Skip to content

docs-drift swept the file and missed a stale 124 — the detector matches phrasings, so its denominator counts files read, not claims checked #603

Description

@serge-ivo

A stale tool count survived a green gate in the file the gate swept — the detector matches phrasings, not claims

scripts/lib/mcp-split.mjs (#575) checks always-on/gated claims against MCP_TOOL_ALWAYS_ON / MCP_TOOL_GATED. Its success line reports 40 swept (3 required to state it).

workers/mcp/AGENTS.md is in that swept set. Line 15 says:

"18 of the 124 registrations are gated"

Actual: 19 of 136. The phrasing did not match the detector's pattern, so the file was swept, matched nothing, and passed. pnpm docs:drift reports all 13 checks green with that sentence present.

This is the file whose entire job is to be the calling agent's contract, and it has been telling every agent the wrong surface size.

This is the second instance of the same defect class today

#600state-vocabulary.ts's scanner returned [] for the two health descriptions that had actually drifted, because it reads (a/b/c) and backtick chains while those wrote `working` (gloss), `waiting` (gloss)the shape a good description uses. The claim was never in the denominator, so no inventory entry could record it.

Same shape here: the denominator is "files swept", not "claims found", so a claim the detector cannot parse is invisible and indistinguishable from a file that makes no claim. Both guards report a healthy-looking number over a population that silently excludes the thing they exist to catch.

That is an ADR 0002 violation inside guards written to enforce ADR 0002: the success line states what was read, not what was checked.

Why "just widen the regex" is the wrong answer

#600's agent measured exactly that for the vocabulary scanner: 8 candidates over the surface, 6 false positives (result field names, write/destructive, a pair of tool names), and on the very description in question it recovered only two of four values. It chose generation over detection, which is that file's own stated doctrine.

The same is available here: MCP_TOOL_COUNT and MCP_TOOL_ALWAYS_ON are already constants. A doc could render them rather than restate them, or the check could assert that a file mentioning tool counts at all matches some known pattern — a shape requirement rather than a broader match.

Acceptance criteria

  1. workers/mcp/AGENTS.md:15's claim is caught by a gate. Demonstrated red before the number is fixed (Agent-facing docs state four numbers the code disproves, and root AGENTS.md predates the output-schema change its first recipe depends on #602 fixes the number; this issue makes it catchable).
  2. The success line states claims found, not files swept — or states both, distinguishing "no claim" from "claim not parsed". This is the load-bearing change.
  3. A file in the swept set that mentions a guarded quantity in a shape the detector cannot parse fails rather than passing silently. If that produces false positives, report the count and rate rather than widening quietly.
  4. Denominator per ADR 0002, and the same audit applied to mcp-split.mjs's sibling checks — the "N tools" check reported 5 claims in 39 files, which is the right shape; establish whether the others are.
  5. Consider whether The vocabulary inventory's own citations are unchecked — three name files or symbols that do not exist #600's finding and this one warrant one fix. They are the same defect in two detectors, and two separate widenings is how a third appears.

Verified vs inferred

  • Verified: AGENTS.md:15's text; tool-count.ts's constants; that docs:drift passes all 13 checks with the stale sentence present; mcp-split.mjs's 40 swept (3 required) output; The vocabulary inventory's own citations are unchecked — three name files or symbols that do not exist #600's measurement of the vocabulary scanner.
  • Inferred: that the phrasing is why it was missed, rather than an exclusion elsewhere in the sweep. The file is in the swept set and the number is wrong and the gate is green — but the detector was not stepped through against this line. Confirm that before fixing; if the cause is an exclusion instead, the fix is different.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions