Skip to content

Kernel: what is admitted on an issue, and when apply refuses #42

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. 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.

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 #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:

    1. 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.
    2. 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.
    3. 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.

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