Skip to main content

Module evaluators

Module evaluators 

Expand description

Gate evaluators: pure comparisons of analysis result sets (or a fact store) against the configured Thresholds, each returning the list of GateViolations it found.

Every evaluator is a noop (empty result) when its governing threshold is unset, so a caller can invoke the family unconditionally and let the configured gates select themselves. The threshold config these read lives in the sibling config module.

Structs§

ArchMeasured
Architecture metrics measured for gate evaluation, returned so callers can record the observed values (ledger, ratchet) on passing runs too.
GateViolation
One detected gate violation.

Functions§

evaluate_architecture_gate
Evaluate the architecture [gates] (max_dependency_cycles, max_propagation_cost) against the import graph in the fact store. Builds the graph once via the shared kernel; a noop (no graph build) when neither gate is configured.
evaluate_architecture_gate_measured
evaluate_architecture_gate returning the measured metrics alongside the violations. None when neither architecture gate is configured (the import graph is not built at all).
evaluate_clone_gate
Evaluate the disallow_clone_type_1 gate by counting Type-1 clone families (similarity = 1.0) in the fact store. When the gate is off this is a noop; when on, every distinct clone group of similarity 1.0 surfaces as one violation row.
evaluate_code_health_gate
Evaluate the code_health_min gate against the COMPOSITE code-health score (run_code_health), not the hotspots inline cognitive-only proxy. This is the score --analysis code-health reports, so a file the analysis bands red is the file the gate flags — the two agree.
evaluate_corpus_percentile_rows
Pure inner comparison for the corpus_percentile_max gate.
evaluate_diff_gate
Evaluate the [diff] section against a base→head delta.
evaluate_effort_exposure_gate
Evaluate the max_red_effort_pct gate: fails when the red code-health band’s window churn share exceeds the configured ceiling.
evaluate_effort_exposure_rows
Pure inner comparison for the max_red_effort_pct gate.
evaluate_effort_exposure_rows_exempt
evaluate_effort_exposure_rows with the improving-churn exemption.
evaluate_familiarity_gate
Evaluate the code_familiarity_min gate: fails when the repository’s active-team familiarity score falls below the configured floor.
evaluate_familiarity_rows
Pure inner comparison for the code_familiarity_min gate.
evaluate_finding_overlap_rows
Pure inner comparison for the max_findings_in_hot_files gate.
evaluate_full_tree
Evaluate the [gates] section against a hotspots result set. Returns the list of violations.
evaluate_gate_thresholds
Evaluate the [diff] gates that apply to a working-tree change-set report (codelore gate / the gate_changes MCP tool).
evaluate_hotspot_anchored_rows
Pure inner comparison for the hotspot_anchored_max gate.
evaluate_new_code_rows
Pure inner comparison for the two-band [new_code] gate over a NewCodeScope.
head_has_scorable_source
Whether the HEAD tree carries at least one Tier-1 source file the code-health scan should have scored — the independent witness for the code_health_min degraded sentinel.