# Public Assurance Tracker Service

## PURPOSE
A SQLAlchemy + httpx service that records public assurances made by officials — like
Minister Bharat's promise in this video that Kurnool's local youth "would be fully
supported with employment opportunities through the Ratan Tata Innovation Hub" — and
later checks each promise against a source URL. It gives a district office a durable,
auditable log of commitments with verification status rather than a scattered trail
of news clips.

## WHY THIS MATTERS
The transcript is, at its core, a public commitment: a minister's assurance about
youth employment. Commitments are cheap to make and easy to forget. This project
teaches the integration pattern that holds institutions accountable — structured
storage of a claim plus periodic retrieval to confirm whether the source still
supports it.

## HOW TO BUILD
Use SQLAlchemy ORM models with FastAPI, and httpx for the outbound source check.

```python
class Assurance(Base):
    __tablename__ = "assurances"
    id: Mapped[int] = mapped_column(primary_key=True)
    speaker: Mapped[str]
    topic: Mapped[str]
    claim: Mapped[str]
    source_url: Mapped[str]
    status: Mapped[str] = mapped_column(default="unverified")

async def verify(a: Assurance, client: httpx.AsyncClient) -> str:
    r = await client.get(a.source_url, timeout=10)
    return "supported" if r.status_code == 200 else "source_unreachable"
```

1. Define an `Assurance` table (speaker, topic, claim, source_url, status, checked_at).
2. Add `POST /assurances` to record a commitment and `GET /assurances` to list.
3. Add `POST /assurances/{id}/verify` doing an httpx GET and updating status.
4. Add a simple API-key dependency for write endpoints.

## WHEN TO USE IN PRODUCTION
Use it for accountability newsrooms, civic-tech trackers, government promise
dashboards, or any team that needs to diff statements against sources over time.
Do NOT use it to auto-adjudicate truth — status here means "source reachable and
recorded", not legal proof. Not suitable for high-frequency scraping without
politeness limits and robots.txt checks.

## HOW IT HELPS STUDENTS
Students learn SQLAlchemy ORM modelling, FastAPI dependency injection, async httpx
I/O, and the verify-after-write pattern that separates toy CRUD from real services.

## STARTER CODE
`starter/main.py` defines the ORM model, records the Minister's assurance as seed
data, exposes record/list/verify endpoints, and uses a deterministic stub when the
network call would happen, with `# TODO` markers for real verification logic.
