Save each discovery conversation's prompts and answers to durable CSV
files (per-conversation + append-only master log) on both save and
completion, so answers survive an extraction error, can be re-fed to the
AI, and can be reviewed/resumed by the user.
- app/services/answer_store.py: canonical prompt list + atomic CSV writes,
master append, and read-back helpers (DB stays system of record; CSV
failures are logged, never fatal).
- discovery router: write CSV on /respond and /complete; new endpoints
GET /answers, GET /answers.csv, POST /reprocess (shared extraction
helper; locked profiles return 409).
- discovery.html: prefill/resume from saved answers after an error and a
"Re-run analysis" button wired to /reprocess.
- scripts/reprocess_csv.py: offline CLI to re-run extraction from a CSV
(print or --write-db).
- QUESTIONS_DIR / QUESTIONS_MASTER_CSV config, .gitignore, README, tests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dg6XWUwprmP5QCL18HxssY
scripts/run-weekly-checkins.ps1: pure-Windows equivalent of the cron script —
reads the admin API key from .env and POSTs /discovery/coaching/run via
Invoke-RestMethod, logging to data/coaching-cron.log. README documents the
Register-ScheduledTask command (weekly, StartWhenAvailable + WakeToRun) for a
more robust schedule than WSL cron.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scripts/run-weekly-checkins.sh reads the admin API key from .env and POSTs the
Phase 3 batch endpoint (/discovery/coaching/run); a weekly host crontab entry
(Mon 08:00) invokes it. Running weekly services all cadences since the endpoint
skips users who aren't due. README documents the install. Output logs to
data/coaching-cron.log (gitignored).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>