Let imports opt out of AI classification

Classification preferences gains "Classify newly imported transactions with
AI", stored as classify_on_import in config.toml and on by default, so existing
configurations keep their behaviour. It covers CSV imports and bank
synchronization alike.

With it off, no import path contacts the provider: classification falls to the
new provider-free rules path, where an opted-in merchant rule still applies its
category and tags, an alias match still attaches its merchant, and everything
else arrives on the editable fallback without a provenance error that would
suggest the provider had failed. Analyse remains available on demand.
This commit is contained in:
Lars Nolden
2026-09-11 18:10:05 +02:00
parent dc767799bc
commit dece0d5b79
10 changed files with 217 additions and 30 deletions
+6 -1
View File
@@ -58,7 +58,12 @@ func (a *App) importFacts(ctx context.Context, s State, facts []domain.Facts) (I
if !ids[t.Facts.ID] || t.Enrichment.Kind == "transfer" {
continue
}
p, e := a.classifier.Classify(ctx, t.Facts, s.Data, false)
// With AI classification off for imports, no provider is contacted at
// all: deterministic merchant rules still apply.
p, e := classification.Rules(t.Facts, s.Data)
if a.settings.ClassifyOnImport {
p, e = a.classifier.Classify(ctx, t.Facts, s.Data, false)
}
if e == nil {
e = addProposal(&s.Data, p)
}