hsa-app/README.md
Jean-Michel Tremblay c715c8e0c0
All checks were successful
Build and Test / build-and-test (push) Successful in 37s
AI classifier correction notes + misread review (AI tab)
Add a global, temporal ai_notes list appended to the classifier prompt
(seeded once from no-PII defaults, documented in README), managed inline
on a new AI tab with a read-only view of the assembled prompt. Every
AI-run upload records the browser-round-tripped suggestion blob + model;
misreads are derived (final field != AI guess) and reviewed one by one
(image + per-field guess-vs-entered + notes-since), attributing which
note fixed each or closing unresolved. Update SPEC (new section 10),
DESIGN item 15, README, and changelog (0.0.3).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 16:04:30 -04:00

35 lines
1.9 KiB
Markdown

# HSA Receipt Tracker
A small, mobile-first web app for two household users to capture and archive
HSA-eligible receipts (photo or PDF) for future reimbursement and tax
substantiation, with optional AI auto-fill of the amount/date/category/patient.
- **What it does (current behavior):** [SPEC.md](SPEC.md) — the source of truth.
- **Why it's built this way (history & rationale):** [DESIGN.md](DESIGN.md).
- **Version log:** [CHANGELOG.md](CHANGELOG.md).
## Running
It's a single static Go binary (`CGO_ENABLED=0`, pure-Go SQLite). Configure via
environment (see [.env.example](.env.example)); `./scripts/build.sh` builds it and
`./scripts/run.sh` runs it locally. Deployment notes: [deploy/INSTALL.md](deploy/INSTALL.md).
## AI classifier correction notes
When an API key is configured, each upload is read by the model to pre-fill the
form. You can steer it with **correction notes** — free-text rules appended to the
classifier prompt — managed under the **AI** tab. When the model misreads a
receipt, that upload is recorded; the AI tab lets you review misreads one by one
and attribute which note fixed each.
Notes live only in the database (private, never committed, included in `/export/db`
backups). On first run the table is seeded once with these **default notes** (no
PII), which you can edit or delete:
1. Amounts that use a comma as the decimal separator (e.g. "12,50") mean 12.50, not 1250.
2. When both a service/visit date and a separate statement, print, or due date appear, use the service date.
3. "Patient Pay", "You Paid", "Amount Due", and "Patient Responsibility" are the amount actually paid — prefer them over subtotals or insurance-covered amounts.
These defaults are defined in code (`internal/storage/ai_notes.go`); this list is
the human-readable copy. They are only seeded when the notes table is empty, so a
deleted default does not come back on restart.