4 lines
1.7 KiB
JavaScript
4 lines
1.7 KiB
JavaScript
#!/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 evidence = ["help-source-boundary.json", "help-runtime.json", "help-kernel.json", "help-recovery.json", "help-facade.json", "help-chrome.json", "help-persistence.json"].map((name) => path.join(docs, "p6", name)); const hashes = Object.fromEntries(evidence.map((file) => [path.basename(file), crypto.createHash("sha256").update(fs.readFileSync(file)).digest("hex")])); evidence.forEach((file) => assert.ok(fs.existsSync(file), file)); const chrome = JSON.parse(fs.readFileSync(evidence[5], "utf8")); assert.equal(chrome.result, "pass"); const report = { schema: "freecad-web-p6-help-gate/v1", module: "Help", result: "pass", gate: "首切片", sourceRevision: JSON.parse(fs.readFileSync(evidence[0], "utf8")).sourceRevision, coveredAction: "inspect/source-inventory", evidence: hashes, uncoveredActions: ["python-api"], moduleStatus: "pending", conclusion: "首切片 A-G 独立合同通过;python-api 保持 pending,不能由首切片推断模块完成" }; fs.writeFileSync(path.join(docs, "p6/help-gate.json"), `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync(path.join(docs, "p6/help-gate.md"), `# Help 首切片 Gate\n\n- 结果:\`pass\`\n- 覆盖动作:\`inspect/source-inventory\`\n- Chrome:外部请求 0,运行时异常 0\n- 未覆盖动作:\`python-api\`;模块状态保持 \`pending\`。\n- 证据 hash:见 \`help-gate.json\`。\n`); console.log(JSON.stringify({ result: report.result, uncoveredActions: report.uncoveredActions }));
|