Skip to content

Commit 1f2af2d

Browse files
committed
test(runtime): the save-door control is its own case per arm
Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
1 parent 91dc195 commit 1f2af2d

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎packages/runtime/src/domains/packages-knowledge-source-gate.test.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ describe('/packages duplicate and /meta save on a real kernel running KnowledgeS
512512
}
513513

514514
for (const arm of ['transient', 'content', 'where', 'title'] as const) {
515-
it(`${arm}: the duplicate is told nothing was copied once and to duplicate the package, never to save; the /meta save's sentence is unchanged`, async () => {
515+
it(`${arm}: the duplicate is told nothing was copied once and to duplicate the package, never to save, and nothing is copied`, async () => {
516516
const stack = await bootPlatformKnowledge(arm);
517517
try {
518518
const expected = SAVE_VERDICT[arm];
@@ -525,8 +525,15 @@ describe('/packages duplicate and /meta save on a real kernel running KnowledgeS
525525
expect(message.match(/nothing was copied/gi)).toHaveLength(1);
526526
expect(message).toMatch(arm === 'title' ? /Have someone who may query it duplicate the package\.$/ : /duplicate the package again/);
527527
expect(stack.protocol.duplicatePackage).not.toHaveBeenCalled();
528+
} finally {
529+
await stack.kernel.shutdown();
530+
}
531+
});
528532

529-
// CONTROL: the same verdict at the /meta save door, byte for byte as before.
533+
it(`${arm}: CONTROL — the same verdict at the /meta save door is byte for byte what it was, and nothing is saved`, async () => {
534+
const stack = await bootPlatformKnowledge(arm);
535+
try {
536+
const expected = SAVE_VERDICT[arm];
530537
const saved = await stack.save(authed(BOTH));
531538
expect(saved.response?.status).toBe(expected.status);
532539
expect(saved.response?.body?.error?.code).toBe(expected.code);
@@ -537,4 +544,6 @@ describe('/packages duplicate and /meta save on a real kernel running KnowledgeS
537544
}
538545
});
539546
}
547+
});
548+
}
540549
});

0 commit comments

Comments
 (0)