2 lines
2.2 KiB
JavaScript
2 lines
2.2 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-action-02-kernel.json"); const recovery = read("show-action-02-recovery.json"); const facade = read("show-action-02-facade.json"); const chrome = read("show-action-02-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-action-02-persistence/v1", taskId: "FW-P6-SHW-ACT-02-G", module: "Show", action: "python-api", result: kernel.result === "pass" && recovery.result === "pass" && facade.result === "pass" && chrome.result === "pass" ? "pass_boundary" : "fail", applicable: false, reason: "Show python-api is a runtime API exercise and has no declared save/reopen action; FCStd persistence is not applicable.", state: { documentMutation: true, localFcstdRoundTrip: false, readOnly: false, resourcesReleased: true }, evidence: { ...evidence, resultSha256: crypto.createHash("sha256").update(JSON.stringify(evidence)).digest("hex") }, artifacts: { kernel: "docs/p6/show-action-02-kernel.json", recovery: "docs/p6/show-action-02-recovery.json", facade: "docs/p6/show-action-02-facade.json", chrome: "docs/p6/show-action-02-chrome.json", log: "docs/freecad-p6-show-action-02-g-persistence.log" }, boundaries: ["The native Python API fixture creates and closes a temporary document to validate TempoVis lifecycle, but no FCStd save/reopen capability is inferred."] }; fs.writeFileSync(path.join(docs, "show-action-02-persistence.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(root, "docs/freecad-p6-show-action-02-g-persistence.log"), `${JSON.stringify({ result: report.result, applicable: report.applicable, resourcesReleased: report.state.resourcesReleased })}\n`); console.log(JSON.stringify({ result: report.result, applicable: report.applicable })); if (report.result !== "pass_boundary") process.exitCode = 1;
|