Repository navigation
Description
Epic: graph-2026-11-simplify (F-10 cluster of #1501) Tier: judgment Execution: sequant_run Blocked by: #1646 (the repeat halt must stand on its own before the ladder that feeds the divergence halt goes; both edit the quality loop in batch-executor.ts)
Problem
D-1. In 453 recorded runs (2026-01-21 to 2026-10-28) --model-ladder and --escalate-effort were used 0 times and neither setting is on in this repo. They are 605 + 116 lines (model-ladder.ts, effort-escalation.ts) plus wiring in batch-executor.ts, phase-executor.ts, config-resolver.ts, settings.ts, three schemas, and flags on both run and ready (bin/cli.ts:442,450,670,676). An advisor on the retry rung (#1138) changed neither verdicts nor loop counts. Founding doc §4, P-4, P-5.
Decisions
| ID | Decision | Rejected |
|---|---|---|
| R-1 | Delete both modules, their tests, the four flag definitions, run.modelLadder and effortEscalation, and the ladder state in batch-executor.ts |
keeping the modules behind a hidden flag |
| R-2 | Schemas keep reading ladderRung, escalatedModel, escalationTrigger, escalationHistory and ladder_halt as optional (I-2); nothing writes them |
a schema version: 2 |
| R-3 | A settings file that still sets modelLadder or effortEscalation loads, with one warning naming the removal in 3.0 |
a hard error |
| R-4 | divergence-halt.ts stays (ready-gate.ts, log-writer.ts, run-log-schema.ts import it); the SPEC_DIVERGENCE halt keeps working with no ladder; the divergence-suspect block, whose only feed is the ladder snapshot, goes with the ladder |
deleting divergence-halt.ts with the ladder |
Prior fixes / producers
- Prior removals: arch: extract RunOrchestrator — decouple execution engine from CLI wiring #503–arch: in-process MCP engine — eliminate subprocess indirection and enable real-time streaming #508 (2026-04 descoping). Class: outcome per named surface.
- Producers:
bin/cli.ts(flags),src/lib/settings.ts(schema,KNOWN_KEYS, defaults, the generated settings table),src/lib/workflow/config-resolver.ts,batch-executor.ts,phase-executor.ts,metrics-writer.ts,log-writer.ts; readersstate-schema.ts,run-log-schema.ts,metrics-schema.ts,src/commands/logs.ts,src/commands/stats.ts; docs underdocs/reference/anddocs/features/.
Acceptance Criteria
- AC-1: Both modules are gone and nothing imports them, tests included. Evidence:
grep -rlE 'model-ladder|effort-escalation' src bin --include='*.ts' | wc -l | tr -d ' '→0 - AC-2: Neither flag appears on
runorready. Evidence:for c in run ready; do npx tsx bin/cli.ts $c --help; done | grep -cE -- '--model-ladder|--escalate-effort'→0 - AC-3: A settings file that sets
modelLadderandeffortEscalationloads with exactly one warning per removed key that names 3.0, and the run proceeds. Evidence:npx vitest run src/lib/settings.removed-keys.test.ts→≥ 2 passed, 0 failed - AC-4: A pre-3.0 run log carrying
ladder_halt,escalationHistoryand ladder fields on its phases validates, andsequant logsrenders it. Evidence:npx vitest run src/lib/workflow/run-log-schema.legacy.test.ts→≥ 2 passed, 0 failed - AC-5: The
SPEC_DIVERGENCEhalt still fires with no ladder configured. Evidence:npx vitest run src/lib/workflow/divergence-halt.test.ts→0 failed(constraint) - AC-6: User docs no longer offer the features. Evidence:
grep -rlE -- 'model-ladder|escalate-effort|modelLadder|effortEscalation' README.md docs/reference docs/features docs/guides docs/getting-started | wc -l | tr -d ' '→0 - AC-7: The changelog records the removal. Evidence:
awk '/^## \[Unreleased\]/,/^## \[[0-9]/' CHANGELOG.md | grep -cE -- '--model-ladder|--escalate-effort'→≥ 1 - AC-8: No skill-directory edits. Evidence:
git diff --name-only $(git merge-base origin/main HEAD)..HEAD | grep -cE '^(plugin/|\.claude/skills/|templates/skills/)'→0(constraint)
isGateTestEvidence classifies none of these ACs as a gate (parse-check, 2026-11-04). AC-4's legacy test still earns its place only if it fails when the schema stops reading old fields: the PR body records that run (make ladderRung required → the legacy test fails; restore) in the Mutation-verified: format.
May touch
src/lib/workflow/model-ladder.ts, effort-escalation.ts and their tests (deleted), batch-executor.ts and batch-executor.model-ladder.test.ts, phase-executor.ts and phase-executor.{model-ladder,effort-escalation}.test.ts, config-resolver.ts, metrics-schema.ts and metrics-schema.effort-escalation.test.ts, state-schema.ts, run-log-schema.ts, log-writer.ts, metrics-writer.ts, types.ts, run-orchestrator.ts, divergence-halt.ts and ready-gate.ts (comments and ladder-only branches; the SPEC_DIVERGENCE halt and the gate's loop unchanged), src/lib/settings.ts, src/commands/run.ts, src/commands/ready.ts, src/mcp/tools/run.ts, bin/cli.ts (the four .option( blocks only), __fixtures__/ (one legacy run log), the named docs pages, CHANGELOG.
Non-Goals
--stacked,--reflect,--full-qa(chore(cli)!: remove--stacked,--reflectand--full-qa— flags,run.fullQa, the MCPfullQaparameter andrun-reflect.ts;--chainkeeps working #1648).- The ready gate's loop and
divergence-halt.ts. - Skills (I-1).
Done when
No code, flag, setting or user doc offers the ladder or escalation, and every pre-3.0 log and settings file still loads.
Activity
docs(#1645): HANDOFF — #1660 and #1659 merged, #1662 filed, #1647 on …
admarble commentedon Nov 8, 2026
Runner context, 2026-11-08: repo state since this issue was written
#1646 merged as
f5489a8fe(PR #1660), and #1649 asa5bba3067. Read the quality loop onmainata5bba3067, not as it stood when this issue was filed.loopHalted(state)inbatch-executor.ts, the one stop predicate the outerbreakand the/loopspawn guard both read;state.repeatHaltBundle;repeatHaltOutcomewith categoryac_not_met_repeated; and theAC_NOT_MET_REPEATEDreason indivergence-halt.ts. Its tests are inbatch-executor.repeat-halt.test.ts. The halt reads only parsed QA verdicts and needs no snapshot, so it doesn't depend onisLadderConfigured.TOP_OF_LADDERassignment (batch-executor.ts:2380) and the divergence-suspect block (:3042, fed by the ladder snapshot thatisLadderConfiguredgates at:2157).loopHaltedkeeps readinghaltedByDivergence, becauseSPEC_DIVERGENCEstill sets it (:2479).SPEC_DIVERGENCEhalt records its issue outcome throughladderHaltOutcome(:1989→:722), which writes categoryladder_halt. R-2's "nothing writes them" holds for the ladder fields, but R-4 keeps this halt working. So unless the spec finds a reason against it, the reading here is: the spec-divergence halt keeps writingladder_halt(no log shape changes, consistent with I-2). If you rename the helper, that's fine, but the category it writes stays the same. A new category would also neederror-classifier.ts, which is outside "May touch". If the spec concludes a new category is required, say so in the spec comment and stop; don't widen the scope.CHANGELOG.md[Unreleased]anddocs/reference/run-command.mdnow carry feat(run): the quality loop halts on a second consecutive AC_NOT_MET — its own counter, no ladder needed; maxIterations stays 3 #1646's and fix(run)!: no label adds thetestphase to a phase list the user or detection chose — remove the UI-label insertion indeterminePhasesForIssue(closes #1631) #1649's entries. Add yours beside them; don't rewrite theirs. PR feat(#1351): improve(release): changelog fragments instead of a shared [Unreleased] block — 121/192 main commits touch CHANGELOG.md #1370 (changelog fragments) is still open. If it merges first, AC-7's awk needs the fragment path instead.src/lib/settings.removed-keys.test.tsand AC-4'srun-log-schema.legacy.test.tsdon't exist yet. This issue creates them (anti-gap pass 4).admarble commentedon Nov 8, 2026
Complexity: Standard (8 ACs, 5 directories:
src/lib/workflow,src/lib,src/commands,bin,docs)AC Quality Check
Every AC is one line with an
Evidence:clause, and the issue has a## Non-Goalssection. Each evidence command was run onmainata5bba3067to make sure it fails there:run-command.md,ready-command.md,model-ladder.md,mcp-server.md). Fails, as it should.One catch on AC-1: the grep matches comments as well as imports. These files only mention
model-ladder/effort-escalationin prose, and their wording has to change too:divergence-halt.ts,divergence-halt.test.ts,batch-executor.repeat-halt.test.ts,batch-executor.test.ts,state-schema.ts,metrics-schema.ts,settings.ts,types.ts,config-resolver.ts.Scope Assessment
Non-Goals:
--stacked/--reflect/--full-qa(#1648); the ready gate's loop anddivergence-halt.ts; skills.Verdict:⚠️ SCOPE_WARNING. This is wide but mechanical: 721 lines of modules, about 7 test files deleted and about 14 test files edited. The quality loop is on.
Acceptance Criteria
AC-1: Both modules are gone and nothing imports them
Verification: Integration Test (grep) plus
npx tsc --noEmitScenario: Given
main→ Whenmodel-ladder.tsandeffort-escalation.tsand their tests are deleted → Then the grep returns 0 and the build passes.Assumptions:
divergence-halt.ts:30importstype ModelEscalationRecordfrommodel-ladder.ts. The type moves intodivergence-halt.ts, becauseEvidenceBundle.escalationHistoryand the run-log schema still read it.ready.ts:25andrun-orchestrator.ts:94importformatEscalationTriggerLabel. That import goes along with the escalation printout it serves.AC-2: No
--model-ladder/--escalate-effortonrunorreadyVerification: Integration Test (CLI help)
Scenario:
sequant run --helpandsequant ready --help→ no match.Assumptions: Only the four
.option(blocks inbin/cli.ts(around :442/450/670/676) are touched.RunOptions.escalateEffort/modelLadderintypes.tsandReadyOptionsinready.tsgo too.src/mcp/tools/run.tshas no such input params, only thehaltReasontype (see OQ-2).AC-3: Old settings keys load with exactly one "removed in 3.0" warning each
Verification: Unit Test (new
src/lib/settings.removed-keys.test.ts)Scenario:
validateSettings({run:{modelLadder:["sonnet","opus"], effortEscalation:true}})→ exactly 2 warnings, one per path, each naming 3.0. NoUnknown keywarning for either. The other settings resolve normally, and neither key appears onsettings.run.Assumptions: Existing bug found:
run.effortEscalationis missing fromKNOWN_KEYS.run. Today it already warnsUnknown key 'run.effortEscalation' (ignored)even though it works (verified onmain). So the test must assert both keys explicitly, including that the generic unknown-key warning does not fire as well. Mechanism: aREMOVED_KEYSmap ("run.modelLadder","run.effortEscalation"→ message) checked indetectUnknownKeysbefore the unknown-key branch. The nestedrunZod schema already strips keys it doesn't know, so no schema entry is needed.AC-4: A pre-3.0 run log with ladder fields validates and
sequant logsrenders itVerification: Unit Test (new
src/lib/workflow/run-log-schema.legacy.test.tsplus one fixture insrc/lib/workflow/__fixtures__/)Scenario: The fixture has
failureCategory: "ladder_halt", a halt bundle whoseescalationHistoryis non-empty and whose reason isTOP_OF_LADDER, and phases carryingladderRung/escalatedModel/escalationTrigger/topOfLadder→RunLogSchema.parsesucceeds, andlogsCommandon that file exits 0 and prints the issue.Assumptions: The PR body records the mutation: make
ladderRungrequired → the legacy test fails → restore. ThatladderRungis in the state schema and the metrics schema, so the mutation must target whichever field the run-log fixture really carries (the halt bundle'sescalationHistory[].rung, or the phase-level field inrun-log-schema.ts). Pick the field the fixture actually exercises, and record it withsequant mutation.AC-5:
SPEC_DIVERGENCEstill halts with no ladder (constraint)Verification: Unit Test (existing
divergence-halt.test.ts, plusbatch-executor.repeat-halt.test.tsmust stay green)Scenario: The loop phase declares
SPEC_DIVERGENCE→haltedByDivergenceis set (batch-executor :2479) →loopHalted(state)stops the loop → the issue outcome isladder_haltthroughladderHaltOutcome.AC-6: User docs no longer offer the features
Verification: Integration Test (grep)
Assumptions:
docs/reference/model-ladder.mdalso documents theSPEC_DIVERGENCEescape hatch and the halt bundle, and both survive. Recommendation: rename it todocs/reference/spec-divergence-halt.md, keep theSPEC_DIVERGENCEand repeat-halt sections, and drop the ladder sections. Then update the links inREADME.md:358,run-command.md:482,docs/THREAT-MODEL.mdandmcp-server.md.README.md:100and:326andrun-command.md:72-74, 458-482are edited in place.ready-command.md:72loses its flag row.AC-7: CHANGELOG
[Unreleased]records the removalVerification: Integration Test (awk/grep)
Assumptions: Add a
### Removedentry next to #1646/#1649 without rewriting theirs. If PR #1370 (fragments) merges first, write a fragment instead and adjust the evidence path. #1370 is still OPEN as of 2026-11-08.AC-8: No skill-directory edits (constraint)
Verification: Integration Test (git diff)
Assumptions: No skill or hook reads
SEQUANT_MODEL_RUNG/SEQUANT_ESCALATION_TRIGGER/SEQUANT_MODEL_TOP_OF_LADDER. A whole-repo grep finds onlyphase-executor.ts, the ladder tests andstate-schema.ts. So the env-var producer inphase-executor.ts:1696-1711can go without a skill edit.Implementation Plan
Phase 1: Cut the producers (
src/lib/workflow)effort-escalation/model-ladderimports,ladderState,lastTrigger,modelTrigger,modelEscalations, thewithEscalatedEffort/withEscalatedModeldispatch (:2317-2390, including theTOP_OF_LADDERassignment at :2380), theisLadderConfiguredsnapshot gate (:2157-2190), the divergence-suspect block (:3025-3055),consecutiveDivergenceSuspectandDIVERGENCE_SUSPECT_HALT_THRESHOLD. Keep:loopHalted,haltedByDivergence(now onlySPEC_DIVERGENCEsets it),repeatHaltBundle/repeatHaltOutcome,ladderHaltOutcome(categoryladder_haltunchanged, doc comment reworded), andbuildBundlewithescalationHistory: [].TOP_OF_LADDER/DIVERGENCE_SUSPECTfinishes, and theeffortEscalations/modelEscalationsfields ofReadyResult. Keep theSPEC_DIVERGENCEfinishes (:863, :975), the halt bundle, and the loop's iteration logic exactly as it is (Non-Goal).config.modelEscalationenv threading (:1696-1711) and theescalatedModelspread into the phase marker (:1958-1962). types.ts: removeeffortEscalation,modelLadder*andmodelEscalationfromExecutionConfig,ModelEscalationFacts, andescalateEffort/modelLadderfromRunOptions. config-resolver.ts: remove the ladder resolver (:470-565) and its two assignments (:671-690).ModelEscalationRecordas a local read-shape type and update the comments that mention the module. The union and the formatter stay as they are (Non-Goal).model-ladder.ts,effort-escalation.ts, and the test filesmodel-ladder{,.recording}.test.ts,effort-escalation.test.ts,batch-executor.model-ladder.test.ts,phase-executor.{model-ladder,effort-escalation}.test.ts.Phase 2: Readers stay, writers stop (R-2)
state-schema.ts,run-log-schema.tsandmetrics-schema.tskeep every ladder field,ladder_halt, and theDIVERGENCE_SUSPECT/TOP_OF_LADDERbundle reasons as optional reads. Update the comments to say "read-only since 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".createMetricRun/metrics-writer.tsdrop theireffortEscalations/modelEscalationsoptions, while the schema still reads those fields. Turnmetrics-schema.effort-escalation.test.tsinto a test that legacy metrics rows still parse, or fold it into the AC-4 legacy test.run-orchestrator.ts:2462-2550andready.ts:65-269: remove the escalation merge, the printouts and the option passthrough.Phase 3: CLI, settings, tests
bin/cli.ts: remove the four.option(blocks.settings.ts: removeeffortEscalation/modelLadderfrom the interface, the schema, the defaults (:1101),KNOWN_KEYSand the generated settings-table row (:1845). AddREMOVED_KEYSwith the one-warning behavior. Writesettings.removed-keys.test.ts.batch-executor.test.ts,ready-gate{,.phase-policy,-run}.test.ts,execution-config-parity.test.ts,config-resolver.{phase-policy,model-roles}.test.ts,run-orchestrator.phase-policy.test.ts,settings.phase-policy.test.ts,ready{,.metrics}.test.ts,run-log-schema.test.ts,log-writer.test.ts,mcp/tools/run.test.ts,divergence-halt.test.ts,batch-executor.repeat-halt.test.ts). Remove the ladder assertions and keep each test's original purpose. Writerun-log-schema.legacy.test.tswith its fixture.Phase 4: Docs and changelog
### RemovedCHANGELOG entry, and the mutation record for AC-4 in the PR body. Run the full suite in the background, since it takes 10–13 minutes.Design Review
batch-executor.ts,ready-gate.ts) and the config surface (settings.ts,config-resolver.ts,cli.ts). The readers (the three schemas andlogs.ts) only get comment changes.git log -S isLadderConfiguredshows the ladder was built across feat(run): model escalation ladder on capability-bound non-convergence #971/feat(config): model roles — semantic indirection between phase policy/ladders and concrete model strings #975/feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995/fix(run): a ladder halt is recorded nowhere: the halting phase reads success, failureCategory is empty, and the bundle exists only on stdout #1254. There have been no fix-on-fix issues against the removal path, so nothing to stop on.SPEC_DIVERGENCEstill writeladder_haltwhen the ladder is gone?" Because a new category needserror-classifier.ts(outside May-touch) and changes the log shape, which goes against I-2. The runner comment of 2026-11-08 agrees. The spec agrees: keepladder_halt, no divergence. (b) "Why keepDIVERGENCE_SUSPECT/TOP_OF_LADDERin the schemas?" Old logs carry them (R-2). (c) "Does deleting the divergence-suspect block change the behavior of a run with no ladder?" No. It could only run when the snapshot existed, and the snapshot was only taken when a ladder was configured (comment at :3033).bin/cli.ts,settings.ts,config-resolver.ts,batch-executor.ts,ready-gate.ts,phase-executor.ts(env vars plus marker spread),run-orchestrator.ts,ready.ts,metrics-writer.ts/createMetricRun. Consumers:state-schema.ts,run-log-schema.ts,metrics-schema.ts,logs.ts,mcp/tools/run.ts(haltReason),divergence-halt.ts(formatter). After the change, every producer is gone and every consumer stays as a read-only reader.scripts/spec/ground-check.ts:257only mentionsescalateEffortas an example inside a doc comment. Leave it.Feature Quality Planning
The standard checks pass. Notable items:
run.effortEscalationwarns as unknown. The new test pins exactly one warning per key.SPEC_DIVERGENCEescape hatch and the evidence-bundle docs now live inmodel-ladder.md(AC-6, OQ-1).!. The CHANGELOG entry should say that the flags error as unknown options from this release, and that the settings keys warn and are ignored.Derived ACs
docs/THREAT-MODEL.mdmust not link to the deletedmodel-ladder.md. Medium priority.Open Questions
docs/reference/model-ladder.md? Recommendation: rename it tospec-divergence-halt.mdand keep the divergence and repeat-halt content. Impact if wrong: the only reference for a halt that still exists gets deleted.DIVERGENCE_SUSPECT/TOP_OF_LADDERfromReadyTerminalReasoninready-gate.ts, which is now producer-only. Keep them inLadderHaltReason(divergence-halt.ts, a Non-Goal), in the run-log schema, and in the MCPhaltReasontype, because those can still read an old log. Impact if wrong: dead union members, or a reader that rejects an old log.ladderHaltOutcomebe renamed? Recommendation: keep the name and update its doc comment. A rename touches the tests and adds nothing, and the category stays the same either way.Recommended Workflow
Phases: exec → qa
Quality Loop: enabled
Reasoning: A large, mechanical deletion across about 25 files, with test edits that are easy to over-trim. The two new tests are named in the ACs and are small, so testgen isn't needed.
Label Review
Current:
graph-2026-11-simplifyRecommended: add
refactorandbreaking(the title has!), plusplanned.Quality Loop: enabled by the scope warning and the refactor label.
admarble commentedon Nov 8, 2026
QA Verdict: READY_FOR_MERGE
AC coverage: 8/8 met
Reviewed in a separate session by claude-code (claude-opus-5-5); the change author was not recorded.