You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kernel: under a Pause, a spent count holds the item with no Run in flight too #169
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 #158, "Kernel: spent attempts hold the item even while a refused Run is queued". With a Run in flight, #158 makes a spent count hold the item whatever would defer (a Pause, or a Pause that can't be read). With no Run in flight, a Pause still comes first in brakes.on_run and brakes.on_act. So a pull request whose attempts are spent reads verifying / paused / defer under a Pause, and one whose approval attempts are spent reads converged / paused, rather than held. Nothing is written while paused, so no act escapes. But the item leaves held for the Pause's length, the Maintainer's attention moves from the Hold to the Pause, and the two paths now disagree.
Done when
It is ruled whether a spent count holds the item under a Pause with no Run in flight, as it does with one.
If it does: _decide asks the ceilings before the Pause on both paths, with a boundary test and a mutant for each; if not, the reason is in the decision record.
Another case of the same split, from Codex on #170: a required check that gives no verdict (check_unreadable) wants no Run.
With no Run in flight, the item defers for a person, and the Run ceiling isn't asked.
With a Run in flight, it waits as working until that Run completes, even when max_runs_per_item completed Runs have spent the ceiling.
Neither path holds for run_ceiling. #158's ruling 1 scopes the in-flight ceilings to the wanted Run, so #170 keeps that scope. The ruling here should say whether a spent Run ceiling, which counts the whole item and not one Intent, holds the item even when its State wants no Run, on both paths.
Solution Architect, delegated. On main at c094a8b (#170).
The cause.brakes.on_run and brakes.on_act ask the Pause first and their ceilings after it. #170 made _decide ask the ceilings alone while a Run is in flight, so a spent count shows through a Pause there. With no Run in flight the Pause still answers first. So the same completed Runs read held with a Run queued and verifying / paused without one. An item already held also reads paused from the moment a Pause starts, and held again when it ends. The issue side is worse. issue.decide takes only a Hold from on_run while a Run is in flight, and under a Pause on_run gives the deferral. So on an issue a spent count is hidden by a Pause on both paths. Checked on c094a8b: a triage issue with three failed investigations reads triage / paused / defer with none in flight, and triage / nothing / working with one queued.
Codex's case is a different question. A State that wants no Run (check_unreadable, awaiting_checks, a converged item due its enqueue) never asks the Run ceiling, on either path. That is right, and stays.
1. A spent count holds under a Pause with no Run in flight too. Yes. Change the order in kernel/brakes.py only. on_run asks run_ceilings, then the Pause. on_act asks approval_ceilings for an approval, then the act ceiling if the count of acts can be read, then the Pause, then acts_unreadable. decide.py and issue.py are not edited for this. brakes.py is a protected path, so the hooks ask the Maintainer for the edit. Why: a Hold of the brakes is a reading, not an act (lifecycle/AGENTS.md): the counter renews only when a writer acts. Decision 0003's "a Pause stops every act" still holds. Nothing is written to a held item, and under a Pause nothing is written at all. §4.1 says a Pause "leaves each item where it is". Today it moves a held item to verifying or converged for its span. The Maintainer's attention also moves from a Hold they must end to a Pause they already know of. One order in brakes.py gives both item types the same reading, and closes the issue side's gap without touching lane b's module.
2. The act ceiling too, on the no-Run path. The rule is "a Pause changes no Hold": whatever Hold the brakes give unpaused, they give paused. A count of acts that cannot be read still defers, after the Pause, as now. With a Run in flight the act ceiling is still not asked: no act is decided while a Run waits, and #170's reason (an undeclared held → adjudicating by a Lens) stands. Why: asking only the Run counts first would leave converged / act_ceiling turning into converged / paused under a Pause, the same split this issue is about.
3. The Run ceiling holds only where a Run is wanted, on both paths. "Wanted" means _wanted_run gives one, or the act is issue_approval, which _spent counts as a Run that may not land. An item whose State wants neither is not held by the Run ceiling, with a Run in flight or none. So check_unreadable defers for a person with none in flight, and waits working with one. Once a Run is wanted again, the ceiling holds before any Run is admitted. Why: the Run ceiling is the cost ceiling (FR-39, §3.9). It bounds model spend, and an item that wants no Run spends none. The Lifecycle already declares an item leaving such a Hold when no Run is wanted: held → converged and held → addressing by a Lens, bound max_runs_per_item. Holding anyway would stop an approved item's enqueue, which spends no model. No person is left out. check_unreadable already calls the Maintainer (needs_you), and it is the cause they can act on: one cause, one alert (I-23). A wait for checks goes stale at its limit. So no Factory-made Hold is ever ended by the Factory. It shows only while something would spend.
4. Boundary tests, written first. Every Run starts after the facts' last_writer_action_at, or it is not counted.
Seed 297's Runs without r4, so none is in flight. verifying / awaiting_review on content C. r0 review-change superseded, r1 to r3 completed, failure, outcome item. With paused True and None: held / attempts_exhausted / hold / needs_you, evidence [r1, r2, r3]. Without r3: verifying / paused (or pause_unreadable) / defer.
Rounds: adjudicating, max_rounds completed adjudicate-findings Runs, paused: held / max_rounds / hold. One fewer: adjudicating / paused / defer.
Run ceiling: verifying / awaiting_review, max_runs_per_item completed fix-findings Runs that succeeded, paused: held / run_ceiling / hold / needs_you. One fewer: verifying / paused / defer.
Act ceiling: converged / approval_due, acts_since_writer at max_acts_per_item, paused: held / act_ceiling / hold / needs_you. One fewer: converged / paused / defer. acts_since_writer None and paused: paused / defer; unpaused: acts_unreadable / defer.
In tests/test_transitions.py, "a Pause changes no Hold": for every base in BASES, with a Run in flight and without, decide with paused True and with paused None equals decide unpaused whenever that one's outcome is hold.
In tests/test_issue.py: triage with max_attempts failed investigations, paused True and None, none in flight and one queued: held / attempts_exhausted / hold / needs_you in all four. One fewer: triage / paused / defer with none in flight, triage / nothing / working with one queued. new / acceptance_due at the act ceiling, paused: held / act_ceiling.
Codex's case: verifying / check_unreadable (one required check neutral), max_runs_per_item completed Runs. None in flight: verifying / check_unreadable / defer / needs_you. One queued: verifying / check_unreadable / nothing / working. Other side: the same Runs with that check failure: held / run_ceiling / hold, none in flight and one queued, paused or not. And converged / approved at the Run ceiling: act / enqueue.
I checked the order of rulings 1 and 2 on a copy of c094a8b. Every case above reads as stated. "A Pause changes no Hold" fails on c094a8b for six bases (attempts_exhausted, its approvals', run_ceiling, max_rounds, act_ceiling and the dependency update's), and passes for all 27 Holds with the new order. test_decide, test_issue and test_transitions pass unchanged, so nothing tests this split today.
5. Mutants, appended to MUTANTS, each with text that appears once. Keep the lines pause = paused(...) / if pause: and stopped = paused(...) / if stopped: as they are, so the existing Pause mutants still find their text. Update the mutants that name the act ceiling's if where that line changes.
"a spent count waits behind the Pause": moved_after("kernel/brakes.py", <on_run's three run_ceilings lines>, " return pause\n"). The seed-297 test kills it.
"an approval's spent count waits behind the Pause": moved_after of on_act's if action == "issue_approval": block to after " return stopped\n". The approval test kills it.
"the act ceiling waits behind the Pause": moved_after of the act ceiling's two lines to after " return stopped\n". The act ceiling test kills it.
"the Run ceiling holds an item that wants no Run": in decide.py, if reason == "check_unreadable":\n becomes the same line, then return brakes.run_ceilings(_decision, facts, evidence, "", since_writer(mine, facts), config["limits"]) or _decision(facts, state, reason, evidence, t.DEFER), then if False:. Codex's no-flight test kills it.
"the Run ceiling holds an item that wants no Run while a Run waits": elif wanted is not None: with its run_ceilings(..., wanted[1], ...) line becomes else: with wanted[1] if wanted else "". Codex's in-flight test kills it.
6. The simulator. In sim/world.py, paused() checks that a ceiling's Hold shows unchanged under a Pause whether or not a Run is in flight. stopped then holds only what would be admitted or acted. The comment on CEILINGS says so; "the Pause defers first" goes. tests/test_simulator.py::test_under_a_pause_a_spent_count_shows_while_a_run_is_in_flight becomes test_under_a_pause_a_spent_count_shows. Its other side flips: with no Run in flight the Hold shows too, and a deferral in its place breaks the invariant. On the copy, seed 273 breaks the old check at 300 seeds, and the new check passes at 40 and 300. No seed of the first 40 reaches it. Once #168 lands, none of 300 does, so the hand-built world and the boundary tests hold it. No coverage test asks for it.
7. Record. No new record: this makes decision 0003's brakes hold as written. Add two Boundary rows to 0003:
"Under a Pause, or one that cannot be read, every Hold the brakes give unpaused is given unchanged, with a Run in flight or none, on a pull request and an issue: a Hold is a reading and no act, and a Pause leaves each item where it is". It names the no-flight tests, test_a_pause_changes_no_hold, the issue test and test_under_a_pause_a_spent_count_shows.
"The Run ceiling holds only an item that wants a Run or an approval; one that wants neither is not held by it, with a Run in flight or none". It names Codex's two tests.
8. Out of scope. A dequeue under a Pause defers as before: it is an act. The act ceiling while a Run waits stays as #170 left it. Whether a Hold of the brakes also gets the label waits on controller/ (decision 0031). Whether a superseded Run counts toward the Run ceiling is #158's ruling 3, still unfiled.
Activity
don-petry commentedon Oct 18, 2026
Another case of the same split, from Codex on #170: a required check that gives no verdict (
check_unreadable) wants no Run.workinguntil that Run completes, even whenmax_runs_per_itemcompleted Runs have spent the ceiling.Neither path holds for
run_ceiling. #158's ruling 1 scopes the in-flight ceilings to the wanted Run, so #170 keeps that scope. The ruling here should say whether a spent Run ceiling, which counts the whole item and not one Intent, holds the item even when its State wants no Run, on both paths.don-petry commentedon Oct 18, 2026
Working rulings (overturnable in review)
Solution Architect, delegated. On main at c094a8b (#170).
The cause.
brakes.on_runandbrakes.on_actask the Pause first and their ceilings after it. #170 made_decideask the ceilings alone while a Run is in flight, so a spent count shows through a Pause there. With no Run in flight the Pause still answers first. So the same completed Runs readheldwith a Run queued andverifying / pausedwithout one. An item already held also readspausedfrom the moment a Pause starts, andheldagain when it ends. The issue side is worse.issue.decidetakes only a Hold fromon_runwhile a Run is in flight, and under a Pauseon_rungives the deferral. So on an issue a spent count is hidden by a Pause on both paths. Checked on c094a8b: atriageissue with three failed investigations readstriage / paused / deferwith none in flight, andtriage / nothing / workingwith one queued.Codex's case is a different question. A State that wants no Run (
check_unreadable,awaiting_checks, a converged item due itsenqueue) never asks the Run ceiling, on either path. That is right, and stays.1. A spent count holds under a Pause with no Run in flight too. Yes. Change the order in
kernel/brakes.pyonly.on_runasksrun_ceilings, then the Pause.on_actasksapproval_ceilingsfor an approval, then the act ceiling if the count of acts can be read, then the Pause, thenacts_unreadable.decide.pyandissue.pyare not edited for this.brakes.pyis a protected path, so the hooks ask the Maintainer for the edit. Why: a Hold of the brakes is a reading, not an act (lifecycle/AGENTS.md): the counter renews only when a writer acts. Decision 0003's "a Pause stops every act" still holds. Nothing is written to a held item, and under a Pause nothing is written at all. §4.1 says a Pause "leaves each item where it is". Today it moves a held item toverifyingorconvergedfor its span. The Maintainer's attention also moves from a Hold they must end to a Pause they already know of. One order inbrakes.pygives both item types the same reading, and closes the issue side's gap without touching lane b's module.2. The act ceiling too, on the no-Run path. The rule is "a Pause changes no Hold": whatever Hold the brakes give unpaused, they give paused. A count of acts that cannot be read still defers, after the Pause, as now. With a Run in flight the act ceiling is still not asked: no act is decided while a Run waits, and #170's reason (an undeclared
held → adjudicatingby a Lens) stands. Why: asking only the Run counts first would leaveconverged / act_ceilingturning intoconverged / pausedunder a Pause, the same split this issue is about.3. The Run ceiling holds only where a Run is wanted, on both paths. "Wanted" means
_wanted_rungives one, or the act isissue_approval, which_spentcounts as a Run that may not land. An item whose State wants neither is not held by the Run ceiling, with a Run in flight or none. Socheck_unreadabledefers for a person with none in flight, and waitsworkingwith one. Once a Run is wanted again, the ceiling holds before any Run is admitted. Why: the Run ceiling is the cost ceiling (FR-39, §3.9). It bounds model spend, and an item that wants no Run spends none. The Lifecycle already declares an item leaving such a Hold when no Run is wanted:held → convergedandheld → addressingby a Lens, boundmax_runs_per_item. Holding anyway would stop an approved item'senqueue, which spends no model. No person is left out.check_unreadablealready calls the Maintainer (needs_you), and it is the cause they can act on: one cause, one alert (I-23). A wait for checks goes stale at its limit. So no Factory-made Hold is ever ended by the Factory. It shows only while something would spend.4. Boundary tests, written first. Every Run starts after the facts'
last_writer_action_at, or it is not counted.verifying / awaiting_reviewon content C. r0review-changesuperseded, r1 to r3 completed,failure, outcomeitem. WithpausedTrue and None:held / attempts_exhausted / hold / needs_you, evidence[r1, r2, r3]. Without r3:verifying / paused(orpause_unreadable)/ defer.adjudicating,max_roundscompletedadjudicate-findingsRuns, paused:held / max_rounds / hold. One fewer:adjudicating / paused / defer.verifying / awaiting_review,max_runs_per_itemcompletedfix-findingsRuns that succeeded, paused:held / run_ceiling / hold / needs_you. One fewer:verifying / paused / defer.converged / approval_due,max_attemptsfailed approvals, outcomeitem, paused:held / attempts_exhausted / hold. One fewer:converged / paused / defer.converged / approval_due,acts_since_writeratmax_acts_per_item, paused:held / act_ceiling / hold / needs_you. One fewer:converged / paused / defer.acts_since_writerNone and paused:paused / defer; unpaused:acts_unreadable / defer.tests/test_transitions.py, "a Pause changes no Hold": for every base inBASES, with a Run in flight and without,decidewithpausedTrue and withpausedNone equalsdecideunpaused whenever that one's outcome ishold.tests/test_issue.py:triagewithmax_attemptsfailed investigations, paused True and None, none in flight and one queued:held / attempts_exhausted / hold / needs_youin all four. One fewer:triage / paused / deferwith none in flight,triage / nothing / workingwith one queued.new / acceptance_dueat the act ceiling, paused:held / act_ceiling.verifying / check_unreadable(one required checkneutral),max_runs_per_itemcompleted Runs. None in flight:verifying / check_unreadable / defer / needs_you. One queued:verifying / check_unreadable / nothing / working. Other side: the same Runs with that checkfailure:held / run_ceiling / hold, none in flight and one queued, paused or not. Andconverged / approvedat the Run ceiling:act / enqueue.I checked the order of rulings 1 and 2 on a copy of c094a8b. Every case above reads as stated. "A Pause changes no Hold" fails on c094a8b for six bases (
attempts_exhausted, its approvals',run_ceiling,max_rounds,act_ceilingand the dependency update's), and passes for all 27 Holds with the new order.test_decide,test_issueandtest_transitionspass unchanged, so nothing tests this split today.5. Mutants, appended to
MUTANTS, each with text that appears once. Keep the linespause = paused(...)/if pause:andstopped = paused(...)/if stopped:as they are, so the existing Pause mutants still find their text. Update the mutants that name the act ceiling'sifwhere that line changes.moved_after("kernel/brakes.py", <on_run's three run_ceilings lines>, " return pause\n"). The seed-297 test kills it.moved_afterofon_act'sif action == "issue_approval":block to after" return stopped\n". The approval test kills it.moved_afterof the act ceiling's two lines to after" return stopped\n". The act ceiling test kills it.decide.py,if reason == "check_unreadable":\nbecomes the same line, thenreturn brakes.run_ceilings(_decision, facts, evidence, "", since_writer(mine, facts), config["limits"]) or _decision(facts, state, reason, evidence, t.DEFER), thenif False:. Codex's no-flight test kills it.elif wanted is not None:with itsrun_ceilings(..., wanted[1], ...)line becomeselse:withwanted[1] if wanted else "". Codex's in-flight test kills it.6. The simulator. In
sim/world.py,paused()checks that a ceiling's Hold shows unchanged under a Pause whether or not a Run is in flight.stoppedthen holds only what would be admitted or acted. The comment onCEILINGSsays so; "the Pause defers first" goes.tests/test_simulator.py::test_under_a_pause_a_spent_count_shows_while_a_run_is_in_flightbecomestest_under_a_pause_a_spent_count_shows. Its other side flips: with no Run in flight the Hold shows too, and a deferral in its place breaks the invariant. On the copy, seed 273 breaks the old check at 300 seeds, and the new check passes at 40 and 300. No seed of the first 40 reaches it. Once #168 lands, none of 300 does, so the hand-built world and the boundary tests hold it. No coverage test asks for it.7. Record. No new record: this makes decision 0003's brakes hold as written. Add two Boundary rows to 0003:
test_a_pause_changes_no_hold, the issue test andtest_under_a_pause_a_spent_count_shows.8. Out of scope. A dequeue under a Pause defers as before: it is an act. The act ceiling while a Run waits stays as #170 left it. Whether a Hold of the brakes also gets the label waits on
controller/(decision 0031). Whether a superseded Run counts toward the Run ceiling is #158's ruling 3, still unfiled.Needs the Maintainer? None.