Revert G's mesh-sdk merge (#189): G merged half, and today's validator refuses G's delivery parts
mesh/delivery merged: source.main moved to novox/mesh-sdk@27da949140c6
mesh/check being carried to 8afc3ebdf371 on 93e0a7b50d90 | from 27da949140c6

The group feat/47-G-join11 merged 3 of 17 members on 2026-11-13; G's mesh-sdk alone on main breaks 25 trunk
modules. The operator chose to put the order right: a reader release first, then G whole. This restores main
to 8fbba810 exactly.

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-13 11:12:48 +01:00
parent b9915abf51
commit 8afc3ebdf3
212 changed files with 2436 additions and 32088 deletions
+1 -69
View File
@@ -26,7 +26,7 @@ test("a bundle on stdio lists its tools and answers a call, a seat's verb among
assert.equal((await ask(1, "initialize", { protocolVersion: "2025-03-26", capabilities: {} })).result.serverInfo.name, "lamp");
child.stdin.write(JSON.stringify({ jsonrpc: "2.0", method: "notifications/initialized" }) + "\n");
const listed = (await ask(2, "tools/list")).result.tools;
assert.deepEqual(listed.map((t: any) => t.name), ["brightness", "node-lamp.on", "fail", "who"]);
assert.deepEqual(listed.map((t: any) => t.name), ["brightness", "node-lamp.on", "fail"]);
assert.deepEqual(listed[0].inputSchema, { type: "object", properties: { level: { type: "number", description: "0 to 10" } } });
const called = (await ask(3, "tools/call", { name: "brightness", arguments: { level: 7 } })).result;
assert.deepEqual(JSON.parse(called.content[0].text), { level: 7 });
@@ -34,21 +34,6 @@ test("a bundle on stdio lists its tools and answers a call, a seat's verb among
assert.equal(failed.isError, true);
assert.equal(failed.content[0].text, "the bulb is gone");
assert.equal((await ask(5, "tools/call", { name: "nothing" })).error.code, -32602);
// The caller the runtime proved in `_meta` is handed to the tool, never one in the arguments (issue 365).
const proved = { "mesh/caller": "ace.mesh-delivery-forge-bridge", "mesh/call": "c-17" };
const who = (await ask(6, "tools/call", { name: "who", arguments: { caller: "person.mallory" }, _meta: proved })).result;
assert.deepEqual(JSON.parse(who.content[0].text), { caller: "ace.mesh-delivery-forge-bridge", call: "c-17" });
const unnamed = (await ask(7, "tools/call", { name: "who", arguments: { caller: "person.mallory" } })).result;
assert.deepEqual(JSON.parse(unnamed.content[0].text), { caller: "unproven", call: "" });
const malformed = (await ask(8, "tools/call", { name: "who", arguments: {}, _meta: { "mesh/caller": "a b", "mesh/call": "x y" } })).result;
assert.deepEqual(JSON.parse(malformed.content[0].text), { caller: "unproven", call: "" });
// A seat's verb judges its callers by the proof: the named module is answered, another and an unproven one refused.
assert.deepEqual(JSON.parse((await ask(9, "tools/call", { name: "node-lamp.on", arguments: {}, _meta: proved })).result.content[0].text), { on: true });
const other = (await ask(10, "tools/call", { name: "node-lamp.on", arguments: {}, _meta: { "mesh/caller": "ace.mallory" } })).result;
assert.equal(other.isError, true);
assert.equal(other.content[0].text, "node-lamp.on: refused for ace.mallory: not on the holder's caller list for node-lamp.on");
const none = (await ask(11, "tools/call", { name: "node-lamp.on", arguments: {} })).result;
assert.match(none.content[0].text, /carries no caller the tool runner proved/);
} finally {
child.stdin.end();
child.kill();
@@ -115,14 +100,6 @@ test("a launched tool's emit is asked of the runtime, and the call answers once
send({ jsonrpc: "2.0", id: asked.id, result: {} });
const answered = await until((m) => m.id === 2);
assert.deepEqual(JSON.parse(answered.result.content[0].text), { rang: true });
// A seat's event is asked of the runtime as a seat's publish, its subject whole and its id kept (ADR 0259 §3).
send({ jsonrpc: "2.0", id: 3, method: "tools/call", params: { name: "peal", arguments: {} } });
const said = await until((m) => m.method === "mesh/seat.publish");
assert.ok(said, "the seat's event was not asked of the runtime");
assert.deepEqual(said.params, { subject: "mesh.seat.bell.event.pealed.anchor", body: { times: 2 }, id: "p-1" });
assert.equal(seen.find((m) => m.id === 3), undefined, "the call answered before its seat's event was published");
send({ jsonrpc: "2.0", id: said.id, result: {} });
assert.deepEqual(JSON.parse((await until((m) => m.id === 3)).result.content[0].text), { pealed: true });
} finally {
child.kill();
}
@@ -332,49 +309,4 @@ test("a launched bundle announces what it keeps as it is imported, and binds no
} finally {
child.kill();
}
// A test of milestone G, merged here to keep the module within its test budget (design 47 G §419):
await aBundlesFindingWriter();
});
// a bundle's finding writer publishes with ack and listens with deliver new through the runtime channel (design 47 G §559)
async function aBundlesFindingWriter(): Promise<void> {
const child = spawn(process.execPath, [fileURLToPath(new URL("./fixtures/stdio-finding-calls.mjs", import.meta.url))],
{ stdio: ["pipe", "pipe", "inherit"], env: { ...process.env, MESH_SERVED_MODULE: "keeper" } });
const seen: any[] = [];
let buffered = "";
child.stdout.on("data", (d) => {
buffered += d.toString();
let at: number;
while ((at = buffered.indexOf("\n")) >= 0) {
seen.push(JSON.parse(buffered.slice(0, at)));
buffered = buffered.slice(at + 1);
}
});
const until = async (match: (m: any) => boolean) => {
for (let i = 0; i < 150 && !seen.some(match); i++) await new Promise((r) => setTimeout(r, 20));
return seen.find(match);
};
const send = (m: unknown) => child.stdin.write(JSON.stringify(m) + "\n");
try {
// the capability words are read once, before the first call that needs one (design 47 G §576)
const caps = await until((m) => m.method === "mesh/capabilities");
send({ jsonrpc: "2.0", id: caps.id, result: { words: ["finding-calls"] } });
const sub = await until((m) => m.method === "mesh/subscribe");
assert.deepEqual(sub.params, { pattern: "mesh-conditions.findings-asked", deliver: "new" });
send({ jsonrpc: "2.0", id: sub.id, result: {} });
send({ jsonrpc: "2.0", id: 1, method: "initialize", params: { protocolVersion: "2025-03-26", capabilities: {} } });
await until((m) => m.id === 1);
send({ jsonrpc: "2.0", id: 2, method: "tools/call", params: { name: "say", arguments: {} } });
const pub = await until((m) => m.method === "mesh/publish");
assert.equal(pub.params.ack, true);
assert.equal(pub.params.key, "finding-written");
assert.equal(pub.params.headers["x-event-id"], "id-1");
// The runtime answers an unacknowledged publish with {error}: the writer's publish fails, so it sends again.
send({ jsonrpc: "2.0", id: pub.id, result: { error: "no stream" } });
const answered = await until((m) => m.id === 2);
assert.equal(seen.filter((m) => m.method === "mesh/capabilities").length, 1, "the words are asked once");
assert.deepEqual(JSON.parse(answered.result.content[0].text), { said: false, why: "the bus did not acknowledge finding-written: no stream" });
} finally {
child.kill();
}
}