Repository navigation
Description
Epic: field-2026-09-28 (downstream non-Node adoption) Tier: judgment Graph: tracker #1203
Problem. Spec is requiresWorktree: false (phase-registry.ts:173-179, phase-executor.ts:1445), so it runs in process.cwd(). #933 AC-4 moved checkSkillsInstalled to the provisioned worktrees (run-orchestrator.ts:1161-1170). It assumed the main checkout was "the one directory guaranteed to have skills". Worktrees are cut from a freshly fetched origin/<base>, so they pass the check. Meanwhile spec runs in a checkout nobody checked.
Field evidence. A downstream main checkout was 21 commits behind origin/master, and its working tree had no .claude/skills/spec/, though the default branch did. The pre-flight passed. The spec agent could not load /spec, wrote a plan by hand from the phase prompt ("Review GitHub issue #N and create an implementation plan…"), and the phase was recorded as success.
Why it passes silently. mapAgentSuccessCore has output guards for qa (needs a verdict) and exec (needs a diff), but none for spec. Nothing checks that the skill loaded.
Options (not prescribed). (a) Check the skills in cwd for every phase with requiresWorktree: false. (b) Run spec in the worktree the batch executor already passes. (c) Warn or fail when the main checkout is not on the base branch or is behind origin/<base>.
AC
- AC-1: A run whose main checkout lacks
.claude/skills/spec/SKILL.mdfails pre-flight before spec starts, naming the missing path. Evidence:npx vitest run src/lib/workflow/skills-preflight.test.ts - AC-2: A spec phase that produced no
SEQUANT_SPECmarker (the one the spec skill emits, parsed byspec-recommendation.ts) is recorded as failed, not success. Evidence:npx vitest run src/lib/workflow/phase-executor.test.ts - AC-3: When the main checkout is behind
origin/<base>, run prints a warning naming the commit count before spec starts. Evidence:npx vitest run src/lib/workflow/run-orchestrator.test.ts
Graph metadata
May touch
src/lib/workflow/run-orchestrator.tssrc/lib/workflow/skills-preflight.tssrc/lib/skills-check.tssrc/lib/workflow/phase-executor.tssrc/lib/workflow/spec-recommendation.ts
File overlap (don't run in the same wave; merge one first):
- fix(qa): parseQaSummary returns null when AC statuses are bold words with no emoji — the SEQUANT_QA_GAPS findings marker is then never read #1194:
src/lib/workflow/phase-executor.ts - fix(adopt): missing-skills remedies contradict each other, and the README plugin path omits the skills that runs need #1201:
src/lib/workflow/run-orchestrator.ts,src/lib/workflow/skills-preflight.ts - feat(logs): run log records each phase's model and the sequant version #1198:
src/lib/workflow/run-orchestrator.ts
Activity
admarble commentedon Sep 29, 2026
Runner context (graph-run, tracker #1203, wave 1) — read before planning. Applies to the spec, exec, and qa phases by name.
mainmoved after this issue was filed: feat(#1135): native review, tech-debt and testing rubrics as skill references; ADR convention; drop TodoWrite #1206 (skill references, TodoWrite dropped), feat(#1135): /release pre-flight runs claude plugin validate; post-tool never hard-blocks; current model aliases #1207 (/releaseplugin validate, post-tool never hard-blocks), fix(#1089): generated MCP configs launch through the inline node -e launcher; update/sync migrate legacy npx entries #1208 (MCP configs launch through the inlinenode -elauncher). Plan against currentorigin/main, not the file state quoted in the body.npm testin exec or in qa. The suite takes 10–13 min and its global setup runsnpm run build; every MCP-dispatched phase has a hard 30-minute wall. Run targeted tests:npx vitest run <changed/related test files>. If a broader run is truly needed: once, foreground, with atimeout, after a WIP commit. Neverrun_in_backgroundorMonitor. The runner runs the full suite before the PR is merged.failedTestin theSEQUANT_MUTATIONmarker must start with the test file path (src/…/x.test.ts > describe > case), or QA §6i floors the AC toAC_NOT_MET. Use a type-preserving mutation (the global setup builds, so a type error aborts every test).admarble commentedon Sep 29, 2026
Complexity: Standard (3 ACs, 2 directories)
AC Quality Check
- AC-1: …with no checkbox.extractAcceptanceCriterianeeds- [ ] **AC-1:** …. As written,/qa§6h/§6i see no ACs and enforce noEvidence:. Fix before exec: rewrite the three lines as- [ ] **AC-N:** …. The normalized form parses as 3 ACs (allunit_test) and is stored in.sequant/state.json.Evidence:commands are vacuous today. Run on base713f4f72, they pass: skills-preflight 27/27, phase-executor 181/181, run-orchestrator 5/5. Each one gates only through the new test case it will contain, so every AC needs aSEQUANT_MUTATIONrecord whosefailedTeststarts with the test file path.Scope Assessment
Non-Goals:⚠️ No
## Non-Goalssection. Proposed: moving spec into the worktree (option b), and changing verify/merger behavior beyond the shared check.src/lib/workflow,src/lib)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: Main checkout missing
.claude/skills/spec/SKILL.mdfails pre-flight, naming the pathVerification: Unit Test (
skills-preflight.test.ts)Scenario: Given worktree isolation is on, the worktrees have every skill, and cwd has no
.claude/skills/spec/SKILL.md→ When the pre-flight runs → Then it returnsok:falsewith a message containing.claude/skills/spec/SKILL.md, and no spec phase starts.Assumptions: Today's
causenames skills (missing skills: spec), not paths. It needs a path list.AC-2: A spec phase with no
SEQUANT_SPECmarker is recorded as failedVerification: Unit Test (⚠️ Real run logs don't store the chat output, so I couldn't confirm the marker shows up in
phase-executor.test.ts,mapAgentSuccessToPhaseResult)Scenario: Given a spec agent result with
success:trueand no marker → When mapped → Thensuccess:false, with an error naming the missing marker.Assumptions:
agentResult.output. Only 3 of the last 20 spec-bearing logs recordedspecRecommendation.sourceat all: 3marker, 1label-fallback. See OQ-1.AC-3: Warn when the main checkout is behind
origin/<base>Verification: Unit Test (
run-orchestrator.test.ts)Scenario: Given the main checkout is N commits behind
origin/<base>and the run includes spec → When run starts → Then a warning naming N prints before spec starts.Implementation Plan
Phase 1: Main-checkout skills check (AC-1)
skills-preflight.ts, have the result carrymissingPaths(.claude/skills/<skill>/SKILL.md) alongsidemissingSkills, and add aphaseFilter/requiresWorktreeselector. The main checkout is checked only for resolved phases withrequiresWorktree: false(spec, verify, merger). Worktrees keep today's full check.run-orchestrator.ts, run the main-checkout check before worktree provisioning (~L1100), so a failure leaves nothing to clean up. Its remedy must differ from the worktree one:git pull/sequant syncin the main checkout, not "commit .claude/skills". If isolation is off, the existing[process.cwd()]path already covers this, so don't check twice.Phase 2: Spec output guard (AC-2)
mapAgentSuccessCore, add aphase === "spec"branch. It fails when no<!-- SEQUANT_SPEC: {…} -->is present, reusingSPEC_MARKER_REGEXexported fromspec-recommendation.tsso there's no second regex. Apply it only to skill-resolving drivers: aider's specpromptTemplatenever asks for a marker, so this guard would fail every aider spec. Pass a flag fromexecutePhase, or add the marker line to the aider template (OQ-2).phase-executor.test.tswhose fixtures lack a marker.Phase 3: Behind-base warning (AC-3)
countCommitsBehind(cwd, baseBranch)fromcheckWorktreeFreshness(worktree-manager.ts:229-300, the merge-base..origin/<base>count).ensureWorktreeshas already fetched, so reuse it rather than adding a second 30s fetch.run-orchestrator.ts, warnmain checkout is N commits behind origin/<base> — spec runs therewhen N>0 and any resolved phase hasrequiresWorktree:false. Skip on--dry-run. Warn only, never fail.docs/reference/run-command.mdanddocs/troubleshooting.md, next to the existing skills pre-flight text.Design Review
skills-preflight.ts, with the orchestrator only wiring it. The output guard goes inmapAgentSuccessCorenext to the qa/exec guards./spec's Worktree Contract (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) plans in the main checkout, and verify/merger sharerequiresWorktree:false, so (b) fixes one of three phases and still leaves the check gap. This plan picks between designs, so the exec PR includes a short ADR indocs/adr/(next NNNN).mapAgentSuccessCoreis sync and has no comment timestamps, and a scan of comments would pass on a stale marker left by an earlier spec. See OQ-1.Feature Quality Planning
extraRetries: 1), which means a full second spec run. The error text should say "skill likely not loaded" so the cause is readable from the run log.Open Questions
agentResult.output. Otherwise fall back to the issue's comments, but accept a marker only from a comment created after the phase started (gh api …/commentswithcreated_at). Impact if wrong: output-only could false-fail specs that posted via a body file and ended on a short summary (fix(sync): plain sync overwrites CUSTOMIZABLE_FILES (constitution) — copyDir ignores force and never consults isCustomizableFile #814). Comments-only accepts stale markers.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Three targeted unit-test ACs in files that already have test suites, so testgen stubs add little. Mutation records are the gating artifact.
Label Review
Current: bug, spec, graph-2026-09-field · Recommended: + planned
admarble commentedon Sep 29, 2026
QA Verdict: NEEDS_VERIFICATION
AC coverage: 3/3 met
Gaps:
admarble commentedon Sep 29, 2026
Runner verification (graph-run #1203, wave 1) — QA verdict was
NEEDS_VERIFICATION; this discharges it against PR #1211 @418cda11.Executed in the worktree:
npx vitest run src/lib/workflow/skills-preflight.test.ts src/lib/workflow/phase-executor.test.ts src/lib/workflow/run-orchestrator.test.ts src/lib/workflow/skills-preflight.integration.test.ts→ 4 files, 225/225 passed.mapAgentSuccessCore(type-preserving) → exactlyphase-executor.test.ts > mapAgentSuccessToPhaseResult > spec phase (#1193) > fails a spec that produced no SEQUANT_SPEC marker…and… > does not accept a marker left by an earlier specfailed (2/186); restored.closingIssuesReferences= [fix(run): spec runs in the main checkout, which the skills pre-flight never checks — a stale checkout silently degrades spec (#933 regression) #1193] only. CI: all checks green excepttest(in progress at time of writing).QA's risk gap (spec self-skip on a re-run emits no fresh marker → guard fails spec): latent today, not live. The self-skip in
spec/SKILL.mdrelies on the bracketed--jq '[.comments[].body]' | grep '"phase"'snippet, which never matches (escaped quotes); run against this issue's comments just now it returned empty, so spec never self-skips and always emits a fresh marker. It becomes live the day that grep is fixed. Surfaced for an owner ruling rather than fixed here: either the skip path emits aSEQUANT_SPECmarker restating the prior plan, or the guard accepts a skip message as success.Also noted: the diff refactors
worktree-manager.ts(newcountCommitsBehind), which is outside this issue's May-touch list and overlaps #1196/#1197/#1199; expect a merge round with #1196.fix(#1193): run checks the main checkout spec runs in; spec without a…
admarble commentedon Sep 29, 2026
Owner ruling on the spec self-skip gap: the skip path emits a marker that restates the prior plan, and the guard stays strict. Filed as #1213 (blocked by this issue). PR #1211 merged as 2a6d58f.