-
Notifications
You must be signed in to change notification settings - Fork 0
Return all matching rules from categorizer (prep for secondary categorization) #44
Description
Currently categorize() in matcher.rs returns only the first matching rule (highest priority). Refactor it to return all matching rules, ordered by priority. The pipeline will still use the first match as primary — this is prep work for secondary categorization.
Implementation
-
File:
crates/paporg/src/categorizer/matcher.rs -
Change
categorize()(line ~71) return type fromOption<CategorizationResult>toVec<CategorizationResult>(or a struct withprimary+secondaryfields) -
Iterate through all rules instead of returning on first match
-
Collect all matches, keep sorted by priority
-
File:
crates/paporg/src/pipeline/runner.rs -
Update
step_categorize()to use the first result from the vec as the primary match (preserving current behavior) -
Ignore secondary results for now (next issue)
Acceptance Criteria
-
categorize()returns all matching rules - Results are ordered by priority (descending)
- Pipeline still uses first match as primary (no behavior change)
- Existing tests pass without modification
- New tests verify multiple matches are returned