@kevinrabun/judges 3.23.6 → 3.23.8
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 +40 -0
- package/README.md +1 -1
- package/dist/api.d.ts +6 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +6 -1
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +123 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/benchmark.d.ts.map +1 -1
- package/dist/commands/benchmark.js +556 -0
- package/dist/commands/benchmark.js.map +1 -1
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +17 -1
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/fix.d.ts +27 -1
- package/dist/commands/fix.d.ts.map +1 -1
- package/dist/commands/fix.js +137 -13
- package/dist/commands/fix.js.map +1 -1
- package/dist/commands/lsp.d.ts +24 -0
- package/dist/commands/lsp.d.ts.map +1 -0
- package/dist/commands/lsp.js +287 -0
- package/dist/commands/lsp.js.map +1 -0
- package/dist/commands/review.d.ts +37 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +539 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/scaffold-plugin.d.ts +16 -0
- package/dist/commands/scaffold-plugin.d.ts.map +1 -0
- package/dist/commands/scaffold-plugin.js +271 -0
- package/dist/commands/scaffold-plugin.js.map +1 -0
- package/dist/commands/tune.d.ts +25 -0
- package/dist/commands/tune.d.ts.map +1 -0
- package/dist/commands/tune.js +408 -0
- package/dist/commands/tune.js.map +1 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +128 -0
- package/dist/config.js.map +1 -1
- package/dist/disk-cache.d.ts +40 -0
- package/dist/disk-cache.d.ts.map +1 -0
- package/dist/disk-cache.js +196 -0
- package/dist/disk-cache.js.map +1 -0
- package/dist/evaluators/index.d.ts.map +1 -1
- package/dist/evaluators/index.js +50 -3
- package/dist/evaluators/index.js.map +1 -1
- package/dist/evaluators/v2.d.ts.map +1 -1
- package/dist/evaluators/v2.js +2 -2
- package/dist/evaluators/v2.js.map +1 -1
- package/dist/finding-lifecycle.d.ts +93 -0
- package/dist/finding-lifecycle.d.ts.map +1 -0
- package/dist/finding-lifecycle.js +214 -0
- package/dist/finding-lifecycle.js.map +1 -0
- package/dist/formatters/github-actions.d.ts +7 -0
- package/dist/formatters/github-actions.d.ts.map +1 -0
- package/dist/formatters/github-actions.js +69 -0
- package/dist/formatters/github-actions.js.map +1 -0
- package/dist/patches/index.d.ts.map +1 -1
- package/dist/patches/index.js +127 -0
- package/dist/patches/index.js.map +1 -1
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +103 -0
- package/dist/presets.js.map +1 -1
- package/dist/scoring.d.ts +8 -0
- package/dist/scoring.d.ts.map +1 -1
- package/dist/scoring.js +66 -26
- package/dist/scoring.js.map +1 -1
- package/dist/tools/register-evaluation.d.ts +1 -1
- package/dist/tools/register-evaluation.d.ts.map +1 -1
- package/dist/tools/register-evaluation.js +90 -1
- package/dist/tools/register-evaluation.js.map +1 -1
- package/dist/tools/register-workflow.d.ts.map +1 -1
- package/dist/tools/register-workflow.js +23 -20
- package/dist/tools/register-workflow.js.map +1 -1
- package/dist/types.d.ts +36 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to **@kevinrabun/judges** are documented here.
|
|
4
4
|
|
|
5
|
+
## [3.23.8] — 2026-03-06
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **MCP batch parallelism** (`evaluateFilesBatch`) — Bounded-concurrency multi-file evaluation for MCP tool calls, processing files in parallel batches instead of sequentially.
|
|
9
|
+
- **Disk-backed persistent cache** (`DiskCache`) — Content-addressable LRU cache with TTL and configurable max entries, persisted to `.judges-cache/` for cross-run performance. Cache keys now incorporate evaluation options (AST, confidence, severity, rules, weights) for correctness.
|
|
10
|
+
- **Incremental `--changed-only` flag** — Evaluate only files changed since the last git commit, using `git diff --name-only` for fast CI feedback loops.
|
|
11
|
+
- **GitHub Actions annotation formatter** (`--format github-actions`) — Emit `::error`, `::warning`, and `::notice` annotations for native GitHub Actions integration.
|
|
12
|
+
- **Confidence explanations** (`estimateFindingConfidenceWithBasis`) — Each finding now includes an `evidenceBasis` string explaining why the confidence score was assigned (line-precise signal, AST match, pattern heuristic, etc.).
|
|
13
|
+
- **Per-path config overrides** — `.judgesrc.json` `overrides` array supports glob-matched per-path `minSeverity`, `disabledRules`, and `disabledJudges` settings via `applyOverridesForFile()`.
|
|
14
|
+
- **`failOnScoreBelow` config** — Set a minimum score threshold in config; CI exits non-zero when the overall score falls below.
|
|
15
|
+
- **Weighted judge scoring** — `judgeWeights` config field allows per-judge influence weighting on the aggregate score.
|
|
16
|
+
- **LSP server scaffold** (`judges lsp --stdio`) — JSON-RPC/LSP server for real-time diagnostics in editors, exposed via `runLsp()`.
|
|
17
|
+
- **Score trend CLI command** (`judges trend`) — Track and display evaluation score trends over time.
|
|
18
|
+
- **Migration guides** (`docs/migration-guides.md`) — Step-by-step guides for migrating from ESLint, SonarQube, Semgrep, and CodeQL.
|
|
19
|
+
- **Block-level selective autofix** — `judges fix` now supports `--rule`, `--severity`, and `--lines` flags for targeted patching.
|
|
20
|
+
- **MCP `evaluate_file` tool** — Single-file evaluation tool for MCP integrations via `register-evaluation.ts`.
|
|
21
|
+
- **Plugin scaffolding** (`judges scaffold-plugin`) — Generate a starter plugin directory with evaluator template, test harness, and `package.json`.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- **Fix README patch count** — Updated from 53 to 114 to reflect actual patch coverage.
|
|
25
|
+
|
|
26
|
+
### Tests
|
|
27
|
+
- 300+ new test lines covering all P0–P2 features
|
|
28
|
+
- All 2084 tests passing (1324 judges + 760 subsystems)
|
|
29
|
+
|
|
30
|
+
## [3.23.7] — 2026-03-05
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- **`judges review` command** — Post inline review comments on GitHub PRs directly from the CLI. Supports `--pr`, `--repo`, `--approve`, `--dry-run`, `--min-severity`, `--max-comments`, and `--format` flags. Authenticates via `GITHUB_TOKEN` env var or `gh` CLI.
|
|
34
|
+
- **`judges tune` command** — Analyze a project directory and generate an optimal `.judgesrc.json` configuration. Detects frameworks, languages, and file structure to suggest presets, disabled rules, and severity overrides. Supports `--dir`, `--apply`, `--max-files`, and `--verbose` flags.
|
|
35
|
+
- **Finding lifecycle tracking** (`src/finding-lifecycle.ts`) — Track individual findings across evaluation runs with fingerprinting, trend detection (improving/stable/degrading), and stats. Supports in-memory and file-backed (`.judges-findings.json`) stores.
|
|
36
|
+
- **8 framework-aware presets** — `react`, `express`, `fastapi`, `django`, `spring-boot`, `rails`, `nextjs`, `terraform` — each disables irrelevant evaluators for that framework.
|
|
37
|
+
- **~15 new autofix patches** — Python (`eval→ast.literal_eval`, `verify=False→True`, `shell=True→False`, `open` without encoding), Go (`log.Fatal→http.Error`, defer Close error check), Rust (`panic!→Result match`, `.clone()→borrow`), Java (`System.out.println→Logger`, `Statement→PreparedStatement`), C# (`ExecuteSqlRaw→ExecuteSqlInterpolated`, `Console.WriteLine→ILogger`).
|
|
38
|
+
- **10 new clean-code FP benchmark cases** — FastAPI, Go handler, Rust handler, Java Spring, C# ASP.NET, TS utility lib, hardened Terraform, Python data script, Go CLI tool, React component.
|
|
39
|
+
- **Enhanced diff mode** — `judges diff` now loads full file content from disk when the file path exists, improving patch context accuracy.
|
|
40
|
+
|
|
41
|
+
### Tests
|
|
42
|
+
- 38 new tests added (framework presets, finding lifecycle, new patches, review/tune CLI parsing)
|
|
43
|
+
- All 2051 tests passing (1037 judges + 727 subsystems + 217 negative + 70 extension-logic)
|
|
44
|
+
|
|
5
45
|
## [3.23.6] — 2026-03-05
|
|
6
46
|
|
|
7
47
|
### Fixed — False Positive Reductions
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ AI code generators (Copilot, Cursor, Claude, ChatGPT, etc.) write code fast —
|
|
|
24
24
|
| **Scope** | Style + some bugs | Bugs + code smells | Security patterns | **37 domains**: security, cost, compliance, a11y, API design, cloud, UX, … |
|
|
25
25
|
| **AI-generated code focus** | No | No | Partial | **Purpose-built** for AI output failure modes |
|
|
26
26
|
| **Setup** | Config per project | Server + scanner | Cloud or local | **One command**: `npx @kevinrabun/judges eval file.ts` |
|
|
27
|
-
| **Auto-fix patches** | Some | No | No | **
|
|
27
|
+
| **Auto-fix patches** | Some | No | No | **114 deterministic patches** — instant, offline |
|
|
28
28
|
| **Non-technical output** | No | Dashboard | No | **Plain-language findings** with What/Why/Next |
|
|
29
29
|
| **MCP native** | No | No | No | **Yes** — works inside Copilot, Claude, Cursor |
|
|
30
30
|
| **SARIF output** | No | Yes | Yes | **Yes** — upload to GitHub Code Scanning |
|
package/dist/api.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
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, } from "./types.js";
|
|
12
12
|
export { JudgesError, ConfigError, EvaluationError, ParseError } from "./errors.js";
|
|
13
|
-
export { parseConfig, defaultConfig, mergeConfigs, discoverCascadingConfigs, loadCascadingConfig, loadPluginJudges, validatePluginSpecifiers, isValidJudgeDefinition, } from "./config.js";
|
|
13
|
+
export { parseConfig, defaultConfig, mergeConfigs, discoverCascadingConfigs, loadCascadingConfig, loadPluginJudges, validatePluginSpecifiers, isValidJudgeDefinition, applyOverridesForFile, } from "./config.js";
|
|
14
14
|
export { JUDGES, getJudge, getJudgeSummaries } from "./judges/index.js";
|
|
15
15
|
export { evaluateWithJudge, evaluateWithTribunal, evaluateProject, evaluateDiff, analyzeDependencies, enrichWithPatches, crossEvaluatorDedup, diffFindings, formatFindingDiff, applyInlineSuppressions, applyInlineSuppressionsWithAudit, runAppBuilderWorkflow, formatVerdictAsMarkdown, formatEvaluationAsMarkdown, clearEvaluationCaches, } from "./evaluators/index.js";
|
|
16
16
|
export type { FindingDiff } from "./evaluators/index.js";
|
|
@@ -19,10 +19,12 @@ export { analyzeCrossFileTaint } from "./ast/cross-file-taint.js";
|
|
|
19
19
|
export { buildSingleJudgeDeepReviewSection, buildTribunalDeepReviewSection, buildSimplifiedDeepReviewSection, isContentPolicyRefusal, DEEP_REVIEW_PROMPT_INTRO, DEEP_REVIEW_IDENTITY, } from "./tools/deep-review.js";
|
|
20
20
|
export { getCondensedCriteria } from "./tools/prompts.js";
|
|
21
21
|
export { LRUCache, contentHash } from "./cache.js";
|
|
22
|
+
export { DiskCache, getSharedDiskCache, clearSharedDiskCache } from "./disk-cache.js";
|
|
22
23
|
export { clearProjectCache } from "./evaluators/project.js";
|
|
23
24
|
export { findingsToSarif, evaluationToSarif, verdictToSarif, validateSarifLog } from "./formatters/sarif.js";
|
|
24
25
|
export type { SarifValidationError } from "./formatters/sarif.js";
|
|
25
26
|
export { verdictToCsvRows, verdictsToCsv, findingsToCsv } from "./formatters/csv.js";
|
|
27
|
+
export { verdictToGitHubActions } from "./formatters/github-actions.js";
|
|
26
28
|
export { runCli } from "./cli.js";
|
|
27
29
|
export { registerPlugin, unregisterPlugin, getRegisteredPlugins, getCustomRules, getPluginJudges, evaluateCustomRules, runBeforeHooks, runAfterHooks, clearPlugins, } from "./plugins.js";
|
|
28
30
|
export type { CustomRule, JudgesPlugin, PluginRegistration } from "./plugins.js";
|
|
@@ -30,10 +32,13 @@ export { fingerprintCode, fingerprintToFindings } from "./fingerprint.js";
|
|
|
30
32
|
export type { AiFingerprint, AiSignal } from "./fingerprint.js";
|
|
31
33
|
export { buildCalibrationProfile, calibrateFindings, autoCalibrateFindings } from "./calibration.js";
|
|
32
34
|
export type { CalibrationProfile } from "./calibration.js";
|
|
35
|
+
export { estimateFindingConfidence, estimateFindingConfidenceWithBasis } from "./scoring.js";
|
|
33
36
|
export { loadFeedbackStore, saveFeedbackStore, computeFeedbackStats, getFpRateByRule, mergeFeedbackStores, computeTeamFeedbackStats, formatTeamStatsOutput, } from "./commands/feedback.js";
|
|
34
37
|
export type { FeedbackEntry, FeedbackStore, FeedbackVerdict, FeedbackStats, TeamFeedbackStats, RuleTeamStats, } from "./commands/feedback.js";
|
|
35
38
|
export { loadFixHistory, saveFixHistory, computeFixStats, recordFixAccepted, recordFixRejected, getFixAcceptanceRate, getLowAcceptanceRules, } from "./fix-history.js";
|
|
36
39
|
export type { FixOutcome, FixHistory, FixStats } from "./fix-history.js";
|
|
40
|
+
export { applyPatches, filterPatches, detectOverlaps, sortPatchesBottomUp } from "./commands/fix.js";
|
|
41
|
+
export type { PatchCandidate, PatchFilter } from "./commands/fix.js";
|
|
37
42
|
export { testRule, runRuleTests, validateRuleTestSuite, formatRuleTestResults, deserializeRule, } from "./commands/rule.js";
|
|
38
43
|
export type { RuleTestCase, RuleTestResult, RuleTestSuiteResult } from "./commands/rule.js";
|
|
39
44
|
export { findingToDiagnostic, findingsToDiagnostics, findingsToCodeActions, formatForProblemMatcher, formatAsJsonRpc, } from "./formatters/diagnostics.js";
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,YAAY,EACV,QAAQ,EACR,OAAO,EACP,OAAO,EACP,KAAK,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGpF,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,YAAY,EACV,QAAQ,EACR,OAAO,EACP,OAAO,EACP,KAAK,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGpF,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAIxE,OAAO,EACL,iBAA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mC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,OAAO,EAAE,eAAe,CAAC;IACzB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;GAUG;AACH,wBAAuB,mBAAmB,CACxC,KAAK,EAAE,SAAS,EAAE,EAClB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,cAAc,CAAC,oBAAoB,CAAC,CAMtC;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,SAAS,EAAE,EAClB,WAAW,SAAI,EACf,OAAO,CAAC,EAAE,iBAAiB,EAC3B,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GACtD,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAmBjC"}
|
package/dist/api.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// ─── Errors ──────────────────────────────────────────────────────────────────
|
|
12
12
|
export { JudgesError, ConfigError, EvaluationError, ParseError } from "./errors.js";
|
|
13
13
|
// ─── Config ──────────────────────────────────────────────────────────────────
|
|
14
|
-
export { parseConfig, defaultConfig, mergeConfigs, discoverCascadingConfigs, loadCascadingConfig, loadPluginJudges, validatePluginSpecifiers, isValidJudgeDefinition, } from "./config.js";
|
|
14
|
+
export { parseConfig, defaultConfig, mergeConfigs, discoverCascadingConfigs, loadCascadingConfig, loadPluginJudges, validatePluginSpecifiers, isValidJudgeDefinition, applyOverridesForFile, } from "./config.js";
|
|
15
15
|
// ─── Judge Registry ──────────────────────────────────────────────────────────
|
|
16
16
|
export { JUDGES, getJudge, getJudgeSummaries } from "./judges/index.js";
|
|
17
17
|
// ─── Core Evaluation Functions ───────────────────────────────────────────────
|
|
@@ -26,10 +26,12 @@ export { buildSingleJudgeDeepReviewSection, buildTribunalDeepReviewSection, buil
|
|
|
26
26
|
export { getCondensedCriteria } from "./tools/prompts.js";
|
|
27
27
|
// ─── Cache Utilities ─────────────────────────────────────────────────────────
|
|
28
28
|
export { LRUCache, contentHash } from "./cache.js";
|
|
29
|
+
export { DiskCache, getSharedDiskCache, clearSharedDiskCache } from "./disk-cache.js";
|
|
29
30
|
export { clearProjectCache } from "./evaluators/project.js";
|
|
30
31
|
// ─── Formatters ──────────────────────────────────────────────────────────────
|
|
31
32
|
export { findingsToSarif, evaluationToSarif, verdictToSarif, validateSarifLog } from "./formatters/sarif.js";
|
|
32
33
|
export { verdictToCsvRows, verdictsToCsv, findingsToCsv } from "./formatters/csv.js";
|
|
34
|
+
export { verdictToGitHubActions } from "./formatters/github-actions.js";
|
|
33
35
|
// ─── CLI ─────────────────────────────────────────────────────────────────────
|
|
34
36
|
export { runCli } from "./cli.js";
|
|
35
37
|
// ─── Plugin API ──────────────────────────────────────────────────────────────
|
|
@@ -38,10 +40,13 @@ export { registerPlugin, unregisterPlugin, getRegisteredPlugins, getCustomRules,
|
|
|
38
40
|
export { fingerprintCode, fingerprintToFindings } from "./fingerprint.js";
|
|
39
41
|
// ─── Confidence Calibration ─────────────────────────────────────────────────
|
|
40
42
|
export { buildCalibrationProfile, calibrateFindings, autoCalibrateFindings } from "./calibration.js";
|
|
43
|
+
export { estimateFindingConfidence, estimateFindingConfidenceWithBasis } from "./scoring.js";
|
|
41
44
|
// ─── Feedback ────────────────────────────────────────────────────────────────
|
|
42
45
|
export { loadFeedbackStore, saveFeedbackStore, computeFeedbackStats, getFpRateByRule, mergeFeedbackStores, computeTeamFeedbackStats, formatTeamStatsOutput, } from "./commands/feedback.js";
|
|
43
46
|
// ─── Fix History / Learning ──────────────────────────────────────────────────
|
|
44
47
|
export { loadFixHistory, saveFixHistory, computeFixStats, recordFixAccepted, recordFixRejected, getFixAcceptanceRate, getLowAcceptanceRules, } from "./fix-history.js";
|
|
48
|
+
// ─── Patch Application ─────────────────────────────────────────────────────
|
|
49
|
+
export { applyPatches, filterPatches, detectOverlaps, sortPatchesBottomUp } from "./commands/fix.js";
|
|
45
50
|
// ─── Custom Rule Testing ────────────────────────────────────────────────────
|
|
46
51
|
export { testRule, runRuleTests, validateRuleTestSuite, formatRuleTestResults, deserializeRule, } from "./commands/rule.js";
|
|
47
52
|
// ─── IDE Diagnostics ─────────────────────────────────────────────────────────
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAiCH,gFAAgF;AAChF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEpF,gFAAgF;AAChF,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAiCH,gFAAgF;AAChF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEpF,gFAAgF;AAChF,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,gFAAgF;AAChF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAExE,gFAAgF;AAEhF,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,gCAAgC,EAChC,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,uBAA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AAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;YACpD,SAAS,EAAE,CAAC;YACZ,UAAU,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5F,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AA0YH;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAcnD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAQzE;AAiBD,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,MAAM,EAAE,CAiBnF;AAsOD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8d1D"}
|
package/dist/cli.js
CHANGED
|
@@ -22,12 +22,14 @@
|
|
|
22
22
|
import { readFileSync, existsSync, readdirSync, statSync, writeFileSync } from "fs";
|
|
23
23
|
import { resolve, extname, dirname, relative, join } from "path";
|
|
24
24
|
import { fileURLToPath } from "url";
|
|
25
|
+
import { execSync } from "child_process";
|
|
25
26
|
import { evaluateWithTribunal, evaluateWithJudge, formatVerdictAsMarkdown, formatEvaluationAsMarkdown, } from "./evaluators/index.js";
|
|
26
27
|
import { getJudge, getJudgeSummaries } from "./judges/index.js";
|
|
27
28
|
import { verdictToSarif } from "./formatters/sarif.js";
|
|
28
29
|
import { verdictToHtml } from "./formatters/html.js";
|
|
29
30
|
import { verdictToJUnit } from "./formatters/junit.js";
|
|
30
31
|
import { verdictToCodeClimate } from "./formatters/codeclimate.js";
|
|
32
|
+
import { verdictToGitHubActions } from "./formatters/github-actions.js";
|
|
31
33
|
import { runReport } from "./commands/report.js";
|
|
32
34
|
import { runHook } from "./commands/hook.js";
|
|
33
35
|
import { runDiff } from "./commands/diff.js";
|
|
@@ -109,6 +111,7 @@ function parseCliArgs(argv) {
|
|
|
109
111
|
exclude: [],
|
|
110
112
|
include: [],
|
|
111
113
|
maxFiles: undefined,
|
|
114
|
+
changedOnly: false,
|
|
112
115
|
};
|
|
113
116
|
// First non-flag arg is the command
|
|
114
117
|
let i = 2; // skip node + script
|
|
@@ -172,6 +175,9 @@ function parseCliArgs(argv) {
|
|
|
172
175
|
case "--fix":
|
|
173
176
|
args.fix = true;
|
|
174
177
|
break;
|
|
178
|
+
case "--changed-only":
|
|
179
|
+
args.changedOnly = true;
|
|
180
|
+
break;
|
|
175
181
|
case "--exclude":
|
|
176
182
|
case "-x":
|
|
177
183
|
args.exclude.push(argv[++i]);
|
|
@@ -203,7 +209,11 @@ USAGE:
|
|
|
203
209
|
judges eval --judge <id> [file] Evaluate with a single judge
|
|
204
210
|
judges init Interactive project setup wizard
|
|
205
211
|
judges fix <file> [--apply] Preview / apply auto-fixes
|
|
212
|
+
--rule <id> --severity <level> --lines <start>-<end>
|
|
206
213
|
judges watch <path> Watch files and re-evaluate on save
|
|
214
|
+
judges lsp Start LSP server for editor integration
|
|
215
|
+
judges trend [file] Show findings trend from snapshots
|
|
216
|
+
judges scaffold-plugin <name> Generate a starter custom plugin project
|
|
207
217
|
judges report <dir> Generate project-level report
|
|
208
218
|
judges hook install Install pre-commit git hook
|
|
209
219
|
judges diff Evaluate only changed lines from a diff
|
|
@@ -219,6 +229,8 @@ USAGE:
|
|
|
219
229
|
judges pack Manage language-specific rule packs
|
|
220
230
|
judges config Export/import shared team configs
|
|
221
231
|
judges compare Compare judges vs other tools
|
|
232
|
+
judges review Post inline review comments on a GitHub PR
|
|
233
|
+
judges tune Analyze project and suggest optimal config
|
|
222
234
|
judges list List all available judges
|
|
223
235
|
judges version Show version information
|
|
224
236
|
judges --help Show this help
|
|
@@ -226,14 +238,16 @@ USAGE:
|
|
|
226
238
|
EVAL OPTIONS:
|
|
227
239
|
--file, -f <path> File to evaluate (or pass as positional arg)
|
|
228
240
|
--language, -l <lang> Language override (auto-detected from extension)
|
|
229
|
-
--format, -o <fmt> Output: text, json, sarif, markdown, html, junit, codeclimate
|
|
241
|
+
--format, -o <fmt> Output: text, json, sarif, markdown, html, junit, codeclimate, github-actions
|
|
230
242
|
--judge, -j <id> Run a single judge instead of the full tribunal
|
|
231
243
|
--fail-on-findings Exit with code 1 when verdict is fail
|
|
232
244
|
--baseline, -b <path> Suppress findings already in baseline file
|
|
233
245
|
--summary Show one-line summary instead of full output
|
|
234
246
|
--config, -c <path> Path to .judgesrc config file
|
|
235
|
-
--preset, -p <name> Use a named preset (strict, lenient, security-only, startup, compliance,
|
|
236
|
-
|
|
247
|
+
--preset, -p <name> Use a named preset (strict, lenient, security-only, startup, compliance,
|
|
248
|
+
performance, react, express, fastapi, django, spring-boot, rails, nextjs,
|
|
249
|
+
terraform, kubernetes)
|
|
250
|
+
Compose presets with commas: --preset security-only,react
|
|
237
251
|
--min-score <n> Fail if score drops below threshold (0-100)
|
|
238
252
|
--exclude, -x <glob> Exclude files matching glob pattern (repeatable)
|
|
239
253
|
--include, -i <glob> Only include files matching glob pattern (repeatable)
|
|
@@ -242,6 +256,7 @@ EVAL OPTIONS:
|
|
|
242
256
|
--verbose Show detailed evaluation information
|
|
243
257
|
--quiet Suppress non-essential output
|
|
244
258
|
--fix Auto-fix findings after evaluation (applies patches in-place)
|
|
259
|
+
--changed-only Only evaluate files changed since last commit (uses git diff)
|
|
245
260
|
--help, -h Show this help
|
|
246
261
|
|
|
247
262
|
FIX OPTIONS:
|
|
@@ -272,6 +287,21 @@ COMPLETIONS:
|
|
|
272
287
|
judges completions fish Fish completions
|
|
273
288
|
judges completions powershell PowerShell completions
|
|
274
289
|
|
|
290
|
+
REVIEW OPTIONS:
|
|
291
|
+
--pr, -p <number> PR number to review (required)
|
|
292
|
+
--repo, -r <owner/repo> Repository (default: current repo from git remote)
|
|
293
|
+
--approve Approve PR if no findings
|
|
294
|
+
--dry-run, -n Print comments without posting
|
|
295
|
+
--min-severity <level> Minimum severity: info, warning, error (default: warning)
|
|
296
|
+
--max-comments <n> Maximum review comments (default: 25)
|
|
297
|
+
--format, -o <fmt> Output: text, json, sarif, markdown
|
|
298
|
+
|
|
299
|
+
TUNE OPTIONS:
|
|
300
|
+
--dir, -d <path> Project directory to analyze (default: .)
|
|
301
|
+
--apply Write recommended .judgesrc.json
|
|
302
|
+
--max-files <n> Max files to sample (default: 200)
|
|
303
|
+
--verbose, -v Show detailed analysis
|
|
304
|
+
|
|
275
305
|
STDIN:
|
|
276
306
|
cat file.ts | judges eval --language typescript
|
|
277
307
|
git diff | judges diff --language typescript
|
|
@@ -299,6 +329,10 @@ EXAMPLES:
|
|
|
299
329
|
judges ci-templates github
|
|
300
330
|
judges docs --output docs/rules/
|
|
301
331
|
judges completions bash >> ~/.bashrc
|
|
332
|
+
judges review --pr 42 --dry-run
|
|
333
|
+
judges review --pr 42 --repo owner/repo --approve
|
|
334
|
+
judges tune
|
|
335
|
+
judges tune --dir ./my-project --apply
|
|
302
336
|
judges list
|
|
303
337
|
|
|
304
338
|
SUPPORTED LANGUAGES:
|
|
@@ -435,6 +469,40 @@ function isDirectory(filePath) {
|
|
|
435
469
|
return false;
|
|
436
470
|
}
|
|
437
471
|
}
|
|
472
|
+
// ─── Git Changed Files (for --changed-only) ─────────────────────────────────
|
|
473
|
+
/**
|
|
474
|
+
* Get files changed since the last commit using git diff.
|
|
475
|
+
* Includes staged, unstaged, and untracked files.
|
|
476
|
+
*/
|
|
477
|
+
function getGitChangedFiles(cwd) {
|
|
478
|
+
try {
|
|
479
|
+
const resolvedCwd = resolve(cwd);
|
|
480
|
+
// Changed files (staged + unstaged) relative to HEAD
|
|
481
|
+
const diffOutput = execSync("git diff --name-only HEAD", {
|
|
482
|
+
cwd: resolvedCwd,
|
|
483
|
+
encoding: "utf-8",
|
|
484
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
485
|
+
}).trim();
|
|
486
|
+
// Untracked files
|
|
487
|
+
const untrackedOutput = execSync("git ls-files --others --exclude-standard", {
|
|
488
|
+
cwd: resolvedCwd,
|
|
489
|
+
encoding: "utf-8",
|
|
490
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
491
|
+
}).trim();
|
|
492
|
+
const files = new Set();
|
|
493
|
+
for (const f of diffOutput.split("\n").filter(Boolean)) {
|
|
494
|
+
files.add(resolve(resolvedCwd, f));
|
|
495
|
+
}
|
|
496
|
+
for (const f of untrackedOutput.split("\n").filter(Boolean)) {
|
|
497
|
+
files.add(resolve(resolvedCwd, f));
|
|
498
|
+
}
|
|
499
|
+
return [...files];
|
|
500
|
+
}
|
|
501
|
+
catch {
|
|
502
|
+
// Not a git repo or git not available — return empty (evaluate nothing)
|
|
503
|
+
return [];
|
|
504
|
+
}
|
|
505
|
+
}
|
|
438
506
|
// ─── Format Output ──────────────────────────────────────────────────────────
|
|
439
507
|
function formatTribunalOutput(verdict, format, filePath) {
|
|
440
508
|
switch (format) {
|
|
@@ -447,6 +515,8 @@ function formatTribunalOutput(verdict, format, filePath) {
|
|
|
447
515
|
case "html":
|
|
448
516
|
// HTML is handled separately in runCli (needs async import)
|
|
449
517
|
return formatTextOutput(verdict);
|
|
518
|
+
case "github-actions":
|
|
519
|
+
return verdictToGitHubActions(verdict, filePath);
|
|
450
520
|
case "text":
|
|
451
521
|
default:
|
|
452
522
|
return formatTextOutput(verdict);
|
|
@@ -594,6 +664,12 @@ export async function runCli(argv) {
|
|
|
594
664
|
runWatch(argv);
|
|
595
665
|
return; // Watch runs indefinitely
|
|
596
666
|
}
|
|
667
|
+
// ─── LSP Command ─────────────────────────────────────────────────────
|
|
668
|
+
if (args.command === "lsp") {
|
|
669
|
+
const { runLsp } = await import("./commands/lsp.js");
|
|
670
|
+
runLsp(argv);
|
|
671
|
+
return; // LSP server runs indefinitely
|
|
672
|
+
}
|
|
597
673
|
// ─── Report Command ───────────────────────────────────────────────────
|
|
598
674
|
if (args.command === "report") {
|
|
599
675
|
runReport(argv);
|
|
@@ -664,6 +740,18 @@ export async function runCli(argv) {
|
|
|
664
740
|
runConfig(argv);
|
|
665
741
|
return;
|
|
666
742
|
}
|
|
743
|
+
// ─── Review Command ────────────────────────────────────────────────
|
|
744
|
+
if (args.command === "review") {
|
|
745
|
+
const { runReview } = await import("./commands/review.js");
|
|
746
|
+
await runReview(argv);
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
// ─── Tune Command ─────────────────────────────────────────────────
|
|
750
|
+
if (args.command === "tune") {
|
|
751
|
+
const { runTune } = await import("./commands/tune.js");
|
|
752
|
+
await runTune(argv);
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
667
755
|
// ─── Compare Command ─────────────────────────────────────────────────
|
|
668
756
|
if (args.command === "compare") {
|
|
669
757
|
const toolName = argv[3];
|
|
@@ -681,6 +769,27 @@ export async function runCli(argv) {
|
|
|
681
769
|
}
|
|
682
770
|
process.exit(0);
|
|
683
771
|
}
|
|
772
|
+
// ─── Trend Command ───────────────────────────────────────────────────
|
|
773
|
+
if (args.command === "trend") {
|
|
774
|
+
const { loadSnapshotStore, computeTrend, formatTrendReport } = await import("./commands/snapshot.js");
|
|
775
|
+
const snapshotFile = argv[3] || ".judges-snapshots.json";
|
|
776
|
+
const store = loadSnapshotStore(snapshotFile);
|
|
777
|
+
if (store.snapshots.length === 0) {
|
|
778
|
+
console.log("No snapshot data found. Run evaluations with --snapshot to collect trend data.");
|
|
779
|
+
console.log(` Expected file: ${snapshotFile}`);
|
|
780
|
+
}
|
|
781
|
+
else {
|
|
782
|
+
const report = computeTrend(store);
|
|
783
|
+
console.log(formatTrendReport(report));
|
|
784
|
+
}
|
|
785
|
+
process.exit(0);
|
|
786
|
+
}
|
|
787
|
+
// ─── Scaffold Plugin Command ─────────────────────────────────────────
|
|
788
|
+
if (args.command === "scaffold-plugin") {
|
|
789
|
+
const { runScaffoldPlugin } = await import("./commands/scaffold-plugin.js");
|
|
790
|
+
runScaffoldPlugin(argv);
|
|
791
|
+
process.exit(0);
|
|
792
|
+
}
|
|
684
793
|
// ─── List Command ────────────────────────────────────────────────────
|
|
685
794
|
if (args.command === "list") {
|
|
686
795
|
listJudges();
|
|
@@ -705,13 +814,19 @@ export async function runCli(argv) {
|
|
|
705
814
|
const excludePatterns = args.exclude.length > 0 ? args.exclude : (evalConfig?.exclude ?? []);
|
|
706
815
|
const includePatterns = args.include.length > 0 ? args.include : (evalConfig?.include ?? []);
|
|
707
816
|
const maxFilesLimit = args.maxFiles ?? evalConfig?.maxFiles;
|
|
708
|
-
|
|
817
|
+
let files = collectFiles(target, {
|
|
709
818
|
exclude: excludePatterns,
|
|
710
819
|
include: includePatterns,
|
|
711
820
|
maxFiles: maxFilesLimit,
|
|
712
821
|
});
|
|
822
|
+
// ── --changed-only: scope to git-changed files ──
|
|
823
|
+
if (args.changedOnly) {
|
|
824
|
+
const changedFiles = getGitChangedFiles(target);
|
|
825
|
+
const changedSet = new Set(changedFiles.map((f) => resolve(f)));
|
|
826
|
+
files = files.filter((f) => changedSet.has(resolve(f)));
|
|
827
|
+
}
|
|
713
828
|
if (files.length === 0) {
|
|
714
|
-
console.error(`No supported source files found in: ${target}`);
|
|
829
|
+
console.error(`No supported source files found in: ${target}${args.changedOnly ? " (changed-only)" : ""}`);
|
|
715
830
|
process.exit(1);
|
|
716
831
|
}
|
|
717
832
|
if (!args.quiet) {
|
|
@@ -1041,6 +1156,9 @@ function loadEvalConfig(args) {
|
|
|
1041
1156
|
// Only apply config format if CLI didn't explicitly set one
|
|
1042
1157
|
args.format = config.format;
|
|
1043
1158
|
}
|
|
1159
|
+
if (config.failOnScoreBelow !== undefined && args.minScore === undefined) {
|
|
1160
|
+
args.minScore = config.failOnScoreBelow;
|
|
1161
|
+
}
|
|
1044
1162
|
}
|
|
1045
1163
|
return config;
|
|
1046
1164
|
}
|