docs: overhaul documentation + add deployment guides

- ARCHITECTURE.md: update for v0.9.0/v0.9.3 — collections schema,
  collection_bills schema, alert_filters in notification_prefs,
  action_category in notification payload, migrations 0015/0016,
  /api/collections + /api/share endpoints, updated pages table,
  pipeline flow reflects categorize_action(), v0.9.0 and v0.9.3
  feature history entries
- ROADMAP.md: new file merging "MVP threshold" and "Feature Roadmap"
  docs into one clean shipped/upcoming/backlog structure with v1.0
  definition; removes stale design notes and duplicate entries
- DEPLOYING.md: new — prerequisites, .env setup, first run, admin
  account, domain/SSL with Caddy, useful commands
- UPDATING.md: new — SSH setup, manual deploy, deploy script, Gitea
  webhook + webhook listener, rollback procedure, env-only updates
- Delete: "MVP threshold this make v1 complete.md" and
  "PocketVeto — Feature Roadmap.md" (superseded by ROADMAP.md)
- how-it-works/page.tsx: accurate per-mode default alert sets,
  Alert Filters callout linking to Notifications settings
- notifications/page.tsx: Follow mode default includes amendment filed;
  Pocket Veto default excludes calendar placement

Authored-By: Jack Levy
This commit is contained in:
Jack Levy
2026-03-02 19:22:02 -05:00
parent a39ae4ccba
commit 676bf1b78d
8 changed files with 728 additions and 334 deletions

112
ROADMAP.md Normal file
View File

@@ -0,0 +1,112 @@
# PocketVeto — Roadmap
> Consolidated feature roadmap and release history. Shipped items reflect what is live as of v0.9.3.
---
## Shipped
### Foundation & Core Pipeline
- [x] Docker Compose stack — PostgreSQL, Redis, FastAPI, Celery, Next.js, Nginx fully containerized
- [x] Bill polling — Congress.gov incremental sync, filtered to legislation that can become law (`hr`, `s`, `hjres`, `sjres`)
- [x] Document fetching — GovInfo bill text retrieval with smart truncation for LLM token budgets
- [x] LLM analysis — multi-provider AI briefs (OpenAI, Anthropic, Gemini, Ollama) with amendment diffing
- [x] Citations — every key point and risk cites the bill section + verbatim quote; `cited_fact` / `inference` label
- [x] Citation UI — § chips expand inline with quote + GovInfo source link; "Inferred" badge on analytical items
- [x] News correlation — NewsAPI + Google News RSS articles linked to bills via topic tags
- [x] Trend scoring — composite zeitgeist score (0100) from NewsAPI + Google News + Google Trends, nightly
- [x] Full-text search — PostgreSQL tsvector across bills and members
- [x] Multi-user auth — JWT email/password, admin role, user management panel
- [x] Admin panel — LLM provider/model switching, pipeline stats, external API health, manual task triggers
- [x] Bill type filtering — only legislation that can become law; 60-day seed window on fresh install
### Member Profiles & Mobile
- [x] Member profiles — bio, contact info, leadership roles, service history, sponsored/cosponsored counts
- [x] Member interest scoring — composite trend score (NewsAPI + GNews + pytrends), nightly; lazy-loaded on first profile view
- [x] Member news — articles correlated to members via name search
- [x] Mobile UI — responsive layout, slide-in drawer, hamburger header, touch-friendly controls
### Follows & Personalization
- [x] Follows — per-user bill, member, and topic follows
- [x] Follow modes — `neutral | pocket_veto | pocket_boost` with mode-selector UI and descriptions
- [x] Dashboard — personalized feed from followed bills/members/topics + trending
- [x] Public browsing — unauthenticated guests browse bills, members, topics, and trending; `AuthModal` gates interactive actions
- [x] Welcome banner — dismissible onboarding card for guests; `localStorage` dismiss state
### Bill Detail Features
- [x] Bill action pipeline — full legislative action history from Congress.gov; nightly batch + event-driven on change
- [x] Action timeline — full history with latest-action fallback while history loads
- [x] Amendment briefs — "What Changed" badge; collapsible version history panel
- [x] Bill text status indicators — Brief / Pending / No text badge on BillCard (single batch query)
- [x] Draft letter generator — select up to 3 cited brief points, generate constituent letter via configured LLM; ZIP not stored
- [x] Personal notes — private per-bill note with pin, auto-resize textarea; one note per user per bill
- [x] Sponsor linking — poller fetches bill detail for sponsor; backfill task for existing bills
- [x] "No bill text" state — shown on detail page when GovInfo has nothing published
### Collections & Sharing
- [x] Collections / Watchlists — named groups of bills, public/private, UUID share token; `CollectionPicker` popover on bill detail
- [x] Shareable brief links — `share_token` on `bill_briefs`; public `/share/brief/[token]` page, no login required
- [x] Shareable collection links — public `/share/collection/[token]` page, no login required
### Notifications
- [x] ntfy push — Celery dispatcher POSTs to user's ntfy topic; optional token/basic auth
- [x] RSS feed — private tokenized XML feed per user; always real-time
- [x] Quiet hours — local-time window (IANA timezone auto-detected by browser); events queued and sent as batch after window
- [x] Digest mode — bundled ntfy summary on daily or weekly schedule instead of per-event pushes
- [x] Weekly digest — Monday 8:30 AM UTC; 7-day summary of followed bill activity via ntfy + RSS
- [x] Change-driven alerts — `categorize_action()` maps action text to 6 named categories; all three follow types (bill, sponsor, topic) covered
- [x] Granular per-mode alert filters — 8 independently toggleable alert types per follow mode (Follow / Pocket Veto / Pocket Boost); preset defaults; tabbed UI with per-tab save
### UX & Polish
- [x] Party badges — solid red/blue/slate, readable in light and dark mode
- [x] Chamber badges — amber/gold for Senate, slate/silver for House
- [x] Fact vs inference labeling — `cited_fact` / `inference` on every cited point; backfill task for existing briefs
- [x] Following page — accordion sections, search, topic filters
- [x] Member search — "First Last" and "Last, First" both match via PostgreSQL `split_part()`
- [x] How It Works page — feature guide covering follow modes, alert filter customization, collections, notifications, AI briefs
---
## Up Next
### Phase 4 — Accountability
- [ ] **Votes & Committees** — fetch roll-call votes from Congress.gov into a `bill_votes` table. UI: vote results filterable by followed members and topics; timeline entries for committee actions.
- [ ] **Member Effectiveness Score** — nightly Celery task; transparent formula: sponsored bills, bills advanced through stages, co-sponsorships, committee participation, bills enacted. Stored in `member_scores`. Displayed on member profile with formula explanation.
- [ ] **Representation Alignment View** — for each followed member, show how their votes and actions align with the user's followed topics. Neutral presentation — no scorecard framing.
### Phase 5 — Search & Polish
- [ ] **Search Improvements** — filters on global search (bill type, status, chamber, date range); search within a member's sponsored bills; topic-scoped search.
- [ ] **Desktop View** — wider multi-column layout for large screens: sticky sidebar, expanded grid, richer bill detail.
- [ ] **first_name / last_name Backfill** — Celery task to populate empty first/last from stored "Last, First" `name` field via split (affects ~10% of member records).
### Backlog
- [ ] **Notification Channels v2** — email (SMTP), Discord webhook, Telegram bot.
- [ ] **Cross-Bill Referencing** — extract referenced bill IDs from LLM briefs; `bill_references` table; hover preview popover in BriefPanel for referenced legislation.
- [ ] **Source Viewer Option B** — in-app bill text viewer with cited passage highlighted and scroll-to-anchor. Deferred pending UX review of the current GovInfo-link approach.
- [ ] **Raw Diff Panel**`difflib` diff between stored document versions, shown as collapsible "Raw Changes" below the amendment brief. Zero API calls.
- [ ] **Shareable Collection Subscriptions** — "Follow this collection" so other users can subscribe to a public collection and get its bills added to their feed.
---
## v1.0 Definition
v1.0 ships when the following are all live:
- [x] Full bill pipeline (poll → fetch text → LLM brief → news → trend score)
- [x] Cited AI briefs with fact/inference labels
- [x] Follow modes (neutral / pocket_veto / pocket_boost)
- [x] Granular per-mode notification filters
- [x] Push (ntfy) + RSS + digest + quiet hours
- [x] Collections with share links
- [x] Shareable brief links
- [x] Personal notes
- [x] Draft letter generator
- [x] Public browsing (no account required to read)
- [x] Multi-user auth with admin panel
- [ ] Member effectiveness score
- [ ] Roll-call vote data
All other items above are post-v1.0.