Repository navigation
Conversation
…ENCE marker fields Entire-Checkpoint: ae6eed2ba02d
…path Entire-Checkpoint: 8825974824b4
Entire-Checkpoint: adc3f98e8c12
…ladder, verbose label Entire-Checkpoint: 9755c3346c39
… three mirrors Entire-Checkpoint: b8d099eedc41
…CHANGELOG Entire-Checkpoint: e841b5163781
…ly once Entire-Checkpoint: a9828201e4fb
… now parses it Entire-Checkpoint: 474f06e00233
The rigged AC-14 run surfaced that the escape hatch was documented into an unreachable state. The skills routed the marker to a `gh issue comment`, but under `sequant run` the phase posts no issue comment at all, and the driver fills `AgentPhaseResult.output` from assistant text blocks only (drivers/claude-code.ts:194-199). `parsePhaseMarkers` additionally strips fenced code, so the documented example cannot double as the declaration. Net effect before this commit: `specDivergence` was always undefined under orchestration, so a diverging spec retried and climbed the ladder anyway -- the exact cost #971 AC-4 exists to avoid. States the channel explicitly in both skills, all three mirrors. Entire-Checkpoint: 639e0fdfb793
… skill wording The suite was green over the AC-14 defect because every divergence test hands a literal string to `parseSpecDivergence`. Nothing drove driver-shaped output through `mapAgentSuccessToPhaseResult`, which is where the marker is actually read in a real run. Adds a test reproducing `ClaudeCodeDriver`'s assistant-text-only capture and asserting all three cases: marker in a tool input -> undefined (the shipped defect), marker fenced in assistant text -> undefined (stripped by design), marker bare in the final message -> parsed. Extends the AC-4 skill gate to assert the section names the channel, not just the marker. Entire-Checkpoint: 7e769fe92af6
The escape-hatch entry described the marker but not where it must appear. Under `sequant run` a marker routed only to a `gh issue comment` never reaches the parser, which is the defect the AC-14 rigged run surfaced. Entire-Checkpoint: 7ea7cc84697b
…a-branch reachability QA surfaced two non-blocking gaps. 1. `divergence-halt.ts` had no direct test. The halt tests drive the formatter through the real run and ready-gate paths, but never reach an empty `shasTried`, an empty `iterations` list, a present-but-empty `declaredAcs`, or a NON-empty escalation history. That last pair is the load-bearing evidence for "no rung was spent" (#971 AC-3/AC-4): a renderer that printed "(empty ...)" over a populated history would invert the bundle's meaning with every integration test still green. 14 tests close those branches. 2. `ready-gate.ts`'s qa-phase `specDivergence` branch is unreachable today -- no skill instructs a qa agent to emit the marker. Kept rather than dropped because `batch-executor.ts`'s run-path check is phase-agnostic, so deleting it would make the two paths disagree on the same input. The comment now states that plainly, and records why documenting the hatch in the qa skill is out of #995's scope rather than leaving it to be rediscovered. Entire-Checkpoint: 39b6ff1922d4
6 tasks
admarble
deleted the
feature/995-feat-run-spec-divergence-escape-hatch-ladder-halts
branch
September 8, 2026 10:01
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
The other half of #971's bargain: the ladder now knows when to stop instead of climbing. Three halts, each printing an evidence bundle and ending the run — plus the
SPEC_DIVERGENCEescape hatch an agent uses to declare an acceptance criterion impossible as written.SPEC_DIVERGENCE— agent-declared via"outcome":"SPEC_DIVERGENCE"in its ownSEQUANT_PHASEmarker. Terminal for the retry path as well as the ladder: no cold-start retry, no MCP fallback, no rung spent.DIVERGENCE_SUSPECT— two consecutive iterations that each produced a diff at a still-failing verdict. Two, not one: a single such iteration is the ordinaryAC_NOT_MET → /loop → re-QAcycle.TOP_OF_LADDER— a further capability-bound trigger on the last rung, reported distinctly fromMAX_ITERATIONS.sequant readygains the three matching terminal reasons; verbose output names triggers in words at all four dispatch print sites; new Model Escalation Ladder reference doc.AC verification
vitest -t "971 AC-3 halt"→ 3 passedvitest -t "971 AC-4"→ 7 passed;grep -c SPEC_DIVERGENCE templates/skills/{exec,loop}/SKILL.md→ 3, 3 (≥1);md5 -q … | uniq | wc -l→ 1 for exec and 1 for loopvitest -t "971 AC-9"→ 2 passedvitest -t "971 AC-10 verbose"→ 2 passedgrep -c 'modelLadder|model-ladder'→ README 2,model-ladder.md4,run-command.md2 (≥2 under the strict per-file reading, OQ-2);grep -c SPEC_DIVERGENCE docs/reference/*.md→model-ladder.md6,run-command.md2 (≥1)model-ladder.test.ts— no halt reachable without a configured laddermetrics.jsonstill parse383315d2— retry-path guard asserts dispatch count, not just final statusFull ladder suites:
model-ladder+phase-executor.model-ladder+batch-executor.model-ladder→ 85 passed.phase-executor+phase-detection→ 229 passed. Build ✅ · Lint ✅ (0 warnings) ·check-skill-sync→ 44 synced, 0 diverged ·lint:skill-calls→ 0 violations.AC-14 — the rigged run, and the defect it caught
Fixture #1015 (single AC: a file must both exist and not exist) was run twice through the real
sequant runmachinery. The first run failed, and that is the point — it surfaced a genuine shipped defect that the whole green suite was blind to.Run 1 (
c9b05922) — did not halt. Root cause, fixed here ineff47840:ClaudeCodeDriverfillsAgentPhaseResult.outputfrom assistant text blocks only (drivers/claude-code.ts:194-199).gh issue comment— a tool input, never inoutput. Undersequant runthe exec phase posts no issue comment at all, so the marker had no channel whatsoever.parsePhaseMarkersadditionally strips fenced code, so the documented example could not double as the declaration.Net effect:
specDivergencewas alwaysundefinedunder orchestration and a diverging spec climbed the ladder anyway — the precise cost #971 AC-4 exists to avoid. The suite was green because every divergence test handed a literal string straight to the parser; nothing drove driver-shaped output throughmapAgentSuccessToPhaseResult.53e6f918closes that hole.Run 2 (
8f0e181d) — halted as specified, in 31 s on one exec dispatch:Run record:
phases: ["exec"]—qawas suppressed, not merely failed.phasePolicies.exec.resolvedModel = claude-sonnet-5, the ladder's bottom rung. AC-14jqover.sequant/metrics.json→0. Fixture #1015 closed with a comment linking the run.Honest caveat on that
jq. It returns0as AC-14 requires, but it is weak evidence on its own:phaseUsageis absent from every recent run record, not just this one, so the filter has nothing to reject. The load-bearing evidence is the empty escalation history in the halt bundle plusresolvedModel = claude-sonnet-5. Flagged here for the owner rather than filed as an issue (I-7).Mutation-verified gate tests
Both mutations were run against a committed tree and restored; the suite is green after restore.
Mutation-verified: AC-4 — replaced
SEQUANT_PHASEwithSEQUANT_execin the exec skill's example marker (all 3 mirrors);971 AC-4 … the exec and loop skills tell agents when to emit the marker, in all three mirrored copiesfailed (expected [] to have a length of 1 but got +0); restored.Mutation-verified: AC-4 — replaced the "final response message" channel wording with "a
gh issue comment" in both skills (all 6 mirrors); the same test failed (expected 'When the spec is impossible as writte…' to match /final response\s+message/); restored.AC-12 is gated by a manual
grep, not by a test, so it carries no mutation record — its outputs are quoted verbatim in the AC table above.Known gaps
phaseUsageis not emitted on this run path (see caveat above), which makes AC-14'sjqa weaker check than it reads. Owner's call whether that warrants follow-up.Closes #995
Post-QA follow-up (commit
5bac217d)QA returned
AC_MET_BUT_NOT_A_PLUSwith two non-blocking gaps. Both are now closed.1.
divergence-halt.tshad no direct test. The halt tests drive the formatter through the real run and ready-gate paths, but never reach an emptyshasTried, an emptyiterationslist, a present-but-emptydeclaredAcs, or a non-empty escalation history. That last pair is the load-bearing evidence for "no rung was spent" — a renderer that printed(empty …)over a populated history would invert the bundle's meaning with every integration test still green. Newdivergence-halt.test.ts: 14 tests.Mutation-verified: replaced the
(empty — no model rung was spent)line with(none);formatEvidenceBundle: escalation history is the 'no rung spent' proof > spells out an EMPTY history rather than omitting the sectionfailed; restored, 14/14 green.2.
ready-gate.ts's qa-phase branch is unreachable today. Kept rather than dropped:batch-executor.ts's run-path check is phase-agnostic (it readsresult.specDivergencefor every phase,qaincluded), so deleting this would make the two paths disagree on the same input. The comment now states the reachability plainly and records why documenting the hatch in theqaskill is out of #995's scope — that skill's one-shot contract requires a### Verdict:line from a closed four-value set, so adding a fifth exit is a design decision, not a gap fill. Owner's call.The QA phase emitted
AC_MET_BUT_NOT_A_PLUS, but the orchestrator recordedAC_NOT_METand dispatched a/loopiteration on that false premise. Cause:parseQaVerdict(phase-executor.ts:508) usesString.match— first match wins — and its patternVerdict:?[^A-Za-z0-9_]*(…)matchesverdict=AC_NOT_MET, which appeared earlier in the body where the QA comment quoted a test's own assertion string.Any QA comment that quotes a verdict token before its own verdict line is mis-scraped.
parseQaVerdictis untouched by this PR (git diff origin/main...HEAD→ 0 occurrences); reporting rather than fixing, since it is shared QA-parsing code well outside #995's scope and needs its own tests. No issue filed, per I-7.