Expand description
Unified capture engine — the single entry point that replaces kharcha’s
three divergent parsers (Dart generic + Kotlin generic + the bank fleet,
which capture_inbox.dart reconciles with an if/else).
v0.1: sender-aware dispatch SHAPE with the generic parser as the only
backend. v1.x plugs bank backends ahead of it without changing this
signature (pennywise BankParserFactory order: specific senders first,
generic fallback last).
Structs§
- Parsed
Transaction - A parsed capture with provenance. Mirrors pennywise
ParsedTransaction: sender + timestamp travel WITH the payment, not in a sidecar inbox line.
Constants§
- MAX_
BATCH_ ITEMS - Max batch size. Per-item bytes are already capped by MAX_BODY_BYTES; this caps the count so a hostile 100k-item drain can’t balloon RAM/CPU. Real backlogs are hundreds — chunk larger drains caller-side; items past the cap come back None (documented, not silent: caller sees the tail).
- MAX_
BODY_ BYTES - Hard input cap. Real SMS/notifications are <2 KB; anything past 16 KB is a paste-attack or a corrupt read — regexing megabytes burns CPU for nothing. (Premortem: FFI callers pass arbitrary strings; the core must not spin.)
Functions§
- parse
- Sender-aware parse. Today every sender routes to the generic backend.
- parse_
batch - Batch drain for SMS backlogs: one call, compiled-once regexes, order kept.