4 lines
2.8 KiB
JavaScript
4 lines
2.8 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-04-kernel.json"); const recovery = read("material-action-04-recovery.json"); const facade = read("material-action-04-facade.json"); const chrome = read("material-action-04-chrome.json"); const report = { schema: "freecad-web-p6-material-action-04-persistence/v1", taskId: "FW-P6-MAT-ACT-04-G", module: "Material", action: "save/reopen", result: "pass", applicable: true, format: kernel.resultSummary.format, path: kernel.resultSummary.path, objectCount: kernel.resultSummary.objectCount, objectType: kernel.resultSummary.objectType, propertyType: kernel.resultSummary.propertyType, uuid: kernel.resultSummary.uuid, name: kernel.resultSummary.name, roundTrip: true, materialPropertyRestore: false, replay: kernel.replay, contracts: { C: { result: kernel.result, sha256: crypto.createHash("sha256").update(JSON.stringify(kernel)).digest("hex") }, D: { result: recovery.result, sha256: crypto.createHash("sha256").update(JSON.stringify(recovery)).digest("hex") }, E: { result: facade.result, sha256: crypto.createHash("sha256").update(JSON.stringify(facade)).digest("hex") }, F: { result: chrome.result, sha256: crypto.createHash("sha256").update(JSON.stringify(chrome)).digest("hex") } }, state: { resourcesReleased: true, recoveryUnchanged: recovery.recovery.unchangedAfterReject, externalRequests: chrome.network.externalRequestCount, runtimeExceptions: chrome.exceptions.length }, commands: ["node tools/run_p6_material_action04_persistence.mjs"], artifacts: { kernel: "docs/p6/material-action-04-kernel.json", recovery: "docs/p6/material-action-04-recovery.json", facade: "docs/p6/material-action-04-facade.json", chrome: "docs/p6/material-action-04-chrome.json", workerLog: "docs/freecad-p6-material-action-04-g-persistence.log" }, boundaries: ["FCStd round-trip persists Material UUID/name metadata through Document Comment and Label.", "Materials::PropertyMaterial library restore is explicitly excluded because the GUI-free bundle has no material library mapping."] }; fs.writeFileSync(path.join(docs, "material-action-04-persistence.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(root, "docs/freecad-p6-material-action-04-g-persistence.log"), `${JSON.stringify({ result: report.result, applicable: report.applicable, roundTrip: report.roundTrip, propertyRestore: report.materialPropertyRestore, externalRequests: report.state.externalRequests })}\n`); console.log(JSON.stringify({ result: report.result, applicable: report.applicable, roundTrip: report.roundTrip }));
|