4 lines
2.7 KiB
JavaScript
4 lines
2.7 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 contracts = { A: { taskId: "FW-P6-MSH-A", artifact: "mesh-source-boundary.json", result: read("mesh-source-boundary.json").result }, B: { taskId: "FW-P6-MSH-B", artifact: "mesh-runtime.json", result: read("mesh-runtime.json").result }, C: { taskId: "FW-P6-MSH-C", artifact: "mesh-kernel.json", result: read("mesh-kernel.json").result }, D: { taskId: "FW-P6-MSH-D", artifact: "mesh-recovery.json", result: read("mesh-recovery.json").result }, E: { taskId: "FW-P6-MSH-E", artifact: "mesh-facade.json", result: read("mesh-facade.json").result }, F: { taskId: "FW-P6-MSH-F", artifact: "mesh-chrome.json", result: read("mesh-chrome.json").result }, G: { taskId: "FW-P6-MSH-G", artifact: "mesh-persistence.json", result: read("mesh-persistence.json").result } }; const result = Object.values(contracts).every((item) => item.result === "pass" || item.result === "pass_boundary") ? "pass" : "fail"; const report = { schema: "freecad-web-p6-mesh-gate/v1", taskId: "FW-P6-MSH-X", module: "Mesh", result, sourceRevision: read("mesh-source-boundary.json").sourceRevision, contracts: Object.fromEntries(Object.entries(contracts).map(([step, item]) => [step, { ...item, sha256: hash(item.artifact) }])), moduleStatusAfterGate: "in_progress", coverage: { createRecompute: "pass", inspectSourceInventory: "pending", pythonApi: "pending", saveReopen: "pending", importExport: "pending" }, boundaries: ["A-G independently close only the Mesh create/recompute first slice.", "Action-level inspect/source-inventory, python-api, save/reopen, and import/export remain pending.", "No release, legal, performance, or non-Chrome compatibility claim is made."] }; fs.writeFileSync(path.join(docs, "mesh-gate.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(docs, "mesh-gate.md"), `# Mesh first-slice gate\n\n- Result: \`${result}\`\n- Source revision: \`${report.sourceRevision}\`\n- Closed action: create/recompute\n- Mesh status after gate: \`${report.moduleStatusAfterGate}\`\n\nA-G evidence closes only the first Mesh action; action-level cards remain pending.\n`); fs.writeFileSync(path.join(root, "docs/freecad-p6-mesh-x-gate.log"), `${JSON.stringify({ result, actions: 1, moduleStatus: report.moduleStatusAfterGate })}\n`); console.log(JSON.stringify({ result, closedAction: "create/recompute", moduleStatus: report.moduleStatusAfterGate }));
|