Feature: Promise Tracker & Daily Webcrawl (The Talk Ledger)
File naming:feat-promise-tracker.md
1. Overview
Field
Description
Feature ID
F-001
Objective
To create a continuously updated, publicly verifiable database of environmental promises, tracking their progress and fulfillment to hold officials accountable.
Summary
The Talk Ledger lives at /promise-tracker and is linked from the Command Center at /. It is a searchable, filterable feed of environmental promises. Each card shows the quote, source, Walk-o-Meter score, AI summary, and Bang Jaga Watchdog commentary. A daily webcrawl ingests news and social media into three categories (New Promises, Progress Updates, Fulfillment Tracking). Gemini Flash summarizes long docs into "What was promised," "When," and "The Budget." Users can Like, Comment, Share, Follow, Flag as BS, and Submit new promises.
Related PRD
PRD §4.1
2. Functional Requirements
2.1 User Stories / Use Cases
ID
As a…
I want to…
So that…
Priority
US-01
Citizen
See a feed of promises with quote, source, and verification score
I can quickly judge who said what and how it's being verified
P0
US-02
Citizen
Search or filter by region, official, year, status
I find promises relevant to my area
P0
US-03
Citizen
Read an AI summary (what, when, budget)
I understand the promise without reading 50-page PDFs
P0
US-04
System
Run a daily crawl of news and social media
The database stays up to date automatically
P0
US-05
System
Classify crawled items as New Promise / Progress / Fulfillment
Data is structured for tracking and analytics
P0
US-06
Citizen
Follow a promise and manage that follow state from the card
I can keep track of promises I care about
P1
US-07
Citizen
Flag a promise card as misleading or wrong
Community can signal low-quality data to admins
P1
US-08
Citizen
Comment on a promise card
I can add context or discuss with others
P1
US-09
Citizen
Submit a new promise not in the system
I can add promises the crawler missed
P2
US-10
Citizen
See a Watchdog Commentary on each promise
I get a plain-language accountability read without research
P1
2.2 Acceptance Criteria
AC-01: The Talk Ledger feed loads showing quote/summary, source, date, and Walk-o-Meter score per card.
AC-02: Search and filter (region, politician, year, status) return the correct subset of promises.
AC-03: For long sources (PDFs, long articles), a 3-bullet AI summary is shown: What, When, Budget.
AC-04: Daily cron runs successfully; new/updated items appear in the feed after processing.
AC-05: Crawled items are tagged: New Promise, Progress Update, or Fulfillment.
AC-06: Authenticated users can follow a promise from the card; the button switches to Following, and a second tap confirms unfollow.
AC-07: Authenticated users can flag a promise; at ≥10 flags an admin alert is triggered.
AC-08: Authenticated users can comment (max 500 chars); comments with ≥5 flags are auto-hidden.
AC-09: User-submitted promises enter a pending moderation queue and are shown with a "Under review" banner. Admin approval/rejection UI and submitter notification are deferred to backlog.
AC-10: Watchdog Commentary is generated at crawl time, stored in DB, and displayed on the card.
AC-11: Source URLs with 404 status show: "Original source no longer available."
2.3 Business Rules
BR-01: A promise must have at minimum: quote or summary, source URL, and date. Walk-o-Meter score defaults to 0 until community input exists.
BR-02: Crawler must not duplicate existing promises. Dedup by source URL + quote fingerprint.
BR-03: AI summaries are generated only for sources above a length threshold (e.g. PDFs, articles > 500 words). Short quotes are used as-is.
BR-04: Each user may cast one Like per promise. One follow per promise. One flag per promise (per reason type).
BR-05: Watchdog Commentary uses a fixed system prompt; output is stored and may be reviewed by an admin before publishing. Max 2 sentences. No personal attacks.
BR-06: Source URL validation runs weekly. source_status is updated to 404 or paywalled accordingly.
BR-07: User-submitted promises are attributed "Submitted by community · Verified by WIWOKDETOK team" after approval.
BR-08: Flag threshold for admin review: ≥10 unique users. Admin can dismiss, edit, or remove.
2.4 Feature Dependencies
Feature
Reference
Dependency type
Region hierarchy
PRD §3.3
Required — filter/drill-down
Walk-o-Meter
docs/features/feat-walk-o-meter.md
Required — supplies Walk-o-Meter score per promise
Throughput: Feed and search support concurrent reads; crawl runs once per day.
Data volume: Pagination at 20 items per page; support 10k+ promises without degradation.
3.2 Availability & Reliability
Uptime: Aligns with Vercel/Supabase SLA. Feed is read-heavy; no hard dependency on crawl completion for serving.
Error handling: Failed crawl does not break the feed. Stale data shown with "last updated" indicator. Crawl retries with exponential backoff.
3.3 Security & Privacy
Auth: Feed and search are public (no login required for read). Write actions (Flag, Comment, Follow, Submit promise) require authentication.
Data: Source URLs and quotes are public by design. Crawler must respect robots.txt and rate limits. No PII in promise content.
Compliance: Ethical scraping and attribution.
3.4 Accessibility & UX
A11y: WCAG 2.1 AA; min tap target 48×48dp.
Localization: ID primary; designed for future EN.
Offline / low data: Data-Saver mode reduces image quality; no heavy animations; system font fallback.
3.5 Scalability & Limits
Crawl: Rate-limit external fetches; use Vercel Cron + queue (e.g. Inngest/QStash) for crawl jobs.
Storage: Promises and summaries in Supabase; raw crawl cache optional with defined retention.
Comments: Paginated at 20 per load; flat (non-threaded) for MVP.
4. Technical Requirements
4.1 Architecture Context
Layer: Frontend (Next.js App Router), Server Actions, cron routes, AI (summarization + Watchdog commentary).
Entry points:/promise-tracker (Talk Ledger UI), / (Command Center linking into the feed), src/app/actions/promises.ts, /api/cron/crawl, /api/cron/validate-urls.