Skip to content

refactor: rename evaluator::MatchResult to disambiguate from output::MatchResult #60

@unclesp1d3r

Description

@unclesp1d3r

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

  • evaluator::MatchResult renamed to evaluator::RuleMatch (or approved alternative)
  • output::MatchResult unchanged
  • All re-exports updated
  • All tests pass
  • No public API surface change beyond the rename

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestevaluatorRule evaluation engine and logicoutputResult formatting and output generationpriority:normalStandard work itemsize:SThis PR changes 10-29 lines, ignoring generated files.

Type

No fields configured for Task.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions