Skip to main content

SMS parser and classifier

Capture, filter, template, confidence, deduplication, categorization, and validation architecture.

The SMS pipeline optimizes for precision. Missing an uncertain transaction is recoverable; inventing spending from a security or promotional message is a release blocker.

Capture

  • Android live capture through a Kotlin broadcast receiver.
  • Permission-gated inbox backfill capped at 30 days.
  • Background one-shot processing through the same Dart pipeline and encrypted store.
  • Debug-only injection path and SMS Lab for SIM-free testing.

Safety order

  1. Consent and permission.
  2. Exact normal or trusted-test sender policy.
  3. Global IGN patterns for OTP, security, decline, pending, promotion, balance-only, and future-charge messages.
  4. Text normalization.
  5. Institution templates in priority order with an execution budget.
  6. Required-field, direction, date, value, and sanity validation.
  7. Stable event-identity deduplication.
  8. Local categorization and confidence.
  9. Review or unmatched-evidence persistence.

Template bundle

assets/parser/bank_templates.json is versioned and currently contains 32 development templates across eight institutions. Templates define:

  • sender aliases;
  • regex match;
  • priority;
  • fixed or dynamic direction;
  • required fields; and
  • optional date format.

The bundle is explicitly illustrative until real, consented, redacted samples become golden fixtures.

Categorization

The parser extracts bank, amount, direction, masked account, date, merchant, balance, and reference when present. Categorization then applies personal rules, local overrides, bundled corpus tiers, and classifier evidence without uploading raw activity.

Deduplication

Dedup is based on normalized event evidence rather than only value/time. Repeated delivery of one alert is suppressed, while distinct transactions with the same value remain separate.

Unmatched evidence

Known-sender, non-sensitive messages with no supported transaction format may enter a capped encrypted queue of 50. The queue is outside the ledger and all metrics.

Tests

cd salli_app
flutter test test/sms
dart run tool/sms_pilot_report.dart

The synthetic suite currently generates 1,078 deterministic scenarios for alias/category behavior, generic debit/credit formats, filters, sender gates, and malformed values. Synthetic coverage does not satisfy the real-evidence beta gate.

Add a template

  1. Obtain an opt-in sample and redact personal evidence.
  2. Add a narrow, institution-scoped template.
  3. Add positive golden fixtures.
  4. Add nearby negatives, especially OTP/promo/decline/pending messages.
  5. Run the whole parser and pilot suite.
  6. Update the coverage record.
  7. Never broaden a sender or regex merely to make one fixture pass.