wedgecheck/.gitignore
caelum0x 943e696e5b feat: persist completed briefs, add shareable permalinks + session history
Every brief used to be generated and handed straight back in the response
-- closing the tab (or losing the API response) lost it for good, and
there was no way to send someone a link to a result.

- app/store.py: SQLite persistence (stdlib sqlite3, no new dependency).
- GET /b/{id}: a public-by-id shareable permalink for one completed
  report. /api/brief now returns id + permalink_url too.
- GET /history: a browser's own past briefs via an anonymous session
  cookie (wedgecheck_session) -- no user-account system, just a grouping
  key, consistent with the rest of Wedgecheck's no-auth design.
- DB writes/reads run via asyncio.to_thread, same pattern as the existing
  event-loop-blocking fix in brief.py (this app is single uvicorn worker,
  so any sync blocking call freezes every concurrent request).

Verified live against the real deployed code path (local uvicorn, free
ai-relay LLM + duckduckgo retriever, no mocks): POST /api/brief returned a
real id/permalink_url, the row landed in sqlite with the real report
content, GET /b/{id} rendered it (and 404s for an unknown id), and
GET /history correctly scoped a session's own briefs (verified both the
empty state and, after seeding a second row under the same session
cookie, that it lists + links to the right permalink). The free
duckduckgo retriever's documented flakiness (0 sources on some attempts)
is pre-existing and unrelated -- unaffected by this change, confirmed the
web-form error path still shows the error and correctly skips persisting
a failed brief.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-29 07:12:06 +03:00

9 lines
73 B
Plaintext

.venv/
__pycache__/
*.pyc
output/
data/
*.log
.env
test_report_output.md