From 364c05c63c7d58a55286ae2933f08985b875c5b5 Mon Sep 17 00:00:00 2001 From: Tiberiu Socaci Date: Fri, 16 Oct 2026 23:10:19 +0300 Subject: [PATCH] test: exercise authorized session carry in live fixture Signed-off-by: Tiberiu Socaci --- test/session-carry.live.test.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/session-carry.live.test.js b/test/session-carry.live.test.js index 392861a5..155f3fda 100644 --- a/test/session-carry.live.test.js +++ b/test/session-carry.live.test.js @@ -24,7 +24,11 @@ test("live: Claude and Codex fixture history roundtrips through a container rebu }; const runtime = __setContainerRuntime({ log() {} }); const slug = `cg-carry-fixtures-${randomUUID().slice(0, 8)}`; - const target = resolveRuntime(slug, { platform: "slack", channelId: "C-CARRY-FIXTURE" }, { settings }); + const meta = { platform: "slack", channelId: "C-CARRY-FIXTURE" }; + // Host histories are private to verified admins. The default project target must refuse them; + // the roundtrip below exercises the separately resolved, authorized admin runtime. + const projectTarget = resolveRuntime(slug, meta, { settings }); + const target = resolveRuntime(slug, meta, { settings, isAdminAuthor: true }); const host = { ...target, backend: "host", container: null }; let mayHaveContainer = false; try { @@ -47,6 +51,10 @@ test("live: Claude and Codex fixture history roundtrips through a container rebu const body = `${JSON.stringify({ fixture: true, engine, sessionId })}\n`; mkdirSync(path.dirname(fixture), { recursive: true }); writeFileSync(fixture, body); + assert.equal(await carrySession({ + engine, sessionId, cwd: target.cwd, storedRuntime: { backend: "host" }, target: projectTarget, + resolveFor: () => host, log() {}, + }), null, `${engine}: project authors must not import host histories`); assert.deepEqual(await carrySession({ engine, sessionId, cwd: target.cwd, storedRuntime: { backend: "host" }, target, resolveFor: () => host, log() {},