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

10 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 docs=path.join(root,"docs/p6");
const files=["src/Mod/Plot/CMakeLists.txt","src/Mod/Plot/Plot.py"]; const input=files.map(f=>`${f}\n${fs.readFileSync(path.join(sourceRoot,f),"utf8")}`).join("\n"); const sourceRevision=execFileSync("git",["-C",sourceRoot,"rev-parse","HEAD"],{encoding:"utf8"}).trim();
const inputSha256=crypto.createHash("sha256").update(input).digest("hex"); const report={schema:"freecad-web-plot-source-boundary/v1",task_id:"FW-P6-PLT-A",status:"pass",source_revision:sourceRevision,input_sha256:inputSha256,module:"Plot",cmake:{target:"src/Mod/Plot/CMakeLists.txt:10",scriptCopy:"src/Mod/Plot/CMakeLists.txt:14",install:"src/Mod/Plot/CMakeLists.txt:16-21",appSources:["src/Mod/Plot/Plot.py"]},python:{entry:"src/Mod/Plot/Plot.py:26-61",apiEntrypoints:["figure:116","plot:131","series:147","removeSerie:155","legend:177","save:310"],dependencies:["PySide","matplotlib","QtAgg backend"]},gui:{buildFlag:"No C++ BUILD_GUI target; Plot.py directly requires PySide Qt widgets",webBoundary:"GUI/PySide and matplotlib QtAgg are unavailable in GUI-free WASM"},actions:{inspect:"source inventory",pythonApi:"Plot.py functions",persistence:"not applicable: no App::Document object"},boundaries:["Source boundary only; no runtime or browser pass is claimed.","Plot is a Python/Qt/matplotlib GUI helper with no native document object or file format entry.","Python API and GUI dependency behavior remain later contracts."]}; fs.mkdirSync(docs,{recursive:true}); fs.writeFileSync(path.join(docs,"plot-source-boundary.json"),`${JSON.stringify(report,null,2)}\n`); fs.writeFileSync(path.join(root,"docs/freecad-p6-plot-a-boundary.log"),`${JSON.stringify({status:report.status,sourceRevision,inputSha256,dependencies:report.python.dependencies})}\n`); console.log(JSON.stringify({status:report.status,module:report.module,inputSha256:report.input_sha256}));