Skip to content

Kernel: an active_runs that is no count defers, on a pull request and on an issue (#218) - #230

Merged
don-petry merged 7 commits into
mainfrom
kernel/active-runs-unreadable
Oct 20, 2026
Merged

don-petry merged 7 commits into
mainfrom
kernel/active-runs-unreadable

Conversation

@don-petry

@don-petry don-petry commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Why

The Claude review on #216 found that the concurrency check, on both sides, deferred only on an active_runs of None and compared anything else with >=: a string raised a TypeError out of decide, and a bool was read as a number. The Controller writes the context, so the fault is the Factory's own, but the rule holds for every fact read from outside: an unreadable fact yields a deferral or a Hold, never an action, and the Kernel never raises. #218 states the rule and names the pattern of #173 (PR #216) and #165 (PR #176).

The rule

In kernel/decide.py and kernel/issue.py, at the concurrency check, if active is None: becomes if type(active) is not int or active < 0:. An active_runs that is no whole number, a bool among them, or is below zero, or is not there, cannot be read: the Run defers with capacity_unreadable, as a deadline that cannot be compared with now does since #216. A whole number is read as before, at the limit (concurrency) and below it (admit). Nothing else changes; no reason is new. kernel/issue.py is lane b's file, and only its concurrency check is touched.

  • Boundary tests, written first, each asserting both sides: tests/test_decide.py::test_an_active_runs_that_is_no_count_defers_and_raises_nothing (Ceilings) and tests/test_issue.py::test_an_active_runs_that_is_no_count_defers_and_raises_nothing (Investigation); ten unreadable values each, then the limit, one below it, and zero.
  • Mutants, each naming its test: the two that put the old line back are re-pointed to the new guard ("an unreadable count of active Runs is trusted", "an issue's active Runs unread are trusted"), and three more each side: the guard replaced by the old is None, type(...) is not int loosened to isinstance, which reads a bool, and the negative check dropped. All eight were applied by hand to a scratch copy and killed by their named test. The capped filtered run of Mutation run: every mutant names its tests, the slow suites run last, and a builder may break a few #219 cannot take either file (57 and 274 mutants against a cap of 40), so CI's shards are the word on them.
  • examples/invalid/pass.a-count-of-active-runs-below-zero.json: the pass record's schema already refuses a count below zero; the counter-example now says so.
  • Two rows on decision 0034, which holds the capacity rows of Kernel: an issue goes stale as a pull request does #176 and Kernel: a now or a Lifecycle that cannot be read never raises out of a pull request's decide (#173) #216; no Decision or Why edited, no new record.

The second round: one helper for either kind of Work item

SonarCloud failed the quality gate on new-code duplication: the fourteen lines from the model provider's deadline to the Run listed unnamed stood word for word in kernel/decide.py and kernel/issue.py, and the two new lines made them new duplicated code. As derive.overdue does for the limit on a wait (#216), derive.run_deferral now reads the deadline, the count of active Runs and the unidentified list once, and both sides call it right after the brakes (977cdd8). No Decision changes: the two review agents diffed every Decision on both sides between ac876db and the helper head over every shape of every context field and found them identical, decide.py's explicit check of the "unreadable" sentinel included, which is_time refuses anyway. The mutants on those lines collapse to one per rule, on derive.py, each naming both sides' tests, and the two that move the brakes below the deferral anchor on the call; all fifteen killed by hand on a scratch copy. One more row on 0034 says where the helper lives; kernel/AGENTS.md stays as main has it, since its forty-line budget had no room for a sentence on it. This touches more of kernel/issue.py than the concurrency check; the constraint was #43's, which edits sim/issues.py and not kernel/issue.py, so nothing conflicts.

Reviewers

On the first head, ac876db, and again on the helper head, 977cdd8 (AGY on the helper head: four runs, the first three produced no output because the fallback model called a tool that headless mode denies; the fourth, with the same prompt wrapped in a stronger no-tool framing, read it).

All four read ac876db, the Kernel head, together; the one fix round, 428445b, touched two documents and no code.

  • Fresh-context Claude review: approve on both heads. On the helper head it ran sites() on both heads (same 30 pairs and 9 reasons alone), applied the fifteen collapsed and re-anchored mutants by hand (all killed, each on both sides), and held brakes-first on both sides; one doc-line nit on kernel/AGENTS.md, not taken: the page's forty-line budget had no room (a5aa574 tried, and c59646d put it back). On ac876db: approve. It applied all eight mutants by hand (killed) and probed every other context field on both sides with wrong-shaped values (nothing raised). One minor, fixed: the code standard's own "Yes" snippet showed the guard this issue found short, which the next author would copy; it now reads a count as the Kernel does.
  • Security pass (Claude subagent): no defect on either head; on the helper head, 23 mutants by name killed, Decisions byte-identical to ac876db on both sides, no context text through the helper, and a Pause or a ceiling still wins. On ac876db: on 20 shapes of active_runs the change is strictly more closed than main on both sides, and no text from the context reaches a Decision. One low wording note, fixed: the row on 0034 cited the counter-example as holding the whole rule, where it holds only that the pass record's schema refuses a count below zero. Noted, not in scope: a config limit of the wrong type would still raise, but the configuration is the Release's own, validated by its schema and check_examples, not a fact read from outside.
  • AGY (Argon out of credits; Gemini 3.8 Flash High, as the Maintainer asked): approve, no findings on ac876db. On 977cdd8: approve with one minor, that the mutant "a deferral that ends now still defers" names a pull-request test that never reaches the until > now boundary. Checked and not so: that test's last block compares a real deadline with a real now at the boundary (at(6) against at(6) admits), and the mutant applied by hand to a scratch copy is killed by that one test alone, before the issue side's suite it also names.
  • Muse Wonder Full (on ac876db): accept, no findings; probed int subclasses, IntEnum, Decimal and the rest on both sides, applied the eight mutants by hand.

Verify

make verify on a fresh git archive export with PATH=/usr/bin:/bin SIM_SEEDS=40: passes on ac876db, on 428445b, on 0efdf22 and on the helper head 977cdd8; the final head's run is in a comment. No full python3 -m tools.mutants locally, by the standing rule.

Closes #218

🤖 Generated with Claude Code

don-petry and others added 2 commits October 20, 2026 14:10
… on an issue (#218)

A count of active Runs that is no whole number, a bool among them, or is
below zero cannot be read: the Run defers as capacity unread, on both sides,
and nothing raises. A whole number is read at the limit and below it, as
before. One boundary test each side, written first; the two mutants that put
the old line back re-pointed and three more each side, each killed by hand;
two rows on decision 0034 and a counter-example of a pass below zero.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…now does, and the record row says what the example holds

The code standard's "Yes" example showed the guard #218 found short, which
the next author would copy; and the row on 0034 cited the counter-example
as holding the whole rule, where it holds only that the pass record's
schema refuses a count below zero.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner October 20, 2026 19:21
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-20T19:21:31.766580Z
We couldn’t complete this review. Comment @codex review to try again.
428445b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: combsmith/software-factory/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bf1206eb-b1a0-4217-8ecd-46531dce0f6a
📥 Commits

Reviewing files that changed from the base of the PR and between 2853101 and c59646d.

📒 Files selected for processing: 9
  • docs/decisions/0034-an-issue-goes-stale-as-a-pull-request-does.md
  • docs/standards/code.md
  • examples/invalid/pass.a-count-of-active-runs-below-zero.json
  • kernel/decide.py
  • kernel/derive.py
  • kernel/issue.py
  • tests/test_decide.py
  • tests/test_issue.py
  • tools/mutants.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

…he cases are one table

SonarCloud failed the quality gate on 6.3% duplication in new code: the
guard's text stood eight times in the mutant table, and the issue's test
repeated the pull request's line by line. No Kernel code changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@don-petry

Copy link
Copy Markdown
Contributor Author

SonarCloud failed the quality gate on 428445b: 6.3% duplication on new code, against a limit of 3%. The duplicates were the guard's text written eight times in the mutant table and the issue's test repeating the pull request's line by line. 0efdf22 writes the guard once, as COUNT_GUARD, and gives the issue's test one table of cases; every mutant's text is still found exactly once, and both tests still pass. No Kernel code changed, so the four reviews of ac876db stand. The make verify export of this head follows when it finishes.

don-petry and others added 3 commits October 20, 2026 14:29
… Work item

SonarCloud still failed the gate on 0efdf22: the fourteen lines from the
model provider's deadline to the Run listed unnamed stood word for word on
both sides, and the two new lines made them new duplicated code. As
derive.overdue does for the limit (#216), derive.run_deferral now reads the
deadline, the count of active Runs and the unidentified list once, and
decide.py and issue.py call it after the brakes. No Decision changes. The
mutants on those lines collapse to one per rule, on derive.py, each naming
both sides' tests, and the two that move the brakes below the deferral anchor
on the call; all fifteen killed by hand on a scratch copy. One row on 0034.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rough one helper in derive.py

The Claude review's one note on 977cdd8: the directory's own description
had derive.py answering only "where does this item stand", while it now
holds the deferral of a Run for both sides, as it holds the limit on a wait.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…age's width

`make verify` in the worktree caught the line at over 260 characters.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@don-petry

Copy link
Copy Markdown
Contributor Author

SonarCloud still failed on 0efdf22 (6.2%): the duplicated block was the fourteen Kernel lines from the model provider's deadline to the Run listed unnamed, identical in decide.py and issue.py, and the two new lines made them new duplicated code. 977cdd8 reads them once, in derive.run_deferral, called after the brakes on both sides, as derive.overdue reads the limit; the per-side mutants collapse to one per rule on derive.py, each naming both sides' tests, and the brakes-ordering mutants anchor on the call. All fifteen were applied by hand and killed. The Claude reviewer and the security pass re-read it: Decisions byte-identical to ac876db on both sides over every context shape, sites() unchanged, no finding but a doc line (fixed in a5aa574). AGY read it on the fourth try (the first three produced no output, a denied tool call), approve, with one minor that does not hold: the pull-request test it names does reach the boundary and kills the mutant alone. make verify on an export of 977cdd8 passed; a5aa574 changes two document lines, and its export run follows. The PR body carries the full account.

The page has a budget of forty lines, and the sentence on derive.py's helpers
for both kinds of Work item made forty-one: every mutant shard and the verify
export failed on the context check. The row on decision 0034 says where the
helper lives; the map stays as main has it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@don-petry

Copy link
Copy Markdown
Contributor Author

a5aa574's one sentence on kernel/AGENTS.md made the page forty-one lines against its budget of forty, so the context check failed: every mutant shard stopped at its baseline run ("the tests fail before anything is broken"), and the make verify export of that head failed the same way. c59646d puts the map back exactly as main has it; the Claude reviewer's doc-line nit stays unaddressed, since the page has no room, and the row on decision 0034 already says where derive.run_deferral lives. SonarCloud passed on a5aa574 (0.0% duplication on new code). No code changes since 977cdd8, the head the reviews read. The export run of c59646d follows.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Contributor Author

make verify on a fresh git archive export of c59646d, with PATH=/usr/bin:/bin SIM_SEEDS=40: passes (exit 0). The tail, the unverified rules left out:

schemas and examples   ok
lifecycle              ok
authority              ok
apps                   ok
kernel purity          ok
trials                 ok
repo                   ok
workflows              ok
context                ok
decision records       ok
decision base          skipped: no .git here, so this is an export with no history to compare with
fake GitHub            49 unverified

@don-petry
don-petry added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 0f53aa5 Oct 20, 2026
19 checks passed
@don-petry
don-petry deleted the kernel/active-runs-unreadable branch October 20, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kernel: an active_runs that is no number raises at the concurrency check, on both sides

1 participant