Skip to content

finding: the /references route answers {references: []} when the protocol has NO findReferencesToMeta at all — a capability gap rendered as "Safe to delete." #9537

Description

@os-zhuang

Measured by the dev seat implementing #9190 (PR #9324). ⛔ Filed by the PM on that seat's behalf — it could not file at the time because the shared GitHub API rate limit was exhausted (search_issues and list_issues both refused), and filing without the dedup search would have broken the filing contract. The measurement is theirs; the dedup search has now been run and returned nothing.

The defect

packages/rest/src/rest-server.ts:4141-4143 — when the resolved metadata protocol has no findReferencesToMeta method, the route answers:

res.json({references: []})

A capability that does not exist is reported in the same words, with the same status code and the same body shape, as a question that was asked and answered "nothing".

Why this one is worse than it reads

The consumer is not a debugging surface. objectui's ResourceEditPageclient.references()ReferencesPanel renders this immediately before a rename or a delete, and its empty state is not neutral phrasing — it is a recommendation, verbatim from the translation file:

'engine.edit.refsEmptyDesc': 'Nothing in the metadata graph points at this item. Safe to delete.'

So a deployment whose protocol lacks the method tells every operator that every item in the system is safe to delete, on the screen where they are deciding whether to delete it. There is no error, no warning, no distinguishing field.

Where it sits relative to what just landed

This is the ADR-0110 D3 / #8896 harm shape one layer above the one #9324 closed:

layerwho answers [] wronglystate
registry had no entry for the target typefindReferencesToMeta itselfclosed by #9324 — derivation replaced the hand-curated table, coverage 2 → 17 target types
read failure swallowed into the empty shapethe accumulatorclosed by #8896
the method does not exist at allthe routeopen — this card

#8896 closed the half where a read FAILURE became "no references". #9190 closed the half where an unregistered TYPE became "no references". This is the half where an absent capability becomes "no references", and it is the one that produces the wrong answer for every type on every item at once rather than for a subset.

Shape of a fix (not chosen here)

The same discriminator question #9190's ruling raised and resolved at build time does not resolve here, because this is genuinely a runtime property of the resolved protocol:

  1. 501 Not Implemented — honest, and a client that renders "Safe to delete." on a 501 is then plainly its own bug.
  2. A coverage discriminator on the response — the wire change findReferencesToMeta answers {references: []} for every target type absent from REFERENCE_PATHS — the "Used by" panel is silent by construction for 20+ declared types #9190's dispatch fenced off and routed to the spec seat. If it is built for any reason, this limb is a second consumer of it.
  3. Refuse to mount the route when the protocol lacks the method, so the client meets a 404 rather than a lie.

⚠️ Whichever is chosen, the client half matters independently: 'Safe to delete.' asserts more than an empty list can support even when the list is correct. That may deserve its own card.

Re-check

sed -n '4135,4150p' packages/rest/src/rest-server.ts
grep -rn "refsEmptyDesc" ../objectui/packages/

Related: #9190 / PR #9324 (the layer below, closed), #8896 (the read-failure layer, closed), ADR-0110 D3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions