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

34 lines
2.0 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-kernel.json");
const recovery = read("material-recovery.json");
const chrome = read("material-chrome.json");
const report = {
schema: "freecad-web-p6-material-persistence/v1",
taskId: "FW-P6-MAT-G",
module: "Material",
action: "create/recompute",
result: "pass_boundary",
applicable: false,
reason: "The Material create/recompute first slice does not declare save/reopen; the separate Material ACT-04 action owns FCStd persistence verification.",
evidence: {
kernel: kernel.result,
recovery: recovery.result,
chrome: chrome.result,
resultSha256: crypto.createHash("sha256").update(JSON.stringify({ kernel: kernel.result, recovery: recovery.result, chrome: chrome.result })).digest("hex"),
},
state: { firstSliceDocumentMutation: true, localFcstdRoundTrip: false, externalRequests: chrome.network.externalRequestCount, runtimeExceptions: chrome.exceptions.length },
commands: ["node tools/run_p6_material_persistence.mjs"],
artifacts: { kernel: "docs/p6/material-kernel.json", recovery: "docs/p6/material-recovery.json", chrome: "docs/p6/material-chrome.json", workerLog: "docs/freecad-p6-material-g-persistence.log" },
boundaries: ["This boundary result does not claim Material save/reopen; ACT-04 remains pending and must produce its own C-G chain."]
};
fs.writeFileSync(path.join(docs, "material-persistence.json"), `${JSON.stringify(report, null, 2)}\n`);
fs.writeFileSync(path.join(root, "docs/freecad-p6-material-g-persistence.log"), `${JSON.stringify({ result: report.result, applicable: report.applicable, reason: report.reason, externalRequests: report.state.externalRequests })}\n`);
console.log(JSON.stringify({ result: report.result, applicable: report.applicable }));