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

27 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 gatePath = path.join(docs, "part-geometry-family-gate.json");
const kernelPath = path.join(docs, "part-geometry-family-kernel.json");
const gate = JSON.parse(fs.readFileSync(gatePath, "utf8"));
const kernel = JSON.parse(fs.readFileSync(kernelPath, "utf8"));
const targets = new Set(["Part::Boolean", "Part::Face", "Part::RuledSurface"]);
const records = gate.records.filter((record) => targets.has(record.name));
const report = {
schema: "freecad-web-p6-part-geometry-family-r1/v1",
taskId: "FW-P6-FPA-D1-PART-R1",
result: "pass_with_blocked_records",
coverage: { inventoryRecords: 3, records: records.length, counts: Object.fromEntries(["passed", "passed_boundary", "blocked"].map((status) => [status, records.filter((record) => record.status === status).length])), resourcesReleased: kernel.counts.resourcesReleased },
records,
fixtures: { boolean: "abstract Part::Boolean remains non-instantiable", face: "Part::Face Sources=Box fixture still returns native recompute error", ruledSurface: "two OCC edge Part::Feature sources now create and recompute" },
source: { gate: "docs/p6/part-geometry-family-gate.json", kernel: "docs/p6/part-geometry-family-kernel.json", gateSha256: crypto.createHash("sha256").update(fs.readFileSync(gatePath)).digest("hex"), kernelSha256: crypto.createHash("sha256").update(fs.readFileSync(kernelPath)).digest("hex") },
boundaries: ["No prior successful record is overwritten; R1 only appends fixture outcomes.", "Part::Boolean and Part::Face remain blocked with native details until dedicated fixtures are available."],
};
fs.writeFileSync(path.join(docs, "part-geometry-family-r1.json"), `${JSON.stringify(report, null, 2)}\n`);
fs.writeFileSync(path.join(root, "docs", "freecad-p6-part-geometry-family-r1.log"), `result=${report.result}\npassed=${report.coverage.counts.passed}\nblocked=${report.coverage.counts.blocked}\nresourcesReleased=${report.coverage.resourcesReleased}\n`);
console.log(JSON.stringify({ result: report.result, coverage: report.coverage }));