G C-1 (TS): a bundle reads its tool runner's capability words once and names a word not stated
mesh/capabilities answered {words}, an unknown call read as none, the node from MESH_NODE; the finding writer's bundle
transport requires finding-calls; a runtime refusal keeps its code.
Builds: design 47 G §576, §622, §488
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -981,3 +981,27 @@ test("the finding writer owns its kinds, keeps a views reader's findings in its
|
||||
await vw.delete(vf);
|
||||
assert.equal(store.has("module.m=2eo=2es.view-waits"), false);
|
||||
});
|
||||
|
||||
test("a bundle reads its tool runner's capability words once, reads an unknown call as none and names a word not stated (design 47 G §576)", async () => {
|
||||
const { useRuntime, requireCapability } = await import("../dist/runtime/index.js");
|
||||
const was = process.env.MESH_NODE;
|
||||
process.env.MESH_NODE = "ace";
|
||||
let asked = 0;
|
||||
useRuntime(async (method) => {
|
||||
asked++;
|
||||
assert.equal(method, "mesh/capabilities");
|
||||
return { words: ["finding-calls"] };
|
||||
});
|
||||
await requireCapability("finding-calls");
|
||||
await assert.rejects(requireCapability("put-sessions"), /"put-sessions".*ace|ace.*"put-sessions"/);
|
||||
assert.equal(asked, 1);
|
||||
useRuntime(async () => { throw Object.assign(new Error("no mesh/capabilities"), { code: -32601 }); });
|
||||
await assert.rejects(requireCapability("finding-calls"), /"finding-calls"/);
|
||||
let tries = 0;
|
||||
useRuntime(async () => { if (++tries === 1) throw new Error("pipe closed"); return { words: ["finding-calls"] }; });
|
||||
await assert.rejects(requireCapability("finding-calls"), /pipe closed/);
|
||||
await requireCapability("finding-calls"); // a failed read is asked again
|
||||
useRuntime(undefined);
|
||||
if (was === undefined) delete process.env.MESH_NODE;
|
||||
else process.env.MESH_NODE = was;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user