Skip to content

Commit fa7fb66

Browse files
committed
changeset: declare the two-holder layered read refusal as a narrowing
The no-engine REST /layers answer (200 with the first holder, now 409 with the holders as candidates) and the in-process getMetaItemLayered answer (first holder, now PackageScopedNameRefusedError) are narrowings of what a caller was served, so the changeset carries the narrowing arm, the BREAKING banner with both moves and the ADR-0087 disposition. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
1 parent 75f99bb commit fa7fb66

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎.changeset/32622-layers-two-holders-candidates.md‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@
33
'@objectstack/rest': patch
44
---
55

6-
fix(metadata-protocol, rest): the layered read of a name two packages hold refuses as the plain read does, naming the holders as `details.candidates` (ADR-0150 D3/D5)
6+
fix(metadata-protocol, rest)!: the layered read of a name two packages hold refuses as the plain read does, naming the holders as `details.candidates` (ADR-0150 D3/D5)
77

8-
Clause-②: no
8+
Clause-②: no (narrowing)
99
Metadata-protocol: none
1010

11+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export changes shape. The moved answers are reads of a name two packages hold, which now refuse as the plain read of that name already did: no stored row, layer, registry key or authored value changes, so there is nothing for a migration to rewrite and no tombstone. -->
12+
13+
**BREAKING** for a reader of the layers of a name two or more served packages register in code, naming no package. Such a name has no one holder (ADR-0150 D3/D5), and the plain read already refused it. Two answers move, measured in both registration orders:
14+
15+
- FROM: on a host that wires no engine for the REST door chain, `GET /meta/:type/:name/layers` (and `?layers=true`) answered 200 with the layers of the holder that registered first. TO: it answers `409 RESOURCE_CONFLICT` naming both holders as `details.candidates`.
16+
- FROM: in process, the protocol's `getMetaItemLayered({ type, name })` with no `packageId` resolved the holder that registered first. TO: it throws `PackageScopedNameRefusedError` (`RESOURCE_CONFLICT`, 409) naming both, as `getMetaItem` does.
17+
18+
**Not moved.** A name one package holds, and every read naming the package (`?package=`, `packageId`), answer as before. On a host whose door chain has an engine, `/layers` already refused 409; it now also names the holders. The save and delete doors do not move.
19+
20+
The fix for a caller: name the package whose layers it means.
21+
1122
`GET /meta/:type/:name/layers` (and the deprecated `?layers=true`) of a name two or more packages hold, read naming no package, now answers like the plain read on every exit and on both transports: `409 RESOURCE_CONFLICT` with the holders as `details.candidates` (`[{ kind: 'package', packageId }, …]`), never one holder's layers.
1223

1324
- A name two served packages register in code: the protocol's layered read (`getMetaItemLayered`) asks the registry's package-scoped resolver before it reads any layer, as `getMetaItem` does, so it throws the same `PackageScopedNameRefusedError` naming both, in process too, whatever the metadata service holds. It used to answer the holder that registered first, and so did the REST door on a host that wires no engine for its door chain. `?package=` still reads each holder's layers; a name one package holds is unchanged.

0 commit comments

Comments
 (0)