Skip to content

[finding] Non-door getMetaItems helper call sites in rest-server.ts still cast, though the declared surface + transport envelope now cover them #9805

Description

@os-elon

Observed while implementing #9741 (declare previewDrafts/state, retire the as any casts at the four REST meta-read doors). Recording the residue outside that card's named scope rather than widening it.

The observation

#9741 retired the request casts at the doors the card named (list, cached and uncached single-item, layered) and introduced a typed transport envelope (TransportScopedMetaRequest in packages/rest/src/rest-server.ts) for the transport-level environmentId. Several OTHER getMetaItems call sites in the same file still call through as any (or a p: any parameter) even though every member they thread is now expressible with the declared spec shape plus that envelope:

  • loadObjectItems(p as any).getMetaItems?.({ type, environmentId? }); note getMetaItems is a REQUIRED member of MetadataProtocol, so the optional-call spelling is not feature detection either;
  • fetchAudienceBooksp: any with an as any request literal threading environmentId;
  • the discovery-scoping object listing and the api listing (protocol?.getMetaItems?.(...) sites around the discovery route);
  • the dataset listing door — (p as any).getMetaItems?.({ type: 'dataset', previewDrafts }).

Not asserted: no behavioural defect and no undeclared members — after #9741 these literals carry only declared keys plus environmentId. This is purely retirable blindness: each cast keeps the compiler from checking a request that is now fully typeable. Genuinely feature-detected server-only verbs (getMetaDiagnostics, listDrafts, migrateStoredMetadata, ...) are NOT part of this observation — runtime casts are the documented convention for those.

Repo: objectstack. File: packages/rest/src/rest-server.ts. Related: #9741 (the ruling and the envelope; not addressed further there — its card named the four doors only), #9726.


Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions