Repository navigation
ruling 87: KB1's key group carries its own body (gate red-first); rulings 109/110; the total= gate - #713
Open
joyful-ii-V-I wants to merge 6 commits into
Open
ruling 87: KB1's key group carries its own body (gate red-first); rulings 109/110; the total= gate#713joyful-ii-V-I wants to merge 6 commits into
joyful-ii-V-I wants to merge 6 commits into
Conversation
…; K3 pins membership from the question Owner ruling 87: KB1's key group must carry its OWN body, and a body served elsewhere on the same page does not satisfy it. Ruling 95 wants the gate written and proved red first, so this commit is the gate alone -- it is RED on this tree, at this commit, against generated output. (K12) replaces (K8). K8 pinned the opposite property: no key block when page 1 already carried the body. That was KB1's frozen rule (results/KB1_ACTREADY_1119/PREREG.md lines 25-26, "A body the page already carries (same p= and l= in the first 12,000 B) is not repeated"), and ruling 87 overturns that clause, so its gate cannot survive it. K12 asserts the positive the fix has to produce, in an order that cannot go vacuous: first that the knob-off twin's page 1 really does serve compute_total's body (it does -- p="src/lib.c" l="2"), then that the key group carries that same (p=, l=) anyway, then that the duplicate reads back out of the delivered answer with the key group masked. A prohibition-shaped arm would have been green on unfixed code for free. The red, on build/ripwire at 37da0ae: PASS (K12) NON-VACUITY: ... (p=,l= ('src/lib.c', '2')) FAIL (K12) CONTRACT: the key group carries its own body of the definition page 1 already serves ... (twin row ('src/lib.c', '2'), key rows []) FAIL (K12) CONTRACT: and the duplicate is read back out of the DELIVERED answer ... FAIL (K3) unrouted: every name the question backticks rides ... question names ['pageEnds', 'streamCuts'], expected ['streamCuts', 'pageEnds'], got ['pageEnds'] (K3) also stops pinning membership by literal symbol name. R1b found that fragility and it is real: the arm read == ["streamCuts","pageEnds"] plus one hardcoded product signature, so any change to the body SELECTOR would redden it by moving which definition page 1 happens to serve. It now derives the expected names and rule E2's order from the question's own backtick spans, and checks each body carries the definition line of the name it claims. Weaker on exact text by one pinned signature; stronger in coverage, since it now applies to every backticked name instead of one, and it is red only when a named body does not ride -- which is the contract. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…page is not an input The defect, in one sentence: insertKeyBodies handed keyBodies the first kAnswerPageBytesDefault bytes of the finished document as `served`, and keyCandidates dropped every definition whose <b> was already in there, so once a body section was promoted onto page 1 the key group silently lost its own copy of whatever that promotion served. Owner ruling 87: KB1's key group must carry its own body, and a body served elsewhere on the same page does not satisfy the contract. So the key group stops consulting the page. The line the ruling is about is the keyBodies call inside insertKeyBodies (src/forkeybody.h:253 at the base commit 37da0ae — :239 is that function's DECLARATION, not the call). With the argument gone, nothing supplies `served` any more: the routed path (verbs_forroute.h:427) and the --pack-task twin (keyBodyFor) always passed {}, so the contract was already honoured on both of those and the three paths now agree — keyBodyFor's documented promise that it returns "the first definition keyBodies would serve" is true for the first time on an unrouted answer. bodyServed and the `served` parameter are therefore removed rather than left unused: a dead predicate that a later call site could re-arm by accident is how this defect would come back, and removing it makes the contract structural. keyCandidates loses `rootArg` with it (the root-relative path was built there only to ask bodyServed about it); keyBodyFor keeps its own rootArg, marked [[maybe_unused]], so its two callers in verbs_for.h and mcpverbs.h stay one identical call and this change does not reach into those files. Gate: test/forkeybodycheck.sh (K12), committed red in d1a7456e9 and green here. Cost: a deliberate duplicate of one body on one page, measured in results/K87_CONTRACT_1120/READOUT.md §5 against R1b's own figure for the dedup it is giving back. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The user-visible change and its measured cost: three cells of 89 move, +4,760 B in all, two of them cells where the group had been emptied completely and one where total= was under-reporting. Page counts, page-1 tail rows and deferred= unchanged on all 89. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…nd pin the moved block
Owner ruling 109. Two registered byte-identity bars were unsatisfiable once KB1's key group is non-empty,
and both were satisfiable before only because ruling 87's defect kept the group EMPTY. Neither loses a row:
the only difference is where the group sits.
forverbroutecheck (4) required the carried <ctx> page to equal the --no-verb-route answer byte for byte,
while forkeybodycheck (K11) requires the carried page's key block to MOVE UP to the routed root — so the
standalone answer holds the block inside it and the carried page does not. They cannot both hold.
sentencesubjectcheck additive() compared the hop answer minus <callers by="subject"> against the no-hop
answer, but KB1 places the group after the FIRST top-level row block, which is the subject block in one and
<sigs> in the other; strip the subject block and the group is left where it had been.
Both are re-registered in the style forkeybodycheck's (K1n)/(K3n)/(K4) already use for exactly this reason —
"ON minus the key group == the twin" — each with a mutation negative control, because a relaxed comparison
cannot be proved red on a binary that satisfied the stricter bar it replaces.
The red-on-the-unfixed-binary proof lives in the two NEW arms this commit adds, which is where ruling 109's
strictness is:
(4k) forverbroutecheck: ONE key block in the routed answer, OUTSIDE the carried page, byte-identical to
the one the --no-verb-route answer carries. Non-vacuity first: the standalone answer must really carry
a group, and it says so on stderr when it does not.
(CK) sentencesubjectcheck: where the question's span PLACES a definition the hop and no-hop answers carry
the SAME group byte for byte; where it places nothing (a call argument list, a Go receiver spelling)
neither carries one. An assertion in both directions, so it is never a silent pass. Measured, which
is why it is per-question: of the five csub questions only two place a definition.
Net strictness: every row is still compared byte for byte AND the block's survival across the move is now
pinned, where before it was only ever compared while it was empty. Looser on one thing only — the group's
position, which (K11) deliberately changes. Changing (K11) instead was on the table and was declined as a
KB1 design question rather than a ruling-87 one.
Evidence, measured before the re-registration (results/K87_CONTRACT_1120/READOUT.md §6.1): the routed root's
block and the standalone's are byte-identical at 166 B; the carried page and the standalone minus its group
are byte-identical at 6,943 B; on sentencesubjectcheck the two groups are 188 B each and the answers are
byte-identical at 1,918 B once the group is set aside.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…count, RED first The disclosure defect ruling 87 fixes as a side effect had no gate of its own. The suppression ran BEFORE the count, so a definition the page happened to serve was erased from total= rather than merely unshown. Measured on this fixture, unfixed: a question naming THREE symbols whose three definitions all exist in src/ disclosed `shown="1" total="1" capped="0"` -- two definitions gone and capped="0" affirming nothing was cut. A question naming SIX disclosed `<bodies of="key" shown="3" total="3" capped="1">`: capped= asserting a cut, shown==total asserting nothing was withheld, and NO next= at all. Three contradictory claims in one tag. CLAUDE.md non-negotiable 3 -- a count that cannot be a total is labelled a floor, and total= is not a floor. Two arms, deliberately of different kinds, and NEITHER SUBSUMES THE OTHER: (K13) is an invariant on the TAG ALONE -- capped="1" iff shown<total iff next= present, and shown<=total -- so no count of this gate's own enters it. It needs no knowledge of how many definitions exist and therefore fires on ANY mechanism that filters candidates before counting them, not only the one ruling 87 removed. That generality is what closes the class. It runs on all four key groups this gate produces, including the ROUTED six-name group as a control, because the routed path never consulted the page and so must have been consistent all along. (K14) pins total= against a count known BY CONSTRUCTION rather than against anything the tool reports: each of compute_total, alpha_one, beta_two, gamma_three, big_function and run_main has exactly one bodied source definition in the fixture's src/, and lib.h's declaration is bodiless and never counts (K0 pins that), so three names means 3 and six means 6. Non-vacuity runs FIRST and prints which bodies page 1 serves elsewhere: without one, a filter-before-count had nothing to remove and the arm would prove nothing on this fixture. Both questions are UNROUTED, because that is the only path that ever passed `served`. The red, on build/ripwire at 37da0ae, verbatim (this commit's arm text, unchanged for the green run): FAIL (K13) one name, unrouted: no key group at all, so the disclosure triple cannot be read (dup.on) PASS (K13) three names, unrouted: shown=1 total=1 capped=0 next=False -- capped=1 iff shown<total iff next= present, and shown<=total FAIL (K13) six names, unrouted: shown=3 total=3 capped=1 next=False -- capped=1 iff shown<total iff next= present, and shown<=total PASS (K13) six names, ROUTED (control: this path never read the page): shown=5 total=6 capped=1 next=True PASS (K14) NON-VACUITY tot3.on: page 1 serves ['alpha_one', 'compute_total', 'run_main'] elsewhere FAIL (K14) tot3.on: total=1 is the 3 definitions the question's names place in src/, shown=1 capped=0 (expected total=3 shown=3 capped=0) PASS (K14) NON-VACUITY tot6.on: page 1 serves ['alpha_one', 'compute_total', 'run_main'] elsewhere FAIL (K14) tot6.on: total=3 is the 6 definitions the question's names place in src/, shown=3 capped=1 (expected total=6 shown=5 capped=1) WHY BOTH ARMS ARE NEEDED, and this is measured rather than argued: (K13) PASSES on the three-name case under the unfixed binary. `shown=1 total=1 capped=0` with no next= is internally CONSISTENT -- the triple agrees with itself while the total is simply wrong -- so a pure consistency invariant cannot see that defect at all. Only (K14), which knows the true count, catches it. Conversely (K14) needs a fixture whose count is known, which a consistency invariant does not. The six-name case is where the suppression broke consistency too, and (K13) catches that one without being told anything. The routed control passing in the same run as the unrouted arms fail is the attribution: the defect was in the one call site that handed the page to the key group, not in the counter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The fragment named the under-reported total=. The K13/K14 fixture isolated a sharper instance of the same defect: shown="3" total="3" capped="1" with no next= -- capped= claiming a cut, shown==total claiming nothing was withheld, and the pointer the legend promises for a cut absent. Three contradictory claims in one tag, so it is worth stating, and the invariant that now gates it is worth naming. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner ruling 87: KB1's key group must carry its own body, and a body served elsewhere on the same page does not satisfy it. Ruling 95 puts the gate first, so the contract arm was written and committed red before any source change, and re-proved green against the same committed arm text.
Targets
integration/070-1120(src/forkeybody.hdoes not exist onmain). Rebased onto21d4b66b7.The defect, in one sentence
insertKeyBodieshandedkeyBodiesthe firstkAnswerPageBytesDefaultbytes of the finished document asserved, andkeyCandidatesdropped every definition whose<b>was already in there. So once a body section was promoted onto page 1, the key group silently lost its own copy of whatever that promotion served — and which definition it lost was decided by what the body selector happened to promote.servedhad exactly one non-empty supplier in the tree. The routed path (verbs_forroute.h) and the--pack-tasktwin (keyBodyFor) always passed{}, so the contract was already honoured there; the three paths now agree, andkeyBodyFor's documented promise that it returns "the first definitionkeyBodieswould serve" is true on an unrouted answer for the first time.bodyServedand theservedargument are removed, not left unused: a dead predicate a later call site could re-arm by accident is how this defect returns.keyCandidateslosesrootArgwith it (the root-relative path was built there only to askbodyServedabout it).keyBodyForkeeps its ownrootArg, marked[[maybe_unused]], soverbs_for.handmcpverbs.hare untouched — they hold its two identical call sites and are the files other lanes are editing on this branch.What it costs, measured
GA1 DEV, n=89, one binary pair, same corpus, byte-deterministic, using the measuring lane's own harness unchanged:
ga-jq-02ga-jq-03ga-bash-it-04That is 2.2× the figure this change was scoped against, which predicted +2,145 B in a single cell. The single-cell number reproduces exactly on its own cell; it was bounded by the arm that measured it, not wrong. The earlier measurement compared against a tree carrying only one promotion, while this branch's base carries every lane merged since, so more sections sit inside the first 12,000 bytes and the suppression fires in three cells instead of one. The suppression's cost grows with how much gets promoted onto page 1 — which is the argument for removing it, now with a number on it.
On the check's own fixture, against a corpus pinned at the base commit: +508 B, exactly mirroring the −508 B the dedup had been reporting as a saving.
What the suppression was actually doing
total=was under-reporting. The suppression ran before the count, so a definition the page happened to serve was erased from the total: the answer disclosedtotal="3" capped="0"for a task with five keyed definitions. A check fixture isolates a sharper form of the same defect:<bodies of="key" shown="3" total="3" capped="1">with nonext=—capped=asserting a cut,shown=totalasserting nothing was withheld, and the continuation the legend promises absent. Three contradictory claims in one tag.What it does not cost, and what it does not buy
deferred=. Page counts unchanged on all 89. The only rows added are the restored key bodies — the group's bytes are not counted against the page budget, so nothing is displaced.Gates
The contract arm
(K12), committed red before the fix (forkeybodycheck). Non-vacuity is asserted first and in that order: the knob-off twin's page 1 must really carry the body elsewhere (it does,p="src/lib.c" l="2"), and only then is the key group required to carry that same(p=, l=)anyway. A prohibition-shaped arm ("no key block") would have been green on unfixed code for free.(K12)replaces(K8), which pinned the opposite property and passed on the unfixed tree.(K8)was the gate for the clause this ruling overturns.(K3)no longer pins membership by literal symbol name. It read an exact two-name list plus one hardcoded product signature, which any change to the body selector would redden by moving which definition page 1 happens to serve. It now derives the expected names and rule E2's order from the question's own backtick spans, and checks each body carries the definition line of the name it claims.Two registered byte-identity bars were re-registered under owner ruling 109, because they were unsatisfiable once the key group is non-empty and were satisfiable before only because the defect kept it empty:
forverbroutecheck(4) required the carried<ctx>page to equal the--no-verb-routeanswer byte for byte, whileforkeybodycheck(K11)requires the carried page's key block to move up to the routed root. Measured: the routed root's block and the standalone's are byte-identical at 166 B, and the carried page equals the standalone minus its key group at 6,943 B. Nothing is lost; the block moved.sentencesubjectcheck'sadditive()compared the hop answer minus<callers by="subject">against the no-hop answer, but the group is placed after the first top-level row block — the subject block in one and<sigs>in the other. Measured: the two groups are 188 B each and the answers are byte-identical at 1,918 B once the group is set aside.Both now compare "ON minus the key group == the twin", the style
(K1n)/(K3n)/(K4)already use for this reason, each with a mutation negative control, plus two new arms that carry the red proof:(4k)pins that the moved block is byte-identical to the one the standalone answer carried, and(CK)pins that the hop and no-hop answers carry the same group. Net strictness: every row is still compared byte for byte and the block's survival across the move is newly pinned; looser only on the group's position, which(K11)deliberately changes. Changing(K11)instead was considered and declined as a KB1 design question rather than a ruling-87 one.(K13)/(K14)close the disclosure defect, which ruling 87 fixed as a side effect but which had no gate of its own:(K13)is an invariant on the tag alone —capped="1"iffshown < totaliffnext=present, andshown <= total. No count of the gate's own enters it, so it needs to know nothing about how many definitions exist and fires on any mechanism that filters candidates before counting them. It runs on all four key groups the gate produces, including the routed group as a control.(K14)pinstotal=against a count known by construction — each of the six fixture symbols has exactly one bodied source definition insrc/, and the bodiless header declaration never counts, so three names means 3 and six means 6. Non-vacuity runs first and prints which bodies page 1 serves elsewhere.Neither subsumes the other, and that is measured rather than argued:
(K13)passes on the three-name case under the unfixed binary, becauseshown="1" total="1" capped="0"with nonext=is internally consistent while the total is simply wrong. A consistency invariant is structurally blind to an under-count; only(K14)catches that one. Conversely(K14)needs a fixture whose count is known, which(K13)does not.(K14)'s count is known for that fixture and is not derived at run time, so a legitimate future change tokeyDefs's placement rules will redden it and require re-measurement. That is the right failure direction, and it is why(K13)stands beside it.Verification
forkeybodycheck: ALL PASS, exit 0, 43 arms. Under ASan too.git diffof the test file between the gate commit and the fix commit is empty), so the only difference between the two runs issrc/.xmllint --nooutclean on the core map and on a key-group-bearing answer.--quality-deltain the ref-pair form (a clean-tree run reportshead_basis="identity"and is vacuous):regressions=0 minor=0 gating=0 api-new-surface=0.churn="unavailable"is the range form's own disclosure.-fsanitize=address,undefined,..., LSan suppressions): zero stderr on the page-1, whole-answer and--pack-taskkey-body paths;g1freshcheckandmcpreloadasancheckalso pass, both of which skip without an ASan build. Per the known G1 gap, ASan cannot exercise the memory ceiling, so this covers the parse and answer-assembly paths and says nothing about the ceiling.shown=3 total=3→shown=5 total=5). The same experiment independently reproduces the disclosure defect: the same question on the same corpus disclosedtotal="5"fold-off andtotal="3"fold-on under the unfixed binary. The one residual coupling is the insertion guard, which a fold change could reach only if a body section were the first top-level block — measured at 0 of 89 cells.Three reds: one this PR closes, and two that are recorded decisions
"All green" is not the signal for this PR. Owner ruling 113 settled this: the acked gates are carried, documented, so the matrix stays red and that is the intended state. Read each decision at the gate that makes it, rather than discovering it from a failing shard.
forkeybodycheck21d4b66b7; the contract arm's red-then-green is above, and the gate is ALL PASS here.loopconservationcheck21d4b66b7, reason in the gate's own header: the merge2550bfdcdis on the 0.7.0 stack's shared history, absent frommain, which is why main passes this gate and this branch does not. The tree it guards is right today. None of this PR's commits is in its finding.w3fixbudgetcheckH221d4b66b7. One cell of 24: lens--pack-task, task lengthmid, budget 3000. The other 23 hold,mainpasses the arm, and the behaviour travels with the--pack-taskrebuild rather than with the merge. It also fails identically under a binary built without this PR's changes.Neither acked red is a gate that stopped working, and that was established rather than assumed:
loopconservationcheck's ten mutation controls are green on the same run, andw3fixbudgetcheck's non-vacuity arm is green at 19 of 24 points — so H2 was judged on blown targets rather than on assumed ones. Both headers state that nothing was relaxed and no arm removed. An acked gate here is a decision with a REVISIT attached, not a suppressed finding.Two things were considered and declined, and they are part of the decision rather than omissions from it. A gate-ack facility — a known-failure list in
pargates.py/ci.ymlor a waiver arm — was declined both as a new mechanism on a 42-commit integration's critical path and because a waiver facility is the kind of thing that gets used more than intended. Fixing the two gates was declined too: one would need the stack's history rewritten or the conservation rule relaxed, and that rule has ten working mutation controls; the other is a budget-step judgement belonging to the--pack-tasksection-share owner. There is no ack mechanism in this repo to reach for in any case —.ripwire_quality_ackskeys--quality-deltafindings only — which is why both acks live in the gates' own headers.truncvocabcheckis a property of the checkout, not of the tree or the binary:--abicompares against git refs, and it has been measured red in the shared checkout (~1,727 local refs →refs="512", the rows cap fires) and passing in a worktree and in a fresh--sharedclone at the same commit (refs="0", nothing caps). CI clones fresh.Notes for the reviewer
src/changed after the fix commit: every later commit touchestest/orchangelog.d/only.windows (cl, ninja)job is the only proof. The change removes a function and one argument and adds[[maybe_unused]], with nothing compiler-specific.🤖 Generated with Claude Code