Files
pi-plan/test/approval.test.ts
T
wassname 325b93983f Recover paused supervision and tighten approval boundaries
Restore bindings before model availability checks, require explicit reconnect/restart recovery, detach inactive plans, remove the general Intercom actuator, and reject placeholder evidence without hashing the plan log. Preserve synchronous handoff-before-ack; document that the void SDK cannot confirm durable message delivery.
2026-09-08 18:57:43 +08:00

14 lines
915 B
TypeScript

import { expect, it } from "vitest";
import { goalBlock, hashGoalBlock } from "../src/approval.js";
it("hashes only the current goal, excluding the log, interview, and their historical goal text", () => {
const goal = "1. [ ] goal: output\n - evidence: output.txt\n";
const before = `${goal}\n## Log\n- first entry\n`;
const after = `${goal}\n## Log\n- later entry\n\n${goal}\n## Interview\n> new notes\n`;
expect(goalBlock(before, "output")).toBe(goal.trimEnd());
expect(hashGoalBlock(goalBlock(before, "output")!)).toBe(hashGoalBlock(goalBlock(after, "output")!));
expect(goalBlock(`${goal}\n## Interview\n> notes`, "output")).toBe(goal.trimEnd());
expect(goalBlock(`${goal}2. [ ] goal: second\n - evidence: second.txt`, "output")).toBe(goal.trimEnd());
expect(hashGoalBlock(goalBlock(before.replace("output.txt", "changed.txt"), "output")!)).not.toBe(hashGoalBlock(goalBlock(before, "output")!));
});