Repository navigation
fix(ENG-RECORD-ANCHOR-RATCHET): restore the 35 definitions c12b376b2 deleted, unwired, and measure the rot they had been hiding - #3344
Conversation
…leted, unwired, and measure the rot they had been hiding The merge that took 1231 lines out of this checker took the tests for them with it nowhere: tests/scripts/test_agent_record.py still asks for extract_links, scan_record_anchors, link_bases, strip_code_spans, RecordAnchorResult and RECORD_ANCHOR_BASELINE, and 58 of its 106 cases were red for that reason alone. scripts/record-anchor-baseline.json outlived the code that reads it, still naming the row in its own _comment. 35 definitions are restored from 4fcce96 by AST span extraction, never retyped, and scope-audited so every name they read resolves. The extractor first dropped @DataClass, because ast reports lineno at the class line and not at the decorator, which produced a restore that PARSED and still failed at run time with 'Field' object is not subscriptable. Reading the diff would not have caught it; running the gate did. main() takes argv again and accepts --report and --write-baseline, with the baseline write AFTER the errors gate rather than before it, which is localai-org#1270. Nothing in main() calls check_record_anchors, check_claim_state_consistency or check_canonical_issue_references. That is the whole point of landing it this way: wiring them reddens the gate today, because nothing has been checking these citations since the merge. --report is no longer silently ignored. ci.yml:187 and agent-preflight.sh:418 both pass it and main() took no arguments, so it was accepted by the shell and dropped by the program. It now prints what the wired gate would have refused on: ok=974, stale=39, broken=5, rot 44, naming offenders such as KV-PREFIX-CACHE -> examples/server/main.cpp:126. The suite goes 58 failures to 24, and the 24 are TWO populations, so the number alone would misreport this. FOURTEEN are subtests of test_every_tracked_checker_line_citation_still_resolves and they ARE the debt -- they are the 44 rotted citations, which is the backlog this row exists to hand over. The other TEN are restore gaps and are not debt: * test_checker_keeps_preexisting_citation_line_floor requires this file to be at least 2446 lines, because the tree's own records cite check-agent-record.py BY LINE and retiring below that invalidates them. The selective splice reaches 1969. The next iteration must restore the whole pre-merge file reconciled with HEAD's restructure, not splice. * two baseline tests want a baseline equal to the tree, and writing one is a raise this row's own error message warns against. * six claim and lifecycle tests get an empty error list where a POSIX-spelled diagnostic was expected, and one archived-link test needs the link_bases two-base behaviour HEAD deliberately flattened to link_base. check-agent-record.py is rc=0, unwired, with and without --report. check-symbol-anchors goes from 5 stale to 0 here, because the restoration brings back the five symbols engine-matrix.md:231 cites, so this branch SUPERSEDES localai-org#3338: that PR corrects the same cell to say the ratchet is absent, and with the code back its correction becomes the false statement. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:codebuff/buffy [freebuff]
1dd1422 to
394c634
Compare
mudler-agent
left a comment
There was a problem hiding this comment.
Changes requested: tests/scripts/test_agent_record.py remains red, and the restored critical checks (check_record_anchors, claim-state consistency, canonical issue references) are not called by the production gate. --report reports 44 rotten anchors but exits 0. Wire and green the guarantees before landing.
…record-anchor subsystem, leaving only the closed issue record upstream/main now defines every name c12b376 dropped and calls them: scan_record_anchors and check_record_anchors are wired inside the errors gate in main(), --report prints offenders, --write-baseline writes scripts/record-anchor-baseline.json only after the gate passes, check_claim_state_consistency is called at line 1980, and canonical_intake_debt plus check_canonical_issue_references at line 2305. The conflict in scripts/check-agent-record.py resolves to the upstream revision. The merged tree reports ANCHOR-ROT=0 and the 106-case test_agent_record.py suite is green, which discharges the 24 failures the unwind left. The issue record closes: the tree falsifies its open state, and the record file is what this pull request still adds. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:anthropic/devin [devin]
1cfdf89 to
706da85
Compare
… main Merges upstream/main (42 commits) into the row branch. The tree merged cleanly; the PR remains records-only -- the closed issue record and its executed verification against upstream's restored anchor subsystem. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:anthropic/devin [devin]
… over current main On the merged head the record gate reports ANCHOR-ROT=0 over 1018 ok anchors, the agent record suite is 106/106, and mutating one cited symbol reddens the gate by name in the stale bucket against the zero baseline, then restores green. The record is closed; the evidence is the artifact this PR still carries. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:anthropic/devin [devin]
Refresh the branch against current main so the gate runs against the tree that will actually receive it. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:Buffy [Freebuff]
|
Two of the three findings are addressed on the current head, and the third does not reproduce on POSIX. Wired. The restored checks are now called by the production gate: Test file. 120 pass, 5 fail, and all five are Windows-only path-separator assertions, not record defects:
|
Closes the local record added in this branch,
.agents/issues/ENG-RECORD-ANCHOR-RATCHET/ISSUE-LOCAL-01M3JXGKKHK4WE6054PWPR67RA.md.Supersedes #3338. This branch brings back the five symbols
.agents/engine-matrix.md:231cites, socheck-symbol-anchorsgoes 5 stale → 0 here. #3338 corrects that same cell to say the ratchet is absent; with the code restored, that correction becomes the false statement. #3338 should close as superseded rather than land first.The tree was asking for this code the whole time
The merge
c12b376b2— divergent parents858560fd4(feature side, 1215 lines) and4fcce96b5(main side, 2446) — resolved to the feature side and took 23 definitions with it. The tests did not go with them.tests/scripts/test_agent_record.pystill asks forextract_links,scan_record_anchors,link_bases,strip_code_spans,RecordAnchorResultandRECORD_ANCHOR_BASELINE, and 58 of its 106 cases were red for that reason alone.scripts/record-anchor-baseline.jsonoutlived the code that reads it, still naming the row in its own_comment.All 23 lost definitions are absent from the entire
scripts/tree. The failures span three subsystems: the anchor ratchet, the markdown fence/inline-span link extractor, and the claim-state checks.Restored unwired, on purpose
main()takesargvagain and accepts--reportand--write-baseline, with the baseline write after the errors gate rather than before it (that ordering is #1270). Nothing inmain()callscheck_record_anchors,check_claim_state_consistencyorcheck_canonical_issue_references.That is the whole reason for landing it this way. Measured by checking
4fcce96b5out over the current tree: it parses, and it goes red —RECORD ANCHOR REGRESSION in bucket 'stale': 39 > baseline 0and'broken': 5 > baseline 0. The 35 definitions are extracted by AST span and never retyped, so the diff is the recovered bytes.One bug worth recording. The extractor dropped
@dataclasson the first pass, becauseastreportslinenoat theclassline and not at the decorator. The result parsed cleanly and still failed at run time with'Field' object is not subscriptable—RecordAnchorResult.countsstayed aFieldobject. Reading the diff would not have caught it; running the gate did.--reportstops being silently ignoredci.yml:187andagent-preflight.sh:418both pass--report, andmain()took no arguments, so the shell accepted the flag and the program dropped it. It now prints what the wired gate would have refused on:check-agent-record.pyis rc=0 with and without--report, unwired.The 24 remaining failures are two populations
58 → 24 is the honest headline, but the number alone would misreport this.
14 — the debt, and genuinely the debt. Subtests of
test_every_tracked_checker_line_citation_still_resolves, i.e. the 44 rotted citations. That is precisely the backlog.agents/specs/record-anchor-ratchet.mdsays the ratchet exists to hand over.10 — restore gaps, not debt:
test_checker_keeps_preexisting_citation_line_floorcheck-agent-record.pyby line. The selective splice reaches 1969 — 477 short. The next iteration must restore the whole pre-merge file reconciled with HEAD's restructure, not splice definitions.test_baseline_matches_the_tree_exactly,test_a_repair_fails_until_the_baseline_is_loweredtest_an_archived_row_with_a_docs_relative_link_is_acceptedlink_basestwo-base archive behaviour HEAD deliberately flattened tolink_base; restoring it verbatim also produced 50 spuriousroadmap_v1.mderrors.Nothing here is presented as green.
check-agent-record.pyrc=0 is the only pass claimed, and it is pass-by-absence, which the--reportnumber states outright.Not claimed
No C++ build gate: no source file is touched.
check-commit-styleandcheck-commit-trailersover--range 1de097c46..HEADare green. The 24 red tests are red on this branch and were red before it — this branch reduces them and names every one.🤖 Generated with Codebuff
Co-Authored-By: Codebuff noreply@codebuff.com
Audit correction (measured 2026-10-04 against this head and
upstream/main@33fb82b09)Re-measured on a clean worktree at this PR's head (
706da8536). The evidencesection above no longer describes this head, and one of its claims is the only
pass the body offers.
Substantiated:
check-symbol-anchorsrc=0 on this head, withstale 0.Contradicted:
706da8536check-agent-record.pyis rc=0 with and without--report, unwired"check-agent-record.pyrc=0 is the only pass claimed"), and it is not a pass.--reportprintsrecord anchors: ok=974, stale=39, broken=5 -> rot 44record anchors: ok=1018, stale=0, broken=0 -> rot 0. The 44 rotted citations this body hands over as backlog are already repaired in this head.check-symbol-anchorsgoes 5 stale -> 0 here"upstream/main. Main already reads 0, so the improvement is no longer attributable to this branch; the "before" state no longer exists.tests/scripts/test_agent_record.pyat this head: 71 failed, 82 passed, 43 subtests passed. Onupstream/main: 5 failed, 120 passed, 62 subtests passed. This head is far worse than main on this file, not 24-from-58.The body also says "The 24 red tests are red on this branch and were red before
it". The first half is now false, and the second half does not hold either -- main
runs 5, not 24.
What this means. The restore this branch performs has since been superseded:
upstream repaired the anchor rot that made 39 stale + 5 broken the interesting
number, so the headline evidence for the branch no longer distinguishes it from
main. The selective-splice concern (
test_checker_keeps_preexisting_citation_line_floorwants >= 2446 lines; the splice reaches 1969) is the part of this body most likely
to still be actionable, and it is worth re-measuring against current main before
anyone re-reviews.
No C++ was built and no test binary was run here beyond the Python test file above.
Correction to my own audit note (measured 2026-10-04, CI-parity method)
One row of the section above was measured in a tainted local environment and is
withdrawn here. The method error:
check-agent-record.pyharvests issuereferences from
merge-base(origin/main, HEAD)..HEADcommit bodies(
branch_issue_references()), and my local checkout'sorigin/mainpointed ata stale fork tip (
1de097c46). The inflated range swept in upstream historywhose commit bodies reference nine
_intakerecords and four fixture-only IDs(
ISSUE-GH-7,ISSUE-GH-8,ISSUE-GH-77, oneISSUE-LOCAL-...), producing13 phantom errors CI never sees — CI runs with
origin/mainat the branchbase, which yields a small range. Re-measured with
origin/maintemporarilypointed at
upstream/main(and restored afterward), at the same audited head:706da8536check-agent-record.pyis rc=0 with and without--report" called rc=1 both ways, 13 errorsagent record OK: ENGINE=179 MODEL=384 QUANT=87 KERNEL=60 BACKEND=90 ANCHOR-ROT=0. The body's only claimed pass is a pass; the sentence above calling it not-a-pass is withdrawn.test_agent_record.pycalled 71 failed vs main's 5, "far worse than main"upstream/main. Neither the body's "24 remaining" nor my 71 describes this head; the real delta against main is zero.Standing as written: the
--reportanchor figures (ok=1018, stale=0, broken=0against the body'sok=974, stale=39, broken=5),stale 0on thishead and on main, and the supersession analysis built on them.
FOLLOWING_AGENTS_PROTOCOL
Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:codebuff/buffy [freebuff]