# Backlog

Everything agreed but not scheduled yet. Newest decisions at the top of each
section. When an item is picked up, move it to FABLE_HANDOFF.md as a pass.

## ⏰ Reminders (raise these at the start of the next planning conversation)

- **Capture Phase 4** (port the extension to Firefox/Edge Android, Safari Web
  Extension, or a Capacitor shell) — **on hold until the phone capture has
  been tested for real** on the iPhone and the Android. Decide after that
  test whether the userscript is "sticking"; if it is, close this item.
  Details: `docs/CAPTURE_PLAN.md`, Phase 4.

## Verification owed (needs the real environment)

Nothing below has run outside the offline test suite yet.

1. **Device test** — iPhone (Safari + Userscripts) and Android (Firefox/Edge +
   Violentmonkey): install, pair by QR and by code (check the device name in
   Configurações → Dispositivos), scan a real cupom, scan with no signal, scan
   a DANFE barcode in Escanear, re-scan a captured cupom ("Já está no Nota").
2. **Deploy behind HTTPS + Authelia**; run section 6 of `docs/DEPLOY_AUTHELIA.md`.
3. **Migrations 0021–0024 on the real Postgres**; rehearse
   `scripts/safe-update.sh` including the forced-rollback run
   (FABLE_HANDOFF.md, "Rehearse the rollback").
4. **Visual check** of every page × Essencial/Simples/Avançado × light/dark ×
   phone/desktop — including the newer pages: previsao, capturar, escanear,
   repor, receitas (FABLE_HANDOFF.md, "Visual QA checklist").
5. **Tandoor against the live instance** — pantry sync, "dá pra fazer agora",
   and saving an AI recipe (payload shape unconfirmed: `recipe_ai.to_tandoor_recipe`).
6. **LLM features against the real LiteLLM** — "Pedir à IA" in Revisar
   reposição and Receitas (prompt/answer format only tested with fixtures).
7. **"Colar URL"** on the Notas page now answers cleanly; whether SEFAZ lets
   the server fetch through at all is expected to be "mostly not".

## Future development (agreed, after the current run)

- **Scheduled backups** — daily `pg_dump` with retention (beyond the dump
  `safe-update.sh` takes before each update) + documented restore.
- **Export everything** — CSV/JSON download of all of a user's data.
- **More states** — SEFAZ adapters beyond RJ (registry in
  `app/services/sefaz/registry.py`; the scanner already recognises other
  states' QR codes and says they're unsupported).
- **Single sign-on through Authelia** — trust `Remote-User` from the proxy to
  log into Nota (security decision; see `docs/DEPLOY_AUTHELIA.md` §8).
- **API tests against a real Postgres** (testcontainers job).
- **Launcher icons** 192/512 px for a crisp Android home-screen icon.

## Decided against (kept so nobody re-proposes them blindly)

- **Server-side SEFAZ fetch for capture** (Capture Phase 3) — SEFAZ breaks
  bots by design; the person's own browser is the capture path. The old
  "Colar URL" box still uses a server fetch and answers `retry` when blocked.
- **Standalone PWA / share target** — would open SEFAZ outside the browser
  where the capture script runs.
- **Forecast seasonality** — not enough history to fit honestly.
