Repository navigation
Description
Summary
/fullsolve's QA loop currently re-runs /qa from scratch on each iteration even when nothing has changed since the prior run — same HEAD SHA, same uncommitted state, same disk content. This wastes a full QA cycle and produces an identical verdict, telling the user nothing new.
The behavior should instead detect "I'm about to issue the same verdict at the same SHA as the last run" and either:
- Apply the missing edit (if the prior QA's "Next Steps" enumerated specific fixes), OR
- Surface a hard blocker to the orchestrator (escalate, don't loop)
Concrete incident — issue #570
The fullsolve run on #570 produced 3 sequential QA failures with identical AC_NOT_MET verdicts, all at SHA cb77c8e6 (== origin/main):
| Run | SHA | Verdict | What changed since last run |
|---|---|---|---|
| QA #1 | cb77c8e6 |
AC_NOT_MET | (initial) |
| QA #2 | cb77c8e6 |
AC_NOT_MET | nothing — same state on disk |
| QA #3 | cb77c8e6 |
AC_NOT_MET | nothing — same state on disk |
QA #3's own comment captures this:
"Re-running
/qa 570without first applying the missing.claude/hooks/pre-tool.shedits will continue to produce the same outcome."
The 4th attempt (this session, manually triggered) applied the missing edit, committed, and got to READY_FOR_MERGE. But that should have happened automatically after QA #1 — not after 3 wasted cycles.
Root cause hypothesis
The fullsolve QA loop appears to:
- Run
/qa→ parse verdict - If verdict ≠ READY_FOR_MERGE → invoke
/sequant:loopfor fixes - Re-run
/qa→ repeat (max iterations)
The gap is in step 2: /sequant:loop runs but does not actually apply the fixes — either it doesn't parse the prior QA's "Next Steps" into edits, or it does but the edits aren't committed back to the worktree, or it skips the loop entirely. Whichever — the symptom is identical state at QA #N+1.
Acceptance Criteria
- AC-1: Before invoking
/qa, fullsolve's QA loop checks the latest QA phase marker on the issue. IfcommitSHAmatches current HEAD ANDstatus == "failed"AND no edits have been made since (git status --porcelainempty), the loop does not re-invoke/qa. Instead it either invokes/loopto apply the prior QA's recommendations, or surfaces a hard blocker. - AC-2: When
/sequant:loopruns, it must verify it actually produced a diff before yielding back to/qa. Ifgit status --porcelainis unchanged after/loop, the loop bails out with a clear "loop fixer made no changes — manual intervention required" message rather than re-QAing the same state. - AC-3: Telemetry / logging captures same-SHA same-verdict cycles in
.sequant/state.json(or equivalent) so future runs can detect "we've been here before" within a single fullsolve invocation. - AC-4: Test coverage: integration test that simulates a fullsolve where
/loopproduces no diff, and asserts the workflow halts after the first wasted cycle (not after MAX_QA_ITERATIONS). - AC-5: Documentation in
.claude/skills/fullsolve/SKILL.mdand.claude/skills/loop/SKILL.md(and the templates/skills mirrors) describing the new escalation behavior.
Non-Goals
- Not redesigning the QA loop algorithm. Keep
MAX_QA_ITERATIONS=2as the cap; this issue only adds an early-exit when iterations would be wasted. - Not auto-applying QA recommendations programmatically (that's a much bigger change). The bar is just "detect no-progress and escalate," not "fix automatically."
- Not changing the QA verdict algorithm itself.
Risks / Open Questions
git status --porcelainmay not be the right "did anything change" signal if/loopwrites to files outside the worktree (settings, state file). Worth a quick audit of where/loopactually writes.- Phase marker availability — AC-1 relies on the prior QA having posted a marker with
commitSHA. The qa skill emits these now, but legacy QAs without markers would force the loop to fall back to verbatim re-runs. That's acceptable degradation.
Complexity
simple-fix — the gating logic is ~20 lines in fullsolve's QA-loop section + a similar check in /loop. The harder part is the integration test (AC-4).
Self-assessed workflow
spec → exec → qa (AC-4 integration test takes the place of testgen — direct hand-rolled test against the orchestration runtime).
Related
- Surfaced during
/fullsolve 570on 2026-05-06; the QA self-correction comment on bug(hooks): pre-tool.sh regexes for destructive/deployment/reset/workflow commands also match inside quoted gh body content #570 references this incident - Adjacent to bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562/fix(#562): qualify Skill("loop") in fullsolve as sequant:loop #565 (the
Skill("loop")namespace fix) but distinct — that bug routed the loop to the wrong skill; this bug is that even the right skill can no-op silently - See
feedback_qa_break_vs_loop.mdandfeedback_qa_recommendation_vs_ac_gap.mdin user memory — the loop-vs-break distinction is part of the broader theme
Activity
feat(#582): /qa Adversarial Re-Read structured section before READY_F…
admarble commentedon May 6, 2026
Complexity: Standard (5 ACs, 3 directories)
AC Quality Check
All 5 ACs are measurable with clear pass/fail signals (specific files, specific git commands, specific verdict comparisons). No issues flagged.
Scope Assessment
Non-Goals (from issue body): keep
MAX_QA_ITERATIONS=2; no auto-applying QA recommendations; no changes to QA verdict algorithm.skills/*/fullsolve,skills/*/loop,src/lib/workflow)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: Pre-
/qano-progress gate in fullsolve QA loopVerification: Integration Test
Scenario: Given
qa:failedmarker withcommitSHA == HEADANDgit status --porcelainempty → When fullsolve enters QA loop iteration ≥2 → Then it must NOT invokeSkill(skill: "qa"). It either invokes/looponce or emitsSAME_SHA_NO_PROGRESSand breaks.AC-2: Post-
/loopno-diff guardVerification: Integration Test
Scenario: Given
/loopruns in orchestrated mode → When bothgit rev-parse HEADANDgit status --porcelainare unchanged before vs after the fix attempt → Then/loopexits withLOOP_NO_DIFFand the manual-intervention message; does NOT yield back to/qa. State-file/settings writes do NOT count as progress (per issue body's open question).AC-3: Stagnation telemetry in
.sequant/state.jsonVerification: Unit Test
Scenario: Given fullsolve detects a same-SHA same-verdict cycle → Then per-issue state contains an additive
qaStagnation: [{ sha, verdict, detectedAt, iteration }]entry. Existing schema preserved.AC-4: Integration test for no-progress halt
Verification: Integration Test
Scenario: Given a temp git repo + stub
/loopthat returns no diff → When the stagnation helper drives the QA-loop logic → Then it halts at iteration 1 (NOTMAX_QA_ITERATIONS=2) with reasonSAME_SHA_NO_PROGRESS. Test undersrc/lib/workflow/next tophase-executor.test.ts.Assumptions: Logic must live in a TS helper (e.g.
src/lib/workflow/qa-stagnation.ts) so test and SKILL.md exercise the same path; SKILL.md invokes vianpx tsx.AC-5: Documentation across three skill mirrors
Verification: Manual Test
⚠️ Pre-existing drift:
Scenario:
.claude/skills/{fullsolve,loop}/SKILL.mdANDtemplates/skills/{fullsolve,loop}/SKILL.mdANDskills/{fullsolve,loop}/SKILL.mdeach describe the no-progress gate, theSAME_SHA_NO_PROGRESS/LOOP_NO_DIFFhalts, and when manual intervention is required.skills/loop/SKILL.mdandtemplates/skills/loop/SKILL.mdlack the entire "Orchestration Context" section vs the canonical.claude/skills/loop/SKILL.md. Implementation should land the new escalation docs in canonical + mirror only the new section to the drifted copies; full reconciliation is out of scope (see Open Question 4).Implementation Plan
Phase 1: Stagnation helper (foundation for AC-1, AC-3, AC-4)
src/lib/workflow/qa-stagnation.ts:detectStagnation({ currentSha, isDirty, lastMarker })— pure functionrecordStagnation(issueNumber, entry)— appends to state viaStateManagernpx tsx src/lib/workflow/qa-stagnation.ts detect <issue>→ printsSTAGNANT|FRESHfor SKILL.md to consumeStateManagerwith optionalqaStagnationarray on per-issue record (additive — no migration).Phase 2: Wire into fullsolve QA loop (AC-1)
.claude/skills/fullsolve/SKILL.md§4.3 (lines 505–529): before eachSkill(skill: "qa")after iteration 1, run helper. IfSTAGNANT: try/looponce if not already this iter; if/loopreturnsLOOP_NO_DIFF, break withSAME_SHA_NO_PROGRESS.SAME_SHA_NO_PROGRESSas a distinct halt reason.Phase 3: Wire into /loop skill (AC-2)
.claude/skills/loop/SKILL.mdStep 6/7: snapshot HEAD +git status --porcelainbefore fix, compare after. If both unchanged → exitLOOP_NO_DIFFand skip Re-run Validation.Phase 4: Sync mirrors (AC-5)
templates/skills/andskills/for both fullsolve and loop. Note the loop mirror drift — land only the new section.Phase 5: Integration test (AC-4)
src/lib/workflow/qa-stagnation.test.ts: temp git repo (followphase-executor.test.tspattern), seededqa:failedmarker matching HEAD, stubbed/loopreturningLOOP_NO_DIFF. Assert iteration halts at 1 withSAME_SHA_NO_PROGRESS.Design Review
src/lib/workflow/qa-stagnation.ts. Skills shell out vianpx tsx(same pattern qa SKILL.md §0 already uses for marker parsing).status=failedcounterpart to the existingstatus=completedshort-circuit.Feature Quality Planning
All standard checks pass. Notable items:
/loopSKILL.md —skills/andtemplates/skills/versions lack the Orchestration Context section. Do NOT attempt full reconciliation in this issue; file follow-up..sequant/state.jsonwrites from "progress" detection (issue body flags this risk).status=completedshort-circuit (already exists) and newstatus=failedno-progress gate.Open Questions
LOOP_NO_DIFFever retry? — Recommend: no. Same prompt → same result. Impact if wrong: rare benign re-attempt.qaStagnationarray vs single object? — Recommend: append-only array. Preserves multi-stagnation history. Impact: minor schema rev later./looponce or escalate immediately? — Recommend: try/looponce on first detection (matches issue's "Apply OR Surface" spec), escalate on second. Impact: one extra cycle vs missed auto-fix./loopmirror drift in this issue? — Recommend: no. File follow-up. Impact: docs land canonical-first; mirrors stay incomplete temporarily.Recommended Workflow
Phases: spec → exec → qa
Quality Loop: disabled
Reasoning: Honoring issue author's self-assessment. AC-4 is a hand-rolled integration test, so testgen stubs would be discarded. No UI → no
test. Skill-orchestration bug → nosecurity-review.Label Review
Current:
bug,plannedRecommended: no change
Reason:
bugis accurate.plannedalready set. Body claims "simple-fix" complexity but the integration test (AC-4) lifts it to Standard tier — nosimple-fixlabel warranted.Quality Loop: Won't auto-enable.
Conflict Risk Analysis
Active worktrees touching adjacent surfaces (
#587,#569,#571) all editqa/,ac-linter, ormarkdown-only-ci— none touch fullsolve or loop. Low conflict risk. Worktree for #581 already exists at../worktrees/feature/581-bug-fullsolve-qa-loop-re-runs-qa-with-no-state-cha.admarble commentedon May 6, 2026
QA Review for Issue #581
AC Coverage
detectStagnation()) but no edits to.claude/skills/fullsolve/SKILL.md(ortemplates/skills/,skills/mirrors). The QA loop never invokes the gate.grep -l qa-stagnationover all 3 fullsolve SKILL.md returns zero matches.snapshotLoopProgress/compareLoopProgress) but no edits to.claude/skills/loop/SKILL.mdor its mirrors. Plus a confirmed parsing bug inreadDirtyExcludingState(see Code Review) means even when wired up, unstaged changes to.sequant/state.jsonwould falsely register as progress — the exact behavior AC-2 was supposed to prevent..sequant/state.jsonQAStagnationEntrySchemaadded tostate-schema.ts✅ andrecordStagnation()implemented ✅, but no caller invokes it (orphan code) and no unit test exists per the spec's "Verification: Unit Test" requirement.src/lib/workflow/qa-stagnation.test.tsdoes not exist. The spec explicitly required this as the highest-leverage AC ("AC-4 demands integration test; markdown-embedded bash is untestable").SKILL.mdwas edited in.claude/skills/,templates/skills/, orskills/for either fullsolve or loop.grep -lconfirms zero references toSAME_SHA_NO_PROGRESS/LOOP_NO_DIFF/stagnation in any skill markdown.Coverage: 0/5 AC items fully met (1 partially met, 4 not met)
Quality Plan Verification
qa-stagnation.test.ts)Quality Plan Status: Not Addressed (1/5 phases done — Phase 1 only)
CI Status
No PR exists for branch
feature/581-bug-fullsolve-qa-loop-re-runs-qa-with-no-state-cha. CI status check skipped.Quality Metrics
any)Test Coverage Analysis
src/lib/workflow/qa-stagnation.tsscripts/qa-stagnation.tssrc/lib/workflow/state-schema.tsCoverage: 0/3 changed source files have corresponding tests.
Critical paths without tests: AC-4 specifically demands an integration test for the orchestration logic — its absence is the binding gap.
Code Review
Strengths (helper module):
detectStagnation) from I/O (readHeadSha,readIsDirty) — directly testable.qaStagnation?: QAStagnationEntry[]) — preserves backward compatibility per the spec's "no migration" goal..comments[].bodyform (not[.comments[].body]), avoiding the JSON-encoding pitfall called out in qa SKILL.md §0a.detectStagnationcodes return paths cleanly; the early-return ladder is readable and maps 1:1 to the AC-1 contract.Issues:
readDirtyExcludingStateregex strips path bytes (src/lib/workflow/qa-stagnation.ts:209-220). The logic does.trim()then.replace(/^.{1,3}/, ""), butgit status --porcelainv1 emits unstaged-only entries with a leading space (e.g.M file.ts). After.trim()the leading space is gone, so the regex chops 3 real characters from the path. Live demonstration in this very worktree:$ npx tsx scripts/qa-stagnation.ts snapshot {"sha":"164aef89...","dirty":["rc/lib/workflow/state-schema.ts","scripts/qa-stagnation.ts","src/lib/workflow/qa-stagnation.ts"]}rc/lib/workflow/state-schema.ts(lost' M s'). Untracked??lines survive because they have no leading space; modified-unstaged lines do not. Functional impact: an unstaged.sequant/state.jsonwrite becomessequant/state.jsonafter parsing, fails thestartsWith(".sequant/")filter, and would falsely register as progress — defeating AC-2's stated guarantee that "state-file/settings writes do NOT count as progress". Suggested fix: parse usingline.slice(3)directly on the raw porcelain output (not the trimmed line), or usegit status --porcelain=v2and parse fields explicitly. Don't.trim()first.detectStagnation.priorVerdict(line 124). It assignslastMarker.erroras the prior verdict, but per qa SKILL.md the failed-marker shape is{phase, status:"failed", error:"AC_NOT_MET", commitSHA, ...}and the verdict on a completed marker lives inlastMarker.verdict. For the failed-marker case AC-1 targets,errorwill be the literal string"AC_NOT_MET"so this happens to work — but the field naming will mislead future readers and break if a non-AC error fires.git diff mainshows nothing. All work sits unstaged or untracked; the branch HEAD is identical toorigin/main. Without a commit, the worktree QA cannot validate this against any merge target, and a follow-up/loopinvocation would also see "no diff" and bail.recordStagnationrequires existing issue state (line 150). It throws ifstate.issues[issueNumber]is missing. In a fresh fullsolve where /spec/exec already ran, the issue record exists; for any other invocation path (manual/qa, retroactive recording) it'll throw. Either lazy-create the record or document the precondition in the CLI shim.detectStagnation(5 early-return branches + the success branch) is unverified. AC-4 requires this; the spec's design review explicitly flagged "AC-4 demands integration test" as the reason for the TS helper extraction.Suggestions:
detectStagnation's decision matrix (no git fixtures needed — it's pure).STATE_DIR_PREFIXas a constant or making the exclusion list configurable; right now it's a magic string.Test Quality Review
N/A — No test files were added or modified.
Anti-Pattern Detection
Dependency Audit
N/A —
package.jsonnot modified.Code Patterns
src/lib/workflow/qa-stagnation.ts:218/^.{1,3}/strips path bytes after.trim()of porcelain output.slice(3)(preserves leading space); or use--porcelain=v2Critical Issues: 0
Warnings: 1 (parsing bug — see Code Review for impact analysis)
Call-Site Review
New exported functions detected: 6 (
detectStagnation,recordStagnation,readHeadSha,readIsDirty,snapshotLoopProgress,compareLoopProgress)detectStagnationscripts/qa-stagnation.ts:87(detectsubcommand) onlyrecordStagnationscripts/qa-stagnation.ts:115(recordsubcommand) onlysnapshotLoopProgressscripts/qa-stagnation.ts:126(snapshotsubcommand) onlycompareLoopProgressscripts/qa-stagnation.ts:143(compare-snapshotsubcommand) onlyFindings: All six new exports are reachable only via the CLI shim. Nothing in the existing skill suite or workflow runtime invokes them, so the helper has no observable effect on
/fullsolveor/loopbehavior today. This is the single biggest gap — Phase 1 (helper) is done; Phases 2–5 (wiring + tests + docs) are not.Recommendations: Land the SKILL.md edits per the implementation plan's Phases 2–4 before any further QA cycles, then hand-roll the integration test in Phase 5.
Execution Evidence
npx tsx scripts/qa-stagnation.tsnpx tsx scripts/qa-stagnation.ts snapshotrc/lib/workflow/state-schema.ts)npm run buildEvidence status: Complete (helpers compile and run; the smoke test surfaced the latent regex bug).
Skill Command Verification
N/A — No
.claude/skills/**/*.mdfiles modified.Detection Pattern Verification
N/A — No skill markdown edits in this diff. (Note: when the missing SKILL.md edits land, the new
grep/regex patterns added to fullsolve/loop SKILL.md will need to be verified per Section 6c against past phase markers andgit statusoutput.)CLI Registration Verification
N/A — No
RunOptionsorbin/cli.tschanges.Skill Change Review
N/A — No skill files changed (which is itself the AC-5 gap).
Smoke Test
npm run buildnpx tsx scripts/qa-stagnation.ts snapshotnpx tsx scripts/qa-stagnation.ts detect 581Smoke Test Status: Partial — happy-path detection requires a prior failed qa marker which doesn't exist on #581.
Manual Test ACs
N/A — No ACs flagged
Manual Testin the spec plan (AC-5 is "Manual Test" in the spec but it asks for documentation review, which is a code-review check, not runtime).CHANGELOG Verification
Result: No CHANGELOG entry. Add one once SKILL.md wiring lands.
Risk Assessment
/fullsolvewill continue to waste cycles exactly as bug(fullsolve): QA loop re-runs /qa with no state change instead of escalating same-SHA same-verdict cycles #581 reports. Once wired, the parsing bug (readDirtyExcludingStatestrips path bytes from unstaged-modified lines) will misclassify worktree state and either (a) treat a state-file write as a real progress diff, defeating AC-2's exclusion guarantee, or (b) more rarely, miss a real diff in.sequant/-prefixed paths if the prefix happens to land in the chopped 3 bytes.detectStagnation's 5 decision branches;recordStagnation's state mutation;compareLoopProgress's set comparison; the porcelain parser. AC-4 explicitly required the integration test that would have caught the parser bug on the first pass.readDirtyExcludingStateis single-instance in this file/module.compareLoopProgressis a downstream consumer (different shape), not a sibling.Adversarial Re-Read
**Verify:**/**Repro:**snippets. The blockquoted line ("Re-running /qa 570 without first applying...") and the SHAcb77c8e6table are prose context, not test fixtures.rc/lib/workflow/state-schema.tsin snapshot output) is a live runtime observation, not a hypothesis.git statusshows: 1 modified (state-schema.ts), 2 untracked (qa-stagnation.ts× 2).git rev-parse HEAD == origin/main. Nothing committed — the entire Phase 1 work would be lost if the worktree were destroyed.MAX_QA_ITERATIONS=2, no auto-applying recommendations, no QA verdict algorithm changes. Implementation touches none of these (it touches almost nothing yet). When SKILL.md wiring lands, verify the gate is additive to the iteration cap, not a replacement.Findings: Two structural gaps were missed by the in-section AC reviews:
Status: Severe Gap (verbatim per Section 6d: "AC marked MET on the basis of code review without the runtime / corpus check the AC's text required" — AC-3's "Verification: Unit Test" was not satisfied; AC-4's integration test was the AC).
Verdict: AC_NOT_MET
Why: 4 of 5 ACs are unmet and the 5th is partially met. The implementation completed Phase 1 of the spec plan (helper module + CLI shim + schema extension) but skipped Phases 2–5 (fullsolve wiring, /loop wiring, mirror docs, integration test). Without the SKILL.md edits the orchestrator never invokes the helper, so the original bug (
/fullsolve 570running 3 same-SHA same-verdict QA cycles) would still occur today. Plus a confirmed parsing bug inreadDirtyExcludingStatewould defeat AC-2's stated state-file exclusion when the helper is eventually wired up.Per the verdict algorithm:
not_met_count > 0→AC_NOT_MET(no further gates evaluated).Documentation
Next Steps
state-schema.ts+ bothqa-stagnation.tsfiles) so the helper has a stable base and/loopdoesn't see "no diff" on its own working tree.readDirtyExcludingState(src/lib/workflow/qa-stagnation.ts:209-220): either drop the.trim()and useline.slice(3)directly on raw porcelain lines, or migrate to--porcelain=v2with explicit field parsing. Verify with the samenpx tsx scripts/qa-stagnation.ts snapshotsmoke test..claude/skills/fullsolve/SKILL.md§4.3 to invokenpx tsx scripts/qa-stagnation.ts detect <issue>before eachSkill(skill: "qa")after iteration 1, and react tostagnant: trueper the spec plan..claude/skills/loop/SKILL.mdto callsnapshotbefore the fix attempt andcompare-snapshotafter, exitingLOOP_NO_DIFFwhen not progressed.templates/skills/andskills/per AC-5; respect the loop-skill drift caveat (don't reconcile the missing Orchestration Context section in this issue).src/lib/workflow/qa-stagnation.test.tsper AC-4 — table-driven unit tests fordetectStagnation's decision matrix plus an integration test that drives the QA-loop helper with a stub/loopreturning no diff and asserts halt at iteration 1 (notMAX_QA_ITERATIONS).recordStagnationat the detection site so AC-3's telemetry actually lands in.sequant/state.json.[Unreleased]once the wiring lands.admarble commentedon May 7, 2026
QA Review for Issue #581
AC Coverage
.claude/skills/,skills/,templates/skills/) wirenpx tsx scripts/qa-stagnation.ts detect <issue-number>at §4.3 before each /qa re-invocation whenqa_iteration > 0; halts withSAME_SHA_NO_PROGRESSand records telemetry.snapshotLoopProgressbrackets Step 5;compareLoopProgressreturnsLOOP_NO_DIFFwhen neither HEAD nor working-tree (excluding.sequant/) changed; halt with manual-intervention exit.readDirtyExcludingStatecorrectly slicesXY-prefixed porcelain output (no trim corruption); testpreserves leading-space pathsconfirms.QAStagnationEntrySchema+qaStagnation: QAStagnationEntry[]?onIssueStateSchema.recordStagnation()invoked from CLI shim'srecordsubcommand, which both fullsolve §4.3 and loop Step 5.5 invoke. Unit tests cover persistence, additive append (2 entries), missing-issue throw, and additive-schema preservation.src/lib/workflow/qa-stagnation.test.ts(26 tests, 17 KB). Integration suite drives the qa-loop logic against a real temp git worktree with stub /loop returning no diff; asserts halt at iteration 1 withqaInvocations==1(NOTMAX_QA_ITERATIONS=2) andreason==LOOP_NO_DIFF. Additional cases: write-then-revert, multi-iteration progress to MAX_ITERATIONS, READY_FOR_MERGE on first try, and directdetectStagnationSAME_SHA_NO_PROGRESS coverage on a real worktree..claude/skills/{fullsolve,loop}/SKILL.mdand mirrored verbatim totemplates/skills/andskills/.grep -c "Step 5.5: No-Diff Guard"returns 1 in each loop mirror;grep -c "qa-stagnation.ts detect"returns 2 in each fullsolve mirror. Pre-existing drift in OTHER sections (Orchestration Context block in loop mirrors, Step 1 wording) was deliberately left untouched per the spec note "full reconciliation is out of scope."Coverage: 5/5 AC items fully met
Original ACs: 5/5 met
Derived ACs: 0 (none specified)
Quality Plan Verification
N/A — No Feature Quality Planning section in spec comment (Standard tier).
CI Status
No PR exists yet (will be created in Phase 5). CI not yet run.
Quality Metrics
any)0877fb5,a07c4a1,dc473b2)lint:skill-callsCode Review
Strengths:
detectStagnationis a pure function (no I/O), separately testable from CLI side effects — 7-branch decision tree, all branches covered.readDirtyExcludingStatecorrectly handles porcelain v1 quirks: rawslice(3)(not trim), rename arrow extraction, and.sequant/filter — comment explains the bug it's avoiding.qaStagnation?: QAStagnationEntry[]), preserving older state files;recordStagnationcorrectly useswithLockfor concurrency.git inittemp repos rather than mocking git — high-fidelity coverage of the actual code paths.Issues:
Suggestions:
qaStagnationentry even when the gate halts (currently the SKILL.md pseudo-code callsrecordonly onSAME_SHA_NO_PROGRESS, and/loop'sLOOP_NO_DIFFexit also callsrecord); both paths are now covered. Consider a follow-up to surfaceqaStagnationhistory in/assessoutput.compareLoopProgress"same path in both dirty sets = no progress" simplification is fine for the orchestrator's invariant (loop starts on a clean tree), but documenting that invariant in the helper's JSDoc would help future readers.Test Quality Review
stagnant,reason,progressed,qaInvocations(outputs), not internals.git inittemp repos.Anti-Pattern Detection
Code Patterns
src/lib/workflow/qa-stagnation.ts:215execSyncsynchronous I/O in helperfeedback_sync_io_acceptable.md— single-shot CLI helper, not hot path.Critical Issues: 0
Warnings: 0
Call-Site Review
New exported functions detected: 6 (
detectStagnation,recordStagnation,readHeadSha,readIsDirty,snapshotLoopProgress,compareLoopProgress)detectStagnationscripts/qa-stagnation.ts:87(CLIdetect);qa-stagnation.test.ts(10 unit + 1 integration)recordStagnationscripts/qa-stagnation.ts:115(CLIrecord); 4 unit testssnapshotLoopProgressscripts/qa-stagnation.ts:127(CLIsnapshot); 4 testscompareLoopProgressscripts/qa-stagnation.ts:142(CLIcompare-snapshot); 5 unit + 3 integration testsreadHeadSha,readIsDirtydetectStagnationcallers + testsFindings: All call sites match AC constraints. No dead exports.
Execution Evidence
npx vitest run src/lib/workflow/qa-stagnation.test.tsnpm run buildnpm run lint:skill-callsgit inittemp repo, stub /loop, asserts halt at iteration 1)reason=LOOP_NO_DIFF,qaInvocations=1Evidence status: Complete
Skill Command Verification
Skill files changed: 6 (3 fullsolve + 3 loop mirrors)
.claude/skills/fullsolve/SKILL.mddetect,record)<issue-number>) — syntax verified, JSON shape matches CLI shim outputskills/fullsolve/SKILL.mdtemplates/skills/fullsolve/SKILL.md.claude/skills/loop/SKILL.mdsnapshot,compare-snapshot,record, jq parse)snapshotandcompare-snapshotsmoke-tested via 9 unit tests against the same code pathskills/loop/SKILL.mdtemplates/skills/loop/SKILL.mdCommands verified:
npx tsx scripts/qa-stagnation.ts snapshot→ returns{sha, dirty}JSON (covered bysnapshotLoopProgresstests)npx tsx scripts/qa-stagnation.ts compare-snapshot <before> <after>→ returns{progressed, reason, message}JSON (covered bycompareLoopProgresstests)detectandrecordrequire live GitHub issue + state.json — covered by unit tests on the underlying functions.Verification Status: Skipped (placeholders) — equivalent to Passed for verdict purposes.
CLI Registration Verification
N/A — No
RunOptionsor other CLI option interface changes. The newscripts/qa-stagnation.tsis a script invoked directly vianpx tsx, not a sub-command.Skill Change Review
snapshotandcompare-snapshotexercised via 9 tests;detectandrecordexercised via unit tests ondetectStagnation/recordStagnation.stagnant,reason,progressed,message) match CLI consumer expectations (jq filter.progressedin loop SKILL.md).SAME_SHA_NO_PROGRESS,LOOP_NO_DIFF) covered; stagnation gate skipped on iteration 0 (no prior marker possible).npx tsx,gh(for marker fetch indetect),jq(for SKILL.md JSON parsing). All standard sequant prerequisites.Smoke Test
npx vitest run src/lib/workflow/qa-stagnation.test.tsnpm run buildnpm run lint:skill-callsgrep -c "Step 5.5: No-Diff Guard" .claude/skills/loop/SKILL.md skills/loop/SKILL.md templates/skills/loop/SKILL.mddiff -q .claude/skills/fullsolve/SKILL.md skills/fullsolve/SKILL.md templates/skills/fullsolve/SKILL.mdSmoke Test Status: Complete
CHANGELOG Verification
a07c4a1)(#581), under FixedResult: CHANGELOG requirements met.
Self-Evaluation
git inittemp repos; the integration suite provesqaInvocations==1when/loopreturns no diff (NOT MAX_QA_ITERATIONS=2). The newSAME_SHA_NO_PROGRESS-on-real-worktree test directly exercises the resumption path.qaInvocations,reason,halted) not implementation details.<issue-number>placeholders that the orchestrator must substitute. If a future refactor breaks the substitution, the gate would silently no-op (the script would error with usage; the loop would proceed). Mitigation: same placeholder convention as the rest of fullsolve §4.3, which is exercised every fullsolve run.Verdict: READY_FOR_MERGE
All 5 ACs literally met (verified via grep + test execution against the helper code paths). Code quality is high: pure-function decision logic, additive schema, real-worktree integration tests, six-mirror SKILL.md parity for new section, no type
any, no deleted tests, CHANGELOG entry present, lint clean, build clean.The implementation directly addresses the #570 incident pattern documented in the issue body — a future fullsolve invocation that would have wasted 3 cycles on identical SHA / identical
AC_NOT_METverdicts will now halt at iteration 1 with a clearSAME_SHA_NO_PROGRESSorLOOP_NO_DIFFmessage, surface telemetry to.sequant/state.json, and require manual intervention rather than silently consumingMAX_QA_ITERATIONS.Documentation
[Unreleased]>Fixed(bug(fullsolve): QA loop re-runs /qa with no state change instead of escalating same-SHA same-verdict cycles #581)Next Steps
admarble commentedon May 7, 2026
/fullsolve Complete
Issue: #581
Status: READY_FOR_MERGE
PR: #591
Summary
src/lib/workflow/qa-stagnation.test.ts)lint:skill-calls: No violationsIterations
spec:completedmarker)Workflow Resume Path
spec:completed+qa:failed (AC_NOT_MET)markers detected/loopapplied missing Phase 2–5 work: canonical.claude/skills/fullsolve/SKILL.mdwiring, all 3loop/SKILL.mdmirrors with new Step 5.5, consolidated unit + integration test (24 tests)[Unreleased]>Fixed/qare-run posted READY_FOR_MERGE with literal AC verification across all 5 ACsCommits on Branch
0877fb5— feat(bug(fullsolve): QA loop re-runs /qa with no state change instead of escalating same-SHA same-verdict cycles #581): fullsolve QA loop early-exit on same-SHA same-verdict cyclesa07c4a1— docs(bug(fullsolve): QA loop re-runs /qa with no state change instead of escalating same-SHA same-verdict cycles #581): add CHANGELOG entry for fullsolve QA loop early-exitdc473b2— test(bug(fullsolve): QA loop re-runs /qa with no state change instead of escalating same-SHA same-verdict cycles #581): rename misleading test + add proper SAME_SHA_NO_PROGRESS coverageReady for human review and merge.