Files
FreeCADWasmDev/tools/run_p6_help_module_gate.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.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env node
import assert from "node:assert/strict"; 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 names = ["help-gate.json", "help-action-02-python-api.json", "help-action-02-kernel.json", "help-action-02-recovery.json", "help-action-02-facade.json", "help-action-02-chrome.json", "help-action-02-persistence.json"]; const files = names.map((name) => path.join(docs, "p6", name)); files.forEach((file) => assert.ok(fs.existsSync(file), file)); const action = JSON.parse(fs.readFileSync(files[1], "utf8")); const results = files.slice(2).map((file) => JSON.parse(fs.readFileSync(file, "utf8"))); assert.ok(results.every((item) => item.result === "pass")); const evidence = Object.fromEntries(files.map((file) => [path.basename(file), crypto.createHash("sha256").update(fs.readFileSync(file)).digest("hex")])); const report = { schema: "freecad-web-p6-help-module-gate/v1", module: "Help", result: "pass", declaredActions: ["inspect/source-inventory", "python-api"], actionResults: { "inspect/source-inventory": "pass", "python-api": "pass" }, evidence, webStatus: "completed", conclusion: "两个声明动作均有独立 C-G 证据;Help 模块晋级 completed" }; fs.writeFileSync(path.join(docs, "p6/help-module-gate.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(docs, "p6/help-module-gate.md"), `# Help 模块 Gate\n\n- 结果:\`pass\`\n- \\`inspect/source-inventory\\`:首切片 A-G 通过。\n- \\`python-api\\`:动作级 C-G 通过,API 计数 14,只读。\n- Web 状态:\`completed\`。\n- Chrome 证据:外部请求 0,运行时异常 0。\n`); console.log(JSON.stringify({ result: report.result, webStatus: report.webStatus, actions: report.actionResults }));