claude-crap 0.2.0 → 0.3.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.
@@ -0,0 +1,326 @@
1
+ /**
2
+ * Bootstrap a scanner for projects that don't have one configured.
3
+ *
4
+ * Detects the project type from workspace signals (package.json,
5
+ * tsconfig.json, pyproject.toml, pom.xml, *.csproj, etc.), installs
6
+ * the appropriate scanner, creates a minimal config file, and runs
7
+ * `autoScan()` to verify and ingest findings immediately.
8
+ *
9
+ * Coverage maps to the five languages the tree-sitter engine supports:
10
+ *
11
+ * - JavaScript / TypeScript → ESLint (npm install + flat config)
12
+ * - Python → Bandit (install instructions only — virtualenv boundary)
13
+ * - Java → Semgrep (install instructions)
14
+ * - C# → Semgrep (install instructions)
15
+ * - Unknown → Semgrep (polyglot fallback)
16
+ *
17
+ * For JS/TS projects the tool runs `npm install --save-dev` and writes
18
+ * an `eslint.config.mjs`. For all other languages it returns manual
19
+ * install instructions rather than executing package managers whose
20
+ * environment assumptions may not hold.
21
+ *
22
+ * @module scanner/bootstrap
23
+ */
24
+ import { existsSync, writeFileSync, readdirSync } from "node:fs";
25
+ import { join } from "node:path";
26
+ import { execFile } from "node:child_process";
27
+ import { adaptScannerOutput } from "../adapters/index.js";
28
+ import { detectScanners } from "./detector.js";
29
+ import { runScanner } from "./runner.js";
30
+ // ── Project type detection ─────────────────────────────────────────
31
+ /**
32
+ * Detect the project type from workspace signals.
33
+ *
34
+ * Checks in priority order: TypeScript, JavaScript, Python, Java,
35
+ * C#, then unknown. TypeScript wins over plain JavaScript because
36
+ * `tsconfig.json` implies a superset.
37
+ */
38
+ export function detectProjectType(workspaceRoot) {
39
+ const has = (file) => existsSync(join(workspaceRoot, file));
40
+ // JS/TS detection — package.json is the anchor
41
+ if (has("package.json")) {
42
+ if (has("tsconfig.json"))
43
+ return "typescript";
44
+ return "javascript";
45
+ }
46
+ // Python detection
47
+ if (has("pyproject.toml") || has("setup.py") || has("requirements.txt")) {
48
+ return "python";
49
+ }
50
+ // Java detection
51
+ if (has("pom.xml") || has("build.gradle") || has("build.gradle.kts")) {
52
+ return "java";
53
+ }
54
+ // C# detection
55
+ if (has("Directory.Build.props"))
56
+ return "csharp";
57
+ try {
58
+ const entries = readdirSync(workspaceRoot);
59
+ if (entries.some((e) => e.endsWith(".csproj") || e.endsWith(".sln"))) {
60
+ return "csharp";
61
+ }
62
+ }
63
+ catch {
64
+ // readdirSync can fail on permissions — fall through
65
+ }
66
+ return "unknown";
67
+ }
68
+ // ── ESLint config generation ───────────────────────────────────────
69
+ /**
70
+ * Generate a minimal ESLint flat config (ESLint 9+).
71
+ *
72
+ * @param isTypeScript Include typescript-eslint when true.
73
+ * @returns The config file content as a string.
74
+ */
75
+ export function generateEslintConfig(isTypeScript) {
76
+ if (isTypeScript) {
77
+ return `import js from "@eslint/js";
78
+ import tseslint from "typescript-eslint";
79
+
80
+ export default tseslint.config(
81
+ js.configs.recommended,
82
+ ...tseslint.configs.recommended,
83
+ {
84
+ ignores: ["dist/", "node_modules/", "coverage/"],
85
+ },
86
+ );
87
+ `;
88
+ }
89
+ return `import js from "@eslint/js";
90
+
91
+ export default [
92
+ js.configs.recommended,
93
+ {
94
+ ignores: ["dist/", "node_modules/", "coverage/"],
95
+ },
96
+ ];
97
+ `;
98
+ }
99
+ // ── Installation helpers ───────────────────────────────────────────
100
+ /**
101
+ * Run `npm install --save-dev` for the given packages.
102
+ */
103
+ function npmInstall(workspaceRoot, packages) {
104
+ return new Promise((resolve) => {
105
+ execFile("npm", ["install", "--save-dev", ...packages], {
106
+ cwd: workspaceRoot,
107
+ timeout: 120_000,
108
+ env: { ...process.env, FORCE_COLOR: "0" },
109
+ }, (err, stdout, stderr) => {
110
+ if (err) {
111
+ resolve({
112
+ action: `npm install --save-dev ${packages.join(" ")}`,
113
+ success: false,
114
+ detail: stderr || err.message,
115
+ });
116
+ return;
117
+ }
118
+ resolve({
119
+ action: `npm install --save-dev ${packages.join(" ")}`,
120
+ success: true,
121
+ detail: `installed ${packages.join(", ")}`,
122
+ });
123
+ });
124
+ });
125
+ }
126
+ /**
127
+ * Write the ESLint config file to the workspace root.
128
+ * Returns failure if the file already exists.
129
+ */
130
+ function writeEslintConfigFile(workspaceRoot, isTypeScript) {
131
+ const configPath = join(workspaceRoot, "eslint.config.mjs");
132
+ if (existsSync(configPath)) {
133
+ return {
134
+ action: "create eslint.config.mjs",
135
+ success: true,
136
+ detail: "eslint.config.mjs already exists — skipped",
137
+ };
138
+ }
139
+ try {
140
+ writeFileSync(configPath, generateEslintConfig(isTypeScript), "utf-8");
141
+ return {
142
+ action: "create eslint.config.mjs",
143
+ success: true,
144
+ detail: `created eslint.config.mjs (${isTypeScript ? "TypeScript" : "JavaScript"} template)`,
145
+ };
146
+ }
147
+ catch (err) {
148
+ return {
149
+ action: "create eslint.config.mjs",
150
+ success: false,
151
+ detail: err.message,
152
+ };
153
+ }
154
+ }
155
+ function getRecommendation(projectType) {
156
+ switch (projectType) {
157
+ case "javascript":
158
+ case "typescript":
159
+ return {
160
+ scanner: "eslint",
161
+ canAutoInstall: true,
162
+ installInstructions: "npm install --save-dev eslint @eslint/js",
163
+ };
164
+ case "python":
165
+ return {
166
+ scanner: "bandit",
167
+ canAutoInstall: false,
168
+ installInstructions: "pip install bandit (or: pipx install bandit, poetry add --group dev bandit)",
169
+ };
170
+ case "java":
171
+ case "csharp":
172
+ return {
173
+ scanner: "semgrep",
174
+ canAutoInstall: false,
175
+ installInstructions: "brew install semgrep (or: pip install semgrep, pipx install semgrep)",
176
+ };
177
+ case "unknown":
178
+ return {
179
+ scanner: "semgrep",
180
+ canAutoInstall: false,
181
+ installInstructions: "brew install semgrep (or: pip install semgrep, pipx install semgrep)",
182
+ };
183
+ }
184
+ }
185
+ // ── Main orchestrator ──────────────────────────────────────────────
186
+ /**
187
+ * Bootstrap a scanner for the current workspace.
188
+ *
189
+ * 1. Check if a scanner is already configured (short-circuit if so)
190
+ * 2. Detect the project type
191
+ * 3. Install the recommended scanner (or return instructions)
192
+ * 4. Run auto_scan to verify and ingest findings
193
+ *
194
+ * @param workspaceRoot Absolute path to the project root.
195
+ * @param sarifStore Live SARIF store for auto-scan ingestion.
196
+ * @param logger Pino logger for progress reporting.
197
+ */
198
+ export async function bootstrapScanner(workspaceRoot, sarifStore, logger) {
199
+ // 1. Check existing scanners
200
+ const detections = await detectScanners(workspaceRoot);
201
+ const available = detections.filter((d) => d.available);
202
+ if (available.length > 0) {
203
+ const existingScanners = available.map((d) => d.scanner);
204
+ logger.info({ existingScanners }, "bootstrap: scanner(s) already configured — skipping");
205
+ return {
206
+ projectType: detectProjectType(workspaceRoot),
207
+ alreadyConfigured: true,
208
+ existingScanners,
209
+ steps: [],
210
+ autoScanResult: null,
211
+ success: true,
212
+ summary: `Scanner(s) already configured: ${existingScanners.join(", ")}. Run auto_scan to ingest findings.`,
213
+ };
214
+ }
215
+ // 2. Detect project type
216
+ const projectType = detectProjectType(workspaceRoot);
217
+ const recommendation = getRecommendation(projectType);
218
+ const steps = [];
219
+ logger.info({ projectType, scanner: recommendation.scanner }, "bootstrap: detected project type");
220
+ // 3. Install scanner
221
+ if (recommendation.canAutoInstall) {
222
+ // JS/TS: auto-install ESLint
223
+ const isTypeScript = projectType === "typescript";
224
+ const packages = isTypeScript
225
+ ? ["eslint", "@eslint/js", "typescript-eslint"]
226
+ : ["eslint", "@eslint/js"];
227
+ const installStep = await npmInstall(workspaceRoot, packages);
228
+ steps.push(installStep);
229
+ if (installStep.success) {
230
+ const configStep = writeEslintConfigFile(workspaceRoot, isTypeScript);
231
+ steps.push(configStep);
232
+ }
233
+ }
234
+ else {
235
+ // Python / Java / C# / Unknown: return instructions
236
+ steps.push({
237
+ action: `suggest ${recommendation.scanner} install`,
238
+ success: true,
239
+ detail: recommendation.installInstructions,
240
+ });
241
+ }
242
+ // 4. Run scanner directly if installation succeeded (inline scan
243
+ // to avoid circular dependency — autoScan calls bootstrapScanner)
244
+ const installSucceeded = steps.every((s) => s.success);
245
+ let autoScanResult = null;
246
+ if (installSucceeded && recommendation.canAutoInstall) {
247
+ try {
248
+ const scanStart = Date.now();
249
+ const postDetections = await detectScanners(workspaceRoot);
250
+ const postAvailable = postDetections.filter((d) => d.available);
251
+ const scanResults = [];
252
+ let scanFindings = 0;
253
+ const settled = await Promise.allSettled(postAvailable.map((d) => runScanner(d.scanner, workspaceRoot)));
254
+ for (let i = 0; i < postAvailable.length; i++) {
255
+ const det = postAvailable[i];
256
+ const res = settled[i];
257
+ if (res.status === "rejected" || !res.value.success) {
258
+ scanResults.push({
259
+ scanner: det.scanner,
260
+ success: false,
261
+ findingsIngested: 0,
262
+ durationMs: res.status === "fulfilled" ? res.value.durationMs : 0,
263
+ error: res.status === "rejected"
264
+ ? String(res.reason)
265
+ : res.value.error ?? "unknown error",
266
+ });
267
+ continue;
268
+ }
269
+ const runResult = res.value;
270
+ let parsed;
271
+ try {
272
+ parsed = JSON.parse(runResult.rawOutput);
273
+ }
274
+ catch {
275
+ parsed = runResult.rawOutput;
276
+ }
277
+ const adapted = adaptScannerOutput(runResult.scanner, parsed);
278
+ const stats = sarifStore.ingestRun(adapted.document, adapted.sourceTool);
279
+ scanFindings += stats.accepted;
280
+ scanResults.push({
281
+ scanner: runResult.scanner,
282
+ success: true,
283
+ findingsIngested: stats.accepted,
284
+ durationMs: runResult.durationMs,
285
+ });
286
+ }
287
+ if (scanFindings > 0)
288
+ await sarifStore.persist();
289
+ autoScanResult = {
290
+ detected: postDetections,
291
+ results: scanResults,
292
+ totalFindings: scanFindings,
293
+ totalDurationMs: Date.now() - scanStart,
294
+ };
295
+ }
296
+ catch (err) {
297
+ logger.warn({ err: err.message }, "bootstrap: scan after install failed");
298
+ }
299
+ }
300
+ // 5. Build result
301
+ const findings = autoScanResult?.totalFindings ?? 0;
302
+ const scannerInstalled = recommendation.canAutoInstall && installSucceeded;
303
+ let summary;
304
+ if (scannerInstalled && autoScanResult) {
305
+ summary = `Installed ${recommendation.scanner} for ${projectType} project. Auto-scan found ${findings} finding(s).`;
306
+ }
307
+ else if (scannerInstalled) {
308
+ summary = `Installed ${recommendation.scanner} for ${projectType} project. Auto-scan did not run.`;
309
+ }
310
+ else if (!recommendation.canAutoInstall) {
311
+ summary = `Detected ${projectType} project. Install ${recommendation.scanner} manually: ${recommendation.installInstructions}`;
312
+ }
313
+ else {
314
+ summary = `Failed to install ${recommendation.scanner}. Check the error details in the steps.`;
315
+ }
316
+ return {
317
+ projectType,
318
+ alreadyConfigured: false,
319
+ existingScanners: [],
320
+ steps,
321
+ autoScanResult,
322
+ success: installSucceeded,
323
+ summary,
324
+ };
325
+ }
326
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/scanner/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAiDzC,sEAAsE;AAEtE;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,aAAqB;IACrD,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;IAEpE,+CAA+C;IAC/C,IAAI,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;QACxB,IAAI,GAAG,CAAC,eAAe,CAAC;YAAE,OAAO,YAAY,CAAC;QAC9C,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,mBA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AC,GAAG,EAAE,GAAG,SAAS;aACxC,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,IAAI,CACT,EAAE,GAAG,EAAG,GAAa,CAAC,OAAO,EAAE,EAC/B,sCAAsC,CACvC,CAAC;QACJ,CAAC;IACH,CAAC;IAED,kBAAkB;IAClB,MAAM,QAAQ,GAAG,cAAc,EAAE,aAAa,IAAI,CAAC,CAAC;IACpD,MAAM,gBAAgB,GAAG,cAAc,CAAC,cAAc,IAAI,gBAAgB,CAAC;IAE3E,IAAI,OAAe,CAAC;IACpB,IAAI,gBAAgB,IAAI,cAAc,EAAE,CAAC;QACvC,OAAO,GAAG,aAAa,cAAc,CAAC,OAAO,QAAQ,WAAW,6BAA6B,QAAQ,cAAc,CAAC;IACtH,CAAC;SAAM,IAAI,gBAAgB,EAAE,CAAC;QAC5B,OAAO,GAAG,aAAa,cAAc,CAAC,OAAO,QAAQ,WAAW,kCAAkC,CAAC;IACrG,CAAC;SAAM,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;QAC1C,OAAO,GAAG,YAAY,WAAW,qBAAqB,cAAc,CAAC,OAAO,cAAc,cAAc,CAAC,mBAAmB,EAAE,CAAC;IACjI,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,qBAAqB,cAAc,CAAC,OAAO,yCAAyC,CAAC;IACjG,CAAC;IAED,OAAO;QACL,WAAW;QACX,iBAAiB,EAAE,KAAK;QACxB,gBAAgB,EAAE,EAAE;QACpB,KAAK;QACL,cAAc;QACd,OAAO,EAAE,gBAAgB;QACzB,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -19,4 +19,5 @@
19
19
  export { detectScanners, type ScannerDetection } from "./detector.js";
20
20
  export { runScanner, type ScannerRunResult } from "./runner.js";
21
21
  export { autoScan, type AutoScanResult, type ScannerResult } from "./auto-scan.js";
22
+ export { bootstrapScanner, detectProjectType, generateEslintConfig, type BootstrapResult, type BootstrapStep, type ProjectType, } from "./bootstrap.js";
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scanner/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scanner/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC"}
@@ -19,4 +19,5 @@
19
19
  export { detectScanners } from "./detector.js";
20
20
  export { runScanner } from "./runner.js";
21
21
  export { autoScan } from "./auto-scan.js";
22
+ export { bootstrapScanner, detectProjectType, generateEslintConfig, } from "./bootstrap.js";
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scanner/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,cAAc,EAAyB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,UAAU,EAAyB,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,QAAQ,EAA2C,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scanner/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,cAAc,EAAyB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,UAAU,EAAyB,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,QAAQ,EAA2C,MAAM,gBAAgB,CAAC;AACnF,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,GAIrB,MAAM,gBAAgB,CAAC"}
@@ -186,6 +186,18 @@ export declare const ingestScannerOutputSchema: {
186
186
  * Schema for the `auto_scan` tool. Auto-detects available scanners
187
187
  * in the workspace, runs them, and ingests findings into the SARIF store.
188
188
  */
189
+ /**
190
+ * Schema for the `bootstrap_scanner` tool. Detects project type,
191
+ * installs the appropriate scanner, creates config files, and runs
192
+ * auto_scan to verify.
193
+ */
194
+ export declare const bootstrapScannerSchema: {
195
+ readonly type: "object";
196
+ readonly description: "Detect the project type (JavaScript, TypeScript, Python, Java, C#), install the appropriate scanner (ESLint for JS/TS, Bandit for Python, Semgrep for Java/C#), create a minimal config file, and run auto_scan to verify. Skips installation if a scanner is already configured. Use this when auto_scan finds no scanners and quality grades are vacuously A.";
197
+ readonly properties: {};
198
+ readonly required: readonly [];
199
+ readonly additionalProperties: false;
200
+ };
189
201
  export declare const autoScanSchema: {
190
202
  readonly type: "object";
191
203
  readonly description: "Auto-detect available scanners (ESLint, Semgrep, Bandit, Stryker) in the workspace, execute them, and ingest findings into the SARIF store. Returns detection results, per-scanner execution stats, and total findings ingested. Call this to populate findings without manual scanner invocation.";
@@ -1 +1 @@
1
- {"version":3,"file":"tool-schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/tool-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;;GAGG;AACH,eAAO,MAA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H,eAAO,MAAM,sBAAsB;;;;;;CAOzB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;CAOjB,CAAC;AAEX,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBpB,CAAC"}
@@ -186,6 +186,18 @@ export const ingestScannerOutputSchema = {
186
186
  * Schema for the `auto_scan` tool. Auto-detects available scanners
187
187
  * in the workspace, runs them, and ingests findings into the SARIF store.
188
188
  */
189
+ /**
190
+ * Schema for the `bootstrap_scanner` tool. Detects project type,
191
+ * installs the appropriate scanner, creates config files, and runs
192
+ * auto_scan to verify.
193
+ */
194
+ export const bootstrapScannerSchema = {
195
+ type: "object",
196
+ description: "Detect the project type (JavaScript, TypeScript, Python, Java, C#), install the appropriate scanner (ESLint for JS/TS, Bandit for Python, Semgrep for Java/C#), create a minimal config file, and run auto_scan to verify. Skips installation if a scanner is already configured. Use this when auto_scan finds no scanners and quality grades are vacuously A.",
197
+ properties: {},
198
+ required: [],
199
+ additionalProperties: false,
200
+ };
189
201
  export const autoScanSchema = {
190
202
  type: "object",
191
203
  description: "Auto-detect available scanners (ESLint, Semgrep, Bandit, Stryker) in the workspace, execute them, and ingest findings into the SARIF store. Returns detection results, per-scanner execution stats, and total findings ingested. Call this to populate findings without manual scanner invocation.",
@@ -1 +1 @@
1
- {"version":3,"file":"tool-schemas.js","sourceRoot":"","sources":["../../src/schemas/tool-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,2EAA2E;AAC3E,0EAA0E;AAC1E,wCAAwC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,sQAAsQ;IACxQ,UAAU,EAAE;QACV,oBAAoB,EAAE;YACpB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,+EAA+E;SAC7F;QACD,eAAe,EAAE;Y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,EAAE;IACZ,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,wQAAwQ;IAC1Q,UAAU,EAAE;QACV,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,6DAA6D;YAC1E,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE;gBAC5C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE;aACrC;YACD,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;SAC9B;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,wBAAwB;YACjC,WAAW,EAAE,8FAA8F;SAC5G;KACF;IACD,QAAQ,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC;IACzC,oBAAoB,EAAE,KAAK;CACnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-crap",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Deterministic QA plugin for Claude Code — CRAP index, Technical Debt Ratio, tree-sitter AST, SARIF 2.1.0, hooks, and a local Vue dashboard.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://code.claude.com/schemas/plugin.json",
3
3
  "name": "claude-crap",
4
- "version": "0.2.0",
4
+ "version": "0.3.1",
5
5
  "description": "Deterministic Quality Assurance plugin for Claude Code. Wraps every Write / Edit / Bash tool call with a PreToolUse gatekeeper, a PostToolUse verifier, and a Stop quality gate backed by CRAP index, Technical Debt Ratio, tree-sitter AST metrics, and SARIF 2.1.0 reports. Forbids the agent from writing functional code before a test safety net exists.",
6
6
  "author": {
7
7
  "name": "Alan Hernandez",