Skip to content

Commit 460df4a

Browse files
committed
test(objectql): the package-less row is written as the store writes it, and the exact read of a member the holder ships refuses beside it (R3-A)
The fixture wrote the canonical member's package-less row as bundle_member 'en-US'; the store spells the canonical member NULL (overlayMemberValue), so the read never found it and the pin asserted the registry's answer. Written as stored, ?package=A for a member A ships answers 409 ambiguous-in-closure naming both holders, while A's list and the send's read serve A's own (epic ruling 6792134290). Claude-Session: https://claude.ai/code/session_01QSeKYm8sWjp2Pk76warN7w Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4668d9e commit 460df4a

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

‎packages/objectql/src/package-scoped-exact-qualifier.test.ts‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,12 @@ describe('[#31699] a package-less row of a name two packages hold is no holder\'
853853
name: 'welcome', label: `${packageId.split('.').pop()} ${locale}`, locale,
854854
subject: `${packageId.split('.').pop()} ${locale}`, bodyHtml: '<p>x</p>',
855855
}, 'name' as never, packageId);
856+
// The row as the store writes it: the canonical member (`en-US`) is
857+
// `bundle_member: null`, never its value (`overlayMemberValue`,
858+
// metadata-protocol `migrations/overlay-index.ts`); any other member, its value.
856859
const envRow = (locale: string) => rows.push({
857-
id: `env_${locale}`, type: 'email_template', name: 'welcome', state: 'active', package_id: null, bundle_member: locale,
860+
id: `env_${locale}`, type: 'email_template', name: 'welcome', state: 'active', package_id: null,
861+
bundle_member: locale === 'en-US' ? null : locale,
858862
metadata: JSON.stringify({ name: 'welcome', label: `env ${locale}`, locale, subject: `env ${locale}`, bodyHtml: '<p>e</p>' }),
859863
});
860864
const read = (packageId: string, member: string) => protocol.getMetaItem({
@@ -923,15 +927,21 @@ describe('[#31699] a package-less row of a name two packages hold is no holder\'
923927
});
924928
}
925929

926-
it('a member the holder itself ships, beside a package-less row of a name two packages hold: the exact read and the holder\'s list both serve the holder\'s own shipped member, never the row (R2-B)', async () => {
930+
// [contract review R3-A; epic ruling 6792134290, answer 2 as first given]
931+
// The package-less canonical row, stored as the store stores it, is the
932+
// member the exact read of the holder's own shipped member reaches: it is
933+
// refused, as at a member the holder does not ship. The list and the send
934+
// keep serving the holder's own, the row withheld (the ruled split).
935+
it('a member the holder itself ships, beside a package-less row of a name two packages hold: the exact read refuses 409 naming both; the holder\'s list and the send\'s read serve its own shipped member, the row withheld (R3-A)', async () => {
927936
tpl('en-US', A);
928937
tpl('en-US', B);
929938
envRow('en-US');
930939
for (const [at, own] of [[A, 'alpha en-US'], [B, 'beta en-US']] as const) {
931-
const answer = await read(at, 'en-US');
932-
expect(labelOf(answer), at).toBe(own);
933-
expect((answer as { item?: { _packageId?: string } }).item?._packageId, at).toBe(at);
940+
const err = await refusalOf(() => read(at, 'en-US'));
941+
expect([err.code, err.status, err.refusal.reason], at).toEqual(['RESOURCE_CONFLICT', 409, 'ambiguous-in-closure']);
942+
expect(err.refusal.candidates, at).toEqual([{ kind: 'package', packageId: A }, { kind: 'package', packageId: B }]);
934943
expect(await listed(at), at).toEqual([own]);
944+
expect(await forSend(at), at).toEqual([own]);
935945
}
936946
});
937947

0 commit comments

Comments
 (0)