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: what is admitted on an issue, and when apply refuses #42
Part of the epic "Epic: slice 0, foundations. The repo holds the line, its context is tested, and the platform facts are recorded".
Why. The State table says where an issue is. Which Run is admitted there, in what order, up to which bound, and when a Run in flight must write nothing, are separate rules, and the reviews found most of their faults in these.
Done when
In triage the Kernel admits one Run at a time: an investigating Run unless the investigation is current, then a readiness Run unless a verdict stands or a person overruled it, then nothing. Each has its boundary test first.
The Controller's acts are Decisions too: accept, remove a label that no longer counts, place a Hold when a bound is exceeded. None is repeated once its label is there.
Asked again with a Run left out of the records, the Kernel refuses that Run when a label was removed, a Hold was added, the content changed or the branch head moved.
Each bound of §4.1 has a test at the bound and one beyond it, and each rule a mutant that is killed.
Needs. The story "Kernel: derive an issue's State from its facts". How an act is counted waits on the ruling in the story "Kernel: how an act is recorded and bounded"; until then the label's presence is the only guard, and the test says so.
Design. §4.1, Acceptance, Investigation, Readiness, "What apply checks on an issue", "What bounds it"; I-40, I-42, I-43; I-21, I-38.
Solution Architect, delegated. On main at 72f8643 (#162). Builds on #41 (PR #155, branch kernel/issue-state, record 0028), which must merge first.
0. The lane holds, with no dispatch.issue.decide(facts, runs, context, config, now) goes beside issue.derive in kernel/issue.py. No edits to decide.py, derive.py, terms.py, gate.py or brakes.py. The Controller picks by item.type (0028). If one entry is wanted later, it is 0028's two-line dispatch, decided with controller/, and that change joins the PR-side lane's sequence. #42 does not.
It adds two imports and edits neither: brakes and since_writer. It has its own Decision maker and its own needs-you reasons. The schema is issue-decision/1, found by check_examples by name. Why: the State enum in decision.schema.json is the pull request's.
1. Admission. In triage, one Run at a time:
investigate-issue, unless the investigation is current: that Role completed a successful Run for this content_id after last_writer_action_at. Once the record expires, its App's entry in role_comments, later than both, stands in. A failed Run is an attempt, which on_run bounds.
judge-readiness (from Kernel: derive an issue's State from its facts #41), by another Role, once the investigation is current. Not again after a readiness Run for this content since the investigation. Not after a person removed factory:ready since the content changed (I-40). After expiry, that App's label or comment stands in.
Otherwise nothing, with a reason that needs a person.
In ready: open-pull-request (from #41). On an outsider's issue it needs a statement: the investigating App's comment, or a writer's, after the content changed. With neither, no_statement. issues.intents maps each Intent to {role, app}, null by default. Null admits nothing. Two Intents with one Role defer. A Run in flight admits nothing; the brakes' Holds still apply (#158).
2. The Controller's acts are Decisions.
accept: row 10, the Controller's App declared for factory:triage, and no person has removed it since the content changed. on_act bounds it. Why the App: an undeclared App's label never counts, so it would be removed and added for ever.
remove_label: a factory:triage or factory:ready that stands and doesn't count, in new, triage or ready. Never the Hold, admission or hands-off.
place_hold: unmerged closes past max_unmerged_closes, counted in this life since a person last removed factory:hold. Why a label: only that removal resets the count.
The last two stop work. Only the Pause stops them (0003). None is decided once its label is there, or gone. The new fact acts_since_writer counts acts (#37). Opening attempts and the Run ceiling are the brakes' hold, as on a pull request. Whether a hold gets the label is decided with controller/, for both item types, and §4.1's table says so.
3. What apply re-asks. Each admit carries content_id. The opening Run's also carries branch_head, a new fact: the next opening's branch head, or null. It defers if unreadable. Tests: with the Run left out, a removed label, an added Hold, changed content or a moved head each refuses it.
4. Bounds. Each has a test at the bound and one past it: opening attempts, unmerged closes, the Run and act ceilings, one investigation and one verdict per content and writer action. Each rule has a mutant in ISSUE.
5. CodeRabbit on #155.ISSUE_LABELS = tuple(t.CONTROL_LABELS) + (LABEL_TRIAGE, LABEL_READY). Test: an event without by, for each of t.CONTROL_LABELS, defers. The mutant drops t.CONTROL_LABELS. It goes in #155 if that is still open, otherwise as #42's first commit.
6. Left out. "Turning it on" spans items, so it is the Controller's. Implementing Runs wait for slice 2.
7. Decision 0031. It records the boundary, the schema, the three acts, issues.intents, acts_since_writer and branch_head. config/defaults.json is protected.
Needs the Maintainer? None now. When issues are turned on, max_triage_admissions_per_pass is a cost number.
Activity
don-petry commentedon Oct 18, 2026
Working rulings (overturnable in review)
Solution Architect, delegated. On main at 72f8643 (#162). Builds on #41 (PR #155, branch
kernel/issue-state, record 0028), which must merge first.0. The lane holds, with no dispatch.
issue.decide(facts, runs, context, config, now)goes besideissue.deriveinkernel/issue.py. No edits todecide.py,derive.py,terms.py,gate.pyorbrakes.py. The Controller picks byitem.type(0028). If one entry is wanted later, it is 0028's two-line dispatch, decided withcontroller/, and that change joins the PR-side lane's sequence. #42 does not.It adds two imports and edits neither:
brakesandsince_writer. It has its own Decision maker and its own needs-you reasons. The schema isissue-decision/1, found bycheck_examplesby name. Why: the State enum indecision.schema.jsonis the pull request's.1. Admission. In
triage, one Run at a time:investigate-issue, unless the investigation is current: that Role completed a successful Run for thiscontent_idafterlast_writer_action_at. Once the record expires, its App's entry inrole_comments, later than both, stands in. A failed Run is an attempt, whichon_runbounds.judge-readiness(from Kernel: derive an issue's State from its facts #41), by another Role, once the investigation is current. Not again after a readiness Run for this content since the investigation. Not after a person removedfactory:readysince the content changed (I-40). After expiry, that App's label or comment stands in.In
ready:open-pull-request(from #41). On an outsider's issue it needs a statement: the investigating App's comment, or a writer's, after the content changed. With neither,no_statement.issues.intentsmaps each Intent to{role, app}, null by default. Null admits nothing. Two Intents with one Role defer. A Run in flight admits nothing; the brakes' Holds still apply (#158).2. The Controller's acts are Decisions.
accept: row 10, the Controller's App declared forfactory:triage, and no person has removed it since the content changed.on_actbounds it. Why the App: an undeclared App's label never counts, so it would be removed and added for ever.remove_label: afactory:triageorfactory:readythat stands and doesn't count, innew,triageorready. Never the Hold, admission or hands-off.place_hold: unmerged closes pastmax_unmerged_closes, counted in this life since a person last removedfactory:hold. Why a label: only that removal resets the count.The last two stop work. Only the Pause stops them (0003). None is decided once its label is there, or gone. The new fact
acts_since_writercounts acts (#37). Opening attempts and the Run ceiling are the brakes'hold, as on a pull request. Whether aholdgets the label is decided withcontroller/, for both item types, and §4.1's table says so.3. What
applyre-asks. Each admit carriescontent_id. The opening Run's also carriesbranch_head, a new fact: the next opening's branch head, or null. It defers if unreadable. Tests: with the Run left out, a removed label, an added Hold, changed content or a moved head each refuses it.4. Bounds. Each has a test at the bound and one past it: opening attempts, unmerged closes, the Run and act ceilings, one investigation and one verdict per content and writer action. Each rule has a mutant in
ISSUE.5. CodeRabbit on #155.
ISSUE_LABELS = tuple(t.CONTROL_LABELS) + (LABEL_TRIAGE, LABEL_READY). Test: an event withoutby, for each oft.CONTROL_LABELS, defers. The mutant dropst.CONTROL_LABELS. It goes in #155 if that is still open, otherwise as #42's first commit.6. Left out. "Turning it on" spans items, so it is the Controller's. Implementing Runs wait for slice 2.
7. Decision 0031. It records the boundary, the schema, the three acts,
issues.intents,acts_since_writerandbranch_head.config/defaults.jsonis protected.Needs the Maintainer? None now. When issues are turned on,
max_triage_admissions_per_passis a cost number.