Skip to content

feat(ENG-RECORD-ANCHOR-RATCHET): the record checker range-checks its own citations and reports nothing (#632) - #851

Merged
localai-bot merged 10 commits into
mainfrom
row/anchor-ratchet-impl
Aug 19, 2026
Merged

feat(ENG-RECORD-ANCHOR-RATCHET): the record checker range-checks its own citations and reports nothing (#632)#851
localai-bot merged 10 commits into
mainfrom
row/anchor-ratchet-impl

Conversation

@localai-bot

@localai-bot localai-bot commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

check-agent-record.py range-checked the record's own path:line citations and
reported nothing about them. This adds the symbol test, the offender report, and
a two-way ratchet over scripts/record-anchor-baseline.json so the rot can only
go down.

Read the correction first. The original commit on this branch, 8632159f3,
says the checker "never read" bare path:line citations. That is false, and a
fresh review caught it. 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. That commit cannot be edited
without a force-push, which is forbidden here, so 22e6294c6 states the
correction in a new message and six record surfaces are corrected in place.

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 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.

Population Count Already parsed before this row
every citation form in the five matrices, ours and upstream 2200 (492 links, 1708 bare) 1017 (46.2%)
the citations this ratchet CLASSIFIES 867 832 (96.0%)

The 35 genuinely new to parsing sit under .agents/, docs/ and website/.
Both population figures are measured at 8daa67b39, and every offender recorded
then 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.md is a keyed record: origin/main taken whole, this
    row'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_ROWS needed no arithmetic: merge base 156, this branch 156 because it
    adds no row, origin/main 163. The merged value is 163, which is what sat
    outside the conflict markers, and the checker re-derives ENGINE=163.
  • The other four conflicts are append-only regions (a dated comment log, a dated
    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-SPARSE at
backend.h:271 reads OK because drift on main moved a comment naming
get_kv_cache_shape onto 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 main took the count down once more, and this one is not a
repair either. 72bd06a5a (record(ROAD-V1-C6), #535) rewrote the
SERVE-ASYNC-LLM row and replaced the citation examples/server/main.cpp:230-247
with a bare examples/server/main.cpp. That anchor was BROKEN, the file being 23
lines, and dropping the line number did not fix it: both citation regexes require
:(\d+), so the anchor left the counted population altogether. broken fell 7 to
6, 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-baseline
instruction 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

Gates

Host mudler-devbox (20 cores) unless stated.

Gate Result
python3 scripts/check-agent-record.py OK, ENGINE=164 ... ANCHOR-ROT=38, load 62
python3 -m unittest tests.scripts.test_agent_record 97 tests, OK, load 62
RecordAnchorRatchet five mutants 2 / 3 / 7 / 3 / 4 cases red, tree restored byte-for-byte
python3 scripts/check-pr-size.py --base origin/main --head HEAD OK
python3 scripts/check-commit-trailers.py --range <merge-base>..HEAD OK, run explicitly per #653
python3 scripts/check-commit-style.py --range <merge-base>..HEAD OK, run explicitly for the same reason
python3 scripts/check-public-doc-tables.py OK
scripts/agent-preflight.sh All gates green, exit 0, at b973c05be, load 25

An earlier preflight run failed test_cpu_x86_llamacpp_floor (#618) at load
237
on this 20-core box, in
test_a_contended_leg_is_discarded_and_never_summarised. An attribution is not
a green, so the identical tree at b973c05be was shipped to Thor
(kairos-4db2, 14 cores) by git archive, with the tar md5 checked on both
sides. At load 3.5 Thor reads 10 tests, OK, and reproduces the baseline
exactly: ok=828, stale=32, broken=7 -> rot 39, with RecordAnchorRatchet
10/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 archive tree has no .git, so commit_exists() calls every DONE row's
closing commit missing and aborts AgentRecordMutationTests.setUpClass. The
record 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 main added three
error-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 is
recorded here.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]

mudler added 2 commits August 15, 2026 00:15
…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]
mudler added 3 commits August 18, 2026 20:27
…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]
@localai-bot localai-bot changed the title feat(ENG-RECORD-ANCHOR-RATCHET): parse the citation form the checker never read, and ratchet its rot feat(ENG-RECORD-ANCHOR-RATCHET): the record checker range-checks its own citations and reports nothing (#632) Aug 18, 2026
mudler added 4 commits August 18, 2026 20:48
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]
…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
localai-bot merged commit 678fc67 into main Aug 19, 2026
22 of 25 checks passed
@localai-bot
localai-bot deleted the row/anchor-ratchet-impl branch August 19, 2026 06:53
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]
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants