freezmo/app/api
Martin Dvorak 9cea13496a Report question: skip a broken card and tell the server
A generated matching card arrived on a phone with three identical
definitions (the generation guards now drop those), but there was no way
to get past a bad card from inside a session. The feed chrome (deck
study, review, mistakes and exam) now has the red "!" control: one tap
records the question, skips to the next card and shows an Undo toast.

- lib/question-reports.ts: the local list (freezmo.reports.v1, zod on
  read, capped 200) is the skip state — reported cards leave every
  session type, count as "not attempted" in the results instead of
  wrong, and Undo takes a report back. A deck where everything is
  reported stays studiable so it can be regenerated.
- POST /api/reports appends one JSON line per report to
  REPORTS_DIR/reports.jsonl (shared/freezmo/reports in production, the
  dev data dir in dev). Deliberately write-only: the question text is
  readable on the server (that is the point — prompt tuning) but never
  over HTTP, since the app has no auth. Best effort: offline reports stay
  local.
- The button: a red outlined rounded square with "!", the chrome's
  control size, in both feed headers (hidden on the results slide).
- config: REPORTS_DIR + RATE_LIMIT_REPORTS (20); the deploy creates the
  shared reports dir; the dev unit and AGENTS.md note the new server
  data location.
- Suites: phase-1 (append + validation + no GET), phase-2 (button, toast,
  server POST, local copy, skip counter, hidden next session, Undo, exam
  pool). SW -> freezmo-v38.
2026-10-12 07:12:55 +00:00
..
chat Chat mode, phase 1: grounded streaming chat over your notes 2026-10-11 18:32:11 +00:00
generate Add an English/Czech interface language switch 2026-10-08 13:56:32 +00:00
grade Add an English/Czech interface language switch 2026-10-08 13:56:32 +00:00
health Chat mode, phase 1: grounded streaming chat over your notes 2026-10-11 18:32:11 +00:00
healthz Infra: split dev and production (releases, services, deploy script) 2026-10-11 19:25:29 +00:00
homework Phase 3: Check my work, follow-ups and turn-into-deck 2026-10-10 14:36:04 +00:00
push Phase 2: learning engine — history, SRS review, mistakes, stats, exam, reminders 2026-10-10 14:15:21 +00:00
reports Report question: skip a broken card and tell the server 2026-10-12 07:12:55 +00:00
sync Phase 1: backup, encrypted sync and monthly-usage handling 2026-10-10 13:43:42 +00:00