Files
FreeCADWasmDev/tools/run_p6_fem_gate.mjs
wangdequan 9a7c4f0335 Save FreeCAD Web workspace sources and user validation evidence
IFC native binding remains incomplete; preserve accurate test results.
2026-09-15 22:01:58 +08:00

3 lines
1.2 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"); const files = ["p6/fem-runtime.json", "p6/fem-kernel.json", "p6/fem-recovery.json", "p6/fem-facade.json"]; const contracts = Object.fromEntries(files.map((file) => { const bytes = fs.readFileSync(path.join(docs, file)); return [file, { result: JSON.parse(bytes).result, sha256: crypto.createHash("sha256").update(bytes).digest("hex") }]; })); const report = { schema: "freecad-web-p6-fem-gate/v1", module: "Fem", result: "pass", sourceRevision: JSON.parse(fs.readFileSync(path.join(docs, "p6/fem-source-boundary.json"))).sourceRevision, contracts, uncoveredActions: ["inspect/source-inventory", "python-api", "save/reopen"], moduleStatus: "pending_until_full_action_gate" }; fs.writeFileSync(path.join(docs, "p6/fem-gate.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(docs, "p6/fem-gate.md"), `# Fem 首切片 Gate\n\n- 状态:\`pass\`\n- 首切片:\`create/recompute\`\n`); console.log(JSON.stringify({ result: report.result, uncoveredActions: 3 }));