Skip to content

fixture: impossible AC — ladder divergence rig (#995 AC-14) #1015

Closed as not planned

Description

@admarble

Throwaway fixture issue. Filed solely to satisfy #995 AC-14's "first real use" rule: a rigged, deterministic run that must halt with SPEC_DIVERGENCE and spend zero model rungs. It will be closed with a comment linking the run as soon as that run completes. Do not implement it.

Why

#995 adds the SPEC_DIVERGENCE escape hatch: an agent that finds an acceptance criterion impossible as written declares it and stops, instead of guessing. This issue's single AC is impossible by construction, so it exercises exactly that path.

Acceptance criteria

  • AC-1: The file src/lib/workflow/impossible-fixture.ts must exist in the repository AND must not exist in the repository — both conditions must hold simultaneously in the same commit — Verify: test -f src/lib/workflow/impossible-fixture.ts && test ! -f src/lib/workflow/impossible-fixture.ts exits 0.

Done when

The run halts with SPEC_DIVERGENCE naming AC-1, with an empty escalation history. There is no implementation to deliver.

Activity

  1. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    /exec — halted: SPEC_DIVERGENCE

    AC-1 requires src/lib/workflow/impossible-fixture.ts to both exist and not exist in the repository simultaneously, in the same commit. That is a logical contradiction — no implementation can satisfy both conditions at once. Per this issue's own description, this is the intended, cheap halt path exercising #995's SPEC_DIVERGENCE escape hatch.

    No implementation attempted. No retry dispatched, no model escalation spent.

  2. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    /qa Review — #1015 (fixture: impossible AC, ladder divergence rig)

    Verdict: AC_NOT_MET

    The /exec refusal was the correct judgment — AC-1 is a genuine contradiction and no code was written, exactly as the issue instructs. But this fixture's job is to produce evidence, and the "Done when" is not satisfied: the halt did not go through the run machinery, and the marker that was emitted cannot halt a run.

    AC verification

    AC Status Evidence
    AC-1 (impossible by construction) ✅ Correctly refused No src/lib/workflow/impossible-fixture.ts; no commits on this branch for #1015 (git log --grep=1015 → empty). Refusal, not implementation, is the intended outcome.
    Done when: run halts with SPEC_DIVERGENCE naming AC-1, empty escalation history ❌ Not met See F1 and F2 below.

    F1 (blocking, also a shipped defect in #995) — the skill documents a marker name the parser does not match

    All six mirrored skill files instruct the agent to emit:

    <!-- SEQUANT_exec: {...,"outcome":"SPEC_DIVERGENCE",...} -->     (exec, x3 mirrors, line 123)
    <!-- SEQUANT_loop: {...,"outcome":"SPEC_DIVERGENCE",...} -->     (loop, x3 mirrors, line 284)
    

    But phase-detection.ts:23 matches only SEQUANT_PHASE:

    const PHASE_MARKER_REGEX = /<!-- SEQUANT_PHASE: (\{[^}]+\}) -->/g;

    Ran the real parsers against the three strings:

    skill-documented SEQUANT_exec  -> markers: 0 | parseSpecDivergence: undefined
    posted on #1015 (SEQUANT_exec) -> markers: 0 | parseSpecDivergence: undefined
    control SEQUANT_PHASE          -> markers: 1 | parseSpecDivergence: {"acs":"AC-1"}
    

    grep -rn "SEQUANT_exec\|SEQUANT_loop" src/ returns nothing — there is no alternate consumer. So an agent that follows the skill verbatim yields specDivergence: undefined in mapAgentSuccessToPhaseResult, haltedByDivergence is never set (batch-executor.ts:1677), and the run proceeds to retry and climb the ladder — the precise behaviour #971 AC-4 / #995 exist to prevent. The escape hatch is documented into an unreachable state.

    The code is the correct side of this drift: phase-executor.ts:904-908 deliberately states "The declaration channel is the existing SEQUANT_PHASE marker rather than a new marker family." The fix is in the six skill files (SEQUANT_exec/SEQUANT_loop → SEQUANT_PHASE), which belongs in #995's own work — #995 is open with no PR yet and these commits sit on this branch.

    Why CI is green on it: the gate test at model-ladder.test.ts:1195-1218 asserts the section contains "outcome":"SPEC_DIVERGENCE" but never asserts the marker name, so renaming the marker family cannot fail it. Tighten it to assert SEQUANT_PHASE in the same delimited section, and mutation-verify per CLAUDE.md.

    F2 (blocking) — no orchestrated run occurred, so there is no escalation history to be empty

    The halt was produced by a hand-invoked /exec skill in an interactive session, not by sequant run:

    "Empty escalation history" was therefore never recorded — it simply never existed. #995 AC-14 asks for a rigged, deterministic run through the real machinery; that evidence has not been produced. Note F1 is exactly the class of defect a real run would have caught, which is the argument for running it rather than waiving it.

    Nit

    The posted marker's timestamp is a fabricated 2026-09-08T00:00:00Z rather than the actual halt time. Harmless to the schema, but it makes the marker useless for ordering.

    Required to close

    1. Fix the marker name in all six skill mirrors (in feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995), and tighten the gate test to assert the name.
    2. Re-run this fixture through sequant run 1015 so a real halt, evidence bundle, and empty escalationHistory are recorded; link that run here.

    Test/build state

    npx vitest run src/lib/workflow/{model-ladder,phase-executor.model-ladder,batch-executor.model-ladder}.test.ts → 3 files, 84 passed. Green, but green over the F1 blind spot.

  3. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    /exec — halted: SPEC_DIVERGENCE

    AC-1 requires src/lib/workflow/impossible-fixture.ts to both exist and not exist in the repository simultaneously, in the same commit. That is a logical contradiction — no implementation can satisfy both conditions at once. Per this issue's own description, this is the intended, cheap halt path exercising #995's SPEC_DIVERGENCE escape hatch.

    No implementation attempted. No retry dispatched, no model escalation spent.

    Note: this branch already carries #995's fix (commit bbc1df8) restoring the SEQUANT_PHASE marker name in the skills, addressing the prior /qa's F1 finding. This halt marker uses SEQUANT_PHASE accordingly.

  4. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    /qa Review — #1015 (fixture: impossible AC, ladder divergence rig)

    Verdict: AC_NOT_MET

    Progress since the last pass: prior blocker F1 is fixed and mutation-verified, and unlike last time an orchestrated sequant run really did happen. But the "Done when" is still not satisfied — the run did not halt, and two independent reasons explain why, one of which is a new, shipped defect in #995.

    AC verification

    AC Status Evidence
    AC-1 (impossible by construction) ✅ Correctly refused src/lib/workflow/impossible-fixture.ts absent; no #1015 implementation commits on the branch. /exec declared the contradiction and wrote no code — the intended outcome.
    Done when: run halts with SPEC_DIVERGENCE naming AC-1, empty escalation history ❌ NOT MET See F2' and F3.

    F1 (prior blocker) — RESOLVED, mutation-verified

    All six mirrors now carry SEQUANT_PHASE; SEQUANT_exec/SEQUANT_loop are gone (0 occurrences across all six). The gate test at model-ladder.test.ts:1198-1245 no longer greps for a substring — it slices the delimited When the spec is impossible as written section, pulls the skill's own example line, and feeds it to the real parsePhaseMarkers + parseSpecDivergence.

    Mutation-verified this pass:

    Mutation-verified: F1 — renamed the marker in .claude/skills/exec/SKILL.md:123 from SEQUANT_PHASE to SEQUANT_exec; "971 AC-4 ... the exec and loop skills tell agents when to emit the marker, in all three mirrored copies" failed (expected [] to have a length of 1 but got +0); restored, green.

    F2' (prior blocker, partially addressed) — the run happened, but the orchestrator has no divergence code

    An orchestrated run is on record this time (.sequant/state.json, main checkout):

    "phases": { "exec": { "status": "completed", ... 09:15:35 → 09:16:12 } },
    "currentPhase": "qa"
    

    exec is recorded completed, and the run advanced to qa — it did not halt. Root cause: the sequant on PATH symlinks to the main checkout (/opt/homebrew/bin/sequant → …/Users/tony/Projects/sequant/dist), and #995 is unmerged. In the running dist/:

    So no EvidenceBundle and no escalationHistory were produced — not "empty", absent. (Consistent with metrics.json: 0 rows for #1015, no escalatedModel anywhere. Nothing was spent, but nothing was recorded either.)

    F3 (NEW, blocking — a shipped defect in #995, not just a harness problem)

    Even with #995 installed, this run would still not have halted. The declaration channel the skills document is not the channel the parser reads.

    parseSpecDivergence(agentResult.output) (phase-executor.ts:959) reads AgentPhaseResult.output, which the Claude Code driver builds at drivers/claude-code.ts:199:

    if (message.type === "assistant") {
      const textContent = content.filter((c) => c.type === "text" && c.text)...
      capturedOutput += textContent;
    }

    Assistant text blocks only — tool inputs and tool results are never captured. But both skills route SEQUANT_PHASE markers to a gh issue comment ("Include this marker in every gh issue comment that represents phase completion or failure"), which is a Bash tool input. And under orchestration the exec skill explicitly closes even that channel: "Skip posting progress comments to GitHub — no per-phase comment is posted under sequant run". Neither skill nor docs/reference/model-ladder.md ever says the marker must appear, unfenced, in the agent's own reply.

    Measured on this run's real transcript (500c752a-…jsonl): the marker appears 3× in tool inputs, 0× in assistant text.

    Ran the real parser against three inputs:

    A) REAL exec assistant text (what capturedOutput held) -> undefined
    B) bare marker in assistant text                       -> {"acs":"AC-1","message":"contradiction"}
    C) marker inside a fenced block                        -> undefined
    

    (A) is the finding: specDivergence is undefined, so batch-executor.ts:1676 never fires, haltedByDivergence stays null, and the run climbs — the precise behaviour #971 AC-4 / #995 exist to prevent. (C) matters because the skill presents the marker inside a ```markdown fence, and the code-block stripping that (correctly) stops an agent from halting itself by documenting the marker also means a copy-pasted fenced emission is inert.

    Why the #995 suite is green over this: every divergence test constructs output as a string and hands it straight to the parser. Nothing exercises the driver → capturedOutput → parseSpecDivergence path, so the channel mismatch is invisible to CI. This is exactly the integration-level class of defect the AC-14 rigged run exists to surface — the run did its job.

    Suggested fix (in #995): state the channel explicitly in all six mirrors — the marker must be emitted in the agent's own final message, unfenced, not (only) in a gh issue comment — and add one test that drives a fixture AgentPhaseResult through mapAgentSuccessToPhaseResult to assert the halt fires from driver-shaped output.

    Checks

    Check Result
    npm run build ✅ Pass
    npm run lint ✅ Pass (0 warnings)
    ladder/divergence suites (3 files) ✅ 84 passed
    Type issues (any) 0
    Deleted tests 0
    Files changed / lines 22 / +1632 −19
    CHANGELOG [Unreleased] ✅ Present, #995 entry
    Stale branch 0 commits behind origin/main
    PR None (fixture issue; #995's work is unmerged on this branch)

    Required to close

    1. Fix F3 in feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995 — document the emission channel in all six mirrors and add the driver-shaped integration test.
    2. Re-run the fixture against a build that contains feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995 (npm run build in the main checkout after feat(run): SPEC_DIVERGENCE escape hatch, ladder halts with evidence bundles, docs, rigged real run (#971 part B) #995 lands, or point the run at this worktree's dist/) so a real halt, evidence bundle, and empty escalationHistory are recorded.

    Until then the fixture's "Done when" is unmet — but this pass produced the evidence it was filed to produce, and F3 is a genuine catch that no amount of unit-level green would have surfaced.

  5. admarble commented on Sep 8, 2026

    @admarble
    ContributorAuthor

    Closing — the rigged run halted with SPEC_DIVERGENCE (#995 AC-14)

    Re-ran through the real sequant run machinery against a build containing #995. The fixture did its job twice over: the first run failed and surfaced a genuine shipped defect in #995, which is exactly why the "first real use" rule exists.

    Run 1 (c9b05922, 09:22Z) — did not halt; surfaced F3

    Exec declared the contradiction correctly but the run advanced to qa anyway. Root cause, since fixed in #995 (eff47840):

    • ClaudeCodeDriver fills AgentPhaseResult.output from assistant text blocks only (drivers/claude-code.ts:194-199).
    • Both skills routed the marker to a gh issue comment — a tool input, never in output. Under sequant run the exec phase posts no issue comment at all, so the marker had no channel whatsoever.
    • parsePhaseMarkers additionally strips fenced code, so the skills' documented example could not double as the declaration.

    Net effect: specDivergence was always undefined under orchestration and a diverging spec climbed the ladder anyway — the precise cost #971 AC-4 exists to avoid. The suite was green over it because every divergence test handed a literal string straight to the parser; nothing drove driver-shaped output through mapAgentSuccessToPhaseResult.

    Run 2 (8f0e181d, 09:27Z) — halted as specified

    sequant run 1015 --phases exec,qa --model-ladder sonnet,opus --max-iterations 2 --timeout 420 --verbose

    Ladder halt: SPEC_DIVERGENCE — issue #1015, phase 'exec'
      Why: the agent declared the spec impossible as written — no model rung was spent
      Declared impossible: AC-1
      Agent message: AC-1 requires src/lib/workflow/impossible-fixture.ts to simultaneously
        exist and not exist in the same commit, which is a logical contradiction no
        implementation can satisfy
      Escalation history:
        (empty — no model rung was spent)
      Next step: Reconcile the acceptance criteria with the repository as it exists, then
        re-run. A stronger model cannot resolve a contradiction in the spec.
    
    Done-when clause Evidence
    Halts with SPEC_DIVERGENCE Halt banner above; run recorded phases: ["exec"] — qa was suppressed, not merely failed
    Names AC-1 Declared impossible: AC-1
    Empty escalation history (empty — no model rung was spent)
    Zero rungs spent phasePolicies.exec.resolvedModel = claude-sonnet-5 — the ladder's bottom rung; never escalated
    AC-14 jq over .sequant/metrics.json → 0

    Halted in 31s on one exec dispatch.

    One honest caveat on the jq. It returns 0 as AC-14 requires, but it is a weak signal on its own: phaseUsage is 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 plus resolvedModel = claude-sonnet-5. Noted on #995 for the owner rather than filed separately (I-7).

    No implementation was delivered, and none was possible. Closing as intended.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions