Skip to content

diff-verb-skips-the-canonical-fold: diffMetaItem answers an EMPTY diff for a manifest-absent type addressed with a plural #8868

Description

@hotlong

Measured while implementing #8819 (not fixed there — out of that card's declared region, which is rollbackMetaItem:15427:15587).

What was measured

#8769 routed publishMetaItem through canonicalizeMetaRequestType (the seventh /meta entry point); #8819 routed rollbackMetaItem (the eighth). diffMetaItem is a ninth entry point on the same URL family and does not funnel through it either — after #8819 lands it is the last straggler I can find on this family.

Measured on the #8819 branch at merge with origin/main20067c56b:

Reachable from the wire: GET /api/v1/meta/:type/:name/diff is a registered route with a caller-supplied :type (packages/rest/src/rest-route-ledger.ts:184, handler at packages/rest/src/rest-server.ts:6587).

The consequence, stated at its real width

For the four manifest-absent types — field, seed, external_catalog, translation, legitimately absent from PLURAL_TO_SINGULAR because they are not stack collections — the plural spelling stays plural all the way into the history query, which then matches no row. The endpoint answers a well-formed empty diff (added: [], removed: [], changed: []) rather than the real diff or a refusal. That is a silent "nothing changed" for an item that does have history, on a routed live endpoint, and the echoed type names a spelling the read did not actually use.

For manifest-present types (view and friends) the manifest map folds and the diff resolves correctly, so this is narrower than #8819's window.

Two smaller limbs, same cause:

Not the #8819 class

diffMetaItem is read-only: it takes no lock and performs no write, so there is no ADR-0010 gate to address around here and none of #8819's severity carries over. This is a wrong-answer defect, not a protection bypass. Filed separately rather than as a rider for that reason, and because the fix wants its own look at whether the echoed type should report the canonical spelling (which would change a response field consumers may read).

Backlink: #8819 · #8769 · the boundary fold's rationale is #7894.


Generated by Claude Code

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions