Repository navigation
Closed
Labels
Description
Tier: judgment Found: 2026-09-30 re-patch retrospective (tracker #1236, closed): the 41 fix commits since v2.15.0 plus their issue/PR decision trails.
Problem. Root causes are found, then dropped. Across 40 fix issues, an upstream cause or sibling site was raised in 39. Of the 80 raised items, 23 were fixed, 20 filed, 13 deferred with a reason, and 22 dropped: raised by spec, QA or the PR, then never filed or fixed. The dropped ones kept coming back:
- bug(init): init --agent <name> on an initialized repo overwrites .sequant/settings.json with defaults #1071's spec recommended a unified preservation rule as a follow-up. It wasn't filed, and the class was patched three more times.
- fix(sync): copy-mode sync leaves existing machine-specific scripts/dev symlinks in place, and doctor's hint loops back to sync #1053's QA said "adjacent unguarded writeFile sites share this PR's root cause". It wasn't filed, and was re-found as fix(writers): update/init/sync write through an existing symlink at a sequant-owned destination (#1053 class) #1122.
- fix(run): spec recommendation handoff parses ephemeral chat text — recommended phases silently dropped; move the contract to a structured comment marker #921 deferred moving QA parsing onto markers, "a separate follow-up". It was never filed, and bug(qa): parseQaVerdict records the first Verdict mention in the transcript, not the final heading — #1070 passed qa three times and was recorded AC_NOT_MET each time #1119 and 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 re-patched the regex.
- bug(codex): usage-limit turn failures classified 'unknown' — quality loop re-runs into the same quota, --auto-wait can't engage #1087's QA wrote "will fail for a seven-day window in October". It wasn't filed. It is a real time bomb, now fix(test): Codex usage-limit tests read the real clock — main goes red 2026-10-09 → 10-16 when the fixture's reset enters the 7-day horizon #1248, and main goes red on 2026-10-09.
The data is already machine-readable: QA's SEQUANT_QA_GAPS findings carry recommendedAction: "document" (GapActionSchema, src/lib/workflow/run-log-schema.ts:182). Nothing makes anyone resolve those, and nothing carries them to the PR.
Two related QA scan gaps from the same audit:
- The sibling-site scan searches for the code being changed, not the defect class. fix(sync): plain sync overwrites CUSTOMIZABLE_FILES (constitution) — copyDir ignores force and never consults isCustomizableFile #814's scan missed the AGENTS.md writer that fix(sync): never rewrite a user-owned AGENTS.md or write a machine-specific scripts/dev symlink (absorbs #991) #990 fixed six weeks later. bug(hooks): pre-tool.sh No-Changes Guard only recognizes single-line 'cd path && git commit', silently blocking real multi-line commits #963 searched for the
cd-extraction pattern and missed the reset guard, which ran baregit statusin the hook's cwd (fix(hooks): pre-tool.sh reset --hard guard reads git status from the hook's cwd, not the command's target worktree #1228). The scan is in.claude/skills/qa/SKILL.md§4/§5 "Sibling-site Scan" (:1908). - End-to-end delivery marked "not tested". fix(run): AC_MET_BUT_NOT_A_PLUS QA verdict misrouted into quality loop → fails with no PR (should break to PR) #749's QA marked the run path to the PR body as "Not tested", and the note never reached 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).
Prior fixes / producers
- Prior: feat(qa): add sibling-site scan prompt to first-pass /qa verdict checklist #573 (added the sibling-site scan), feat(qa): promote Adversarial Re-Read from checklist item to required structured output section #582 (Adversarial Re-Read), feat(qa/loop/ready): structured gap findings — finite taxonomy with required evidence, replacing the lossy prose-scrape gap channel #937 (the
SEQUANT_QA_GAPSmarker). None requires deferred items to be resolved. - Producers of deferred follow-ups: spec's comment (Open Questions and out-of-scope notes), exec's PR body, QA's review and
SEQUANT_QA_GAPSfindings, and the runner's context comments.
AC
- AC-1: QA's verdict section requires every item an earlier phase deferred to end in one of three states:
filed #N,fixed in this PRordropped: <reason>. That covers spec's out-of-scope and follow-up notes, exec's PR-body follow-ups, and QA's ownrecommendedAction: "document"findings. An unresolved item keeps the verdict below READY_FOR_MERGE. Evidence: a gate test insrc/lib/__tests__/qa-followup-ledger-skill.test.ts, scoped to the new QA section in all three copies and mutation-verified - AC-2:
buildAutomatedPRBodyrenders a## Follow-upschecklist from the run'sdocumentfindings, each line carrying its resolution. It has no effect until the orchestrator is the only PR producer, so this AC is blocked by 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. Evidence:npx vitest run src/lib/workflow/worktree-manager.build-pr-body.test.ts - AC-3: The sibling-site scan asks for the defect class, not the symbol being changed. Examples: "every git call in the file without
-C <target>", "every writer to a project path". The scan names the class it searched. Evidence: a gate test insrc/lib/__tests__/qa-sibling-scan-skill.test.ts, scoped to the Sibling-site Scan section and mutation-verified - AC-4: QA may not mark end-to-end delivery "not tested" when it is the AC's promise (for example "surfaces in the PR body"). It must run the path or return NEEDS_VERIFICATION. Evidence: the AC-3 gate test file asserts the rule in the Risk Assessment section, mutation-verified
- AC-5: The QA skill doesn't grow: the net line count of
.claude/skills/qa/SKILL.mdis ≤ its count before this change (3,837 at filing). New rules replace or tighten existing text. Evidence:wc -l .claude/skills/qa/SKILL.mdagainst the base branch, andnpm run lint:skill-sync
Non-Goals
- QA filing issues on its own. The gate records a decision; the runner or owner files.
- Changing
SEQUANT_QA_GAPS's schema.
Graph metadata
- Blocked by: 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 (for AC-2 only; AC-1 and AC-3 to AC-5 can land first if split)
May touch
.claude/skills/qa/SKILL.md,skills/qa/SKILL.md,templates/skills/qa/SKILL.mdsrc/lib/workflow/worktree-manager.ts,src/lib/workflow/worktree-manager.build-pr-body.test.tssrc/lib/__tests__/qa-followup-ledger-skill.test.ts,src/lib/__tests__/qa-sibling-scan-skill.test.ts(new)
Activity
admarble commentedon Oct 3, 2026
Runner context (2026-10-03, main @ a14229f)
Repo state changed since filing. Read this before spec.
#1247 is merged and shipped in v2.19.0, so AC-2 is unblocked. The orchestrator is now the only PR producer under
sequant run.openOrUpdatePR(src/lib/workflow/batch-executor.ts:1119) runs after each successful exec pass and again after QA (:2499). After QA,createPRtakes the update path.buildAutomatedPRBodyis atsrc/lib/workflow/worktree-manager.ts:2022. It already takes{qaVerdict, readyGateReport}throughcreatePR(:2118).Data flow for AC-2. The QA
documentfindings live inphaseResults[].summary.findings:PhaseResult.summary?: QaSummary(types.ts:429).findingsis parsed fromSEQUANT_QA_GAPSatphase-executor.ts:711.openOrUpdatePR'safterarg doesn't carry them yet.Thread them through
after→createPR→buildAutomatedPRBody, the same wayreadyGateReportgoes. Use the latest QA pass, not.find().batch-executor.ts:2379and:2498both use.find(), which returns the first QA verdict. That bug is #1245, which runs after this issue in the same region. Don't fix #1245 here, but don't add a third first-match reader either. Read the last QA entry, or add one small accessor #1245 can reuse.Prior fixes / producers (checked with
git log -Sand grep):.claude/skills/qa/SKILL.md:1908) has had one prior change, feat(qa): add sibling-site scan prompt to first-pass /qa verdict checklist #573. The Risk Assessment "Not tested" line has had one, fix: simplify adversarial self-evaluation to 2-field risk assessment #513. Neither is a class yet, so a local change is fine.scripts/qa/precheck.tssiblingGrep(:242) greps changed identifiers deterministically, and §5 consumes its output. AC-3's "defect class, not the symbol" rule has to say how the two relate: the precheck stays a symbol-level hint, and the class search is the agent's job. If you find AC-3 needsprecheck.tschanged, stop and surface it. Don't widen silently.:1912says "Don't widen scope mid-PR; file a follow-up issue instead." That's the sentence that produces unfiled follow-ups. AC-1's rule should replace or tighten it. Don't add a parallel rule beside it.Risk Assessmentappears in three templates (:1898,:3403,:3743), and each has aNot tested:line. AC-4's gate test has to cover the copy (or copies) the rule actually governs. Scope it to the delimited region.Launch constraints:
.claude/skills/qa/SKILL.mdis 3,837 lines on main, and net growth must be ≤ 0. Make the cut in the same files (tighten prose). Don't move text into a newreferences/file to dodge the count unless you say so explicitly in the PR..claude/skills,skills,templates/skills) and runnpm run lint:skill-sync.npm testin exec or QA. It hits the 30-minute phase wall, and CI runs it. Run the targeted test files,npm run build,npm run lint:skill-sync, andnpx tsc --noEmit.failedTestmust start with the test file path, e.g.src/lib/__tests__/qa-followup-ledger-skill.test.ts > <describe> > <case>, or §6i floors AC_NOT_MET.Refs, never a closing keyword, even in examples.admarble commentedon Oct 3, 2026
Complexity: Standard (5 ACs, 5 directories)
AC Quality Check
The parser finds all 5 ACs, each with
Evidence:, and the linter flags none. EachEvidence:was run againstorigin/main(a14229f):worktree-manager.build-pr-body.test.tsalready passes on main, so this evidence proves nothing on its own. The PR must add abuildAutomatedPRBody — follow-ups (#1249)describe block, and QA should check that block is in the diff.wc -lis a cap (3,837), not a change, so it passes today by design. ✅Scope Assessment
Non-Goals: QA doesn't file issues itself, and the
SEQUANT_QA_GAPSschema doesn't change.Verdict:⚠️ SCOPE_WARNING. The three QA skill copies are one logical file, so the real spread is the skill plus
src/lib/workflow. Keep it as one PR. AC-2 was blocked by #1247, which is now merged.Acceptance Criteria
AC-1: Follow-up ledger gate
Verification: Unit Test (a skill gate test, mutation-verified)
Scenario: Given a deferred item from spec, exec's PR body or a QA
documentfinding → When QA writes its verdict → Then every item ends infiled #N,fixed in this PRordropped: <reason>, and any unresolved item caps the verdict atAC_MET_BUT_NOT_A_PLUS.Assumptions: The ledger becomes a §7 verification gate (
followup_ledger_status: Resolved/Unresolved/N/A) with a slot in both output templates (Simple Fix and Standard).AC-2:
## Follow-upsin the PR bodyVerification: Unit Test
Scenario: Given the latest QA pass has
documentfindings → WhenbuildAutomatedPRBodyruns → Then it renders a## Follow-upschecklist with one line per finding and that finding's resolution. A run with no findings renders no section.Assumptions: The resolution comes from the finding's
description, with no schema change (see Open Q1).AC-3: Sibling scan searches the defect class
Verification: Unit Test (a gate test scoped to
#### Sibling-site Scan, mutation-verified)Scenario: Given a localized fix → When QA runs §5 → Then it states the class it searched (e.g. "every git call without
-C <target>") inSibling sites considered:.AC-4: End-to-end delivery can't be "not tested"
Verification: Unit Test (a gate test scoped to
### 5. Risk Assessment, mutation-verified)Scenario: Given an AC that promises delivery (e.g. "surfaces in the PR body") → When QA hasn't run that path → Then the verdict is
NEEDS_VERIFICATION, not MET with a "Not tested" note.AC-5: No net growth
Verification: Integration Test (
wc -l≤ 3,837 in all three copies, plusnpm run lint:skill-sync)Implementation Plan
Phase 1: QA skill prose (all three copies, one batch)
qa/SKILL.md:1912, "Don't widen scope mid-PR; file a follow-up issue instead.", with a pointer to the ledger. That sentence is what produces unfiled follow-ups. Then:#### Follow-up Ledgerblock under §7. It lists the three sources (spec Open Questions and out-of-scope notes, exec PR-body follow-ups, QAdocumentfindings) and the three terminal states.followup_ledger_statusto the §7 gate list and the verdict table.### Follow-up Ledgerslot to both templates.documentfinding'sdescription:— filed #N,— fixed in this PRor— dropped: <reason>.scripts/qa/precheck.tssiblingGrepstays a symbol-level hint, and the class search is the agent's job. Don't changeprecheck.ts; if that turns out to be needed, stop and surface it. The paragraph's closing "Don't automate via grep" contradicts the precheck, so drop it.NEEDS_VERIFICATION. Tighten the sentence that reservesNEEDS_VERIFICATIONfor "external/temporal gates" so it includes this case; otherwise the two rules contradict each other. Keep the slot labels**Not tested:**,**Sibling sites considered:**and**Sibling-line audit:**, becausescripts/analytics/gap-signal.ts:54,64anchors on them.feedback_qa_second_look.md" line.references/unless the PR says so.Phase 2: Runtime (AC-2)
PhaseResult, so 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 can reuse it. Use it only to read findings. Don't touch the two.find()verdict readers atbatch-executor.ts:2379/:2498; those belong to 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.followups?: GapFinding[]through four steps: theopenOrUpdatePRafterargument, thencreatePR, thenbuildAutomatedPRBody. This is the same pathreadyGateReporttakes. Filter torecommendedAction === "document".## Follow-upsafter the QA note and before the stack manifest:- [x] <desc> — <resolution>.- [ ] <desc> — unresolved.sanitizeImportedClosingKeywords, because finding text like "fixes chore(assess): sync chain flag references and add chain-resume rule #812" would otherwise close another issue.Phase 3: Tests
readFromEachRootpattern fromqa-review-dimensions-skill.test.ts.fix_nowfindings are excludedSEQUANT_MUTATIONmarkers for AC-1, AC-3 and AC-4. EachfailedTestmust start with the test file path.Run the targeted tests,
npm run build,npx tsc --noEmitandnpm run lint:skill-sync. Don't run the fullnpm test.Design Review
worktree-manager.tsbuildAutomatedPRBody, the only PR body producer undersequant run(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).description, so the PR body reads only the existing marker channel. Rejected: parsing the ledger table from QA prose. That would be a second channel, and fix(run): spec recommendation handoff parses ephemeral chat text — recommended phases silently dropped; move the contract to a structured comment marker #921, bug(qa): parseQaVerdict records the first Verdict mention in the transcript, not the final heading — #1070 passed qa three times and was recorded AC_NOT_MET each time #1119 and 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 show what prose regex parsing costs.resolutionfield toGapFindingSchema?" Because it's a Non-Goal. The suffix convention is a parse contract, so the ADR must record it, and a schema field is the upgrade path.SEQUANT_QA_GAPS) and runner context comments.findingsare consumed byparseQaSummary(phase-executor.ts:711),ready-gate.ts:374,/loop, and nowbuildAutomatedPRBody.gap-signal.ts.ADR: the plan picks between two designs (suffix vs. a prose ledger parse). The exec PR must add an ADR in
docs/adr/using the next free number; #1250's branch already claims 0005.Feature Quality Planning
The standard checks pass. Two things need attention:
batch-executor.tsinsiderunIssueWithLogging(hunks from about :1199), next toopenOrUpdatePR(:1119). 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 is queued for the same region. Mergeorigin/mainbefore QA.Open Questions
AC_MET_BUT_NOT_A_PLUS, so the run still breaks to a PR and a human resolves it. Impact if wrong:AC_NOT_METwould loop exec on a decision exec can't make.Recommended Workflow
Phases: exec → qa
Quality Loop: enabled
Reasoning: The ACs are gate tests that exec writes and mutation-verifies, so I skip testgen; its stubs would duplicate that work. The quality loop is on because the hard line cap and three mirrored copies make a first-pass
AC_NOT_METlikely.Label Review
Current: enhancement
Recommended: enhancement, planned
Quality Loop: set explicitly above (scope is SCOPE_WARNING).
admarble commentedon Oct 3, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 5/6 met
Gaps:
Suggestions:
⚠️ unresolved. If QA copies that wording into a finding's description, the PR body will show— ⚠️ unresolved — unresolved. This is cosmetic only.fix(#1249): a follow-up QA already marked unresolved renders one unre…
admarble commentedon Oct 3, 2026
Runner verification and follow-up ledger (PR #1288)
Verified by the runner
tsc --noEmitandlint:skill-syncare clean..claude/skills/qa/SKILL.mdwent from 3,837 to 3,832 lines.summary.findings, goes fromopenOrUpdatePRtocreatePRtobuildAutomatedPRBody, and renders before the stack manifest.Run caveat
The MCP server that ran this was sequant 2.18.0. It opened the PR only after QA, which is #1247's old two-producer behaviour, so QA had no PR body to read. That is the source of QA's "no SEQUANT_MUTATION marker" gap. Restart the MCP server on 2.19.0 before the next run.
Ledger
## Summary(exec SKILL.md, PR Creation), andextractExecSummaryimports that section into the PR body.$0substitution in the qa SKILL.md awk programs: filed investigation(skills): Claude Code may substitute positional $0 inside qa SKILL.md awk programs when /qa gets an argument #1289. It is unverified; AC-1 there reproduces or refutes it.⚠️ unresolved — unresolvedsuffix: fixed in this PR (0d80d67), with a test that fails without the fix.