Skip to content

Commit b0e3f1d

Browse files
committed
docs(metadata-protocol): #34258's every-holder-disabled key beside an enabled holder elsewhere is declared as the narrowing it is
The changeset bullet and the ADR-0087 entry said that cell "still" answered 404; on main it answered 200, because the name's holders were judged. Each now gives its FROM 200 and TO 404, and the rest pin's title names its base. Two stale docblocks follow the code: the face's key-grain action judgment, and the HolderRegistry note above the two new refusals. Claude-Session: https://claude.ai/code/session_01ADHkmQmQ1jpFsNcARMbY56 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 10c011f commit b0e3f1d

5 files changed

Lines changed: 23 additions & 15 deletions

File tree

‎.changeset/34452-same-name-writes-and-hydration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Metadata-protocol: none
1515
- **A bare write beside a disabled package's row** (#34346). Two enabled packages ship the name and its stored rows are bound to a disabled package and to one shipper. FROM the bare publish save answering 200 and writing that shipper's row, and the bare draft save and delete refusing naming that shipper and the disabled package, TO all three refusing `409 RESOURCE_CONFLICT` naming the two shippers, as the bare read does, never the disabled package, and writing or removing nothing.
1616
- **A doc row hydrated after a restart beside two holders** (#34417, ruling 6942962369). FROM the row wearing the first registered holder's envelope, so `?package=FIRST` served the environment's row and every read naming no package refused 409, TO every read naming no package serving the environment's row and `?package=FIRST` serving that holder's own doc.
1717
- **The environment's own action on another object** (#33904, ADR-0150 D4). A package holds an action name on one object and the environment stores its own package-less action of the name on another. FROM the plain read, `/layers` and `/published` naming no package serving the package's action, the merged list naming only it, and the bare delete removing the package's row, TO those reads serving the environment's action, the list naming both, and the bare delete removing the environment's row.
18-
- **A package-less action row beside an enabled and a disabled holder on its object** (#34258). FROM the read naming no package answering 404 when the disabled holder registered first, TO 200 serving the row as the enabled holder's customization in both orders. A key whose every holder is disabled still answers 404.
18+
- **A package-less action row beside an enabled and a disabled holder on its object** (#34258). FROM the read naming no package answering 404 when the disabled holder registered first, TO 200 serving the row as the enabled holder's customization in both orders. And where every holder on the row's object is disabled while an enabled package holds the name on another object: FROM 200 serving the row (the name, not the key, was judged, and it had an enabled holder) TO 404, as a key whose every holder is disabled answers with no other holder of the name.
1919

2020
The registry's heal for a package-less overlay row whose every holder is disabled (#33127) now keeps it recorded with no holder, so enabling one holder rebuilds it under that holder's envelope; no door's answer moves.
2121

‎packages/metadata-protocol/src/protocol-meta-item-face.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ function isHoldersPairRow(engine: unknown, type: string, name: string, item: unk
140140
* (`overlayRowBinding`, every holder counted): `null` is the environment's
141141
* own item (D3 (a), no holder at its key, a same-name action on another
142142
* object included), served; one holder is withheld when it is disabled; two
143-
* or more are judged as the name's holders are ({@link disabledOnlyHolderOf}).
143+
* or more are judged as the name's holders are ({@link disabledOnlyHolderOf}),
144+
* except for an `action`, whose two or more are judged at its key
145+
* ({@link actionKeyHoldersOf}).
144146
* The row itself is untouched, so it is served again on re-enable.
145147
* `undefined` when the item is not such a row, or the registry cannot bind
146148
* one (optional-called: such a registry hides nothing more).

‎packages/metadata-protocol/src/protocol-save.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3702,7 +3702,6 @@ export function packagelessHolderRefusal(
37023702
: disabledHoldersOnlyRefusal(verb, shownType, name);
37033703
}
37043704

3705-
/** The registry reads {@link packagelessHolderRefusal} asks, each optional-called. */
37063705
/**
37073706
* The package-scoped resolver's own refusal of a name two or more ENABLED
37083707
* packages hold (`resolveItem` naming no package, the judgment the by-name
@@ -3774,6 +3773,7 @@ export function disabledRowHoldersRefusal(
37743773
return enabled.length > 1 ? packagelessAddressAmbiguityRefusal(verb, shownType, name, enabled) : undefined;
37753774
}
37763775

3776+
/** The registry reads {@link packagelessHolderRefusal} and the two refusals above ask, each optional-called. */
37773777
interface HolderRegistry {
37783778
readsByPackage?(type: string): boolean;
37793779
getEnvironmentScopedItem?(type: string, name: string, member?: string): unknown;

‎packages/rest/src/meta-qualified-item-route.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ describe('#33456 — the bare action read grafts a holder\'s envelope only at it
12721272
*/
12731273
describe('[#34258] the withhold of a package-less action row is judged at its key', () => {
12741274
const withC = () => registry.installPackage({ id: C, name: C, version: '1.0.0', type: 'app', namespace: 'gamma' } as never, 'code');
1275-
it('A and B disabled on `account`, C enabled on `contact`, the environment\'s row on `account`: withheld (404), in both orders', async () => {
1275+
it('A and B disabled on `account`, C enabled on `contact`, the environment\'s row on `account`: withheld (404), in both orders (BASE: served 200, the name judged with C enabled)', async () => {
12761276
for (const steps of bothOrders([() => shipAction(A, 'account'), () => shipAction(B, 'account'), () => shipAction(C, 'contact'), () => environmentAction('account')])) {
12771277
compose();
12781278
withC();

‎packages/spec/src/migrations/entries/semantic/19.package-less-action-row-judged-at-its-key.ts‎

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
import type { SemanticMigration } from '../../types.js';
44

5-
// A widening of the action read that names no package, not of any key:
6-
// ADR-0150 D3/D4 (#34258) has a package-less action row judged by the holders
7-
// at its own (object, name) key, and a disabled package holds no name. With
8-
// an enabled and a disabled package both holding the name on the row's
9-
// object, the row wore the envelope of whichever registered first, and the
10-
// read withheld it (404) when that was the disabled one. No key is added,
5+
// A widening and a narrowing of the action read that names no package, not
6+
// of any key: ADR-0150 D3/D4 (#34258) has a package-less action row judged by
7+
// the holders at its own (object, name) key, and a disabled package holds no
8+
// name. Widening: with an enabled and a disabled package both holding the
9+
// name on the row's object, the row wore the envelope of whichever registered
10+
// first, and the read withheld it (404) when that was the disabled one.
11+
// Narrowing: with every holder on the row's object disabled and an enabled
12+
// package holding the name on another object, the name's holders were judged,
13+
// so the row was served (200); judged at its key it is withheld (404). No key is added,
1114
// removed or re-shaped and no stored row changes shape, so no tombstone and
1215
// no D2 conversion. No relevance question: the move turns on which installed
1316
// packages are disabled, which no question over one stack can name.
@@ -16,19 +19,22 @@ export const entry: SemanticMigration = {
1619
surface:
1720
'GET /api/v1/meta/action/NAME naming no package, and the in-process item read with no packageId, for an action '
1821
+ 'name an enabled and a disabled package both hold on one object while the environment stores a package-less '
19-
+ 'action row of the name on that object',
22+
+ 'action row of the name on that object; and the same reads where every package holding the name on that '
23+
+ 'object is disabled while an enabled package holds it on another object',
2024
replacement:
2125
'None needed to read the customization: the read that names no package now serves the package-less row as the '
22-
+ 'enabled holder\'s customization, in both registration orders. A key whose every holder is disabled still '
23-
+ 'withholds its package-less row (404), whatever packages hold the name on other objects.',
26+
+ 'enabled holder\'s customization, in both registration orders. A key whose every holder is disabled now '
27+
+ 'withholds its package-less row (404) also when an enabled package holds the name on another object, where it '
28+
+ 'was served (200): to keep reading that row, enable a holder on its object or name the package that holds it.',
2429
reason:
2530
'A disabled package holds no name (ADR-0150 D3), and an action is keyed by (package, objectName, name) (D4). The '
2631
+ 'row borrowed the envelope of the first registered holder bound to its object, so with the disabled holder '
2732
+ 'registered first the read withheld the enabled holder\'s customization (404). Judged at the key, the one '
2833
+ 'enabled holder lends its envelope. There is no mechanical rewrite: the 404 came from one registration order '
29-
+ 'only, so no caller could rely on it.',
34+
+ 'only, so no caller could rely on it. The other cell judged the name, so an enabled holder on another object '
35+
+ 'kept serving a row whose own key had only disabled holders, against D3.',
3036
acceptanceCriteria:
3137
'For every such name while the disabled holder stays disabled, in both registration orders: the read that names '
3238
+ 'no package answers 200 the package-less row under the enabled holder; with every holder at the row\'s key '
33-
+ 'disabled it answers 404, an enabled holder on another object notwithstanding.',
39+
+ 'disabled it answers 404 (it answered 200 where an enabled package held the name on another object).',
3440
};

0 commit comments

Comments
 (0)