Skip to content

0.7.0 integration: the answer-first stack reconciled with main - #710

Open
joyful-ii-V-I wants to merge 358 commits into
mainfrom
integration/070-1120
Open

joyful-ii-V-I wants to merge 358 commits into
mainfrom
integration/070-1120

Conversation

@joyful-ii-V-I

Copy link
Copy Markdown
Collaborator

The single 0.7.0 integration branch: the answer-first stack reconciled with main.

Two forked lines of 0.7.0 work plus main, merged into one branch. No rebase, no squash, no
cherry-pick — the merges carry the files in rather than replaying patches against a tree that lacks
them.

What this brings

144 non-merge commits over main (175 including merges). Of those, the part this PR had to
reconcile is 42 commits: integration/070-candidate and lane/r1b-priority share a merge base
2f5561c26 that already sits 54 commits past main, and diverge from it by only 23 and 19. The rest is
shared stack history that was already reconciled below that base — lane/af1-answerfirst (AF2) among it,
which is an ancestor of the base and so needed no landing step of its own. --cherry-mark finds
zero duplicate patches between the two lines.

By theme:

  • Answer-first --for — the paged answer (--page-bytes=), the key-body block
    (src/forkeybody.h), the signature index and the page layout (src/forpages.h, src/forsigx.h),
    and the page budget's explicit priority order.
  • --pack-task D1 rebuild — the --for head, the file tail, one key body, one token conversion;
    the tail's declared share is a floor; a truncated served body is disclosed as a cut.
  • Capped bodies (CB1) — the key block carries kKeyBodyMax = 5 (was 2) under a new monotone
    120-line cap, kCappedBodyLines.
  • --for routing (RT3) — call-path and quoted-literal questions are vetoed; a windowed routed
    answer continues itself.
  • --impact first window (IM1) — production rows and evidence importers lead it.
  • Macro see-through ceiling (BX2) — a per-macro ceiling on --callers/--uses see-through.
  • Verb/attribution fixes (BX1) — defGroupsRenumberMatches collects a dropped group's member so a
    printed table still lists it.
  • An opt-in SubagentStart primer hook, the --legend-seen= flag, --no-verb-route, one aggregate
    ci-gate job, and gate hygiene.
  • From main: the --lsp client-declared-language path and its --lsp-langmap= alias map, and the
    train-1117d1 extraction work.

How the merge was done

Union first (integration/070-candidate × lane/r1b-priority, zero human conflicts), then
main by sha ee8d1a50ea9be710c9b7b6a875b1afa7073d074c — by sha, not by name, so a concurrent
fetch cannot move the target. Both merges went through the repo's own scripts/merge_main.sh +
scripts/merge_resolve.py, which set-merge test/regression.sh's absorb list, settle the gatecount
sites, mark the binary-pinned files REGEN AFTER BUILD, and refuse a kParserVer that does not clear
both sides' bumps.

main left 13 files / 17 hunks for a person. The ones worth a reviewer's eye:

  • src/defattrib.h — the only genuine two-sided refactor collision. main split
    defGroupsDropSilent into defGroupsSilent + defGroupsDrop + a thin wrapper; the stack kept the
    monolith and added defGroupsRenumberMatches above it, so the naive merge left two definitions of
    one function in one header
    , which cannot compile. Resolved to main's structure with the stack's
    helper kept
    , because the stack's only semantic change to the monolith was replacing its ofMatch
    loop with that helper — and that loop lives, under main's split, inside defGroupsDrop. Main's
    split is therefore a strict superset of the shape the stack's change needs. In the second hunk main
    changed one word of a comment where the stack changed the behaviour, so the behaviour is kept
    (test/verbfixcheck.sh arm F7 pins it).
  • kParserVer / kIngestParserVerMirror — main 331, the stack 317, base 313. Both moved to
    332 (max+1), rich file tag 333, so neither side's cache can be read by the other's binary. Both
    provenance lists are kept as labelled history. test/qschemetrip.hash is re-pinned from the merged
    build
    (0a4ba8ec92…): neither side's value could be right once the parser version moves.
  • The flag-arm counters — base 27/225, main 27/226 (--lsp-langmap=), the stack 28/228. Neither
    side taken: 28 / 229, with both provenance lists merged. The three prose "long flags" counts went
    to 199, which is not an arithmetic guess — it is --help=all counted the gate's own way on the
    built binary.
  • skills/ripwire-mcp/SKILL.md — the stack split this skill into 7 files while main edited the
    monolith. The split is kept and main's two LSP-langmap commits (9b8c57052, b47088b6e) were
    ported into transports.md, the split file that owns --lsp: the textDocument.languageId
    path, the config search order, the [overrule] suffixes rule, and the explicit-@lang exception.
  • test/legendcoveragecheck.sh and src/mcpverbs.h — independent additions on both sides; both
    kept. The gate asserts no file-wide arm total, so the concatenation runs strictly more arms.
  • test/compactlegendfix/pre_l1_full/callers.xml — a hand-re-anchored pin, not a generated file.
    Both sides' edits were characterised mechanically and both applied; the result differs from main's
    side by exactly the stack's two insertions and nothing else.

Three gates exist on main and on neither line, and a merge taking the stack's side of
test/regression.sh would have dropped them silently.
fnvbasischeck, langordercheck and
qdrangecheck are all present and registered (two in the absorb list, one invoked by name). The
registry check proves the stronger statement: all 898 top-level test/*.sh files are registered exactly
once, no duplicate and no orphan — so no gate from either side was lost.

Measured gains (lane R1b, on lane BL1's units and instrument)

  • Body rung: 9 → 20 of 89 cells complete, 14 cells up, ZERO down, closing 11 of the 21-cell
    composition gap BL1 measured. R1b's control arm reproduces BL1's baseline body figure exactly
    (9 of 89), which is the strongest instrument agreement available between the two lanes.

  • Bytes: page 1 never grows by more than +679 B in any cell, 0 of 89 cells exceed the pre-registered
    +1,500 B per-cell cap, no cell's whole answer grows at all, and the population sheds 481 B on
    page 1 and 2,145 B overall.

  • Guard B-FILE-GOLD at zero tolerance: PASS — 122 → 122 gold FILE rows, 0 cells up and 0 cells
    down, and not one of the 11 repos moves in either direction
    (Newtonsoft.Json, bash-it, bat, black,
    eslint, gson, jq, libzmq, restic, sinatra, zod).

    That pass must be read with R1b's own caveat, which is the most important one in its readout. The
    loss channel is wide open: 33 of 89 cells do lose page-1 tail rows, 773 rows in total. The gold
    simply does not live in those rows — this population carries a median of 1 gold FILE row per task. On
    the orient-shaped cells that originally failed this guard, 8 of 9 losses persist. So the honest
    statement is "the file rung is unharmed on localisation-shaped questions, and the orient-shaped class
    is unmeasured here", not "the file rung is safe".

  • Function rung: +2 to +4 cells under every one of seven scoring definitions, with zero cells falling
    under any of them.
    The level is deliberately not quoted here: R1b re-scored the same answers seven
    ways and none reproduces lane BL1's 62, so BL1's grader remains the instrument of record for the
    level and the two must not be quoted side by side. Direction and the zero-loss property do not depend
    on the definition; the level does.

Three honest caveats

1. forkeybodycheck is RED, deliberately, and it is a real contract defect — not a gate to argue
with.
Owner ruling 87 names the fix: insertKeyBodies should stop passing the served argument to
keyBodies, so a body already on page 1 is not suppressed. The call is at src/forkeybody.h:253 (:239
is the declaration — an earlier mis-citation, corrected here). It is a one-argument, one-line change
that is unimplemented, identically, on both merged lines
— nobody has written it. Owner ruling 95
settles that it lands as a FOLLOW-UP PR with its gate written first
, and the reason is not scheduling:
87's gate has to be written red-first so that its green carries information, and that cannot happen
inside a 42-commit merge whose suite is green for other reasons. So the red here is carried knowingly,
not tolerated. Measured cost of leaving it: +2,145 B in one cell.

2. The function rung's LEVEL is not quoted beside lane BL1's 62. See above — seven definitions, none
reproducing it. Only the delta statement is quotable.

3. The programme's headline completeness pair was measured on a DIFFERENT configuration than the one
this PR ships.
The frozen candidate binary (built_from=79052376e) carries the fork-base answer-first
code: kKeyBodyMax = 2 and no line cap. This branch lands CB1's raise to 5 plus the 120-line
monotone cap
. Every figure quoted from that binary therefore describes code this PR does not ship. The
two agree on the body rung at 9 of 89 — and that agreement is expected rather than evidence of
equivalence, since this population's median task needs one body, so a cap of 2 is not binding for most
of it. Owner ruling 94 settles the consequence: the headline pair WILL be re-measured on this
branch's binary before 0.7.0 ships.
So this is not an open question but a ruled, pending step, and
until it completes the published pair describes a configuration this PR does not ship. The
re-measurement is a separate lane's work and is deliberately not attempted here — it needs this
binary first.

Verification

Built with cmake --build build --clean-first -j4 on a plain dev configure (never
-DCMAKE_BUILD_TYPE=Release, which would compile DEGRADED_PATH_ALERT out). --clean-first is not
optional here: this merge moves kIngestParserVerMirror, which is the repo's own worked example of a
stale object surviving repeated successful rebuilds. Exit 0, zero warnings, zero errors, and
--version reports built_from=0ebd18b66, equal to the branch tip.

Full gate suite:

python3 test/pargates.py . ./build/ripwire -j 2
gates=898 pass=891 fail=5 skip=2 wall=5055s (84 min) tree_writes=0

898 gates is exactly the registry total, and tree_writes=0 is the runner's own proof that nothing
edited the tree while it ran.

Eight failed on the first pass. Three were a procedural error of mine, not the merge: I built at the
main merge and two generated-file commits landed on top, so the binary's built_from trailed HEAD while
no src/ file differed. versioncheck, versionlabelcheck and mcpreloadasancheck were all correct to
fire, and all three pass after the clean rebuild at the tip.

The five real failures, each attributed against an unmodified ee8d1a50e build. None is main's.

gate main ours attribution
forkeybodycheck (K3) not on main FAIL expected, ruling 87 — see caveat 1
langidentitycheck PASS FAIL the binary, not the tree (below)
loopconservationcheck PASS FAIL inherited from stack history, not fixable here
showcasecapturecheck (D) PASS FAIL a merge resolution loss; generator refuses to re-record
w3fixbudgetcheck (H2) PASS FAIL --pack-task RP monotonicity, 1 of 24 points

Three of these want a maintainer's eye, so the detail is here rather than buried:

  • langidentitycheck fails on the binary, not on any source change. The shared-file Lang::
    ratchet is counted through the tool (runner.py --ratchet-only runs the binary's own --regex over
    src/), so I crossed tree × binary in all four cells: main's tree with our binary gives the same
    326/FAIL, and our tree with main's binary gives 325/PASS.
    A source-level count of distinct
    == Lang:: / != Lang:: lines is identical between the two trees, file for file. All three merge
    parents carry ceiling 325, so no side raised it. I did not raise the ceiling — the ratchet file
    says it may never rise, and there is no new predicate to move, so the gate's own suggested remedy does
    not fit this cause. This is a gate whose subject is the source but whose instrument is the binary, and
    it needs a decision rather than a lane's edit.
  • loopconservationcheck names a historical stack merge (2550bfdcd, absent from main) in which
    phantomdefcheck left the loop before the commit that declared its tombstone. The tree as it stands is
    correct and self-consistent — test/regression.sh:290 carries the # retired: tombstone and the gate
    file is absent from both trees — so this is bookkeeping in history, not a missing retirement, and it
    cannot be corrected without rewriting history.
  • showcasecapturecheck (D) reports 3/192 flags uncovered: --legend-seen, --no-verb-route, --page-bytes. Both sides carried the same dated capture and it conflicted; the tool took main's side.
    Neither side's capture is right for the merged binary — main's covers --lsp-langmap and misses the
    stack's three; the stack's covers all three and misses --lsp-langmap. The dictv pair was already
    re-recorded to the merged binary's. I ran the prescribed generator, test/showcase_capture.py, and it
    refused to write: its own window guard finds no --since=HEAD~N in [2,14] that demonstrates what
    the --in=src case promises on this merge-heavy tip. That is the generator behaving correctly, so the
    capture cannot be re-recorded on this branch as it stands. I did not force it and did not hand-edit the
    capture's "Not run" list to silence the arm — the flags are runnable, so listing them as not-run would
    be a false record.

Other verification:

  • Determinism: two full map runs byte-identical (26,405 B).
  • Well-formedness: xmllint --noout clean; zero newlines outside CDATA (G4).
  • --quality-delta: rc=2, regressions=111, minor=75, gating=2, with baseline="ref-pair"
    against ee8d1a50e. The ref-pair form is deliberate: on a committed tree the bare
    --quality-delta compares the tree against its own HEAD (head_basis="identity") and reports
    regressions=0 whatever the branch holds, so that green is free and is not quoted here. Both gating
    rows are inherited, not introduced
    : packBodies is byte-identical to lane/r1b-priority's and
    test/testrowpaths.py is unchanged against it, and the aggregate 111/75 is 144 commits from many
    lanes, each already accepted on its own.
  • ASan/UBSan: built --clean-first with -DRIPWIRE_ASAN=ON, exit 0, zero warnings, and six runs
    clean under -fno-sanitize-recover=all. The runs were chosen to actually enter the changed code: the
    default map carries no answer-first marker at all
    , while five --for/--pack-task runs at
    --page-bytes= 12000/8000/4000/2000 and a --pack-task run all show page="1", deferred=,
    capped="1" and the <bodies> block. What ASan does not reach, stated rather than glossed: under a
    sanitizer the CMake condition links neither allocator TU and leaves RIPWIRE_MEM_CEILING_HOOK
    undefined, so ASan structurally cannot exercise the memory ceiling this branch carries — that path's
    evidence is memceilingcheck in the plain build's suite, which passed, not the sanitizer run.
  • No stale-object artefact appeared anywhere: no std::length_error, no bad_alloc, no sanitizer region
    divisible by an old sizeof(Symbol).

Not in this PR

  • Ruling 87's one-line fix (above) and its gate — a follow-up PR, per ruling 95.
  • The PUBLISHED count snapshots, deliberately left alone (owner ruling 96). They are a dated
    snapshot, not a per-branch value
    — merge_main.sh says so in its own header. On this branch the
    published gate count still reads 876 (dated 2026-11-19) where the registry now names 883, and
    docs/LIMITS.md still reads 447 caps against a live 452. Both were verified not brought
    current by this merge, and both generators' --check passes, so the tree is self-consistent as it
    stands. Refreshing them (python3 docs/counts_snapshot.py refresh) is a separate pass after this
    lands — a regenerated published count that later proved wrong should not be attributable to this
    merge. What is in this PR is the merge's own gate-count regeneration, which manifestcheck
    requires; that was regenerated, never hand-edited.
  • The headline completeness re-measurement (ruling 94) — a separate lane, which needs this binary.

🤖 Generated with Claude Code

joyful-ii-V-I and others added 30 commits November 19, 2026 01:12
…nd pair, COMMANDS.md)

scripts/merge_main.sh --regen-after-build, from: ripwire 0.6.10-dev.133+g95a81abd9 (dev, AppleClang 21.0.0.21000101, emit=std::print, built_from=95a81abd9)

    changelog.d/dict-core-packs.md
    docs/COMMANDS.md
    docs/captures/COMMANDS_showcase_2026-11-18.md
    test/printf_parity.manifest

parity labels re-pinned: callers_limit help help_all
…er tag once

dictv=ee0535c0ea4bf198 entries=1265 (from ./build/ripwire --legend-dict=tiers at 9a05a74);
kParserVer 317 / rich 318. dict-core-packs.md points at it instead of carrying its own pair.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, not the document's (INT1 merge red)

for-graph-path-default (S1's A19 row, from the batch) answers answer-first (AF1-fix), and its first
block is <graph_verb>, whose own legend comment stands right after <ctx ...>. legendOf took that
comment as the head legend and so skipped the trailing document legend: (G) reported 63 attributes
the trailing legend defines (ctx@task, d@cx, path@hops, ...) as undefined. The comment is the
block legend trailingBlocks() already reads; legendOf now leaves it out of the head legend when it
stands immediately before a TRAILING block's tag (default rows only), and the trailing run is read.
No attribute and no floor line deleted; no output byte changed.

New arms (T11-T11d): the leading block legend plus the trailing document legend define the fixture;
a trailing legend without q= makes d@q a gap (the trailing run is what is read); the block legend
defines nothing outside its block; control: a head comment before no trailing block is still read.
(G) on the integrated build: 4417 attributes over 164 default rows, 47 undefined, all on the floor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tences are dictionary entries too

A legend whose present-only clauses are erased per answer (body-fold, dotted_strings, lit, doc_body, syms, exemplar
family) is now held as the pieces between those clauses plus the clauses themselves, so any cut of it is a run of
entries; the four est_tokens= sentences in verbs_for.h are named constants (byte-identical output) and entries. A clause
the composer appends after another with only its own leading space now ends the one before it, and a reduced comment
loses the punctuation its removals leave at its start. 99 --for entries; dictv=0b6c23c3897c28f3, entries=1,263.
Later --for page 1 saves a further median 268 B (n=16, 44-532 B): median 2,729 B (17.8 %). Gate arm (S13).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es (showcasecapturecheck (D) on the 0.7.0 candidate)

The three flags the candidate adds (LS1, RT1, AF1) had no capture block and no Not-run line:
(D) coverage 3/191 uncovered. Four S1 blocks: the --for=rankGraphTeleport answer with
--legend-seen= of a file made at setup from that same answer piped into --legend-dict=seen; a
backticked who-calls question routed to --callers, and the same with --no-verb-route; page 2 of
the --for answer at --page-bytes=4000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…verbroutecheck (2) sets the key block aside

Both read the answer KB1 adds to: foranswerfirstcheck pins the answer-first PERMUTATION (SIGX is off there for the
same reason); forverbroutecheck (2) compares the routed rows with the plain --callers rows. forkeybodycheck K1n/K3n
pins that the key block is the only addition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…een); plain --hook stays advisory-only

The hook REWRITES ripwire commands (it inserts --legend-seen=FILE), and --hook promises advisory-only entries, so
--hook no longer installs it. skills/install.sh --hook-legend-seen registers it (hook-only, like --hook; with --hook
too, both). Until the owner rules on a default. legendseenhookcheck (i) asserts both halves; skillinstallcheck (R)
is back to 3 Claude entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… warns and carries the page

Coordinator 2026-11-19 (CT2): callees is the kind where ripwire's answers lose to grep + read. Development on 10 DEV cells
RT2 authored (results/RT2_ROUTE_1118/callees_dev/, 9 languages, not a held-out set) found the defect in the ROUTE: R2's
who-calls cue (\bcall\b) sent every "what does X call" question to --callers — 5/10 complete, 3 no-value, 3 losses
unwarned. --callees itself completes 8/10 at a median 1,760 B (--for: 8/10 at 16,821 B); every row prints its file:line.

- forroute.h: a what-it-calls kind, checked FIRST — \bcallees?\b | what (does|do|did) … call | which (functions|methods|
  routines) … (does|do) … call, within one sentence (a '.' inside a dotted name does not end it). It matches 0 questions of
  T5c, P1's held-out, T5b, T5d or T5e, so RT2's confirmed rule is unchanged on them.
- verbs_forroute.h calleesEvidence + partialwarn.h bodyCallNames / bodyGapReason: the BODY GAP — call-shaped names in X's
  body that the index defines as callable and the --callees answer names nowhere -> warn="1" why=body-gap:N:FIRST, page
  carried. No fold. MCP `for` and batch inherit it (routeQuestion).
- Legend: route kind= lists what-it-calls; warn= reads body-gap.

DEV result (callees_dev/GRADE_DEV.txt): routed 9/10 vs --for 8/10, median 2,600 vs 16,821 B, 0 losses; axum (call inside
macro_rules args) warned and completed by the carried page; one false alarm (kysely: `resolve` is a local and a repo name).
Confirmation pre-registered: results/RT2_ROUTE_1118/PREREG_CALLEES.md (GOLD_HELDOUT_T5F_CALLEES_1118, not opened yet).

Gates written first: forverbroutecheck arms 26–29 (route, order, dotted name, body gap on a Rust macro_rules fixture,
determinism, well-formedness) red on 7055119; mcpforroutecheck r6 (MCP rows equal the CLI's). quality-delta gating 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the display cut

showcasecapturecheck (G) on the 0.7.0 candidate: the --adaptive and doc-mention captions name
[adaptive: ...] / [doc mentions: ...] clauses that the answer-first --for document carries in its
TRAILING legend, past the 30-line display window, so the published block lost them. fmt_block now
keeps the trailing run of comment lines (and closing tags among them) after the marker, which counts
only the lines in between; a block whose trailing run holds no comment is cut exactly as before (so
docscommandscheck (E)'s --naming-calibration accounting, which reads the marker as the last line,
is unchanged). The preamble says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…body gap warns and carries the page"

This reverts commit 74f4e03.
…geEnds keeps its signature), ES and keyBodies split into helpers

quality-delta vs 35f775b gated pageEnds (contract-change, 2 -> 4 params) and forEarlyStopPage (complexity 16 > 15).
Output byte-identical (dev re-run checked against the previous binary).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sty fix)

The tail clauses say how the rows were collected (rank rows, then file-page rows; code files first on a code question). Past row 24 M2
lists same-directory files first, so the legend was false there. Now the emitter adds, right after the tail clauses, the clause
'; t order past row 24: files in the directory of a sigs row with r<=5 first, then the rest, each part in the order above'
(foranswerfirst.h kTailSameDirClause) in the answer-first posture with RIPWIRE_NO_TAIL_SAMEDIR unset and a tail that walks past
file page 0; it is priced with the header and exempt from the sig-trim charge like the other tail clauses. The answer-first pass
reorders a tail ONLY when its document legend carries the clause, so the order and its sentence cannot disagree (a budget that
drops the tail clauses serves rank order). --legend=first, --json and the MCP twin never reorder and keep their wording.

foranswerfirstcheck (SD3/SD3n): the legend is read against the order emitted — the reordered answer states it, the rank-order twin
does not, a shedding budget states exactly the order it serves; red before this change. The permutation arms of
foranswerfirstcheck, forpagescheck (P6) and compactlegendcheck (SPp) now compare with M2 off (the clause is legend bytes the
--legend=first twin does not carry). Dev check: the new M2 order equals the confirmed M2 order plus the clause on 8/8 T5b cells.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…andidate build

docs/captures/COMMANDS_showcase_2026-11-19.md from ./build/ripwire (built_from=95a81abd9; every
commit since is test/docs/changelog only), via test/showcase_capture.py; docs/COMMANDS.md via
docs/docs_commands_build.py --bin build/ripwire. showcasecapturecheck, docscommandscheck and
argvdiffcheck green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 445 caps)

python3 docs/counts_snapshot.py refresh on the integrated tree; gendocsmergecheck (D) had the
snapshot 12 gates behind (bound 10).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-doctor rows

hooks/ripwire-codex-legend-seen.sh adapts Codex's payload (tool_response as a string, {output} or {stdout}) to the shared
hook and keeps its state in legend-seen-codex; SessionStart compact forgets it (Codex has no PreCompact).
hooks/opencode/ripwire-legend-seen.js is an opencode plugin (tool.execute.before/after on bash, session.compacted and
session.deleted) that drives the same shell hook; a truncated output is not recorded. skills/install.sh
--codex --hook-legend-seen and --opencode --hook-legend-seen install them (the latter as a loader file); both say they
rewrite before they do. ripwire wrap claude|codex|opencode prints the OPT-IN line as a comment; --doctor
--agent=claude|codex adds a *-legend-seen row (installed, refs, events_ok, exec, jq; absent is a pass).
Gate test/legendseenportcheck.sh; codexdoctorcheck counts the new row; agenttablecheck (G)/(H) read past the
legend-seen comment; deckcheck allowlists the two installer flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	changelog.d/versions.md
#	skills/ripwire-mcp/SKILL.md
…callees veto)

Coordinator 2026-11-19: RT2-C (the what-it-calls route) failed its single pre-registered confirmation and is reverted in
706ce97. The rule that passed T5d still sent every "what does X call" question to --callers through its who-calls cue:
on the sealed callees set that is 4/10 complete with 5 unwarned losses against --for's 9/10. Now such a question is not
routed at all.

- forroute.h asksCallees, checked in decide() before every kind; any noun head:
  \bcallees?\b | what (does|do|did) S \bcall\b | which S (does|do|did) S \bcall\b | what\s+(?!calls\b)\S S \bcalls\b,
  S = within one sentence (a '.' inside a dotted name does not end it). rules2.py VETO is the reference copy.
- A vetoed question's answer is the --for answer byte for byte — what every unrouted question gets; no <route> element is
  added (that would change the ranked answer's bytes, paging and page price). Who-calls phrasing ("who calls X", "what calls
  X", "callers of X", "X is called by", "which functions call X") still routes to --callers. MCP `for` and the batch sub-verb
  share decide().
- afterBoundedWord: one helper for "a bounded word, then the next token" (hasUsedNotBy and the veto's what-X-calls test).

It changes nothing confirmed: the veto matches 0 questions of T5c, P1's held-out set, T5b, T5d and T5e, and 12 T5c routed
answers are byte-identical to the T5d-frozen binary's. Post hoc (spent data): on GOLD_HELDOUT_T5F_CALLEES_1118 and RT2's 10
callees dev cells every question is vetoed and every answer equals --for page 1 byte for byte (20 of 20).

Gates (red on 7055119 as the control): forverbroutecheck arms 26–29 (five veto spellings incl. a dotted subject, five
who-calls near-misses, the veto ahead of the radius/transitive kinds, determinism); mcpforroutecheck v1–v2 (MCP `for`, a
mixed batch). quality-delta gating 0 (the lane's own churn on hasUsedNotBy/decide acked). changelog.d/for-callees-veto.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he lanes' final tips

From ./build/ripwire built_from=905addd2f (LS1 50f2965, TL1 07ead98, RT2 dd19af0 merged):
docs/captures/COMMANDS_showcase_2026-11-19.md via test/showcase_capture.py, docs/COMMANDS.md via
docs_commands_build.py --bin, the dictionary pair dictv=b3334535c215ce69 entries=1286 (--legend-dict)
in versions.md and dict-core-packs.md, and the counts snapshot (873 gates). showcasecapturecheck,
docscommandscheck, argvdiffcheck, gendocsmergecheck, gatecountcheck green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tablebuildcheck #7), the absorb list byte order, LIMITS.md

keyDefs iterated placeCandidates(...).front() of a temporary: fine on clang, a dangling range on GCC 13/14. The
regression.sh absorb list is byte-sorted again (manifestcheck REGISTRY, mergemaincheck). docs/LIMITS.md regenerated
for kKeyBodyMax (limitstablecheck, readmedriftcheck). Output unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- skilltruthcheck (mixed corpus, config suppression): BX2 FIX 6 names a file whose every hit the tier held back on
  the root (held_files="1" held="package.json"), never as a row. Re-pinned by design: the arm strips held= before
  asserting no package.json row, and asserts held= names it.
- mcptranchecheck M12: the CLI files= probe matched greedily and read BX2's held_files= (7) instead of files= (28);
  the sed now matches " files=" as a whole attribute. MCP and CLI agree (28).
- capdisclose.map: kGrepHeldFilesListed (BX2 FIX 6, search.h) gets its row, sink:heldFiles (held_files= counts every
  held file beside the listed first 5); the kAnswerPageBytesDefault row goes, its only answer-path cap use being TL1
  M3's bodiesLeadInPlace, which INT1 drops.
- the flag count is 198 (RT1 --no-verb-route + LS1 --legend-seen): README, docs/REFERENCE_GUIDE.md and the deck
  source (readmedriftcheck B, deckclaimcheck).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lock complexity back under the bar)

--quality-delta=origin/main..HEAD gated fmt_block 19 -> 26 (this lane's e4b2e69). The walk moves to
trailing_legend_start(); fmt_block's output is byte-identical (checked on a cut answer-first --for
block and an untouched --naming-calibration block).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	src/foranswerfirst.h
#	src/verbs_for.h
#	test/capdisclose.map
#	test/foranswerfirstcheck.sh
…1 merged

From ./build/ripwire built_from=c2d7a9314 (lane/kb1-actready 8be38a4 merged, --clean-first):
the showcase capture, docs/COMMANDS.md, the dictionary pair dictv=c5c2e437a41fbf2c entries=1287
(--legend-dict) in versions.md and dict-core-packs.md, and the counts snapshot (874 gates, 446 caps).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bare blast radius routes to --impact

The RT2 route sent three question kinds to a verb that answers something else:
- a call-path / call-chain question ("the call chain from A to B", "which call
  path from main") went to --callers or --impact: PATH veto, no route;
- a question quoting a literal ("prints \"usage: ...\"; where is that built")
  was routed by the symbol beside it: LITERAL veto, no route;
- a bare "blast radius" (no who-calls, no where-used word) went to --uses, the
  direct radius: now transitive, --impact. One that names the direct relation
  ("every file that calls it") stays on --uses as RT2 confirmed it.

A vetoed question is the --for answer byte for byte (CLI, MCP for, batch). Dev
(spent sets, 373 questions): 371 page 1s byte-identical; the 2 changed (bare
blast radius) stay complete. Gates: forverbroutecheck 30-35, mcpforroutecheck
t1-t3, red on 2f5561c.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cro hop" (INT1: hold BX2 FIX 2)

This reverts commit 63c91f6.
… per file, at most 16 files, the rest disclosed

BX2's T5e confirmation failed the byte bar on one-hop fan-out: cpython's
_Py_RemoteDebug_IsFatalReadError is called through set_exception_cause at 46 functions in 8
files, so --callers grew 3 -> 62 rows (+7 KB; +12.5 KB on --uses) and gained no group.

Restored FIX 2 (the two INT1 reverts reverted: BX1's merge and BX2's first-hop limit), then
callhierarchy.h macroCeiling: per macro, the see-through rows are one per file (the first in
served order), at most kMacroSeeThroughFiles = 16 files; the rest are withheld (not in count=
or via_macro=) and the root says so: via_macro_capped=N and via_macro_next="--callers=MACRO"
(--uses: "--uses=MACRO"), the macro with the most withheld; JSON and MCP carry the same keys,
MCP's via_macro_note the clause. An answer under the ceiling is byte-identical to uncapped FIX 2.

K chosen on DEV (T5c, T5e — spent for these verbs), results/BX2_FIX2C_1119/sim_ceiling.py: a
16-ROW file-first ceiling kept T5c's groups but left T5e at +7.1% (callers); one row per file
keeps every group on both (tmux-01's 9 files from 15 rows) at about half the bytes.

Gate: test/verbfixcheck.sh [F2C.1]-[F2C.13] (12 [P] red on the uncapped restore).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…it exists

A SubagentStart hook is the one documented way to put context into a subagent at spawn (code.claude.com/docs/en/hooks:
"can't block subagent creation, but they can inject context into the subagent"). Lane AR1 found that no ripwire
routing reached the 83 subagents of the SUB1 orchestrator session: SessionStart does not fire for a subagent, the
prompt router runs on the parent side only, and the PreToolUse advice that does fire inside subagents was retired
on 2026-09-02.

This gate feeds hooks/ripwire-subagent-primer.sh recorded SubagentStart payloads and pins: the two-step text, in
order and short; the off switch (env, meter.conf, unknown value = off); `auto` randomized per agent_id, not per
session; silence outside a git work tree, without ripwire or jq, on bad input and on other events; hostile payload
fields never reaching the text; fixture runs never writing the operator's log; rows with ids and no text; the
installer registering exactly one entry and refreshing another copy's; and the two pasted commands running.

Red here (exit 2): the hook does not exist yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
joyful-ii-V-I and others added 30 commits November 22, 2026 09:12
… corpus

Round 2 candidate C2: the C1 list (old nine runs + paged map, --lint, --clones, --expand, --grep on
this checkout) plus a single cold map of scripts/pgocorpus.py's tree at --scale 1 (213 files), so the
class-identity / guarded-walk / memo paths get counts without the 21 extra runs that diluted the
general paths in the 30-run workload. The generator's default scale is now 1; optremarkscheck keeps
its determinism, non-vacuity and shape arms, and asserts the synthetic tree is mapped exactly once.
Also fixes the training-phase message C1 left naming a corpus it no longer trains on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rofile improvements only

Round 2 fallback. The nine training run lines are byte-identical to ad42388's, so the profile
is the old one. What this branch keeps on top of it: a training run that exits non-zero on this
checkout fails the build (reported, not fatal, on a --corpus tree whose symbol names may not
exist); --check-training BIN runs the list without building; the header comment says exactly
what is trained; and optremarkscheck proves every listed verb runs and exits 0, catches a planted
gap and a forced failure, and refuses a benchmark corpus's name. scripts/pgocorpus.py is removed
and docs/OPTREMARKS.md and release.yml carry their original wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… coverage group

Round 2 candidate C3 (owner direction: cover more of the code paths without losing the hot-path
weights). Training writes two raw-profile groups via LLVM_PROFILE_FILE and merges them with
llvm-profdata -weighted-input: CORE = the original nine runs on this checkout, verbatim, at
RIPWIRE_PGO_CORE_WEIGHT (default 4); COVERAGE = page 2 of a paged map, --lint, --clones, --expand,
--grep, --for by name and by path on this checkout, plus the full verb list on scripts/pgocorpus.py's
synthetic tree (scale 2, namesake-heavy C++ + every other language family), at weight 1. Each group
must have written counters or the build fails.

optremarkscheck: --check-training sets the groups' LLVM_PROFILE_FILE exactly as the build does, so
the logging shim records each run's group; the gate asserts core is exactly the nine original runs
with no coverage verb leaked into it (and that a relabelled --lint run is seen as a leak), on top of
the verb-coverage, determinism, benchmark-name and forced-failure arms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… merge same-change steps, add highlights

Fragments are the published release notes. Internal vocabulary (work-stream codes, internal
question-set names, internal result paths and plan references) is rewritten into plain language
without changing any fact, number or caveat; fragments describing one user-visible change are
merged (output ceiling, legend-seen, verb routing, routed paging, row lines, sigx, def rows,
key body, page-1 promotion, header static, grep held-back, subagent routing, maintenance), and
000-highlights.md leads the section with a placeholder for the release measurements.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (gateexitcheck G1/G2/H2)

- house ok(): a failed PASS write sets fail;
- its eight one-line `&& ok || no` verdicts as if/else (no arm changed what it asserts);
- arm 7 now compares the --merge-scout exit status it captured (msrc): the documented
  contract is exit 0 when a scout is produced (exit 1 only for an unresolvable ref), so
  the arm requires msrc = 0 — stricter, not looser.
ALL PASS on the train; still red on the pre-M1B train binary ad37885 (18 FAIL lines);
gateexitcheck ALL PASS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n/070-cut-1121)

This release's changelog fragments rewritten in public language (changelog.d only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ewrite

RN1 rewrote this release's fragments on ad37885; HN1, PG1 and M1B landed after it and
named an internal question set. Applying RN1's rules, no fact, number or caveat changed:
- "the 89 GA1 DEV questions" -> "the 89 development questions from 11 open-source
  repositories" (budget-counts-shown-rows.md x3, tracked-build-dirs.md);
- "GA1 DEV's bat tree" -> "the bat repository, one of the 11 open-source repositories
  behind the 89 development questions" (grep-clones-expand-paged.md);
- "the 99 GA3 DEV questions" -> "the 99 questions of a second development set".
RN1's leak.py on changelog.d: 3 hits, exactly its declared generic-English exceptions
(ls-tier-bound "readout", qd-tangle "orchestrator", route-hook-cold "readout");
changelogfragcheck ALL PASS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/070-cut-1121)

PGO training C3: a weighted profile merge (the original runs at weight 4 over the new training set); covered functions 6,330 -> 7,347, maps byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…icePage's one reader

foractline.h detail::repriceAdded had grown a 314-token copy of forpages.h detail::pricePage's
reader (where the root's est_tokens= sits, how many bytes <bodies> holds), flagged by
--quality-delta as duplication + new-clone-of-reused-helper. Both now call
forpages::detail::rootPriceSpan and keep only their own pricing arithmetic.

Byte-identical: 10/10 GA1 DEV --for page 1, 10/10 whole answers, 6/6 MCP `for` bundles
against 565645d. repriceAdded's clamp when an old MCP price held less than its markup is
left as it was and noted at the function (it over-charges the line there; a separate fix).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t contract, both sides

est_tokens= is one round-to-nearest price of the whole document (serialize.h
tokensForEmittedBytes), so the rise the act line causes is a difference of two rounded
prices: floor or ceil of the priced bytes / 2.5, depending on the old price's fraction. The
old bound (rise*2.5 >= added) demanded the ceiling every time and failed a correct price on
4 of 10 GA1 DEV whole answers at 565645d (and on src.whole on an integration tree: 105
for 264 B). The gate was stricter than the contract; the product was right.

The CLI arms are now bounded on both sides (the old bound had no ceiling at all). MCP
`for` re-prices without the render's ledger and over-charges the line (490 for 264 B):
bounded below only there, and the excess is printed rather than hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in every community PR main has landed since the train's last main merge: #715
(@himanchalkaushale, #548 arm 1: Clojure calls whose list head carries metadata), its
qschemetrip re-pin and clojurecheck hardening, and main's #717 merge (the train already
carries #717's content). Merged, not rebased: the train contains the pushed
origin/integration/070-1120, and contributor commits stay as merged.

Conflicts — a parser-version collision, resolved by the house rule:
- src/ingest_cache.h kParserVer and src/quality.h kIngestParserVerMirror: the train's 340
  (rich 341) vs main's 337 (rich 338) -> 342 (rich file tag 343), ONE number above both,
  the mirror equal to it; both sides' history notes kept.
- test/qschemetrip.hash: re-pinned with UPDATE_GOLDEN=1 test/qschemetripcheck.sh on the
  merged sources (a606e48d5b…2f4e02ec), never hand-edited; test/qschemetripcheck.sh's
  RE-PIN LOG keeps both sides' entries under a new one for 342.
kCacheVersion 54 and kQSnapCacheScheme 38 unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n/070-cut-1121)

The act line's re-price reuses forpages.h's page pricing instead of a copy (the repriceAdded/pricePage clone gone), and actlinecheck's (F) est_tokens arm reads the documented round-to-nearest contract (serialize.h tokensForEmittedBytes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… its number

MCP `for` called insertActLine with no ledger, so repriceAdded rebuilt the
price from the root's est_tokens= alone. The bundle is priced before its
<syms> block is spliced in (its clause says "not in est_tokens"), so the old
price covered less than the markup, the rest clamped to 0, and the line's
re-price charged the whole <syms> block too: +490 for 264 B on src/ (the
round-to-nearest difference is 105..106), 506..689 for 265..385 B on ten
development questions.

forTaskText now hands insertActLine what priceForTaskRoot converged
(answerPrice), kept current by insertFileSyms the way the CLI ledger follows
its edits, so the line is priced exactly as on the CLI. actlinecheck (M)(F)
is two-sided like the CLI arms (red on c58dec3, green here).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gration/070-cut-1121)

MCP `for` prices the act line once in est_tokens= (it was charged about four times over); MCP est_tokens= values only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…napshot on the final train

- test/printf_parity.manifest: `help` and `help_all` move (PG1/HN1/M1B/LC1 help text since
  the last re-record); UPDATE_GOLDEN=1 printffmtparitycheck moved exactly those two labels;
  ALL PASS over 42 verbs after.
- `python3 docs/counts_snapshot.py refresh` (tool-written): gates.scripts 907 -> 910.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ANDS.md

Recorded from built_from=27883b050 on a clean tree (272 commands, 8m26s) after the last
merge (BR1D) and the origin/main merge (b576a95; a fresh fetch showed main unmoved);
COMMANDS.md rebuilt from it (197 flags, 178 samples; --check equal). The legend pair
re-pins once: dictv=6c4aa81a81163d18 entries=1320.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le, on a fixture it writes itself

LD8 asserted that holding a later page's travelling clauses always leaves them out of
that page. The product's rule (src/legendseen.h) is narrower and older: an answer the
reduction would not shorten is served unchanged. A lone 90 B clause costs a 122 B marker
plus a 22 B in-place reference, so holding it alone correctly serves the page whole.

The arm ran on this repo as its corpus, so a changelog.d-only edit moved the repo's last
travelling page from one carrying four dictionary entries to one carrying the single
clause, and LD8 went red on a correct product. Holding only that clause leaves the old
tree's page whole too; the old arm passed there on the page's other entries. Against a
mutant without the never-larger check (page 4 served 54 B LARGER) the old arm passed.

LD8 now:
- reads one hash per travelling clause off the page (dictionary entries);
- holds exactly those, prices saved vs cost (marker length read off a served reduction),
  and demands left out when it saves > 8 B, byte-identical when it costs > 8 B;
- takes its premise from a fixture the gate writes into its temp dir, which must serve
  both shapes (5 must-omit pages and 3 must-keep pages on this tree), so no repo edit
  can redden it or make it vacuous;
- LD8m: the predicate fails a must-omit page served whole and a hand-built reduction of
  a must-keep page.

Red on both product mutants (never-larger check removed; travelling comments skipped by
the reduction). Priced margins match the mutant's actual growth to the byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…70-cut-1121)

Test-only: pagelegendcheck's (LD8) arm follows legendseen's documented never-larger rule (src/legendseen.h) — a held travelling clause whose reference would cost more than the clause is correctly left in; negative controls LD8m added. No product byte moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s/COMMANDS.md

LD8 (test-only) changed files this repo's own capture crawls, so the showcase is recorded
once more after the last merge: built_from=6e5dd9207, clean tree, 272 commands;
COMMANDS.md rebuilt from it (--check equal). Legend pair unchanged:
dictv=6c4aa81a81163d18 entries=1320.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
graph.h rustOutsideGlobMaySupply is asked for every bare Rust call and every in-tree namesake of it in
another file, and each ask re-read the caller file's import records and re-ran levelAt and
rustPathProvablyOutside for every glob `use` at a level of the call's chain.

- receiverevidence.h: RIPWIRE_STATS counters for the asks, the import records forEachImport read
  for them, and the glob verdicts they ran; graph.h prints `[mem] rust_glob asks= reads= verdicts=`.
- test/rustglobscalecheck.sh: a generated crate with G outside globs and C bare calls, at
  (G, C) = (40, 40), (40, 80), (80, 80). S1: verdicts grow at most 2.5x when both double. S2: import
  records read grow at most 1.25x when only the calls double. Red here: verdicts 1600 -> 6400, reads
  2,822,400 -> 5,644,800.

No output change: the counters are read only under RIPWIRE_STATS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st-segment cuts

`s.find_last_not_of( " \t" ) + 1` on an all-blank line reads npos + 1 == 0. Release gets the right
answer from the wrap; the G1 sanitizer build (-fsanitize=integer, -fno-sanitize-recover=all) aborts.
llvm-project's reST docs hit it in ingest_rest.h isAdornmentLine (an overline candidate followed by a
text line and an empty line), so the G1 build could not map llvm at all.

namesplit::trimTrailing( text, blanks ) is the one right-trim to a set, npos tested; the reST
adornment scan, quality.h's import tail, forselfhook's decorator text and resolve.h's three trims use
it. The last-segment cuts in exemplarfamily.h memberStem and forrowfeatures.h dirOf use the existing
namesplit::afterLast. forimportspec.h's `colon - 1` (colon == 0) keeps its old answer explicitly.

Output is byte-identical (maps and --for/--exemplar on black, eslint, libzmq, this repo; maps of
cpython/Doc, django/docs, llvm/docs). restdocscheck K pins it: red on the base under asan/ripwire.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its candidates

graph.h rustOutsideGlobMaySupply was asked per (call, in-tree candidate in another file) and every
ask re-read the file's import records and re-ran levelAt + rustPathProvablyOutside +
rustRootNamesTreePackage for each glob at a level of the call's chain. A glob's verdict depends on
(file, glob) alone and the answer on (file, byte, name) alone.

- receiverevidence.h rustGlobFacts: per file, built on its first ask — the sorted names its `use`
  rows bind, and per level (levelAt's Level, sorted) whether a glob there provably leads out and
  whether one does not. A file with no glob answers false at once; a name no `use` binds skips the
  forEachRustUseAt walk.
- rustGlobLast: the ladder asks once per candidate of one call; the last call's answer is reused.

nushell: asks 2,024,900 (unchanged), answered 10,343; import reads 114,460,236 -> 206,024; glob
verdicts 2,030,736 -> 1,197. Map (all rows), --pin-census and --for byte-identical to de28985 on
nushell, terraform and three Rust trees. Gate: test/rustglobscalecheck.sh S1/S2/A1 red -> green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… trims

Three sites in graph.h added 1 to a find result that can be npos and relied on the wrap to 0,
which the integer sanitizer aborts on: the `../` walk of a module path (`dir.rfind('/') + 1`),
the proc_macro attribute trim (a blank `#[ ]`), and the blank text before `as` in a `use` list.
Each now tests npos and takes the same result the wrap gave (top level, no match, empty text).

Byte-identical: full map, --pin-census and --for on nushell, terraform and three Rust trees.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…0-cut-1121)

The npos+1 wrap fixed at 11 sites (namesplit::trimTrailing / afterLast and their callers); output byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…0-cut-1121)

The Rust glob-import regression on nushell (asks 2,024,900 -> 10,343; reads 114M -> 206K), three graph.h npos sites tested instead of wrapped, and the new gate test/rustglobscalecheck.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…loaded, and a warm --for on llvm unmapped its own graph

The macOS large-block route keeps a region's size in a 16-byte header before
the block. A Release build links with LTO, which inlined the replaced operator
delete into its callers. Where a function holds both the `operator new` call
and the free, the optimizer treats the header read as a load from outside a
fresh block of known size and may give it any value: at least 15 of the
46,669 inlined frees in the candidate (no profile; 4,135 sites with one) call
munmap( block, <leftover register> ). In pageRankDouble the leftover is a
pointer, so the request is a multi-gigabyte unmap.

Recorded with a munmap interposer on the candidate (llvm-project, fully warm
--for, 5 runs): the 2 surviving runs made the call low in the address space
and got EINVAL (the block leaks); the 3 crashing runs made it at 0x3098c0000
and the like, it returned 0, and the graph's blocks at 0x340104000.. went with
it. vscode and envoy make the same call and get EINVAL.

The replaced allocation functions are now never inlined, so the header is read
where the pointer is only a pointer. Fixed Release+LTO+PGO build: 2 munmap
call sites, 14 of 14 fully warm llvm runs exit 0 with the candidate's answer,
0 wrong-length unmaps under the interposer.

Gate (test/largeallocpeakcheck.sh): arm L builds the route under -O2 -flto with
a fixture shaped like pageRankDouble (red before: 48 freed blocks stay mapped,
385 MiB; munmap called from the fixture's own functions); arm S counts the
munmap call sites of the binary under test (red on the candidate: 4,135).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…on/070-cut-1121)

Release blocker: the llvm warm --for segfault. src/largealloc.cpp's replaced operator new/delete were inlined under LTO, so the size read from the block's 16-byte header was undefined to the optimizer and munmap received a stale register as its length; all ten forms are now [[gnu::noinline]]. largeallocpeakcheck gains the LTO fixture (L) and S arms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main moved again before the final build: #723 (#719, bench XML-escaped path/name decode,
its new gate test/benchxmlpathcheck.sh and binoverridecheck exemption). No source or parser
change, so kParserVer stays 342.

Conflicts: README.md, docs/EVALS.md, docs/LIMITS.md, docs/TUNING.md, docs/counts.tsv,
present/deck5_ripwire_build.js — all the generated counts-snapshot regions both sides
refreshed. Kept the train's side, then `python3 docs/counts_snapshot.py refresh` on the
merged tree (tool-written), never text-merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PG2 (45972e0) gave optremarkscheck training-workload arms that run the binary
(BIN="${RIPWIRE_BIN:-$ROOT/build/ripwire}"), so its EXEMPT reason "no binary invocation"
went stale and binoverridecheck (2b) went red. The row is removed: the gate now runs under
binoverridecheck's override like any other, and honours RIPWIRE_BIN — binoverridecheck
ALL PASS on the train after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…COMMANDS.md

The held regeneration after RS1, NU1, CR1 and origin/main 785143c: recorded from
built_from=191eeb0fb on a clean tree (272 commands); COMMANDS.md rebuilt from it
(--check equal). The printf golden needed no re-pin (ALL PASS) and the counts snapshot
was refreshed in the main merge (912 gate scripts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant