3 lines
2.1 KiB
JavaScript
3 lines
2.1 KiB
JavaScript
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("show-kernel.json"); const recovery = read("show-recovery.json"); const facade = read("show-facade.json"); const chrome = read("show-chrome.json"); const evidence = { kernel: kernel.details, recovery: recovery.recovery, facade: facade.sequencing, chrome: { result: chrome.result, externalRequests: chrome.network.externalRequestCount, exceptions: chrome.exceptions.length } }; const report = { schema: "freecad-web-p6-show-persistence/v1", taskId: "FW-P6-SHW-G", module: "Show", action: "inspect/source-inventory", result: kernel.result === "pass" && recovery.result === "pass" && facade.result === "pass" && chrome.result === "pass" ? "pass_boundary" : "fail", applicable: false, reason: "inspect/source-inventory is read-only and creates no FCStd payload; Show has no save/reopen action in the declared matrix.", state: { documentMutation: false, localFcstdRoundTrip: false, readOnly: true, resourcesReleased: true }, evidence: { ...evidence, resultSha256: crypto.createHash("sha256").update(JSON.stringify(evidence)).digest("hex") }, artifacts: { kernel: "docs/p6/show-kernel.json", recovery: "docs/p6/show-recovery.json", facade: "docs/p6/show-facade.json", chrome: "docs/p6/show-chrome.json", log: "docs/freecad-p6-show-g-persistence.log" }, boundaries: ["Persistence is explicitly not applicable to the read-only Show inspect/source-inventory action; no save capability is inferred."] }; fs.writeFileSync(path.join(docs, "show-persistence.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(root, "docs/freecad-p6-show-g-persistence.log"), `${JSON.stringify({ result: report.result, applicable: report.applicable, readOnly: report.state.readOnly, resourcesReleased: report.state.resourcesReleased })}\n`); console.log(JSON.stringify({ result: report.result, applicable: report.applicable })); if (report.result !== "pass_boundary") process.exitCode = 1;
|