feat(hooks): feature-first .workbench resolver + injection (gated, type-first default)#43
Merged
Merged
Conversation
Phases 0-2 of the feature-first restructure, all gated on paths.layout (default type-first, byte-identical). Fix resolvePlanPath (main-worktree anchor, exact slug match, refuse ambiguity); add layout/schemaVersion/ticketPrefixes config + getMainWorktreeConfig; add identity resolver (extractTicketFromBranch, resolveFeatureId, resolveFeatureRoot, get{Global,Archive}Path) routed through path getters; inject VD_FEATURE/GLOBAL/ARCHIVE_PATH + Feature: line. Tests: resolveplanpath 7, featurefirst 23, contract 2, inject 11; parity 19/19.
computeFeatureId lowercases the slug-only branch for parity with the ticket branch; export cleanSlug so the workbench CLI normalizes user slugs identically to branch resolution (idempotency contract). +mixed-case test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature-first
.workbench/— control-plane side (companion to skills#206).What
hooks/lib/paths.cjs: feature identity resolver —extractTicketFromBranch,computeFeatureId(ticket-dedup, lowercased),resolveFeatureId(memoized, idempotentfeature.jsoncreate),resolveFeatureRoot(gated),getGlobalPath/getArchivePath; path getters routed through it. FixresolvePlanPath(anchor to main worktree, exact slug match, refuse ambiguity).hooks/lib/config.cjs:paths.layoutflag (defaulttype-first),schemaVersion,plan.ticketPrefixes,getMainWorktreeConfig(layout/umbrella read from the main worktree).VD_FEATURE_PATH/VD_GLOBAL_PATH/VD_ARCHIVE_PATH+ aFeature:line — feature-first only.Safety
Every addition is gated on
paths.layout; defaulttype-firstis byte-identical to today (parity 19/19). Reversible (vd hooks rollback).Tests
parity 19/19 · featurefirst 24 · inject 11 · resolveplanpath 7 · contract 2 ·
go build/go test ./...green.