@kevinrabun/judges 3.53.0 → 3.55.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/approve-chain.d.ts +8 -0
- package/dist/commands/approve-chain.d.ts.map +1 -0
- package/dist/commands/approve-chain.js +235 -0
- package/dist/commands/approve-chain.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/coach-mode.d.ts +8 -0
- package/dist/commands/coach-mode.d.ts.map +1 -0
- package/dist/commands/coach-mode.js +230 -0
- package/dist/commands/coach-mode.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/context-inject.d.ts +9 -0
- package/dist/commands/context-inject.d.ts.map +1 -0
- package/dist/commands/context-inject.js +212 -0
- package/dist/commands/context-inject.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/finding-contest.d.ts +8 -0
- package/dist/commands/finding-contest.d.ts.map +1 -0
- package/dist/commands/finding-contest.js +193 -0
- package/dist/commands/finding-contest.js.map +1 -0
- package/dist/commands/habit-tracker.d.ts +8 -0
- package/dist/commands/habit-tracker.d.ts.map +1 -0
- package/dist/commands/habit-tracker.js +195 -0
- package/dist/commands/habit-tracker.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/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/prompt-replay.d.ts +8 -0
- package/dist/commands/prompt-replay.d.ts.map +1 -0
- package/dist/commands/prompt-replay.js +177 -0
- package/dist/commands/prompt-replay.js.map +1 -0
- package/dist/commands/review-replay.d.ts +9 -0
- package/dist/commands/review-replay.d.ts.map +1 -0
- package/dist/commands/review-replay.js +265 -0
- package/dist/commands/review-replay.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/snippet-eval.d.ts +8 -0
- package/dist/commands/snippet-eval.d.ts.map +1 -0
- package/dist/commands/snippet-eval.js +224 -0
- package/dist/commands/snippet-eval.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
|
+
* Context inject — feed project-specific context (architecture docs,
|
|
3
|
+
* API contracts, coding standards) into evaluation for higher-precision
|
|
4
|
+
* findings.
|
|
5
|
+
*
|
|
6
|
+
* Parses context files and maintains a local context cache for judges.
|
|
7
|
+
*/
|
|
8
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync } from "fs";
|
|
9
|
+
import { join, basename } from "path";
|
|
10
|
+
// ─── Storage ────────────────────────────────────────────────────────────────
|
|
11
|
+
const CONTEXT_DIR = ".judges-context";
|
|
12
|
+
function ensureDir() {
|
|
13
|
+
if (!existsSync(CONTEXT_DIR))
|
|
14
|
+
mkdirSync(CONTEXT_DIR, { recursive: true });
|
|
15
|
+
}
|
|
16
|
+
function loadProfile() {
|
|
17
|
+
const file = join(CONTEXT_DIR, "profile.json");
|
|
18
|
+
if (!existsSync(file))
|
|
19
|
+
return null;
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(readFileSync(file, "utf-8"));
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function saveProfile(profile) {
|
|
28
|
+
ensureDir();
|
|
29
|
+
writeFileSync(join(CONTEXT_DIR, "profile.json"), JSON.stringify(profile, null, 2));
|
|
30
|
+
}
|
|
31
|
+
// ─── Context Extraction ────────────────────────────────────────────────────
|
|
32
|
+
const RULE_PATTERNS = [
|
|
33
|
+
{ regex: /(?:must|should|always|never|require|mandatory)\s+(.{10,80})/i, category: "requirement" },
|
|
34
|
+
{ regex: /(?:do not|don't|avoid|prohibit|forbid)\s+(.{10,80})/i, category: "prohibition" },
|
|
35
|
+
{ regex: /(?:all|every)\s+(?:api|endpoint|route|handler)\s+(?:must|should)\s+(.{10,80})/i, category: "api-standard" },
|
|
36
|
+
{
|
|
37
|
+
regex: /(?:database|db|data)\s+(?:access|query|operation)\s+(?:must|should)\s+(.{10,80})/i,
|
|
38
|
+
category: "data-access",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
regex: /(?:error|exception)\s+(?:handling|management)\s+(?:must|should)\s+(.{10,80})/i,
|
|
42
|
+
category: "error-handling",
|
|
43
|
+
},
|
|
44
|
+
{ regex: /(?:auth|authentication|authorization)\s+(.{10,80})/i, category: "auth" },
|
|
45
|
+
{ regex: /(?:naming|convention|style)\s+(?:must|should|:)\s*(.{10,80})/i, category: "naming" },
|
|
46
|
+
{ regex: /(?:test|testing)\s+(?:must|should|require)\s+(.{10,80})/i, category: "testing" },
|
|
47
|
+
{ regex: /(?:log|logging)\s+(?:must|should|require)\s+(.{10,80})/i, category: "logging" },
|
|
48
|
+
{ regex: /(?:security|secure)\s+(?:must|should|require)\s+(.{10,80})/i, category: "security" },
|
|
49
|
+
];
|
|
50
|
+
function extractRules(content, source) {
|
|
51
|
+
const rules = [];
|
|
52
|
+
const lines = content.split("\n");
|
|
53
|
+
for (const line of lines) {
|
|
54
|
+
const trimmed = line.trim();
|
|
55
|
+
if (!trimmed || trimmed.startsWith("#"))
|
|
56
|
+
continue;
|
|
57
|
+
for (const pattern of RULE_PATTERNS) {
|
|
58
|
+
const match = pattern.regex.exec(trimmed);
|
|
59
|
+
if (match) {
|
|
60
|
+
rules.push({ source: basename(source), category: pattern.category, rule: trimmed.substring(0, 120) });
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return rules;
|
|
66
|
+
}
|
|
67
|
+
// ─── CLI ────────────────────────────────────────────────────────────────────
|
|
68
|
+
export function runContextInject(argv) {
|
|
69
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
70
|
+
console.log(`
|
|
71
|
+
judges context-inject — Feed project context into evaluation
|
|
72
|
+
|
|
73
|
+
Usage:
|
|
74
|
+
judges context-inject --add docs/architecture.md
|
|
75
|
+
judges context-inject --add docs/coding-standards.md
|
|
76
|
+
judges context-inject --show
|
|
77
|
+
judges context-inject --scan docs/
|
|
78
|
+
judges context-inject --clear
|
|
79
|
+
|
|
80
|
+
Options:
|
|
81
|
+
--add <file> Add a context file (Markdown/YAML/text)
|
|
82
|
+
--scan <dir> Scan directory for context documents
|
|
83
|
+
--show Show current context profile
|
|
84
|
+
--clear Clear all context
|
|
85
|
+
--format json JSON output
|
|
86
|
+
--help, -h Show this help
|
|
87
|
+
|
|
88
|
+
Context files are parsed for rules, standards, and conventions that
|
|
89
|
+
judges use to calibrate findings for your specific project.
|
|
90
|
+
`);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const format = argv.find((_a, i) => argv[i - 1] === "--format") || "text";
|
|
94
|
+
const isAdd = argv.includes("--add");
|
|
95
|
+
const _isShow = argv.includes("--show");
|
|
96
|
+
const isScan = argv.includes("--scan");
|
|
97
|
+
const isClear = argv.includes("--clear");
|
|
98
|
+
if (isClear) {
|
|
99
|
+
saveProfile({
|
|
100
|
+
name: "default",
|
|
101
|
+
sources: [],
|
|
102
|
+
rules: [],
|
|
103
|
+
createdAt: new Date().toISOString(),
|
|
104
|
+
updatedAt: new Date().toISOString(),
|
|
105
|
+
});
|
|
106
|
+
console.log(" ✅ Context cleared");
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (isAdd) {
|
|
110
|
+
const fileIdx = argv.indexOf("--add") + 1;
|
|
111
|
+
const file = argv[fileIdx] || "";
|
|
112
|
+
if (!file || !existsSync(file)) {
|
|
113
|
+
console.error(` File not found: ${file}`);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const content = readFileSync(file, "utf-8");
|
|
117
|
+
const newRules = extractRules(content, file);
|
|
118
|
+
const profile = loadProfile() || {
|
|
119
|
+
name: "default",
|
|
120
|
+
sources: [],
|
|
121
|
+
rules: [],
|
|
122
|
+
createdAt: new Date().toISOString(),
|
|
123
|
+
updatedAt: "",
|
|
124
|
+
};
|
|
125
|
+
if (!profile.sources.includes(file))
|
|
126
|
+
profile.sources.push(file);
|
|
127
|
+
profile.rules.push(...newRules);
|
|
128
|
+
profile.updatedAt = new Date().toISOString();
|
|
129
|
+
saveProfile(profile);
|
|
130
|
+
console.log(` ✅ Added ${file} — extracted ${newRules.length} rule(s)`);
|
|
131
|
+
if (newRules.length > 0) {
|
|
132
|
+
for (const r of newRules.slice(0, 5)) {
|
|
133
|
+
console.log(` [${r.category}] ${r.rule}`);
|
|
134
|
+
}
|
|
135
|
+
if (newRules.length > 5)
|
|
136
|
+
console.log(` ... and ${newRules.length - 5} more`);
|
|
137
|
+
}
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (isScan) {
|
|
141
|
+
const dirIdx = argv.indexOf("--scan") + 1;
|
|
142
|
+
const dir = argv[dirIdx] || "docs";
|
|
143
|
+
if (!existsSync(dir)) {
|
|
144
|
+
console.error(` Directory not found: ${dir}`);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const DOC_EXTS = new Set([".md", ".txt", ".yaml", ".yml", ".rst"]);
|
|
148
|
+
let entries;
|
|
149
|
+
try {
|
|
150
|
+
entries = readdirSync(dir);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
entries = [];
|
|
154
|
+
}
|
|
155
|
+
const docFiles = entries.filter((e) => DOC_EXTS.has(join(".", e).includes(".") ? "." + e.split(".").pop() : ""));
|
|
156
|
+
const profile = loadProfile() || {
|
|
157
|
+
name: "default",
|
|
158
|
+
sources: [],
|
|
159
|
+
rules: [],
|
|
160
|
+
createdAt: new Date().toISOString(),
|
|
161
|
+
updatedAt: "",
|
|
162
|
+
};
|
|
163
|
+
let totalNew = 0;
|
|
164
|
+
for (const f of docFiles) {
|
|
165
|
+
const fullPath = join(dir, f);
|
|
166
|
+
try {
|
|
167
|
+
const content = readFileSync(fullPath, "utf-8");
|
|
168
|
+
const rules = extractRules(content, fullPath);
|
|
169
|
+
if (!profile.sources.includes(fullPath))
|
|
170
|
+
profile.sources.push(fullPath);
|
|
171
|
+
profile.rules.push(...rules);
|
|
172
|
+
totalNew += rules.length;
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
/* skip */
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
profile.updatedAt = new Date().toISOString();
|
|
179
|
+
saveProfile(profile);
|
|
180
|
+
console.log(` ✅ Scanned ${docFiles.length} doc(s) in ${dir} — extracted ${totalNew} rule(s)`);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
// Default: show profile
|
|
184
|
+
const profile = loadProfile();
|
|
185
|
+
if (!profile || profile.rules.length === 0) {
|
|
186
|
+
console.log(" No context loaded. Use --add <file> or --scan <dir> to inject context.");
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (format === "json") {
|
|
190
|
+
console.log(JSON.stringify(profile, null, 2));
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
console.log(`\n Context Profile — ${profile.rules.length} rule(s) from ${profile.sources.length} source(s)\n ──────────────────────────`);
|
|
194
|
+
const byCategory = new Map();
|
|
195
|
+
for (const r of profile.rules) {
|
|
196
|
+
const list = byCategory.get(r.category) || [];
|
|
197
|
+
list.push(r);
|
|
198
|
+
byCategory.set(r.category, list);
|
|
199
|
+
}
|
|
200
|
+
for (const [cat, rules] of byCategory) {
|
|
201
|
+
console.log(`\n 📋 ${cat} (${rules.length}):`);
|
|
202
|
+
for (const r of rules.slice(0, 5)) {
|
|
203
|
+
console.log(` ${r.rule}`);
|
|
204
|
+
}
|
|
205
|
+
if (rules.length > 5)
|
|
206
|
+
console.log(` ... and ${rules.length - 5} more`);
|
|
207
|
+
}
|
|
208
|
+
console.log(`\n Sources: ${profile.sources.join(", ")}`);
|
|
209
|
+
console.log(` Last updated: ${profile.updatedAt}\n`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=context-inject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-inject.js","sourceRoot":"","sources":["../../src/commands/context-inject.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAmBtC,+EAA+E;AAE/E,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC,SAAS,SAAS;IAChB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QAAE,SAAS,CAAC,W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E,CAAC;YACtC,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,KAAK,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;YAClD,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;gBAClC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YACnC,CAAC;YACD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,kBAAkB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-readiness.d.ts","sourceRoot":"","sources":["../../src/commands/deploy-readiness.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA4LH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAsDvD"}
|
|
@@ -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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,aAAa,SAAS,YAAY,SAAS,YAAY,SAAS,IAAI,CAAC,CAAC;IACzG,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding contest — gamified challenge mode where developers compete
|
|
3
|
+
* to fix the most findings in a codebase within a time window.
|
|
4
|
+
*
|
|
5
|
+
* Results stored locally in `.judges-contests/`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function runFindingContest(argv: string[]): void;
|
|
8
|
+
//# sourceMappingURL=finding-contest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finding-contest.d.ts","sourceRoot":"","sources":["../../src/commands/finding-contest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyEH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAuKtD"}
|