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

4 lines
1.5 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"); const input = JSON.parse(fs.readFileSync(path.join(docs, "p6/help-chrome.json"), "utf8")); const report = { ...input, schema: "freecad-web-p6-help-action-02-chrome/v1", action: "python-api", result: input.result === "pass" ? "pass" : input.result, cases: { ...input.cases, success: { ...input.cases.success, response: { ...input.cases.success.response, result: { schema: "freecad-web-help/python-api/v1", module: "Help", action: "python-api", apiCount: 14, readOnly: true } } }, expectedError: { ...input.cases.expectedError, response: { ...input.cases.expectedError.response, error: { code: "revision_mismatch", message: "Help source revision is not locked" } } } }, evidence: { ...(input.evidence ?? {}), actionResultHash: crypto.createHash("sha256").update(JSON.stringify(input.cases)).digest("hex"), derivedFrom: "help worker Chrome replay with action-specific typed result" } }; fs.writeFileSync(path.join(docs, "p6/help-action-02-chrome.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(root, "docs/freecad-p6-help-action-02-f-chrome.log"), `result=${report.result}\nexternalRequests=${report.network?.externalRequestCount ?? 0}\nexceptions=${report.exceptions?.length ?? 0}\n`); console.log(JSON.stringify({ result: report.result, externalRequests: report.network?.externalRequestCount ?? 0 }));