Repository navigation
Description
Tier: judgment Found: 2026-09-30 re-patch retrospective (tracker #1236, closed): the 41 fix commits since v2.15.0, their decision trails, and entire transcripts for four clusters.
Problem. About 78% of the fixes (32 of 41) re-patched an artifact that already had an earlier fix. The design-level causes were visible when they were fixed, but spec's Design Review (.claude/skills/spec/SKILL.md:303-308) confirms whatever site the issue already chose:
-
Recurrence treated as precedent. Q3 "What existing pattern does this follow?" made the recurring fix the pattern to follow. 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's spec said "the parser keeps chasing the skill's real-world formatting drift", and cited it as the approach. fix(sync): never rewrite a user-owned AGENTS.md or write a machine-specific scripts/dev symlink (absorbs #991) #990's spec rejected a broader ownership registry because "the existing CUSTOMIZABLE_FILES split already proves the minimal shape".
-
Producers never listed. In clusters with two or more producers of the same artifact, the second producer was missed or mirrored instead of merged:
- worktree creation:
new-feature.shvsworktree-manager.ts(fix(orchestrator): respect custom base branch in exec zero-diff guard (#534 follow-up) #537 → bug(worktree): new-feature.sh and sequant run derive different branch names for the same issue #1145 → bug(exec): sequant run worktrees never record sequantBase, so the zero-diff/uncommitted guard compares against origin/main and a --base ahead of main disables it #1234) - package-manager detection ×3 (worktree-manager's bare
|| "npm"fallback disagrees with the PM-aware shell path on manifest-less projects #870 → fix(worktree): TS provisioning runsnpm ci/pip install -qin repos with no manifest to install from — the shell path guards, TS doesn't #1196 → fix(stacks): uv ciInstall is a bareuv pip install -q— useuv sync --frozenwith uv.lock, else requirements or skip #1217 → fix(stacks): detectPackageManagerSync is JS-only — a uv/poetry repo without a declared packageManager resolves to npm and skips its install #1231) - PR creation (fix(run): AC_MET_BUT_NOT_A_PLUS QA verdict misrouted into quality loop → fails with no PR (should break to PR) #749, feat(run): --ready-gate — run the post-QA ready gate inside
sequant run(automates the any-gaps/fix-gaps second look, stops at human merge) #817, feat(pr): opt out of closing keywords —Refs #Nfor issues a PR should not close #1197 and fix(pr): sequant run PRs double the conventional prefix in the title and ship a placeholder body #1223, none of which reach exec-opened PRs; fix(run): sequant run has two PR producers — exec opens the PR itself and createPR returns it untouched, dropping the QA note, ready-gate report and summary #1247) - MCP config (MCP server: prevent nested npx version mismatch in sequant_run #389 → fix(mcp): plugin MCP server dies with CONNECTION_CLOSED when the open project has an older sequant in node_modules — npx ignores the pin and runs the local copy #1084 → fix(mcp): sequant init --mcp and the official-plugin-directory dist .mcp.json still invoke npx directly, retaining the #1084 shadowing exposure #1089)
No "one producer per artifact" rule exists (
memory/constitution.md, CLAUDE.md and docs were checked). - worktree creation:
-
Spec can't stop a wrong lever. In 35 of 40 issues the fix was set at filing. Even when spec saw the upstream cause (fix(worktree): TS provisioning runs
npm ci/pip install -qin repos with no manifest to install from — the shell path guards, TS doesn't #1196's spec named the JS-only detector as the root cause and declined it, and it came back as fix(stacks): detectPackageManagerSync is JS-only — a uv/poetry repo without a declared packageManager resolves to npm and skips its install #1231), its only options were to follow the AC or to widen scope silently.
Verified mechanism gap. #995's SPEC_DIVERGENCE halt is parsed for any phase (phase-executor.ts:1178, :1418) and halts inside batch-executor's phase loop (batch-executor.ts:1736). But the spec path runs before that loop (:1185-1215) and never checks specDivergence. A spec that finds the AC's lever contradicts the design can't halt the run before exec.
Prior fixes / producers
- Prior: Spec skill: add Design Review section before implementation planning #413 (added Design Review), perf(spec): prompt compression and tiered context — reduce spec skill token cost by ~60% #515 (compressed spec), feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995 (
SPEC_DIVERGENCEfor exec and loop). None covers recurrence or producers. - Producers of the plan: the issue body (filer or runner), the runner's context comments, and the spec comment.
AC
- AC-1: Design Review Q3 treats a pattern with ≥2 prior fix issues as a stop, not a precedent. The plan cites them (from
git log -Sand an issue search) and either fixes the class or records "deliberately local, reason: …, class tracked in #N". Evidence: a gate test insrc/lib/__tests__/spec-design-review-skill.test.ts, scoped to the Design Review section in all three copies and mutation-verified - AC-2: Design Review adds Q5, "Every producer and consumer of the artifact this changes (whole-repo grep)". With ≥2 producers, the plan collapses them or adds a parity test on every field and records why. Evidence: the AC-1 gate test file, mutation-verified
- AC-3: When Q3 or Q5 contradicts the issue's prescribed lever, spec emits
SPEC_DIVERGENCEin itsSEQUANT_PHASEmarker, and the spec path inrunIssueWithLogginghalts before exec with the divergence bundle, as the loop path already does. Evidence:npx vitest run src/lib/workflow/batch-executor.test.tswith a spec-phase divergence fixture that asserts exec never runs, mutation-verified - AC-4:
memory/constitution.mdgains one principle: "one producer per artifact; a second producer needs a parity test on every field and a recorded reason". Evidence: a gate test asserting the principle inmemory/constitution.md(scoped to the principles section), mutation-verified - AC-5: The Q3/Q5 additions stay within the spec skill's tier gating (Simple-tier issues skip them), and the spec skill doesn't grow past its base line count plus 15. Evidence:
wc -l .claude/skills/spec/SKILL.mdagainst the base branch, andnpm run lint:skill-sync
Non-Goals
- Fixing any of the named clusters. Each is its own issue (fix(run): status, PR-body QA note and MCP result use the first qa verdict — a looped AC_NOT_MET→NEEDS_VERIFICATION records ready_for_merge #1245 and fix(run): sequant run has two PR producers — exec opens the PR itself and createPR returns it untouched, dropping the QA note, ready-gate report and summary #1247 exist; others to be filed as found).
- Changing
/improve: it filed ~0 of the audited issues.
Graph metadata
- No dependency edges. Independent of feat(qa): enforce the follow-up ledger — every deferred item resolves to filed/fixed/dropped; sibling scans search the defect class #1249 (the QA follow-up ledger); they touch different skills.
May touch
.claude/skills/spec/SKILL.md,skills/spec/SKILL.md,templates/skills/spec/SKILL.mdmemory/constitution.md(the tracked copy;.claude/memory/is untracked)src/lib/workflow/batch-executor.ts,src/lib/workflow/batch-executor.test.tssrc/lib/__tests__/spec-design-review-skill.test.ts(new)
Activity
admarble commentedon Oct 1, 2026
Runner context (re-checked against main @ 5e8f0aa)
Line refs (current):
.claude/skills/spec/SKILL.mdis 435 lines, so AC-5's cap is 450. Tier table:92(Simple = "Design Review Q1/Q3 only");## Design Review:303; Q1–Q4:305-308; tier comment:310. Same lines inskills/andtemplates/.src/lib/workflow/phase-executor.ts:parseSpecDivergence:1111; attached to the result at:1178-1179(and:1418) for every phase, spec included.src/lib/workflow/batch-executor.ts: the spec path runs:1133-1215(executePhaseWithRetry("spec", …):1163,phaseResults.push(specResult):1198). It never readsspecResult.specDivergence. The loop-path halt to mirror is:1736-1741, with the bundle and halt record at:1473,:1524-1548and:1937. Reuse that bundle builder; don't write a second one.memory/constitution.md(tracked) has no section called "principles". Its sections are## 1. Definition of Done,## 2. AC Authoring Standard,## 3. Boundaries,## 4. Budgets & Stop Conditions,## 5. Stack-Specific Notesand## Project-Specific Notes. Put AC-4's principle in the section that fits (probably §3 Boundaries), scope the gate test to that section, and say which one in the PR.Two design points for spec to settle in the plan (decide them; don't pass them to exec):
:92abugwith ≤2 ACs is Simple, and AC-5 has Simple-tier issues skip the new Q3/Q5 additions. Several of the audited re-patches were small bug fixes. Either justify the skip, or keep a one-line recurrence check (thegit log -Scount) in Simple's Q3, which still fits the +15 budget. If you choose the second, record it as a deviation from AC-5's parenthetical and explain why.SEQUANT_PHASEmarker withSPEC_DIVERGENCE. Confirm the parser at:1111-1134accepts the outcome from a spec-phase marker as is, before adding a new parser.Prior fixes / producers (checked)
git log -S SPEC_DIVERGENCEshows only feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995's lineage, so the halt has one producer (parseSpecDivergence) and two consumers (the loop path, and the spec path after this issue). Spec should consume the existing field, not add a new one.Standard block
npm testin exec or in QA. This applies to the qa phase too. Run the AC test files plusgrep -rlE 'specDivergence|SPEC_DIVERGENCE|Design Review' --include='*.test.ts' src __tests__ scripts | xargs npx vitest run.failedTestmust start with the test file path, e.g.src/lib/__tests__/spec-design-review-skill.test.ts > … > ….Closes #1250. UseRefsonly for the tracker. Never put a closing keyword next to another real issue number, even in an example; write#<n>.admarble commentedon Oct 1, 2026
Complexity: Standard (5 ACs, 4 directories)
AC Quality Check
lintAcceptanceCriteria: 5/5 passed. Parser: AC-1 and AC-3 resolve tounit_test, AC-4 and AC-5 tointegration_test, all with declared evidence. Three things to note:manual. Its Evidence, "the AC-1 gate test file", names no path or test keyword, so/qa§6i won't treat AC-2 as a gate-test AC. Fix in exec's PR: give AC-2 its ownSEQUANT_MUTATIONrecord whosefailedTeststarts withsrc/lib/__tests__/spec-design-review-skill.test.ts > …. Treat AC-2 as a gate test even though the parser classifies it as manual.wc -lcheck passes on the base branch already (435 ≤ 450). That is fine for a ceiling. The tier-gating half of AC-5 isn't checked by anything, though, so the AC-1 gate test also asserts the tier gating (see the AC-5 section below).Scope Assessment
Non-Goals: present. Fixing the named clusters (#1245, #1247) and changing
/improveare both out of scope..claude/skills,skills/templatesmirrors,memory/,src/lib/workflow)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: Q3 treats a pattern with ≥2 prior fixes as a stop, not a precedent
Verification: Unit Test, as a gate test (
src/lib/__tests__/spec-design-review-skill.test.ts, new)Scenario: Given the three spec SKILL.md copies → When the test reads the Design Review region (from
## Design Reviewto the next\n---) → Then Q3 namesgit log -S, an issue search, a ≥2 threshold, and the literaldeliberately local, reason:/class tracked in #escape.Mutation: revert Q3 to "[Named pattern, confirm it fits]" in one copy, then confirm exactly that copy's case fails.
AC-2: Q5 lists every producer and consumer
Verification: Unit Test, as a gate test (same file)
Scenario: Given the Design Review region → Then a
5.item names producers and consumers, a whole-repo grep, and the ≥2-producer rule (collapse them, or add a parity test on every field and record the reason).Mutation: delete the Q5 line, then confirm the Q5 case fails.
AC-3: Spec can halt the run before exec
Verification: Unit Test (
src/lib/workflow/batch-executor.test.ts, newdescribe("#1250 …"))Scenario: Given
autoDetectPhases: trueand the mocked specPhaseResultcarryingspecDivergence: { acs: "AC-2", message: … }→ WhenrunIssueWithLoggingruns → ThenmockExecutePhasewas called only forspec(exec, qa and loop never run), the printed output containsLadder halt: SPEC_DIVERGENCEandDeclared impossible: AC-2, and the result issuccess: false.Two fixtures (required): (a) spec
success: truewith divergence. This one fails today, because the run proceeds to exec. (b) specsuccess: falsewith divergence. Today this case early-returns without printing the bundle, so only the bundle assertion catches it.Mutation: delete the new spec-path check, then confirm fixture (a) fails.
Assumptions (confirmed during planning):
parseSpecDivergence(phase-executor.ts:1111) is phase-agnostic. It reusesparsePhaseMarkers,PhaseMarkerSchema.phaseisPhaseSchema(which includesspec), andoutcome: z.enum(["SPEC_DIVERGENCE"])doesn't depend on the phase. Both result paths attach it (:1178,:1418).executePhaseWithRetryalready short-circuits retries onspecDivergenceregardless of phase (:2091,:2148). No new parser and no new field. Exec adds oneparseSpecDivergencecase with"phase":"spec"to pin this.AC-4: The constitution states "one producer per artifact"
Verification: Integration Test, as a gate test (assertion in the new spec-design-review test file, or in a sibling
constitution-boundaries.test.ts)Decision: put it in §3 Boundaries as a table row. §3 requires a named enforcer for every row, so the row is
One producer per artifact; a second producer needs a parity test on every field and a recorded reasonwith enforcer/specDesign Review Q5 (#1250). Scope the test to the region between## 3. Boundariesand## 4..Mutation: delete the row, then confirm the test fails. The PR says "§3 Boundaries".
AC-5: Tier gating and the line budget
Verification: Integration Test (
wc -lvsorigin/main≤ 450, plusnpm run lint:skill-sync) and assertions in the AC-1 gate file on the tier table row and the tier commentScenario: The Simple row at
:92still reads "Design Review Q1/Q3 only". The tier comment under Design Review says Q5 is Standard/Complex only. All three copies are byte-identical.Implementation Plan
Phase 1: Spec skill (all 3 copies, kept identical)
.claude/skills/spec/SKILL.mdDesign Review (:303-310):git log -S '<symbol>' --oneline+ issue search). ≥2 prior fixes = stop: fix the class, or recorddeliberately local, reason: …, class tracked in #N." Use one or two lines.<!-- SEQUANT_PHASE: {"phase":"spec","status":"failed",…,"outcome":"SPEC_DIVERGENCE","divergenceAcs":"AC-N","error":"…"} -->instead ofcompleted, sosequant runstops before exec. For the full semantics, point to the exec skill's section instead of copying it. The budget is +15 lines in total.skills/spec/SKILL.mdandtemplates/skills/spec/SKILL.md. Runnpm run lint:skill-syncandwc -l.Phase 2: Runtime halt (
src/lib/workflow/batch-executor.ts)iterationRecords,modelEscalationsandbuildBundle(currently:1478-1548) above the spec block, so the spec path reuses the one bundle builder. Both arrays are empty at spec time, which is exactly the "no SHA tried, no rung spent" record. Don't write a second builder.if (!specResult.success)(:1300), add:if (specResult.specDivergence) { log(chalk.yellow(formatEvidenceBundle(buildBundle("SPEC_DIVERGENCE", "spec", specResult.specDivergence)))); deactivate relay; return { success: false, … } }. It goes before the success split for the same reason the loop path's does (:1932-1936): a spec that declares divergence and also emits a validSEQUANT_SPECpasses the fix(run): spec runs in the main checkout, which the skills pre-flight never checks — a stale checkout silently degrades spec (#933 regression) #1193 guard, and today it would carry on into exec. Factor out the relay-deactivation + return block shared with the!successbranch instead of duplicating it.parseSpecDivergencespec-phase case in the phase-executor tests.Phase 3: Constitution plus gate tests
memory/constitution.md§3 row (AC-4).src/lib/__tests__/spec-design-review-skill.test.ts, modeled onspec-skill-self-skip-marker.test.ts:describe.each(COPIES)with region-scoped reads. Commit, then mutation-verify AC-1, AC-2, AC-4 and AC-3, recording each with theSEQUANT_MUTATIONmarker (failedTestbegins with the test file path).docs/adr/(next NNNN) covering "spec may halt the run". It records the Simple-tier deviation and the rejected alternatives below.Design Review
runIssueWithLogging's spec path holds the enforcement (halting). The constitution states the principle and names Q5 as its enforcer.SEQUANT_PHASE.outcomeandparseSpecDivergence, and make the spec path read the field it already gets. That is one producer and two consumers, as the runner's context comment notes. Rejected: (a) a newSPEC_HALTmarker or field, which would add a second producer of the same signal; (b) relying on the fix(run): spec runs in the main checkout, which the skills pre-flight never checks — a stale checkout silently degrades spec (#933 regression) #1193 guard to fail the spec phase, which halts only when spec also leaves outSEQUANT_SPEC, prints no bundle, and would let a divergent-but-complete spec through; (c) a separate purebuildEvidenceBundleindivergence-halt.ts, which is a valid alternative but turns a hoist into a refactor. Exec may choose it if hoisting makes the closure awkward.:1736,:1937). Applying AC-1 to this issue: the Design Review section has three prior fixes (Spec skill: add Design Review section before implementation planning #413 added it, perf(spec): prompt compression and tiered context — reduce spec skill token cost by ~60% #515 compressed it, feat(spec,qa): detect behavior-rule implementations across skill+runtime touchpoints #552 added Rule Touchpoints next to it). That's ≥2, so it's a stop. This issue is the class fix: it changes what the review asks rather than adding another nearby section. It isn't a local patch.bugissues with ≤2 ACs, which is exactly what the Simple tier covers, so skipping it there misses most of the target. The cost is onegit log -Sper Simple spec, with no extra lines because it's the same Q3 line. This is a deliberate deviation from AC-5's parenthetical. The PR records it, and the gate test asserts the Simple row still lists Q3.deliberately local, isn't a divergence.ADR required: the plan picks between designs (rejected options a–c, plus the Simple-tier deviation), so exec's PR includes
docs/adr/NNNN-spec-can-halt-before-exec.mdperdocs/adr/README.md.Feature Quality Planning
The standard checks pass. Notable items:
status:"failed"means the next/specre-runs (Phase Detection:spec:failed→ re-run), so the owner edits the AC text and runs again. Note this in the halt note. A decision comment alone doesn't re-open the work; the AC lines have to be edited.parsePhaseMarkersstrips it, so documenting the marker can't halt a run. Keep the example fenced./fullsolvereads spec markers through its own path. Whether it honors a spec-phase divergence is out of scope here (see Open Questions).Open Questions
/fullsolvealso stop on a specSPEC_DIVERGENCE? Recommendation: file a follow-up, since this AC namesrunIssueWithLoggingonly. Impact if this is wrong: a/fullsolve-driven run goes on to exec after spec flagged the lever.Conflict Risk
The open worktree for #1247 changes
batch-executor.tsandbatch-executor.test.tsin the PR-creation region, which is far from the spec path (:1133-1330). The worktrees for #1223 and #1233 are already merged. Risk is low: mergeorigin/mainbefore pushing.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: The ACs declare unit and integration evidence, but they are gate tests whose shape comes from mutation verification, so testgen stubs would add nothing (and have been left as stubs before). Exec writes them directly. The scope is contained and the runtime change is one check plus a hoist. QA: don't run the full
npm test. Run the AC test files plusgrep -rlE 'specDivergence|SPEC_DIVERGENCE|Design Review' --include='*.test.ts' src __tests__ scripts | xargs npx vitest run.Label Review
Current: enhancement
Recommended: enhancement, planned
Quality Loop: won't auto-enable (SCOPE_OK).
admarble commentedon Oct 1, 2026
QA Verdict: NEEDS_VERIFICATION
AC coverage: 5/5 met
Gaps:
fix(#1250): spec emits the divergence marker in its final response, t…
admarble commentedon Oct 1, 2026
Follow-up ledger: QA's finding 2 ("halt persisted as spec completed") is filed as #1254, which covers all four ladder halts. Open Question 1 (
/fullsolve) is dropped:/fullsolveruns spec in-session, and its §1.3 already exits on a failed spec, so there's no orchestrator halt to wire. Runner verification and a fix to the AC-3 marker channel are in PR #1253's body.fix(#1265): ship a slim plugin/ folder instead of the whole dev repo (#…