test: fix the spawned-block slice and type the #3045 re-init events

This commit is contained in:
garrytan committed 2026-10-06 18:27:24 +00:00
1 parent 7bfe46b781
commit 3cb6ef027b
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -500,9 +500,9 @@ describe('Autoplan parent publication guard', () => {
const reason = (f.evaluate() as any).reason;
expect(reason).toContain('which this guard cannot bind');
expect(reason).toContain('`bun "<SNAPSHOT_TOOL>" init "<SOURCE_PLAN>" "<ACTIVE_PLAN>" "<RESTORE_PATH>"`');
f.events.splice(2, 0, { ...structuredClone(f.events[0]!), toolUseId: 're-init',
f.events.splice(2, 0, { ...(structuredClone(f.events[0]!) as any), toolUseId: 're-init',
input: { command: `bun "${ROOT}/bin/gstack-autoplan-snapshot.ts" init "${f.source}" "${f.active}" "${f.restore}"` } },
{ ...structuredClone(f.events[1]!), toolUseId: 're-init', content: JSON.stringify({ ...f.init, reused: true }) });
{ ...(structuredClone(f.events[1]!) as any), toolUseId: 're-init', content: JSON.stringify({ ...f.init, reused: true }) });
f.reorder(); expect(f.evaluate()).toEqual({ allow: true });
});
+1 -1
View File
@@ -24,7 +24,7 @@ describe('#3016: spawned auto-choice never grants consent or publishes', () => {
test("skill-start's spawned-session block names consent and off-machine publishing as exceptions", () => {
const start = fs.readFileSync(path.join(ROOT, 'bin', 'gstack-skill-start'), 'utf8');
const block = start.slice(start.indexOf('_emit_block spawned-session'), start.indexOf('EOI', start.indexOf('_emit_block spawned-session')));
const block = start.slice(start.indexOf('_emit_block spawned-session'), start.indexOf('\nEOI', start.indexOf('_emit_block spawned-session')));
expect(block).toContain('never grant a consent or choose an option that publishes or syncs data off this machine');
});
});