@kevinrabun/judges 3.54.0 → 3.56.0
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/CHANGELOG.md +24 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +112 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/api-versioning-audit.d.ts +6 -0
- package/dist/commands/api-versioning-audit.d.ts.map +1 -0
- package/dist/commands/api-versioning-audit.js +234 -0
- package/dist/commands/api-versioning-audit.js.map +1 -0
- package/dist/commands/boundary-enforce.d.ts +6 -0
- package/dist/commands/boundary-enforce.d.ts.map +1 -0
- package/dist/commands/boundary-enforce.js +256 -0
- package/dist/commands/boundary-enforce.js.map +1 -0
- package/dist/commands/build-optimize.d.ts +7 -0
- package/dist/commands/build-optimize.d.ts.map +1 -0
- package/dist/commands/build-optimize.js +257 -0
- package/dist/commands/build-optimize.js.map +1 -0
- package/dist/commands/commit-hygiene.d.ts +6 -0
- package/dist/commands/commit-hygiene.d.ts.map +1 -0
- package/dist/commands/commit-hygiene.js +176 -0
- package/dist/commands/commit-hygiene.js.map +1 -0
- package/dist/commands/deploy-readiness.d.ts +6 -0
- package/dist/commands/deploy-readiness.d.ts.map +1 -0
- package/dist/commands/deploy-readiness.js +212 -0
- package/dist/commands/deploy-readiness.js.map +1 -0
- package/dist/commands/error-taxonomy.d.ts +6 -0
- package/dist/commands/error-taxonomy.d.ts.map +1 -0
- package/dist/commands/error-taxonomy.js +227 -0
- package/dist/commands/error-taxonomy.js.map +1 -0
- package/dist/commands/log-quality.d.ts +6 -0
- package/dist/commands/log-quality.d.ts.map +1 -0
- package/dist/commands/log-quality.js +212 -0
- package/dist/commands/log-quality.js.map +1 -0
- package/dist/commands/migration-safety.d.ts +6 -0
- package/dist/commands/migration-safety.d.ts.map +1 -0
- package/dist/commands/migration-safety.js +257 -0
- package/dist/commands/migration-safety.js.map +1 -0
- package/dist/commands/null-safety-audit.d.ts +6 -0
- package/dist/commands/null-safety-audit.d.ts.map +1 -0
- package/dist/commands/null-safety-audit.js +222 -0
- package/dist/commands/null-safety-audit.js.map +1 -0
- package/dist/commands/observability-gap.d.ts +6 -0
- package/dist/commands/observability-gap.d.ts.map +1 -0
- package/dist/commands/observability-gap.js +212 -0
- package/dist/commands/observability-gap.js.map +1 -0
- package/dist/commands/ownership-map.d.ts +6 -0
- package/dist/commands/ownership-map.d.ts.map +1 -0
- package/dist/commands/ownership-map.js +229 -0
- package/dist/commands/ownership-map.js.map +1 -0
- package/dist/commands/retry-pattern-audit.d.ts +6 -0
- package/dist/commands/retry-pattern-audit.d.ts.map +1 -0
- package/dist/commands/retry-pattern-audit.js +216 -0
- package/dist/commands/retry-pattern-audit.js.map +1 -0
- package/dist/commands/rollback-safety.d.ts +5 -0
- package/dist/commands/rollback-safety.d.ts.map +1 -0
- package/dist/commands/rollback-safety.js +192 -0
- package/dist/commands/rollback-safety.js.map +1 -0
- package/dist/commands/secret-age.d.ts +6 -0
- package/dist/commands/secret-age.d.ts.map +1 -0
- package/dist/commands/secret-age.js +215 -0
- package/dist/commands/secret-age.js.map +1 -0
- package/dist/commands/test-isolation.d.ts +6 -0
- package/dist/commands/test-isolation.d.ts.map +1 -0
- package/dist/commands/test-isolation.js +235 -0
- package/dist/commands/test-isolation.js.map +1 -0
- package/dist/commands/test-quality.d.ts +6 -0
- package/dist/commands/test-quality.d.ts.map +1 -0
- package/dist/commands/test-quality.js +161 -0
- package/dist/commands/test-quality.js.map +1 -0
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deploy readiness — pre-deployment checklist that validates
|
|
3
|
+
* AI-generated code is production-ready.
|
|
4
|
+
*/
|
|
5
|
+
import { readFileSync, readdirSync, statSync, existsSync } from "fs";
|
|
6
|
+
import { join, extname } from "path";
|
|
7
|
+
// ─── File Collection ────────────────────────────────────────────────────────
|
|
8
|
+
const CODE_EXTS = new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".py", ".java", ".go", ".rs"]);
|
|
9
|
+
function collectFiles(dir, max = 300) {
|
|
10
|
+
const files = [];
|
|
11
|
+
function walk(d) {
|
|
12
|
+
if (files.length >= max)
|
|
13
|
+
return;
|
|
14
|
+
let entries;
|
|
15
|
+
try {
|
|
16
|
+
entries = readdirSync(d);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
for (const e of entries) {
|
|
22
|
+
if (files.length >= max)
|
|
23
|
+
return;
|
|
24
|
+
if (e.startsWith(".") || e === "node_modules" || e === "dist" || e === "build")
|
|
25
|
+
continue;
|
|
26
|
+
const full = join(d, e);
|
|
27
|
+
try {
|
|
28
|
+
if (statSync(full).isDirectory())
|
|
29
|
+
walk(full);
|
|
30
|
+
else if (CODE_EXTS.has(extname(full)))
|
|
31
|
+
files.push(full);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
/* skip */
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
walk(dir);
|
|
39
|
+
return files;
|
|
40
|
+
}
|
|
41
|
+
function allContent(files) {
|
|
42
|
+
return files
|
|
43
|
+
.map((f) => {
|
|
44
|
+
try {
|
|
45
|
+
return readFileSync(f, "utf-8");
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return "";
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
.join("\n");
|
|
52
|
+
}
|
|
53
|
+
// ─── Checks ─────────────────────────────────────────────────────────────────
|
|
54
|
+
function runChecks(dir) {
|
|
55
|
+
const checks = [];
|
|
56
|
+
const files = collectFiles(dir);
|
|
57
|
+
const content = allContent(files);
|
|
58
|
+
// Health check endpoint
|
|
59
|
+
const hasHealthCheck = /\/(health|healthz|readyz|livez|status)\b/.test(content);
|
|
60
|
+
checks.push({
|
|
61
|
+
name: "Health check endpoint",
|
|
62
|
+
status: hasHealthCheck ? "pass" : "fail",
|
|
63
|
+
detail: hasHealthCheck ? "Health check endpoint found" : "No /health or /healthz endpoint detected",
|
|
64
|
+
category: "availability",
|
|
65
|
+
});
|
|
66
|
+
// Graceful shutdown
|
|
67
|
+
const hasGraceful = /process\.on\s*\(\s*['"]SIG(TERM|INT)['"]|graceful.?shutdown|server\.close/i.test(content);
|
|
68
|
+
checks.push({
|
|
69
|
+
name: "Graceful shutdown handler",
|
|
70
|
+
status: hasGraceful ? "pass" : "warn",
|
|
71
|
+
detail: hasGraceful ? "SIGTERM/SIGINT handler found" : "No graceful shutdown handler — may lose in-flight requests",
|
|
72
|
+
category: "availability",
|
|
73
|
+
});
|
|
74
|
+
// Environment variable validation
|
|
75
|
+
const envRefs = (content.match(/process\.env\.\w+|os\.environ|System\.getenv/g) || []).length;
|
|
76
|
+
const envValidation = /process\.env\.\w+\s*\|\||required|assert.*env|validateEnv|env\.parse/i.test(content);
|
|
77
|
+
checks.push({
|
|
78
|
+
name: "Environment variable validation",
|
|
79
|
+
status: envRefs > 0 && envValidation ? "pass" : envRefs > 0 ? "warn" : "pass",
|
|
80
|
+
detail: envRefs > 0
|
|
81
|
+
? envValidation
|
|
82
|
+
? `${envRefs} env vars with validation`
|
|
83
|
+
: `${envRefs} env vars but no validation at startup`
|
|
84
|
+
: "No environment variables detected",
|
|
85
|
+
category: "configuration",
|
|
86
|
+
});
|
|
87
|
+
// Rate limiting
|
|
88
|
+
const hasRateLimit = /rate.?limit|throttle|express-rate-limit|fastify-rate-limit|@nestjs\/throttler/i.test(content);
|
|
89
|
+
checks.push({
|
|
90
|
+
name: "Rate limiting",
|
|
91
|
+
status: hasRateLimit ? "pass" : "warn",
|
|
92
|
+
detail: hasRateLimit ? "Rate limiting configured" : "No rate limiting detected — vulnerable to abuse",
|
|
93
|
+
category: "security",
|
|
94
|
+
});
|
|
95
|
+
// CORS configuration
|
|
96
|
+
const hasCors = /cors\(|Access-Control-Allow-Origin|@CrossOrigin/i.test(content);
|
|
97
|
+
const permissiveCors = /cors\(\s*\)|Allow-Origin.*\*/i.test(content);
|
|
98
|
+
checks.push({
|
|
99
|
+
name: "CORS configuration",
|
|
100
|
+
status: hasCors && !permissiveCors ? "pass" : permissiveCors ? "warn" : hasCors ? "pass" : "pass",
|
|
101
|
+
detail: permissiveCors
|
|
102
|
+
? "CORS is permissive (allow-all) — restrict origins in production"
|
|
103
|
+
: hasCors
|
|
104
|
+
? "CORS configured"
|
|
105
|
+
: "No CORS detected (may be OK for backend-only services)",
|
|
106
|
+
category: "security",
|
|
107
|
+
});
|
|
108
|
+
// Error handling
|
|
109
|
+
const hasGlobalErrorHandler = /app\.use\s*\(\s*\(err|@ExceptionHandler|exception_handler|error_handler/i.test(content);
|
|
110
|
+
checks.push({
|
|
111
|
+
name: "Global error handler",
|
|
112
|
+
status: hasGlobalErrorHandler ? "pass" : "warn",
|
|
113
|
+
detail: hasGlobalErrorHandler
|
|
114
|
+
? "Global error handler found"
|
|
115
|
+
: "No global error handler — uncaught errors may leak stack traces",
|
|
116
|
+
category: "reliability",
|
|
117
|
+
});
|
|
118
|
+
// Logging
|
|
119
|
+
const hasStructuredLogging = /winston|pino|bunyan|log4j|logging\.getLogger|slog\.|zerolog/i.test(content);
|
|
120
|
+
const consoleLogCount = (content.match(/console\.(log|debug)\s*\(/g) || []).length;
|
|
121
|
+
checks.push({
|
|
122
|
+
name: "Structured logging",
|
|
123
|
+
status: hasStructuredLogging ? "pass" : consoleLogCount > 10 ? "warn" : "pass",
|
|
124
|
+
detail: hasStructuredLogging
|
|
125
|
+
? "Structured logging framework detected"
|
|
126
|
+
: `${consoleLogCount} console.log calls — use a logging framework in production`,
|
|
127
|
+
category: "observability",
|
|
128
|
+
});
|
|
129
|
+
// Connection pool limits
|
|
130
|
+
const hasPool = /pool|createPool|connectionLimit|maxConnections|max_connections/i.test(content);
|
|
131
|
+
checks.push({
|
|
132
|
+
name: "Connection pool limits",
|
|
133
|
+
status: hasPool ? "pass" : "pass",
|
|
134
|
+
detail: hasPool ? "Connection pooling configured" : "No explicit connection pool detected (may be OK)",
|
|
135
|
+
category: "performance",
|
|
136
|
+
});
|
|
137
|
+
// Dockerfile / container
|
|
138
|
+
const hasDockerfile = existsSync(join(dir, "Dockerfile")) || existsSync(join(dir, "docker-compose.yml"));
|
|
139
|
+
const hasK8sProbes = /readinessProbe|livenessProbe|startupProbe/i.test(content);
|
|
140
|
+
if (hasDockerfile) {
|
|
141
|
+
checks.push({
|
|
142
|
+
name: "Container probes",
|
|
143
|
+
status: hasK8sProbes ? "pass" : "warn",
|
|
144
|
+
detail: hasK8sProbes ? "K8s readiness/liveness probes configured" : "Dockerfile found but no K8s probes detected",
|
|
145
|
+
category: "deployment",
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// HTTPS
|
|
149
|
+
const hasInsecureHttp = /['"]http:\/\/(?!localhost|127\.0\.0\.1)/i.test(content);
|
|
150
|
+
checks.push({
|
|
151
|
+
name: "HTTPS enforcement",
|
|
152
|
+
status: hasInsecureHttp ? "warn" : "pass",
|
|
153
|
+
detail: hasInsecureHttp ? "Insecure HTTP URLs detected — use HTTPS" : "No insecure HTTP URLs found",
|
|
154
|
+
category: "security",
|
|
155
|
+
});
|
|
156
|
+
// Timeout configuration
|
|
157
|
+
const hasTimeouts = /timeout|connectTimeout|socketTimeout|requestTimeout/i.test(content);
|
|
158
|
+
checks.push({
|
|
159
|
+
name: "Request timeouts",
|
|
160
|
+
status: hasTimeouts ? "pass" : "warn",
|
|
161
|
+
detail: hasTimeouts ? "Timeout configuration found" : "No explicit timeouts — requests may hang indefinitely",
|
|
162
|
+
category: "reliability",
|
|
163
|
+
});
|
|
164
|
+
return checks;
|
|
165
|
+
}
|
|
166
|
+
// ─── CLI ────────────────────────────────────────────────────────────────────
|
|
167
|
+
export function runDeployReadiness(argv) {
|
|
168
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
169
|
+
console.log(`
|
|
170
|
+
judges deploy-readiness — Pre-deployment production readiness checklist
|
|
171
|
+
|
|
172
|
+
Usage:
|
|
173
|
+
judges deploy-readiness [dir]
|
|
174
|
+
judges deploy-readiness src/ --format json
|
|
175
|
+
|
|
176
|
+
Options:
|
|
177
|
+
[dir] Directory to scan (default: .)
|
|
178
|
+
--format json JSON output
|
|
179
|
+
--help, -h Show this help
|
|
180
|
+
|
|
181
|
+
Checks: health endpoints, graceful shutdown, env validation, rate limiting,
|
|
182
|
+
CORS, error handling, logging, connection pools, container probes, HTTPS, timeouts
|
|
183
|
+
`);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const format = argv.find((_a, i) => argv[i - 1] === "--format") || "text";
|
|
187
|
+
const dir = argv.find((a) => !a.startsWith("-") && argv.indexOf(a) > 0) || ".";
|
|
188
|
+
const checks = runChecks(dir);
|
|
189
|
+
const passCount = checks.filter((c) => c.status === "pass").length;
|
|
190
|
+
const warnCount = checks.filter((c) => c.status === "warn").length;
|
|
191
|
+
const failCount = checks.filter((c) => c.status === "fail").length;
|
|
192
|
+
const score = Math.round((passCount / checks.length) * 100);
|
|
193
|
+
if (format === "json") {
|
|
194
|
+
console.log(JSON.stringify({
|
|
195
|
+
checks,
|
|
196
|
+
score,
|
|
197
|
+
summary: { pass: passCount, warn: warnCount, fail: failCount },
|
|
198
|
+
timestamp: new Date().toISOString(),
|
|
199
|
+
}, null, 2));
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
const badge = failCount > 0 ? "❌ NOT READY" : warnCount > 2 ? "⚠️ REVIEW" : "✅ READY";
|
|
203
|
+
console.log(`\n Deploy Readiness: ${badge} (${score}%)\n ──────────────────────────`);
|
|
204
|
+
for (const check of checks) {
|
|
205
|
+
const icon = check.status === "pass" ? "✅" : check.status === "warn" ? "⚠️" : "❌";
|
|
206
|
+
console.log(` ${icon} ${check.name}`);
|
|
207
|
+
console.log(` ${check.detail}`);
|
|
208
|
+
}
|
|
209
|
+
console.log(`\n Score: ${score}% | Pass: ${passCount} | Warn: ${warnCount} | Fail: ${failCount}\n`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=deploy-readiness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-readiness.js","sourceRoot":"","sources":["../../src/commands/deploy-readiness.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAWrC,+EAA+E;AAE/E,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAEhG,SAAS,YAAY,CAAC,GAAW,EAAE,GAAG,GAAG,GAAG;IAC1C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,SAAS,IAAI,CAAC,CAAS;QACrB,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG;YAAE,OAAO;QAChC,IAAI,OAAiB,CAAC;QACtB,IAAI,CAAC;YACH,OAAO,GAAG,WAAW,CAAC,CAAC,CAAwB,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;QACT,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACxB,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG;gBAAE,OAAO;YAChC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,cAAc,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,OAAO;gBAAE,SAAS;YACzF,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC;gBACH,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE;oBAAE,IAAI,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CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,aAAa,SAAS,YAAY,SAAS,YAAY,SAAS,IAAI,CAAC,CAAC;IACzG,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-taxonomy.d.ts","sourceRoot":"","sources":["../../src/commands/error-taxonomy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqMH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAyErD"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error taxonomy — classify and standardize error codes, messages, and
|
|
3
|
+
* hierarchies across a codebase.
|
|
4
|
+
*/
|
|
5
|
+
import { readFileSync, readdirSync, statSync } from "fs";
|
|
6
|
+
import { join, extname } from "path";
|
|
7
|
+
// ─── File Collection ────────────────────────────────────────────────────────
|
|
8
|
+
const CODE_EXTS = new Set([".ts", ".tsx", ".js", ".jsx", ".py", ".java", ".go", ".rs"]);
|
|
9
|
+
function collectFiles(dir, max = 300) {
|
|
10
|
+
const files = [];
|
|
11
|
+
function walk(d) {
|
|
12
|
+
if (files.length >= max)
|
|
13
|
+
return;
|
|
14
|
+
let entries;
|
|
15
|
+
try {
|
|
16
|
+
entries = readdirSync(d);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
for (const e of entries) {
|
|
22
|
+
if (files.length >= max)
|
|
23
|
+
return;
|
|
24
|
+
if (e.startsWith(".") || e === "node_modules" || e === "dist" || e === "build")
|
|
25
|
+
continue;
|
|
26
|
+
const full = join(d, e);
|
|
27
|
+
try {
|
|
28
|
+
if (statSync(full).isDirectory())
|
|
29
|
+
walk(full);
|
|
30
|
+
else if (CODE_EXTS.has(extname(full)))
|
|
31
|
+
files.push(full);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
/* skip */
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
walk(dir);
|
|
39
|
+
return files;
|
|
40
|
+
}
|
|
41
|
+
// ─── Extraction ─────────────────────────────────────────────────────────────
|
|
42
|
+
function extractErrors(filepath) {
|
|
43
|
+
const errors = [];
|
|
44
|
+
let content;
|
|
45
|
+
try {
|
|
46
|
+
content = readFileSync(filepath, "utf-8");
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return errors;
|
|
50
|
+
}
|
|
51
|
+
const lines = content.split("\n");
|
|
52
|
+
for (let i = 0; i < lines.length; i++) {
|
|
53
|
+
const line = lines[i];
|
|
54
|
+
// Error class definitions
|
|
55
|
+
const classMatch = line.match(/class\s+(\w*Error\w*)\s+extends/);
|
|
56
|
+
if (classMatch) {
|
|
57
|
+
errors.push({ file: filepath, line: i + 1, code: classMatch[1], message: "", kind: "class" });
|
|
58
|
+
}
|
|
59
|
+
// Error code constants
|
|
60
|
+
const constMatch = line.match(/(?:const|export\s+const|static\s+readonly)\s+(\w*(?:ERR|ERROR|CODE)\w*)\s*[:=]\s*['"]([^'"]+)['"]/i);
|
|
61
|
+
if (constMatch) {
|
|
62
|
+
errors.push({ file: filepath, line: i + 1, code: constMatch[1], message: constMatch[2], kind: "constant" });
|
|
63
|
+
}
|
|
64
|
+
// throw new Error
|
|
65
|
+
const throwMatch = line.match(/throw\s+new\s+(\w*Error)\s*\(\s*['"`]([^'"`]{3,}?)['"`]/);
|
|
66
|
+
if (throwMatch) {
|
|
67
|
+
errors.push({ file: filepath, line: i + 1, code: throwMatch[1], message: throwMatch[2], kind: "throw" });
|
|
68
|
+
}
|
|
69
|
+
// HTTP status codes in responses
|
|
70
|
+
const statusMatch = line.match(/(?:status|statusCode|res\.status)\s*[:=(]\s*(\d{3})/);
|
|
71
|
+
if (statusMatch) {
|
|
72
|
+
const msgMatch = line.match(/(?:message|msg|error)\s*[:=]\s*['"`]([^'"`]+)['"`]/);
|
|
73
|
+
errors.push({
|
|
74
|
+
file: filepath,
|
|
75
|
+
line: i + 1,
|
|
76
|
+
code: `HTTP_${statusMatch[1]}`,
|
|
77
|
+
message: msgMatch?.[1] || "",
|
|
78
|
+
kind: "status",
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return errors;
|
|
83
|
+
}
|
|
84
|
+
// ─── Analysis ───────────────────────────────────────────────────────────────
|
|
85
|
+
function analyzeErrors(allErrors) {
|
|
86
|
+
const issues = [];
|
|
87
|
+
// Duplicate error messages
|
|
88
|
+
const msgMap = new Map();
|
|
89
|
+
for (const e of allErrors) {
|
|
90
|
+
if (e.message) {
|
|
91
|
+
const key = e.message.toLowerCase().trim();
|
|
92
|
+
if (!msgMap.has(key))
|
|
93
|
+
msgMap.set(key, []);
|
|
94
|
+
msgMap.get(key).push(e);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const dupes = [...msgMap.entries()].filter(([, v]) => v.length > 1);
|
|
98
|
+
if (dupes.length > 0) {
|
|
99
|
+
issues.push({
|
|
100
|
+
issue: `${dupes.length} duplicate error message(s)`,
|
|
101
|
+
severity: "medium",
|
|
102
|
+
detail: "Same message thrown from multiple places — consolidate into error constants",
|
|
103
|
+
examples: dupes.slice(0, 5).map(([msg, defs]) => `"${msg}" in ${defs.length} places`),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
// Inconsistent naming
|
|
107
|
+
const errorClasses = allErrors.filter((e) => e.kind === "class").map((e) => e.code);
|
|
108
|
+
const mixedCase = errorClasses.filter((c) => /Error$/i.test(c) && !/Error$/.test(c));
|
|
109
|
+
if (mixedCase.length > 0) {
|
|
110
|
+
issues.push({
|
|
111
|
+
issue: "Inconsistent error class naming",
|
|
112
|
+
severity: "low",
|
|
113
|
+
detail: "Some error classes don't follow PascalCase + Error suffix convention",
|
|
114
|
+
examples: mixedCase.slice(0, 5),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
// Bare Error throws (no custom class)
|
|
118
|
+
const bareThrows = allErrors.filter((e) => e.kind === "throw" && e.code === "Error");
|
|
119
|
+
if (bareThrows.length > 5) {
|
|
120
|
+
issues.push({
|
|
121
|
+
issue: `${bareThrows.length} bare Error throws`,
|
|
122
|
+
severity: "high",
|
|
123
|
+
detail: "Throwing plain Error makes catch handling harder — use typed error classes",
|
|
124
|
+
examples: bareThrows.slice(0, 5).map((e) => `${e.file}:${e.line} — "${e.message.slice(0, 50)}"`),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// Missing error codes
|
|
128
|
+
const constants = allErrors.filter((e) => e.kind === "constant");
|
|
129
|
+
const throws = allErrors.filter((e) => e.kind === "throw");
|
|
130
|
+
if (throws.length > 10 && constants.length === 0) {
|
|
131
|
+
issues.push({
|
|
132
|
+
issue: "No error code constants",
|
|
133
|
+
severity: "high",
|
|
134
|
+
detail: "Define error codes for machine-readable error handling (e.g., ERR_AUTH_FAILED)",
|
|
135
|
+
examples: throws.slice(0, 3).map((t) => `${t.file}:${t.line}`),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// Inconsistent HTTP status usage
|
|
139
|
+
const statusDefs = allErrors.filter((e) => e.kind === "status");
|
|
140
|
+
const statusCodes = new Map();
|
|
141
|
+
for (const s of statusDefs) {
|
|
142
|
+
statusCodes.set(s.code, (statusCodes.get(s.code) || 0) + 1);
|
|
143
|
+
}
|
|
144
|
+
const overusedStatuses = [...statusCodes.entries()].filter(([, count]) => count > 10);
|
|
145
|
+
if (overusedStatuses.length > 0) {
|
|
146
|
+
issues.push({
|
|
147
|
+
issue: "HTTP status code overuse",
|
|
148
|
+
severity: "medium",
|
|
149
|
+
detail: "Same status code used extensively — consider more specific error responses",
|
|
150
|
+
examples: overusedStatuses.map(([code, count]) => `${code} used ${count} times`),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
// Generic messages
|
|
154
|
+
const genericMsgs = allErrors.filter((e) => e.message && /^(error|something went wrong|unknown error|internal error|failed)$/i.test(e.message.trim()));
|
|
155
|
+
if (genericMsgs.length > 0) {
|
|
156
|
+
issues.push({
|
|
157
|
+
issue: `${genericMsgs.length} generic error message(s)`,
|
|
158
|
+
severity: "high",
|
|
159
|
+
detail: "Vague error messages impede debugging — include context (what failed, why, and what to try)",
|
|
160
|
+
examples: genericMsgs.slice(0, 5).map((e) => `${e.file}:${e.line} — "${e.message}"`),
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return issues;
|
|
164
|
+
}
|
|
165
|
+
// ─── CLI ────────────────────────────────────────────────────────────────────
|
|
166
|
+
export function runErrorTaxonomy(argv) {
|
|
167
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
168
|
+
console.log(`
|
|
169
|
+
judges error-taxonomy — Classify and standardize error codes and messages
|
|
170
|
+
|
|
171
|
+
Usage:
|
|
172
|
+
judges error-taxonomy [dir]
|
|
173
|
+
judges error-taxonomy src/ --format json
|
|
174
|
+
|
|
175
|
+
Options:
|
|
176
|
+
[dir] Directory to scan (default: .)
|
|
177
|
+
--format json JSON output
|
|
178
|
+
--help, -h Show this help
|
|
179
|
+
|
|
180
|
+
Checks: duplicate messages, inconsistent naming, bare Error throws, missing error codes,
|
|
181
|
+
generic messages, HTTP status overuse.
|
|
182
|
+
`);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const format = argv.find((_a, i) => argv[i - 1] === "--format") || "text";
|
|
186
|
+
const dir = argv.find((a) => !a.startsWith("-") && argv.indexOf(a) > 0) || ".";
|
|
187
|
+
const files = collectFiles(dir);
|
|
188
|
+
const allErrors = [];
|
|
189
|
+
for (const f of files)
|
|
190
|
+
allErrors.push(...extractErrors(f));
|
|
191
|
+
const issues = analyzeErrors(allErrors);
|
|
192
|
+
const highCount = issues.filter((i) => i.severity === "high").length;
|
|
193
|
+
const score = Math.max(0, 100 - highCount * 15 - issues.length * 5);
|
|
194
|
+
if (format === "json") {
|
|
195
|
+
console.log(JSON.stringify({
|
|
196
|
+
errors: allErrors.length,
|
|
197
|
+
issues,
|
|
198
|
+
score,
|
|
199
|
+
summary: {
|
|
200
|
+
classes: allErrors.filter((e) => e.kind === "class").length,
|
|
201
|
+
constants: allErrors.filter((e) => e.kind === "constant").length,
|
|
202
|
+
throws: allErrors.filter((e) => e.kind === "throw").length,
|
|
203
|
+
issues: issues.length,
|
|
204
|
+
},
|
|
205
|
+
timestamp: new Date().toISOString(),
|
|
206
|
+
}, null, 2));
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
const badge = score >= 80 ? "✅ CONSISTENT" : score >= 50 ? "⚠️ INCONSISTENT" : "❌ CHAOTIC";
|
|
210
|
+
console.log(`\n Error Taxonomy: ${badge} (${score}/100)\n ─────────────────────────────`);
|
|
211
|
+
console.log(` Error definitions: ${allErrors.length} | Classes: ${allErrors.filter((e) => e.kind === "class").length} | Constants: ${allErrors.filter((e) => e.kind === "constant").length} | Throws: ${allErrors.filter((e) => e.kind === "throw").length}\n`);
|
|
212
|
+
if (issues.length === 0) {
|
|
213
|
+
console.log(" No taxonomy issues detected.\n");
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
for (const issue of issues) {
|
|
217
|
+
const icon = issue.severity === "high" ? "🔴" : issue.severity === "medium" ? "🟡" : "🔵";
|
|
218
|
+
console.log(` ${icon} ${issue.issue}`);
|
|
219
|
+
console.log(` ${issue.detail}`);
|
|
220
|
+
for (const ex of issue.examples) {
|
|
221
|
+
console.log(` • ${ex}`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
console.log(`\n Score: ${score}/100\n`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=error-taxonomy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-taxonomy.js","sourceRoot":"","sources":["../../src/commands/error-taxonomy.ts"],"names":[],"mappings":"AAAA;;;GAG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