- Backup dir default ./data/dbbackup; files named hsa_sqlite_backup_<YYYY_MM_DD>.db
(one per day; a same-day re-run is a no-op since the dated file exists).
- Simplify the scheduler: attempt on start, then tick every BACKUP_INTERVAL.
Per-day idempotency makes restarts and sub-day intervals settle at one/day —
removes the date-parsing untilNext/newestBackup logic (and its busy-loop edge).
- BACKUP_INTERVAL remains the frequency knob (Go duration; 0 disables).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- internal/backup: weekly (configurable) snapshots via the existing VACUUM INTO
+ blob-strip path; restart-safe (only backs up if newest is older than the
interval), retains BACKUP_KEEP most recent, prunes the rest. Runs in a
background goroutine; failures are logged, never fatal.
- Config: BACKUP_DIR (./data/backups), BACKUP_INTERVAL (168h; 0 disables),
BACKUP_KEEP (8).
- Fix: blob-strip now clears attachments.image_data too, not just receipts.
- Fix: STORAGE_DIR is the storage ROOT (default ./data) — receipts/ and
attachments/ live under it; corrects the doubled-nesting from item 10.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Features (see spec.md v2):
- Wire receipt classification into the upload flow; cheap model (Haiku 4.5)
is now the default, shown as a footnote with per-scan cost in cents.
- Skip-AI toggle to enter fields by hand.
- Duplicate-transaction warning: live check on date+amount, gated submit.
- Tally tab: person x year totals with margins and grand total.
- Recent uploads / recent receipts tabs with paging and file serving.
- People reconcile on startup: merge stray partial names (e.g. "Jude" ->
"Jude Tremblay"), reassigning receipts; idempotent seeding.
- scripts/build.sh builds the binary; scripts/run.sh builds and runs with .env.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Go app for capturing and archiving HSA-eligible receipts: OIDC/PKCE auth
against Authelia, SQLite storage with dual-write (filesystem + DB blob),
mobile-first upload, and DB export.
Adds AI receipt classification: a config.json catalog of people and
categories (seeded into the DB on startup), a prompt builder that derives
name-order/initial variants from the data (with same-surname ambiguity
handling), and an Anthropic tool-use client behind POST /classify. Tests
run against a mock endpoint; a live integration test is env-gated to the
cheapest model.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>