Skip to content

[finding] endpoint-publish-gate.ts's consumer table names two symbols that do not exist — cacheControlHeader and endpointRateLimiterRegistry, both renamed in endpoint-policy.ts #13040

Description

@os-trump

Found while re-closing api.cacheTtl's liveness citation for #13003 batch 3 (PR #13039). Not fixed there: that batch's declared file surface is packages/spec/liveness/*.json only, and this is a source edit.

What

packages/spec/src/api/endpoint-publish-gate.ts:31 carries a docblock table mapping each publish-gate concern to the runtime that enforces it. Its policy row reads:

 * | policy (armed-but-unusable `rateLimit`, negative `cacheTtl`, `cacheTtl` off GET) | `endpointRateLimiterRegistry` / `cacheControlHeader` — `packages/runtime/src/endpoint-policy.ts` |

Neither name is a symbol. Measured on origin/main at 9ee2dcfbd:

Named Actually
cacheControlHeader computeCacheControl (endpoint-policy.ts:252)
endpointRateLimiterRegistry createEndpointRateLimiterRegistry (endpoint-policy.ts:130)

grep -rn '\bcacheControlHeader\b' packages/ returns exactly two hits: this line, and the api.json liveness entry that had copied the same stale name (fixed in PR #13039). grep -rn '\bendpointRateLimiterRegistry\b' packages/ returns exactly one: this line.

Why it is worth a row rather than a shrug

It is small, and it is the same defect class the liveness worklist exists for, one layer over: a pointer written as prose, correct when written, silently falsified by a rename, with nothing that can see it. The liveness gate would have caught this if the table lived in a ledger evidence string — check:liveness resolves paths and, since #12516, symbol anchors. A docblock gets no such check, so this row has been naming a function that does not exist for however long the rename is old.

The cost today is a reader (human or AI) grepping for cacheControlHeader in endpoint-policy.ts, finding nothing, and concluding the enforcement is missing. That is exactly backwards: the enforcement is real and green.

Disposition — not judged here

Two shapes, neither obviously right:

  1. Just correct the two names. A two-word edit. Restores the table's truth and buys nothing against the next rename.
  2. Make the table checkable. The repo already has a grammar for a falsifiable pointer (path#symbol, [finding] A liveness citation can rot IN RANGE: action.target and action.requiredPermissions point at the wrong lines one day after being repointed, and every check stays green #12516) and a gate that resolves it. A doc-comment convention plus a lint that resolves path#symbol inside packages/spec/src/** docblocks would cover this class, not just this instance — but that is a new gate with its own false-positive population to measure, which is the [finding] A liveness citation can rot WITHIN its file — 14 measured candidates the new line bound structurally cannot see, incl. permission.objects.allowExport citing a symbol that moved repos-internally #11457 caution.

Left unassigned and unlabelled beyond finding for triage.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions