4 lines
2.1 KiB
JavaScript
4 lines
2.1 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 = (f) => JSON.parse(fs.readFileSync(path.join(docs, f), "utf8")); const hash = (f) => crypto.createHash("sha256").update(fs.readFileSync(path.join(docs, f))).digest("hex"); const actions = { "create/recompute": "meshpart-gate.json", "inspect/source-inventory": "meshpart-action-02-inspect-source-inventory.json", "python-api": "meshpart-action-03-python-api.json", "save/reopen": "meshpart-action-04-save-reopen.json" }; const entries = Object.fromEntries(Object.entries(actions).map(([action, file]) => [action, { result: read(file).result, artifact: file, sha256: hash(file) }])); const result = Object.values(entries).every((x) => x.result === "pass" || x.result === "pass_boundary") ? "pass" : "fail"; const report = { schema: "freecad-web-p6-meshpart-module-gate/v1", taskId: "FW-P6-MSP-Y", module: "MeshPart", result, sourceRevision: read("meshpart-source-boundary.json").sourceRevision, actions: entries, moduleStatusAfterGate: result === "pass" ? "completed" : "pending", boundaries: ["All four declared MeshPart actions have independent conclusions.", "MeshPart shape-to-mesh is the only executable first-slice action; later save/reopen is explicit not-applicable boundary.", "SMESH/VTK, NETGEN, flatmesh, GUI, release, performance, and non-Chrome claims remain out of scope."] }; fs.writeFileSync(path.join(docs, "meshpart-module-gate.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(docs, "meshpart-module-gate.md"), `# MeshPart module gate\n\n- Result: \`${result}\`\n- Source revision: \`${report.sourceRevision}\`\n- Declared actions: create/recompute, inspect/source-inventory, python-api, save/reopen\n- MeshPart status after gate: \`${report.moduleStatusAfterGate}\`\n\nAll declared MeshPart actions have independent conclusions; non-applicable persistence is explicit.\n`); console.log(JSON.stringify({ result, actions: 4, moduleStatus: report.moduleStatusAfterGate }));
|