Skip to content

rest emits two error codes outside the closed ADR-0112 vocabulary — FIELD_VISIBILITY_UNRESOLVED has no ledger entry and no test anywhere #8885

Description

@qq9340100

Blocked-by: #8846

Filed unassigned by the dev seat working #8850, which moved the code that emits these. Not a claim, and not fixed under #8850 — that card is a no-behaviour-change move, and changing or registering a wire code is a behaviour question.

Measured on origin/main @ cc5c07b80

ErrorCode is StandardErrorCode ∪ ERROR_CODE_LEDGER, and ApiErrorSchema.code parses against exactly that union (#8846 restates this). Two codes the REST layer puts on the wire are in neither half:

codeemitted byin StandardErrorCode?in ERROR_CODE_LEDGER?
FIELD_VISIBILITY_UNRESOLVEDsendFieldVisibilityFault (ADR-0106 D6 tier 3), 503nono
RECORD_NOT_ACCESSIBLEmapDataError's comment-access branch (#4630), 403nono

Control, same measurement method: UNIQUE_VIOLATION, FEEDS_DISABLED, ERR_DATASOURCE_UNAVAILABLE and PROJECT_PROVISIONING are all present in the ledger — so the absence above is a real gap, not an artifact of where I looked.

RECORD_NOT_ACCESSIBLE is the more surprising one: its own source comment argues it uses "the STANDARD catalog code rather than a bespoke one (ADR-0112: generic permission conditions take the catalog)" — and it is not in the catalog.

The second half: FIELD_VISIBILITY_UNRESOLVED has zero coverage

A repo-wide search for the literal outside dist/ returns exactly two hits:

No test asserts it anywhere in the repo, in packages/rest or outside it. So an ADR-0106 D6 tier-3 refusal — the closed answer that exists specifically so an unhealthy security service cannot auto-open a disclosure hole — is advertised in the deployment docs and pinned by nothing. Prime Directive #10's shape: a documented capability with no proof it still fires.

This is measurement, not a claim that it is broken. It may work perfectly; nothing would notice if it stopped.

Why this is standalone rather than a sub-issue of #8846

#8846 registers "the set that #8087's gate reports", and that gate lives in packages/runtime over the dispatcher domains. It does not read packages/rest's emitters, so neither code above is inside #8846's completion scope. But the remedy lands in the same ledger file under the same ruling, so it should not be started before #8846 — hence the Blocked-by rather than a parallel edit of error-code-ledger.zod.ts.

Two questions the fix has to answer, not one

  1. Register or collapse. Registering widens the accepted set (spec: register the dispatcher conformance gate's reported error codes in ERROR_CODE_LEDGER (spec half of the #8087 ruling) #8846's standing constraint 2, with the model floor it carries). Collapsing RECORD_NOT_ACCESSIBLE onto the catalog's existing permission code may be the honest answer given its own comment says that was the intent — but it is a wire change and needs its own decision.
  2. Whichever is chosen, FIELD_VISIBILITY_UNRESOLVED also needs a pin — the ADR-0112 envelope minimum, codeandstatus (503), on the tier-3 path. A registration with no test leaves half the gap open.

⚠️ Worth a sweep rather than a two-line fix: these two were found incidentally while moving unrelated code, which suggests the population is larger than two. Report the number before registering it unexamined — the same instruction #8846 carries.

Refs: #8850 (where these were noticed), #8846 / #8087 (the ledger lane and the ruling), ADR-0112, ADR-0106 D6.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions