rungate 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +14 -3
- package/.claude/agents/aditi.md +0 -47
- package/.claude/agents/marcus.md +0 -50
- package/.claude/agents/quinn.md +0 -58
- package/.claude/agents/rook.md +0 -47
- package/.claude/agents/serena.md +0 -46
- package/.claude/rungate.json +0 -11
- package/.fallowrc.json +0 -28
- package/.github/copilot-instructions.md +0 -20
- package/.rungate/conformity-findings.json +0 -648
- package/AGENTS.md +0 -106
- package/CODE-MAP.md +0 -50
- package/HARNESS.md +0 -88
- package/bun.lock +0 -26
- package/bunfig.toml +0 -2
- package/config/brief-policies.json +0 -28
- package/config/ceremony-profiles.json +0 -212
- package/config/consumer-cascade-map.json +0 -24
- package/config/doc-cascade-map.json +0 -24
- package/config/eval.json +0 -84
- package/config/profiles/account-plan.yaml +0 -36
- package/config/profiles/campaign.yaml +0 -94
- package/config/prove-evidence.schema.json +0 -65
- package/config/spec-policies.json +0 -36
- package/config/workflow-schema.json +0 -281
- package/gates/SCHEMA-GUIDE.md +0 -121
- package/gates/ac-quality.test.ts +0 -106
- package/gates/adversarial.test.ts +0 -274
- package/gates/brief-assembler.test.ts +0 -429
- package/gates/brief-assembler.ts +0 -334
- package/gates/bunfig.toml +0 -2
- package/gates/chain.test.ts +0 -91
- package/gates/e2e-smoke.test.ts +0 -234
- package/gates/error-classifier.test.ts +0 -249
- package/gates/error-classifier.ts +0 -89
- package/gates/orchestrator.test.ts +0 -950
- package/gates/orchestrator.ts +0 -569
- package/gates/preload.ts +0 -77
- package/gates/prompts/ac-adversary.md +0 -20
- package/gates/prompts/evidence-validator.md +0 -22
- package/gates/prompts/prove-reproducer.md +0 -53
- package/gates/prove.test.ts +0 -164
- package/gates/run-gate.ts +0 -936
- package/gates/schema-parity.test.ts +0 -197
- package/gates/schema.ts +0 -362
- package/gates/self-heal.test.ts +0 -511
- package/gates/self-heal.ts +0 -121
- package/gates/ship-orchestrator.test.ts +0 -379
- package/gates/ship-orchestrator.ts +0 -363
- package/gates/test-fixtures/broken-no-environments.json +0 -60
- package/gates/test-fixtures/valid-standard.json +0 -54
- package/gates/test-utils.ts +0 -43
- package/gates/witness.ts +0 -220
- package/gates/workflow.test.ts +0 -1053
- package/hooks/AgentBriefGuard.hook.ts +0 -586
- package/hooks/AgentVerdictCapture.hook.ts +0 -134
- package/hooks/AutoVerifyGate.hook.ts +0 -76
- package/hooks/GateEnforcement.hook.ts +0 -273
- package/hooks/IssueCloseGuard.hook.ts +0 -116
- package/hooks/MergeGuard.hook.ts +0 -55
- package/hooks/StaleTTLCleanup.hook.ts +0 -133
- package/hooks/VerifyPhaseLock.hook.ts +0 -81
- package/hooks/WorkflowStateGuard.hook.ts +0 -37
- package/hooks/lib/agentDetection.ts +0 -70
- package/hooks/lib/findWorkflow.ts +0 -101
- package/hooks/lib/parseStdin.ts +0 -37
- package/hooks/lib/paths.ts +0 -111
- package/hooks/lib/utils.ts +0 -81
- package/reference/migration-manifest.json +0 -554
- package/reference/prompts/agent-aditi.md +0 -38
- package/reference/prompts/agent-marcus.md +0 -38
- package/reference/prompts/agent-quinn.md +0 -38
- package/reference/prompts/agent-rook.md +0 -37
- package/reference/prompts/agent-serena.md +0 -37
- package/reference/prompts/council-skill.md +0 -170
- package/reference/prompts/goal-skill.md +0 -235
- package/reference/prompts/prove-skill.md +0 -283
- package/reference/prompts/quinn-standard.md +0 -246
- package/reference/prompts/ship-convergence.md +0 -65
- package/reference/prompts/ship-escalation.md +0 -43
- package/reference/prompts/ship-iteration.md +0 -382
- package/reference/prompts/ship-pending-patches.md +0 -246
- package/reference/prompts/ship-reference.md +0 -250
- package/reference/prompts/ship-skill.md +0 -347
- package/reference/prompts/ship-templates.md +0 -215
- package/reference/scripts/batch-status.sh +0 -68
- package/reference/scripts/chain-compat-check.sh +0 -67
- package/reference/scripts/context-audit.sh +0 -314
- package/reference/scripts/dead-export-check.sh +0 -61
- package/reference/scripts/generate-qc-tables.sh +0 -92
- package/reference/scripts/harness-init.sh +0 -111
- package/reference/scripts/pai-054-baseline-check.sh +0 -40
- package/reference/scripts/prove-smoke-test.sh +0 -112
- package/reference/scripts/setup-keychain-salt.sh +0 -12
- package/reference/scripts/skill-optimizer-friday.sh +0 -88
- package/reference/scripts/skill-qc-test.sh +0 -351
- package/reference/scripts/skill-synthesize-tonight.sh +0 -66
- package/reference/specs/HARNESS-EXTRACTION-SPEC.md +0 -263
- package/reference/specs/harness-v3-bash-deletion-plan.md +0 -65
- package/reference/specs/harness-v3-migration-plan.md +0 -188
- package/scripts/decision-reconcile.sh +0 -74
- package/scripts/decision-reconcile.ts +0 -152
- package/scripts/git-hooks/pre-commit +0 -76
- package/scripts/git-hooks/pre-push +0 -271
- package/scripts/harness-skill-check.sh +0 -52
- package/scripts/lib/gap-emit.sh +0 -65
- package/scripts/lib/jq-update.sh +0 -30
- package/scripts/lib/resolve-slug.sh +0 -30
- package/scripts/lib/verify-spec-compliance.sh +0 -102
- package/scripts/prove-backfill.sh +0 -87
- package/scripts/scaffold-rungate-config.ts +0 -91
- package/scripts/self-containment-check.sh +0 -109
- package/scripts/skill-qc-validator.sh +0 -402
- package/scripts/slug-resolver.sh +0 -14
- package/specs/BOOTSTRAP-DATA-FLOW-SPEC.md +0 -2493
- package/specs/BOOTSTRAP-TEST-PLAN.md +0 -571
- package/specs/HARNESS-GATES.md +0 -256
- package/specs/HARNESS-SKILL-CHAIN.md +0 -286
- package/specs/HARNESS-SKILL-CONTRACT.md +0 -93
- package/specs/HARNESS-STANDARD.md +0 -488
- package/specs/SPEC-TEMPLATE.md +0 -53
- package/specs/bootstrap-data-flow.png +0 -0
- package/specs/harness-automation-matrix.md +0 -314
- package/specs/harness-automation-matrix.rules.json +0 -64
- package/test/anti.test.ts +0 -80
- package/test/contract-negative.test.ts +0 -86
- package/test/contract.test.ts +0 -158
- package/test/external-deps.test.ts +0 -48
- package/test/fixtures/golden-project/.env.example +0 -3
- package/test/fixtures/golden-project/Makefile +0 -7
- package/test/fixtures/golden-project/docs/adr/ADR-001-framework.md +0 -23
- package/test/fixtures/golden-project/docs/setup-guide.md +0 -10
- package/test/fixtures/golden-project/package.json +0 -10
- package/test/fixtures/golden-project/specs/api-spec.md +0 -20
- package/test/fixtures/golden-project/src/auth.ts +0 -8
- package/test/fixtures/golden-project/src/db.ts +0 -11
- package/test/fixtures/golden-project/src/index.ts +0 -19
- package/test/fixtures/golden-project/src/utils/format.ts +0 -3
- package/test/fixtures/golden-project/test/auth.test.ts +0 -15
- package/test/fixtures/golden-project/tsconfig.json +0 -12
- package/test/meta-sc-coverage.test.ts +0 -159
- package/test/phase-0.test.ts +0 -846
- package/test/phase-1.test.ts +0 -617
- package/test/phase-2.test.ts +0 -620
- package/test/phase-3.test.ts +0 -99
- package/test/scaffold-conformity.test.ts +0 -8
- package/test/schema-canary.test.ts +0 -51
- package/test/spec-compliance-auto.test.ts +0 -64
- package/test/spec-compliance.test.ts +0 -295
- package/test/spec-discovery.test.ts +0 -68
- package/test/spec-drift.test.ts +0 -5
- package/test/structure.test.ts +0 -165
- package/test/unit/agent-brief-guard-ship.test.ts +0 -293
- package/test/unit/extract-constraints.test.ts +0 -145
- package/test/unit/issue-close-guard.test.ts +0 -204
- package/test/unit/scaffold-project.test.ts +0 -417
- package/test/unit/skill-cooccurrence.test.ts +0 -177
- package/test/unit/skill-sequence-logger.test.ts +0 -244
- package/test/unit/workflow-state-guard.test.ts +0 -95
- package/workflows/batch-ship.js +0 -295
- package/workflows/council.js +0 -481
- package/workflows/prove.js +0 -560
- package/workflows/ship.js +0 -789
- package/workflows/verify.js +0 -236
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { test, expect, describe } from "bun:test";
|
|
2
|
-
import { classifyFailures, type FailureCategory, type Classification } from "./error-classifier";
|
|
3
|
-
|
|
4
|
-
function fail(check: string, detail = ""): { check: string; result: string; detail: string } {
|
|
5
|
-
return { check, result: "FAIL", detail };
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
describe("error-classifier", () => {
|
|
9
|
-
describe("STATE category", () => {
|
|
10
|
-
test("workflow-state.json validates", () => {
|
|
11
|
-
const c = classifyFailures([fail("workflow-state.json validates", "schema error")]);
|
|
12
|
-
expect(c.category).toBe("STATE");
|
|
13
|
-
expect(c.retryable).toBe(true);
|
|
14
|
-
expect(c.regressionTarget).toBeUndefined();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
test("sourceSpecs-required", () => {
|
|
18
|
-
const c = classifyFailures([fail("sourceSpecs-required")]);
|
|
19
|
-
expect(c.category).toBe("STATE");
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
test("discovery-evidence", () => {
|
|
23
|
-
const c = classifyFailures([fail("discovery-evidence")]);
|
|
24
|
-
expect(c.category).toBe("STATE");
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
test("spec-elements-in-acs", () => {
|
|
28
|
-
const c = classifyFailures([fail("spec-elements-in-acs")]);
|
|
29
|
-
expect(c.category).toBe("STATE");
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
test("no 'DA should'", () => {
|
|
33
|
-
const c = classifyFailures([fail("no 'DA should'")]);
|
|
34
|
-
expect(c.category).toBe("STATE");
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
test("checks containing threshold", () => {
|
|
38
|
-
const c = classifyFailures([fail("weak-threshold-check")]);
|
|
39
|
-
expect(c.category).toBe("STATE");
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test("checks containing statement", () => {
|
|
43
|
-
const c = classifyFailures([fail("statement-length-check")]);
|
|
44
|
-
expect(c.category).toBe("STATE");
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
test("checks containing schema", () => {
|
|
48
|
-
const c = classifyFailures([fail("schema-version-check")]);
|
|
49
|
-
expect(c.category).toBe("STATE");
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
describe("CODE category", () => {
|
|
54
|
-
test("tests-pass", () => {
|
|
55
|
-
const c = classifyFailures([fail("tests-pass", "3 tests failed")]);
|
|
56
|
-
expect(c.category).toBe("CODE");
|
|
57
|
-
expect(c.retryable).toBe(true);
|
|
58
|
-
expect(c.regressionTarget).toBe("BUILD");
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
test("tsc-pass", () => {
|
|
62
|
-
const c = classifyFailures([fail("tsc-pass", "type errors")]);
|
|
63
|
-
expect(c.category).toBe("CODE");
|
|
64
|
-
expect(c.regressionTarget).toBe("BUILD");
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
test("code-committed", () => {
|
|
68
|
-
const c = classifyFailures([fail("code-committed")]);
|
|
69
|
-
expect(c.category).toBe("CODE");
|
|
70
|
-
expect(c.regressionTarget).toBe("BUILD");
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
test("brief-ac-alignment", () => {
|
|
74
|
-
const c = classifyFailures([fail("brief-ac-alignment")]);
|
|
75
|
-
expect(c.category).toBe("CODE");
|
|
76
|
-
expect(c.regressionTarget).toBe("BUILD");
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
describe("DISCOVERY category", () => {
|
|
81
|
-
test("ac-issue-alignment", () => {
|
|
82
|
-
const c = classifyFailures([fail("ac-issue-alignment")]);
|
|
83
|
-
expect(c.category).toBe("DISCOVERY");
|
|
84
|
-
expect(c.retryable).toBe(true);
|
|
85
|
-
expect(c.regressionTarget).toBe("DISCOVERY");
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
test("issue-goal-captured", () => {
|
|
89
|
-
const c = classifyFailures([fail("issue-goal-captured")]);
|
|
90
|
-
expect(c.category).toBe("DISCOVERY");
|
|
91
|
-
expect(c.regressionTarget).toBe("DISCOVERY");
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
test("sizing-declared", () => {
|
|
95
|
-
const c = classifyFailures([fail("sizing-declared")]);
|
|
96
|
-
expect(c.category).toBe("DISCOVERY");
|
|
97
|
-
expect(c.regressionTarget).toBe("DISCOVERY");
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
describe("ENVIRONMENT category", () => {
|
|
102
|
-
test("container-has-fix", () => {
|
|
103
|
-
const c = classifyFailures([fail("container-has-fix")]);
|
|
104
|
-
expect(c.category).toBe("ENVIRONMENT");
|
|
105
|
-
expect(c.retryable).toBe(true);
|
|
106
|
-
expect(c.regressionTarget).toBeUndefined();
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
test("local-api-validated", () => {
|
|
110
|
-
const c = classifyFailures([fail("local-api-validated")]);
|
|
111
|
-
expect(c.category).toBe("ENVIRONMENT");
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
test("local-ui-validated", () => {
|
|
115
|
-
const c = classifyFailures([fail("local-ui-validated")]);
|
|
116
|
-
expect(c.category).toBe("ENVIRONMENT");
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
test("prod-rebuild-pass", () => {
|
|
120
|
-
const c = classifyFailures([fail("prod-rebuild-pass")]);
|
|
121
|
-
expect(c.category).toBe("ENVIRONMENT");
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
test("prod-smoke-pass", () => {
|
|
125
|
-
const c = classifyFailures([fail("prod-smoke-pass")]);
|
|
126
|
-
expect(c.category).toBe("ENVIRONMENT");
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
test("prod-quinn-pass", () => {
|
|
130
|
-
const c = classifyFailures([fail("prod-quinn-pass")]);
|
|
131
|
-
expect(c.category).toBe("ENVIRONMENT");
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
test("code-pushed", () => {
|
|
135
|
-
const c = classifyFailures([fail("code-pushed")]);
|
|
136
|
-
expect(c.category).toBe("ENVIRONMENT");
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
test("branch-merged", () => {
|
|
140
|
-
const c = classifyFailures([fail("branch-merged")]);
|
|
141
|
-
expect(c.category).toBe("ENVIRONMENT");
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
describe("NON_RETRYABLE category", () => {
|
|
146
|
-
test("failure containing auth", () => {
|
|
147
|
-
const c = classifyFailures([fail("github-auth-check", "auth token expired")]);
|
|
148
|
-
expect(c.category).toBe("NON_RETRYABLE");
|
|
149
|
-
expect(c.retryable).toBe(false);
|
|
150
|
-
expect(c.regressionTarget).toBeUndefined();
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
test("failure containing credential", () => {
|
|
154
|
-
const c = classifyFailures([fail("credential-check", "no credentials")]);
|
|
155
|
-
expect(c.category).toBe("NON_RETRYABLE");
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
test("failure containing permission", () => {
|
|
159
|
-
const c = classifyFailures([fail("permission-denied", "insufficient")]);
|
|
160
|
-
expect(c.category).toBe("NON_RETRYABLE");
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
test("failure containing timeout", () => {
|
|
164
|
-
const c = classifyFailures([fail("api-timeout", "30s exceeded")]);
|
|
165
|
-
expect(c.category).toBe("NON_RETRYABLE");
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
test("unknown check defaults to NON_RETRYABLE", () => {
|
|
169
|
-
const c = classifyFailures([fail("totally-unknown-check-xyz")]);
|
|
170
|
-
expect(c.category).toBe("NON_RETRYABLE");
|
|
171
|
-
expect(c.retryable).toBe(false);
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
describe("priority ordering", () => {
|
|
176
|
-
test("NON_RETRYABLE beats everything", () => {
|
|
177
|
-
const c = classifyFailures([
|
|
178
|
-
fail("tests-pass"), // CODE
|
|
179
|
-
fail("api-timeout"), // NON_RETRYABLE
|
|
180
|
-
fail("container-has-fix"), // ENVIRONMENT
|
|
181
|
-
]);
|
|
182
|
-
expect(c.category).toBe("NON_RETRYABLE");
|
|
183
|
-
expect(c.retryable).toBe(false);
|
|
184
|
-
expect(c.failures).toHaveLength(3);
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
test("DISCOVERY beats CODE", () => {
|
|
188
|
-
const c = classifyFailures([
|
|
189
|
-
fail("tests-pass"), // CODE
|
|
190
|
-
fail("ac-issue-alignment"), // DISCOVERY
|
|
191
|
-
]);
|
|
192
|
-
expect(c.category).toBe("DISCOVERY");
|
|
193
|
-
expect(c.regressionTarget).toBe("DISCOVERY");
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
test("CODE beats STATE", () => {
|
|
197
|
-
const c = classifyFailures([
|
|
198
|
-
fail("workflow-state.json validates"), // STATE
|
|
199
|
-
fail("tsc-pass"), // CODE
|
|
200
|
-
]);
|
|
201
|
-
expect(c.category).toBe("CODE");
|
|
202
|
-
expect(c.regressionTarget).toBe("BUILD");
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
test("STATE beats ENVIRONMENT", () => {
|
|
206
|
-
const c = classifyFailures([
|
|
207
|
-
fail("container-has-fix"), // ENVIRONMENT
|
|
208
|
-
fail("sourceSpecs-required"), // STATE
|
|
209
|
-
]);
|
|
210
|
-
expect(c.category).toBe("STATE");
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
test("all categories mixed picks NON_RETRYABLE", () => {
|
|
214
|
-
const c = classifyFailures([
|
|
215
|
-
fail("container-has-fix"), // ENVIRONMENT
|
|
216
|
-
fail("sourceSpecs-required"), // STATE
|
|
217
|
-
fail("tests-pass"), // CODE
|
|
218
|
-
fail("ac-issue-alignment"), // DISCOVERY
|
|
219
|
-
fail("permission-check"), // NON_RETRYABLE
|
|
220
|
-
]);
|
|
221
|
-
expect(c.category).toBe("NON_RETRYABLE");
|
|
222
|
-
expect(c.failures).toHaveLength(5);
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
describe("edge cases", () => {
|
|
227
|
-
test("empty failures array", () => {
|
|
228
|
-
const c = classifyFailures([]);
|
|
229
|
-
expect(c.category).toBe("NON_RETRYABLE");
|
|
230
|
-
expect(c.retryable).toBe(false);
|
|
231
|
-
expect(c.failures).toHaveLength(0);
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
test("single failure preserves detail", () => {
|
|
235
|
-
const c = classifyFailures([fail("tests-pass", "AssertionError in foo.test.ts")]);
|
|
236
|
-
expect(c.failures[0].detail).toBe("AssertionError in foo.test.ts");
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
test("NON_RETRYABLE keyword in detail field does not trigger", () => {
|
|
240
|
-
const c = classifyFailures([fail("tests-pass", "auth module test failed")]);
|
|
241
|
-
expect(c.category).toBe("CODE");
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
test("case-insensitive NON_RETRYABLE check matching", () => {
|
|
245
|
-
const c = classifyFailures([fail("AUTH-TOKEN-EXPIRED")]);
|
|
246
|
-
expect(c.category).toBe("NON_RETRYABLE");
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export type FailureCategory = "STATE" | "CODE" | "DISCOVERY" | "ENVIRONMENT" | "NON_RETRYABLE";
|
|
2
|
-
|
|
3
|
-
export interface Classification {
|
|
4
|
-
category: FailureCategory;
|
|
5
|
-
regressionTarget?: "BUILD" | "DISCOVERY";
|
|
6
|
-
retryable: boolean;
|
|
7
|
-
failures: Array<{ check: string; result: string; detail: string }>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const PRIORITY: FailureCategory[] = ["NON_RETRYABLE", "DISCOVERY", "CODE", "STATE", "ENVIRONMENT"];
|
|
11
|
-
|
|
12
|
-
const STATE_CHECKS = new Set([
|
|
13
|
-
"workflow-state.json validates",
|
|
14
|
-
"sourceSpecs-required",
|
|
15
|
-
"discovery-evidence",
|
|
16
|
-
"spec-elements-in-acs",
|
|
17
|
-
"no 'DA should'",
|
|
18
|
-
]);
|
|
19
|
-
|
|
20
|
-
const CODE_CHECKS = new Set([
|
|
21
|
-
"tests-pass",
|
|
22
|
-
"tsc-pass",
|
|
23
|
-
"code-committed",
|
|
24
|
-
"brief-ac-alignment",
|
|
25
|
-
]);
|
|
26
|
-
|
|
27
|
-
const DISCOVERY_CHECKS = new Set([
|
|
28
|
-
"ac-issue-alignment",
|
|
29
|
-
"issue-goal-captured",
|
|
30
|
-
"sizing-declared",
|
|
31
|
-
]);
|
|
32
|
-
|
|
33
|
-
const ENVIRONMENT_CHECKS = new Set([
|
|
34
|
-
"container-has-fix",
|
|
35
|
-
"local-api-validated",
|
|
36
|
-
"local-ui-validated",
|
|
37
|
-
"prod-rebuild-pass",
|
|
38
|
-
"prod-smoke-pass",
|
|
39
|
-
"prod-quinn-pass",
|
|
40
|
-
"code-pushed",
|
|
41
|
-
"branch-merged",
|
|
42
|
-
]);
|
|
43
|
-
|
|
44
|
-
const STATE_KEYWORDS = ["threshold", "statement", "schema"];
|
|
45
|
-
const NON_RETRYABLE_KEYWORDS = ["auth", "credential", "permission", "timeout"];
|
|
46
|
-
|
|
47
|
-
function categorizeCheck(check: string): FailureCategory {
|
|
48
|
-
const lower = check.toLowerCase();
|
|
49
|
-
|
|
50
|
-
if (NON_RETRYABLE_KEYWORDS.some((kw) => lower.includes(kw))) return "NON_RETRYABLE";
|
|
51
|
-
if (STATE_CHECKS.has(check)) return "STATE";
|
|
52
|
-
if (CODE_CHECKS.has(check)) return "CODE";
|
|
53
|
-
if (DISCOVERY_CHECKS.has(check)) return "DISCOVERY";
|
|
54
|
-
if (ENVIRONMENT_CHECKS.has(check)) return "ENVIRONMENT";
|
|
55
|
-
if (STATE_KEYWORDS.some((kw) => lower.includes(kw))) return "STATE";
|
|
56
|
-
|
|
57
|
-
return "NON_RETRYABLE";
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const CATEGORY_META: Record<FailureCategory, { retryable: boolean; regressionTarget?: "BUILD" | "DISCOVERY" }> = {
|
|
61
|
-
STATE: { retryable: true },
|
|
62
|
-
CODE: { retryable: true, regressionTarget: "BUILD" },
|
|
63
|
-
DISCOVERY: { retryable: true, regressionTarget: "DISCOVERY" },
|
|
64
|
-
ENVIRONMENT: { retryable: true },
|
|
65
|
-
NON_RETRYABLE: { retryable: false },
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export function classifyFailures(
|
|
69
|
-
failures: Array<{ check: string; result: string; detail: string }>,
|
|
70
|
-
): Classification {
|
|
71
|
-
if (failures.length === 0) {
|
|
72
|
-
return { category: "NON_RETRYABLE", retryable: false, failures: [] };
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const categories = new Set<FailureCategory>();
|
|
76
|
-
for (const f of failures) {
|
|
77
|
-
categories.add(categorizeCheck(f.check));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const winner = PRIORITY.find((p) => categories.has(p)) ?? "NON_RETRYABLE";
|
|
81
|
-
const meta = CATEGORY_META[winner];
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
category: winner,
|
|
85
|
-
retryable: meta.retryable,
|
|
86
|
-
regressionTarget: meta.regressionTarget,
|
|
87
|
-
failures,
|
|
88
|
-
};
|
|
89
|
-
}
|