feat: v2.0 iteration — test coverage, reliability, observability
M0: Test coverage expansion (151 → 321 tests, 61% → 66% lines) - normalizeKnowledge CRLF/LF normalization fix - gooseReviewer: 11 tests, 97.35% coverage - r2 storage: 22 tests, 100% coverage - triage processor: 11 tests, exported buildTriagePrompt/labelName - webhook processor: 35 tests, 72.39% coverage - conflict resolver: 12 tests - review processor: 7 tests M1: Reliability hardening - Smart retry with jitter, maxTotalTimeoutMs, custom retryable predicate - MergeGuard: in-memory merge dedup tracker (100% coverage) - failureMessages: 7-category failure classifier (100% coverage) M2: Observability - MetricsCollector: Actions-run metrics with snapshot/markdown/reset - 11 tests, 100% coverage New files: 12 test files, 3 source modules All gates: typecheck ✓ lint ✓ format ✓ 321/321 tests ✓ build ✓
This commit is contained in:
1 parent
db53296d78
commit
78bf8e9e41
87 files changed
+6003
-2587
No files matched your search
@@ -17,7 +17,9 @@ function run(cmd) {
|
||||
// 1) 暂存区生成物防护:graft/、.codegraph/、.code-review-graph/、dist/ 等不允许进仓库。
|
||||
const staged = run("git diff --cached --name-only").split("\n").filter(Boolean);
|
||||
const blockedPrefixes = ["graft/", ".codegraph/", ".code-review-graph/", "dist/", ".ghbot-tmp/"];
|
||||
const blocked = staged.filter((file) => blockedPrefixes.some((p) => file === p.slice(0, -1) || file.startsWith(p)));
|
||||
const blocked = staged.filter((file) =>
|
||||
blockedPrefixes.some((p) => file === p.slice(0, -1) || file.startsWith(p))
|
||||
);
|
||||
if (blocked.length > 0) {
|
||||
console.error("[pre-commit] BLOCKED:以下生成物/索引文件被暂存,已拒绝提交:");
|
||||
blocked.forEach((f) => console.error(` - ${f}`));
|
||||
@@ -33,9 +35,15 @@ if (changedTs.length > 0) {
|
||||
const tsc = run("npm run typecheck");
|
||||
if (tsc && /error TS\d+/.test(tsc)) {
|
||||
console.error("[pre-commit] TypeScript 类型错误,已阻止提交:");
|
||||
console.error(tsc.split("\n").filter((l) => /error TS/.test(l)).slice(0, 20).join("\n"));
|
||||
console.error(
|
||||
tsc
|
||||
.split("\n")
|
||||
.filter((l) => /error TS/.test(l))
|
||||
.slice(0, 20)
|
||||
.join("\n")
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
process.exit(0);
|
||||
process.exit(0);
|
||||
Reference in new issue
Block a user