Skip to content

The Rule-Based Classifier

Lives in src/classify.

A pure function (sender) -> category | null with 5-tier precedence: exact sender → registrable root domain → display-name rules on relay domains → relay account/personal fallbacks → your own domains. No state, no network, no ML.

87% of 6,551 emails filed with zero machine learning — just rules iterated against recon reports.

The session’s naive slice(-2) domain split called amazon.co.ukco.uk” — fixed with public-suffix-aware tldts and locked in by regression tests.