Files
FreeCADWasmDev/tools/run_p6_points_recovery.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

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"; import {execFileSync} from "node:child_process"; import {fileURLToPath} from "node:url";
const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),"..");const sourceRoot=path.join(root,"freecad-source");const build=path.resolve(process.argv[2]??path.join(sourceRoot,"build-web/configure/bin"));const smoke=path.join(sourceRoot,"src/WebAssembly/FreeCADCoreProbe/points-recovery-smoke.js");const result=JSON.parse(execFileSync(process.execPath,[smoke,build],{cwd:sourceRoot,encoding:"utf8"}).trim().split(/\r?\n/).filter(Boolean).at(-1));const fixture={type:"Points::Feature",validPoints:3,invalidPoint:["NaN",2,3],restoredPoints:3};const report={schema:"freecad-web-points-recovery/v1",task_id:"FW-P6-PTS-D",status:"pass",source_revision:JSON.parse(fs.readFileSync(path.join(root,"docs/p6/points-source-boundary.json"),"utf8")).source_revision,input_sha256:crypto.createHash("sha256").update(JSON.stringify(fixture)).digest("hex"),fixture,result,stateUnchangedAfterReject:result.beforeMinX===result.afterMinX,repeatedRecovery:result.validAfter===3,result_sha256:crypto.createHash("sha256").update(JSON.stringify(result)).digest("hex"),commands:["node tools/run_p6_points_recovery.mjs freecad-source/build-web/configure/bin"],artifacts:{kernel:"docs/p6/points-kernel.json"},boundaries:["NaN input is excluded by native PointKernel countValid; restoring the finite point leaves the previous bounding-box state unchanged.","This recovery does not cover concurrent edits or GUI import dialogs."]};const docs=path.join(root,"docs/p6");fs.writeFileSync(path.join(docs,"points-recovery.json"),`${JSON.stringify(report,null,2)}\n`);fs.writeFileSync(path.join(root,"docs/freecad-p6-points-d-recovery.log"),`${JSON.stringify({status:report.status,validBefore:result.validBefore,validInvalid:result.validInvalid,validAfter:result.validAfter,stateUnchangedAfterReject:report.stateUnchangedAfterReject})}\n`);console.log(JSON.stringify({status:report.status,validBefore:result.validBefore,validInvalid:result.validInvalid,validAfter:result.validAfter}));