Skip to content

Commit 6c48c8e

Browse files
committed
test(metadata-protocol,objectql): the registerItem ledger records the stamped call, and the boot-order pin asserts the row's binding
The hydrator's registerItem now passes the body through withRowBinding, so the call-site ledger records that call text with its disposition unchanged. The boot-order no-op pin asserted _packageId absent because only an artifact graft could set it; the row's own binding now does, and _lock absent and _provenance org still prove no graft. Claude-Session: https://claude.ai/code/session_01P88ehrZ6hM19hBzdpsQTTo Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1b8c66d commit 6c48c8e

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎packages/metadata-protocol/src/protocol.register-item-call-sites.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ const SITES: ReadonlyArray<Site & {
9595
+ 'and a row bound to another package is refused (D9.9, OBJECT_OVERLAY_PACKAGE_MISMATCH)',
9696
},
9797
{
98-
member: 'hydrateOverlayIntoRegistry', args: 'type, mergeArtifactProtection(type, stateTenantAuthorship(data), envelope), \'name\' as any',
98+
// [#23233] The body carries the row's package binding (`withRowBinding`); the disposition is unchanged.
99+
member: 'hydrateOverlayIntoRegistry', args: 'type, mergeArtifactProtection(type, stateTenantAuthorship(withRowBinding(data, options.packageId)), envelope), \'name\' as any',
99100
disposition: 'yes, view only: skips a name another package ships',
100-
path: 'the list\'s hydration and the write-through on an unscoped kernel; the boot\'s loadMetaFromDb on every kernel',
101+
// [#23298] The write-through runs wherever the registry takes the kernel's stored rows.
102+
path: 'the list\'s hydration on an unscoped kernel; the write-through on an unscoped kernel and on an environment kernel that hydrated its own store; the boot\'s loadMetaFromDb on every kernel',
101103
why: 'a stored row: a view row bound to a package is not registered where another package ships its name, and the '
102104
+ 'reads answer it from its row; a package-less row, and every other type, register as before (#4624)',
103105
viewOnlyBy: 'const bound = canonicalType === \'view\' ? boundPackageOf(options.packageId) : undefined;',

‎packages/objectql/src/protocol-boot-hydration-scoped.test.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,13 @@ describe('loadMetaFromDb — ADR-0048 package-scoped protection graft at boot (#
149149
// it — `_provenance: 'org'`, the same one the `object` branch has
150150
// always stated — because every row this hydrator sees came out of a
151151
// `sys_metadata` write. That is a statement of authorship, not a graft
152-
// from an artifact: `_lock` and `_packageId` stay absent, which is what
153-
// this case is about.
152+
// from an artifact: `_lock` stays absent, which is what this case is
153+
// about.
154+
//
155+
// [#23233] `_packageId` is no longer absent: the hydrator states the
156+
// row's OWN package binding (its `package_id` column), as a list read
157+
// always did. That is read from the row, not grafted from an artifact —
158+
// which is why `_provenance` below stays `'org'` and not `'package'`.
154159
const registry = new SchemaRegistry({ multiTenant: false });
155160
registry.logLevel = 'silent';
156161
const rows = [
@@ -169,7 +174,7 @@ describe('loadMetaFromDb — ADR-0048 package-scoped protection graft at boot (#
169174
const direct: any = registry.getItem('page', 'home');
170175
expect(direct.label).toBe('B Home (customized)');
171176
expect(direct._lock).toBeUndefined();
172-
expect(direct._packageId).toBeUndefined();
177+
expect(direct._packageId).toBe(PKG_B);
173178
// [#16702] NOT `undefined` — the hydrator states tenant authorship.
174179
expect(direct._provenance).toBe('org');
175180
});

0 commit comments

Comments
 (0)