@kevinrabun/judges 3.124.5 → 3.126.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/agents/accessibility.judge.md +1 -1
- package/agents/agent-instructions.judge.md +1 -1
- package/agents/ai-code-safety.judge.md +10 -1
- package/agents/api-design.judge.md +1 -1
- package/agents/authentication.judge.md +1 -1
- package/agents/backwards-compatibility.judge.md +1 -1
- package/agents/caching.judge.md +1 -1
- package/agents/ci-cd.judge.md +1 -1
- package/agents/cloud-readiness.judge.md +1 -1
- package/agents/code-structure.judge.md +1 -1
- package/agents/compliance.judge.md +1 -1
- package/agents/concurrency.judge.md +1 -1
- package/agents/configuration-management.judge.md +1 -1
- package/agents/cost-effectiveness.judge.md +9 -1
- package/agents/cybersecurity.judge.md +1 -1
- package/agents/data-security.judge.md +1 -1
- package/agents/data-sovereignty.judge.md +1 -1
- package/agents/database.judge.md +1 -1
- package/agents/dependency-health.judge.md +1 -1
- package/agents/documentation.judge.md +1 -1
- package/agents/error-handling.judge.md +1 -1
- package/agents/ethics-bias.judge.md +1 -1
- package/agents/framework-safety.judge.md +9 -1
- package/agents/hallucination-detection.judge.md +1 -1
- package/agents/iac-security.judge.md +1 -1
- package/agents/intent-alignment.judge.md +1 -1
- package/agents/internationalization.judge.md +1 -1
- package/agents/logging-privacy.judge.md +1 -1
- package/agents/logic-review.judge.md +8 -0
- package/agents/maintainability.judge.md +10 -1
- package/agents/observability.judge.md +1 -1
- package/agents/performance.judge.md +1 -1
- package/agents/portability.judge.md +1 -1
- package/agents/rate-limiting.judge.md +1 -1
- package/agents/reliability.judge.md +1 -1
- package/agents/scalability.judge.md +1 -1
- package/agents/security.judge.md +1 -1
- package/agents/software-practices.judge.md +1 -1
- package/agents/testing.judge.md +1 -1
- package/agents/ux.judge.md +1 -1
- package/dist/api.d.ts +2 -1
- package/dist/api.js +2 -0
- package/dist/cli-formatters.js +38 -0
- package/dist/cli.js +27 -1
- package/dist/commands/llm-benchmark.js +18 -5
- package/dist/evaluators/index.js +163 -1
- package/dist/evaluators/shared.js +33 -0
- package/dist/judges/accessibility.js +1 -1
- package/dist/judges/agent-instructions.js +1 -1
- package/dist/judges/ai-code-safety.js +10 -1
- package/dist/judges/api-design.js +1 -1
- package/dist/judges/authentication.js +1 -1
- package/dist/judges/backwards-compatibility.js +1 -1
- package/dist/judges/caching.js +1 -1
- package/dist/judges/ci-cd.js +1 -1
- package/dist/judges/cloud-readiness.js +1 -1
- package/dist/judges/code-structure.js +1 -1
- package/dist/judges/compliance.js +1 -1
- package/dist/judges/concurrency.js +1 -1
- package/dist/judges/configuration-management.js +1 -1
- package/dist/judges/cost-effectiveness.js +9 -1
- package/dist/judges/cybersecurity.js +1 -1
- package/dist/judges/data-security.js +1 -1
- package/dist/judges/data-sovereignty.js +1 -1
- package/dist/judges/database.js +1 -1
- package/dist/judges/dependency-health.js +1 -1
- package/dist/judges/documentation.js +1 -1
- package/dist/judges/error-handling.js +1 -1
- package/dist/judges/ethics-bias.js +1 -1
- package/dist/judges/framework-safety.js +9 -1
- package/dist/judges/hallucination-detection.js +1 -1
- package/dist/judges/iac-security.js +1 -1
- package/dist/judges/intent-alignment.js +1 -1
- package/dist/judges/internationalization.js +1 -1
- package/dist/judges/logging-privacy.js +1 -1
- package/dist/judges/logic-review.js +9 -1
- package/dist/judges/maintainability.js +10 -1
- package/dist/judges/observability.js +1 -1
- package/dist/judges/performance.js +1 -1
- package/dist/judges/portability.js +1 -1
- package/dist/judges/rate-limiting.js +1 -1
- package/dist/judges/reliability.js +1 -1
- package/dist/judges/scalability.js +1 -1
- package/dist/judges/security.js +1 -1
- package/dist/judges/software-practices.js +1 -1
- package/dist/judges/testing.js +1 -1
- package/dist/judges/ux.js +1 -1
- package/dist/regulatory-scope.d.ts +27 -0
- package/dist/regulatory-scope.js +181 -0
- package/dist/tools/prompts.d.ts +1 -1
- package/dist/tools/prompts.js +3 -1
- package/dist/types.d.ts +87 -0
- package/judgesrc.schema.json +14 -0
- package/package.json +2 -2
- package/server.json +2 -2
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Your role is adversarial: assume the code has accessibility defects and actively hunt for them. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
43
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Assume instruction files are brittle until proven robust.
|
|
42
42
|
- Never praise or compliment; report risks, ambiguities, and missing controls.
|
|
43
43
|
- If uncertain, flag likely ambiguity only when you can cite specific evidence from the instruction file. Speculative findings without concrete evidence erode trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code.
|
|
@@ -48,8 +48,17 @@ FALSE POSITIVE AVOIDANCE:
|
|
|
48
48
|
- Missing AI-specific guardrails (content filtering, toxicity detection) are only relevant for AI-facing code.
|
|
49
49
|
- Framework-level AI safety features (OpenAI content policy, Anthropic safety layers) are external controls — code calling these APIs is correctly delegating safety.
|
|
50
50
|
|
|
51
|
+
CLEAN CODE RECOGNITION (if ALL of the following are true, report ZERO findings):
|
|
52
|
+
- Input validation present on user-facing entry points
|
|
53
|
+
- No eval(), exec(), or dynamic code generation from untrusted input
|
|
54
|
+
- API keys/secrets not hardcoded (using environment variables or secret managers)
|
|
55
|
+
- Dependencies from standard registries with no placeholder/example credentials
|
|
56
|
+
- Error handling does not expose internal details to callers
|
|
57
|
+
- No disabled security features (TLS verification, CORS restrictions)
|
|
58
|
+
- Standard application code without AI/LLM interactions does not need AI safety review
|
|
59
|
+
|
|
51
60
|
ADVERSARIAL MANDATE:
|
|
52
61
|
- Assume the code was generated by an AI and has not been security-reviewed. Hunt for the patterns LLMs typically get wrong.
|
|
53
62
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
54
63
|
- If uncertain, flag the issue only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
55
|
-
-
|
|
64
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -52,4 +52,4 @@ ADVERSARIAL MANDATE:
|
|
|
52
52
|
- Your role is adversarial: assume the API has design flaws and actively hunt for them. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
53
53
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
54
54
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
55
|
-
-
|
|
55
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -58,4 +58,4 @@ ADVERSARIAL MANDATE:
|
|
|
58
58
|
- Your role is adversarial: assume authentication is broken and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
59
59
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
60
60
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
61
|
-
-
|
|
61
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Your role is adversarial: assume backwards compatibility is not considered and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
43
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
package/agents/caching.judge.md
CHANGED
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Your role is adversarial: assume the caching strategy is flawed or absent and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
43
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
package/agents/ci-cd.judge.md
CHANGED
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Your role is adversarial: assume the CI/CD posture is weak and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
43
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -48,4 +48,4 @@ ADVERSARIAL MANDATE:
|
|
|
48
48
|
- Your role is adversarial: assume the code is not cloud-ready and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
49
49
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
50
50
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
51
|
-
-
|
|
51
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -40,7 +40,7 @@ ADVERSARIAL MANDATE:
|
|
|
40
40
|
- Your role is adversarial: assume the code has structural problems and actively hunt for complexity, dead code, and over-sized functions. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
41
41
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
42
42
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
43
|
-
-
|
|
43
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
44
44
|
|
|
45
45
|
FALSE POSITIVE AVOIDANCE:
|
|
46
46
|
- **Dict[str, Any] at serialization boundaries**: When code deserializes JSON (json.loads, JSON.parse, API responses), Dict[str, Any] / Record<string, any> is the correct type until schema validation narrows it. Do not flag dynamic types at JSON I/O boundaries when the schema is defined elsewhere (Pydantic model, TypedDict, Zod schema).
|
|
@@ -44,4 +44,4 @@ ADVERSARIAL MANDATE:
|
|
|
44
44
|
- Your role is adversarial: assume the code has compliance gaps and actively hunt for them. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
45
45
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
46
46
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
47
|
-
-
|
|
47
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -43,4 +43,4 @@ ADVERSARIAL MANDATE:
|
|
|
43
43
|
- Your role is adversarial: assume the code has concurrency bugs and actively hunt for them. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
44
44
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
45
45
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
46
|
-
-
|
|
46
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Your role is adversarial: assume configuration management is inadequate and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
43
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -33,8 +33,16 @@ FALSE POSITIVE AVOIDANCE:
|
|
|
33
33
|
- **Tree/hierarchy traversal**: Nested loops that iterate parent → children (e.g., chapters → sections → articles) visit each element once. Total work is O(total_items), NOT O(n²). Only flag quadratic cost when two independent collections are cross-joined.
|
|
34
34
|
- **Bounded reference datasets**: Loaders for fixed-size data (regulations, schemas, configs with <1000 items) have bounded cost regardless of algorithm choice. Do not flag these as scaling cost concerns.
|
|
35
35
|
|
|
36
|
+
CLEAN CODE RECOGNITION (if ALL of the following are true, report ZERO findings):
|
|
37
|
+
- Database queries are targeted (no SELECT * on large tables without limits)
|
|
38
|
+
- No unbounded loops or recursive calls on external data
|
|
39
|
+
- Resources (connections, file handles, streams) cleaned up after use
|
|
40
|
+
- No redundant network calls or duplicate computations in hot paths
|
|
41
|
+
- Appropriate use of caching or memoization where data is re-read
|
|
42
|
+
- Small utility functions, type definitions, and configuration code are inherently cost-neutral
|
|
43
|
+
|
|
36
44
|
ADVERSARIAL MANDATE:
|
|
37
45
|
- Your role is adversarial: assume the code wastes resources and actively hunt for inefficiencies. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
38
46
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
39
47
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
40
|
-
-
|
|
48
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -58,4 +58,4 @@ ADVERSARIAL MANDATE:
|
|
|
58
58
|
- Your role is adversarial: assume the code is vulnerable and actively hunt for exploits. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
59
59
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
60
60
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
61
|
-
-
|
|
61
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -45,4 +45,4 @@ ADVERSARIAL MANDATE:
|
|
|
45
45
|
- Your role is adversarial: assume the code leaks or mishandles data and actively hunt for exposures. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
46
46
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
47
47
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
48
|
-
-
|
|
48
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -55,4 +55,4 @@ ADVERSARIAL MANDATE:
|
|
|
55
55
|
- Your role is adversarial: assume sovereignty controls are missing unless explicitly shown.
|
|
56
56
|
- Never praise or compliment the code. Report only gaps, risks, and deficiencies.
|
|
57
57
|
- If uncertain, flag potential sovereignty exposure only when you can cite specific code evidence. Speculative findings without concrete evidence erode trust.
|
|
58
|
-
-
|
|
58
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code.
|
package/agents/database.judge.md
CHANGED
|
@@ -46,4 +46,4 @@ ADVERSARIAL MANDATE:
|
|
|
46
46
|
- Your role is adversarial: assume database usage is unsafe and inefficient and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
47
47
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
48
48
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
49
|
-
-
|
|
49
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -43,4 +43,4 @@ ADVERSARIAL MANDATE:
|
|
|
43
43
|
- Your role is adversarial: assume the dependency tree has risks and actively hunt for them. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
44
44
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
45
45
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
46
|
-
-
|
|
46
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -50,4 +50,4 @@ ADVERSARIAL MANDATE:
|
|
|
50
50
|
- Your role is adversarial: assume the documentation is inadequate and actively hunt for gaps. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
51
51
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
52
52
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
53
|
-
-
|
|
53
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -50,4 +50,4 @@ ADVERSARIAL MANDATE:
|
|
|
50
50
|
- Your role is adversarial: assume error handling is insufficient and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
51
51
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
52
52
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
53
|
-
-
|
|
53
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -43,4 +43,4 @@ ADVERSARIAL MANDATE:
|
|
|
43
43
|
- Your role is adversarial: assume the code has ethical risks or bias and actively hunt for them. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
44
44
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
45
45
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
46
|
-
-
|
|
46
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -40,8 +40,16 @@ FALSE POSITIVE AVOIDANCE:
|
|
|
40
40
|
- Missing framework features (no CSRF middleware, no rate limiting) should be deferred to specialized judges (SEC, RATE) unless the framework provides them as defaults that were explicitly disabled.
|
|
41
41
|
- Do NOT flag non-web code (CLI tools, scripts, libraries) for web framework safety issues.
|
|
42
42
|
|
|
43
|
+
CLEAN CODE RECOGNITION (if ALL of the following are true, report ZERO findings):
|
|
44
|
+
- Framework middleware/plugins used per official documentation
|
|
45
|
+
- Security middleware enabled (helmet, CSRF protection, etc.) where applicable
|
|
46
|
+
- No explicitly disabled built-in protections
|
|
47
|
+
- Route handlers follow framework conventions
|
|
48
|
+
- Template rendering uses auto-escaping (not disabled)
|
|
49
|
+
- Non-web code (CLI tools, libraries, scripts) does not need web framework review
|
|
50
|
+
|
|
43
51
|
ADVERSARIAL MANDATE:
|
|
44
52
|
- Your role is adversarial: assume the code misuses framework APIs and actively hunt for violations. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
45
53
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
46
54
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
47
|
-
-
|
|
55
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -43,4 +43,4 @@ ADVERSARIAL MANDATE:
|
|
|
43
43
|
- Assume every API call could be hallucinated. Hunt for subtle mismatches between documented APIs and actual usage.
|
|
44
44
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
45
45
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
46
|
-
-
|
|
46
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -41,5 +41,5 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Your role is adversarial: assume the infrastructure code is insecure and actively hunt for misconfigurations. Back every finding with concrete code evidence (line numbers, resource definitions, configuration blocks).
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and security gaps.
|
|
43
43
|
- If you are uncertain whether something is a misconfiguration, flag it only when you can cite specific code evidence (line numbers, patterns, resource definitions). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
45
45
|
- Pay special attention to defaults that are insecure when not explicitly configured (e.g., public access defaults, missing encryption defaults).
|
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Assume every comment could be lying. Verify that implementations match their stated intent.
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
43
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -39,4 +39,4 @@ ADVERSARIAL MANDATE:
|
|
|
39
39
|
- Your role is adversarial: assume the code will break in non-English locales and actively hunt for i18n defects. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
40
40
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
41
41
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
42
|
-
-
|
|
42
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Your role is adversarial: assume logs contain sensitive data and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
43
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -32,3 +32,11 @@ FALSE POSITIVE AVOIDANCE:
|
|
|
32
32
|
- Feature flags intentionally create "dead" branches — skip if flag-guarded
|
|
33
33
|
- Test files may intentionally test edge cases with unusual conditions
|
|
34
34
|
- Framework-required patterns (e.g., exhaustive switch in Redux) are intentional
|
|
35
|
+
|
|
36
|
+
CLEAN CODE RECOGNITION (if ALL of the following are true, report ZERO findings):
|
|
37
|
+
- Control flow is straightforward with no inverted conditions or unreachable code
|
|
38
|
+
- Functions return consistent types and handle edge cases
|
|
39
|
+
- Boolean expressions read naturally without double negatives
|
|
40
|
+
- Switch/match statements cover expected cases
|
|
41
|
+
- No partial refactor artifacts, dead code, or contradictory logic
|
|
42
|
+
- Guard clauses and early returns used appropriately
|
|
@@ -37,8 +37,17 @@ FALSE POSITIVE AVOIDANCE:
|
|
|
37
37
|
- Do NOT flag configuration files, data files, or build scripts for code maintainability issues.
|
|
38
38
|
- Only flag maintainability issues when you can cite specific code patterns (deep nesting, excessive coupling, duplicated logic) with exact line numbers.
|
|
39
39
|
|
|
40
|
+
CLEAN CODE RECOGNITION (if ALL of the following are true, report ZERO findings):
|
|
41
|
+
- Functions/methods have clear single responsibilities and reasonable length
|
|
42
|
+
- Naming is consistent and self-documenting
|
|
43
|
+
- No deep nesting (>3 levels) or excessive cyclomatic complexity
|
|
44
|
+
- No copy-pasted logic blocks
|
|
45
|
+
- No magic numbers in business logic (configuration constants are fine)
|
|
46
|
+
- Standard library and framework patterns used idiomatically
|
|
47
|
+
- Code reads top-to-bottom without requiring cross-referencing
|
|
48
|
+
|
|
40
49
|
ADVERSARIAL MANDATE:
|
|
41
50
|
- Your role is adversarial: assume the code is unmaintainable and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
42
51
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
52
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
53
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -49,4 +49,4 @@ ADVERSARIAL MANDATE:
|
|
|
49
49
|
- Your role is adversarial: assume the code is unobservable and will be impossible to debug in production. Actively hunt for monitoring gaps. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
50
50
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
51
51
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
52
|
-
-
|
|
52
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Your role is adversarial: assume the code has performance problems and actively hunt for bottlenecks. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
43
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Your role is adversarial: assume the code is not portable and actively hunt for platform dependencies. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
43
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -50,4 +50,4 @@ ADVERSARIAL MANDATE:
|
|
|
50
50
|
- Your role is adversarial: assume rate limiting is absent or insufficient and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
51
51
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
52
52
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
53
|
-
-
|
|
53
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -52,4 +52,4 @@ ADVERSARIAL MANDATE:
|
|
|
52
52
|
- Your role is adversarial: assume the code will fail in production and actively hunt for reliability gaps. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
53
53
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
54
54
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
55
|
-
-
|
|
55
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -47,4 +47,4 @@ ADVERSARIAL MANDATE:
|
|
|
47
47
|
- Your role is adversarial: assume the code will not scale and actively hunt for bottlenecks. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
48
48
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
49
49
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
50
|
-
-
|
|
50
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
package/agents/security.judge.md
CHANGED
|
@@ -59,4 +59,4 @@ ADVERSARIAL MANDATE:
|
|
|
59
59
|
- Your role is adversarial: assume the code has security vulnerabilities and actively hunt for them. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
60
60
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
61
61
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
62
|
-
-
|
|
62
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
|
@@ -51,4 +51,4 @@ ADVERSARIAL MANDATE:
|
|
|
51
51
|
- Your role is adversarial: assume the code has engineering quality problems and actively hunt for them. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
52
52
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
53
53
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
54
|
-
-
|
|
54
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
package/agents/testing.judge.md
CHANGED
|
@@ -49,4 +49,4 @@ ADVERSARIAL MANDATE:
|
|
|
49
49
|
- Your role is adversarial: assume the test coverage is insufficient and actively hunt for gaps. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
50
50
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
51
51
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
52
|
-
-
|
|
52
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
package/agents/ux.judge.md
CHANGED
|
@@ -41,4 +41,4 @@ ADVERSARIAL MANDATE:
|
|
|
41
41
|
- Your role is adversarial: assume the user experience is poor and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
|
|
42
42
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
43
43
|
- If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
|
|
44
|
-
-
|
|
44
|
+
- If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
|
package/dist/api.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* const result = evaluateCode("const x = eval(input);", "typescript");
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
|
-
export type { Severity, Verdict, Finding, Patch, LangFamily, JudgesConfig, RuleOverride, ProjectFile, ProjectVerdict, DiffVerdict, DependencyEntry, DependencyVerdict, JudgeEvaluation, TribunalVerdict, JudgeDefinition, EvaluationContextV2, EvidenceBundleV2, SpecializedFindingV2, TribunalVerdictV2, MustFixGateOptions, MustFixGateResult, AppBuilderWorkflowResult, PlainLanguageFinding, WorkflowTask, PolicyProfile, SuppressionRecord, SuppressionResult, ExecutionTrace, RuleTrace, StreamingBatch, JudgeSelectionContext, JudgeSelectionResult, SessionContext, } from "./types.js";
|
|
11
|
+
export type { Severity, Verdict, Finding, Patch, LangFamily, JudgesConfig, RuleOverride, ProjectFile, ProjectVerdict, DiffVerdict, DependencyEntry, DependencyVerdict, JudgeEvaluation, TribunalVerdict, JudgeDefinition, EvaluationContextV2, EvidenceBundleV2, SpecializedFindingV2, TribunalVerdictV2, MustFixGateOptions, MustFixGateResult, AppBuilderWorkflowResult, PlainLanguageFinding, WorkflowTask, PolicyProfile, SuppressionRecord, SuppressionResult, ExecutionTrace, RuleTrace, StreamingBatch, JudgeSelectionContext, JudgeSelectionResult, SessionContext, HumanFocusGuide, FocusItem, BlindSpot, } from "./types.js";
|
|
12
12
|
export { JudgesError, ConfigError, EvaluationError, ParseError } from "./errors.js";
|
|
13
13
|
export { parseConfig, defaultConfig, mergeConfigs, discoverCascadingConfigs, loadCascadingConfig, loadConfigFile, expandEnvPlaceholders, loadPluginJudges, validatePluginSpecifiers, isValidJudgeDefinition, validateJudgeDefinition, applyOverridesForFile, applyLanguageProfile, resolveExtendsConfig, } from "./config.js";
|
|
14
14
|
export { EXT_TO_LANG, SUPPORTED_EXTENSIONS, detectLanguageFromPath } from "./ext-to-lang.js";
|
|
@@ -47,6 +47,7 @@ export { runFeedbackLoop, formatFeedbackLoopReport } from "./feedback-loop.js";
|
|
|
47
47
|
export type { FeedbackLoopResult, ConfidenceAdjustment, FeedbackLoopStats } from "./feedback-loop.js";
|
|
48
48
|
export { registerPlugin, unregisterPlugin, getRegisteredPlugins, getCustomRules, getPluginJudges, evaluateCustomRules, runBeforeHooks, runAfterHooks, clearPlugins, } from "./plugins.js";
|
|
49
49
|
export type { CustomRule, JudgesPlugin, PluginRegistration } from "./plugins.js";
|
|
50
|
+
export { filterByRegulatoryScope, getSupportedFrameworks } from "./regulatory-scope.js";
|
|
50
51
|
export { JudgeRegistry, defaultRegistry } from "./judge-registry.js";
|
|
51
52
|
export { parseFrontmatter, validateFrontmatter, parseAgentFile, resolveEvaluator, agentToJudgeDefinition, loadAgentDirectory, loadAndRegisterAgents, } from "./agent-loader.js";
|
|
52
53
|
export type { AgentFrontmatter, ParsedAgent } from "./agent-loader.js";
|
package/dist/api.js
CHANGED
|
@@ -56,6 +56,8 @@ export { getAgentCard, createTask, getTask, completeTask, failTask, listTasks, p
|
|
|
56
56
|
export { runFeedbackLoop, formatFeedbackLoopReport } from "./feedback-loop.js";
|
|
57
57
|
// ─── Plugin API ──────────────────────────────────────────────────────────────
|
|
58
58
|
export { registerPlugin, unregisterPlugin, getRegisteredPlugins, getCustomRules, getPluginJudges, evaluateCustomRules, runBeforeHooks, runAfterHooks, clearPlugins, } from "./plugins.js";
|
|
59
|
+
// ─── Regulatory Scope ────────────────────────────────────────────────────────
|
|
60
|
+
export { filterByRegulatoryScope, getSupportedFrameworks } from "./regulatory-scope.js";
|
|
59
61
|
// ─── Judge Registry ──────────────────────────────────────────────────────────
|
|
60
62
|
export { JudgeRegistry, defaultRegistry } from "./judge-registry.js";
|
|
61
63
|
// ─── Agent Markdown Loader ───────────────────────────────────────────────────
|
package/dist/cli-formatters.js
CHANGED
|
@@ -136,6 +136,44 @@ export function formatTextOutput(verdict) {
|
|
|
136
136
|
}
|
|
137
137
|
lines.push("");
|
|
138
138
|
}
|
|
139
|
+
// Human Focus Guide
|
|
140
|
+
if (verdict.humanFocusGuide) {
|
|
141
|
+
const guide = verdict.humanFocusGuide;
|
|
142
|
+
lines.push(" 👤 Human Reviewer Focus Guide");
|
|
143
|
+
lines.push(" " + "─".repeat(60));
|
|
144
|
+
lines.push(` ${guide.summary}`);
|
|
145
|
+
lines.push("");
|
|
146
|
+
if (guide.trust.length > 0) {
|
|
147
|
+
lines.push(" ✅ TRUST (act on these directly):");
|
|
148
|
+
for (const item of guide.trust.slice(0, 10)) {
|
|
149
|
+
const lineRef = item.lineNumbers?.[0] ? ` L${item.lineNumbers[0]}` : "";
|
|
150
|
+
lines.push(` [${item.severity.toUpperCase()}] ${item.ruleId}${lineRef}: ${item.title}`);
|
|
151
|
+
lines.push(` ${item.reason}`);
|
|
152
|
+
}
|
|
153
|
+
if (guide.trust.length > 10)
|
|
154
|
+
lines.push(` ... and ${guide.trust.length - 10} more`);
|
|
155
|
+
lines.push("");
|
|
156
|
+
}
|
|
157
|
+
if (guide.verify.length > 0) {
|
|
158
|
+
lines.push(" 🔍 VERIFY (use your judgment):");
|
|
159
|
+
for (const item of guide.verify.slice(0, 10)) {
|
|
160
|
+
const lineRef = item.lineNumbers?.[0] ? ` L${item.lineNumbers[0]}` : "";
|
|
161
|
+
lines.push(` [${item.severity.toUpperCase()}] ${item.ruleId}${lineRef}: ${item.title}`);
|
|
162
|
+
lines.push(` ${item.reason}`);
|
|
163
|
+
}
|
|
164
|
+
if (guide.verify.length > 10)
|
|
165
|
+
lines.push(` ... and ${guide.verify.length - 10} more`);
|
|
166
|
+
lines.push("");
|
|
167
|
+
}
|
|
168
|
+
if (guide.blindSpots.length > 0) {
|
|
169
|
+
lines.push(" 🔦 BLIND SPOTS (automated analysis cannot evaluate):");
|
|
170
|
+
for (const spot of guide.blindSpots) {
|
|
171
|
+
lines.push(` • ${spot.area}`);
|
|
172
|
+
lines.push(` ${spot.guidance.slice(0, 120)}${spot.guidance.length > 120 ? "…" : ""}`);
|
|
173
|
+
}
|
|
174
|
+
lines.push("");
|
|
175
|
+
}
|
|
176
|
+
}
|
|
139
177
|
// Exit guidance
|
|
140
178
|
if (verdict.overallVerdict === "fail") {
|
|
141
179
|
lines.push(" ⛔ FAIL — This code has issues that should be addressed before shipping.");
|
package/dist/cli.js
CHANGED
|
@@ -43,6 +43,7 @@ import { formatComparisonReport, formatFullComparisonMatrix, TOOL_PROFILES } fro
|
|
|
43
43
|
import { loadOverrideStore, applyOverrides } from "./commands/override.js";
|
|
44
44
|
import { runGit } from "./tools/command-safety.js";
|
|
45
45
|
import { detectLanguageFromPath, SUPPORTED_EXTENSIONS } from "./ext-to-lang.js";
|
|
46
|
+
import { getSupportedFrameworks } from "./regulatory-scope.js";
|
|
46
47
|
import { formatTribunalOutput, writeOutputIfSpecified, formatSingleJudgeTextOutput, } from "./cli-formatters.js";
|
|
47
48
|
import { COMMAND_TABLE } from "./cli-dispatch.js";
|
|
48
49
|
// ─── Language Detection ─────────────────────────────────────────────────────
|
|
@@ -226,6 +227,8 @@ function printHelp() {
|
|
|
226
227
|
* over-promising features that aren't wired yet.
|
|
227
228
|
*/
|
|
228
229
|
const coreCommands = [
|
|
230
|
+
["judges list", "List all available judges"],
|
|
231
|
+
["judges list --frameworks", "List supported regulatory frameworks"],
|
|
229
232
|
["judges eval [options] [file]", "Evaluate code with the full tribunal"],
|
|
230
233
|
["judges eval --judge <id> [file]", "Evaluate with a single judge"],
|
|
231
234
|
["judges init", "Interactive project setup wizard"],
|
|
@@ -485,6 +488,24 @@ function listJudges() {
|
|
|
485
488
|
console.log(` Total: ${judges.length} judges`);
|
|
486
489
|
console.log("");
|
|
487
490
|
}
|
|
491
|
+
// ─── List Regulatory Frameworks ─────────────────────────────────────────────
|
|
492
|
+
function listFrameworks() {
|
|
493
|
+
const frameworks = getSupportedFrameworks();
|
|
494
|
+
console.log("");
|
|
495
|
+
console.log(" Supported Regulatory Frameworks:");
|
|
496
|
+
console.log(" " + "─".repeat(60));
|
|
497
|
+
console.log(" Use these IDs in .judgesrc → regulatoryScope: [...]");
|
|
498
|
+
console.log("");
|
|
499
|
+
for (const fw of frameworks) {
|
|
500
|
+
console.log(` ${fw.id.padEnd(15)} ${fw.description}`);
|
|
501
|
+
}
|
|
502
|
+
console.log("");
|
|
503
|
+
console.log(` Total: ${frameworks.length} frameworks`);
|
|
504
|
+
console.log("");
|
|
505
|
+
console.log(" Example .judgesrc:");
|
|
506
|
+
console.log(' { "regulatoryScope": ["GDPR", "PCI-DSS", "SOC2"] }');
|
|
507
|
+
console.log("");
|
|
508
|
+
}
|
|
488
509
|
// ─── Version ────────────────────────────────────────────────────────────────
|
|
489
510
|
function getPackageVersion() {
|
|
490
511
|
try {
|
|
@@ -681,7 +702,12 @@ export async function runCli(argv) {
|
|
|
681
702
|
}
|
|
682
703
|
// ─── List Command ────────────────────────────────────────────────────
|
|
683
704
|
if (args.command === "list") {
|
|
684
|
-
|
|
705
|
+
if (argv.includes("--frameworks")) {
|
|
706
|
+
listFrameworks();
|
|
707
|
+
}
|
|
708
|
+
else {
|
|
709
|
+
listJudges();
|
|
710
|
+
}
|
|
685
711
|
process.exit(0);
|
|
686
712
|
}
|
|
687
713
|
// ─── Eval Command ────────────────────────────────────────────────────
|
|
@@ -148,14 +148,27 @@ export function parseLlmRuleIds(response) {
|
|
|
148
148
|
const validPrefixes = getValidRulePrefixes();
|
|
149
149
|
const pattern = /\b([A-Z][A-Z0-9]+)-(\d{1,3})\b/g;
|
|
150
150
|
const found = new Set();
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
// Split response into paragraphs/sections and skip sections that explicitly
|
|
152
|
+
// declare zero findings — rule IDs mentioned in "zero findings" rationale
|
|
153
|
+
// are explanatory references, not actual detections.
|
|
154
|
+
const sections = response.split(/\n{2,}/);
|
|
155
|
+
const zeroFindingsPattern = /\*?\*?(?:ZERO|zero|0|no)\s+findings?\*?\*?|(?:findings?|issues?)[\s:]*\*?\*?(?:none|0|zero)\*?\*?|no\s+(?:issues?|findings?|problems?|concerns?)\s+(?:found|detected|identified|reported)/i;
|
|
156
|
+
for (const section of sections) {
|
|
157
|
+
// If this section explicitly declares zero/no findings, skip rule ID extraction
|
|
158
|
+
if (zeroFindingsPattern.test(section))
|
|
159
|
+
continue;
|
|
160
|
+
let match;
|
|
161
|
+
pattern.lastIndex = 0;
|
|
162
|
+
while ((match = pattern.exec(section)) !== null) {
|
|
163
|
+
if (validPrefixes.has(match[1])) {
|
|
164
|
+
found.add(match[0]);
|
|
165
|
+
}
|
|
155
166
|
}
|
|
156
167
|
}
|
|
157
|
-
// Secondary pass: extract known prefixes from compound IDs like DEPS-TYPO-001
|
|
168
|
+
// Secondary pass on full text: extract known prefixes from compound IDs like DEPS-TYPO-001
|
|
169
|
+
// These are almost always in findings tables, not rationale
|
|
158
170
|
const compoundPattern = /\b([A-Z][A-Z0-9]+)-[A-Z][A-Z0-9]+-(\d{1,3})\b/g;
|
|
171
|
+
let match;
|
|
159
172
|
while ((match = compoundPattern.exec(response)) !== null) {
|
|
160
173
|
if (validPrefixes.has(match[1])) {
|
|
161
174
|
found.add(`${match[1]}-${match[2]}`);
|