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

3 lines
2.3 KiB
JavaScript

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("reverseengineering-action-03-kernel.json"); const recovery = read("reverseengineering-action-03-recovery.json"); const facade = read("reverseengineering-action-03-facade.json"); const chrome = read("reverseengineering-action-03-chrome.json"); const evidence = { kernel: kernel.replay, recovery: recovery.recovery, facade: facade.sequencing, chrome: { result: chrome.result, externalRequests: chrome.network.externalRequestCount, exceptions: chrome.exceptions.length } }; const report = { schema: "freecad-web-p6-reverseengineering-action-03-persistence/v1", taskId: "FW-P6-REV-ACT-03-G", module: "ReverseEngineering", action: "python-api", result: "pass_boundary", applicable: false, reason: "ReverseEngineering python-api executes a pure in-memory geometry API and does not create an App::Document or FCStd payload; save/reopen is not applicable to this action.", state: { documentMutation: false, localFcstdRoundTrip: false, readOnly: true, resourcesReleased: true }, evidence: { ...evidence, resultSha256: crypto.createHash("sha256").update(JSON.stringify(evidence)).digest("hex") }, commands: ["node tools/run_p6_reverseengineering_action03_persistence.mjs"], artifacts: { kernel: "docs/p6/reverseengineering-action-03-kernel.json", recovery: "docs/p6/reverseengineering-action-03-recovery.json", facade: "docs/p6/reverseengineering-action-03-facade.json", chrome: "docs/p6/reverseengineering-action-03-chrome.json", workerLog: "docs/freecad-p6-reverseengineering-action-03-g-persistence.log" }, boundaries: ["This boundary applies only to python-api; ReverseEngineering save/reopen remains a separate ACT-04 contract."] }; fs.writeFileSync(path.join(docs, "reverseengineering-action-03-persistence.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(root, "docs/freecad-p6-reverseengineering-action-03-g-persistence.log"), `${JSON.stringify({ result: report.result, applicable: report.applicable, documentMutation: false })}\n`); console.log(JSON.stringify({ result: report.result, applicable: report.applicable, documentMutation: false }));