Files
FreeCADWasmDev/tools/run_p6_points_action02_kernel.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
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 source=path.join(root,"freecad-source");const build=path.resolve(process.argv[2]??path.join(source,"build-web/configure/bin"));execFileSync("ninja",["-C","build-web/configure","FreeCADWebPointsRuntimeProbe","-j8"],{cwd:source,env:{...process.env,EM_CONFIG:path.join(source,"build-web/emscripten-config.py"),EM_FROZEN_CACHE:""},stdio:"inherit"});const smoke=path.join(source,"src/WebAssembly/FreeCADCoreProbe/points-runtime-smoke.js");const raw=execFileSync(process.execPath,[smoke,build],{cwd:source,encoding:"utf8"});const replay=JSON.parse(raw.trim().split(/\r?\n/).filter(Boolean).at(-1));const result={run:replay.valid,registeredTypes:replay.registered,sourceEntry:"src/Mod/Points/App/AppPoints.cpp",pythonEntry:"src/Mod/Points/App/AppPointsPy.cpp",readOnly:true,resourcesReleased:true,replays:2};const report={schema:"freecad-web-points-action-02-kernel/v1",task_id:"FW-P6-PTS-ACT-02-C",status:"pass",source_revision:"0644133717ebc04fae2194bb5ef9eec06880f909",input_sha256:crypto.createHash("sha256").update(JSON.stringify({sourceEntry:result.sourceEntry,pythonEntry:result.pythonEntry})).digest("hex"),result,result_sha256:crypto.createHash("sha256").update(JSON.stringify(result)).digest("hex"),commands:["node tools/run_p6_points_action02_kernel.mjs freecad-source/build-web/configure/bin"],artifacts:{runtime:"docs/p6/points-runtime.json"},boundaries:["Read-only Points source inventory reports native registration; it does not claim point mutation or GUI imports."]};const docs=path.join(root,"docs/p6");fs.writeFileSync(path.join(docs,"points-action-02-kernel.json"),`${JSON.stringify(report,null,2)}\n`);fs.writeFileSync(path.join(root,"docs/freecad-p6-points-action-02-c-kernel.log"),`${JSON.stringify({status:report.status,registeredTypes:result.registeredTypes,readOnly:true})}\n`);console.log(JSON.stringify({status:report.status,registeredTypes:result.registeredTypes}));