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 = (file) => JSON.parse(fs.readFileSync(path.join(docs, file), "utf8")); const hash = (file) => crypto.createHash("sha256").update(fs.readFileSync(path.join(docs, file))).digest("hex"); const files = { A: "meshpart-source-boundary.json", B: "meshpart-runtime.json", C: "meshpart-kernel.json", D: "meshpart-recovery.json", E: "meshpart-facade.json", F: "meshpart-chrome.json", G: "meshpart-persistence.json" }; const contracts = Object.fromEntries(Object.entries(files).map(([step, file]) => [step, { result: read(file).result, artifact: file, sha256: hash(file) }])); const result = Object.values(contracts).every((item) => item.result === "pass" || item.result === "pass_boundary") ? "pass" : "fail"; const report = { schema: "freecad-web-p6-meshpart-gate/v1", taskId: "FW-P6-MSP-X", module: "MeshPart", result, sourceRevision: read("meshpart-source-boundary.json").sourceRevision, contracts, moduleStatusAfterGate: "in_progress", coverage: { createRecompute: "pass", importExport: "pending", inspectSourceInventory: "pending", pythonApi: "pending", saveReopen: "pending" }, boundaries: ["A-G close only the no-SMESH MeshPart shape-to-mesh first slice.", "SMESH/VTK, NETGEN, flatmesh, GUI, and action-level contracts remain pending."] }; fs.writeFileSync(path.join(docs, "meshpart-gate.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(docs, "meshpart-gate.md"), `# MeshPart first-slice gate\n\n- Result: \`${result}\`\n- Source revision: \`${report.sourceRevision}\`\n- Closed action: create/recompute\n- MeshPart status after gate: \`${report.moduleStatusAfterGate}\`\n\nA-G evidence closes only the no-SMESH shape-to-mesh first slice.\n`); fs.writeFileSync(path.join(root, "docs/freecad-p6-meshpart-x-gate.log"), `${JSON.stringify({ result, actions: 1, moduleStatus: report.moduleStatusAfterGate })}\n`); console.log(JSON.stringify({ result, actions: 1, moduleStatus: report.moduleStatusAfterGate }));
|