Repository navigation
fix(#1193): run checks the main checkout spec runs in; spec without a SEQUANT_SPEC marker fails - #1211
Merged
admarble merged 1 commit intoSep 29, 2026
Conversation
… SEQUANT_SPEC marker fails The skills pre-flight also checks the main checkout for the phases that run there (requiresWorktree: false), before any worktree is provisioned, naming the missing .claude/skills/<skill>/SKILL.md. The run warns when the main checkout is behind origin/<base>. mapAgentSuccessCore fails a spec that produced no SEQUANT_SPEC marker in its output or in an issue comment posted during the phase; drivers that do not resolve skills are exempt. ADR-0002 records why spec stays in the main checkout. Entire-Checkpoint: 69e643afcee5
This was referenced Sep 29, 2026
admarble
deleted the
feature/1193-fix-run-spec-runs-in-the-main-checkout-which-the-s
branch
September 29, 2026 02:50
This was referenced Sep 29, 2026
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.
Summary
Spec is
requiresWorktree: false, so it runs in the main checkout. Since #933 the skills pre-flight has checked only the worktrees, so a main checkout behindorigin/<base>and missing.claude/skills/spec/SKILL.mdpassed. Spec then planned without its skill and was recorded as success. This PR adds options (a) and (c) from the issue. ADR-0002 records why (b), running spec in the worktree, was rejected.runSkillsPreflighttakesscope: "main-checkout", which checks only the resolved phases withrequiresWorktree: false(spec, verify, merger). The result now carriesmissingPaths. The orchestrator runs this check againstprocess.cwd()before provisioning, so a failure leaves no worktree to clean up. The remedy isgit pull/sequant syncin the main checkout, not "commit .claude/skills". With isolation off, the existing per-cwd check already covers the main checkout, so it isn't checked twice.mapAgentSuccessCorefails aspecphase that produced noSEQUANT_SPECmarker, parsed withparseSpecMarkerso no second regex is added. It checks the agent output first. If the output has no marker, it checks issue comments created during the phase (60 s clock-skew allowance), so a plan posted through a body file (fix(sync): plain sync overwrites CUSTOMIZABLE_FILES (constitution) — copyDir ignores force and never consults isCustomizableFile #814) passes and a marker left by an earlier spec does not (OQ-1). Drivers withresolvesSkills: false(aider) are exempt (OQ-2). The error names.claude/skills/spec/SKILL.mdand the checkout.countCommitsBehind(cwd, base)is a non-fetching helper extracted fromcheckWorktreeFreshness, which now calls it. After provisioning, which has already fetched, the run prints⚠ main checkout is N commits behind origin/<base> — spec runs therebefore any phase. It is a warning only and is skipped on--dry-run.docs/reference/run-command.md(Phase Isolation),docs/troubleshooting.md, ADR-0002, CHANGELOG.Pre-PR AC Verification
.claude/skills/spec/SKILL.mdfails pre-flight before spec, naming the pathrun-orchestrator.tsmain-checkout block;skills-preflight.tsscope/missingPaths; test1193 AC-1: …SEQUANT_SPECmarker recorded as failedphase-executor.tsspecProducedMarker+ spec branch inmapAgentSuccessCore;spec phase (#1193)testsorigin/<base>run-orchestrator.tsfreshness block;worktree-manager.tscountCommitsBehind;#1193describe inrun-orchestrator.test.tsMutation records
Mutation-verified: AC-1 — made the main-checkout pre-flight unreachable;
1193 AC-1failed (along with933 AC-2and the #813 integration test, which also assert the new check); restored.Mutation-verified: AC-2 — flipped the spec guard's default off;
fails a spec that produced no SEQUANT_SPEC marker…failed (anddoes not accept a marker left by an earlier spec); restored.Mutation-verified: AC-3 — raised the behind-count threshold from 0 to 99;
prints a warning naming the commit count before spec startsfailed (only that test); restored.Existing tests changed
skills-preflight.integration.test.ts: a run with no skills now stops beforeensureWorktrees, because the main checkout lacks the spec skill. The test now asserts zero provisioning calls and that the abort names the path.skills-preflight.test.ts933 AC-2: the main checkout is now checked once, scoped tomain-checkout. The full phase set is still checked only in the worktree.phase-executor.test.ts"other phases": the passthrough case moved fromspec, which is now guarded, toverify.Test plan
npm run build: passesnpm run lint: passesnpx vitest run src/lib/workflow/skills-preflight.test.ts src/lib/workflow/skills-preflight.integration.test.ts: 32/32npx vitest run src/lib/workflow/phase-executor.test.ts: 186/186npx vitest run src/lib/workflow/run-orchestrator.test.ts: 7/7src/commands/run*.test.ts, platforms, adr-convention, tautology-detector-cli): 767/767 across 34 files__tests__/integration/{multi-issue-reliability,run-pipeline}.integration.test.ts: 15/15parseMutationMarkers: all threevalidnpm test: not run in this phase (runner instruction); the runner runs it before mergeCloses #1193
🤖 Generated with Claude Code