Files
FreeCADWasmDev/tools/run_p6_inspection_geometry_family_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.6 KiB
JavaScript

#!/usr/bin/env node
import crypto from "node:crypto";import fs from "node:fs";import path from "node:path";import{fileURLToPath}from"node:url";const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),"..");const p6=path.join(root,"docs/p6");const k=JSON.parse(fs.readFileSync(path.join(p6,"inspection-geometry-family-kernel.json"),"utf8"));const ok=k.result==="pass"&&k.counts.registered===1&&k.counts.createRecompute===1&&k.counts.saveReopen===1&&k.counts.objects===3&&k.counts.distances>0;const report={schema:"freecad-web-p6-inspection-geometry-family-gate/v1",taskId:"FW-P6-FPA-D1-INSPECTION",result:ok?"pass":"fail",coverage:{inventoryRecords:1,probedRecords:1,counts:{passed:ok?1:0,blocked:ok?0:1},createRecompute:ok,saveReopen:ok,distances:k.counts.distances},records:[{name:"Inspection::Feature",status:ok?"passed":"blocked",detail:ok?"native type/create/recompute/save-reopen passed":"native contract failed"}],source:{kernel:"docs/p6/inspection-geometry-family-kernel.json",kernelSha256:crypto.createHash("sha256").update(fs.readFileSync(path.join(p6,"inspection-geometry-family-kernel.json"))).digest("hex")},boundaries:["Inspection::Feature uses the native Actual/Nominals document fixture and semantic FCStd round-trip."]};fs.writeFileSync(path.join(p6,"inspection-geometry-family-gate.json"),JSON.stringify(report,null,2)+"\n");fs.writeFileSync(path.join(root,"docs/freecad-p6-inspection-geometry-family-gate.log"),JSON.stringify({result:report.result,counts:report.coverage.counts})+"\n");console.log(JSON.stringify({result:report.result,counts:report.coverage.counts}));if(!ok)process.exitCode=1;