### Phase 3 — Personal Workflow & Context _Focus: Allowing users to organize data and adding the "Cross-Bill" intelligence layer._ - **Collections / Watchlists:** `collections` table for public/private bill groupings shareable via UUID tokens. - **Personal Notes:** Private `bill_notes` table to store user stances, tags, and pinned insights on bill detail pages. - **Cross-Bill Referencing (New):** - **Extraction:** Update LLM prompts to identify and extract related bill identifiers (e.g., "H.R. 1234") from text. - **Referential Table:** Implement `bill_references` to map source-to-target bill relationships with context quotes. - **Ghost Hydration:** Create the `/api/admin/bills/hydrate` endpoint to fetch and analyze referenced bills not currently in the DB. - **UI Hover Previews:** Use `Radix UI` popovers in the `BriefPanel` to show snapshots of referenced legislation without leaving the page. - **Weekly Digest:** Celery beat task to dispatch 7-day summaries of followed bills via ntfy and RSS. --- ### Phase 4 — Accountability & Member Scoring _Focus: Deep-diving into legislative performance and voting records._ - **Votes & Committees:** Fetch roll-call votes and committee actions from Congress.gov into a new `bill_votes` table. - **Member Effectiveness Score:** Nightly Celery task calculating scores based on sponsored bills, advancement milestones, and "bills enacted" metrics. - **Bipartisan Progress Metric (Proposed):** Enhance effectiveness scores by weighting co-sponsorship across party lines and committee movement in opposing chambers. - **Representation Alignment:** Neutral view showing how member votes align with a user’s followed topics. --- ### Phase 5 — Systemic Intelligence _Focus: Enhancing search and providing broader legislative context._ - **Search Improvements:** Add filters for bill type, status, chamber, and date; implement "Search within member bills". - **Topic-Scoped Search:** Allow users to search legislation exclusively within followed topics like "Healthcare" or "Energy". - **Member Effectiveness Transparency:** Display the "Member Effectiveness" formula on profile pages to maintain non-partisan trust. --- ### Phase 6 — Desktop & Polish _Focus: Optimization for professional-grade power users._ - **Desktop View:** Multi-column layout with sticky sidebars and expanded grids optimized for large screens. - **Notification Channels v2:** Expand beyond ntfy/RSS to include Discord webhooks, Telegram, and SMTP email. - **Backfill Tasks:** Automate `first_name` and `last_name` population for all member records. --- ## 🛠️ Updated Technical Implementation Details ### Database Schema Updates |**Table**|**New Columns / Purpose**| |---|---| |**`bill_references`**|`source_id`, `target_id`, `context_quote` to link related bills.| |**`bill_notes`**|`user_id`, `bill_id`, `content`, `stance`, `tags`, `pinned`.| |**`collections`**|`user_id`, `name`, `slug`, `is_public` for shared watchlists.| |**`bill_votes`**|Stores roll-call data and results for accountability tracking.| ### Enhanced LLM Pipeline The `llm_processor.py` task will now perform a dual-pass: 1. **Analysis:** Generate the standard brief with citations and fact/inference labels. 2. **Mapping:** Extract bill IDs found in the text and insert them into the `bill_references` table. If a target ID is missing from the `bills` table, it triggers a low-priority `hydrate_bill` task. ### Performance Guardrails - **Selective Hydration:** The poller will only "Ghost Hydrate" referenced bills if they are from the current or previous Congress to prevent API exhaustion. - **Cached Previews:** Referenced bill snapshots for hover tooltips will be cached in Redis to minimize database hits during dashboard scrolling.