fix(hopper): reserve Linux demo application before launch (#1158)
* test(hopper): give locals oracle explicit stack storage * fix(hopper): reserve Linux demo application before launch * fix(hopper): serialize stale lease recovery
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
/** Prove competing Linux launches cannot forward documents into the active MCP owner. */
|
||||
export async function verifyLinuxHopperLaunchIsolation({
|
||||
call,
|
||||
runCli,
|
||||
dispatcher,
|
||||
primary,
|
||||
secondary,
|
||||
}) {
|
||||
const documents = await call("list_documents");
|
||||
const current = await call("current_document");
|
||||
const procedures = await call("list_procedures");
|
||||
for (const target of [primary, secondary]) {
|
||||
let failure;
|
||||
try {
|
||||
await runCli([
|
||||
dispatcher,
|
||||
"inspect",
|
||||
target,
|
||||
"--provider",
|
||||
"hopper",
|
||||
"--format",
|
||||
"json",
|
||||
]);
|
||||
} catch (error) {
|
||||
assert.equal(error.code, 1);
|
||||
failure = JSON.parse(error.stdout);
|
||||
}
|
||||
assert.ok(
|
||||
failure,
|
||||
"A competing CLI launch was allowed to reach Linux Hopper",
|
||||
);
|
||||
assert.equal(failure.code, "provider_unavailable");
|
||||
assert.match(
|
||||
failure.message,
|
||||
/Linux Hopper is already active in REA session/u,
|
||||
);
|
||||
assert.ok(failure.message.includes(target));
|
||||
assert.deepEqual(
|
||||
await call("list_documents"),
|
||||
documents,
|
||||
"A rejected CLI launch changed the owning session's documents",
|
||||
);
|
||||
assert.equal(await call("current_document"), current);
|
||||
assert.deepEqual(await call("list_procedures"), procedures);
|
||||
}
|
||||
return {
|
||||
sameTargetRejected: true,
|
||||
differentTargetRejected: true,
|
||||
ownerDocumentsPreserved: true,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user