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

25 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 kernelPath = path.join(docs, "import-kernel.json");
const originalPath = path.join(docs, "import-geometry-family-kernel.json");
const kernel = JSON.parse(fs.readFileSync(kernelPath, "utf8"));
const original = JSON.parse(fs.readFileSync(originalPath, "utf8"));
const report = {
schema: "freecad-web-p6-import-geometry-family-r1/v1",
taskId: "FW-P6-FPA-D1-IMPORT-R1",
result: "blocked",
target: { name: "App::FeaturePython", status: "blocked", error: { code: "type_not_found", message: "Import Python module does not register App::FeaturePython" } },
realStepFixture: { status: kernel.result, objectType: kernel.first.summary.objectType, objects: kernel.first.summary.objects, parts: kernel.first.summary.parts, solids: kernel.first.summary.solids, volume: kernel.first.summary.volume, deterministic: kernel.deterministic, activeAfterRelease: kernel.first.activeAfterRelease, fixtureSha256: kernel.input.sha256 },
originalFailure: { evidence: "docs/p6/import-geometry-family-kernel.json", sha256: crypto.createHash("sha256").update(fs.readFileSync(originalPath)).digest("hex"), error: original.type.error },
sourceBacked: true,
boundaries: ["The official Import STEP path creates Part::Feature objects; App::FeaturePython remains an App/Python object boundary.", "No missing fixture is treated as a pass and the original failure evidence is preserved."],
};
fs.writeFileSync(path.join(docs, "import-geometry-family-r1.json"), `${JSON.stringify(report, null, 2)}\n`);
fs.writeFileSync(path.join(root, "docs", "freecad-p6-import-geometry-family-r1.log"), `result=${report.result}\nobjectType=${report.realStepFixture.objectType}\nobjects=${report.realStepFixture.objects}\nactiveAfterRelease=${report.realStepFixture.activeAfterRelease}\ntarget=${report.target.name}\nerrorCode=${report.target.error.code}\n`);
console.log(JSON.stringify({ result: report.result, target: report.target.name, errorCode: report.target.error.code, realStep: report.realStepFixture }));