Module defect_validation
Expand description
defect-validation analysis — surfaces a defect-calibration artifact’s
own evidence as flat, human-scannable (metric, value) rows.
Unlike every other registered analysis, this one reads NOTHING from the
fact store: all of its numbers were already computed at mining time and
frozen into a defects.calib.json artifact (see
crate::defect_calibration). It resolves that artifact from
opts.defect_calibration, applies the SAME repo-identity guard the weight
application uses (check_repo_identity, honouring
--allow-foreign-calibration), and flattens its
ValidationMetrics +
TuningDecision +
MiningStats into rows.
Presentation follows the project’s honesty framing: the band table shows
where mined defects landed relative to code-health bands, but this is an
association, not causation — a red file that a defect-introducing
commit touched is evidence the score ranks it high, not proof the score
caused the defect. Every count carries its n; every absent
Option metric renders as an explicit n/a (<why>) rather than being
silently dropped. The tuning-decision AUCs are always surfaced — including
the case where tuning was applied yet the validation AUCs sit below 0.5,
so a reader can judge the outcome for themselves.
Without a configured artifact the analysis returns zero rows and prints a
one-line hint on stderr pointing at codelore calibrate-defects — an
honest absence, not an error.
Structs§
- Defect
Validation Row - One flattened evidence row from a defect-calibration artifact:
(metric, value). The value is a string so counts, ratios, honestn/a (<why>)placeholders, and textual verdicts (e.g. the weights source) share one row shape — mirroringArchitectureMetricRow.
Functions§
- run_
defect_ validation - Run the
defect-validationanalysis.