Repository navigation
Description
Summary
/fullsolve tells /exec that a worktree exists, /exec trusts it and skips creation, and nobody ever creates one. Nothing in the chain verifies the path before using it. The result is that skill-driven /fullsolve runs execute in the main checkout, on whatever branch it happens to be on — and where the path does resolve, it can resolve into a different repository's worktree, because ../worktrees/ is one namespace shared by every sibling repo. With one session this is silent — commits land, a PR opens, nothing errors. With two sessions it becomes interleaved checkout / reset / commit in a shared working tree.
Three links, all in the skills:
1. /spec does not create a worktree. .claude/skills/fullsolve/SKILL.md:293 asserts it does:
The `/spec` skill will:
- ...
- Create feature worktree
and Phase 1's post-state (line 336) declares "Feature worktree ready". spec/SKILL.md has three worktree mentions across 397 lines — a frontmatter permission and two git worktree list calls for collision detection. No creation step, in either mirror.
2. /fullsolve exports an unexpanded glob (fullsolve/SKILL.md:366, repeated at 468 and 537):
export SEQUANT_WORKTREE=../worktrees/feature/<issue-number>-*/3. /exec is instructed to trust it without checking (exec/SKILL.md:474):
**If orchestrated (SEQUANT_WORKTREE is set):**
- Use the provided worktree path directly: `cd $SEQUANT_WORKTREE`
- Skip steps 1-2 below (worktree already created by orchestrator)
There is no existence guard anywhere in the chain. The cd fails, creation is skipped by contract, and the agent proceeds in the current directory.
The tell is in the frontmatter: fullsolve/SKILL.md:38 grants Bash(./scripts/new-feature.sh:*). The body never invokes it, in either mirror. The permission was written for a call that was never added.
Evidence
Dogfood, 2026-08-05. Two /fullsolve sessions in ai-devtools-weekly on issues #10 and #23.
git worktree list shows zero sequant worktrees — only the main checkout, sitting on feature/10-distribution-measurement. The reflog is the incident, all in one working tree:
| time (CDT) | reflog entry |
|---|---|
| 12:49:36 | commit: chore(#10): drop stray #23 line committed to this branch by mistake |
| 12:49:53 | checkout: moving from feature/10-distribution-measurement to fix/issue-023-cloud-egress |
| 12:50:25 | commit (cherry-pick): chore(#23): strip unused connectors from the routine |
| 12:58:05 | checkout: moving from fix/issue-023-egress-clean to feature/10-distribution-measurement |
Downstream damage in that session: a git reset clobbered the other session's branch, two commits were pushed onto the other session's PR branch, and an uncommitted RUNBOOK edit was destroyed by the other session's branch operations.
matcha-maps shows the milder form the same day — repeated checkout: moving from main to main from separate sessions, with fix/sentry-auth-token-doc-staleness created directly in the shared tree.
Which path ran: ai-devtools-weekly/.sequant/ contains only an empty locks/ — no state.json, no logs/, no pids/. So sequant locks acquire ran (fullsolve Phase 0.3) and sequant run never did. Positive evidence for the skill path, not an inference from absence.
The CLI path is unaffected. sequant run calls ensureWorktrees → ensureWorktree (src/lib/workflow/worktree-manager.ts:599) before setting SEQUANT_WORKTREE, which is what /exec's skip branch was written against. matcha-maps/.sequant/state.json shows 20 issues with real worktree paths, all from CLI runs.
Second failure mode: the glob can resolve into another repo
../worktrees/ is derived from the parent of the git root (src/lib/workflow/worktree-manager.ts:615, and identically scripts/new-feature.sh:103), so every repo under ~/Projects/ writes into one ~/Projects/worktrees/feature/ tree. new-feature.sh:404 already acknowledges this for the npm cache ("../worktrees/ is shared by every repo (#847)") — the consequence for worktree resolution was never followed through.
Both lookups key on issue number, which is per-repo and collides constantly:
fullsolve/SKILL.md:366—export SEQUANT_WORKTREE=../worktrees/feature/<issue-number>-*/exec/SKILL.md:483— standalone path: "check if../worktrees/contains a directory for this issue"
~/Projects/worktrees/feature/ today, owner resolved via git rev-parse --git-common-dir per entry:
| directory | owning repo |
|---|---|
9-create-solve-sequence-real-terminal-footage-with-p |
sequant-demo-video |
10-create-result-and-cta-sequences-3-30-5-00 |
sequant-demo-video |
35-qa-final-cross-browser-and-mobile-review |
portfolio-2025 |
125-onboarding-flow-ai-program-generation |
workout |
145-sheet-save-load-named-campaigns |
ad-motion |
578-seo-expand-city-coverage-to-20-cities |
matcha-maps |
Five repos, one flat namespace. ai-devtools-weekly was working #9 and #10 on the same day; ../worktrees/feature/9-* and 10-* from that repo glob straight onto sequant-demo-video's directories.
A second reason the path name is not identity: 578-seo-expand-city-coverage-to-20-cities currently holds branch feature/578-city-expansion-clean. Slug and branch have already diverged, so a glob match tells you nothing about which branch you land on.
Creation is not the exposed surface — git worktree add onto an existing foreign path fails loudly. Resolution is. Same class as #881 (parallel-group marker filename was global across projects), fixed there by scoping per project.
Provenance — not a regression
- 2026-01-09 (feat: Worktree isolation and multi-issue integration workflow #31/feat(#31): Worktree isolation and multi-issue integration #35):
/specis created stating "No worktree needed. Planning happens in the main repository directory. The worktree will be created during the execution phase (/exec)." - 2026-01-10 (feat: Add orchestration context awareness to skills #40/feat(#40): Add orchestration context awareness to skills #52):
/execgains theSEQUANT_WORKTREEskip branch. Sound — the only orchestrator wassequant run, which really creates one. - 2026-01-17 (feat: Update /fullsolve to invoke child skills and add --chain to /solve recommendations #111/feat(#111): update /fullsolve to invoke child skills and add --chain to /solve #112):
/fullsolveis wired to child skills. It setsSEQUANT_WORKTREE(satisfying the skip condition) but never creates anything, and claims/specdoes — contradicting spec's own text, seven days old at that point. Both the false claim and the glob export land in this commit. - 2026-04-14 (perf(spec): prompt compression and tiered context — reduce spec skill token cost by ~60% #515): the 68% spec compression deletes the "created during the execution phase (
/exec)" line. No behavior change, but the one sentence that made the contradiction legible is gone.
Worth naming: #625 (2026-05-11) added the per-issue lock to fullsolve Phase 0.3 with the rationale at line 255 — "prevents a second session ... from racing". True for the same issue; for two different issues in one checkout it reads as coverage that isn't there. See #901.
Impact
- Skill-driven
/fullsolvehas never had worktree isolation. Every such run has been executing in the main checkout. - Single-session runs degrade silently — no error, PR still opens — so the defect survived seven months undetected.
- Concurrent sessions corrupt each other's branches, as above. Lost uncommitted work is unrecoverable.
- The pre-tool worktree guard cannot help: with
SEQUANT_WORKTREEunset-or-invalid there is nothing for it to enforce against.
Acceptance Criteria
- AC-1:
/fullsolvecreates the feature worktree itself before Phase 2, via./scripts/new-feature.sh <issue-number>(already granted in its frontmatter), rather than asserting/specdid it. - AC-2: Every
SEQUANT_WORKTREE=export infullsolve/SKILL.mdcarries a resolved absolute path; no*glob appears in any exported value. - AC-3:
/exechalts with a named error whenSEQUANT_WORKTREEis set but is not an existing directory, instead of continuing in the current directory. - AC-4:
/exechalts whenSEQUANT_WORKTREEresolves to a path absent from the current project'sgit worktree list, so a foreign or stale path cannot be adopted. - AC-5:
/exec's standalone lookup resolves throughgit worktree listin the current repository instead of globbing../worktrees/feature/<issue-number>-*. - AC-6: Lookup selects on the branch reported by
git worktree list, not on the directory slug, so a directory whose name has diverged from its branch cannot be mis-selected. - AC-7:
/fullsolveno longer claims/speccreates the worktree, and its Phase 1 post-state describes what actually happens. - AC-8:
/specstates its worktree contract explicitly — planning runs in the main repo, the worktree is created by the orchestrator or/exec— restoring the line dropped by perf(spec): prompt compression and tiered context — reduce spec skill token cost by ~60% #515. - AC-9: Both skill mirrors (
.claude/skills/,templates/skills/) carry identical changes. - AC-10: A regression test asserts the absence of a globbed
SEQUANT_WORKTREEexport in fullsolve and the presence of the existence guard in exec, scoped to the delimited region rather than the whole file, with a recorded mutation result per CLAUDE.md. - AC-11: A regression test creates a foreign worktree directory matching the issue-number glob and asserts the lookup does not select it, with a recorded mutation result per CLAUDE.md.
Non-Goals
- Not changing the
sequant runCLI worktree path, which is correct. - Not changing
SEQUANT_WORKTREEprecedence — it stays authoritative when set and valid. - Not relaying out
../worktrees/into per-project subdirectories. That would strand every existing worktree on disk and is not required: scoping resolution to the current repo closes the failure mode. - Not adding checkout-scoped locking (feat(locks): per-issue locks give no mutual exclusion on the shared working tree — checkout-scoped protection #901).
- Absorbs bug(worktree): ../worktrees/ is one namespace shared by every sibling repo, and lookup globs on issue number alone #900, closed as consolidated — same two files, same mirrors, same PR.
Activity
[-]bug(fullsolve/exec): /fullsolve never creates the worktree it exports, so skill-driven runs execute in the main checkout[/-][+]bug(fullsolve/exec): the worktree is never created and never verified — skill-driven runs execute in the main checkout, or in another repo's worktree[/+]admarble commentedon Aug 6, 2026
Plan (/spec) — #899
Complexity: Complex (11 ACs, 3 directories)
AC Quality Check
All 11 ACs pass the linter — no vague, unmeasurable, incomplete, or open-ended patterns; no title/body tension. Behavior-rule detection ran on every AC: no triggers, so no Rule Touchpoints section.
Two corrections to the issue text, surfaced rather than silently absorbed:
.claude/skills/(canonical),templates/skills/, andskills/(the published plugin).scripts/check-skill-sync.tsenforces all three. I will sync all three vianpm run sync:skills; AC-9 is satisfied a fortiori.Scope Assessment
Non-Goals: present (5 items) — CLI
runpath untouched,SEQUANT_WORKTREEprecedence unchanged, no re-layout of../worktrees/, no checkout-scoped locking (#901).test/other)src/,skills/, tests)Verdict: ❌ SCOPE_SPLIT_RECOMMENDED — recommend overriding; do not split.
The split signal is an artifact: the "2 features" clustering keys on the word test in AC-10/AC-11, which are the regression tests for this same fix, not a second feature. All 11 ACs land in two skills plus their mirrors and one new resolver. The issue already consolidated #900 into it on exactly this reasoning ("same two files, same mirrors, same PR"). Splitting would ship a guard without its creation step, or vice versa — a worse intermediate state than either end.
Design Decision: one repo-scoped resolver, not six inline snippets
AC-3 through AC-6 all reduce to one question: given this repo and this issue, which worktree? Three ways to answer it:
templates/scripts/*.shscripts/dev/, notscripts/— path breakssequant worktreeCLI subcommandChosen: a
worktreeCLI subcommand group, following the existingsequant lockspattern (src/commands/locks.ts+ abin/cli.tscommand group). It reuseslistWorktrees()(src/lib/workflow/worktree-manager.ts:367), which already parsesgit worktree list --porcelainand derives the issue number from the branch — precisely AC-6 — and whichready.ts:136already uses for this same lookup.git worktree listonly ever reports the current repo's worktrees, so AC-4/AC-5 scoping is structural, not a filter that can be forgotten. It also avoids the TS↔shell mirror drift class documented in #871.Known limitation, stated up front:
listWorktrees()extracts the issue fromfeature/<N>-…only.new-feature.shalways produces that shape, so sequant-created worktrees always resolve. A hand-madefix/issue-023-…branch will not — and that failure is a halt (WORKTREE_NOT_FOUND), never a silent adoption, so it fails safe. Broadening the regex would changeready.tssemantics and is out of scope.Acceptance Criteria
AC-1:
/fullsolvecreates the worktree itself before Phase 2Verification: Integration Test (skill-content gate)
Scenario: Given
fullsolve/SKILL.md→ When the Phase 1.5 region is read → Then it invokes./scripts/new-feature.sh <issue-number>(grant already in frontmatter line 38)Assumptions:
new-feature.shis idempotent — it exits 0 with "Worktree already exists" (line 132), so re-running on resume is safe.AC-2: No globbed
SEQUANT_WORKTREEexportVerification: Integration Test (gate, scoped to the export regions)
Scenario: Given the three
export SEQUANT_WORKTREE=sites (lines 366, 468, 537) → When each is read → Then the value is"$SEQUANT_WORKTREE"captured fromsequant worktree resolve, containing no*AC-3:
/exechalts on a non-existentSEQUANT_WORKTREEVerification: Integration Test (CLI) + skill-content gate
Scenario: Given
SEQUANT_WORKTREE=/no/such/dir→ Whensequant worktree verifyruns → Then exit 1 with named errorSEQUANT_WORKTREE_NOT_FOUND, andexec/SKILL.md:474instructs halting rather thancd-and-continueAC-4:
/exechalts on a foreign or stale pathVerification: Integration Test
Scenario: Given a real directory that is a worktree of a different repo → When
verifyruns in this repo → Then exit 1 withSEQUANT_WORKTREE_FOREIGN(realpath-compared against this repo'sgit worktree list)AC-5: standalone lookup resolves through
git worktree listVerification: Integration Test + gate
Scenario: Given standalone
/exec→ When it looks up the worktree → Then it callssequant worktree resolve <issue>; the string../worktrees/feature/<issue-number>-*no longer appears in the lookup regionAC-6: selection keys on branch, not directory slug
Verification: Integration Test
Scenario: Given a worktree at
…/899-old-slugwhose branch isfeature/899-renamed→ Whenresolve 899runs → Then it returns that path via the branch; and given a directory named899-foothat is not a worktree, it is never returnedAC-7:
/fullsolvestops claiming/speccreates the worktreeVerification: Integration Test (gate)
Scenario: Given
fullsolve/SKILL.md→ When the Phase 1 description (line 293) and post-state (line 336) are read → Then neither attributes worktree creation to/specAC-8:
/specstates its worktree contractVerification: Integration Test (gate)
Scenario: Given
spec/SKILL.md→ When read → Then it states planning runs in the main repo and the worktree is created by the orchestrator or/exec(restores the line dropped by #515)AC-9: all mirrors identical
Verification: Integration Test —
npm run lint:skill-sync(scripts/check-skill-sync.ts) exits 0 across all three rootsAC-10: regression test for the skill text
Verification: Integration Test, mutation-verified
Scenario: Asserts (a) no
*in anySEQUANT_WORKTREE=export in fullsolve, (b) the existence guard is present in exec — each scoped to its delimited region, per CLAUDE.md. Mutation: reintroduce the glob / delete the guard → confirm exactly that test fails → restore → record in the PR body.AC-11: regression test for foreign-worktree rejection
Verification: Integration Test, mutation-verified
Scenario: Given two real temp git repos, repo B has a worktree whose directory name matches repo A's issue-number glob → When
resolveruns in repo A → Then repo B's path is not returned. Mutation: swap the lookup back to a filesystem glob → confirm this test fails → restore → record.Implementation Plan
Phase 1 — Resolver (
src/,bin/)src/commands/worktree.tswith two actions, modelled onsrc/commands/locks.ts:sequant worktree resolve <issue> [--json]—listWorktrees()filtered onw.issue === issue. Exactly one match → print the absolute path on stdout and nothing else (clean$(…)capture). Zero → exit 1,WORKTREE_NOT_FOUND. More than one → exit 1,WORKTREE_AMBIGUOUSwith candidates, so an ambiguous state is never silently resolved.sequant worktree verify <path> [--issue <n>] [--json]— exit 1 withSEQUANT_WORKTREE_NOT_FOUND(missing / not a directory),SEQUANT_WORKTREE_FOREIGN(realpath absent from this repo'sgit worktree list), orSEQUANT_WORKTREE_ISSUE_MISMATCH(branch's issue ≠--issue).worktreecommand group intobin/cli.tsnext tolocks(~line 724).Phase 2 — Skills (canonical
.claude/skills/only)fullsolve/SKILL.md: new Phase 1.5 — Create the feature worktree running./scripts/new-feature.sh <issue>then capturingSEQUANT_WORKTREE="$(sequant worktree resolve <issue>)", halting if resolve fails (AC-1). Replace all three glob exports with the captured absolute path (AC-2). Drop "Create feature worktree" from the/specbullet list and rewrite the Phase 1 post-state (AC-7). Also correct the stale "already done by/spec" line at 370.exec/SKILL.md: orchestrated branch (line 474) gains a mandatorysequant worktree verify "$SEQUANT_WORKTREE" --issue <n>gate that halts on failure instead of continuing in the current directory (AC-3, AC-4). Standalone lookup (line 482) replaces the../worktrees/glob withsequant worktree resolve(AC-5, AC-6). AddBash(npx sequant worktree:*)to frontmatter.spec/SKILL.md: add the explicit worktree contract (AC-8).Phase 3 — Mirrors and tests
npm run sync:skills→ propagate totemplates/skills/andskills/;npm run lint:skill-syncto confirm (AC-9).src/commands/__tests__/worktree-resolve.integration.test.ts— real temp git repos, foreign-worktree and slug-divergence cases (AC-11, AC-6, AC-3, AC-4). Note: filename carries.integration.so it lands in the integration project, not the 5s-timeoutunitproject (fix(test): tsx-spawning integration tests blow vitest's 5s default — phase-registry should use the prebuilt dist like its five siblings #842).__tests__/integration/worktree-contract-skill.integration.test.ts— region-scoped skill-text gates (AC-10, AC-2, AC-7, AC-8), asserting across all three mirror roots.Design Review
locks.listWorktrees()rather than writing a new porcelain parser. Rejected: inline bash (untestable, six copies) and a newtemplates/scripts/*.sh(lands atscripts/dev/in consumer projects, so the documented path is wrong there).sequant locks— a small command group backed by a lib module, called from skill bodies.ready.ts:136already does this exactlistWorktrees().find(w => w.issue === n)lookup; this promotes it to a shared verb.../worktrees/is one flat namespace across five repos today. Resolution scoping, not path shape, is the actual defect.Feature Quality Planning
All standard checks pass. Notable items:
/fullsolvecan re-enter Phase 1.5 after a context restore.new-feature.shalready exits 0 when the worktree exists, andresolveis read-only, so re-entry is safe. Covered by test 7.sequant, which consumer projects have; it does not depend onscripts/layout.Open Questions
listWorktrees()'sfeature/(\d+)-regex to also matchfix/? — Recommendation: no, this pass. It would changeready.tsselection semantics for a casenew-feature.shnever produces, and the unmatched case already fails safe (halt, not mis-adopt). Impact if wrong: a hand-named branch's worktree needsSEQUANT_WORKTREEset explicitly. Worth a follow-up issue if it bites.verifyalso warn whenSEQUANT_WORKTREEis set but the shell is elsewhere? — Recommendation: out of scope; the pre-tool hook owns boundary enforcement once the path is valid.Recommended Workflow
Phases: spec → exec → qa
Quality Loop: enabled
Reasoning: No UI surface, so no
/test. Testgen skipped —buglabel only, and AC-10/AC-11 already specify the tests concretely. Quality loop on: 11 ACs across a CLI addition plus three skill mirrors, with two mutation-verified gates to confirm.Label Review
Current:
bugRecommended:
bug,no-browser-testReason: No UI surface; the explicit opt-out keeps
/testfrom being inferred on later re-runs.admarble commentedon Aug 6, 2026
QA Review for Issue #899
PR: #902 · Reviewed at:
e0731316AC Coverage
/fullsolvecreates the worktree via./scripts/new-feature.shworktree-creation (#899). Literal check: invokes./scripts/new-feature.sh <issue-number>, the exact command the AC names, and the grant at frontmatter line 38 is now actually used. Idempotence verified atnew-feature.sh:132—exit 0on "Worktree already exists".*in any exportedSEQUANT_WORKTREEvaluegrep -rn "export SEQUANT_WORKTREE=" … | grep '\*'across all three mirrors → no matches. All 4 export sites carry"$SEQUANT_WORKTREE". The two surviving../worktrees/feature/<issue>-*strings are inside "Never substitute a glob" / "Do not glob" prohibitions — prose, not exported values./exechalts on a non-existent pathSEQUANT_WORKTREE_NOT_FOUND. Executed:worktree verify /no/such/dir→ exit 1. Also rejects an unexpanded glob as a path. The skill region halts withexit 1rather than falling through tocd./exechalts on a foreign or stale pathSEQUANT_WORKTREE_FOREIGN. Executed against the shippeddist/artifact:worktree verify /Users/tony/Projects --issue 899→ exit 1 with the named error. Test proves the harder case — a real worktree of another repo is rejected from repo A and accepted from repo B.git worktree listworktree-standalone-lookup (#899)callssequant worktree resolve. The old "check if../worktrees/contains a directory for this issue" directive is gone; the only remaining mention is the prohibition.listWorktrees()derives the issue frombranch refs/heads/…. Test fixture is deliberately adversarial: directory810-original-slugholding branchfeature/810-renamed-after-the-factresolves correctly, and a directory named900-not-a-worktreethat is not a worktree is never returned./speccreates the worktree- Create feature worktreebullet is gone; Phase 1 post-state now reads "Still in the main repository — no worktree exists yet". Also caught the stale companion claim at the orchestration table ("already done by/spec") and the workflow diagram./specstates its worktree contractspec-worktree-contract (#899). Restores the "Planning happens in the main repository directory" line #515 dropped, and names both creators (orchestrator or/exec).npm run lint:skill-sync→ 44 synced, 0 diverged, 0 missing. Note: the AC says "Both skill mirrors" — there are three.skills/(the published plugin) sits alongside.claude/skills/andtemplates/skills/, andscripts/check-skill-sync.tsenforces all three. All three updated; AC satisfied a fortiori.__tests__/integration/worktree-contract-skill.integration.test.ts, 24 tests (8 × 3 roots). Mutation results below.src/lib/workflow/worktree-resolver.integration.test.ts, 11 tests over two real temp git repos. Mutation results below.Coverage: 11/11 AC items fully met
Derived ACs: none — the
/specplan produced no Derived ACs tableQuality Plan Verification
Quality Plan Status: Complete
The plan's three named concerns all hold up: re-entry is safe (
new-feature.shis idempotent andresolveis read-only); every new failure mode halts rather than degrading; and the resolver is reached viasequant, not ascripts/path that differs in consumer projects.Precheck Findings
Precheck Findings: unavailable — inline fallback used.
CI Status
typecheckbuild (22.x)validate-skillsvalidate-pluginPlugin Structure ValidationHooks Validationnode-floor-guardSetup Directory CreationCI Summary: 8 passed, 0 pending, 0 failed
CI-related AC items: none of the 11 ACs is CI-gated
Quality Metrics
any)The +1154 overstates the change: the three skill mirrors are byte-identical copies, so ~450 of those lines are the same content written three times.
Size Gate
Diff is 1154 lines — well over the 100-line threshold, so
SMALL_DIFF=falseand the standard pipeline applies. Code review was performed inline rather than via sub-agents: the substantive diff is ~400 unique lines (the mirrors triple it), and delegating worktree-resident review is the known-hallucination path.Build Verification
N/A — build passed (
npm run build,tscclean).Test Coverage Analysis
src/lib/workflow/worktree-resolver.tsworktree-resolver.integration.test.ts(11)src/lib/workflow/worktree-manager.tsrun.test.ts+ the new resolver suite exerciseslistWorktrees(cwd)src/commands/worktree.tsdist/artifact — see Execution Evidence.bin/cli.ts--helpoutput verified;validate-plugin+typecheckgreenSKILL.mdworktree-contract-skill.integration.test.ts(24, across all 3 roots)Coverage: 4/5 changed source files have direct tests; the fifth is a wrapper whose logic is covered and whose surface is smoke-tested.
Critical paths without tests: none — no auth/payment/security/middleware paths touched.
Code Review
Strengths:
git worktree listmakes repo-scoping structural — there is no filter to forget.listWorktrees()rather than writing a second porcelain parser.ready.ts:136already performed this exactfind(w => w.issue === n)lookup; this promotes it instead of duplicating it. Avoids the TS↔shell mirror-drift class (PM_CONFIG.yarn.ciInstall uses Yarn 2+--immutable, which Yarn 1 rejects — no berry detection exists #871) that six inline bash copies would have created.WORKTREE_AMBIGUOUSis a nice catch — two worktrees claiming one issue is resolvable-looking but not safely resolvable, and it errors instead of picking one.region()throws when a marker is absent, so deleting the markers fails loudly rather than degrading the assertion to a match on"".Issues:
Suggestions:
canonicalize()recurses on the parent path for not-yet-existing paths. Correct, and bounded by the filesystem root — but it duplicates intent with the symlink-resolution fix in 7a0d9e7. Worth consolidating if a third caller appears.Test Quality Review
git init+git worktree addin a temp sandbox — correct, since the entire claim is about whatgit worktree listreportsuser.email,commit.gpgsign=false) avoids the recurring gpg-signing breakage classThe suite's
afterAllcarries an explicit comment pinningsandboxas assign-once so a future mutation pass cannot redirect itsrmSync— a direct guard against the destructive-mutation incident in #883.Anti-Pattern Detection
Dependency Audit: N/A —
package.jsonunchanged.Code Patterns: no findings. No
await-in-loop, no empty catch, no hardcoded secrets, no SQL concatenation, no uncleared timers. The two barecatch {}blocks incanonicalize()are intentional control flow (probe-and-fall-back on a path that may not exist), not swallowed errors.Critical Issues: 0 · Warnings: 0
Call-Site Review
New exported functions detected: 5
resolveIssueWorktree()src/commands/worktree.ts:50verifyWorktreePath()src/commands/worktree.ts:103--issueoptionalworktreeResolveCommand()bin/cli.ts:804.action()worktreeVerifyCommand()bin/cli.ts:813.action()listWorktrees(cwd?)ready.ts:136,ready.ts:226, resolver ×2Findings: No dead exports. The
listWorktreessignature change is the one back-compat risk, and it is safe:cwdis optional and both pre-existingready.tscallers pass nothing, preserving theprocess.cwd()default.ready.test.tsmocks it withvi.fn(), which is indifferent to arity. Confirmed green in the full suite.Execution Evidence
node dist/bin/cli.js worktree resolve 899$(…)captureworktree resolve 12345WORKTREE_NOT_FOUND+ remediationworktree verify /no/such/dirSEQUANT_WORKTREE_NOT_FOUNDworktree verify '../worktrees/feature/899-*/'SEQUANT_WORKTREE_NOT_FOUND: unexpanded globnode dist/bin/cli.js worktree verify /Users/tony/Projects --issue 899SEQUANT_WORKTREE_FOREIGNworktree verify "$(pwd)" --issue 899✓ <path> (feature/899-…)worktree verify "$(pwd)" --issue 42SEQUANT_WORKTREE_ISSUE_MISMATCHworktree --helpEvidence status: Complete — run against the built
dist/artifact this PR ships, not only viatsx.Script Verification (§11)
Not Required — no files under
scripts/ortemplates/scripts/were modified.scripts/new-feature.shis invoked by the new skill text but is unchanged.Skill Command Verification
Skill files changed: 9 (3 skills × 3 mirrors)
fullsolve/SKILL.mdexec/SKILL.mdspec/SKILL.mdCommands Verified:
./scripts/new-feature.sh 899→ ✅ executed; created the worktree this PR was built innpx sequant worktree resolve 899→ ✅ exit 0, printed the absolute pathnpx sequant worktree verify "$PATH" --issue 899→ ✅ exit 0 valid / exit 1 with each named errornpx sequant locks release <issue>→ ✅ subcommand exists (pre-existing, unchanged)Commands with Issues: none.
One honest observation on invocation form: the bare global binary (
/opt/homebrew/bin/sequant→ the main repo'sdist/) currently answerserror: unknown command 'worktree', because main has not been rebuilt with this PR.npx sequant worktree …— the form the skills actually use — resolves correctly and exits 0. This is a dev-environment artifact of reviewing pre-merge, not a product defect: skills and the CLI ship in the same npm package, so any project that has the new skill text necessarily has the new CLI. Worth knowing when testing this branch locally.Verification Status: Passed
Detection Pattern Verification
Omitted — precondition false. The added lines in the changed skill markdown introduce no
grep/awk/jq/sedcommand and no regex literal; the diff-hunk gate returned empty.CLI Registration Verification
Option files modified:
bin/cli.ts(new command group).RunOptionsuntouched.WorktreeResolveOptions.jsonoptions.json(worktree.ts:53)--jsononworktree resolveWorktreeVerifyOptions.issueoptions.issue(worktree.ts:96)--issue <issue>onworktree verifyWorktreeVerifyOptions.jsonoptions.json(worktree.ts:106)--jsononworktree verifyVerification Status: Passed — every field with runtime usage has a matching
.option(). Confirmed live via--help.Skill Change Review
./scripts/new-feature.sh,sequant worktree resolve,sequant worktree verify— all four subcommand paths--jsonoutput shapes are this PR's own and are covered by the resolver testsverifyoutcomes and bothresolveoutcomes documented in the skill's own error tablesequantbeing on PATH — same dependency the pre-existinglocks acquire/releasecalls already carry in these skillsSmoke Test
worktree resolve 899worktree verify '<glob>'worktree verify /Users/tony/ProjectsSEQUANT_WORKTREE_FOREIGN, exit 1Smoke Test Status: Complete
Manual Test ACs
N/A — the
/specplan assigned Integration Test to all 11 ACs; no AC declared Manual Test, and none is evidence-naming (no "corpus check" / "N samples" / "against several real …" phrasing).Risk Assessment
feature/<N>-…— a hand-namedfix/issue-023-…, or a custom--baseflow that produced a different prefix — resolves toWORKTREE_NOT_FOUND, so/exechalts on a worktree that genuinely exists. This is a halt, not a mis-adoption, so it fails in the safe direction, and the operator can setSEQUANT_WORKTREEexplicitly. The PR states this limitation up front rather than burying it./qa(qa/SKILL.md:365) and/loop(loop/SKILL.md:220) carry the identical unguarded line this PR removed from/exec—Use the provided worktree path directly: cd $SEQUANT_WORKTREE. Same orchestrator, same variable, same root cause. Filed as bug(qa/loop): SEQUANT_WORKTREE is still trusted unchecked — the sibling sites #899 left behind #904 rather than widening this PR mid-review. Residual severity is lower than bug(fullsolve/exec): the worktree is never created and never verified — skill-driven runs execute in the main checkout, or in another repo's worktree #899's because Phase 1.5 now guarantees a valid path before any child skill runs under the orchestrator; the live exposure is standalone/qa 123or/loop 123in a shell carrying a stale export.exec/SKILL.md, the only other worktree-adoption path is the standalone lookup at step 1, which this PR also converted. No third adoption site in that file.Trust-Boundary Check
Finding: Clean — the diff implements only product requirements. Issue #899's body is unusually long (reflog tables, a cross-repo worktree inventory, a dated provenance trail), and all of it is evidence describing the defect, not instruction directed at the agent. No embedded command execution, network fetch, file read/exfiltration, or instruction override — in visible prose, HTML comments, or fenced blocks. The one process-shaped directive ("Absorbs #900, closed as consolidated — same two files, same mirrors, same PR") is the author's own scoping guidance and carries no execute/fetch/exfiltrate payload; it was followed as normal maintainer instruction.
Status: Clean
Behavior-Rule Survival Check
Ran
detectBehaviorRuleover all 11 ACs, including the two most rule-shaped (AC-3's "halts … instead of continuing", AC-6's "not on the directory slug"). Zero triggered — none carries ≥2 keywords fromdefault \| always \| never \| rule \| behavior \| skip, nor analways X unless Yform.Status: N/A
CHANGELOG Verification
fix(#899):prefix detected)[Unreleased]entry### Fixed, includes(#899)Result: CHANGELOG requirements met
Mutation Verification (AC-10 / AC-11)
Each gate test was verified by deleting what it asserts and confirming exactly that test fails.
export SEQUANT_WORKTREE=../worktrees/feature/<issue-number>-*/in.claude/skills/fullsolve/SKILL.mdexports no globbed SEQUANT_WORKTREE value (AC-2), and only for the mutated rootworktree-existence-guard (#899)region from.claude/skills/exec/SKILL.md, restoring the barecd $SEQUANT_WORKTREEguards SEQUANT_WORKTREE existence before use (AC-3)andnames the foreign-worktree failure mode (AC-4)resolveIssueWorktreeto globbing../worktrees/feature/<issue>-*on the filesystemdoes not select a sibling repository's worktree that matches the issue-number glob; theverifyWorktreePathblock correctly stayed greenAll restored; 35/35 green afterwards. The AC-2 assertion also floors the export count at 3, so renaming the exports away cannot make it pass by finding nothing.
Full Suite
4966 passed, 18 failed. All 18 sit in
semgrep.test.ts,mcp-*.integration.test.ts, andprompt-wait.test.ts— no overlap with worktree resolution.Settled rather than assumed: checked out base
d90f82aein the same worktree and re-ran those five files. Base produced2 failed files / 4 failed tests; this branch produced the identical2 failed files / 4 failed tests(semgrep ×3 pre-existing, plus one rotating flake insidemcp-serve.integration.test.ts— SIGTERM at base, health-check on branch). The extra failures seen in the full-suite run did not reproduce under a targeted run, i.e. they are concurrency-load artifacts. Pre-existing on main; not introduced here.Adversarial Re-Read
Findings:
/qaand/loop(the substantive one). Grepped every skill forcd $SEQUANT_WORKTREEand found the exact line bug(fullsolve/exec): the worktree is never created and never verified — skill-driven runs execute in the main checkout, or in another repo's worktree #899 removed from/execstill live atqa/SKILL.md:365andloop/SKILL.md:220. Both receiveSEQUANT_WORKTREEfrom the same orchestrator. Filed as bug(qa/loop): SEQUANT_WORKTREE is still trusted unchecked — the sibling sites #899 left behind #904.worktrees/layout is reconstructed literally in the test sandbox, and the real-world slug/branch divergence it cites (578-seo-expand-city-coverageholdingfeature/578-city-expansion-clean) is reproduced as the AC-6 case.dist/artifact after the fix, and each mutation result is a post-fix demonstration that the test detects the regression.origin/main; no stashes; no uncommitted residue from the three mutation passes (git status --shortempty after each restore).SEQUANT_WORKTREEprecedence — it stays authoritative when set and valid." It does: a valid value is used unchanged; only an invalid one now halts instead of being silently ignored, which is the AC's own requirement rather than a precedence change.sequant run'sensureWorktreepath is untouched, and../worktrees/was not re-laid-out.Status: Gaps Found — finding (1) is a real cross-file sibling that maps to follow-up #904, not to a missing AC fixture.
Verdict: AC_MET_BUT_NOT_A_PLUS
All 11 acceptance criteria are MET, each verified literally against its text rather than its intent, and both mutation-verified gates behave correctly under deletion. CI is fully green (8/8). The design is the right one: it fixes resolution rather than path shape, which is what actually closes the cross-repo failure mode, and it does so in one tested CLI verb instead of six copies of inline bash across the mirrors.
The verdict is gated below
READY_FOR_MERGEby the adversarial re-read (§6d, Gaps Found), for one reason:/qaand/loopstill carry the identical unguardedcd $SEQUANT_WORKTREEthat this PR removed from/exec. That is out of scope for #899's ACs — they name/execonly — and correctly left to #904 rather than widening the PR mid-review. But it means the class of defect is not fully closed at the end of this PR, and the review should say so rather than round up.Per the break-don't-loop rule,
AC_MET_BUT_NOT_A_PLUSis a break to PR, not a/looptrigger. PR #902 is ready for human review and merge; #904 tracks the remainder.Documentation
### Fixed,[Unreleased], includes(#899))exec/SKILL.mdbeside the guarddocs/change needed;sequant worktreeis an internal verb for skill bodies, not a user-facing workflow commandNext Steps
sequantpicks up theworktreecommand./qaand/loop.fix(#904): close the unverified-worktree defect in every skill, not j…
admarble commentedon Aug 6, 2026
QA Re-Review for Issue #899 — after gap closure
PR: #902 · Reviewed at:
90a84f53b8e33835f2bbec8461e2c2bb2e7954bb· Supersedes the prior verdict ofAC_MET_BUT_NOT_A_PLUSThe prior review's single gating finding was the cross-file sibling sites (§5 / §6d "Gaps Found"), filed as #904. That gap is now closed in this PR, and the sweep found more than #904 named.
What changed since the last review
/qa,/loopcd $SEQUANT_WORKTREE/qa,/loop,/testgen../worktrees/feature/<issue>-*worktree resolve/merger×2grep "feature/$ISSUE"thenworktree remove --forceworktree resolve/qaPhase 0grep -igating the implementation probeworktree resolve/assessworktree resolveTwo of these were more severe than #904 described:
/merger's force-remove (a slug collision destroys an unrelated issue's worktree —ISSUE=89matchesfeature/899-…) and/testgen's glob (it writes stubs into whatever tree it lands in).Sibling-site scan — now clean
The prior review's §5 finding is resolved. Re-ran the sweep: no skill in any mirror carries an unguarded
cd $SEQUANT_WORKTREE, and no skill globs../worktrees/or grepsgit worktree listfor an issue number. This is no longer asserted by inspection — two completeness invariants enforce it across every skill, so a future skill reintroducing either pattern fails the build. Pinning the six known sites would not have held; the pattern reached six skills by being copied.Additional mutation results
/qa's guard region/docs, a skill in no pinned listdocs:; this is the case pinning could never catch/merger's grepmerger:All restored; 62/62 green.
Verification
lint/lint:skill-sync/lint:skill-calls/lint:skill-gatesOn the full suite: it is now completely green. The 18 failures in the prior review (semgrep, MCP, prompt-relay) did not recur — consistent with the base-commit comparison that showed base and branch failing identically, i.e. concurrency-load flakes rather than regressions.
One CI note, for the record:
validate-skillsfirst reported FAILURE on this commit. Reading the log rather than trusting the status: the job died in Set up job withFailed to resolve action download info. Error: Service Unavailable— GitHub infrastructure.validate:skillsnever executed. It passes locally (19/19 skills valid) and passed on re-run. Not a code defect.AC Coverage
Unchanged: 11/11 MET. The gap fixes touch no #899 AC — they extend the same fix to skills outside its scope. The AC-10 gate test grew from 24 to 51 assertions and all pre-existing ones still pass.
Trust-Boundary Check
Finding: Clean — no agent-directed instruction from external text was acted on.
Status: Clean
Adversarial Re-Read
Findings: The prior review's one finding is closed, and closing it surfaced three sites that review had missed (
/testgen,/merger×2,/qaPhase 0) plus one false positive worth recording:/assess'sgrep "^worktree"looks like the same pattern but enumerates every worktree and keys on nothing, so it is correct code and is deliberately exempted. Re-swept for further siblings after the fix — none remain, and the invariants now hold that line mechanically rather than by inspection. Process state clean (working tree empty after all six mutations, branch 0 behind origin/main). Non-Goals still honoured.Status: Clean
Verdict: READY_FOR_MERGE
All 11 ACs met, the sibling-site gap that gated the prior verdict is closed, the full suite and CI are green, and six mutations confirm the gates detect what they claim. The completeness invariants make this stronger than the ACs asked for: the defect class is now closed against future reintroduction, not just at the six sites where it existed.
#904 is absorbed and closed.
Merge origin/main (#899, #904) into feature/901
feat(#1136): explicit in-place checkout mode for exec, qa, loop and t…