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

19 lines
1.6 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 files = { C: "inspection-action-04-kernel.json", D: "inspection-action-04-recovery.json", E: "inspection-action-04-facade.json", F: "inspection-action-04-chrome.json", G: "inspection-action-04-persistence.json" };
const contracts = Object.fromEntries(Object.entries(files).map(([step, file]) => {
const bytes = fs.readFileSync(path.join(docs, file));
const report = JSON.parse(bytes);
return [step, { result: report.result, sha256: crypto.createHash("sha256").update(bytes).digest("hex"), artifact: `docs/p6/${file}` }];
}));
const result = Object.values(contracts).every((item) => item.result === "pass") ? "pass" : "fail";
const report = { schema: "freecad-web-p6-inspection-action-04-save-reopen/v1", taskId: "FW-P6-INS-ACT-04", module: "Inspection", action: "save/reopen", result, contracts, sourceRevision: "4f4e9244e613ea2df06e70027074a562695048cb", boundaries: ["C-G closes one deterministic save/reopen action only.", "Chrome evidence is Google Chrome only and records zero external requests."] };
fs.writeFileSync(path.join(docs, "inspection-action-04-save-reopen.json"), `${JSON.stringify(report, null, 2)}\n`);
fs.writeFileSync(path.join(root, "docs/freecad-p6-inspection-action-04-summary.log"), `${JSON.stringify({ result, contracts: Object.keys(contracts).length })}\n`);
console.log(JSON.stringify({ result, contracts: Object.keys(contracts).length }));