Kernel: a pull request whose diff the Task cannot carry whole is held (#327)

Merged
DO
25d ago
+204-38

Closes #327.

A review was asked of a diff the Task had cut at a file's boundary, and its verdict covered a change it had not read whole. Now the Kernel holds such a pull request before any Run is admitted, and the Harness refuses one if it ever is.

PartWhat changed
One boundconfig/harness.json's texts.diff_characters (decision 0050's place) becomes config/defaults.json's limits.max_diff_characters, 60000. The Harness reads it there through harness/run.py's configuration()
The factfacts/1's diff gains optional characters: the whole diff's length escaped as JSON, as harness/task.py's carried() counts it, from the bytes the content id is the digest of (adapters/pull.py). A 406 too_large diff has none
The holdderive holds too_large when characters is absent, no whole number, or past the bound
Defence in depthThe run job writes a failed Result, diff_not_whole, before the CLI when a reviewing Task left part of the diff out
RecordDecision 0065. It cites 0050 for the old place and edits no record

Every facts fixture (tests/support, sim/world, examples, test_transitions, test_approve) gains a length under the bound; the 8 config counter-examples gain the new required limit.

Verify

  • make verify on an export of each head, run alone: the first head failed only check_context's gapless numbering, so the record took its number in merge order, 0065, once 0063 and 0064 were on main.
  • Ten new mutants, one per rule, plus the budget's mutant re-pointed: each killed by hand, the CI way.
  • The capped filtered local run (python3 -m tools.mutants harness/run.py, then adapters/pull.py) hit its 600 s limit on the unbroken suite (verify took 746 s on this machine), so CI's 8 mutant shards, which break every mutant, are the evidence instead.

Gates

  • Claude review and security pass: one major (a diff of no UTF-8 was counted and admitted, which the Harness refuses), fixed in d58aebb with a test and a mutant; two nits and a minor fixed in the schema and the record. The simulator never makes a diff with no length or one past the bound: left as a follow-up.
  • Argon: approve, no findings.
  • Muse: approve, one minor (a negative length was read as under the bound), fixed in the third commit with a boundary case and a mutant.

šŸ¤– Generated with Claude Code