Skip to main content

Crate judge

Crate judge 

Source
Expand description

Codebase intelligence for Rust workspaces.

Modules§

advisory
Advisory-only modules: heuristic signals that never affect the verdict/exit code (mutation-testing import, clippy import, coverage import, dependency advisories). Grouped here for navigability (see GitHub issue #41) — a pure module-path reorganization.
baseline
Baseline snapshots and delta verdicts (see todo.md §5, §14.2 P0#5).
finding
The common output unit for detectors: a Finding. Findings can reference each other (caused_by/causes) so a single root cause — e.g. a missed entry point — doesn’t present as dozens of unrelated findings (see todo.md §7 “Kausale Finding-Gruppen”, §14.2 P0#1). Causal edges are owned exclusively by FindingGraph (todo.md §15.2): detectors emit findings without edges, the graph stores each edge once, and the per-finding caused_by/causes fields are derived from that single edge set on export.
health_score
Health score: a single 0–100 number plus letter grade summarizing severity-weighted, LOC-density-normalized findings (see todo.md §4 “Health Score & Decision Surface”).
impact
Deterministic impact context for one workspace source file.
ingest
Ingest layer: discovers workspace crates, source files, and entry points via cargo metadata.
markdown
Markdown rendering of baseline comparison deltas (todo.md §7) — the PR-comment use case: a compact verdict + gates + per-finding table that reads well pasted into a GitHub comment. Pure functions over the already-computed Delta; the CLI only writes the returned string. Deliberately not a general report format — commands without a delta reject --format markdown instead of producing half-baked output.
pattern_baseline
Baseline snapshots and diffs for crate::rules::pattern::PatternCandidates (see todo.md §16 “Pattern-Kandidaten separat baselinen”).
refactor_map
Compact, deterministic workspace facts for planning refactoring work.
report
Shared presentation model for human-readable command reports (issue #12): a command builds a Report from its own domain-specific status lines and finding groups, then hands it to Report::write_tty instead of hand-rolling terminal layout. JSON remains the exhaustive automation contract; this model covers only the human-readable TTY views.
rule_registry
Static, versioned documentation for every rule id judge can emit (todo.md §17.5: “Für jede Regel in der Registry Evidenzklasse, Voraussetzungen, Ausschlussgründe, zulässige Formulierungen und Verdict-Effekt fest hinterlegen”). This is a pure lookup table, not a detector — the text here is consolidated from each rule’s own module/function doc comments, not invented, and is consulted by cargo judge explain-rule <id>.
rules
Rule/detector modules: each one analyses the workspace for one concern (structural slop, duplication, dead code, boundaries, …) and produces crate::finding::Findings. Grouped here for navigability (see GitHub issue #41) — this is a pure module-path reorganization, not a change to any rule’s logic or evidence.
sarif
SARIF 2.1.0 rendering of a Report (todo.md §7 “Formate”, §0) — the interchange format GitHub code scanning and most CI annotators consume. render is pure: it maps an already-built report to a serde_json::Value without touching the CLI, so it is testable in isolation. Artifact URIs are emitted with forward slashes; callers relativize finding paths (see crate::finding::relativize_paths) before building the report, matching SARIF’s relative-URI convention.
suppression
Generic inline suppression via a judge-ignore marker comment (see todo.md §5 “Suppression”: the three-tier precedence is baseline, then config-rule, then inline). The full syntax: // judge-ignore: <rule-id> — <reason>.

Enums§

AnalysisTier
Analysis tier selected for a run.