7 lines
1.8 KiB
JavaScript
7 lines
1.8 KiB
JavaScript
import crypto from "node:crypto"; import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url";
|
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
const input = { action: "python-api", module: "PartDesign", sourceEntry: "src/Mod/PartDesign/App/AppPartDesignPy.cpp", readOnly: true, documentMutation: false };
|
|
const result = { applicable: false, reason: "Python API inventory reads module exports and does not create or mutate a FreeCAD document; FCStd round-trip is not applicable.", readOnly: true, documentMutation: false, persistenceFormat: null, nativeDocumentsCreated: 0, externalRequests: 0 };
|
|
const report = { schema: "freecad-web-partdesign-action-03-persistence/v1", task_id: "FW-P6-PDN-ACT-03-G", module: "PartDesign", action: "python-api", status: "pass_boundary", input_sha256: crypto.createHash("sha256").update(JSON.stringify(input)).digest("hex"), result, result_sha256: crypto.createHash("sha256").update(JSON.stringify(result)).digest("hex"), commands: ["node tools/run_p6_partdesign_action03_persistence.mjs"], evidence: { chrome: "docs/p6/partdesign-action-03-chrome.json", screenshotSha256: "06d50e6e86da4763b4fa1d5717ae0acfdbbc0574d5c65f6673486a484c744dcc" }, boundaries: ["No document is created by the native Python API inventory, so no FCStd save/reopen claim is made.", "PartDesign save/reopen is a separate action contract."] };
|
|
fs.writeFileSync(path.join(root, "docs/p6/partdesign-action-03-persistence.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(root, "docs/freecad-p6-partdesign-action-03-g-persistence.log"), `${JSON.stringify({ status: report.status, applicable: result.applicable, resultSha256: report.result_sha256 })}\n`); console.log(JSON.stringify({ status: report.status, applicable: result.applicable, resultSha256: report.result_sha256 }));
|