@kevinrabun/judges 3.57.0 → 3.59.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-misuse.d.ts +5 -0
- package/dist/commands/api-misuse.d.ts.map +1 -0
- package/dist/commands/api-misuse.js +261 -0
- package/dist/commands/api-misuse.js.map +1 -0
- package/dist/commands/assertion-density.d.ts +5 -0
- package/dist/commands/assertion-density.d.ts.map +1 -0
- package/dist/commands/assertion-density.js +264 -0
- package/dist/commands/assertion-density.js.map +1 -0
- package/dist/commands/async-safety.d.ts +5 -0
- package/dist/commands/async-safety.d.ts.map +1 -0
- package/dist/commands/async-safety.js +267 -0
- package/dist/commands/async-safety.js.map +1 -0
- package/dist/commands/clone-detect.d.ts +5 -0
- package/dist/commands/clone-detect.d.ts.map +1 -0
- package/dist/commands/clone-detect.js +233 -0
- package/dist/commands/clone-detect.js.map +1 -0
- package/dist/commands/completion-audit.d.ts +5 -0
- package/dist/commands/completion-audit.d.ts.map +1 -0
- package/dist/commands/completion-audit.js +297 -0
- package/dist/commands/completion-audit.js.map +1 -0
- package/dist/commands/contract-verify.d.ts +5 -0
- package/dist/commands/contract-verify.d.ts.map +1 -0
- package/dist/commands/contract-verify.js +317 -0
- package/dist/commands/contract-verify.js.map +1 -0
- package/dist/commands/cross-file-consistency.d.ts +5 -0
- package/dist/commands/cross-file-consistency.d.ts.map +1 -0
- package/dist/commands/cross-file-consistency.js +255 -0
- package/dist/commands/cross-file-consistency.js.map +1 -0
- package/dist/commands/dead-code-detect.d.ts +5 -0
- package/dist/commands/dead-code-detect.d.ts.map +1 -0
- package/dist/commands/dead-code-detect.js +256 -0
- package/dist/commands/dead-code-detect.js.map +1 -0
- package/dist/commands/encoding-safety.d.ts +5 -0
- package/dist/commands/encoding-safety.d.ts.map +1 -0
- package/dist/commands/encoding-safety.js +276 -0
- package/dist/commands/encoding-safety.js.map +1 -0
- package/dist/commands/example-leak.d.ts +5 -0
- package/dist/commands/example-leak.d.ts.map +1 -0
- package/dist/commands/example-leak.js +233 -0
- package/dist/commands/example-leak.js.map +1 -0
- package/dist/commands/input-guard.d.ts +5 -0
- package/dist/commands/input-guard.d.ts.map +1 -0
- package/dist/commands/input-guard.js +256 -0
- package/dist/commands/input-guard.js.map +1 -0
- package/dist/commands/logic-lint.d.ts +5 -0
- package/dist/commands/logic-lint.d.ts.map +1 -0
- package/dist/commands/logic-lint.js +256 -0
- package/dist/commands/logic-lint.js.map +1 -0
- package/dist/commands/phantom-import.d.ts +5 -0
- package/dist/commands/phantom-import.d.ts.map +1 -0
- package/dist/commands/phantom-import.js +261 -0
- package/dist/commands/phantom-import.js.map +1 -0
- package/dist/commands/review-focus.d.ts +5 -0
- package/dist/commands/review-focus.d.ts.map +1 -0
- package/dist/commands/review-focus.js +197 -0
- package/dist/commands/review-focus.js.map +1 -0
- package/dist/commands/spec-conform.d.ts +5 -0
- package/dist/commands/spec-conform.d.ts.map +1 -0
- package/dist/commands/spec-conform.js +305 -0
- package/dist/commands/spec-conform.js.map +1 -0
- package/dist/commands/state-integrity.d.ts +5 -0
- package/dist/commands/state-integrity.d.ts.map +1 -0
- package/dist/commands/state-integrity.js +284 -0
- package/dist/commands/state-integrity.js.map +1 -0
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec conform — check code conformance to project conventions and style patterns.
|
|
3
|
+
*/
|
|
4
|
+
import { readFileSync, readdirSync, statSync } from "fs";
|
|
5
|
+
import { join, extname, basename } from "path";
|
|
6
|
+
// ─── File Collection ────────────────────────────────────────────────────────
|
|
7
|
+
const CODE_EXTS = new Set([".ts", ".tsx", ".js", ".jsx"]);
|
|
8
|
+
function collectFiles(dir, max = 300) {
|
|
9
|
+
const files = [];
|
|
10
|
+
function walk(d) {
|
|
11
|
+
if (files.length >= max)
|
|
12
|
+
return;
|
|
13
|
+
let entries;
|
|
14
|
+
try {
|
|
15
|
+
entries = readdirSync(d);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
for (const e of entries) {
|
|
21
|
+
if (files.length >= max)
|
|
22
|
+
return;
|
|
23
|
+
if (e.startsWith(".") || e === "node_modules" || e === "dist" || e === "build")
|
|
24
|
+
continue;
|
|
25
|
+
const full = join(d, e);
|
|
26
|
+
try {
|
|
27
|
+
if (statSync(full).isDirectory())
|
|
28
|
+
walk(full);
|
|
29
|
+
else if (CODE_EXTS.has(extname(full)))
|
|
30
|
+
files.push(full);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
/* skip */
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
walk(dir);
|
|
38
|
+
return files;
|
|
39
|
+
}
|
|
40
|
+
function detectConventions(dir, files) {
|
|
41
|
+
const conv = {
|
|
42
|
+
useSemicolons: null,
|
|
43
|
+
quoteStyle: null,
|
|
44
|
+
indentStyle: null,
|
|
45
|
+
indentSize: null,
|
|
46
|
+
namingStyle: null,
|
|
47
|
+
hasEslint: false,
|
|
48
|
+
hasPrettier: false,
|
|
49
|
+
hasEditorConfig: false,
|
|
50
|
+
fileNamingPattern: null,
|
|
51
|
+
};
|
|
52
|
+
// Check for config files
|
|
53
|
+
try {
|
|
54
|
+
const entries = readdirSync(dir);
|
|
55
|
+
conv.hasEslint = entries.some((e) => /^\.?eslint/.test(e));
|
|
56
|
+
conv.hasPrettier = entries.some((e) => /^\.?prettier/.test(e));
|
|
57
|
+
conv.hasEditorConfig = entries.includes(".editorconfig");
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
/* skip */
|
|
61
|
+
}
|
|
62
|
+
// Analyze existing file conventions from first 20 files
|
|
63
|
+
let semiCount = 0;
|
|
64
|
+
let noSemiCount = 0;
|
|
65
|
+
let singleQuote = 0;
|
|
66
|
+
let doubleQuote = 0;
|
|
67
|
+
let tabIndent = 0;
|
|
68
|
+
let spaceIndent = 0;
|
|
69
|
+
const indentSizes = [];
|
|
70
|
+
let camelCount = 0;
|
|
71
|
+
let snakeCount = 0;
|
|
72
|
+
const sampleFiles = files.slice(0, 20);
|
|
73
|
+
for (const filepath of sampleFiles) {
|
|
74
|
+
let content;
|
|
75
|
+
try {
|
|
76
|
+
content = readFileSync(filepath, "utf-8");
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const fileLines = content.split("\n");
|
|
82
|
+
for (const line of fileLines.slice(0, 50)) {
|
|
83
|
+
// Semicolons
|
|
84
|
+
if (/;\s*$/.test(line.trim()) && !/\/\/|\/\*|\*/.test(line.trim().slice(0, 2)))
|
|
85
|
+
semiCount++;
|
|
86
|
+
if (/[^;{}\s]\s*$/.test(line.trim()) && line.trim().length > 5 && !/\/\/|\/\*|\*|=>/.test(line.trim()))
|
|
87
|
+
noSemiCount++;
|
|
88
|
+
// Quotes
|
|
89
|
+
const singles = (line.match(/'/g) || []).length;
|
|
90
|
+
const doubles = (line.match(/"/g) || []).length;
|
|
91
|
+
singleQuote += singles;
|
|
92
|
+
doubleQuote += doubles;
|
|
93
|
+
// Indentation
|
|
94
|
+
const indent = line.match(/^(\s+)/);
|
|
95
|
+
if (indent) {
|
|
96
|
+
if (indent[1].includes("\t"))
|
|
97
|
+
tabIndent++;
|
|
98
|
+
else {
|
|
99
|
+
spaceIndent++;
|
|
100
|
+
indentSizes.push(indent[1].length);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Variable naming
|
|
105
|
+
const varDecls = content.match(/(?:const|let|var)\s+([a-z]\w+)/g) || [];
|
|
106
|
+
for (const decl of varDecls) {
|
|
107
|
+
const name = decl.split(/\s+/)[1];
|
|
108
|
+
if (name.includes("_"))
|
|
109
|
+
snakeCount++;
|
|
110
|
+
else
|
|
111
|
+
camelCount++;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
conv.useSemicolons = semiCount > noSemiCount * 2 ? true : noSemiCount > semiCount * 2 ? false : null;
|
|
115
|
+
conv.quoteStyle = singleQuote > doubleQuote * 1.5 ? "single" : doubleQuote > singleQuote * 1.5 ? "double" : null;
|
|
116
|
+
conv.indentStyle = tabIndent > spaceIndent ? "tabs" : spaceIndent > tabIndent ? "spaces" : null;
|
|
117
|
+
if (indentSizes.length > 0) {
|
|
118
|
+
const mode = indentSizes.sort((a, b) => a - b)[Math.floor(indentSizes.length / 2)];
|
|
119
|
+
conv.indentSize = mode <= 4 ? mode : null;
|
|
120
|
+
}
|
|
121
|
+
conv.namingStyle = camelCount > snakeCount * 2 ? "camelCase" : snakeCount > camelCount * 2 ? "snake_case" : null;
|
|
122
|
+
// File naming pattern
|
|
123
|
+
const fileNames = files.map((f) => basename(f, extname(f)));
|
|
124
|
+
const kebab = fileNames.filter((n) => /^[a-z][a-z0-9-]*$/.test(n)).length;
|
|
125
|
+
const camel = fileNames.filter((n) => /^[a-z][a-zA-Z0-9]*$/.test(n) && /[A-Z]/.test(n)).length;
|
|
126
|
+
const pascal = fileNames.filter((n) => /^[A-Z][a-zA-Z0-9]*$/.test(n)).length;
|
|
127
|
+
const snake = fileNames.filter((n) => /^[a-z][a-z0-9_]*$/.test(n) && n.includes("_")).length;
|
|
128
|
+
const counts = [
|
|
129
|
+
{ style: "kebab-case", count: kebab },
|
|
130
|
+
{ style: "camelCase", count: camel },
|
|
131
|
+
{ style: "PascalCase", count: pascal },
|
|
132
|
+
{ style: "snake_case", count: snake },
|
|
133
|
+
].sort((a, b) => b.count - a.count);
|
|
134
|
+
if (counts[0].count > files.length * 0.5)
|
|
135
|
+
conv.fileNamingPattern = counts[0].style;
|
|
136
|
+
return conv;
|
|
137
|
+
}
|
|
138
|
+
// ─── Analysis ───────────────────────────────────────────────────────────────
|
|
139
|
+
function analyzeFile(filepath, conv) {
|
|
140
|
+
const issues = [];
|
|
141
|
+
let content;
|
|
142
|
+
try {
|
|
143
|
+
content = readFileSync(filepath, "utf-8");
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return issues;
|
|
147
|
+
}
|
|
148
|
+
const lines = content.split("\n");
|
|
149
|
+
const fname = basename(filepath, extname(filepath));
|
|
150
|
+
// File naming convention
|
|
151
|
+
if (conv.fileNamingPattern === "kebab-case" && !/^[a-z][a-z0-9.-]*$/.test(fname) && !fname.startsWith("_")) {
|
|
152
|
+
issues.push({
|
|
153
|
+
file: filepath,
|
|
154
|
+
line: 1,
|
|
155
|
+
issue: "File name breaks project convention",
|
|
156
|
+
severity: "low",
|
|
157
|
+
detail: `Project uses kebab-case filenames but this file is named \`${fname}\``,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (conv.fileNamingPattern === "PascalCase" && !/^[A-Z]/.test(fname)) {
|
|
161
|
+
issues.push({
|
|
162
|
+
file: filepath,
|
|
163
|
+
line: 1,
|
|
164
|
+
issue: "File name breaks project convention",
|
|
165
|
+
severity: "low",
|
|
166
|
+
detail: `Project uses PascalCase filenames but this file is named \`${fname}\``,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
for (let i = 0; i < lines.length; i++) {
|
|
170
|
+
const line = lines[i];
|
|
171
|
+
const trimmed = line.trim();
|
|
172
|
+
// Semicolon consistency
|
|
173
|
+
if (conv.useSemicolons === true && /[a-zA-Z0-9)\]'"]\s*$/.test(trimmed) && trimmed.length > 10) {
|
|
174
|
+
if (!/^\s*(?:\/\/|\/\*|\*|import|export|if|else|for|while|do|switch|try|catch|finally|class|interface|type|enum|function|=>|\{|\}|\(|\)|,)/.test(trimmed)) {
|
|
175
|
+
issues.push({
|
|
176
|
+
file: filepath,
|
|
177
|
+
line: i + 1,
|
|
178
|
+
issue: "Missing semicolon (project uses semicolons)",
|
|
179
|
+
severity: "low",
|
|
180
|
+
detail: "Line ends without semicolon — inconsistent with project style",
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
// Quote style consistency
|
|
185
|
+
if (conv.quoteStyle === "single" && /"[^"]*"/.test(trimmed) && !/import\s/.test(trimmed)) {
|
|
186
|
+
if (!trimmed.includes("'") && !trimmed.includes("`") && !/console\.|require|JSON/.test(trimmed)) {
|
|
187
|
+
// Only flag if it's clearly a string, not a JSON key or HTML attribute
|
|
188
|
+
const dqCount = (trimmed.match(/"/g) || []).length;
|
|
189
|
+
if (dqCount === 2) {
|
|
190
|
+
issues.push({
|
|
191
|
+
file: filepath,
|
|
192
|
+
line: i + 1,
|
|
193
|
+
issue: "Double quotes (project uses single)",
|
|
194
|
+
severity: "low",
|
|
195
|
+
detail: "Project convention is single quotes — AI generated double-quoted string",
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// Variable naming convention
|
|
201
|
+
if (conv.namingStyle === "camelCase") {
|
|
202
|
+
const snakeMatch = trimmed.match(/(?:const|let|var)\s+([a-z]+_[a-z_]+)/);
|
|
203
|
+
if (snakeMatch) {
|
|
204
|
+
issues.push({
|
|
205
|
+
file: filepath,
|
|
206
|
+
line: i + 1,
|
|
207
|
+
issue: "snake_case variable in camelCase project",
|
|
208
|
+
severity: "medium",
|
|
209
|
+
detail: `\`${snakeMatch[1]}\` uses snake_case — project convention is camelCase`,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (conv.namingStyle === "snake_case") {
|
|
214
|
+
const camelMatch = trimmed.match(/(?:const|let|var)\s+([a-z]+[A-Z]\w+)/);
|
|
215
|
+
if (camelMatch) {
|
|
216
|
+
issues.push({
|
|
217
|
+
file: filepath,
|
|
218
|
+
line: i + 1,
|
|
219
|
+
issue: "camelCase variable in snake_case project",
|
|
220
|
+
severity: "medium",
|
|
221
|
+
detail: `\`${camelMatch[1]}\` uses camelCase — project convention is snake_case`,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// Mixed indentation
|
|
226
|
+
if (conv.indentStyle === "spaces" && /^\t/.test(line)) {
|
|
227
|
+
issues.push({
|
|
228
|
+
file: filepath,
|
|
229
|
+
line: i + 1,
|
|
230
|
+
issue: "Tab indentation in spaces-only project",
|
|
231
|
+
severity: "low",
|
|
232
|
+
detail: "Project uses spaces for indentation — AI generated tab-indented code",
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
if (conv.indentStyle === "tabs" && /^ {2,}/.test(line) && !/^\s*\*/.test(line)) {
|
|
236
|
+
issues.push({
|
|
237
|
+
file: filepath,
|
|
238
|
+
line: i + 1,
|
|
239
|
+
issue: "Space indentation in tabs-only project",
|
|
240
|
+
severity: "low",
|
|
241
|
+
detail: "Project uses tabs for indentation — AI generated space-indented code",
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return issues;
|
|
246
|
+
}
|
|
247
|
+
// ─── CLI ────────────────────────────────────────────────────────────────────
|
|
248
|
+
export function runSpecConform(argv) {
|
|
249
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
250
|
+
console.log(`
|
|
251
|
+
judges spec-conform — Check code conformance to project conventions
|
|
252
|
+
|
|
253
|
+
Usage:
|
|
254
|
+
judges spec-conform [dir]
|
|
255
|
+
judges spec-conform src/ --format json
|
|
256
|
+
|
|
257
|
+
Options:
|
|
258
|
+
[dir] Directory to scan (default: .)
|
|
259
|
+
--format json JSON output
|
|
260
|
+
--help, -h Show this help
|
|
261
|
+
|
|
262
|
+
Auto-detects: semicolon usage, quote style, indentation, variable naming, file naming.
|
|
263
|
+
Flags AI-generated code that breaks detected project conventions.
|
|
264
|
+
`);
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const format = argv.find((_a, i) => argv[i - 1] === "--format") || "text";
|
|
268
|
+
const dir = argv.find((a) => !a.startsWith("-") && argv.indexOf(a) > 0) || ".";
|
|
269
|
+
const files = collectFiles(dir);
|
|
270
|
+
const conv = detectConventions(dir, files);
|
|
271
|
+
const allIssues = [];
|
|
272
|
+
for (const f of files)
|
|
273
|
+
allIssues.push(...analyzeFile(f, conv));
|
|
274
|
+
const highCount = allIssues.filter((i) => i.severity === "high").length;
|
|
275
|
+
const medCount = allIssues.filter((i) => i.severity === "medium").length;
|
|
276
|
+
const score = Math.max(0, 100 - highCount * 10 - medCount * 4 - allIssues.filter((i) => i.severity === "low").length);
|
|
277
|
+
if (format === "json") {
|
|
278
|
+
console.log(JSON.stringify({
|
|
279
|
+
conventions: conv,
|
|
280
|
+
issues: allIssues,
|
|
281
|
+
score,
|
|
282
|
+
summary: { high: highCount, medium: medCount, total: allIssues.length },
|
|
283
|
+
timestamp: new Date().toISOString(),
|
|
284
|
+
}, null, 2));
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
const badge = score >= 80 ? "✅ CONFORMING" : score >= 50 ? "⚠️ DRIFTING" : "❌ NONCONFORMING";
|
|
288
|
+
console.log(`\n Spec Conform: ${badge} (${score}/100)\n ─────────────────────────────`);
|
|
289
|
+
console.log(` Detected: semis=${conv.useSemicolons ?? "?"} quotes=${conv.quoteStyle ?? "?"} indent=${conv.indentStyle ?? "?"}(${conv.indentSize ?? "?"}) naming=${conv.namingStyle ?? "?"} files=${conv.fileNamingPattern ?? "?"}`);
|
|
290
|
+
if (allIssues.length === 0) {
|
|
291
|
+
console.log(" No convention violations detected.\n");
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
for (const issue of allIssues.slice(0, 25)) {
|
|
295
|
+
const icon = issue.severity === "high" ? "🔴" : issue.severity === "medium" ? "🟡" : "🔵";
|
|
296
|
+
console.log(` ${icon} ${issue.issue}`);
|
|
297
|
+
console.log(` ${issue.file}:${issue.line}`);
|
|
298
|
+
console.log(` ${issue.detail}`);
|
|
299
|
+
}
|
|
300
|
+
if (allIssues.length > 25)
|
|
301
|
+
console.log(` ... and ${allIssues.length - 25} more`);
|
|
302
|
+
console.log(`\n Total: ${allIssues.length} | High: ${highCount} | Medium: ${medCount} | Score: ${score}/100\n`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=spec-conform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-conform.js","sourceRoot":"","sources":["../../src/commands/spec-conform.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAY/C,+EAA+E;AAE/E,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1D,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,CAAC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,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YAC1F,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;YAC1C,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACnD,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,GAAG,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,eAAe,SAAS,CAAC,MAAM,GAAG,EAAE,OAAO,CAAC,CAAC;QACpF,OAAO,CAAC,GAAG,CAAC,gBAAgB,SAAS,CAAC,MAAM,YAAY,SAAS,cAAc,QAAQ,aAAa,KAAK,QAAQ,CAAC,CAAC;IACrH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-integrity.d.ts","sourceRoot":"","sources":["../../src/commands/state-integrity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuPH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CA+DtD"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State integrity — validate state machine correctness, unreachable states, and missing transitions.
|
|
3
|
+
*/
|
|
4
|
+
import { readFileSync, readdirSync, statSync } from "fs";
|
|
5
|
+
import { join, extname } from "path";
|
|
6
|
+
// ─── File Collection ────────────────────────────────────────────────────────
|
|
7
|
+
const CODE_EXTS = new Set([".ts", ".tsx", ".js", ".jsx"]);
|
|
8
|
+
function collectFiles(dir, max = 300) {
|
|
9
|
+
const files = [];
|
|
10
|
+
function walk(d) {
|
|
11
|
+
if (files.length >= max)
|
|
12
|
+
return;
|
|
13
|
+
let entries;
|
|
14
|
+
try {
|
|
15
|
+
entries = readdirSync(d);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
for (const e of entries) {
|
|
21
|
+
if (files.length >= max)
|
|
22
|
+
return;
|
|
23
|
+
if (e.startsWith(".") || e === "node_modules" || e === "dist" || e === "build")
|
|
24
|
+
continue;
|
|
25
|
+
const full = join(d, e);
|
|
26
|
+
try {
|
|
27
|
+
if (statSync(full).isDirectory())
|
|
28
|
+
walk(full);
|
|
29
|
+
else if (CODE_EXTS.has(extname(full)))
|
|
30
|
+
files.push(full);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
/* skip */
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
walk(dir);
|
|
38
|
+
return files;
|
|
39
|
+
}
|
|
40
|
+
// ─── Analysis ───────────────────────────────────────────────────────────────
|
|
41
|
+
function analyzeFile(filepath) {
|
|
42
|
+
const issues = [];
|
|
43
|
+
let content;
|
|
44
|
+
try {
|
|
45
|
+
content = readFileSync(filepath, "utf-8");
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return issues;
|
|
49
|
+
}
|
|
50
|
+
const lines = content.split("\n");
|
|
51
|
+
const fullText = content;
|
|
52
|
+
// Detect enum/union type definitions for states
|
|
53
|
+
const stateEnums = new Map();
|
|
54
|
+
for (let i = 0; i < lines.length; i++) {
|
|
55
|
+
const line = lines[i];
|
|
56
|
+
const enumMatch = line.match(/enum\s+(\w*(?:State|Status|Phase|Stage|Mode)\w*)\s*\{/i);
|
|
57
|
+
if (enumMatch) {
|
|
58
|
+
const enumName = enumMatch[1];
|
|
59
|
+
let depth = 0;
|
|
60
|
+
let enumEnd = i;
|
|
61
|
+
for (let j = i; j < Math.min(i + 30, lines.length); j++) {
|
|
62
|
+
for (const ch of lines[j]) {
|
|
63
|
+
if (ch === "{")
|
|
64
|
+
depth++;
|
|
65
|
+
if (ch === "}")
|
|
66
|
+
depth--;
|
|
67
|
+
}
|
|
68
|
+
if (depth <= 0 && j > i) {
|
|
69
|
+
enumEnd = j;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const enumBody = lines.slice(i + 1, enumEnd).join("\n");
|
|
74
|
+
const values = [...enumBody.matchAll(/(\w+)\s*[=,]/g)].map((m) => m[1]);
|
|
75
|
+
if (values.length > 0)
|
|
76
|
+
stateEnums.set(enumName, { values, line: i + 1 });
|
|
77
|
+
}
|
|
78
|
+
// Also detect string union types for state
|
|
79
|
+
const unionMatch = line.match(/type\s+(\w*(?:State|Status|Phase|Stage|Mode)\w*)\s*=\s*(.+)/i);
|
|
80
|
+
if (unionMatch) {
|
|
81
|
+
const typeName = unionMatch[1];
|
|
82
|
+
const rest = unionMatch[2] + (lines[i + 1] || "");
|
|
83
|
+
const values = [...rest.matchAll(/['"](\w+)['"]/g)].map((m) => m[1]);
|
|
84
|
+
if (values.length > 1)
|
|
85
|
+
stateEnums.set(typeName, { values, line: i + 1 });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Check if all enum values are handled in switch statements
|
|
89
|
+
for (const [enumName, { values }] of stateEnums) {
|
|
90
|
+
for (let i = 0; i < lines.length; i++) {
|
|
91
|
+
const line = lines[i];
|
|
92
|
+
if (/switch\s*\(/.test(line) &&
|
|
93
|
+
new RegExp(enumName, "i").test(lines.slice(Math.max(0, i - 3), i + 1).join("\n"))) {
|
|
94
|
+
let depth = 0;
|
|
95
|
+
let switchEnd = i;
|
|
96
|
+
let started = false;
|
|
97
|
+
for (let j = i; j < Math.min(i + 60, lines.length); j++) {
|
|
98
|
+
for (const ch of lines[j]) {
|
|
99
|
+
if (ch === "{") {
|
|
100
|
+
depth++;
|
|
101
|
+
started = true;
|
|
102
|
+
}
|
|
103
|
+
if (ch === "}")
|
|
104
|
+
depth--;
|
|
105
|
+
}
|
|
106
|
+
if (started && depth <= 0) {
|
|
107
|
+
switchEnd = j;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const switchBody = lines.slice(i, switchEnd + 1).join("\n");
|
|
112
|
+
const unhandled = values.filter((v) => !switchBody.includes(v));
|
|
113
|
+
if (unhandled.length > 0 && !/default\s*:/.test(switchBody)) {
|
|
114
|
+
issues.push({
|
|
115
|
+
file: filepath,
|
|
116
|
+
line: i + 1,
|
|
117
|
+
issue: "Incomplete state handling",
|
|
118
|
+
severity: "high",
|
|
119
|
+
detail: `Switch on ${enumName} missing: ${unhandled.join(", ")} — and no default case`,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
for (let i = 0; i < lines.length; i++) {
|
|
126
|
+
const line = lines[i];
|
|
127
|
+
// Impossible state combinations (boolean flags)
|
|
128
|
+
if (/(?:loading|isLoading)\s*[:=]\s*true/.test(line)) {
|
|
129
|
+
const block = lines.slice(i, Math.min(i + 5, lines.length)).join("\n");
|
|
130
|
+
if (/(?:error|isError|hasError)\s*[:=]\s*true/.test(block)) {
|
|
131
|
+
issues.push({
|
|
132
|
+
file: filepath,
|
|
133
|
+
line: i + 1,
|
|
134
|
+
issue: "Impossible state: loading + error simultaneously",
|
|
135
|
+
severity: "medium",
|
|
136
|
+
detail: "Setting loading and error to true at the same time — use state machine to prevent impossible combinations",
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// Direct state mutation without transition validation
|
|
141
|
+
if (/\.(?:state|status|phase)\s*=\s*['"](\w+)['"]/.test(line)) {
|
|
142
|
+
const newState = line.match(/\.(?:state|status|phase)\s*=\s*['"](\w+)['"]/)?.[1];
|
|
143
|
+
const block = lines.slice(Math.max(0, i - 5), i + 1).join("\n");
|
|
144
|
+
if (!/if\s*\(|switch\s*\(|transition|canTransition|validate|guard|allowed/i.test(block)) {
|
|
145
|
+
issues.push({
|
|
146
|
+
file: filepath,
|
|
147
|
+
line: i + 1,
|
|
148
|
+
issue: "State mutation without transition guard",
|
|
149
|
+
severity: "medium",
|
|
150
|
+
detail: `Setting state to '${newState}' without validating transition — any state can be set from any other`,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// useState with multiple related booleans (React)
|
|
155
|
+
if (/useState\s*<?\s*boolean\s*>?\s*\(\s*(?:true|false)\s*\)/.test(line)) {
|
|
156
|
+
const block = lines.slice(i, Math.min(i + 8, lines.length)).join("\n");
|
|
157
|
+
const boolStateCount = (block.match(/useState\s*<?\s*boolean/g) || []).length;
|
|
158
|
+
if (boolStateCount >= 3) {
|
|
159
|
+
issues.push({
|
|
160
|
+
file: filepath,
|
|
161
|
+
line: i + 1,
|
|
162
|
+
issue: "Too many boolean state variables",
|
|
163
|
+
severity: "medium",
|
|
164
|
+
detail: `${boolStateCount} boolean useState calls in proximity — use discriminated union or state machine to prevent impossible states`,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Redux/Vuex: reducer with incomplete action handling
|
|
169
|
+
if (/(?:createSlice|createReducer|reducer)\s*[(:]/.test(line)) {
|
|
170
|
+
const block = lines.slice(i, Math.min(i + 40, lines.length)).join("\n");
|
|
171
|
+
if (!/default\s*:|exhaustive|never/i.test(block)) {
|
|
172
|
+
const caseCount = (block.match(/case\s+['"]?\w+['"]?\s*:|(\w+)\s*(?::\s*\(|:\s*\{)/g) || []).length;
|
|
173
|
+
if (caseCount > 0 && caseCount < 3) {
|
|
174
|
+
issues.push({
|
|
175
|
+
file: filepath,
|
|
176
|
+
line: i + 1,
|
|
177
|
+
issue: "Reducer with few cases and no default",
|
|
178
|
+
severity: "low",
|
|
179
|
+
detail: "Reducer handles few actions — ensure all action types are covered",
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
// State variable set to invalid value (magic string)
|
|
185
|
+
if (/(?:state|status|phase|stage|mode)\s*[:=]\s*['"](\w+)['"]/.test(line)) {
|
|
186
|
+
const value = line.match(/(?:state|status|phase|stage|mode)\s*[:=]\s*['"](\w+)['"]/)?.[1];
|
|
187
|
+
if (value) {
|
|
188
|
+
// Check if this value is defined in any state enum or type
|
|
189
|
+
let isDefined = false;
|
|
190
|
+
for (const [_name, { values }] of stateEnums) {
|
|
191
|
+
if (values.includes(value)) {
|
|
192
|
+
isDefined = true;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Check if value is used as a type somewhere
|
|
197
|
+
if (!isDefined && fullText.includes(`'${value}'`) && !/test|spec|fixture/i.test(filepath)) {
|
|
198
|
+
const occurrences = (fullText.match(new RegExp(`['"]${value}['"]`, "g")) || []).length;
|
|
199
|
+
if (occurrences === 1) {
|
|
200
|
+
issues.push({
|
|
201
|
+
file: filepath,
|
|
202
|
+
line: i + 1,
|
|
203
|
+
issue: "State value used only once",
|
|
204
|
+
severity: "low",
|
|
205
|
+
detail: `State '${value}' appears only once — may be an orphaned or transitional state`,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// Missing error state in async flow
|
|
212
|
+
if (/async\s+(?:function|=>)/.test(line) && /state|status|phase/i.test(fullText)) {
|
|
213
|
+
const block = lines.slice(i, Math.min(i + 30, lines.length)).join("\n");
|
|
214
|
+
if (/loading|pending|fetching/i.test(block)) {
|
|
215
|
+
if (!/error|failed|rejected|catch/i.test(block)) {
|
|
216
|
+
issues.push({
|
|
217
|
+
file: filepath,
|
|
218
|
+
line: i + 1,
|
|
219
|
+
issue: "Async flow missing error state",
|
|
220
|
+
severity: "medium",
|
|
221
|
+
detail: "Async operation sets loading state but has no error state — failures leave UI in loading",
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return issues;
|
|
228
|
+
}
|
|
229
|
+
// ─── CLI ────────────────────────────────────────────────────────────────────
|
|
230
|
+
export function runStateIntegrity(argv) {
|
|
231
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
232
|
+
console.log(`
|
|
233
|
+
judges state-integrity — Validate state machine correctness and impossible states
|
|
234
|
+
|
|
235
|
+
Usage:
|
|
236
|
+
judges state-integrity [dir]
|
|
237
|
+
judges state-integrity src/ --format json
|
|
238
|
+
|
|
239
|
+
Options:
|
|
240
|
+
[dir] Directory to scan (default: .)
|
|
241
|
+
--format json JSON output
|
|
242
|
+
--help, -h Show this help
|
|
243
|
+
|
|
244
|
+
Checks: incomplete enum handling, impossible boolean combinations, state mutation without guards,
|
|
245
|
+
excessive boolean state, missing error states in async flows, orphaned state values.
|
|
246
|
+
`);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const format = argv.find((_a, i) => argv[i - 1] === "--format") || "text";
|
|
250
|
+
const dir = argv.find((a) => !a.startsWith("-") && argv.indexOf(a) > 0) || ".";
|
|
251
|
+
const files = collectFiles(dir);
|
|
252
|
+
const allIssues = [];
|
|
253
|
+
for (const f of files)
|
|
254
|
+
allIssues.push(...analyzeFile(f));
|
|
255
|
+
const highCount = allIssues.filter((i) => i.severity === "high").length;
|
|
256
|
+
const medCount = allIssues.filter((i) => i.severity === "medium").length;
|
|
257
|
+
const score = Math.max(0, 100 - highCount * 10 - medCount * 4);
|
|
258
|
+
if (format === "json") {
|
|
259
|
+
console.log(JSON.stringify({
|
|
260
|
+
issues: allIssues,
|
|
261
|
+
score,
|
|
262
|
+
summary: { high: highCount, medium: medCount, total: allIssues.length },
|
|
263
|
+
timestamp: new Date().toISOString(),
|
|
264
|
+
}, null, 2));
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
const badge = score >= 80 ? "✅ SOUND" : score >= 50 ? "⚠️ FRAGILE" : "❌ BROKEN";
|
|
268
|
+
console.log(`\n State Integrity: ${badge} (${score}/100)\n ─────────────────────────────`);
|
|
269
|
+
if (allIssues.length === 0) {
|
|
270
|
+
console.log(" No state integrity issues detected.\n");
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
for (const issue of allIssues.slice(0, 25)) {
|
|
274
|
+
const icon = issue.severity === "high" ? "🔴" : issue.severity === "medium" ? "🟡" : "🔵";
|
|
275
|
+
console.log(` ${icon} ${issue.issue}`);
|
|
276
|
+
console.log(` ${issue.file}:${issue.line}`);
|
|
277
|
+
console.log(` ${issue.detail}`);
|
|
278
|
+
}
|
|
279
|
+
if (allIssues.length > 25)
|
|
280
|
+
console.log(` ... and ${allIssues.length - 25} more`);
|
|
281
|
+
console.log(`\n Total: ${allIssues.length} | High: ${highCount} | Medium: ${medCount} | Score: ${score}/100\n`);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=state-integrity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-integrity.js","sourceRoot":"","sources":["../../src/commands/state-integrity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAYrC,+EAA+E;AAE/E,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1D,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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