Member Effectiveness Score
- New BillCosponsor table (migration 0018) with per-bill co-sponsor
party data required for the bipartisan multiplier
- bill_category column on Bill (substantive | commemorative | administrative)
set by a cheap one-shot LLM call after each brief is generated
- effectiveness_score / percentile / tier columns on Member
- New bill_classifier.py worker with 5 tasks:
classify_bill_category — triggered from llm_processor after brief
fetch_bill_cosponsors — triggered from congress_poller on new bill
calculate_effectiveness_scores — nightly at 5 AM UTC
backfill_bill_categories / backfill_all_bill_cosponsors — one-time
- Scoring: distance-traveled pts × bipartisan (1.5×) × substance (0.1×
for commemorative) × leadership (1.2× for committee chairs)
- Percentile normalised within (seniority tier × party) buckets
- Effectiveness card on member detail page with colour-coded bar
- Admin panel: 3 new backfill/calculate controls in Maintenance section
Representation Alignment View
- New GET /api/alignment endpoint: cross-references user's stanced bill
follows (pocket_veto/pocket_boost) with followed members' vote positions
- Efficient bulk queries — no N+1 loops
- New /alignment page with ranked member list and alignment bars
- Alignment added to sidebar nav (auth-required)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
35 lines
1.6 KiB
Python
35 lines
1.6 KiB
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.api import bills, members, follows, dashboard, search, settings, admin, health, auth, notifications, notes, collections, share, alignment
|
|
from app.config import settings as config
|
|
|
|
app = FastAPI(
|
|
title="PocketVeto",
|
|
description="Monitor US Congressional activity with AI-powered bill summaries.",
|
|
version="1.0.0",
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=[o for o in [config.LOCAL_URL, config.PUBLIC_URL] if o],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(auth.router, prefix="/api/auth", tags=["auth"])
|
|
app.include_router(bills.router, prefix="/api/bills", tags=["bills"])
|
|
app.include_router(members.router, prefix="/api/members", tags=["members"])
|
|
app.include_router(follows.router, prefix="/api/follows", tags=["follows"])
|
|
app.include_router(dashboard.router, prefix="/api/dashboard", tags=["dashboard"])
|
|
app.include_router(search.router, prefix="/api/search", tags=["search"])
|
|
app.include_router(settings.router, prefix="/api/settings", tags=["settings"])
|
|
app.include_router(admin.router, prefix="/api/admin", tags=["admin"])
|
|
app.include_router(health.router, prefix="/api/health", tags=["health"])
|
|
app.include_router(notifications.router, prefix="/api/notifications", tags=["notifications"])
|
|
app.include_router(notes.router, prefix="/api/notes", tags=["notes"])
|
|
app.include_router(collections.router, prefix="/api/collections", tags=["collections"])
|
|
app.include_router(share.router, prefix="/api/share", tags=["share"])
|
|
app.include_router(alignment.router, prefix="/api/alignment", tags=["alignment"])
|