Summary
There are two distinct types named MatchResult in the codebase, causing confusion:
evaluator::MatchResult -- Internal evaluation result with confidence: f64 (0.0-1.0)
output::MatchResult -- Output-facing result with confidence: u8 (0-100), plus length, rule_path, mime_type
The naming collision requires context to understand which type is being used, and conversion between them involves a non-obvious confidence scale change (float to percentage).
Proposal
Rename evaluator::MatchResult to evaluator::RuleMatch (or evaluator::EvalMatch). This:
- Makes the purpose clear at a glance
- Eliminates the need for fully-qualified paths in code that uses both
- Follows the pattern of the type being an internal evaluation concept vs an output format
Affected Code
src/evaluator/mod.rs -- Type definition and construction
src/lib.rs -- Re-export (pub use evaluator::RuleMatch) and EvaluationResult.matches field type
src/output/mod.rs -- Conversion from evaluator::RuleMatch to output::MatchResult
- Tests referencing the type
Acceptance Criteria
Summary
There are two distinct types named
MatchResultin the codebase, causing confusion:evaluator::MatchResult-- Internal evaluation result withconfidence: f64(0.0-1.0)output::MatchResult-- Output-facing result withconfidence: u8(0-100), pluslength,rule_path,mime_typeThe naming collision requires context to understand which type is being used, and conversion between them involves a non-obvious confidence scale change (float to percentage).
Proposal
Rename
evaluator::MatchResulttoevaluator::RuleMatch(orevaluator::EvalMatch). This:Affected Code
src/evaluator/mod.rs-- Type definition and constructionsrc/lib.rs-- Re-export (pub use evaluator::RuleMatch) andEvaluationResult.matchesfield typesrc/output/mod.rs-- Conversion fromevaluator::RuleMatchtooutput::MatchResultAcceptance Criteria
evaluator::MatchResultrenamed toevaluator::RuleMatch(or approved alternative)output::MatchResultunchanged