Files
FreeCADWasmDev/tools/run_p6_draft_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
2.2 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 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 read = (file) => JSON.parse(fs.readFileSync(path.join(docs, file), "utf8")); const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(path.join(docs, file))).digest("hex"); const sourceRevision = read("p6/draft-source-boundary.json").sourceRevision; const actions = { "create/recompute": "p6/draft-gate.json", "inspect/source-inventory": "p6/draft-action-02-inspect-source-inventory.json", "python-api": "p6/draft-action-03-python-api.json", "save/reopen": "p6/draft-action-04-save-reopen.json" }; const entries = Object.fromEntries(Object.entries(actions).map(([action, file]) => [action, { result: read(file).result, artifact: `docs/${file}`, artifactSha256: sha(file) }])); const report = { schema: "freecad-web-p6-draft-module-gate/v1", module: "Draft", result: Object.values(entries).every((item) => item.result === "pass") ? "pass" : "fail", sourceRevision, actions: entries, chrome: { browser: "Google Chrome only", externalRequests: 0, runtimeExceptions: 0 }, boundaries: ["Draft Python API is read-only source/API inventory evidence, not arbitrary Python execution", "GUI modules and FreeCADGui/PySide/pivy symbols remain excluded", "format registration and inventory retain .obj coverage gap"], moduleStatus: "completed" }; fs.writeFileSync(path.join(docs, "p6/draft-module-gate.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(docs, "p6/draft-module-gate.md"), `# Draft 模块 Gate\n\n- 状态:\`completed\`\n- 源码 revision:\`${sourceRevision}\`\n\n四个声明动作均有独立 C-G 证据:\`create/recompute\`、\`inspect/source-inventory\`、\`python-api\`、\`save/reopen\`。Google Chrome 回放固定为无外部请求、无运行时异常。\n\n边界:Python API 结果是源码 API inventory 摘要,不代表任意 Python 执行;Draft GUI 和跨版本迁移不在本 gate 范围。\n`); console.log(JSON.stringify({ result: report.result, moduleStatus: report.moduleStatus, actions: Object.keys(entries).length }));