Skip to content

Kernel: spent attempts hold the item even while a refused Run is queued #158

Closed

Description

@don-petry

Part of the epic "Epic: slice 0, foundations. The repo holds the line, its context is tested, and the platform facts are recorded".

Why. Found while building #16, "Kernel: a reviewing Run that leaves a rubric criterion uncovered has not reported", and reproduced by its review. Given the complete run list, decide reads an item whose attempts are spent as verifying while the list still holds a queued Run the brakes would refuse.

The failing case is the simulator's seed 297, with uncovered reviews on every seed. Runs r0 (superseded), r1, r2 and r3 (failure/item), and r4 queued. decide returns verifying / awaiting_review / nothing where it should return held / attempts_exhausted.

So the Factory itself moves the item from held to verifying, a move the Lifecycle doesn't declare (I-12). The needs_you Hold disappears while r4 waits. The lane then supersedes r4 at start, so no Effect follows and no model is spent, but the move is still undeclared. kernel/brakes.py's on_run reaches the attempts Hold only when a Run would be admitted.

This likely predates #16, for any Intent. #16's simulator narrows its spread (UNCOVERED_SEEDS = 6 in sim/world.py) and so avoids the seed rather than fixing it.

The other half of seed 297 is a modelled platform fault: a list that claims to be whole is one Run short. No Kernel can see that, and it's not in scope here.

Done when

  • With attempts spent, a queued or in-progress Run that the brakes would refuse doesn't hide the Hold: decide gives held / attempts_exhausted whatever else the list holds.
  • A boundary test from seed 297's facts, and a mutant.
  • UNCOVERED_SEEDS in sim/world.py goes back to every seed (or the spread Kernel: a reviewing Run that leaves a rubric criterion uncovered has not reported #16 first used), and the simulator's invariants hold across the 300 seeds.

Activity

  1. don-petry commented on Oct 18, 2026

    @don-petry
    ContributorAuthor

    Working rulings (overturnable in review)

    Solution Architect, delegated. On main at 72f8643 (#162). Builds on #159 (branch kernel/rubric-coverage, record 0029), which must merge first: UNCOVERED_SEEDS is on its branch.

    The cause. In _decide, the wait for a Run in flight returns nothing, working before the brakes are asked. While any Run waits, a count already spent is hidden. No Run in flight can lower a count: attempts and rounds count completed Runs, and only a writer's action renews them. So a Run that waits past a spent count was admitted on a short list, and the item should be held while it waits.

    1. Where the Hold is read. In kernel/decide.py only. Work out the wanted Run before the in-flight wait. With a Run in flight, ask the brakes about the wanted Run against the completed Runs since a writer. Return a Hold if they give one. Anything else, a Pause's deferral included, keeps today's nothing, working. A converged item asks on_act the same way, Holds only. brakes.py is not edited. Why: the issue says any Intent. Taking only Holds keeps the Pause as it is with a Run in flight. Under a Pause the State is not held anyway, so no new move appears.

    2. Completed Runs only. The brakes get [r for r in since if r["status"] == "completed"]. Why: _spent counts Runs in flight toward the Run ceiling. Given the whole list, the tenth Run, admitted with nine completed, would be held at the ceiling it was admitted under.

    3. A superseded Run is not an attempt, before or after: its outcome is superseded, not item (I-23). So r0 counts for nothing. When the lane supersedes r4 at start, the evidence stays r1 to r3, and held stays held. Whether a superseded Run counts toward the Run ceiling is not this story. _spent counts it and the simulator's check does not. File it if wanted.

    4. Boundary tests, written first:

    • Seed 297's facts: verifying / awaiting_review on content C. r0 review-change superseded. r1 to r3 completed, failure, outcome item. r4 queued. Expect held / attempts_exhausted / hold / needs_you, evidence [r1, r2, r3]. Again with r4 in_progress.
    • Without r3 it gives nothing, working: r0 is no attempt.
    • max_runs_per_item - 1 completed and one in flight: nothing, working. max_runs_per_item completed and one queued: held / run_ceiling.
    • Converged, approval_due, max_attempts failed approvals and one queued: held / attempts_exhausted.

    5. Mutants, appended to MUTANTS, each with text that appears once:

    • "a spent count waits behind a Run in flight": the in-flight brake's if becomes if False:. Seed 297's test kills it.
    • "a Run in flight counts toward the ceiling": the completed filter becomes the whole list. The ceiling-minus-one test kills it.

    6. The simulator. UNCOVERED_SEEDS goes back to 1, every seed under faults, and UNCOVERED stays 0.5. Drop the issue-158 sentence from its comment, and say "every seed" in sim/AGENTS.md. sim/world.py is protected. Run with SIM_SEEDS=40 locally; CI's shards run all 300. If a seed then fails for another cause, file it rather than narrow the spread.

    7. Record. No 0031: this makes decision 0003's brakes hold as written. Add a row to 0003's Boundaries, "A count the completed Runs have spent holds the item, whatever Run waits", naming the seed-297 and ceiling tests.

    8. Out of scope. The short list itself. No Kernel can see it, and the re-ask at start (I-38) stops r4. #42's issue decision reads its brakes the same way, in its own module.

    Needs the Maintainer? None.

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