Skip to content

[finding] metadata.endpoints.items gates four routes — the _migrate-stored write door and the diagnostics sweep among them — while its declared meaning names only the type listing #15542

Description

@claude

Filed unassigned and unlabelled for triage, from the capability-coverage work on #14961 (PR #15541, which authors the checklist items for metadata_endpoints). Not that PR's change and not addressed there.

Measured on origin/main 6f944589

MetadataEndpointsConfigSchema.endpoints declares three live switches, and each one's describe() names exactly one route:

key its declared meaning
types GET /meta - List all metadata types
items GET /meta/:type - List items of type
item GET /meta/:type/:name - Get specific item

packages/rest/src/rest-server.ts#registerMetadataEndpointsInner gates more than that. Counting the if blocks in that method:

  • endpoints.types !== false gates 2 mounts — GET {prefix} and GET {prefix}/types (one handler, two paths, deliberately).
  • endpoints.items !== false gates 4 mounts — GET {prefix}/:type, and also GET {prefix}/diagnostics (the cross-type spec-validation sweep), GET {prefix}/_drafts, and POST {prefix}/_migrate-stored, which is a write door.
  • endpoints.item !== false gates 4 mounts — GET {prefix}/:type/:name, plus /:type/:name/references, /:type/:name/layers and GET {prefix}/book/:name/tree.

Why it is worth a decision

An operator who reads the schema and turns off "list items of type" — a read they may consider chatty or unnecessary — silently unmounts a migration write door and the diagnostics sweep with it. Nothing warns, and nothing in the declared contract says those routes ride that switch. That is the declared-vs-enforced asymmetry ADR-0049 is about, in the direction the ledger does not look: the key is genuinely live, so no liveness census flags it; what drifted is the key's radius versus its own documentation.

Options (not decided here)

  1. Document the real radius — extend each describe() to name what it gates. Cheapest; keeps every current behaviour.
  2. Give the extra routes their own switches (or move _migrate-stored and diagnostics under a separate key) — the authored key then means what it says. A spec change with a compatibility question.
  3. Rule it correct as-isitems is "the item-listing family, broadly" — and record that reading in the schema so the next reader does not re-derive this.

⚠️ Whichever way, note that RestServerConfig is not reachable from any shipped boot path today (filed separately), so the blast radius is currently limited to programmatic embedders.

Where it is already captured

docs/qa/platform-checklist/FOLLOW-UPS.md §10b E1, and as an acceptance clause on the new api-backend.rest-metadata-config-contract item, which requires a run to ENUMERATE each switch's real radius rather than trust the declared one.


Generated by Claude Code

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions