2 lines
2.7 KiB
JavaScript
2 lines
2.7 KiB
JavaScript
import crypto from "node:crypto"; import fs from "node:fs"; import path from "node:path"; import { execFileSync } from "node:child_process"; 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 firstSlice = read("show-gate.json"); const python = read("show-action-02-persistence.json"); const runtime = read("show-runtime.json"); const actions = [{ id: "FW-P6-SHW-ACT-01", action: "inspect/source-inventory", result: firstSlice.result, persistence: read("show-persistence.json").result, evidence: ["docs/p6/show-kernel.json", "docs/p6/show-recovery.json", "docs/p6/show-facade.json", "docs/p6/show-chrome.json", "docs/p6/show-persistence.json"] }, { id: "FW-P6-SHW-ACT-02", action: "python-api", result: python.result === "pass_boundary" ? "pass" : "fail", persistence: python.result, evidence: ["docs/p6/show-action-02-kernel.json", "docs/p6/show-action-02-recovery.json", "docs/p6/show-action-02-facade.json", "docs/p6/show-action-02-chrome.json", "docs/p6/show-action-02-persistence.json"] }]; const result = runtime.result === "pass" && firstSlice.result === "pass" && python.result === "pass_boundary"; const revision = execFileSync("git", ["-C", path.join(root, "freecad-source"), "rev-parse", "HEAD"], { encoding: "utf8" }).trim(); const evidence = { actions, revision, wasmSha256: runtime.artifacts.wasm.sha256, sourceSha256: runtime.sourceSha256 }; const report = { schema: "freecad-web-p6-show-module-gate/v2", taskId: "FW-P6-SHW-Y", module: "Show", result: result ? "completed" : "pending", actions, revision, evidenceSha256: crypto.createHash("sha256").update(JSON.stringify(evidence)).digest("hex"), evidence, boundaries: ["Both declared Show actions have independent C-G conclusions: inspect/source-inventory pass, python-api pass with pass_boundary persistence.", "GUI-only Camera, ClipPlane, Pickability and Workbench paths remain excluded; no FCStd save/reopen capability is inferred."] }; fs.writeFileSync(path.join(docs, "show-module-gate.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(docs, "show-module-gate.md"), `# Show module gate\n\n- Result: ${report.result}\n- Revision: ${revision}\n- Actions: inspect/source-inventory pass; python-api pass (persistence pass_boundary).\n- Evidence: docs/p6/show-module-gate.json, docs/p6/show-gate.json, docs/p6/show-action-02-persistence.json.\n- Boundaries: official GUI-free Show Python core is covered; GUI-only SceneDetails and FCStd save/reopen remain excluded by the declared action matrix.\n`); console.log(JSON.stringify({ result: report.result, actionCount: actions.length, evidenceSha256: report.evidenceSha256 })); if (!result) process.exitCode = 1;
|