Skip to content

Commit 9910fbc

Browse files
committed
fix(metadata-protocol): declare and pin the list cell where a platform action sits at a key no package binds
The list slot fix also lists a platform action of a name (no package, no stored row) beside a package's action of the name on another object, or object-less, where main dropped it (b61bcd2 moved the bound cells, 73c2de8 the object-less one). The changeset bullet and the environment-action-on-another-object-answers-first entry now name it, FROM and TO, and three pins plus a CONTROL hold it. Claude-Session: https://claude.ai/code/session_01ADHkmQmQ1jpFsNcARMbY56 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 73c2de8 commit 9910fbc

3 files changed

Lines changed: 37 additions & 11 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, with no package-less row of the name. 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, a disabled one counted** (#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 (or object-less) 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-
- **The merged action list where a package binds the object** (#33904, ADR-0150 D4). The list now slots an action at its `(package, objectName, name)` key wherever a package's action of the name binds the object, object-less being a key of its own. Two cells move with no environment-own action. Two packages hold the name on two objects and a package-less row is stored on one: FROM the row listed under both packages and the second package's own action dropped, TO the row listed under its object's package and the second package's own action listed. A list scoped to a package whose action is bound to one object, beside the environment's row on another: FROM that package's slot serving the environment's row, TO its own action. Where no package holds the name, the list slots by name as before.
18+
- **The merged action list where a package binds the object** (#33904, ADR-0150 D4). The list now slots an action at its `(package, objectName, name)` key wherever a package's action of the name binds the object, object-less being a key of its own. Three cells move with no environment-own action. Two packages hold the name on two objects and a package-less row is stored on one: FROM the row listed under both packages and the second package's own action dropped, TO the row listed under its object's package and the second package's own action listed. A list scoped to a package whose action is bound to one object, beside the environment's row on another: FROM that package's slot serving the environment's row, TO its own action. A platform action of the name (no package, no stored row) on one object, or object-less, beside a package's action on another object, or object-less: FROM the platform action dropped, TO both listed. Where no package holds the name, the list slots by name as before.
1919
- **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.
2020

2121
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.

‎packages/metadata-protocol/src/protocol.action-list-slot-key.test.ts‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
* Each cell names its FROM (the list slotted every action by name) and its TO.
1010
* A package-less row on a package's object is that package's customization
1111
* and shares its slot; a package-less row on no package's object is the
12-
* environment's own item and is listed beside the packages'. Package-less
12+
* environment's own item and is listed beside the packages', as is a platform
13+
* action (no package) at a key no package's action binds. Package-less
1314
* contributions with no package holding the name keep one slot, which the
1415
* action route reads as the platform item's key
1516
* (runtime `action-package-addressing.test.ts`).
@@ -63,7 +64,27 @@ describe('[#33904] the list slots an action at its key where a package binds the
6364
expect(listed(out)).toEqual([['p', 'account', 'P'], ['env', null, null]]);
6465
});
6566

67+
it('a platform action (no package) on `lead`, a code package\'s OBJECT-LESS action: both listed (BASE, on `main` and the first list fix: P\'s item only)', () => {
68+
const out = mergePackageAwareOverlay('action', [action('platform', 'lead'), action('p', undefined, 'P')], []);
69+
expect(listed(out)).toEqual([['platform', 'lead', null], ['p', null, 'P']]);
70+
});
71+
72+
it('a platform action on `lead`, a code package on `account`: both listed (BASE: P\'s item only)', () => {
73+
const out = mergePackageAwareOverlay('action', [action('platform', 'lead'), action('p', 'account', 'P')], []);
74+
expect(listed(out)).toEqual([['platform', 'lead', null], ['p', 'account', 'P']]);
75+
});
76+
77+
it('an OBJECT-LESS platform action, a code package on `account`: both listed (BASE: P\'s item only)', () => {
78+
const out = mergePackageAwareOverlay('action', [action('platform'), action('p', 'account', 'P')], []);
79+
expect(listed(out)).toEqual([['platform', null, null], ['p', 'account', 'P']]);
80+
});
81+
6682
describe('CONTROLs (unchanged)', () => {
83+
it('a platform action on the object a package binds shares its slot', () => {
84+
const out = mergePackageAwareOverlay('action', [action('platform', 'lead'), action('p', 'lead', 'P')], []);
85+
expect(listed(out)).toEqual([['p', 'lead', 'P']]);
86+
});
87+
6788
it('a package-less row on the object a package binds is its customization', () => {
6889
const out = mergePackageAwareOverlay('action', [action('p', 'account', 'P')], [row(action('env', 'account'))]);
6990
expect(listed(out)).toEqual([['env', 'account', 'P']]);

‎packages/spec/src/migrations/entries/semantic/19.environment-action-on-another-object-answers-first.ts‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ import type { SemanticMigration } from '../../types.js';
1111
// name neither a package nor an object took the package's. Object-less is a
1212
// key of its own on both sides. The merged list slots an action at that key
1313
// wherever a package's action of the name binds the object, which also moves
14-
// two list cells with no environment-own item: a package-less row on one
14+
// three list cells with no environment-own item: a package-less row on one
1515
// package's object is listed as that package's customization only (it was
1616
// listed under every package of the name, and another package's own action
17-
// of the name was dropped), and a list scoped to a package lists the
18-
// package's own action rather than the environment's row on another object.
19-
// No key is added,
20-
// removed or re-shaped and no stored row changes shape, so no tombstone and
17+
// of the name was dropped); a list scoped to a package lists the package's
18+
// own action rather than the environment's row on another object; and a
19+
// platform item of the name (no package, no stored row) at a key no
20+
// package's action binds is listed beside the package's action (it was
21+
// dropped). No key is added, removed or re-shaped and no stored row changes shape, so no tombstone and
2122
// no D2 conversion. No relevance question: the move turns on which installed
2223
// packages hold a name, which no question over one stack can name.
2324
export const entry: SemanticMigration = {
@@ -31,20 +32,24 @@ export const entry: SemanticMigration = {
3132
+ 'DELETE /api/v1/meta/action/NAME naming no package. Also the merged action list, with no such environment '
3233
+ 'action, where two packages hold the name on two objects and a package-less row is stored on one of them, '
3334
+ 'and the list scoped to a package (GET /api/v1/meta/action?package=PACKAGE) whose action of the name is bound '
34-
+ 'to one object while the environment\'s row is on another',
35+
+ 'to one object while the environment\'s row is on another, and the merged list where a platform action of the '
36+
+ 'name (no package) is on an object, or object-less, while every package\'s action of the name is on another '
37+
+ 'object or object-less',
3538
replacement:
3639
'To read or delete the package\'s action, name the package: GET or DELETE /api/v1/meta/action/NAME?package=PACKAGE '
3740
+ 'reads or removes that package\'s action, as before. The reads that name no package serve the environment\'s '
3841
+ 'action (its version too), the list names both actions, and the delete that names no package removes the '
3942
+ 'environment\'s row and leaves the package\'s. In the list, a package-less row on one package\'s object is that '
4043
+ 'package\'s customization only, and the other package\'s own action is listed again; the list scoped to a '
41-
+ 'package lists that package\'s own action, and the environment\'s row on another object is read naming no package.',
44+
+ 'package lists that package\'s own action, and the environment\'s row on another object is read naming no package. '
45+
+ 'A platform action at a key no package\'s action binds is listed beside the package\'s; read it by its object '
46+
+ '(the action route) or override it in the environment.',
4247
reason:
4348
'The environment\'s own item answers first, and reads and writes give the same answer (ruling 6942962369). The '
4449
+ 'plain read, /layers effective and /published served the package\'s action, the list slotted actions by name and '
4550
+ 'named the package\'s only (so a package-less row on one package\'s object was also listed under every other '
4651
+ 'package of the name, in place of that package\'s own action, and stood in for a scoped list\'s package on '
47-
+ 'another object), and the bare delete removed the package\'s row and left the environment\'s, while '
52+
+ 'another object, and a platform action at another key was dropped from the list), and the bare delete removed the package\'s row and left the environment\'s, while '
4853
+ 'the save door and the action route keyed the two apart. There is no mechanical rewrite: which action a caller '
4954
+ 'meant is a judgement about that caller.',
5055
acceptanceCriteria:
@@ -53,5 +58,5 @@ export const entry: SemanticMigration = {
5358
+ 'delete that names no package removes only the environment\'s row, after which the reads that name no package '
5459
+ 'answer the package\'s action. With two packages on two objects and a package-less row on one, the list names '
5560
+ 'the row under that package and the other package\'s own action; a list scoped to a package names its own '
56-
+ 'action.',
61+
+ 'action; a platform action at a key no package\'s action binds is listed beside the package\'s.',
5762
};

0 commit comments

Comments
 (0)