Skip to content

Commit 52e2569

Browse files
committed
test(objectql): the publish plan read names the publishing package (#29414)
The two objectql capture-read pins held the plan read's old shape { type, name, state }; publishPackageDrafts now scopes it with package_id: request.packageId, so each read carries the draft's package. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZ5jYNfPGLvPV8LYRe
1 parent 7a6e6cd commit 52e2569

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎packages/objectql/src/protocol-publish-package-drafts.test.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ describe('protocol.publishPackageDrafts (ADR-0033 / ADR-0067 D2)', () => {
157157
// one per draft, in draft order, each in the draft's own scope. (Reads
158158
// after these belong to the ADR-0038 L3 probes, which run post-commit.)
159159
expect(captureReads.slice(0, 3)).toEqual([
160-
{ type: 'object', name: 'course', state: 'active' },
161-
{ type: 'object', name: 'student', state: 'active' },
162-
{ type: 'view', name: 'course_list', state: 'active' },
160+
{ type: 'object', name: 'course', state: 'active', package_id: 'app.edu' },
161+
{ type: 'object', name: 'student', state: 'active', package_id: 'app.edu' },
162+
{ type: 'view', name: 'course_list', state: 'active', package_id: 'app.edu' },
163163
]);
164164
expect(promote).toHaveBeenCalledTimes(3);
165165
expect((promote.mock.calls[0][0] as any)).toMatchObject({ type: 'object', name: 'course' });
@@ -205,10 +205,12 @@ describe('protocol.publishPackageDrafts (ADR-0033 / ADR-0067 D2)', () => {
205205

206206
expect(res).toMatchObject({ success: true, publishedCount: 2 });
207207
// The capture ran for both items, in their own scope — this is what makes
208-
// the values below evidence rather than defaults.
208+
// the values below evidence rather than defaults. [#29414] The scope names
209+
// the publishing package: another package's row of the name is not the
210+
// item's pre-publish state.
209211
expect(captureReads.slice(0, 2)).toEqual([
210-
{ type: 'object', name: 'course', state: 'active' },
211-
{ type: 'object', name: 'student', state: 'active' },
212+
{ type: 'object', name: 'course', state: 'active', package_id: 'app.edu' },
213+
{ type: 'object', name: 'student', state: 'active', package_id: 'app.edu' },
212214
]);
213215
// One commit, carrying one entry per promoted item, each with the state
214216
// that was actually READ.

0 commit comments

Comments
 (0)