Skip to content

Commit 56a1fe5

Browse files
committed
test(metadata-protocol): the hydrated flow body's _packageId is the column since #28594
Main's #28671 (#28594) made storedOverlayEntries serve a stored row's _packageId from its package_id column and drop the body's own stamp, so the hydration pin that expected the body stamp on the registry body now reads the pair. The assertion follows main's column-wins rule; the storedRowBindingOf and not-serialized assertions, the #28412 binding contract, are unchanged. The stored-row-binding header no longer says the hydrated body keeps the stored stamp. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent bac10f7 commit 56a1fe5

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

‎packages/metadata-protocol/src/protocol.flow-stored-row-shipped-name.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,10 @@ describe('[#28412] the flow view admits exactly the shipping package\'s declared
280280
await protocol.getMetaItemsForExecution({ type: 'flow' });
281281
const hydrated = registry.bare('flow', SHIPPED)!;
282282
expect(storedRowBindingOf(hydrated)).toBe(PAIR);
283-
expect(hydrated._packageId).toBe(PACKAGE_ID); // the body's own stamp, kept and never read for the binding
283+
// [#28594] The served stamp is the column too (`storedOverlayEntries`
284+
// replaces the body's own `PACKAGE_ID` stamp); the binding above is
285+
// still read from the symbol, never from this enumerable key.
286+
expect(hydrated._packageId).toBe(PAIR);
284287
expect(JSON.parse(JSON.stringify(hydrated))).not.toHaveProperty('storedRowBinding');
285288

286289
const packageless = harness([storedRow('flow', SHIPPED, flowBody(SHIPPED, 'STAMPED', { ...DECLARED, _packageId: PAIR }))]);

‎packages/metadata-protocol/src/stored-row-binding.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
*
66
* A stored `sys_metadata` row is bound to a package by its `package_id`
77
* COLUMN. The body the protocol hydrates into the SchemaRegistry for it
8-
* (`hydrateOverlayIntoRegistry`) carries no trustworthy copy of that column:
9-
* `_packageId` on such a body is whatever the stored bytes said, or the column
10-
* when they said nothing (`withRowBinding` keeps a body's own stamp). A body
11-
* can carry a `_packageId` copied from a read of the base package, so a stamp
12-
* names the base while the row belongs to another package (the shape #28238
13-
* measured), and a package-less row can carry a stamp naming a package it is
14-
* not bound to.
8+
* (`hydrateOverlayIntoRegistry`) states it as `_packageId` since #28594
9+
* (`storedOverlayEntries` serves the column and drops a body's own stamp),
10+
* but `_packageId` is still no proof of the column: it is an ordinary JSON
11+
* key, so a stored body, a request body or an import can carry one copied
12+
* from a read of the base package (the shape #28238 measured), and every
13+
* writer that does not go through that reader keeps it (`withRowBinding`
14+
* keeps a body's own stamp).
1515
*
1616
* ADR-0146 D9 item 1 arms a flow over the code package's name only when the
1717
* row that declares it is bound to the base's paired `<base>.custom` — by the

0 commit comments

Comments
 (0)