import { describe, it } from "node:test"; import assert from "node:assert/strict"; import { readBoardContract } from "../../../tools/core/readers/board.reader.ts"; describe("readBoardContract", () => { it("reads the placeholder fields under the first agent and gate anchors, stopping at the first other line", () => { const template = [ "Agent — ", " Owns: ", " Flags: —", " Note: filled in", " Refs: ", "", "Gate — ", " State: ", "", "Agent — ", " Extra: ", ].join("\n"); assert.deepEqual(readBoardContract(template), { agentFields: ["Owns", "Flags"], gateFields: ["State"] }); }); it("reads nothing from a template that declares no record", () => { assert.deepEqual(readBoardContract("prose"), { agentFields: [], gateFields: [] }); }); });