@kevinrabun/judges 3.38.0 → 3.40.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 +46 -0
- package/README.md +5 -4
- package/dist/api.d.ts +5 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +5 -1
- package/dist/api.js.map +1 -1
- package/dist/ast/structural-parser.js +3 -3
- package/dist/ast/structural-parser.js.map +1 -1
- package/dist/calibration.d.ts +35 -0
- package/dist/calibration.d.ts.map +1 -1
- package/dist/calibration.js +52 -0
- package/dist/calibration.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +307 -16
- package/dist/cli.js.map +1 -1
- package/dist/commands/benchmark-languages.js +4 -4
- package/dist/commands/benchmark.d.ts +2 -1
- package/dist/commands/benchmark.d.ts.map +1 -1
- package/dist/commands/benchmark.js +67 -2
- package/dist/commands/benchmark.js.map +1 -1
- package/dist/commands/calibration-dashboard.d.ts.map +1 -1
- package/dist/commands/calibration-dashboard.js +198 -0
- package/dist/commands/calibration-dashboard.js.map +1 -1
- package/dist/commands/calibration-share.d.ts +31 -0
- package/dist/commands/calibration-share.d.ts.map +1 -0
- package/dist/commands/calibration-share.js +183 -0
- package/dist/commands/calibration-share.js.map +1 -0
- package/dist/commands/compliance-report.d.ts +35 -0
- package/dist/commands/compliance-report.d.ts.map +1 -0
- package/dist/commands/compliance-report.js +162 -0
- package/dist/commands/compliance-report.js.map +1 -0
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +8 -3
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/feedback-rules.d.ts +29 -0
- package/dist/commands/feedback-rules.d.ts.map +1 -0
- package/dist/commands/feedback-rules.js +174 -0
- package/dist/commands/feedback-rules.js.map +1 -0
- package/dist/commands/feedback.d.ts +12 -0
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +16 -0
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/fix.d.ts.map +1 -1
- package/dist/commands/fix.js +33 -1
- package/dist/commands/fix.js.map +1 -1
- package/dist/commands/governance.d.ts +32 -0
- package/dist/commands/governance.d.ts.map +1 -0
- package/dist/commands/governance.js +203 -0
- package/dist/commands/governance.js.map +1 -0
- package/dist/commands/help.d.ts +8 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +303 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/hook.d.ts.map +1 -1
- package/dist/commands/hook.js +17 -20
- package/dist/commands/hook.js.map +1 -1
- package/dist/commands/llm-benchmark.d.ts +119 -0
- package/dist/commands/llm-benchmark.d.ts.map +1 -0
- package/dist/commands/llm-benchmark.js +396 -0
- package/dist/commands/llm-benchmark.js.map +1 -0
- package/dist/commands/metrics-dashboard.d.ts +22 -0
- package/dist/commands/metrics-dashboard.d.ts.map +1 -0
- package/dist/commands/metrics-dashboard.js +335 -0
- package/dist/commands/metrics-dashboard.js.map +1 -0
- package/dist/commands/metrics.d.ts +58 -0
- package/dist/commands/metrics.d.ts.map +1 -0
- package/dist/commands/metrics.js +242 -0
- package/dist/commands/metrics.js.map +1 -0
- package/dist/commands/onboard.d.ts +13 -0
- package/dist/commands/onboard.d.ts.map +1 -0
- package/dist/commands/onboard.js +179 -0
- package/dist/commands/onboard.js.map +1 -0
- package/dist/commands/org-metrics.d.ts +24 -0
- package/dist/commands/org-metrics.d.ts.map +1 -0
- package/dist/commands/org-metrics.js +238 -0
- package/dist/commands/org-metrics.js.map +1 -0
- package/dist/commands/override.d.ts +62 -0
- package/dist/commands/override.d.ts.map +1 -0
- package/dist/commands/override.js +264 -0
- package/dist/commands/override.js.map +1 -0
- package/dist/commands/parity.d.ts +31 -0
- package/dist/commands/parity.d.ts.map +1 -0
- package/dist/commands/parity.js +213 -0
- package/dist/commands/parity.js.map +1 -0
- package/dist/commands/plugin-search.d.ts +40 -0
- package/dist/commands/plugin-search.d.ts.map +1 -0
- package/dist/commands/plugin-search.js +328 -0
- package/dist/commands/plugin-search.js.map +1 -0
- package/dist/commands/plugins.d.ts +13 -0
- package/dist/commands/plugins.d.ts.map +1 -0
- package/dist/commands/plugins.js +105 -0
- package/dist/commands/plugins.js.map +1 -0
- package/dist/commands/review.js +1 -1
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/snapshot.d.ts +27 -0
- package/dist/commands/snapshot.d.ts.map +1 -1
- package/dist/commands/snapshot.js +99 -0
- package/dist/commands/snapshot.js.map +1 -1
- package/dist/commands/trace.d.ts +65 -0
- package/dist/commands/trace.d.ts.map +1 -0
- package/dist/commands/trace.js +246 -0
- package/dist/commands/trace.js.map +1 -0
- package/dist/commands/trust-ramp.d.ts +30 -0
- package/dist/commands/trust-ramp.d.ts.map +1 -0
- package/dist/commands/trust-ramp.js +190 -0
- package/dist/commands/trust-ramp.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +65 -0
- package/dist/config.js.map +1 -1
- package/dist/data-adapter.d.ts +124 -0
- package/dist/data-adapter.d.ts.map +1 -0
- package/dist/data-adapter.js +213 -0
- package/dist/data-adapter.js.map +1 -0
- package/dist/evaluators/accessibility.js +1 -1
- package/dist/evaluators/accessibility.js.map +1 -1
- package/dist/evaluators/ai-code-safety.d.ts.map +1 -1
- package/dist/evaluators/ai-code-safety.js +1 -4
- package/dist/evaluators/ai-code-safety.js.map +1 -1
- package/dist/evaluators/cost-effectiveness.js +1 -1
- package/dist/evaluators/cost-effectiveness.js.map +1 -1
- package/dist/evaluators/false-positive-review.js +4 -4
- package/dist/evaluators/false-positive-review.js.map +1 -1
- package/dist/evaluators/iac-security.js +1 -1
- package/dist/evaluators/iac-security.js.map +1 -1
- package/dist/evaluators/index.d.ts.map +1 -1
- package/dist/evaluators/index.js +59 -10
- package/dist/evaluators/index.js.map +1 -1
- package/dist/evaluators/intent-alignment.d.ts +4 -0
- package/dist/evaluators/intent-alignment.d.ts.map +1 -1
- package/dist/evaluators/intent-alignment.js +163 -0
- package/dist/evaluators/intent-alignment.js.map +1 -1
- package/dist/evaluators/logic-review.js +1 -1
- package/dist/evaluators/logic-review.js.map +1 -1
- package/dist/evaluators/maintainability.js +1 -1
- package/dist/evaluators/maintainability.js.map +1 -1
- package/dist/evaluators/over-engineering.js +3 -3
- package/dist/evaluators/over-engineering.js.map +1 -1
- package/dist/evaluators/project.d.ts +12 -0
- package/dist/evaluators/project.d.ts.map +1 -1
- package/dist/evaluators/project.js +86 -0
- package/dist/evaluators/project.js.map +1 -1
- package/dist/evaluators/security.js +2 -2
- package/dist/evaluators/security.js.map +1 -1
- package/dist/evaluators/ux.js +1 -1
- package/dist/evaluators/ux.js.map +1 -1
- package/dist/finding-lifecycle.d.ts +9 -0
- package/dist/finding-lifecycle.d.ts.map +1 -1
- package/dist/finding-lifecycle.js +15 -0
- package/dist/finding-lifecycle.js.map +1 -1
- package/dist/fix-history.d.ts +9 -0
- package/dist/fix-history.d.ts.map +1 -1
- package/dist/fix-history.js +15 -0
- package/dist/fix-history.js.map +1 -1
- package/dist/formatters/sarif.d.ts +3 -0
- package/dist/formatters/sarif.d.ts.map +1 -1
- package/dist/formatters/sarif.js +36 -12
- package/dist/formatters/sarif.js.map +1 -1
- package/dist/github-app.d.ts +16 -1
- package/dist/github-app.d.ts.map +1 -1
- package/dist/github-app.js +85 -2
- package/dist/github-app.js.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/judge-registry.d.ts +157 -0
- package/dist/judge-registry.d.ts.map +1 -0
- package/dist/judge-registry.js +273 -0
- package/dist/judge-registry.js.map +1 -0
- package/dist/judges/accessibility.d.ts.map +1 -1
- package/dist/judges/accessibility.js +4 -0
- package/dist/judges/accessibility.js.map +1 -1
- package/dist/judges/agent-instructions.d.ts.map +1 -1
- package/dist/judges/agent-instructions.js +4 -0
- package/dist/judges/agent-instructions.js.map +1 -1
- package/dist/judges/ai-code-safety.d.ts.map +1 -1
- package/dist/judges/ai-code-safety.js +4 -0
- package/dist/judges/ai-code-safety.js.map +1 -1
- package/dist/judges/api-contract.d.ts.map +1 -1
- package/dist/judges/api-contract.js +4 -0
- package/dist/judges/api-contract.js.map +1 -1
- package/dist/judges/api-design.d.ts.map +1 -1
- package/dist/judges/api-design.js +4 -0
- package/dist/judges/api-design.js.map +1 -1
- package/dist/judges/authentication.d.ts.map +1 -1
- package/dist/judges/authentication.js +4 -0
- package/dist/judges/authentication.js.map +1 -1
- package/dist/judges/backwards-compatibility.d.ts.map +1 -1
- package/dist/judges/backwards-compatibility.js +4 -0
- package/dist/judges/backwards-compatibility.js.map +1 -1
- package/dist/judges/caching.d.ts.map +1 -1
- package/dist/judges/caching.js +4 -0
- package/dist/judges/caching.js.map +1 -1
- package/dist/judges/ci-cd.d.ts.map +1 -1
- package/dist/judges/ci-cd.js +4 -0
- package/dist/judges/ci-cd.js.map +1 -1
- package/dist/judges/cloud-readiness.d.ts.map +1 -1
- package/dist/judges/cloud-readiness.js +4 -0
- package/dist/judges/cloud-readiness.js.map +1 -1
- package/dist/judges/code-structure.d.ts.map +1 -1
- package/dist/judges/code-structure.js +4 -0
- package/dist/judges/code-structure.js.map +1 -1
- package/dist/judges/compliance.d.ts.map +1 -1
- package/dist/judges/compliance.js +4 -0
- package/dist/judges/compliance.js.map +1 -1
- package/dist/judges/concurrency.d.ts.map +1 -1
- package/dist/judges/concurrency.js +4 -0
- package/dist/judges/concurrency.js.map +1 -1
- package/dist/judges/configuration-management.d.ts.map +1 -1
- package/dist/judges/configuration-management.js +4 -0
- package/dist/judges/configuration-management.js.map +1 -1
- package/dist/judges/cost-effectiveness.d.ts.map +1 -1
- package/dist/judges/cost-effectiveness.js +4 -0
- package/dist/judges/cost-effectiveness.js.map +1 -1
- package/dist/judges/cybersecurity.d.ts.map +1 -1
- package/dist/judges/cybersecurity.js +4 -0
- package/dist/judges/cybersecurity.js.map +1 -1
- package/dist/judges/data-security.d.ts.map +1 -1
- package/dist/judges/data-security.js +4 -0
- package/dist/judges/data-security.js.map +1 -1
- package/dist/judges/data-sovereignty.d.ts.map +1 -1
- package/dist/judges/data-sovereignty.js +4 -0
- package/dist/judges/data-sovereignty.js.map +1 -1
- package/dist/judges/database.d.ts.map +1 -1
- package/dist/judges/database.js +4 -0
- package/dist/judges/database.js.map +1 -1
- package/dist/judges/dependency-health.d.ts.map +1 -1
- package/dist/judges/dependency-health.js +4 -0
- package/dist/judges/dependency-health.js.map +1 -1
- package/dist/judges/documentation.d.ts.map +1 -1
- package/dist/judges/documentation.js +4 -0
- package/dist/judges/documentation.js.map +1 -1
- package/dist/judges/error-handling.d.ts.map +1 -1
- package/dist/judges/error-handling.js +4 -0
- package/dist/judges/error-handling.js.map +1 -1
- package/dist/judges/ethics-bias.d.ts.map +1 -1
- package/dist/judges/ethics-bias.js +4 -0
- package/dist/judges/ethics-bias.js.map +1 -1
- package/dist/judges/false-positive-review.d.ts.map +1 -1
- package/dist/judges/false-positive-review.js +2 -0
- package/dist/judges/false-positive-review.js.map +1 -1
- package/dist/judges/framework-safety.d.ts.map +1 -1
- package/dist/judges/framework-safety.js +4 -0
- package/dist/judges/framework-safety.js.map +1 -1
- package/dist/judges/hallucination-detection.d.ts.map +1 -1
- package/dist/judges/hallucination-detection.js +4 -0
- package/dist/judges/hallucination-detection.js.map +1 -1
- package/dist/judges/iac-security.d.ts.map +1 -1
- package/dist/judges/iac-security.js +4 -0
- package/dist/judges/iac-security.js.map +1 -1
- package/dist/judges/index.d.ts +59 -0
- package/dist/judges/index.d.ts.map +1 -1
- package/dist/judges/index.js +65 -189
- package/dist/judges/index.js.map +1 -1
- package/dist/judges/intent-alignment.d.ts.map +1 -1
- package/dist/judges/intent-alignment.js +4 -0
- package/dist/judges/intent-alignment.js.map +1 -1
- package/dist/judges/internationalization.d.ts.map +1 -1
- package/dist/judges/internationalization.js +4 -0
- package/dist/judges/internationalization.js.map +1 -1
- package/dist/judges/logging-privacy.d.ts.map +1 -1
- package/dist/judges/logging-privacy.js +4 -0
- package/dist/judges/logging-privacy.js.map +1 -1
- package/dist/judges/logic-review.d.ts.map +1 -1
- package/dist/judges/logic-review.js +4 -0
- package/dist/judges/logic-review.js.map +1 -1
- package/dist/judges/maintainability.d.ts.map +1 -1
- package/dist/judges/maintainability.js +4 -0
- package/dist/judges/maintainability.js.map +1 -1
- package/dist/judges/model-fingerprint.d.ts.map +1 -1
- package/dist/judges/model-fingerprint.js +4 -0
- package/dist/judges/model-fingerprint.js.map +1 -1
- package/dist/judges/multi-turn-coherence.d.ts.map +1 -1
- package/dist/judges/multi-turn-coherence.js +4 -0
- package/dist/judges/multi-turn-coherence.js.map +1 -1
- package/dist/judges/observability.d.ts.map +1 -1
- package/dist/judges/observability.js +4 -0
- package/dist/judges/observability.js.map +1 -1
- package/dist/judges/over-engineering.d.ts.map +1 -1
- package/dist/judges/over-engineering.js +4 -0
- package/dist/judges/over-engineering.js.map +1 -1
- package/dist/judges/performance.d.ts.map +1 -1
- package/dist/judges/performance.js +4 -0
- package/dist/judges/performance.js.map +1 -1
- package/dist/judges/portability.d.ts.map +1 -1
- package/dist/judges/portability.js +4 -0
- package/dist/judges/portability.js.map +1 -1
- package/dist/judges/rate-limiting.d.ts.map +1 -1
- package/dist/judges/rate-limiting.js +4 -0
- package/dist/judges/rate-limiting.js.map +1 -1
- package/dist/judges/reliability.d.ts.map +1 -1
- package/dist/judges/reliability.js +4 -0
- package/dist/judges/reliability.js.map +1 -1
- package/dist/judges/scalability.d.ts.map +1 -1
- package/dist/judges/scalability.js +4 -0
- package/dist/judges/scalability.js.map +1 -1
- package/dist/judges/security.d.ts.map +1 -1
- package/dist/judges/security.js +4 -0
- package/dist/judges/security.js.map +1 -1
- package/dist/judges/software-practices.d.ts.map +1 -1
- package/dist/judges/software-practices.js +4 -0
- package/dist/judges/software-practices.js.map +1 -1
- package/dist/judges/testing.d.ts.map +1 -1
- package/dist/judges/testing.js +4 -0
- package/dist/judges/testing.js.map +1 -1
- package/dist/judges/ux.d.ts.map +1 -1
- package/dist/judges/ux.js +4 -0
- package/dist/judges/ux.js.map +1 -1
- package/dist/plugins.d.ts +8 -51
- package/dist/plugins.d.ts.map +1 -1
- package/dist/plugins.js +16 -125
- package/dist/plugins.js.map +1 -1
- package/dist/security-ids.d.ts +24 -0
- package/dist/security-ids.d.ts.map +1 -0
- package/dist/security-ids.js +240 -0
- package/dist/security-ids.js.map +1 -0
- package/dist/tools/prompts.d.ts +4 -0
- package/dist/tools/prompts.d.ts.map +1 -1
- package/dist/tools/prompts.js +6 -4
- package/dist/tools/prompts.js.map +1 -1
- package/dist/tools/register-scaffold.d.ts +3 -0
- package/dist/tools/register-scaffold.d.ts.map +1 -0
- package/dist/tools/register-scaffold.js +399 -0
- package/dist/tools/register-scaffold.js.map +1 -0
- package/dist/tools/register.d.ts +1 -1
- package/dist/tools/register.d.ts.map +1 -1
- package/dist/tools/register.js +3 -1
- package/dist/tools/register.js.map +1 -1
- package/dist/types.d.ts +75 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
- package/server.json +2 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { analyzeRateLimiting } from "../evaluators/rate-limiting.js";
|
|
2
|
+
import { defaultRegistry } from "../judge-registry.js";
|
|
1
3
|
export const rateLimitingJudge = {
|
|
2
4
|
id: "rate-limiting",
|
|
3
5
|
name: "Judge Rate Limiting",
|
|
@@ -32,5 +34,7 @@ ADVERSARIAL MANDATE:
|
|
|
32
34
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
33
35
|
- 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.
|
|
34
36
|
- Absence of findings does not mean rate limiting is adequate. It means your analysis reached its limits. State this explicitly.`,
|
|
37
|
+
analyze: analyzeRateLimiting,
|
|
35
38
|
};
|
|
39
|
+
defaultRegistry.register(rateLimitingJudge);
|
|
36
40
|
//# sourceMappingURL=rate-limiting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limiting.js","sourceRoot":"","sources":["../../src/judges/rate-limiting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rate-limiting.js","sourceRoot":"","sources":["../../src/judges/rate-limiting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,qBAAqB;IAC3B,MAAM,EAAE,4BAA4B;IACpC,WAAW,EACT,uJAAuJ;IACzJ,UAAU,EAAE,MAAM;IAClB,gBAAgB,EAAE,0DAA0D;IAC5E,iBAAiB,EAAE,2BAA2B;IAC9C,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;iIAyBiH;IAC/H,OAAO,EAAE,mBAAmB;CAC7B,CAAC;AAEF,eAAe,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reliability.d.ts","sourceRoot":"","sources":["../../src/judges/reliability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"reliability.d.ts","sourceRoot":"","sources":["../../src/judges/reliability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,eAAO,MAAM,gBAAgB,EAAE,eAsC9B,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { analyzeReliability } from "../evaluators/reliability.js";
|
|
2
|
+
import { defaultRegistry } from "../judge-registry.js";
|
|
1
3
|
export const reliabilityJudge = {
|
|
2
4
|
id: "reliability",
|
|
3
5
|
name: "Judge Reliability",
|
|
@@ -34,5 +36,7 @@ ADVERSARIAL MANDATE:
|
|
|
34
36
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
35
37
|
- 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.
|
|
36
38
|
- Absence of findings does not mean the code is reliable. It means your analysis reached its limits. State this explicitly.`,
|
|
39
|
+
analyze: analyzeReliability,
|
|
37
40
|
};
|
|
41
|
+
defaultRegistry.register(reliabilityJudge);
|
|
38
42
|
//# sourceMappingURL=reliability.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reliability.js","sourceRoot":"","sources":["../../src/judges/reliability.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reliability.js","sourceRoot":"","sources":["../../src/judges/reliability.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,0BAA0B;IAClC,WAAW,EACT,gKAAgK;IAClK,UAAU,EAAE,KAAK;IACjB,gBAAgB,EAAE,qDAAqD;IACvE,iBAAiB,EAAE,sCAAsC;IACzD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;4HA2B4G;IAC1H,OAAO,EAAE,kBAAkB;CAC5B,CAAC;AAEF,eAAe,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalability.d.ts","sourceRoot":"","sources":["../../src/judges/scalability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"scalability.d.ts","sourceRoot":"","sources":["../../src/judges/scalability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,eAAO,MAAM,gBAAgB,EAAE,eAwC9B,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { analyzeScalability } from "../evaluators/scalability.js";
|
|
2
|
+
import { defaultRegistry } from "../judge-registry.js";
|
|
1
3
|
export const scalabilityJudge = {
|
|
2
4
|
id: "scalability",
|
|
3
5
|
name: "Judge Scalability",
|
|
@@ -36,5 +38,7 @@ ADVERSARIAL MANDATE:
|
|
|
36
38
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
37
39
|
- 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.
|
|
38
40
|
- Absence of findings does not mean the code will scale. It means your analysis reached its limits. State this explicitly.`,
|
|
41
|
+
analyze: analyzeScalability,
|
|
39
42
|
};
|
|
43
|
+
defaultRegistry.register(scalabilityJudge);
|
|
40
44
|
//# sourceMappingURL=scalability.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalability.js","sourceRoot":"","sources":["../../src/judges/scalability.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scalability.js","sourceRoot":"","sources":["../../src/judges/scalability.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,2BAA2B;IACnC,WAAW,EACT,+JAA+J;IACjK,UAAU,EAAE,OAAO;IACnB,gBAAgB,EAAE,6DAA6D;IAC/E,iBAAiB,EAAE,yBAAyB;IAC5C,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2HA6B2G;IACzH,OAAO,EAAE,kBAAkB;CAC5B,CAAC;AAEF,eAAe,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/judges/security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/judges/security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,eAAO,MAAM,aAAa,EAAE,eA+B3B,CAAC"}
|
package/dist/judges/security.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { analyzeSecurity } from "../evaluators/security.js";
|
|
2
|
+
import { defaultRegistry } from "../judge-registry.js";
|
|
1
3
|
export const securityJudge = {
|
|
2
4
|
id: "security",
|
|
3
5
|
name: "Judge Security",
|
|
@@ -26,5 +28,7 @@ RULES FOR YOUR EVALUATION:
|
|
|
26
28
|
- Provide concrete remediation with code examples.
|
|
27
29
|
- Reference CWE IDs where applicable.
|
|
28
30
|
- Score from 0-100 where 100 means excellent security posture.`,
|
|
31
|
+
analyze: analyzeSecurity,
|
|
29
32
|
};
|
|
33
|
+
defaultRegistry.register(securityJudge);
|
|
30
34
|
//# sourceMappingURL=security.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../src/judges/security.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../src/judges/security.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,MAAM,aAAa,GAAoB;IAC5C,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE,0BAA0B;IAClC,WAAW,EACT,qPAAqP;IACvP,UAAU,EAAE,KAAK;IACjB,gBAAgB,EAAE,+FAA+F;IACjH,iBAAiB,EACf,uGAAuG;IACzG,YAAY,EAAE;;;;;;;;;;;;;;;;;;;+DAmB+C;IAC7D,OAAO,EAAE,eAAe;CACzB,CAAC;AAEF,eAAe,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"software-practices.d.ts","sourceRoot":"","sources":["../../src/judges/software-practices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"software-practices.d.ts","sourceRoot":"","sources":["../../src/judges/software-practices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,eAAO,MAAM,sBAAsB,EAAE,eA2CpC,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { analyzeSoftwarePractices } from "../evaluators/software-practices.js";
|
|
2
|
+
import { defaultRegistry } from "../judge-registry.js";
|
|
1
3
|
export const softwarePracticesJudge = {
|
|
2
4
|
id: "software-practices",
|
|
3
5
|
name: "Judge Software Practices",
|
|
@@ -39,5 +41,7 @@ ADVERSARIAL MANDATE:
|
|
|
39
41
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
40
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.
|
|
41
43
|
- Absence of findings does not mean the code follows best practices. It means your analysis reached its limits. State this explicitly.`,
|
|
44
|
+
analyze: analyzeSoftwarePractices,
|
|
42
45
|
};
|
|
46
|
+
defaultRegistry.register(softwarePracticesJudge);
|
|
43
47
|
//# sourceMappingURL=software-practices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"software-practices.js","sourceRoot":"","sources":["../../src/judges/software-practices.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"software-practices.js","sourceRoot":"","sources":["../../src/judges/software-practices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,MAAM,sBAAsB,GAAoB;IACrD,EAAE,EAAE,oBAAoB;IACxB,IAAI,EAAE,0BAA0B;IAChC,MAAM,EAAE,mDAAmD;IAC3D,WAAW,EACT,6LAA6L;IAC/L,UAAU,EAAE,OAAO;IACnB,gBAAgB,EAAE,iEAAiE;IACnF,iBAAiB,EAAE,gCAAgC;IACnD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uIAgCuH;IACrI,OAAO,EAAE,wBAAwB;CAClC,CAAC;AAEF,eAAe,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/judges/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/judges/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,eAAO,MAAM,YAAY,EAAE,eAsC1B,CAAC"}
|
package/dist/judges/testing.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { analyzeTesting } from "../evaluators/testing.js";
|
|
2
|
+
import { defaultRegistry } from "../judge-registry.js";
|
|
1
3
|
export const testingJudge = {
|
|
2
4
|
id: "testing",
|
|
3
5
|
name: "Judge Testing",
|
|
@@ -34,5 +36,7 @@ ADVERSARIAL MANDATE:
|
|
|
34
36
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
35
37
|
- 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.
|
|
36
38
|
- Absence of findings does not mean the code is well-tested. It means your analysis reached its limits. State this explicitly.`,
|
|
39
|
+
analyze: analyzeTesting,
|
|
37
40
|
};
|
|
41
|
+
defaultRegistry.register(testingJudge);
|
|
38
42
|
//# sourceMappingURL=testing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../src/judges/testing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../src/judges/testing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,MAAM,YAAY,GAAoB;IAC3C,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,yBAAyB;IACjC,WAAW,EACT,oKAAoK;IACtK,UAAU,EAAE,MAAM;IAClB,gBAAgB,EAAE,mDAAmD;IACrE,iBAAiB,EAAE,6BAA6B;IAChD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;+HA2B+G;IAC7H,OAAO,EAAE,cAAc;CACxB,CAAC;AAEF,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC"}
|
package/dist/judges/ux.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ux.d.ts","sourceRoot":"","sources":["../../src/judges/ux.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ux.d.ts","sourceRoot":"","sources":["../../src/judges/ux.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,eAAO,MAAM,OAAO,EAAE,eAoCrB,CAAC"}
|
package/dist/judges/ux.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { analyzeUx } from "../evaluators/ux.js";
|
|
2
|
+
import { defaultRegistry } from "../judge-registry.js";
|
|
1
3
|
export const uxJudge = {
|
|
2
4
|
id: "ux",
|
|
3
5
|
name: "Judge UX",
|
|
@@ -32,5 +34,7 @@ ADVERSARIAL MANDATE:
|
|
|
32
34
|
- Never praise or compliment the code. Report only problems, risks, and deficiencies.
|
|
33
35
|
- 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.
|
|
34
36
|
- Absence of findings does not mean the UX is good. It means your analysis reached its limits. State this explicitly.`,
|
|
37
|
+
analyze: analyzeUx,
|
|
35
38
|
};
|
|
39
|
+
defaultRegistry.register(uxJudge);
|
|
36
40
|
//# sourceMappingURL=ux.js.map
|
package/dist/judges/ux.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ux.js","sourceRoot":"","sources":["../../src/judges/ux.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ux.js","sourceRoot":"","sources":["../../src/judges/ux.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,MAAM,OAAO,GAAoB;IACtC,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,qCAAqC;IAC7C,WAAW,EACT,wJAAwJ;IAC1J,UAAU,EAAE,IAAI;IAChB,gBAAgB,EAAE,iEAAiE;IACnF,iBAAiB,EAAE,6BAA6B;IAChD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;sHAyBsG;IACpH,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/plugins.d.ts
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* Allows third-party extensions to add custom judges, rules, and evaluators
|
|
5
5
|
* that integrate seamlessly with the tribunal evaluation pipeline.
|
|
6
6
|
*
|
|
7
|
+
* This module is now a thin façade over the unified JudgeRegistry.
|
|
8
|
+
* All state lives in `defaultRegistry`; these functions delegate to it
|
|
9
|
+
* for full backwards compatibility.
|
|
10
|
+
*
|
|
7
11
|
* ```ts
|
|
8
12
|
* import { registerPlugin } from "@kevinrabun/judges/api";
|
|
9
13
|
* registerPlugin({
|
|
@@ -14,56 +18,9 @@
|
|
|
14
18
|
* });
|
|
15
19
|
* ```
|
|
16
20
|
*/
|
|
17
|
-
import type { Finding, JudgeDefinition
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
/** Unique rule ID (e.g., "MYORG-001") */
|
|
21
|
-
id: string;
|
|
22
|
-
/** Human-readable title */
|
|
23
|
-
title: string;
|
|
24
|
-
/** Severity level */
|
|
25
|
-
severity: Severity;
|
|
26
|
-
/** Which judge category this rule belongs to */
|
|
27
|
-
judgeId: string;
|
|
28
|
-
/** Description of what the rule checks */
|
|
29
|
-
description: string;
|
|
30
|
-
/** Languages this rule applies to (empty = all) */
|
|
31
|
-
languages?: string[];
|
|
32
|
-
/** Regex pattern to match (simple pattern-based rule) */
|
|
33
|
-
pattern?: RegExp;
|
|
34
|
-
/** Custom analyze function for complex logic */
|
|
35
|
-
analyze?: (code: string, language: string) => Finding[];
|
|
36
|
-
/** Suggested fix text */
|
|
37
|
-
suggestedFix?: string;
|
|
38
|
-
/** Tags for filtering */
|
|
39
|
-
tags?: string[];
|
|
40
|
-
}
|
|
41
|
-
/** Plugin definition */
|
|
42
|
-
export interface JudgesPlugin {
|
|
43
|
-
/** Unique plugin name */
|
|
44
|
-
name: string;
|
|
45
|
-
/** Plugin version (semver) */
|
|
46
|
-
version: string;
|
|
47
|
-
/** Optional description */
|
|
48
|
-
description?: string;
|
|
49
|
-
/** Custom rules to register */
|
|
50
|
-
rules?: CustomRule[];
|
|
51
|
-
/** Custom judge definitions to add to the tribunal */
|
|
52
|
-
judges?: JudgeDefinition[];
|
|
53
|
-
/** Hook: called before evaluation */
|
|
54
|
-
beforeEvaluate?: (code: string, language: string) => void;
|
|
55
|
-
/** Hook: called after evaluation with findings for post-processing */
|
|
56
|
-
afterEvaluate?: (findings: Finding[]) => Finding[];
|
|
57
|
-
/** Hook: called to transform findings (e.g., add org-specific metadata) */
|
|
58
|
-
transformFindings?: (findings: Finding[]) => Finding[];
|
|
59
|
-
}
|
|
60
|
-
/** Plugin registration result */
|
|
61
|
-
export interface PluginRegistration {
|
|
62
|
-
name: string;
|
|
63
|
-
version: string;
|
|
64
|
-
rulesRegistered: number;
|
|
65
|
-
judgesRegistered: number;
|
|
66
|
-
}
|
|
21
|
+
import type { Finding, JudgeDefinition } from "./types.js";
|
|
22
|
+
import { type CustomRule, type JudgesPlugin, type PluginRegistration } from "./judge-registry.js";
|
|
23
|
+
export type { CustomRule, JudgesPlugin, PluginRegistration };
|
|
67
24
|
/**
|
|
68
25
|
* Register a plugin with the judges system.
|
|
69
26
|
*/
|
|
@@ -93,7 +50,7 @@ export declare function evaluateCustomRules(code: string, language: string): Fin
|
|
|
93
50
|
*/
|
|
94
51
|
export declare function runBeforeHooks(code: string, language: string): void;
|
|
95
52
|
/**
|
|
96
|
-
* Run all plugin afterEvaluate hooks.
|
|
53
|
+
* Run all plugin afterEvaluate and transformFindings hooks.
|
|
97
54
|
*/
|
|
98
55
|
export declare function runAfterHooks(findings: Finding[]): Finding[];
|
|
99
56
|
/**
|
package/dist/plugins.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAmB,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGnH,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAE7D;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,kBAAkB,CAEvE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,kBAAkB,EAAE,CAE3D;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,UAAU,EAAE,CAE7C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,eAAe,EAAE,CAEnD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,EAAE,CAE7E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAEnE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAG5D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
|
package/dist/plugins.js
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* Allows third-party extensions to add custom judges, rules, and evaluators
|
|
5
5
|
* that integrate seamlessly with the tribunal evaluation pipeline.
|
|
6
6
|
*
|
|
7
|
+
* This module is now a thin façade over the unified JudgeRegistry.
|
|
8
|
+
* All state lives in `defaultRegistry`; these functions delegate to it
|
|
9
|
+
* for full backwards compatibility.
|
|
10
|
+
*
|
|
7
11
|
* ```ts
|
|
8
12
|
* import { registerPlugin } from "@kevinrabun/judges/api";
|
|
9
13
|
* registerPlugin({
|
|
@@ -14,173 +18,60 @@
|
|
|
14
18
|
* });
|
|
15
19
|
* ```
|
|
16
20
|
*/
|
|
17
|
-
|
|
18
|
-
const registeredPlugins = new Map();
|
|
19
|
-
const customRules = new Map();
|
|
20
|
-
const pluginJudges = new Map();
|
|
21
|
+
import { defaultRegistry } from "./judge-registry.js";
|
|
21
22
|
/**
|
|
22
23
|
* Register a plugin with the judges system.
|
|
23
24
|
*/
|
|
24
25
|
export function registerPlugin(plugin) {
|
|
25
|
-
|
|
26
|
-
throw new Error("Plugin name is required");
|
|
27
|
-
if (!plugin.version)
|
|
28
|
-
throw new Error("Plugin version is required");
|
|
29
|
-
if (registeredPlugins.has(plugin.name)) {
|
|
30
|
-
// Unregister existing version first
|
|
31
|
-
unregisterPlugin(plugin.name);
|
|
32
|
-
}
|
|
33
|
-
registeredPlugins.set(plugin.name, plugin);
|
|
34
|
-
let rulesRegistered = 0;
|
|
35
|
-
let judgesRegistered = 0;
|
|
36
|
-
// Register custom rules
|
|
37
|
-
if (plugin.rules) {
|
|
38
|
-
for (const rule of plugin.rules) {
|
|
39
|
-
if (!rule.id)
|
|
40
|
-
throw new Error(`Rule in plugin "${plugin.name}" is missing an id`);
|
|
41
|
-
customRules.set(rule.id, rule);
|
|
42
|
-
rulesRegistered++;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
// Register custom judges
|
|
46
|
-
if (plugin.judges) {
|
|
47
|
-
for (const judge of plugin.judges) {
|
|
48
|
-
pluginJudges.set(judge.id, judge);
|
|
49
|
-
judgesRegistered++;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return { name: plugin.name, version: plugin.version, rulesRegistered, judgesRegistered };
|
|
26
|
+
return defaultRegistry.registerPlugin(plugin);
|
|
53
27
|
}
|
|
54
28
|
/**
|
|
55
29
|
* Unregister a plugin and remove its rules/judges.
|
|
56
30
|
*/
|
|
57
31
|
export function unregisterPlugin(name) {
|
|
58
|
-
|
|
59
|
-
if (!plugin)
|
|
60
|
-
return false;
|
|
61
|
-
if (plugin.rules) {
|
|
62
|
-
for (const rule of plugin.rules) {
|
|
63
|
-
customRules.delete(rule.id);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (plugin.judges) {
|
|
67
|
-
for (const judge of plugin.judges) {
|
|
68
|
-
pluginJudges.delete(judge.id);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
registeredPlugins.delete(name);
|
|
72
|
-
return true;
|
|
32
|
+
return defaultRegistry.unregisterPlugin(name);
|
|
73
33
|
}
|
|
74
34
|
/**
|
|
75
35
|
* Get all registered plugins.
|
|
76
36
|
*/
|
|
77
37
|
export function getRegisteredPlugins() {
|
|
78
|
-
return
|
|
79
|
-
name: plugin.name,
|
|
80
|
-
version: plugin.version,
|
|
81
|
-
rulesRegistered: plugin.rules?.length ?? 0,
|
|
82
|
-
judgesRegistered: plugin.judges?.length ?? 0,
|
|
83
|
-
}));
|
|
38
|
+
return defaultRegistry.getRegisteredPlugins();
|
|
84
39
|
}
|
|
85
40
|
/**
|
|
86
41
|
* Get all custom rules from all registered plugins.
|
|
87
42
|
*/
|
|
88
43
|
export function getCustomRules() {
|
|
89
|
-
return
|
|
44
|
+
return defaultRegistry.getCustomRules();
|
|
90
45
|
}
|
|
91
46
|
/**
|
|
92
47
|
* Get all custom judges from all registered plugins.
|
|
93
48
|
*/
|
|
94
49
|
export function getPluginJudges() {
|
|
95
|
-
return
|
|
50
|
+
return defaultRegistry.getPluginJudges();
|
|
96
51
|
}
|
|
97
52
|
/**
|
|
98
53
|
* Evaluate custom rules against code and return findings.
|
|
99
54
|
*/
|
|
100
55
|
export function evaluateCustomRules(code, language) {
|
|
101
|
-
|
|
102
|
-
for (const rule of customRules.values()) {
|
|
103
|
-
// Skip if rule doesn't apply to this language
|
|
104
|
-
if (rule.languages && rule.languages.length > 0 && !rule.languages.includes(language)) {
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
// Custom analyze function
|
|
108
|
-
if (rule.analyze) {
|
|
109
|
-
try {
|
|
110
|
-
findings.push(...rule.analyze(code, language));
|
|
111
|
-
}
|
|
112
|
-
catch {
|
|
113
|
-
// Silently skip failed custom rules
|
|
114
|
-
}
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
// Pattern-based rule
|
|
118
|
-
if (rule.pattern) {
|
|
119
|
-
const re = new RegExp(rule.pattern.source, rule.pattern.flags);
|
|
120
|
-
let match;
|
|
121
|
-
while ((match = re.exec(code)) !== null) {
|
|
122
|
-
const beforeMatch = code.slice(0, match.index);
|
|
123
|
-
const lineNum = (beforeMatch.match(/\n/g) || []).length + 1;
|
|
124
|
-
findings.push({
|
|
125
|
-
ruleId: rule.id,
|
|
126
|
-
title: rule.title,
|
|
127
|
-
severity: rule.severity,
|
|
128
|
-
description: `${rule.description} (matched: ${match[0].slice(0, 100)})`,
|
|
129
|
-
lineNumbers: [lineNum],
|
|
130
|
-
recommendation: rule.suggestedFix || "",
|
|
131
|
-
suggestedFix: rule.suggestedFix,
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return findings;
|
|
56
|
+
return defaultRegistry.evaluateCustomRules(code, language);
|
|
137
57
|
}
|
|
138
58
|
/**
|
|
139
59
|
* Run all plugin beforeEvaluate hooks.
|
|
140
60
|
*/
|
|
141
61
|
export function runBeforeHooks(code, language) {
|
|
142
|
-
|
|
143
|
-
if (plugin.beforeEvaluate) {
|
|
144
|
-
try {
|
|
145
|
-
plugin.beforeEvaluate(code, language);
|
|
146
|
-
}
|
|
147
|
-
catch {
|
|
148
|
-
// Don't let plugin errors crash the evaluation
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
62
|
+
defaultRegistry.runBeforeHooks(code, language);
|
|
152
63
|
}
|
|
153
64
|
/**
|
|
154
|
-
* Run all plugin afterEvaluate hooks.
|
|
65
|
+
* Run all plugin afterEvaluate and transformFindings hooks.
|
|
155
66
|
*/
|
|
156
67
|
export function runAfterHooks(findings) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (plugin.afterEvaluate) {
|
|
160
|
-
try {
|
|
161
|
-
result = plugin.afterEvaluate(result);
|
|
162
|
-
}
|
|
163
|
-
catch {
|
|
164
|
-
// Don't let plugin errors crash the evaluation
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
if (plugin.transformFindings) {
|
|
168
|
-
try {
|
|
169
|
-
result = plugin.transformFindings(result);
|
|
170
|
-
}
|
|
171
|
-
catch {
|
|
172
|
-
// Don't let plugin errors crash the evaluation
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return result;
|
|
68
|
+
const afterResult = defaultRegistry.runAfterHooks(findings);
|
|
69
|
+
return defaultRegistry.runTransformHooks(afterResult);
|
|
177
70
|
}
|
|
178
71
|
/**
|
|
179
72
|
* Clear all registered plugins (useful for testing).
|
|
180
73
|
*/
|
|
181
74
|
export function clearPlugins() {
|
|
182
|
-
|
|
183
|
-
customRules.clear();
|
|
184
|
-
pluginJudges.clear();
|
|
75
|
+
defaultRegistry.clearPlugins();
|
|
185
76
|
}
|
|
186
77
|
//# sourceMappingURL=plugins.js.map
|
package/dist/plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,eAAe,EAA+D,MAAM,qBAAqB,CAAC;AAKnH;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAAoB;IACjD,OAAO,eAAe,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,eAAe,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,eAAe,CAAC,oBAAoB,EAAE,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,eAAe,CAAC,cAAc,EAAE,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,eAAe,CAAC,eAAe,EAAE,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,QAAgB;IAChE,OAAO,eAAe,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,QAAgB;IAC3D,eAAe,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,QAAmB;IAC/C,MAAM,WAAW,GAAG,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC5D,OAAO,eAAe,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,eAAe,CAAC,YAAY,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CWE / OWASP Rule Mapping — Structured Security Identifiers
|
|
3
|
+
*
|
|
4
|
+
* Maps rule prefixes and specific rule IDs to CWE and OWASP identifiers.
|
|
5
|
+
* These are attached to findings so downstream tools (SARIF viewers,
|
|
6
|
+
* compliance dashboards, etc.) can cross-reference industry standards.
|
|
7
|
+
*/
|
|
8
|
+
import type { Finding } from "./types.js";
|
|
9
|
+
interface SecurityMapping {
|
|
10
|
+
cweIds?: string[];
|
|
11
|
+
owaspIds?: string[];
|
|
12
|
+
learnMoreUrl?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Enrich findings with structured CWE/OWASP IDs and Learn More URLs.
|
|
16
|
+
* Non-mutating — returns a new array of enriched findings.
|
|
17
|
+
*/
|
|
18
|
+
export declare function enrichWithSecurityIds(findings: Finding[]): Finding[];
|
|
19
|
+
/**
|
|
20
|
+
* Get the security mapping for a specific rule or prefix.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getSecurityMapping(ruleId: string): SecurityMapping | undefined;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=security-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-ids.d.ts","sourceRoot":"","sources":["../src/security-ids.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,UAAU,eAAe;IACvB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA+MD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAmBpE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAK9E"}
|