From a661f1773abe62bf60578b0d41d8947f966a50c4 Mon Sep 17 00:00:00 2001 From: mintaka Date: Sun, 22 Nov 2026 23:38:20 -0500 Subject: [PATCH 1/2] test(cotal): pin resume role refusal for spawn grant bound (RIG-11871) Co-authored-by: Matt Wilkinson --- .../manager/smoke/spawn-grant-bound.smoke.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/forks/cotal/implementations/manager/smoke/spawn-grant-bound.smoke.ts b/forks/cotal/implementations/manager/smoke/spawn-grant-bound.smoke.ts index 2e2b6233e..c92502154 100644 --- a/forks/cotal/implementations/manager/smoke/spawn-grant-bound.smoke.ts +++ b/forks/cotal/implementations/manager/smoke/spawn-grant-bound.smoke.ts @@ -95,7 +95,7 @@ M.managerInstanceId = "smoke-manager-instance"; requestDeliveryAdmin: requestDeliveryAdminZeroMemberships, getRoster: () => [...M.agents.values()].map((a) => ({ card: { id: principalKey(DEV_OWNER, a.id).key, name: a.name }, status: "idle", lifecycleUid: a.lifecycleUid })), }; -const con: Connector = { kind: "connector", name: "smoke-gb", requires: ["node"], eventChannel, buildLaunch: () => ({ command: "true", args: [], env: {} }) }; +const con: Connector = { kind: "connector", name: "smoke-gb", requires: ["node"], eventChannel, supportsResume: true, buildLaunch: () => ({ command: "true", args: [], env: {} }) }; registry.register(con); const spawnAs = (caller: EpCaller | undefined, name: string, extra: Record = {}): Promise => @@ -191,6 +191,11 @@ try { check("its credential binds the worker task queue", raw.some((s) => s.startsWith("$JS.API.CONSUMER.MSG.NEXT.") && s.endsWith(".svc_worker")), raw.filter((s) => s.includes("svc_"))); const w = await spawnAs(issuedCallerOf("dispatcher"), "worker"); check("it hands the role on", w.ok === true, w); + const resume = await spawnAs(caller, "worker", { resume: "existing-worker-session" }); + const roleRefusal = "spawn: this spawn hands its helper more than the spawner holds: role worker (a spawner hands on a role it was given as its own or as the `role:worker` capability). A spawner hands on only what its own issued credential carries (SPEC 13.15). Drop these from the persona or the spawn, or have the operator widen the spawner's own persona."; + check("resuming a worker without its role is refused with the same grant error", resume.ok === false && resume.code === undefined && resume.error === roleRefusal, resume); + const allowedResume = await spawnAs(issuedCallerOf("dispatcher"), "worker", { resume: "existing-worker-session" }); + check("a spawner holding role:worker can resume the worker", allowedResume.ok === true, allowedResume); const dt = await spawnAs(issuedCallerOf("dispatcher"), "deputy"); check("and the role:worker token", dt.ok === true, dt); } From 3128ad02f414d8abf63f81655086dbfe714205bb Mon Sep 17 00:00:00 2001 From: mintaka Date: Sun, 22 Nov 2026 23:42:50 -0500 Subject: [PATCH 2/2] test(cotal): compare resume refusal to the spawn refusal; relabel resume control (RIG-11871) --- .../implementations/manager/smoke/spawn-grant-bound.smoke.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/forks/cotal/implementations/manager/smoke/spawn-grant-bound.smoke.ts b/forks/cotal/implementations/manager/smoke/spawn-grant-bound.smoke.ts index c92502154..8f3823fba 100644 --- a/forks/cotal/implementations/manager/smoke/spawn-grant-bound.smoke.ts +++ b/forks/cotal/implementations/manager/smoke/spawn-grant-bound.smoke.ts @@ -192,10 +192,9 @@ try { const w = await spawnAs(issuedCallerOf("dispatcher"), "worker"); check("it hands the role on", w.ok === true, w); const resume = await spawnAs(caller, "worker", { resume: "existing-worker-session" }); - const roleRefusal = "spawn: this spawn hands its helper more than the spawner holds: role worker (a spawner hands on a role it was given as its own or as the `role:worker` capability). A spawner hands on only what its own issued credential carries (SPEC 13.15). Drop these from the persona or the spawn, or have the operator widen the spawner's own persona."; - check("resuming a worker without its role is refused with the same grant error", resume.ok === false && resume.code === undefined && resume.error === roleRefusal, resume); + check("resuming a worker without its role is refused with the same grant error", resume.ok === false && resume.code === undefined && resume.error === r.error, resume); const allowedResume = await spawnAs(issuedCallerOf("dispatcher"), "worker", { resume: "existing-worker-session" }); - check("a spawner holding role:worker can resume the worker", allowedResume.ok === true, allowedResume); + check("a spawner holding role:worker passes the grant bound with a resume", allowedResume.ok === true, allowedResume); const dt = await spawnAs(issuedCallerOf("dispatcher"), "deputy"); check("and the role:worker token", dt.ok === true, dt); }