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

6 lines
2.2 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("material-action-02-kernel.json"); const recovery = read("material-action-02-recovery.json"); const facade = read("material-action-02-facade.json"); const chrome = read("material-action-02-chrome.json"); const report = { schema: "freecad-web-p6-material-action-02-persistence/v1", taskId: "FW-P6-MAT-ACT-02-G", module: "Material", action: "inspect/source-inventory", result: "pass_boundary", applicable: false, reason: "Material source inventory is read-only and does not create or persist a Document; FCStd round-trip is not applicable to this action.", state: { readOnly: true, documentMutation: false, externalRequests: chrome.network.externalRequestCount, runtimeExceptions: chrome.exceptions.length }, evidence: { kernel: kernel.result, recovery: recovery.result, facade: facade.result, chrome: chrome.result, resultSha256: crypto.createHash("sha256").update(JSON.stringify({ kernel: kernel.result, recovery: recovery.result, facade: facade.result, chrome: chrome.result })).digest("hex") }, commands: ["node tools/run_p6_material_action02_persistence.mjs"], artifacts: { kernel: "docs/p6/material-action-02-kernel.json", recovery: "docs/p6/material-action-02-recovery.json", facade: "docs/p6/material-action-02-facade.json", chrome: "docs/p6/material-action-02-chrome.json", workerLog: "docs/freecad-p6-material-action-02-g-persistence.log" }, boundaries: ["The separate Material python-api and save/reopen actions remain pending."] }; fs.writeFileSync(path.join(docs, "material-action-02-persistence.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(root, "docs/freecad-p6-material-action-02-g-persistence.log"), `${JSON.stringify({ result: report.result, applicable: report.applicable, readOnly: report.state.readOnly, externalRequests: report.state.externalRequests })}\n`); console.log(JSON.stringify({ result: report.result, applicable: report.applicable }));