Skip to content

[finding] An evidence-based registrar route reaches 14 more client-bound rows and closes the storage ledger — but it redefines "registrar" to include Zod contract declarations, and admits 3 non-registrars #11857

Description

@os-steve

Measured while investigating #11178, and deliberately not landed there. #11178's premise was falsified (the auth surface is unreachable because it has no in-repo registration site at all, not because discovery misses one), so the evidence route below does not serve that card — but it is a real, measured improvement to a different population, and it carries a contract question that deserves its own ruling rather than riding along.

Filed unassigned and unlabelled for grading. ⛔ Not a claim on anyone's time.

What was measured

scripts/docs-audit/affected-docs.mjs discovers route registrars by filename convention:

REGISTRAR_FILE_RE=/(?:^|\/)(?:[\w.-]*route[\w.-]*|[\w.-]*-server)\.ts$/// :287

An additional admission route — admit any non-test packages/**/*.ts whose masked source yields ≥1 route tail through the real parseRegistrarSource — was implemented and measured on origin/main @ a6eca9223, then reverted (tree restored byte-identical under a trap … EXIT INT TERM, sha back to 839fe0c5).

readingbeforeafter
registrar files scanned1220
route tails produced4382
client-bound rows reachable4559
storage ledger unreachable7 of 70 of 7
i18n ledger unreachable3 of 31 of 3
runtime ledger unreachable65 of 6962 of 69
rest ledger unreachable46 of 8744 of 87
plugin-auth unreachable56 of 5656 of 56 (unchanged — see #11178)

No reach regression is possible in that direction by construction: selectsFrom is a some() over the tail list, so added tails can only add selections. Every observed per-ledger unreachable count fell or held.

The census probe was built from verbatim source slices of affected-docs.mjs (REGISTRAR_FILE_RE, LEDGER_FILE_RE, REGISTRAR_HANDLER_WINDOW, isTestFile, routeTailOf, parseRegistrarSource) rather than a re-implementation, and its positive control reproduces the live run exactly — 19 convention-matched files minus 7 ledgers = 12 registrar files, and 43 route tails, both identical to real --bridge-coverage output.

⚠️ Why this is a fork and not a free win

1. It redefines what a "registrar" is. Five of the eight newly-admitted files are packages/specZod API contract declarations, not registration call sites. Whether a contract declaration counts as a registrar for doc-nomination purposes is a real contract question with an argument on each side — the declaration is arguably the better source of truth, but the recognizer's name, its docblock and its --self-test all currently mean "the file that registers the route".

2. It admits three non-registrars, which a taker would have to hand-maintain or exclude:

filewhy it is not a registrar
packages/qa/dogfood/test/fixtures/endpoint-policy-fixture.tstest fixture
packages/spec/src/benchmark.bench.tsbenchmark
packages/spec/src/conversions/registry.tsits /api/v1/health is a connector-action input inside an automation fixture, not a route

Root cause for the first two: isTestFile excludes neither test/fixtures/*.ts nor *.bench.ts. That is arguably a defect in its own right and may be the cheaper half of this card.

3. It moves a published figure (45 → 59 reachable) that other cards cite. #10534's census and #9572's original 221→45 measurement both quote it; anything reading those numbers needs to know when they changed and why.

Not claimed

  • No opinion on whether A should land. The measurements are offered so the decision is made on numbers rather than on the shape sounding right.
  • Whether the 14 newly-reached rows actually produce useful doc nominations was not measured — only that they become reachable. Reach is necessary, not sufficient.
  • The three false positives were enumerated, not fixed.

Re-derivation recipe

Patch affected-docs.mjs to admit any non-test packages/**/*.ts whose masked source yields ≥1 tail via parseRegistrarSource, then run node scripts/docs-audit/affected-docs.mjs --bridge-coverage before and after. Confirm the probe first by reproducing 12 registrar files / 43 tails on the unmodified tree — if that control does not reproduce, the delta means nothing.

Refs

#11178 (where this was measured; premise falsified there) · #10534 (the census quoting 221/45) · #9572 (the original bridge measurement) · #9941 / #10050 (the incidents behind the bridge work)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions