Skip to content

Commit 71dca74

Browse files
committed
test(dogfood): two older clone fixtures land the copy in a package
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pRVPsxnFxPBAQLUMh
1 parent 8a0ba37 commit 71dca74

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

‎packages/qa/dogfood/test/flow-credential-channel.dogfood.test.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,14 @@ describe('[#20790] flow credentials live in the write-only channel, not the stor
300300
],
301301
edges: [{ id: 'e1', source: 'start', target: 'end' }],
302302
});
303-
const plain = await stack.apiAs(token, 'POST', '/automation/zz_channel_plain_src/clone', { name: 'zz_channel_plain_copy', label: 'Copy' });
304-
expect(plain.status).toBe(200);
303+
// [#28149, ADR-0146 D4] No package ships this source, so it has no paired
304+
// customization package: its copy names the writable package it lands in.
305+
const pkg = await stack.apiAs(token, 'POST', '/packages', { id: 'com.dogfood.channel-plain', name: 'Channel plain', version: '1.0.0', type: 'app' });
306+
expect(pkg.status, await pkg.clone().text()).toBeLessThan(300);
307+
const plain = await stack.apiAs(token, 'POST', '/automation/zz_channel_plain_src/clone', {
308+
name: 'zz_channel_plain_copy', label: 'Copy', package: 'com.dogfood.channel-plain',
309+
});
310+
expect(plain.status, await plain.clone().text()).toBe(200);
305311
});
306312

307313
it('7 — with no crypto provider a save carrying a credential is refused before anything is written', async () => {

‎packages/qa/dogfood/test/flow-provenance-server-held.dogfood.test.ts‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ const SYSTEM_CTX = { isSystem: true, positions: [], permissions: [] };
7070
/** A package the showcase composition really loads — the claim a caller must not be able to make. */
7171
const REAL_PACKAGE = 'com.example.showcase';
7272
const ASSERTION = { _packageId: REAL_PACKAGE, _provenance: 'package' };
73+
/** [#28149] The showcase's paired customization package — where a clone of its flow lands. */
74+
const PAIR_PACKAGE = `${REAL_PACKAGE}.custom`;
7375

7476
const definition = (name: string) => ({
7577
name,
@@ -271,13 +273,22 @@ describe('a flow\'s package provenance is the server\'s fact at every door (show
271273
expect(put.status, JSON.stringify(put.json)).toBe(200);
272274
});
273275

274-
it('a clone of a shipped flow is saved as a tenant row that reads back on the metadata door', async () => {
276+
it('a clone of a shipped flow is saved as a row of the base\'s pair that reads back on the metadata door', async () => {
275277
const res = await call('POST', `/automation/${SHIPPED}/clone`, { name: CLONE, label: 'Dogfood clone' });
276278
expect(res.status, JSON.stringify(res.json)).toBe(200);
279+
// [#28149, ADR-0146 D3/D4] The copy lands in the base's paired
280+
// customization package, never package-less.
281+
expect(dataOf(res.json)?.packageId).toBe(PAIR_PACKAGE);
277282

278283
const served = await metaRead(CLONE);
279284
expect(served.status, JSON.stringify(served.doc)).toBe(200);
280-
expect(isCodeArtifactBody(served.doc)).toBe(false);
285+
// MEASURED, as for META_BOUND above: the served body surfaces the row's
286+
// binding as a package stamp, which reads as code-shipped on its own…
287+
expect(served.doc?._packageId).toBe(PAIR_PACKAGE);
288+
expect(isCodeArtifactBody(served.doc)).toBe(true);
289+
// …and the copy is still the customer's to edit: its round trip saves.
290+
const echoed = await call('PUT', `/meta/flow/${CLONE}?package=${PAIR_PACKAGE}`, served.doc);
291+
expect(echoed.status, JSON.stringify(echoed.json)).toBe(200);
281292
// The clone is the customer's: the activation door refuses it too.
282293
const off = await call('POST', `/automation/${CLONE}/toggle`, { enabled: false });
283294
expect(off.status, JSON.stringify(off.json)).toBe(409);

0 commit comments

Comments
 (0)