fix: 收口模板契约与安全门禁
统一模板包 visual 契约并补齐完成证据;修复 release 版本一致性、管理员 token 撤销、CORS 与默认品牌配置;收敛依赖安全风险并完成全量回归验证。
This commit is contained in:
1 parent
456171aa85
commit
4f0b50c7f1
84 files changed
+7367
-5180
No files matched your search
@@ -1,7 +1,11 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { applyManualReview, diagnoseTemplate } from "./lib/template-doctor.mjs";
|
||||
import {
|
||||
applyCompletionEvidence,
|
||||
applyManualReview,
|
||||
diagnoseTemplate,
|
||||
} from "./lib/template-doctor.mjs";
|
||||
|
||||
try {
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
@@ -31,14 +35,30 @@ try {
|
||||
);
|
||||
const registry = JSON.parse(fs.readFileSync(registryPath, "utf8"));
|
||||
applyManualReview(reports, registry.items, registry.scope);
|
||||
const report = { schemaVersion: 1, completionStatus: "unverified", templates: reports };
|
||||
const evidencePath = path.join(
|
||||
root,
|
||||
".codex-tasks/template-audit-execution/raw/completion-evidence.json",
|
||||
);
|
||||
const evidence = fs.existsSync(evidencePath)
|
||||
? JSON.parse(fs.readFileSync(evidencePath, "utf8"))
|
||||
: undefined;
|
||||
const completion = applyCompletionEvidence(reports, evidence, root);
|
||||
const report = {
|
||||
schemaVersion: 1,
|
||||
completionStatus: completion.completionStatus,
|
||||
templates: reports,
|
||||
};
|
||||
const output = JSON.stringify(report, null, 2) + "\n";
|
||||
if (options["--output"]) {
|
||||
fs.mkdirSync(path.dirname(path.resolve(options["--output"])), { recursive: true });
|
||||
fs.writeFileSync(options["--output"], output);
|
||||
}
|
||||
process.stdout.write(output);
|
||||
process.exitCode = reports.some((r) => r.staticStatus === "fail") ? 1 : 0;
|
||||
process.exitCode = reports.some(
|
||||
(r) => r.staticStatus === "fail" || r.completionStatus === "incomplete",
|
||||
)
|
||||
? 1
|
||||
: 0;
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
process.exitCode = 2;
|
||||
|
||||
Reference in new issue
Block a user