Skip to content

feat(run): model escalation ladder on capability-bound non-convergence #971

Closed

Description

@admarble

Epic: M2 Blocked by: #863, #986 Tier: judgment Doc: docs/internal/graph-2026-09/PLAN.md §2 D-ladder, §5 I-1/I-2, §7 D4/D6, §9 OQ-4/OQ-5 Graph node: 11

Builds on #914 (per-phase model/effort configuration), #915 (effort escalation on retries), and #581 (QA stagnation detection).

Motivation

Well-specified issues execute reliably on cheaper models; today the phase model is fixed at launch, so users either overpay (strong model everywhere) or babysit (watch for stalls, relaunch manually with --models). #915 already escalates effort on observed retries; this adds the next rungs — model escalation — for the cases where an effort bump wasn't enough.

The critical design constraint: model escalation only helps capability-bound churn, not spec-bound churn. When the loop churns because the spec diverges from reality, a stronger model rediscovers the contradiction more expensively before halting. So the ladder must route on why the loop is churning, not just count iterations — and the two failure classes leave different fingerprints in data qa-stagnation.ts already records:

  • No progress (LOOP_NO_DIFF, SAME_SHA_NO_PROGRESS): the agent can't produce a working change → capability-bound → escalate.
  • Progress but repeated failure (new SHA each iteration, QA still fails): plausible diffs that don't converge → divergence-suspect → halt to human, never escalate.

Design

Out of scope (deferred, not rejected)

  • Pre-escalation divergence probe (a cheap bounded session asking "is this AC achievable as written?") — favorable noise asymmetry, but adds a session type; revisit after dogfood metrics.
  • Semantic comparison of QA findings across verdicts — rejected as a trigger (see above).
  • Speculative downgrades — same reasoning as feat(loop): evidence-based effort escalation on quality-loop retries #915: escalation on evidence can only trade cost for quality; prediction can trade the reverse.

Scope (graph plan 2026-09)

Design decisions fixed at plan review (graph plan 2026-09)

Acceptance criteria (graph plan 2026-09)

Done when (graph plan 2026-09)

With a ladder configured, a phase that stalls with no progress is re-dispatched one rung up through the single shared resolver, sticks there, never skips or overflows, and records what it did; with no ladder, nothing changes.

Original acceptance criteria (superseded by the graph-plan ACs above; kept for history)
  • AC-1: run.modelLadder and --model-ladder are parsed, with CLI precedence over settings; with no ladder configured, retried phases carry the same model options as feat(run): per-phase model and effort configuration for the claude-code driver #914/feat(loop): evidence-based effort escalation on quality-loop retries #915 ship today (unescalated, verified by a driver-options unit test)
  • AC-2: with a ladder configured, a retried phase whose prior attempt recorded LOOP_NO_DIFF or SAME_SHA_NO_PROGRESS dispatches at the next ladder rung, verified by a driver-options unit test at the dispatch site
  • AC-3: a divergence-suspect pattern (repeated failed QA verdicts at advancing SHAs) does NOT escalate the model; the loop halts and surfaces the divergence-suspect evidence to the human
  • AC-4: a SPEC_DIVERGENCE phase-marker outcome halts to human/spec-revision without escalating, and the exec/loop skill docs instruct agents when to emit it
  • AC-5: model escalation composes with feat(loop): evidence-based effort escalation on quality-loop retries #915 — effort escalates on the first retry at the same model, and the model rung fires only on a subsequent capability-bound trigger, never both on the same retry
  • AC-6: an escalated rung persists for that phase's remaining iterations in the run, rungs are never skipped, and the ladder never escalates past its last entry
  • AC-7: an explicit --models pin sets the ladder starting rung; a pin with no ladder configured never escalates
  • AC-8: a rigged missing/inconsistent phase marker is reconciled (doctor path) without escalating, verified by a unit test on the guard
  • AC-9: top-of-ladder non-convergence halts with an evidence bundle (SHAs, verdicts, escalation history) instead of looping
  • AC-10: escalations are recorded in the phase marker, run metrics, and verbose output with base model, escalated model, and trigger reason
  • AC-11: both ExecutionConfig producers apply escalation through one shared resolver function (no per-call-site copies), with a test covering the ready-gate path
  • AC-12: README + docs/ document the ladder, triggers, the capability-vs-spec-bound distinction, cost implications, and the SPEC_DIVERGENCE escape hatch

Activity

  1. admarble commented on Aug 28, 2026

    @admarble
    ContributorAuthor

    Design note from the vid-gen dogfood run (2026-08-28): the one real-world escalation would not have fired under this ladder

    A 20-issue production run executed the tiering policy this issue automates (sonnet spec/exec, opus QA, manual escalation on divergence signals). Escalation was warranted exactly once — and the trigger that surfaced it was neither LOOP_NO_DIFF nor SAME_SHA_NO_PROGRESS.

    The case (vid-gen #11, clip ingest): sonnet exec converged cleanly — new SHAs, green tests, no stagnation fingerprint at all. The code was built against an imagined vendor API (three nonexistent methods/signatures) and its own mocked tests certified it. QA returned NEEDS_VERIFICATION rather than findings. The gap only became visible when the ACs' verify commands ran against the real vendor; the escalated redo (fable) was correct on the first pass — i.e., genuinely capability-bound, exactly what the ladder exists for. Under the ladder as specced, this issue would have sat in ready_for_merge unescalated.

    Implication: confident-but-wrong convergence leaves no stagnation fingerprint, and in this run it was the only capability-bound failure mode that occurred (three more instances of the same imagined-API class appeared on later issues, caught the same way). The stagnation triggers guard against churn; they're blind to convergence on fiction.

    Proposed third trigger, composing with #972's verify routing: a failed verify phase (the ACs' literal commands executed against real dependencies) is a deterministic signal — command exit codes, not LLM-written findings — so it adds an escalation rung source without reopening the semantic-comparison objection this issue already rejected. Routing sketch: verify fails after a NEEDS_VERIFICATION verdict → counts as a capability-bound retry trigger alongside LOOP_NO_DIFF/SAME_SHA_NO_PROGRESS. The SPEC_DIVERGENCE escape hatch composes unchanged: a verify failure the exec agent attributes to the spec still halts to human.

    Two config notes from follow-up spikes (2026-08-28):

    Two honest asterisks from the same run, relevant to expectations (and to #944/#916 more than to the mechanism here):

    • The "hard issues need the top tier" intuition partially failed its test: the e2e-runner issue — predicted to need the strong model for its debugging tail — accidentally ran on the cheap tier and converged, with the verification layer catching what mattered. The top-tier reservation earned its cost on 4 of 5 designated issues, but the prediction of which issues need it was imperfect in both directions.
    • "Cheap tier sufficed on 15/20" carries a caveat: 6 of those 15 needed orchestrator fix rounds after verdicts. Cheap-tier viability in this run was conditional on a strong verification layer behind it — which is an argument for landing NEEDS_VERIFICATION maps to ready_for_merge, blocking QA re-runs; MCP sequant_run ignores force #972's verify routing before or with this ladder, since the ladder's cost story assumes something downstream reliably converts "wrong but confident" into a retry signal.
  2. admarble commented on Aug 30, 2026

    @admarble
    ContributorAuthor

    Trail note from #975 (2026-08-29): when this ladder's observability AC lands ("escalations recorded in the phase marker and run metrics"), include requestedModel in the marker emission — PhaseMarkerSchema already carries optional requestedModel/resolvedModel fields since #975 (state-schema.ts), and #975 deliberately deferred marker emission to this issue so the machinery is built once. Dispatch-time facts (requested role, dispatched model string, rung) are env-threadable to the agent; the resolved concrete ID from modelUsage is post-hoc and lives in run metrics only (#975's enrichPhasePoliciesFromResults).

  3. added
    graph-2026-09
    on Sep 7, 2026
  4. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    Graph plan 2026-09 — split. This issue now carries the ladder mechanism (node 11: AC-1/2/5/6/7/8/11, the recording half of AC-10, the non-escalation half of AC-3, and the #973 shape). Halts, SPEC_DIVERGENCE, verbose output, docs and the rigged real run → #995. Decisions approved 2026-09-06: verify-failure trigger stays out (OQ-4); ladder entries resolve through #975 roles (OQ-5). Blocked by #863 and #986. Plan: docs/internal/graph-2026-09/PLAN.md.

  5. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    Runner context — wave 3 launch (2026-09-08, main at 0f278b4). Both blockers are merged: #863 (PR #1004: single ExecutionConfig producer, ready.ts routed through resolveRunOptions, execution-config-parity.test.ts is the I-1 gate) and #986 (PR #1010: per-phase metrics.phaseUsage[] rows { phase, model, inputTokens, outputTokens, cacheReadTokens, cacheCreationTokens, costUSD } sourced from the SDK modelUsage map, one worktree-anchored token helper). Read the plan and your node file from main: docs/internal/graph-2026-09/PLAN.md (§5 I-1/I-2, §7 D4/D6/D16–D22, §8) and docs/internal/graph-2026-09/issues/11-971A-model-ladder-mechanism.md. AC-10's recording half lands in the phaseUsage row #986 just introduced — extend that row, do not add a parallel structure. AC-11 means the ladder resolves in config-resolver.ts once and ready-gate.ts inherits it (the parity test will fail otherwise).

    Launch discipline: the launcher kills any phase silent for 30 minutes — commit a WIP within 5 minutes and every ~10 minutes; run only the node file's targeted -t "971 …" commands in the foreground; never the full suite inside the phase. If cut off, your committed work is reused on re-dispatch. Stop-at-PR is lifted for merge only by the owner after runner verification; still open the PR yourself with every AC's verify output and the gate-test Mutation-verified: records in the body.

  6. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    /spec — Plan review (#971, graph node 11)

    Complexity: Complex (10 ACs, 4 directories)

    Verified on main at 0f278b40: both blockers are in (#863 — resolvePhasePolicies has one caller and ready-gate.ts consumes RunReadyGateOptions.config; #986 — metrics.phaseUsage[] rows exist), and so are #973 (claude-code.ts:236 already converts subtype:"success" + is_error:true into success:false) and #975 (resolveRoleToModel is ready for OQ-5's role-resolved entries).


    AC Quality Check

    Five findings. Two are broken verify commands that would pass vacuously.

    1. AC-10's compat command matches no test (verified, not theorized). Ran it on main:

    $ npx vitest run src/commands/stats.test.ts -t "986 AC-6"
    Test Files  1 skipped (1)   Tests  25 skipped (25)   EXIT=0
    

    The test is named 986 renders a pre-fix record without throwing, showing 0 / — for the missing fields (AC-6), so -t "986 AC-6" is not a substring of any name — it exits 0 having asserted nothing. Use -t "AC-6" (matches 2 tests) or the full title.

    2. AC-11's grep is a combined count over two files and can never be 0. grep -rn 'modelLadder' ready-gate.ts config-resolver.ts | grep -v import | wc -l prints one number over both files, and config-resolver.ts must mention modelLadder (it is the resolver). The AC's intent — "the ready-gate count is 0" — needs a per-file check: grep -c 'modelLadder' src/lib/workflow/ready-gate.ts → 0. (grep -v import also misses a multi-line import block; a per-file count of 0 makes that moot.)

    3. AC-2's trigger has no producer at either dispatch site today — the load-bearing gap:

    • SAME_SHA_NO_PROGRESS — detectStagnation/recordStagnation in qa-stagnation.ts have zero runtime TypeScript callers (only fullsolve/loop SKILL.md prose). Nothing in the run path ever records it, and IssueState.qaStagnation is never written.
    • LOOP_NO_DIFF — computed only in ready-gate.ts:737, where it is immediately terminal: return finish("LOOP_NO_DIFF"). There is no "next retry" left in that gate invocation to escalate.
    • batch-executor.ts's outer quality loop computes no progress signal at all.

    So "a retry whose prior attempt recorded LOOP_NO_DIFF or SAME_SHA_NO_PROGRESS" is, as of main, an unreachable state. AC-2 implies a behavior change nobody wrote down — see OQ-1/OQ-2.

    4. AC-8 names a surface that doesn't exist. doctor.ts has no phase-marker check (its checks are version/skills/hooks/CLI/MCP); marker parsing lives in phase-detection.ts and drift healing in reconcile.ts, which is wired into neither dispatch site. "Reconciled through the doctor path" is not implementable as written — see OQ-4.

    5. AC-6 doesn't say where topOfLadder lives (record? marker? ReadyResult?). Recommendation: the record + the marker fields, so #995 can act on it from either path.

    Numbering gaps (no AC-4/9/12) are deliberate — those went to #995 at D4.


    Scope Assessment

    Non-Goals: present and specific (verify-failure trigger/OQ-4, semantic finding comparison, downgrades, skills text and docs → #995).

    Metric Value Status
    Feature count 1 mechanism, 5 sub-parts (parse / trigger / dispatch / stickiness / recording) ⚠️
    AC items 10 ⚠️
    Directory spread 4 (bin/, src/lib/, src/lib/workflow/, src/commands/ read-only) ✅

    Verdict: ⚠️ SCOPE_WARNING — quality loop on. The split at D4 already removed the halts/docs half; what remains is cohesive and should not be split further.

    In-flight conflict risk: none. The 916/919 worktrees have no commits vs origin/main; PR #1009 (#993) touches only evals/. A feature/971-… worktree exists at 0f278b40 with no commits.


    Acceptance Criteria

    All ten are Unit Test verification (driver-options assertions at the dispatch sites); AC-11 additionally carries a static grep gate.

    AC Scenario (Given → When → Then) Assumptions / flags
    AC-1 CLI + settings ladder both set → buildExecutionConfig → CLI wins; with neither, a retried phase's AgentExecutionConfig deep-equals the pre-change snapshot ladder key omitted (not []) when unconfigured, so the parity test sees no new key on either producer
    AC-2 prior attempt compared LOOP_NO_DIFF → next qa/loop/phase dispatch → model is ladder[n+1], both paths ⚠️ blocked on OQ-1 + OQ-2 — the trigger must first be produced
    AC-3 3 iterations, new SHA each, failing verdicts → model option constant —
    AC-5 retry 1 → effort only; later capability-bound retry → model rung; never both on one iteration enforced structurally (Design Q3), not by convention
    AC-6 escalate, then keep iterating → rung persists, index +1 exactly, top rung leaves model unchanged and sets topOfLadder flag's home unspecified in the AC → record + marker
    AC-7 --models pin → ladder starts at that rung; pin with no ladder never escalates ⚠️ pin-not-in-ladder undefined → OQ-3
    AC-8 rigged missing/inconsistent marker → no escalation ⚠️ no doctor marker check exists → OQ-4
    AC-10 escalated dispatch → rung/base/escalated/trigger/requestedModel in the marker and the phaseUsage row; old records still load ⚠️ PHASE_MARKER_REGEX is /<!-- SEQUANT_PHASE: (\{[^}]+\}) -->/g — flat JSON only; a nested {escalation:{…}} silently stops the marker parsing at all. Round-trip test mandatory
    AC-11 ladder resolves once in config-resolver.ts; ready-gate inherits it gate test → needs a Mutation-verified: record
    AC-13 subtype:"success", is_error:true → retry path, not convergence claude-code.ts:236 already does this; if no production change is needed, say so plainly and mutation-verify the regression test

    Implementation Plan

    Phase 1 — config surface (AC-1, AC-11)

    1. src/lib/settings.ts: run.modelLadder?: string[] on the interface + z.array(z.string()).optional() on the schema + "modelLadder" in KNOWN_KEYS.run (without it, a valid key warns as unknown).
    2. bin/cli.ts: --model-ladder <spec> (comma list) on both run (~line 405) and ready (~line 627), mirroring --escalate-effort's dual registration; add RunOptions.modelLadder.
    3. config-resolver.ts: resolveModelLadder(cli, settings, modelRoles, activeDriver) — CLI beats settings, each entry through resolveRoleToModel (OQ-5), keeping the pre-resolution strings as modelLadderRequested for AC-10. Omit both keys entirely when unconfigured.
    4. types.ts: ExecutionConfig.modelLadder?/modelLadderRequested?, documented like effortEscalation ("consumed at dispatch time, never baked statically").

    Phase 2 — the resolver module (AC-2, AC-6, AC-7, AC-8)

    New src/lib/workflow/model-ladder.ts, beside effort-escalation.ts for the same stated reason (co-locating in config-resolver.ts would create a cycle through batch-executor.ts's getEnvConfig):

    • type EscalationTrigger = "LOOP_NO_DIFF" | "SAME_SHA_NO_PROGRESS".
    • createLadderState() → { rungByPhase: Map<Phase, number> }. Stickiness lives here, in per-run mutable state owned by the dispatch loop — not in ExecutionConfig, which is shared across phases (exactly feat(loop): evidence-based effort escalation on quality-loop retries #915's AC-7 rationale).
    • resolveNextRung(ladder, currentIndex) — pure, +1, clamped, never skips.
    • detectCapabilityBoundTrigger({ loopProgressed, priorMarker, currentSha, isDirty }) — one place both paths agree on the trigger, and the AC-8 integrity guard: a missing/inconsistent marker returns null (never escalate) plus a reason.
    • withEscalatedModel(config, phase, trigger, state) → { config, record? }, returning the input config by reference when the ladder is absent/empty, the trigger is null and no sticky rung applies, or the top rung is reached. Applies the sticky rung on every later dispatch even with a null trigger (AC-6).
    • startingRungFor(phase, config) — AC-7's --models pin → starting index.

    Phase 3 — dispatch sites (AC-2, AC-3, AC-5, AC-13)

    1. ready-gate.ts: wrap the existing qa and loop dispatches; carry lastTrigger across iterations. Named withEscalatedModel(...) only — the file must never contain the string modelLadder (AC-11's gate).
    2. ready-gate.ts:739: when a ladder is configured, a rung remains, and iterations < maxIterations, LOOP_NO_DIFF records the trigger and continues the loop instead of finish("LOOP_NO_DIFF") (OQ-1). With no ladder, the terminal is byte-identical to today.
    3. batch-executor.ts: snapshot/compare each quality-loop iteration via an injectable snapshotFn (default snapshotLoopProgress) only when a ladder is configured, so an unconfigured run makes zero new git calls and AC-1's deep-equal holds; feed the trigger into the next iteration's dispatch, next to the existing withEscalatedEffort call at :1451.
    4. AC-5 enforced structurally, not by convention: withEscalatedEffort(cfg, phase, isRetry && trigger === null) then withEscalatedModel(cfg, phase, trigger, state). A capability-bound trigger suppresses the effort bump for that dispatch, so "both changed on one iteration" is unrepresentable rather than merely untested.

    Phase 4 — recording (AC-10)

    1. state-schema.ts (append-only per I-2): flat optional ladderRung, baseModel, escalatedModel, escalationTrigger, topOfLadder on PhaseMarkerSchema beside feat(config): model roles — semantic indirection between phase policy/ladders and concrete model strings #975's requestedModel — flat scalars only (see AC-10's assumption).
    2. metrics-schema.ts: the same fields as optional columns on PhaseUsageSchema — extend fix(metrics): tokensUsed is 0 on every recorded run — capture-tokens.sh reads .usage (transcripts carry .message.usage) and run reads the wrong dir; wire SDK modelUsage tokens+costUSD per phase × model into metrics and stats #986's row, no parallel array.
    3. phase-executor.ts:~1256: thread the dispatch-time facts into the phase env (SEQUANT_MODEL_RUNG, SEQUANT_MODEL_BASE, SEQUANT_MODEL_ESCALATED, SEQUANT_ESCALATION_TRIGGER) so feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995's skill prose can emit them (see OQ-5).
    4. run-orchestrator.ts:1875–1935: aggregate model-escalation records from both paths, mirroring the effortEscalations merge.

    Phase 5 — tests + gate records

    1. model-ladder.test.ts (-t "971 AC-…" selectors exactly as the ACs name them), a phase-executor.model-ladder.test.ts end-to-end wiring test in the style of phase-executor.effort-escalation.test.ts (real executor + real driver, mocked query()), the parity + ready-gate phase-policy assertions, and the formatPhaseMarker round-trip.
    2. Mutation-verify every gate test (AC-11's grep gate, AC-1's parity assertion, AC-13's regression) and record each as Mutation-verified: AC-N — <mutation>; <test> failed; restored. in the PR body — commit first (git checkout <file> wipes uncommitted edits).

    Design Review

    1. Where does this logic belong? A new model-ladder.ts peer of effort-escalation.ts. Ladder resolution (strings → concrete models) belongs in config-resolver.ts as the single producer; ladder application is a per-dispatch decision and must not be baked into ExecutionConfig.
    2. Simplest correct approach? A pure rung resolver plus a per-run Map<Phase, number> threaded to the dispatch sites. Rejected: baking the escalated model into phasePolicies at build time (leaks across every phase in the chain — the bug feat(loop): evidence-based effort escalation on quality-loop retries #915's AC-7 exists to prevent); persisting rung state to state.json (survives a resume but adds a schema write no AC asks for — revisit if feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995 needs it).
    3. Existing pattern? withEscalatedEffort's single-choke-point shape, including its "return the input config by reference when nothing changed" contract. Two deliberate divergences, both AC-mandated: escalation is sticky (feat(loop): evidence-based effort escalation on quality-loop retries #915 explicitly does not accumulate) and trigger-gated rather than retry-gated.
    4. What would a senior reviewer challenge? (a) "You made LOOP_NO_DIFF continuable" — yes; it is the only way AC-2 is reachable in the gate path, and it is gated on a configured ladder so the default path is untouched. (b) "Why does batch-executor now shell out to git per iteration?" — only when a ladder is configured. (c) "AC-13 has no production change" — correct; fix(driver): result subtype "success" with is_error:true is reported as phase success — unrecognized model yields a zero-work "successful" phase #973 already landed it, and the test is labelled a regression guard.

    Feature Quality Planning

    Derived ACs

    Source Derived AC Priority
    Marker parser constraint AC-D1: new marker fields survive formatPhaseMarker → parsePhaseMarkers round-trip (flat JSON, [^}]+ regex) High
    Off-by-default parity AC-D2: with no ladder configured, batch-executor issues no additional git calls per iteration Medium

    Sibling-site scan

    The dispatch sites are the sibling class here, and there are four, not three: batch-executor.ts:1451 (phase), ready-gate.ts:638 (qa), ready-gate.ts:714 (loop) — and batch-executor.ts:~1730, the inner /loop spawn, which builds loopConfig and calls executePhaseWithRetry without withEscalatedEffort. So #915's escalation never reaches the batch path's /loop phase today.

    Surfacing both halves separately rather than widening scope:


    Open Questions

    1. LOOP_NO_DIFF is terminal in the ready gate — does the ladder make it continuable? Recommendation: yes, but only when a ladder is configured and a rung remains and iterations < maxIterations; otherwise the terminal is unchanged. Impact if wrong: AC-2's gate-path half is untestable except by injecting a synthetic prior state, i.e. a test that proves nothing about the real loop.
    2. What produces the trigger on the run path? Recommendation: batch-executor computes it per iteration with the existing snapshotLoopProgress/compareLoopProgress helpers, gated on a configured ladder. SAME_SHA_NO_PROGRESS stays reachable through detectCapabilityBoundTrigger's marker+SHA inputs, so both trigger names in AC-2 remain meaningful. Impact if wrong: the ladder ships only for sequant ready, and the run path silently never escalates.
    3. AC-7: a --models pin that is not in the ladder. Recommendation: that phase does not escalate, with a one-line notice — never treat ladder[0] as "next" after an off-ladder pin, which could silently downgrade the user's explicit pin. Impact if wrong: a pin becomes a cheaper model mid-run, the exact inversion feat(loop): evidence-based effort escalation on quality-loop retries #915 and this issue both reject.
    4. AC-8's "doctor path". Recommendation: implement the guard as a pure predicate inside detectCapabilityBoundTrigger — missing/inconsistent marker ⇒ no trigger, with a reason — and leave reconciliation to reconcile.ts, which node 11 does not wire in. Restate the AC as "no escalation occurs and the reason is recorded". Impact if wrong: an AC that cannot be satisfied as literally written blocks the PR at QA.
    5. AC-10's marker emission split. No runtime TypeScript emits SEQUANT_PHASE (skills do, and skills text is feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995). Recommendation: node 11 lands the schema fields, the pure field-builder, the round-trip test and the env threading; feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995 wires the skill prose that prints them. Impact if wrong: node 11 either edits feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995's files or leaves the marker half of AC-10 with no runtime path.
    6. Include the 4th dispatch site (batch /loop spawn) for the ladder? Recommendation: yes for the ladder (trivially co-located, one call), no for backfilling feat(loop): evidence-based effort escalation on quality-loop retries #915's effort escalation there (separate issue).
    7. The run.modelLadder row in settings.ts's generated settings-reference table. Recommendation: include it — the table is generated from settings.ts, which is in scope; README/docs/ stay with feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: enabled
    Reasoning: SCOPE_WARNING plus a judgment-tier node. Every AC declares a vitest command, which by the standard detection would indicate testgen — overridden deliberately: the node file already fixes the test file paths and the exact -t "971 AC-N" selectors, so the stub contract is fully specified, and wave-3's launch discipline (MCP's hard 30-minute no-progress kill, commit every ~10 min) makes an extra phase a dispatch slot spent on stubs that /testgen tends to leave untracked. No UI surface (no test phase); no auth/payment/secret surface (no security-review).


    Label Review

    Current: graph-2026-09
    Recommended: add enhancement, planned
    Reason: it is a feature node, and planned marks phase-1 completion. No ui label (no .tsx/.jsx in scope) and no browser test; complex is optional — the plan already routes it through the quality loop.


    Before exec: fix the two verify commands in the AC list

    AC-10 → npx vitest run src/commands/stats.test.ts -t "AC-6"; AC-11 → grep -c 'modelLadder' src/lib/workflow/ready-gate.ts → 0. Left as-is, both are green while asserting nothing, and /qa §6i would accept them.

  7. added
    planned
    enhancement
    on Sep 8, 2026
  8. added 5 commits that reference this issue on Sep 8, 2026
  9. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    Runner context — the third QA round was killed at its start by the launcher's 30-minute no-progress ceiling (08:21Z); the clean worktree was removed by design (#935) and is re-provisioned from the branch. Nothing is lost: all 11 commits are pushed and PR #1012's head is 24d01210 (= branch tip, contains current main). This re-dispatch is QA only, iteration 3 of the loop — review the PR at that head against the node-11 ACs and the two prior rounds' findings (both loop fixes landed: c42648b6 effort rung before model rung for AC-5; 24d01210 run-path tests no longer emit orchestrator progress lines). Post the verdict; do not re-run exec. Keep the review under 25 minutes of wall time; if a check needs the full suite, run only the node file's -t "971 …" targets.

  10. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #971 (round 3)

    Reviewed at 24d01210 (= PR #1012 head). Every AC's declared verify command was executed in this pass; nothing is marked MET on reasoning alone.

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original parse + precedence + off-by-default MET -t "971 AC-1" ✅. resolveModelLadder spreads conditionally so both keys are absent (not undefined) when unconfigured; parity test green.
    AC-2 Original capability-bound trigger dispatches the next rung, both paths MET -t "971 AC-2" → 11 ✅. Driver-options assertions on the real ready-gate loop and the real run-path quality loop. See gap A — only the LOOP_NO_DIFF half has a production producer.
    AC-3 Original advancing SHAs + failing verdicts never change the model MET -t "971 AC-3" → 3 ✅. lastTrigger = null on any progressing iteration, both paths.
    AC-5 Original composes with #915; never both on one retry MET -t "971 AC-5" → 5 ✅. Structural, not conventional: effectiveModelTrigger withholds until retry 2 and one value feeds both escalators. Run-path dispatches assert [high/—, xhigh/—, high/opus].
    AC-6 Original sticky, no skipping, no overflow MET -t "971 AC-6" → 7 ✅. Rung persists across trigger-less dispatches, +1 exactly, top rung leaves the model unchanged and sets topOfLadder.
    AC-7 Original --models pin sets the starting rung; pin w/o ladder never escalates MET -t "971 AC-7" → 5 ✅. Off-ladder pin returns the config by reference and is asserted not to become ladder[0].
    AC-8 Original marker-integrity guard MET -t "971 AC-8" → 8 ✅. "Reconciled through the doctor path" was renegotiated at spec OQ-4 (doctor.ts has no phase-marker check) to "no escalation occurs and the reason is recorded" — the requirement is met and the deviation is disclosed in the PR body. See gap A for reachability.
    AC-10 Original recording half: rung/base/escalated/trigger/requestedModel MET -t "971 AC-10" → 24 ✅; back-compat stats.test.ts -t "AC-6" → 1 passed ✅. Columns on #986's phaseUsage row (no parallel per-execution structure). Marker emission is #995 per OQ-5. See gaps B/C.
    AC-11 Original one resolver for both producers MET execution-config-parity.test.ts ready-gate.phase-policy.test.ts -t "971" → 5 ✅. Corrected per-file gate: grep -c 'modelLadder' src/lib/workflow/ready-gate.ts → 0 (config-resolver.ts → 7).
    AC-13 Original #973 shape is retry-eligible MET -t "971 AC-13" → 2 ✅. No production change needed (claude-code.ts:236 already landed it); labelled a regression guard and mutation-verified.
    Derived ACs
    AC-D1 Derived (marker parser constraint) flat fields survive formatPhaseMarker → parsePhaseMarkers MET -t "971 AC-D1" ✅. Fixture rebuilt from the builder's raw output in 972d0ff5 after the schema-parse laundering hole was found.
    AC-D2 Derived (off-by-default parity) no extra git calls when unconfigured MET -t "971 AC-D2" ✅. Snapshot fn called 0 times unconfigured, once per iteration boundary when configured.

    Coverage: 12/12 AC items met (10 original + 2 derived)


    Quality Plan Verification

    Dimension Items Planned Items Addressed Status
    Backward compat 3 (marker, phaseUsage, ExecutionConfig shape) 3 ✅ Complete
    Cost/observability 2 (recording, verbose print) 2 ✅ Complete
    Failure mode (invalid rung → #973) 1 1 ✅ Complete
    Test coverage 2 derived ACs 2 ✅ Complete
    Polish (UI) N/A N/A – (not a UI feature)

    Derived ACs: 2/2 addressed · Quality Plan Status: Complete


    Precheck Findings

    Precheck Findings: unavailable — inline fallback used.


    CI Status

    Check State Bucket Impact
    build (22.x) SUCCESS pass ✅ MET
    typecheck SUCCESS pass ✅ MET
    node-floor-guard SUCCESS pass ✅ MET
    validate-skills SUCCESS pass ✅ MET
    validate-plugin SUCCESS pass ✅ MET
    tautology-advisory SUCCESS pass ✅ MET

    CI Summary: 6 passed, 0 pending, 0 failed. mergeable: MERGEABLE, mergeStateStatus: CLEAN, 0 commits behind origin/main.
    CI-related AC items: none declared.


    Quality Metrics

    Metric Value Status
    Type issues (any) in added lines 0 OK
    Deleted tests 0 OK
    Files changed 21 OK (large but cohesive)
    Lines added +2938 –
    Lines deleted -13 –

    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    src/lib/workflow/model-ladder.ts Standard ✅ Yes model-ladder.test.ts, model-ladder.recording.test.ts
    src/lib/workflow/config-resolver.ts Standard ✅ Yes model-ladder.test.ts, execution-config-parity.test.ts
    src/lib/workflow/batch-executor.ts Standard ✅ Yes batch-executor.model-ladder.test.ts
    src/lib/workflow/ready-gate.ts Standard ✅ Yes model-ladder.test.ts, ready-gate.phase-policy.test.ts
    src/lib/workflow/phase-executor.ts Standard ✅ Yes phase-executor.model-ladder.test.ts
    src/lib/workflow/run-orchestrator.ts Standard ⚠️ Mirror only see gap C — the join is re-implemented in the test, not invoked
    src/lib/workflow/metrics-schema.ts / state-schema.ts Standard ✅ Yes model-ladder.recording.test.ts
    src/commands/ready.ts Standard ✅ Yes ready.test.ts
    bin/cli.ts / src/lib/settings.ts Standard ✅ Yes smoke-tested --help on both commands

    Coverage: 8/9 changed source areas have direct tests; run-orchestrator.ts's new join is covered only by a mirror test.
    Critical paths without tests: none (no auth/payment/secret surface).

    Full run of the 7 touched test files: 122 passed (122).


    Code Review

    Strengths:

    • AC-5 is enforced structurally, not by convention. One value (effectiveModelTrigger(lastTrigger, retryIndex)) feeds both escalators, so "effort and model both escalated on one iteration" is unrepresentable rather than merely untested. The run-path test derives the trigger from a real no-diff iteration instead of hand-feeding it — that is what caught the ordering regression fixed in c42648b6.
    • The off-by-default contract is enforced at three independent levels: keys spread conditionally so they are absent not undefined; withEscalatedModel returns the input config by reference; and the per-iteration git snapshot is gated on isLadderConfigured. AC-1 and AC-D2 each assert a different one.
    • LadderState lives in the dispatch loop, not in ExecutionConfig — correctly avoiding the feat(loop): evidence-based effort escalation on quality-loop retries #915 AC-7 cross-phase leak, with the rationale written down at the definition.
    • The flat-scalars-only marker constraint is documented at all three sites (state-schema.ts, model-ladder.ts, the round-trip test) with the actual [^}]+ regex quoted. AC-D1's own test hole (schema-parse laundering) was found and fixed rather than papered over.
    • The 4th dispatch site (batch-executor's inner /loop spawn) was surfaced by the spec's sibling-site scan and included, while the adjacent pre-existing feat(loop): evidence-based effort escalation on quality-loop retries #915 gap was deliberately not widened into this PR. Correct scope discipline.
    • Both broken verify commands the spec flagged were re-run, confirmed vacuous, and corrected in the PR body rather than quietly satisfied.

    Issues:

    • A. SAME_SHA_NO_PROGRESS has no production producer, and the AC-8 guard is therefore unreachable in production. Both production callers of detectCapabilityBoundTrigger (batch-executor.ts:1914, ready-gate.ts:800) pass only { isRetry, loopProgress }. The marker/SHA path — and with it the SAME_SHA_NO_PROGRESS return and the entire checkMarkerIntegrity branch, which engages only when lastMarker !== undefined || currentSha !== undefined — is exercised by unit tests alone. AC-2 names both triggers with an or, so the AC is literally met by the LOOP_NO_DIFF half, and spec OQ-2 anticipated this. But the PR body's AC-2 and AC-8 rows read as though both triggers and the guard are live; that limitation is not disclosed anywhere in the PR.
    • B. The run-level modelEscalations log counts sticky re-dispatches as escalations. withEscalatedModel sets config.modelEscalation on any dispatch above the starting rung, including a sticky re-application (verified: trigger: "STICKY", record: false). phase-executor.ts:1446 attaches those facts to the PhaseResult, and run-orchestrator.ts:1914 builds modelEscalations from p.escalatedModel with no STICKY filter — so the run path contributes one entry per escalated dispatch, while the gate path (ready-gate.ts:688,774) pushes only rung-advancing records. The same array mixes two semantics, and MetricRunSchema.modelEscalations's own docstring says "one entry per dispatch that advanced a rung". model-ladder.test.ts:439 already filters on trigger !== "STICKY" for AC-5, so the distinction is understood elsewhere in the PR. Impact today is bounded — nothing reads the field yet — but this is the auditability channel for a feature whose whole cost story is auditability, so it would over-report spend the first time stats consumes it.
    • C. The AC-10 phaseUsage join test re-implements the production expression instead of invoking it. model-ladder.recording.test.ts:267 is commented "The join run-orchestrator.ts performs, asserted directly", but the test body copy-pastes the spread from run-orchestrator.ts:1823-1840 into a local const rows = ... and asserts on its own copy. It never imports run-orchestrator.ts. Deleting the join in production leaves this test green. Both ends of the join are genuinely pinned (phase-executor attaches the facts; PhaseUsageSchema accepts the columns) — it is the middle, which the comment claims to cover, that is uncovered. The production expression is correct as written, so this is a coverage gap rather than a live defect.

    Suggestions:

    • Filter trigger !== "STICKY" in run-orchestrator.ts:1914's run-path branch (gap B) — a one-line change that makes the array match its docstring and the gate path.
    • Either disclose gap A in the PR body / a #995 follow-up note, or drop the unreachable marker branch until a caller exists.
    • For gap C, drive the assertion through the real orchestrator path or extract the join into a named exported helper both sides call.
    • PhaseResult.escalatedModel (a facts object) and the phaseUsage column escalatedModel (a model string) share a name with different types. Not a defect, but it makes the join harder to read.

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ⚠️ WARN One mirror test (gap C); the rest assert dispatch-site driver options through real loops.
    Coverage Depth ✅ OK Off-ladder pin, top-of-ladder clamp, missing/wrong-phase/no-SHA/unparseable-timestamp markers, sticky re-application, role: resolution.
    Mock Hygiene ✅ OK query() mocked at the SDK boundary; the real executor, real driver, real quality loop and real gate loop all run.
    Test Reliability ✅ OK vi.stubEnv("SEQUANT_ORCHESTRATOR", "") in 24d01210 stopped the run-path tests emitting 80 fabricated SEQUANT_PROGRESS: lines that would drive the live launcher's display and reset its watchdog. Good catch — that was a real harness-safety bug, not cosmetics.

    Issues Found:

    • model-ladder.recording.test.ts:267 — mirror test, see gap C.

    Anti-Pattern Detection

    Dependency Audit

    N/A — package.json unchanged.

    Code Patterns

    File:Line Category Pattern Suggestion
    — — none found —

    0 hardcoded secrets, 0 eval/innerHTML, 0 empty catch blocks, 0 0.0.0.0 binds, 0 any in added lines.

    Critical Issues: 0 · Warnings: 0


    Call-Site Review

    New exported functions detected: 11 (in model-ladder.ts) + resolveModelLadder

    Function Call Sites Loop? Conditions AC Match
    withEscalatedModel() batch-executor.ts:1521,1801; ready-gate.ts:681,768 Yes (all four) gated by effectiveModelTrigger ✅ All four retry-dispatch sites, per OQ-6
    effectiveModelTrigger() batch-executor.ts:1498; ready-gate.ts:673 Yes retryIndex >= 2 ✅ AC-5
    detectCapabilityBoundTrigger() batch-executor.ts:1914; ready-gate.ts:800 Yes {isRetry, loopProgress} only ⚠️ gap A — marker/SHA args never supplied
    isLadderConfigured() batch-executor.ts No — ✅ AC-D2
    canEscalateFurther() ready-gate.ts:807 Yes OQ-1 continuation guard ✅ AC-6/AC-2
    createLadderState() both paths No unconditional (cheap) ✅
    resolveModelLadder() config-resolver.ts:625 No single resolution site ✅ AC-11
    buildEscalationMarkerFields() tests only – – ⚠️ Dead export — deliberate, deferred to #995 per OQ-5 and disclosed in the PR body
    resolveNextRung, startingRungFor, checkMarkerIntegrity internal to withEscalatedModel / the detector – – ✅ (checkMarkerIntegrity marked @internal)

    Findings: no call site contradicts an AC constraint. Two exports are reachable only from tests (buildEscalationMarkerFields outright; checkMarkerIntegrity's branch via gap A) — both deliberate and both tied to #995, but only the first is disclosed.


    Execution Evidence

    Test Type Command Exit Code Result
    CLI smoke (run) sequant run --help 0 --model-ladder <rungs> present with correct help text
    CLI smoke (ready) sequant ready --help 0 --model-ladder <rungs> present, gate-specific help text
    Targeted suites 7 touched test files, full 0 122 passed (122)
    Back-compat stats.test.ts -t "AC-6" 0 1 passed | 24 skipped

    Evidence status: Complete


    Skill Command Verification

    N/A — no .claude/skills/**/*.md files changed.

    Detection Pattern Verification

    N/A — no pattern changes in skill markdown.


    CLI Registration Verification

    Option files modified: Yes (bin/cli.ts, batch-executor.ts RunOptions)

    Interface Field Runtime Usage CLI Registered Status
    RunOptions.modelLadder config-resolver.ts:625 (mergedOptions.modelLadder) --model-ladder <rungs> on run (cli.ts:413) and ready (cli.ts:641) ✅ OK
    ReadyCommandOptions.modelLadder ready.ts:183 same flag ✅ OK
    ExecutionConfig.modelLadder / modelLadderRequested / modelEscalation resolved in-process N/A ⏭️ SKIP (internal)

    Verification Status: Passed — both registrations confirmed against live --help output, not just source grep.


    Behavior-Rule Survival Check

    AC Triggered? Survivors Status
    AC-1 No — N/A
    AC-3 No — N/A
    AC-6 No — N/A

    Status: N/A — the behavior-rule detector did not trigger on any AC.


    Declared-Evidence Execution

    AC Evidence Executed? Result
    AC-1 -t "971 AC-1" Yes ✅ 36 passed
    AC-2 -t "971 AC-2" Yes ✅ 11 passed
    AC-3 -t "971 AC-3" Yes ✅ 3 passed
    AC-5 -t "971 AC-5" Yes ✅ 5 passed
    AC-6 -t "971 AC-6" Yes ✅ 7 passed
    AC-7 -t "971 AC-7" Yes ✅ 5 passed
    AC-8 -t "971 AC-8" Yes ✅ 8 passed
    AC-10 -t "971 AC-10" + stats.test.ts -t "AC-6" Yes ✅ 24 passed; ✅ 1 passed
    AC-11 parity + phase-policy -t "971"; grep -c gate Yes ✅ 5 passed; grep → 0
    AC-13 -t "971 AC-13" Yes ✅ 2 passed
    AC-D1 / AC-D2 -t "971 AC-D1" / -t "971 AC-D2" Yes ✅ 2 passed each

    Status: Complete


    Mutation Verification

    All nine SEQUANT_MUTATION markers were re-parsed against this diff's test files via parseMutationMarkers; every one classifies valid (its failedTest names a test file present in the diff).

    AC Gate Test? Marker Status
    AC-1 Yes model-ladder.test.ts > with no ladder configured, the resolved ExecutionConfig has NO ladder key at all Verified
    AC-2 Yes model-ladder.test.ts > ready-gate path: a no-diff fix loop re-dispatches qa one rung up Verified
    AC-5 Yes model-ladder.test.ts > no iteration of the real ready-gate loop shows effort and model both changing Verified
    AC-5 Yes batch-executor.model-ladder.test.ts > spends the effort rung BEFORE any model rung when iteration 1 produces nothing Verified
    AC-10 Yes model-ladder.test.ts > ReadyResult.modelEscalations carries every rung the gate spent Verified
    AC-11 Yes execution-config-parity.test.ts > 971 AC-11: the gate inherits the resolved model ladder rather than resolving one Verified
    AC-13 Yes phase-executor.model-ladder.test.ts > a subtype:'success' result with is_error:true returns success:false Verified
    AC-D1 Yes model-ladder.recording.test.ts > 971 AC-D1: the fields survive a formatPhaseMarker → parsePhaseMarkers round-trip Verified
    AC-D2 Yes batch-executor.model-ladder.test.ts > never calls the snapshot function when no ladder is configured Verified

    Status: Verified

    Worth noting: the AC-D1 record honestly documents that the mutation initially left the suite green because the fixture was laundered through PhaseMarkerSchema.parse (which strips unknown keys), and that 972d0ff5 rebuilt the fixture before the record was claimed. That is the mutation gate working as #939 intended.


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (feat(#971) commits)
    [Unreleased] entry ✅ Present (under ### Added)
    Entry format ✅ Valid (includes #971, action-verb bullets)

    Result: CHANGELOG requirements met


    Manual Test ACs

    N/A — every AC declares a vitest command; no Manual Test or evidence-naming ACs detected.


    Risk Assessment

    • Likely failure mode: A user configures run.modelLadder expecting escalation on any stalled loop, but only LOOP_NO_DIFF is ever produced in production (gap A). A phase that churns while re-touching the same SHA — the SAME_SHA_NO_PROGRESS case the docs and CHANGELOG both advertise — never escalates. Failure is silent: the run just costs what it always did, and nothing records why the ladder stayed put.
    • Not tested: the run-orchestrator.ts join itself (gap C — mirror test only); end-to-end metrics write of modelEscalations from the run path (which is where gap B's over-count would first show up); no test asserts the run-level log excludes sticky dispatches.
    • Sibling sites considered: the retry-dispatch sites are the cross-file sibling class. The spec's scan found four (batch-executor.ts:1521, batch-executor.ts:1801, ready-gate.ts:681, ready-gate.ts:768) and all four apply the ladder — verified by grep, not taken on trust. The adjacent pre-existing gap (feat(loop): evidence-based effort escalation on quality-loop retries #915's effort escalation absent at batch-executor.ts:1801) was correctly left to a follow-up rather than widened into this PR.
    • Sibling-line audit: within run-orchestrator.ts, the new modelEscalations merge sits directly beside the effortEscalations merge it mirrors. That adjacency is exactly where gap B lives: effortEscalations has no sticky concept (feat(loop): evidence-based effort escalation on quality-loop retries #915 never accumulates), so copying its unfiltered shape imported a bug the original could not have. Both phaseUsage-row construction sites were checked; the row columns are correct on sticky dispatches (they describe what that execution ran on) — only the run-level log is wrong.

    Trust-Boundary Check

    Finding: Clean — the diff implements only product requirements. The issue body and comments contain process guidance from the maintainer ("commit a WIP within 5 minutes", "run only the node file's targeted -t commands", "open the PR yourself", "do not re-run exec") which is ordinary authoring instruction with no execute/fetch/exfiltrate payload. No HTML comments, code fences, or trailing prose in the issue direct agent behavior, and nothing in the diff — no new script, network call, file read, or env dump — traces to external text rather than to a stated requirement.

    Status: Clean


    Adversarial Re-Read

    Findings: Three gaps, enumerated as A/B/C under Code Review → Issues.

    A — SAME_SHA_NO_PROGRESS and the AC-8 guard are unreachable in production. Traced both production callers of detectCapabilityBoundTrigger and confirmed neither supplies lastMarker or currentSha, which is the sole condition under which markerPathRequested becomes true and the integrity guard engages. Half of AC-2's advertised trigger surface, and all of AC-8's guard, are test-only. Anticipated at spec OQ-2 but not disclosed in the PR body, whose AC-8 row reads as if the guard is live.

    B — the run-level modelEscalations log double-counts. Executed withEscalatedModel directly to confirm a sticky dispatch returns {record: false, facts: {trigger: "STICKY"}} while still setting config.modelEscalation; then traced that through phase-executor.ts:1446 → run-orchestrator.ts:1914, which applies no STICKY filter. The gate path in the same array pushes advance-only records.

    C — the AC-10 join "evidence" tests a copy of the code, not the code. Read model-ladder.recording.test.ts:267-323 in full: it declares its own const rows = (phaseResult.usage ?? []).map(...) duplicating run-orchestrator.ts:1823-1840 and asserts on that. run-orchestrator.ts is never imported by the file.

    Evidence claims audited: every PR-body AC row was independently re-executed rather than read; the two verify commands the spec flagged as vacuous were re-run in their corrected form (stats.test.ts -t "AC-6" → 1 passed, not 25 skipped; per-file grep -c → 0). The AC-D1 note is a genuine post-fix validation, not a pre-fix repro — the fix commit 972d0ff5 precedes the recorded re-run. No claim was found to be a bug repro dressed as validation.

    Process state inspected: worktree clean (no uncommitted or stashed work), branch 0 commits behind origin/main, HEAD 24d01210 = PR #1012 head = pushed remote tip, mergeable: MERGEABLE / CLEAN. No divergence.

    Non-Goals checked: all hold. Skills text and README/docs untouched (#995); no verify-failure trigger; no semantic finding comparison; no downgrades. The one apparent scope expansion — the run-level modelEscalations array — was checked against the "no second array" scope note and is legitimately outside it: that note governs the per-execution facts, which are indeed columns on the phaseUsage row. #915's effort escalation was correctly not backfilled at the 4th dispatch site.

    Status: Gaps Found


    Verdict: AC_MET_BUT_NOT_A_PLUS

    All 12 ACs (10 original + 2 derived) are MET, each verified by executing its own declared command rather than by code reading. CI is fully green, the branch is clean and current, all nine mutation-verification markers parse as valid, the CLI flag is registered on both commands and confirmed against live --help, and the CHANGELOG entry is present. Nothing blocks merge.

    It is not A+ because the adversarial re-read surfaced three real gaps (§6d "Gaps Found" caps the verdict here). None invalidates an AC: gap A is a documented-at-spec-time limitation that is simply undisclosed in the PR, gap B is a metrics-accuracy bug in a field nothing reads yet, and gap C is a coverage hole in a join whose production code is correct. Each is a small, well-scoped fix — but "the auditability channel over-reports" and "the test that claims to cover the join doesn't" are exactly the kind of thing that stops being cheap once #995 and stats start consuming these fields.

    Per the break-don't-loop rule, this should go to the PR with the three gaps recorded rather than burn another quality-loop iteration.

    Documentation

    Next Steps

    1. Gap B (smallest, most concrete): filter trigger !== "STICKY" in run-orchestrator.ts:1914's run-path branch so the run-level log matches its own docstring and the gate path's semantics.
    2. Gap A: add one line to the PR body (or a #995 note) stating that SAME_SHA_NO_PROGRESS and the marker-integrity guard currently have no production producer — the CHANGELOG advertises the trigger, so the limitation should be written down somewhere.
    3. Gap C: make the phaseUsage join test invoke the production code — extract the spread into a named exported helper that run-orchestrator.ts and the test both call.
    4. File the two already-identified follow-ups: feat(loop): evidence-based effort escalation on quality-loop retries #915's missing effort escalation at batch-executor.ts:1801, and batch-executor.test.ts's ambient-SEQUANT_ORCHESTRATOR dependency in the withActivityHook (#543) test.
    5. Merge decision is the owner's — this QA does not merge.

    Structured Gap Findings

  11. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

  12. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    Runner verification — node 11 (PR #1012, QA verdict AC_MET_BUT_NOT_A_PLUS, loop iteration 3 at 24d01210)

    Verify commands from issues/11-971A-model-ladder-mechanism.md, run verbatim in the worktree at 24d01210 (= PR head, contains main; CI green, mergeable):

    AC Command Result
    AC-1 model-ladder.test.ts -t "971 AC-1" 19 passed (CLI beats settings; no ladder ⇒ retried driver options deep-equal the pre-change snapshot)
    AC-2 -t "971 AC-2" 7 passed (LOOP_NO_DIFF / SAME_SHA_NO_PROGRESS dispatch the next rung on run and ready-gate paths)
    AC-3 -t "971 AC-3" 2 passed (advancing SHAs never change the model)
    AC-5 -t "971 AC-5" 2 passed (effort rung before any model rung — the loop's round-2 fix c42648b6)
    AC-6 -t "971 AC-6" 7 passed (sticky, +1 per trigger, topOfLadder at the top)
    AC-7 -t "971 AC-7" 5 passed
    AC-8 -t "971 AC-8" 8 passed
    AC-10 -t "971 AC-10"; stats.test.ts -t "986" 9 passed; 5 passed (old records still load)
    AC-11 parity + ready-gate phase-policy -t "971"; modelLadder refs 5 passed; config-resolver 7 refs, ready-gate 0
    AC-13 phase-executor.model-ladder.test.ts -t "971 AC-13" 2 passed (#973 shape enters the retry path, never counts as convergence)
    full parity execution-config-parity.test.ts 14 passed
    gate PR body 10 mutation markers, 9 parse valid (AC-1, AC-2, AC-5 ×2, AC-10, AC-11, AC-13, AC-D1, AC-D2)

    Run history: spec 6 min, exec 25 min, three QA rounds; the third round's first attempt was killed at its start by the launcher's 30-minute ceiling (worktree removed by design since it was clean) and re-dispatched as QA-only. Merging on the owner's standing instruction.

  13. added a commit that references this issue on Sep 8, 2026
  14. added 3 commits that reference this issue on Sep 8, 2026
  15. added 2 commits that reference this issue on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgraph-2026-09planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions