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 from Option<CategorizationResult> to Vec<CategorizationResult> (or a struct with primary + secondary fields)
-
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
Currently
categorize()inmatcher.rsreturns 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.rsChange
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.rsUpdate
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