const test = require("node:test"); const assert = require("node:assert"); const { createFakePi } = require("./fake_pi_runtime.js"); const installGatePromise = import("../../tht-gate.js").then((m) => m.default); test("tht schema introspect --refresh e' bloccato in sessione (manutenzione)", async () => { const installGate = await installGatePromise; const { pi } = createFakePi(); installGate(pi); const res = await pi.emit("tool_call", { toolName: "bash", input: { command: "tht schema introspect -c workspaces/psd.yaml --refresh" }, }); assert.equal(res?.block, true); }); test("tht schema introspect senza --refresh passa (cache hit innocuo)", async () => { const installGate = await installGatePromise; const { pi } = createFakePi(); installGate(pi); const res = await pi.emit("tool_call", { toolName: "bash", input: { command: "tht schema introspect -c workspaces/psd.yaml" }, }); assert.equal(res, undefined); });