| @objectstack/rest | patch |
|---|
GET /api/v1/meta/:type/:name/references: both of the door's 501 refusals now answer the same ADR-0112 nested envelope, and the unanswerable-target refusal keeps the prescriptive message ADR-0110 D3 requires of it.
The route can refuse in two ways, and the two answers agreed on neither the envelope nor the message:
A the protocol cannot answer for this TARGET type (a `field`)
501 {"error":"Internal server error","code":"NOT_IMPLEMENTED"}
B the resolved kernel has no `findReferencesToMeta` at all
501 {"error":{"code":"NOT_IMPLEMENTED","message":"protocol.findReferencesToMeta() is not available in this kernel"}}
A now answers in B's shape, carrying the producer's own sentence:
501 {"error":{"code":"NOT_IMPLEMENTED","message":"[unanswerable_target] References to a 'field' item cannot be computed. … Ask the owning object instead: GET /api/v1/meta/object/account/references."}}
Why the message matters more than it looks. This door backs the admin "Used by" panel, whose empty case renders "Nothing in the metadata graph points at this item. Safe to delete." to an operator whose next click is a delete. A field target can never MATCH a reference site — fields are addressed by the composite <object>.<field> key while every property naming one holds the bare name — so the protocol refuses instead of answering an empty list, and its message names the question that IS answerable: ask the owning object. Relayed as "Internal server error", that instruction never reached the operator.
Two consequences for a caller:
body.error.codenow readsNOT_IMPLEMENTEDon both refusals; the top-level siblingbody.codethis route used to answer on refusal A is gone.@objectstack/clientreads either position, soerr.codeis unchanged for SDK callers;err.messageimproves fromInternal server errorto the prescriptive sentence. A raw HTTP caller branching onbody.codefor this route's 501 should readbody.error.code, which is what the route's other refusal has always answered.- Nothing else on the door moves. A genuine server fault reaching this route — the 503 a
sys_metadataoutage raises — keeps its withheld generic message and its flat body, and 200 answers are untouched.