feat(ENG-RECORD-ANCHOR-RATCHET): the record checker range-checks its own citations and reports nothing (#632) - #851
Merged
Merged
Conversation
…never read, and ratchet its rot `check-agent-record.py` looked like it validated the record's `file.cpp:123` citations and did not. `LINK_RE` matches markdown links, so `local_line_anchors` only ever saw `[label](path#L505)`. Re-derived over the five matrices at `0e8b15d56`: 479 link anchors carrying an `#L` fragment against 2134 bare citations inside backtick spans, so 17.2% of the citation forms a reader sees were examined as citations at all. Three gaps compounded. The bare form was unparsed. `is_code_anchor` answers with `any()`, so one good link in a cell covered every rotted citation beside it. And `EVIDENCED_STATES` omits `ACTIVE` and `READY`, so 83 live rows got no anchor check. Inside the fraction that was examined, only the RANGE was checked -- which is why three stale anchors survived the 2026-08-13/14 campaign and had to be caught by a human reading. All three were in range. This parses both forms, classifies each resolvable citation as OK, STALE (the line exists but does not contain the symbol named beside it) or BROKEN (out of range, or a filename gone from a directory we own), and gates the STALE+BROKEN count against `scripts/record-anchor-baseline.json` the way the DSR ratchet in `check-device-leakage.py` gates leakage: a bucket above its baseline fails, and a bucket below it fails too, so a repair must lower the baseline in the same commit. Measured backlog at adoption is 40 -- 33 stale, 7 broken, over 800 correct -- and every one of the 40 was verified by hand against the cited file before the number was written down. They are deliberately NOT repaired here; the ratchet exists so they are fixed by whoever next touches each row. `is_code_anchor`'s `any()` stays for the STATE gate: a row is still evidenced by one good anchor. The ratchet counts every citation independently, which is the half `any()` was hiding. The symbol test is conservative by measurement, not by taste. It reads only the `code` and `tests` cells, never `upstream`, which is what keeps 1446 upstream `vllm/...py:123` references structurally out of the count instead of relying on a path heuristic that `tests/`, `cmake/`, `docs/` and `src/` all defeat. A symbol is inferred only from an immediately adjacent backtick span that looks like an identifier -- 4+ characters carrying `_`, `::`, `()` or an uppercase letter, and not starting with `_`, which was added after a measured false positive on `` the text-only `_ModelInfo` ``. About six citations in seven yield no symbol and are OK by construction. That polarity is the point: a checker that cries wolf gets disabled, and this one has to survive a four-figure backlog. Nine cases in `RecordAnchorRatchet`, all captured red before implementation -- the six the spec names plus the two gate directions and the tree/baseline pin. Five mutants red them: report-only, `EVIDENCED_STATES` restored, links-only, first-citation-only, and range-only. The load-bearing case is the cell holding one good link beside one rotted bare citation, which is the exact shape the rot hid in; links-only, first-citation-only and range-only all red it. The ratchet is a mode of the checker rather than a new script because it needs `parse_claim_rows` and `field_index`; a separate checker would have re-derived both and dragged a `CREATION_MUTATIONS` entry through `check-pr-size.py` for no gain. It runs in `agent-preflight.sh` through `check-agent-record`, and the `agent-record` CI job now calls `--report` so the offender list is printed on every run, the way `check-device-leakage --report` is wired below it. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
…derive the baseline the merge moved The branch was 161 commits behind `origin/main` and conflicted in the five files it edits. Each conflict is resolved by the rule its surface carries. `.agents/engine-matrix.md` is a keyed record, so `origin/main` is taken whole and this row's scoped edit is applied again on top: the `ENG-RECORD-ANCHOR-RATCHET` row moves `SPIKE` to `ACTIVE`, and the two summary rows it moves follow. The Serving area reads SPIKE 1 to 0 and ACTIVE 10 to 11. The Total reads SPIKE 5 to 4 and ACTIVE 37 to 38. The row count is unchanged at 163. The five area rows ABOVE the conflict markers auto-merged clean and were verified byte-for-byte against `origin/main` before the reapplication. `ENGINE_ROWS` needed no arithmetic and got none. The merge base is 156, this branch is 156 because it adds no row, and `origin/main` is 163 because it added seven. The merged value is therefore 163, which is what git already held OUTSIDE the conflict markers while only the comment block conflicted. `check-agent-record.py` re-derives the count from the rows and agrees: `ENGINE=163`. `scripts/check-agent-record.py`, `scripts/check-gate-commands.py` and `tests/scripts/test_agent_record.py` conflicted in append-only regions: a dated comment log, a dated gate-set log, and two independent new test classes. Each is resolved as a union in date order. `docs/BENCHMARKS.md` conflicted between two new at-a-glance rows and keeps both. The merge shifted the line numbers this row's own record cites, which turned all seven of its anchors STALE. They are repaired rather than banked, because a row that argues stale anchors matter may not carry seven. The offender set is now the recorded 40 minus one: `KERNEL-ATTN-MLA-SPARSE` at `include/vllm/v1/attention/backend.h:271` no longer reads STALE because drift on `main` moved a comment naming `get_kv_cache_shape` onto that line. That is an accidental pass, not a repair, and the spec records it as a measured limit of the symbol test. The baseline is re-derived to 39, which is 32 STALE and 7 BROKEN. No new offender was banked. `agent_record.main()` is called with an explicit empty argument list by the test `origin/main` added in #1033. #632 gave the checker an argparse front end, so `main(None)` parses `sys.argv`, which under a test runner holds the runner's arguments and exits 2. The production call site is unchanged. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
…at checks out (#1270) `--write-baseline` returned as soon as it had a number, and that return sat above the `if errors:` gate at the end of `main`. A tree that failed any other record check could therefore still write `scripts/record-anchor-baseline.json`, and the banked figure then carried the authority of a run that never passed. The rot budget is the one file in this tree whose value nobody may quietly raise, so it is the wrong file to write from an unverified tree. The write moves below the error gate. `check_record_anchors` is still skipped in write mode, because a run that lowers the baseline must not also report a regression against the value it is replacing. `RecordAnchorRatchet.test_a_baseline_is_never_banked_from_a_tree_with_record_errors` holds it. The case makes `check_roadmap` append one synthetic error, calls `main(["--write-baseline"])`, and requires exit 1, the error on stderr, and the baseline file byte-identical. Captured red before the change, where `main` returned 0 and rewrote the file. Restoring the early return in a scratch copy reds it again, and the other nine cases in the class stay green, so the case measures this guarantee and not the ratchet beside it. Found while re-deriving the baseline after merging 161 commits of `main` into this branch. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
…n six surfaces, and this is the correction (#632) **The correction, stated plainly, because the commit that carried the false version cannot be edited without a force-push and force-pushing is forbidden.** `8632159f3` says the checker "never read" bare `path:line` citations, and its subject says it "parse[s] the citation form the checker never read". That is false. `RAW_LOCAL_ANCHOR_RE` has parsed the bare form since `ee511ca8a` (2026-07-10) under the prefixes `src`, `include`, `tests`, `examples`, `cmake`, `scripts`, `tools` and `.github/workflows`, plus `CMakeLists.txt`, and it range-checks each one. Read this commit as the binding statement of the defect wherever the two disagree. **What was actually wrong.** `local_line_anchors` parses both citation forms and range-checks both, and then reports nothing. On a missing file and on an out-of-range line the loop runs `continue`, so the failing anchor never enters the returned list, and `is_code_anchor` answers with `any()`, so one good sibling covers the rest. There was no symbol test. **32 of the 39** recorded offenders are IN RANGE, so range-checking alone could never have found them. That defect is real, it is sufficient, and the design that closes it needed no change: the fresh review returned FAIL on the recorded justification and PASS on the implementation, tests and gate wiring, so nothing here is redesigned. **Two populations, two ratios, each with its denominator.** Quoting one as if it were the other is what produced the error. A citation is counted only where it is the WHOLE of a backtick span, which is what the parser requires; the earlier 2134 used a looser method that matched a `path:line` token anywhere in a span. - Every citation form in the five matrices, ours and upstream: 492 links and 1708 bare, 2200 total, of which 1017 (46.2%) were already parsed. Most of the rest are upstream paths no local checker can validate, so this ratio answers no coverage question on its own. - The citations the ratchet CLASSIFIES: 867. Of those **832 (96.0%)** were already parsed and range-checked, and 35 (4.0%) are genuinely new to parsing, under `.agents/`, `docs/` and `website/`. All 39 offenders sit in the 96%. Six surfaces carried the false statement and are corrected in place rather than appended to, so nobody reads the wrong version first: the spec's `## The defect`, the `ENG-RECORD-ANCHOR-RATCHET` row, `docs/STATUS.md`, `docs/BENCHMARKS.md`, the `#632` issue-index row, and this message for the commit. The index row is edited rather than corrected by a second row because append-only protects rows a concurrent branch may hold, and this one has never reached `main`; the append-only gate measures the merge base and agrees. The spec also contradicted itself: `## The defect` said 480 / 2137 / 18.3% while `## Our baseline` said 479 / 2134 / 17.2%. `## The defect` is corrected in place, so the file carries one measurement rather than three. Four figures are re-derived rather than copied. - The suite is 97 methods in `tests/scripts/test_agent_record.py` and 10 in `RecordAnchorRatchet`, not the 72 the record claimed. - The `RECORD_ANCHOR_STATES` to `EVIDENCED_STATES` mutant reds **3** cases, not 4: `test_active_row_anchors_are_counted`, `test_baseline_matches_the_tree_exactly` and `test_new_rot_fails_the_gate`. `test_a_repair_fails_until_the_baseline_is_lowered` stays green under it and reds only under report-only. - Widening `EVIDENCED_STATES` raises **82 errors across 46 rows**, not "71 rows". The unit was wrong: the contract check emits one error per missing anchor field. `## Scope` now says the non-widening is a decision. - **801 of 867** in-scope citations yield no symbol and are OK by construction, which is 92.4%, or about 13 in 14, not "six in seven". The spec cited `local_line_anchors:941` and `LINK_RE:545`, both stale, inside the file arguing that stale anchors matter. They are gone with the paragraph that held them, the row's five remaining anchors are re-pinned at this head, and the spec now records that no spec body is policed by this ratchet, because `MATRIX_PATHS` holds no spec (#911). `check-pr-size.py` no longer aborts on `.agents/issue-index.md`. #856 classified that path at `scripts/check-pr-size.py:93`, so the MEDIUM finding against it is closed by `main` and needs no issue here. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
…uring this repair No conflict. The four commits touch `.agents/issue-index.md`, `docs/BENCHMARKS.md` and `docs/STATUS.md`, and each is an append or a keyed row this branch does not hold. The record gate re-derives ANCHOR-ROT=39 and ENGINE=163 against the merged tree, and the public doc tables stay inside the STATUS size ratchet. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
No conflict. The commit touches `.agents/issue-index.md`, `docs/BENCHMARKS.md` and `docs/STATUS.md` in rows this branch does not hold. The record gate re-derives ANCHOR-ROT=39 and ENGINE=163 against the merged tree, and the public doc tables stay inside the STATUS size ratchet. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
… index-append conflict No conflict locally. The only overlap is `.agents/issue-index.md`, where both sides append a row and the `merge=union` attribute resolves it. GitHub reported CONFLICTING for the same file, so the merge is taken here where the attribute applies. The record gate re-derives ANCHOR-ROT=39 and ENGINE=163 against the merged tree. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
… is 53, and three other counts were stale by one landed case (#632, #1287) The second fresh review returned FAIL on record text alone. The design, the checker, the tests, the baseline rule and the gate wiring were all found sound, and none of them is touched here. **46 is wrong, and it was wrong when it was written.** `22e6294c6` presented "82 errors across 46 rows" as re-derived, and its body cannot be edited because `main` is never force-pushed, so the correction is stated here instead. Widening `EVIDENCED_STATES` to `ACTIVE` and `READY` and running the contract check yields 82 errors across **50** distinct row IDs, not 46. It was 50 at `22e6294c6` and 50 at `8daa67b39`, so the figure never drifted into being wrong. This commit merges `main`, which adds `LOAD-GGUF-MMPROJ`, `QUANT-QWEN38-27B-GGUF-ARM` and `QUANT-QWEN38-27B-NVFP4-ARM`, each raising one error. The head-true figure that lands is therefore **85 errors across 53 rows**: 37 `ACTIVE` and 16 `READY`, 32 rows raising two errors and 21 raising one, by matrix 26 engine, 11 backend, 7 model, 6 kernel and 3 quantization. A number that is right at one head and landed at another is the defect this row exists to catch, so the landed value is the one measured here. Two counts were stale by exactly the case `8b9b2278f` added for #1270. The row said nine `RecordAnchorRatchet` cases and the work breakdown said six RED-first cases, while `## Gates`, the claim file and `22e6294c6` all said ten. The class runs ten and the `## Tests` table lists seven. #1287 is filed for the fourth finding. `## Our baseline` recorded honestly that `KERNEL-ATTN-MLA-SPARSE` reads `OK` for the wrong reason: its citation `include/vllm/v1/attention/backend.h:271` lands on a ROCm comment naming `get_kv_cache_shape`, and the declaration is 70 lines down at `:341`. That framing stays, because tightening it needs a parser per language. What the spec did not draw out is the cost downstream, and this merge produced the worked example. The ratchet also fails when a bucket FALLS without the baseline being lowered in the same commit, so unrelated drift that stops a citation from being counted forces the next contributor to bank a repair nobody made. `72bd06a5a`, a record reconciliation for #535, replaced the `SERVE-ASYNC-LLM` citation `examples/server/main.cpp:230-247` with a bare `examples/server/main.cpp`. The anchor was never repaired; it stopped being an anchor. `broken` fell 7 to 6 and the baseline had to be lowered here to go green. The merge also moved five of this row's own anchors into `scripts/check-agent-record.py`, and the edits in this commit moved them once more. They are re-pinned rather than banked, because a row arguing that stale anchors matter may not carry any. The population figures measured at `8daa67b39` are left at their measured values and now name that head, because the merge moved the in-scope citation total and re-deriving them needs the pre-ratchet parser. The engine-matrix summary table conflicted. The target-branch version was taken whole and the totals were re-derived from the rows rather than patched: 164 rows, and `SPIKE` 4 with `ACTIVE` 38 because this branch already moved one `Serving` row between those states. Gate: `check-agent-record.py --report` exits 0 at `ok=844, stale=32, broken=6 -> rot 38`; `RecordAnchorRatchet` runs 10 tests OK; `test_agent_record.py` runs 97 tests OK. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [CLI]
…re-derive the engine totals from the rows `main` moved twice during this repair round, so the branch is merged again before the push. Git resolved every path automatically, and `.agents/engine-matrix.md` is a keyed record, so the result was checked rather than trusted: against `origin/main` it differs in exactly two places, the summary table and the `ENG-RECORD-ANCHOR-RATCHET` row, and every other row is byte-for-byte the target-branch version. The summary totals are re-derived from the rows, not patched: 164 rows, `SPIKE` 4 and `ACTIVE` 38, which is main's table with this branch's own `Serving` row already moved between those two states. `.agents/issue-index.md` union-merged with no deletion. The three rows this branch adds are the only lines it carries over `main`. The measured figures are unchanged by this merge: 85 contract errors across 53 rows when `EVIDENCED_STATES` is widened, `ENGINE=164`, and anchor rot 38. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [CLI]
This was referenced Aug 18, 2026
…the pre-merge rot, which is the row's own thesis failing on the row's own record (#632, #1287) The row corrected its rot figure on `.agents/` and `scripts/` after the last merge and left `docs/BENCHMARKS.md` and `docs/STATUS.md` asserting the numbers from before it. That a recorded figure must be true at the head where it lands is this row's entire argument, so a public surface contradicting `scripts/record-anchor-baseline.json` in the same tree is the defect the row exists to name. Re-derived at this head: `check-agent-record.py --report` reads `ok=844, stale=32, broken=6 -> rot 38`, and the baseline reads `{"total": 38, "buckets": {"stale": 32, "broken": 6}}`. `docs/BENCHMARKS.md:14` was wrong in all four figures -- rot 39, 7 broken, 828 OK, and it was the last surviving place that stated **832 of 867** and **96.0%** with no head named. Those two are NOT re-derived here: reproducing them needs the pre-ratchet parser, so they are ANCHORED to `8daa67b39` the way `.agents/specs/record-anchor-ratchet.md:47-48` and `scripts/check-agent-record.py:1123` already anchor them. Adding the anchor pushed the cell to 230 chars against `MAX_CELL_CHARS = 220`, so two phrases were shortened to pay for it: `No runtime number owed` became `No number owed`, the form 11 other rows in the same table already use, and `the symbol test and report were not` became `no symbol test and no report ran`, which says the same thing in fewer words. The cell is 219 chars and no figure moved to buy the room. `docs/STATUS.md:97` and `:100` carried the same pre-merge numbers in prose. `scripts/check-agent-record.py:539-540` said `33 of the 40 offenders`, wrapped across two lines so a single-line grep never saw it, while `:1111` in the same file said `32 of the 38`. This one is NOT fallout from the last merge: the phrase entered at `d1591074f`, where the recorded baseline was already 39 (32 stale, 7 broken), so it has never agreed with any baseline this repository has stored. The block around it dates to `c13b9845f`, which is why the two sound like one edit. `.agents/engine-matrix.md:225` said `Measured at that head:` in a cell that names no head, so `that` had no antecedent. It now names `8daa67b39`. No code, test, gate wiring or baseline changes. The rot count is identical before and after, which is the point: this commit moves no number, it makes four sentences agree with the number the tree already holds. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
localai-bot
pushed a commit
that referenced
this pull request
Aug 19, 2026
Brings #851's record-checker range change under this branch's gates before the W4 pull request is opened, so the checkers this branch reports run against the version that will judge it. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
This was referenced Aug 19, 2026
localai-bot
added a commit
that referenced
this pull request
Aug 19, 2026
…se the moment it landed (#1324, #1325) (#1329) `docs/BENCHMARKS.md` and `docs/STATUS.md` published `844` correct citations for the `ENG-RECORD-ANCHOR-RATCHET` row. At the row's own merge commit `678fc672c` the tree reads `ok=847`: three good citations landed on `main` between verification and merge, so the figure was already wrong when it shipped. `.agents/engine-matrix.md` and `.agents/specs/record-anchor-ratchet.md` carried the same number. It has moved again since. At this branch's merged head the report reads `ok=849`, because `b953bfe82` added two more good citations while this repair was being written. The published figure went from wrong by three to wrong by five inside one day, with no change to the row, to the checker's semantics or to the rot, and no gate failed at any point. Chasing it to 847 fixes nothing. `ok` moves on every merge that adds or removes a citation, so 847 is false again at the next landing, and a live measurement stored in a document is what AGENTS.md §Records forbids by name: "Never store a measurement of one file inside another file. A number that changes after each edit couples every pull request to lines that it does not own." The count is therefore DROPPED rather than anchored to a SHA. Both shapes are defensible; this one was chosen for three reasons. First, `scripts/record-anchor-baseline.json` already made this decision for the machine-read surface, and says so in its own `_comment`: the OK count "is printed by --report but kept out of this file on purpose". Dropping it from the human-read surfaces makes the two agree, instead of stating a rule in one file and breaking it in four others. Second, no information is lost. The same BENCHMARKS cell already carries "832 of 867 in-scope citations (96.0%)" anchored at `8daa67b39`, so the reader keeps the sense of scale, from a figure that cannot drift. Third, the two figures are not the same kind of thing, and only one of them survives anchoring. "832 of 867" is a past-tense measurement OF the defect this row fixed: it describes a state at `8daa67b39` and is true there forever, so a SHA is the natural and sufficient form for it. `ok` is a present-tense health figure, and a projection document is read as current by construction -- anchoring it would leave a number that is simultaneously true of a past head and false of the tree in front of the reader, which is a worse failure than omitting it. Neither figure is gated, so "no gate reads it" does not separate them; what separates them is whether a SHA makes the sentence true or merely dated. Dropping removes the class instead of restating it in a form that still needs a human to notice. What remains stated is the rot -- 38, 32 stale, 6 broken, 32 in range -- which `check-agent-record.py` gates against the baseline in both directions, so it cannot move without a commit that says so. The BENCHMARKS cell falls from 219 to 203 characters against the 220 cap. Two findings from the same review are filed and NOT fixed here, because each is a semantic checker change owing its own spec, red-before mutation and fresh reviewer. #1324: this row's public figures are read by no gate. Measured at `af87251c5`, restoring the wrong pre-#851 values (rot 39, 7 broken, 828 OK) into the BENCHMARKS cell leaves `check-public-doc-tables.py` exit 0 AND `check-agent-record.py` exit 0, while the same run derived `stale=32, broken=6` beside them. The ratchet reads only the `code` and `tests` cells of matrix rows, so `docs/` prose sits outside `RECORD_ANCHOR_FIELDS` by construction. Rounds four and five of the #851 review were each spent on this class and each caught by a human reading; the `844` above is the third instance, and it landed. #1325: `scripts/record-anchor-baseline.json` stores a `"total"` that no code reads. `load_record_anchor_baseline` returns the two buckets only, and `write_record_anchor_baseline` refuses a raise against their `sum()`, so mutating `"total": 38` to `39` is inert and every gate stays green. The row's own budget file therefore carries the shape the row exists to name. Both stay OPEN. Both are listed under `## Owed` in `.agents/specs/record-anchor-ratchet.md` and appended to `.agents/issue-index.md` naming `ENG-RECORD-ANCHOR-RATCHET` as the owning row. Gates at the merged head: `check-agent-record.py --report` exit 0 with `ok=849, stale=32, broken=6 -> rot 38`, agreeing with `scripts/record-anchor-baseline.json`'s `"stale": 32, "broken": 6`; `check-agent-record.py` exit 0; `check-public-doc-tables.py` exit 0; `check-issue-index-append-only.py --base origin/main` exit 0 ("issue index append-only"), and the index diff against `origin/main` is two added lines and zero removed; `check-commit-trailers.py --range origin/main..HEAD` exit 0; `check-commit-style.py --range origin/main..HEAD` exit 0. `scripts/agent-preflight.sh` reports every other gate `ok`, including `commit-trailers` and `commit-style` over `origin/main..HEAD` and `issue-index append-only`, and one red: `test_cpu_x86_llamacpp_floor`, which this branch does not touch. It fails the same way on a clean checkout of the base with zero commits applied, and its own message names the cause both times -- `load=53.29` on the base run and `load=187.63` on the merged head, against a harness that discards a leg it cannot take on a quiet box. It is the known contended-box flake, not a finding about this change. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [claude-code] Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
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.
check-agent-record.pyrange-checked the record's ownpath:linecitations andreported nothing about them. This adds the symbol test, the offender report, and
a two-way ratchet over
scripts/record-anchor-baseline.jsonso the rot can onlygo down.
Read the correction first. The original commit on this branch,
8632159f3,says the checker "never read" bare
path:linecitations. That is false, and afresh review caught it.
RAW_LOCAL_ANCHOR_REhas parsed the bare form sinceee511ca8a(2026-07-10) under the prefixessrc,include,tests,examples,cmake,scripts,toolsand.github/workflows, plusCMakeLists.txt, and it range-checks each one. That commit cannot be editedwithout a force-push, which is forbidden here, so
22e6294c6states thecorrection in a new message and six record surfaces are corrected in place.
What was actually wrong
local_line_anchorsparses both citation forms and range-checks both, and thenreports nothing. On a missing file and on an out-of-range line the loop runs
continue, so the failing anchor never enters the returned list, andis_code_anchoranswers withany(), so one good sibling covers the rest.There was no symbol test. 32 of the 38 recorded offenders are IN RANGE, so
range-checking alone could never have found them.
That defect is real and sufficient, and the design that closes it needed no
change. The fresh review returned FAIL on the recorded justification and PASS on
the implementation, tests and gate wiring, so nothing here is redesigned.
Two populations, two ratios
Quoting one as if it were the other is what produced the error, so both carry
their denominator. A citation is counted only where it is the whole of a
backtick span, which is what the parser requires.
The 35 genuinely new to parsing sit under
.agents/,docs/andwebsite/.Both population figures are measured at
8daa67b39, and every offender recordedthen sat in the 96%. What this row adds is the symbol test and the report, not
the parser.
Bringing the branch current
The branch was 161 commits behind and conflicted in the five files it edits.
.agents/engine-matrix.mdis a keyed record:origin/maintaken whole, thisrow's scoped edit applied again on top. Serving area SPIKE 1 to 0 and ACTIVE
10 to 11; Total SPIKE 5 to 4 and ACTIVE 37 to 38. The five area rows above the
conflict markers auto-merged and were verified byte-for-byte first.
ENGINE_ROWSneeded no arithmetic: merge base 156, this branch 156 because itadds no row,
origin/main163. The merged value is 163, which is what satoutside the conflict markers, and the checker re-derives
ENGINE=163.gate-set log, two independent new test classes, two new at-a-glance rows),
resolved as unions in date order.
The merge moved the lines this row's own record cites, turning all seven of its
anchors STALE. They are repaired, not banked. The offender set is now the 40 the
review verified by hand, minus one:
KERNEL-ATTN-MLA-SPARSEatbackend.h:271reads OK because drift onmainmoved a comment namingget_kv_cache_shapeonto that line, while the real declaration is at:341.That is an accidental pass, recorded in the spec as a measured limit of the
symbol test.
A later merge of
maintook the count down once more, and this one is not arepair either.
72bd06a5a(record(ROAD-V1-C6), #535) rewrote theSERVE-ASYNC-LLMrow and replaced the citationexamples/server/main.cpp:230-247with a bare
examples/server/main.cpp. That anchor was BROKEN, the file being 23lines, and dropping the line number did not fix it: both citation regexes require
:(\d+), so the anchor left the counted population altogether.brokenfell 7 to6, the two-way ratchet went red on the fall, and the baseline had to be lowered to
go green — banking an improvement nobody made, on a row unrelated to this one.
#1287 tracks both. The comment case and the de-lining case are one mechanism:
the ratchet cannot tell a fall that was earned from a fall that was not, so it
forces the next contributor to bank either. Measured on the way in, de-lining any
citation drops it from the count and the gate then prints the
--write-baselineinstruction that makes the removal permanent. The issue's candidate 2 — a bank
must name the repair that earned it — closes both, and is out of scope here.
Baseline 38 (32 STALE, 6 BROKEN) over 844 OK. No new offender banked.
Also in this flow
--write-baselinebanks a record-anchor baseline from a tree that failed other record checks #1270, found and fixed here.--write-baselinereturned above theif errors:gate, so a tree that failed any other record check could stillbank its rot. The write moves below the gate, held by a case captured red
first and red again under the restored early return.
10 in
RecordAnchorRatchet, not 72; theEVIDENCED_STATESmutant reds3 cases, not 4; widening
EVIDENCED_STATESraises 85 errors across 53rows at this head, not "71 rows"; 801 of 867 citations yield no symbol, which is
92.4% (about 13 in 14), not "six in seven".
local_line_anchors:941andLINK_RE:545, both stale, insidethe file arguing that stale anchors matter. Gone with the paragraph that held
them, and the spec now records that no spec body is policed by this ratchet
because
MATRIX_PATHSholds none (Spec-body file:line anchors are unchecked (4772 of them) and an anchor into a file the row is editing is stale by default: one spec shipped 8 stale anchors, then 7 more from the merge alone #911).check-pr-size.pyno longer aborts on.agents/issue-index.md: pr-size aborts on every PR: .agents/issue-index.md was never classified when #840 created it #856classified it at
scripts/check-pr-size.py:93, so that review finding isclosed by
main.Gates
Host
mudler-devbox(20 cores) unless stated.python3 scripts/check-agent-record.pyENGINE=164 ... ANCHOR-ROT=38, load 62python3 -m unittest tests.scripts.test_agent_recordRecordAnchorRatchetfive mutantspython3 scripts/check-pr-size.py --base origin/main --head HEADpython3 scripts/check-commit-trailers.py --range <merge-base>..HEADpython3 scripts/check-commit-style.py --range <merge-base>..HEADpython3 scripts/check-public-doc-tables.pyscripts/agent-preflight.shb973c05be, load 25An earlier preflight run failed
test_cpu_x86_llamacpp_floor(#618) at load237 on this 20-core box, in
test_a_contended_leg_is_discarded_and_never_summarised. An attribution is nota green, so the identical tree at
b973c05bewas shipped to Thor(
kairos-4db2, 14 cores) bygit archive, with the tar md5 checked on bothsides. At load 3.5 Thor reads 10 tests, OK, and reproduces the baseline
exactly:
ok=828, stale=32, broken=7 -> rot 39, withRecordAnchorRatchet10/10. The final dev-box preflight then passed the same gate at load 35, so the
load-dependence is measured on both boxes rather than argued.
Thor reports 70 rather than 97 record tests. That is the instrument: a
git archivetree has no.git, socommit_exists()calls every DONE row'sclosing commit missing and aborts
AgentRecordMutationTests.setUpClass. Therecord is fine; the tree simply has no history to ask.
Closes #632. Fixes #1270.
The figure "82 errors across 46 rows" in an earlier commit body on this branch is
superseded. It was 82 across 50 rows when written, not 46 — the unit was
re-derived but the row count was wrong — and merging
mainadded threeerror-raising rows (#1279), so it is 85 across 53 at this head. Those commit
bodies cannot be edited without force-pushing
main, so the correction isrecorded here.
FOLLOWING_AGENTS_PROTOCOL
Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]