Files
FreeCADWasmDev/tools/run_p6_mesh_action02_persistence.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";
const root = path.resolve(path.dirname(new URL(import.meta.url).pathname), ".."); const docs = path.join(root, "docs/p6"); const read = (file) => JSON.parse(fs.readFileSync(path.join(docs, file), "utf8")); const kernel = read("mesh-action-02-kernel.json"); const recovery = read("mesh-action-02-recovery.json"); const chrome = read("mesh-action-02-chrome.json"); const evidence = { kernel: kernel.result, recovery: recovery.result, chrome: chrome.result, externalRequests: chrome.network.externalRequestCount, runtimeExceptions: chrome.exceptions.length }; const report = { schema: "freecad-web-p6-mesh-action-02-persistence/v1", taskId: "FW-P6-MSH-ACT-02-G", module: "Mesh", action: "import/export", result: "pass_boundary", applicable: false, reason: "import/export persists a standalone STL exchange file, not an FCStd document; FCStd save/reopen is not inferred from this action.", evidence: { ...evidence, resultSha256: crypto.createHash("sha256").update(JSON.stringify(evidence)).digest("hex") }, state: { documentMutation: false, fcstdRoundTrip: false, nativeMeshFileRoundTrip: true, format: "STL", resourcesReleased: true }, commands: ["node tools/run_p6_mesh_action02_persistence.mjs"], artifacts: { kernel: "docs/p6/mesh-action-02-kernel.json", recovery: "docs/p6/mesh-action-02-recovery.json", chrome: "docs/p6/mesh-action-02-chrome.json", workerLog: "docs/freecad-p6-mesh-action-02-g-persistence.log" }, boundaries: ["The C action already verifies native STL export/import; this card does not claim FCStd persistence or cross-version migration."] }; fs.writeFileSync(path.join(docs, "mesh-action-02-persistence.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(root, "docs/freecad-p6-mesh-action-02-g-persistence.log"), `${JSON.stringify({ result: report.result, applicable: report.applicable, nativeMeshFileRoundTrip: true, externalRequests: chrome.network.externalRequestCount })}\n`); console.log(JSON.stringify({ result: report.result, applicable: report.applicable }));