Skip to content

The record-anchor symbol test accepts a COMMENT that names the symbol, so a citation 70 lines off its declaration reads OK — and the two-way ratchet then forces the next commit to bank a repair nobody made #1287

Description

@localai-bot

The record-anchor ratchet (ENG-RECORD-ANCHOR-RATCHET, #632) classifies a citation
STALE when the cited lines do not contain the symbol named beside it. The test is a
substring search over those lines. A comment that mentions the symbol therefore
satisfies it, so a citation can pass while pointing nowhere near the thing it names.

The live instance

KERNEL-ATTN-MLA-SPARSE cites include/vllm/v1/attention/backend.h:271 for
get_kv_cache_shape. The file is 431 lines. Line 271 is a comment:

// Upstream rocm_attn.py:247-256 (`get_kv_cache_shape`) returns

The real declaration is 70 lines further down, at :341:

  std::vector<int64_t> get_kv_cache_shape(
      int64_t num_blocks, int64_t block_size, int64_t num_kv_heads,

Drift on main moved that ROCm comment onto :271. The citation now reads OK, and
nothing repaired it. .agents/specs/record-anchor-ratchet.md §Our baseline records
this honestly as a measured limit of the conservative rule rather than as a repair,
and that framing is right: separating a declaration from a comment needs a parser per
language, which is the cry-wolf trade the whole design refuses
(scripts/check-agent-record.py, the WHERE THE CONSERVATIVE LINE IS DRAWN block).

So this is not a request to tighten the symbol test by parsing. It is a request to make
the false negative visible, because of what it costs downstream.

The second-order cost, which the spec does not currently draw out

The ratchet fails in both directions. A bucket above its baseline fails, and a bucket
below it fails too, with the instruction to lower the baseline in the same commit as the
repair that earned it. That rule exists so improvements are banked rather than silently
absorbed, and it is correct as long as a fall means a repair.

A fall does not always mean a repair. Unrelated drift that parks a comment naming the
symbol on a cited line lowers the count with no work done, and the next contributor to
touch the tree is then forced to bank an improvement that never happened. The banked
number is permanent, because the baseline only ever moves down.

This is not hypothetical. It happened while row/anchor-ratchet-impl merged main:

  • 72bd06a5a (record(ROAD-V1-C6), record(ROAD-V1-C6): punch-list item 9 asks for a lever the project refuted and a flip that landed 10 days before the item was written #535) is a record reconciliation that touches no
    src/, include/ or tests/ file. It rewrote the SERVE-ASYNC-LLM row and replaced
    the citation `examples/server/main.cpp:230-247` with a bare
    `examples/server/main.cpp`.
  • That citation was BROKEN (the file is 23 lines). Dropping the line number did not
    repair it; it removed the anchor, so the ratchet stopped counting it.
  • broken fell 7 to 6. The ratchet then went red on the fall, and the merge commit had
    to lower the baseline to 6 to go green — banking an improvement nobody made, on a row
    that had nothing to do with SERVE-ASYNC-LLM.

The same mechanism runs through the STALE bucket via the comment case above, and there
it is harder to see, because the citation still looks anchored.

What would close this

Not a per-language parser. Candidates, in increasing cost:

  1. --report marks a citation whose only match is inside a comment, so the false
    negative is legible without changing any verdict or count.
  2. --write-baseline refuses, or warns loudly, when the fall is not attributable to a
    citation the same commit edited. That is the property actually wanted: a bank should
    name the repair that earned it.
  3. A cheap non-parser heuristic, for example preferring a match on a line that is not
    inside a // or # prefix when the file offers both.

None of these is in scope for #632, which lands the ratchet itself.

Not a duplicate

Owning row: ENG-RECORD-ANCHOR-RATCHET.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions