Repository navigation
Conversation
Adds a stagnation gate to /fullsolve's QA loop and a no-diff guard to /loop so that wasted iterations (same HEAD SHA, same AC_NOT_MET verdict) halt with a hard blocker instead of consuming MAX_QA_ITERATIONS. - src/lib/workflow/qa-stagnation.ts — detectStagnation() + recordStagnation() + snapshotLoopProgress()/compareLoopProgress() helpers, with .sequant/ exclusion for state-file writes (per issue's open question). - scripts/qa-stagnation.ts — CLI shim (detect / record / snapshot / compare-snapshot) so SKILL.md and tests exercise the same code path. - state-schema.ts — additive QAStagnationEntrySchema + qaStagnation array on IssueState (AC-3 telemetry). - /fullsolve SKILL.md (3 mirrors) — §4.3 wires the stagnation detector before each /qa re-invocation after iteration 0; halts on SAME_SHA_NO_PROGRESS (AC-1, AC-5). - /loop SKILL.md (3 mirrors) — new Step 5.5 No-Diff Guard takes a before/after snapshot and exits with LOOP_NO_DIFF if /loop produced no commit and no working-tree change excluding .sequant/ (AC-2, AC-5). - qa-stagnation.test.ts — unit + integration coverage: AC-3 recordStagnation persistence, AC-4 simulator proves halt at iteration 1 (NOT MAX_QA_ITERATIONS) when /loop returns no diff. Closes #581
Documents the SAME_SHA_NO_PROGRESS / LOOP_NO_DIFF escalation gates, the new qa-stagnation helpers and CLI shim, the additive QAStagnationEntrySchema, and the unit + integration test coverage.
…coverage - Rename 'halts via SAME_SHA_NO_PROGRESS at iteration 2 if /loop appears to diff but state is restored' to accurately describe LOOP_NO_DIFF halt. - Add new test that exercises SAME_SHA_NO_PROGRESS detection directly via detectStagnation() against a real worktree, covering the resumption path (prior qa:failed marker at current HEAD, no /loop in this invocation). - Add new test where /loop writes-then-reverts (clean tree at gate) to exercise the LOOP_NO_DIFF early-halt path on iteration 1. 26 tests pass.
5 tasks
admarble
deleted the
feature/581-bug-fullsolve-qa-loop-re-runs-qa-with-no-state-cha
branch
May 7, 2026 01:58
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
Fixes the QA loop in
/fullsolvethat previously consumedMAX_QA_ITERATIONS=2re-running/qaon identical state when/loopproduced no commit and no working-tree change. Two new escalation gates short-circuit the wasted-cycle pattern surfaced during/fullsolve 570(3 sequentialAC_NOT_METverdicts at SHAcb77c8e6):/qastagnation gate in/fullsolve§4.3 — runsnpx tsx scripts/qa-stagnation.ts detect <issue>before each/qare-invocation after iteration 0; halts withSAME_SHA_NO_PROGRESSwhen the priorqa:failedmarker'scommitSHAmatches HEAD ANDgit status --porcelainis empty./loopno-diff guard as new "Step 5.5" in/loop— snapshot/compare brackets Step 5 (Fix Issues) and exits withLOOP_NO_DIFFwhen neither HEAD nor the working-tree (excluding.sequant/state writes) changed.What Changed
src/lib/workflow/qa-stagnation.ts(new, 285 lines) —detectStagnation()(pure decision function, 7 branches),recordStagnation()(additiveqaStagnationarray onIssueState),snapshotLoopProgress()/compareLoopProgress()(with.sequant/exclusion in the porcelain v1 parser).scripts/qa-stagnation.ts(new, 150 lines) — CLI shim (detect/record/snapshot/compare-snapshot) so SKILL.md and tests exercise the same code path.src/lib/workflow/state-schema.ts— additiveQAStagnationEntrySchema+ optionalqaStagnation: QAStagnationEntry[]field onIssueState(preserves older state files).{.claude/skills,skills,templates/skills}/fullsolve/SKILL.md— §4.3 wired with stagnation gate + record + halt.{.claude/skills,skills,templates/skills}/loop/SKILL.md— new "Step 5.5: No-Diff Guard" section in all 3 mirrors.src/lib/workflow/qa-stagnation.test.ts(new, 26 tests) — covers alldetectStagnationbranches,recordStagnationpersistence + additive append,compareLoopProgresspaths,.sequant/exclusion, leading-space porcelain handling, and a 4-test integration suite that drives the qa-loop logic against realgit inittemp repos.CHANGELOG.md— entry under[Unreleased]>Fixed.Pre-existing drift between
loop/SKILL.mdmirrors (Orchestration Context block missing fromskills/andtemplates/skills/) was deliberately left untouched per the spec note: "full reconciliation is out of scope."AC Coverage (5/5 MET)
/qano-progress gate in fullsolve QA loop — wired in all 3 mirrors at §4.3./loopno-diff guard — new Step 5.5 in all 3 mirrors;readDirtyExcludingStatecorrectly slices porcelain v1XYprefix without trim corruption..sequant/state.json— additive schema + caller (CLI shim invoked from both fullsolve and loop SKILL.md) + 4 unit tests.qaInvocations==1(NOT MAX_QA_ITERATIONS=2) andreason==LOOP_NO_DIFFagainst a real git worktree.Quality Metrics
lint:skill-calls: No violationsany): 0Closes #581
Test plan
npx vitest run src/lib/workflow/qa-stagnation.test.ts— 26 tests passnpm run build— tsc cleannpm run lint:skill-calls— no unqualifiedSkill()callsdiff -qconfirms all 3 fullsolve SKILL.md mirrors identical; loop mirrors share identical new Step 5.5 sectiongit inittemp repo + stub/loopreturning no diff → halts at iteration 1 withLOOP_NO_DIFF/fullsolveinvocation on a stuck issue should halt with stagnation telemetry instead of consuming 2 wasted cycles