Summary
--license-diagnostics emits a detection_log but doesn't annotate individual matches with why they were discarded. When a match disappears between raw output and final detections, the reason must be inferred.
Proposal
Add a DiscardReason enum (variants: Contained, Overlapping, BelowMinCoverage, Spurious, TooShort, FalsePositive, etc.) and an Option<DiscardReason> field on LicenseMatch. Set it at each filter boundary. When --license-diagnostics is enabled, include the discard reason in the detection log output.
Benefits
- At-a-glance understanding of why a match was dropped
- Makes filter debugging transparent without needing stage-by-stage checkpoints
- Complementary to the filter stage pipeline restructuring — works whether or not the pipeline is restructured
- Low risk: additive field, no behavioral change
When
Next time the filter pipeline is touched, or when --license-diagnostics output needs to be more informative.
Summary
--license-diagnosticsemits adetection_logbut doesn't annotate individual matches with why they were discarded. When a match disappears between raw output and final detections, the reason must be inferred.Proposal
Add a
DiscardReasonenum (variants:Contained,Overlapping,BelowMinCoverage,Spurious,TooShort,FalsePositive, etc.) and anOption<DiscardReason>field onLicenseMatch. Set it at each filter boundary. When--license-diagnosticsis enabled, include the discard reason in the detection log output.Benefits
When
Next time the filter pipeline is touched, or when
--license-diagnosticsoutput needs to be more informative.