import { execFile } from "node:child_process"; import { promisify } from "node:util"; import { describe, expect, it } from "vitest"; import { createEvidenceBundle } from "../../../src/domain/evidenceBundle.js"; const execute = promisify(execFile); describe("reconstruction obligation ledger CLI parity", () => { it("builds the same Evidence-backed empty ledger through the CLI", async () => { const input = { evidence_bundle: createEvidenceBundle([]), reviewed_obligations: [], manifest: { bindings: [], contradictions: [], }, }; const { stdout } = await execute( process.execPath, [ "scripts/rea.mjs", "build-reconstruction-obligation-ledger", JSON.stringify(input), "--json", ], { cwd: process.cwd(), env: process.env, maxBuffer: 16 * 1_024 * 1_024, }, ); expect(JSON.parse(stdout)).toMatchObject({ operation: "build_reconstruction_obligation_ledger", predicate_type: "rea.reconstruction-obligation-ledger", normalized_result: { schema: "ReconstructionObligationLedger", status: "unknown", summary: { total: 0 }, }, }); }, 20_000); });