Repository navigation
feat(#1646): the quality loop halts on a second consecutive AC_NOT_MET — its own counter, no ladder needed; maxIterations stays 3 - #1660
Merged
admarble merged 2 commits intoNov 8, 2026
Conversation
…T — its own counter, no ladder needed; maxIterations stays 3 A counter on the parsed QA verdict in recordLoopPhaseOutcome stops the loop before the next /loop spawn when AC_NOT_MET repeats; any other verdict or none resets it. One loopHalted(state) predicate replaces the two duplicated halt lists. The issue fails with category ac_not_met_repeated, an abortReason naming both SHAs and the failed ACs, and an EvidenceBundle with reason AC_NOT_MET_REPEATED and per-iteration failedAcs (run log version stays 1). Entire-Checkpoint: 1b8b0a83d395
Contributor
Author
Read firstComputed from the diff, the issue's Residue
Tests
Explained
AC verdict: the |
…LD are file-local (no importer)
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
How it works:
recordAcNotMetStreakinbatch-executor.tsruns after every QA phase. AnAC_NOT_METverdict adds{iteration, sha, verdict, failedAcs}to a list. Any other verdict, or no verdict, empties the list. It reuses the commit SHA already looked up for the verdict comment and the AC rowsrecordAcStatusesalready returns, so it adds no git calls.repeatHaltBundleand prints the bundle withwarn. The bundle's reason is the newAC_NOT_MET_REPEATED. A newloopHalted(state)check now drives both the outer-loopbreakand the/loopspawn guard, which used to have separate copies of the same list. Nothing in this path depends on the ladder, so chore(cli)!: remove the model ladder and effort escalation — modules,--model-ladderand--escalate-efforton run and ready, their settings and docs; old logs and settings still load #1647 can delete the ladder without losing this halt.repeatHaltOutcomesetsfailureCategory: "ac_not_met_repeated". TheabortReasonreadsac_not_met_repeated: AC_NOT_MET twice in qa at <sha1>, <sha2> (failed: AC-…), and the evidence bundle is attached. The existingrecordIssueCompletionpath writes both to the run log; a test covers this.versionstays 1:ac_not_met_repeatedis added toERROR_CATEGORIESand to the inline category list in the schema.AC_NOT_MET_REPEATEDis a new bundle reason.failedAcs.divergence-halt.ts: the additive edit the spec recommended.src/mcp/tools/run.ts: itshaltReasontype needed the new reason to compile.__tests__/error-capture.test.ts: this test checks the category count, so it now expects 11 categories, one more than before.Pre-PR AC Verification
npx vitest run src/lib/workflow/batch-executor.repeat-halt.test.ts→ 6 passed, 0 failed (repeat halt, refusal then pass, null verdict resets, no AC record, no snapshot without a ladder, reaches the run log)npx vitest run src/lib/workflow/run-log-schema.test.ts -t "ac_not_met_repeated"→ 3 passed, 0 failed; all existing fixtures still validategrep -c 'maxIterations: z.number().positive().default(3)' src/lib/settings.ts→1(not touched)docs/reference/run-command.md, under### Quality Loop Mode→1CHANGELOG.md[Unreleased]### Changed→1(#1370 is not merged, so nochangelog.d/)0No AC is a gate test, so there are no
SEQUANT_MUTATIONmarkers. As an extra check, I removedrepeatHaltBundlefromloopHalted: the 4 halt tests failed and the 2 no-halt tests passed. Then I restored the file.Checks
npm run build: passed.npm run lint: passed, 0 warnings.npx vitest run --changed origin/mainselected 172 files, so I ran it in 3 shards with everySEQUANT_*variable unset:__tests__/error-capture.test.ts. That test hard-codes the category count at 10, and my change made it 11. I updated it and it now passes, 29/29.divergence-halt.test.ts,batch-executor.test.ts,batch-executor.model-ladder.test.ts,mcp-run-async.test.tsand the files that grep for the changed paths.scripts/qa/health-report.test.tspassed separately, 12/12.batch-executor.tsis covered by the newbatch-executor.repeat-halt.test.ts,run-log-schema.tsby its schema test, and the category list byerror-capture.test.ts.OQ-2
One of 92 run logs in
.sequant/logs/(main checkout plus this worktree) has two QA verdicts in a row that are both `AC_NOT_MEFixes #1646
Follow-ups
🤖 Generated by
sequant runRunner verification (graph-2026-11-simplify W1, 2026-11-07)
NEEDS_VERIFICATION; its only blocking gap was CI pending. I re-ran all six AC commands verbatim in the worktree: AC-1 6 passed, 0 failed (≥ 4 needed); AC-2 3 passed / 83 skipped, 0 failed; AC-31; AC-41; AC-51; AC-60. Tier confirmed from the run log: spec, exec and qa allclaude-opus-5-5(judgment).997ae80da:repeatHaltOutcomeandAC_NOT_MET_REPEAT_HALT_THRESHOLDhad no importer outside the file (QArepository_gap), so both are file-local now.tsc --noEmitand eslint are clean, and AC-1 is re-run at 6 passed.test_gap("an iteration that never reaches qa does not reset the streak") is dropped on purpose. It matches H-1, which counts consecutive QA verdicts only, so an iteration with no verdict neither adds to the streak nor resets it. Recorded on feat(run): the quality loop halts on a second consecutive AC_NOT_MET — its own counter, no ladder needed; maxIterations stays 3 #1646.Execution: split) is smoke(simplify): first real use — one detached run of amainbuild on two notes-fixture smoke issues, after #S-01 to #S-07 merge; the owner reads the report #1655, the smoke.Closes #1646