whisper-money/tests/Feature/Ai
Víctor Falcón 88b43dfb99 feat(ai): learn a forward rule from category corrections
When a user corrects a category the AI assigned, the system now records
the correction as a deterministic, forward-looking automation rule so the
same merchant — or the same distinctive description — is never
mis-categorized the same way again. The next matching transaction is
caught by the rule before the model ever runs, ending the
correct-it-every-time loop.

- New RuleOrigin::Correction: rules learned from corrections, protected
  from the AI self-heal and editable like any rule in settings.
- AiRuleLearner::learnFromCorrection keys on the merchant when present
  (stable as the description varies), otherwise on the description's
  distinctive tokens, guarded against over-broad description rules that
  could silently mis-file en masse.
- A key lives in exactly one correction rule, so changing your mind moves
  it to the new category. Correcting a transaction a prior correction
  rule categorized is also learnable, so correction rules stay fixable.
- Extract DescriptionTokenizer, shared by RuleSuggestionAggregator and the
  learner, removing the duplicated distinctive-token logic.
- TransactionMatcher::countMatchingAll backs the over-broad guard.
- The update endpoint returns the learned rule; the transactions table
  shows a toast with an instant Undo.
2026-06-29 16:52:58 +02:00
..
AiCategorizationGateTest.php AI auto-categorization: open to pro + consent, nudge free users (#561) 2026-06-19 14:08:40 +00:00
AiRuleLearnerTest.php feat(ai): auto-categorize transactions with AI (behind flag) (#535) 2026-06-15 16:35:20 +02:00
ApplyRuleSuggestionsTest.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
CategorizationOverrideRouteTest.php feat(ai): auto-categorize transactions with AI (behind flag) (#535) 2026-06-15 16:35:20 +02:00
CategorizationSchemaTest.php feat(ai): auto-categorize transactions with AI (behind flag) (#535) 2026-06-15 16:35:20 +02:00
CategorizeBackfillCommandTest.php feat(ai): auto-categorize transactions with AI (behind flag) (#535) 2026-06-15 16:35:20 +02:00
CategorizeOnboardingTransactionsJobTest.php AI auto-categorization: open to pro + consent, nudge free users (#561) 2026-06-19 14:08:40 +00:00
CategorizeTransactionWithAiTest.php AI auto-categorization: open to pro + consent, nudge free users (#561) 2026-06-19 14:08:40 +00:00
CategorizeTransactionsTest.php fix(ai): handle transient AI provider overloads — stop the Sentry noise and retry the dropped work (#595) 2026-06-26 20:07:06 +02:00
CategorizeUncategorizedTransactionsTest.php feat(ai): manage AI consent outside onboarding with live backfill (#591) 2026-06-25 10:50:35 +02:00
CategoryOverrideHandlerTest.php feat(ai): learn a forward rule from category corrections 2026-06-29 16:52:58 +02:00
CategorySourceFilterTest.php feat(ai): auto-categorize transactions with AI (behind flag) (#535) 2026-06-15 16:35:20 +02:00
RetryTransientAiCategorizationJobTest.php fix(ai): handle transient AI provider overloads — stop the Sentry noise and retry the dropped work (#595) 2026-06-26 20:07:06 +02:00
RuleSuggestionAggregatorTest.php feat(ai): learn a forward rule from category corrections 2026-06-29 16:52:58 +02:00
RuleSuggestionConsolidatorTest.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
RuleSuggestionControllerTest.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
RuleSuggestionGeneratorTest.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
RuleSuggestionGuardTest.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
SuggestRulesCommandTest.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00