17 lines
2.2 KiB
JavaScript
17 lines
2.2 KiB
JavaScript
#!/usr/bin/env node
|
|
import crypto from "node:crypto";
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
const root = path.resolve(path.dirname(new URL(import.meta.url).pathname), "..");
|
|
const docs = path.join(root, "docs/p6");
|
|
const read = (file) => JSON.parse(fs.readFileSync(path.join(docs, file), "utf8"));
|
|
const kernel = read("measure-action-02-kernel.json");
|
|
const recovery = read("measure-action-02-recovery.json");
|
|
const facade = read("measure-action-02-facade.json");
|
|
const chrome = read("measure-action-02-chrome.json");
|
|
const evidence = { kernel: kernel.result, recovery: recovery.result, facade: facade.result, chrome: chrome.result, externalRequests: chrome.network.externalRequestCount, runtimeExceptions: chrome.exceptions.length };
|
|
const report = { schema: "freecad-web-p6-measure-action-02-persistence/v1", taskId: "FW-P6-MEA-ACT-02-G", module: "Measure", action: "inspect/source-inventory", result: "pass_boundary", applicable: false, reason: "inspect/source-inventory is read-only and has no Document or FCStd save/reopen operation; persistence is not inferred.", evidence: { ...evidence, resultSha256: crypto.createHash("sha256").update(JSON.stringify(evidence)).digest("hex") }, state: { documentMutation: false, localFcstdRoundTrip: false, readOnly: true, resourcesReleased: true }, commands: ["node tools/run_p6_measure_action02_persistence.mjs"], artifacts: { kernel: "docs/p6/measure-action-02-kernel.json", recovery: "docs/p6/measure-action-02-recovery.json", facade: "docs/p6/measure-action-02-facade.json", chrome: "docs/p6/measure-action-02-chrome.json", workerLog: "docs/freecad-p6-measure-action-02-g-persistence.log" }, boundaries: ["This boundary result does not claim Measure save/reopen; a separate action-level persistence contract remains pending."] };
|
|
fs.writeFileSync(path.join(docs, "measure-action-02-persistence.json"), `${JSON.stringify(report, null, 2)}\n`);
|
|
fs.writeFileSync(path.join(root, "docs/freecad-p6-measure-action-02-g-persistence.log"), `${JSON.stringify({ result: report.result, applicable: report.applicable, externalRequests: chrome.network.externalRequestCount })}\n`);
|
|
console.log(JSON.stringify({ result: report.result, applicable: report.applicable }));
|