Skip to content

P0 acceptance trace (PRD §15 → repository)

This file maps each §15 acceptance criterion to how it is verified in this repo. Primary PRD: prd.md.

# PRD §15 criterion Implementation / artifact How to verify
1 docker compose up brings the full stack up in <60s (first pull may exceed) docker-compose.yml, api, db, redis, web time docker compose up --build -d then curl -sf http://localhost:8000/health
2 Event simulator emits Scenario 1 with timestamps within ±5% of target spacing simulator/scenario_1.yaml, simulator/emit.py Compare YAML delay_ms (0 / 2000 / 500) to wall-clock gaps printed or logged; emit.py also stamps monotonic event_time offsets
3 Dashboard loads in <2s frontend/src/App.tsx Open http://localhost:3000 after up; DevTools Network for /v1/dashboard/state
4 Active Issues increments within 5s of device.damage_detected ingest_event + refresh_kpis + WS kpi channel Run simulator step 1 only (optional) or full script; watch KPI tile / Network WS payloads
5 AI Recommendations panel shows new card within 5s of claim.submitted Recommendation is created after payment.authorized in MVP pipeline (card appears after payment step) Trace note: PRD wording ties card to claim; implementation generates the recommendation after payment to mirror claim → pay → decide. Demo runbook describes the visible sequence.
6 Clicking the card opens detail with four reason codes persist_recommendation + customer_device_for (right-side panel — PRD §5.1 #11, not modal) Click the live High Impact card; right column lists four codes
7 Rationale is grammatical and references ≥2 reason codes backend/app/rationale.py templated string Read right-side panel rationale text
8 Approve triggers outcome; KPIs update within 5s; Active Issues decrements POST /v1/feedback/outcome_handle_approval + KPI refresh Click Approve in right panel; watch Active Issues, Cost Avoided MTD, NBA%
9 Activity feed appends “Repair center assigned” _handle_approval pushes timeline summary Alerts panel + timeline row (outcome.recorded)
10 Demo reset and re-run POST /v1/admin/reset-demo + Makefile demo-reset make demo-reset then run emit.py + approve; repeat
11 Add Widget Clarifier end-to-end (ADR-005) backend/app/widgets/, frontend/src/widgets/, docs/widget-builder.md Click + Add Widget → describe a chart → answer 1 question → preview renders → click Add to dashboard → widget appears in My widgets rail; make demo-reset clears it from the rail.
12 CustomSpec round-trip + atomic metric promotion (ADR-006, ADR-007) scripts/verify-acceptance.sh lines 26–50, backend/app/widgets/routes.py _validate_and_promote_metric bash scripts/verify-acceptance.sh POSTs a canned CustomSpec to /v1/widgets, asserts 201 + populated metric_id, fetches GET /v1/metrics/{metric_id} and confirms catalog promotion (catalog name matches the persisted spec), then GET /v1/widgets shows the row with spec.type == "custom". Exits non-zero on any assertion failure.

Automated smoke script

scripts/verify-acceptance.sh performs non-interactive checks for items 1, basic API contracts, reset (item 10 partially), the metric catalog seed (item 11 prereq, ADR-007), and the CustomSpec round-trip (item 12, ADR-006 + ADR-007).

Full 4–9 validation still needs the browser for WS + UI, or Playwright (not included in MVP). Item 11 (Add Widget Clarifier E2E) is browser-driven by design — the smoke script does not exercise the SSE → HITL → preview → persist flow.

PRD §5 tile coverage (current build)

P0 tiles wired through /v1/dashboard/state + WS updates:

  • KPIs: Active Issues, Claims in Progress, NBA %, Cost Avoided MTD (+ CSAT 4.6/5 static per PRD §5.1 #5)
  • Top Issues (15m window) with friendly labels + trend column
  • AI Recommendations list — live High Impact + 4 visual-stub cards (Preventive / Risk Detected / SLA Risk / Customer Comms) per the user-confirmed scope and PRD §5.2
  • Timeline (with All Signals / Customer / Device / Claims / Interactions / Ops tabs) + Alerts feed
  • Customer & Device Detail right-side panel populated when an issue session is selected (PRD §5.1 #11)

P1 visual stubs added for layout parity with the mockup:

  • KPI sparklines + delta chips (PRD §5.1 #6)
  • US Issue Heatmap (inline SVG + region hotspots; PRD §5.1 #7)
  • Connected Systems strip (PRD §5.1 #13)

P2 (visible, non-interactive): left-nav items beyond Executive Overview (PRD §5.1 #14).

Mistakes fixed in this build

  • Stale web container: rebuilt as part of the rework.
  • Detail view: replaced modal with PRD-aligned right-side panel.
  • Recommendation card title: derived from data with the PRD §4.1 string as fallback.
  • NBA Taken %: now ~87% (was 100%) — adds 18 unapproved seeded recs (PRD §17 plausibility warning).
  • Frontend stack: now Tailwind + Recharts per PRD §6.2.
  • Top Issues: friendly labels + trend column (was raw enum).