E2E Pipeline Smoke Test (WI-8)

Context

End-to-end smoke test verifying the full fact engine pipeline from news ingestion through to user-facing features. Runs after all other waves are complete.

Current State

  • Individual unit tests cover components in isolation
  • Manual cron triggers are the only integration test path

Existing Infrastructure

  • Playwright config: apps/web/playwright.config.ts exists and is functional
  • Existing specs (3):
    • login.spec.ts — authentication flow
    • button-audit.spec.ts — UI button accessibility
    • site-audit.spec.ts — site-wide health checks
  • These provide a foundation for additional E2E specs below

Challenges

Challenge 8.1: Pipeline Flow

Requirement: Test ingestion → clustering → extraction → validation → enrichment. Acceptance Criteria:

  • Insert mock news sources
  • Trigger cluster-sweep → verify story created
  • Trigger extract-facts → verify fact record created with correct schema
  • Trigger validate-fact → verify status transitions (pending → validated)
  • Trigger enrichment orchestrator → verify API client resolution (13 clients)
  • Trigger challenge content generation → verify output for target format/style
  • Trigger challenge image resolution → verify anti-spoiler compliance Evaluation: PENDING

Challenge 8.2: Feed & Interaction

Requirement: Test feed delivery and user interaction flow. Acceptance Criteria:

  • Call /api/feed → verify validated fact appears with userStatus
  • Submit free-text answer → verify AI scoring returns 0.0-1.0
  • Verify spaced repetition schedules next review
  • Verify subcategory filtering returns correctly scoped results
  • Test conversational challenge mode interaction flow Evaluation: PENDING

Challenge 8.3: Disputes & Rewards

Requirement: Test dispute and reward flows. Acceptance Criteria:

  • Submit score dispute → verify AI evaluation and decision
  • Check reward milestone progress → claim milestone → verify free Eko+ days granted Evaluation: PENDING

Challenge 8.4: Subscription Gating

Requirement: Test access control. Acceptance Criteria:

  • Verify card detail gated behind subscription
  • Verify free user sees paywall overlay
  • Verify Eko+ user sees full content Evaluation: PENDING

Challenge 8.5: Public Site Integration

Requirement: Test public site feed and conversion funnel. Acceptance Criteria:

  • Public site home page renders feed from app API
  • Subscription card appears at position 4
  • Card click triggers login/subscribe flow Evaluation: PENDING

Challenge 8.6: Build & Type Verification

Requirement: Full build passes after all changes. Acceptance Criteria:

  • bun run typecheck — zero errors
  • bun run lint — zero violations
  • bun run test — all pass
  • bun run migrations:check — index current
  • bun run build — all 3 apps build successfully Evaluation: PENDING Notes: Partially addressed by existing Playwright specs (login.spec.ts, button-audit.spec.ts, site-audit.spec.ts) which cover build verification and basic site health.

Challenge 8.7: Challenge Content Pipeline

Requirement: Test challenge generation across all format types and drift validation. Acceptance Criteria:

  • Generate challenges for all 8 format types → verify output schema
  • Validate drift coordinator checks pass (voice, structure, schema, taxonomy, difficulty, reveal, textbook)
  • Test style/format combination coverage matrix
  • Verify micro-batch amortization produces consistent output Evaluation: PENDING

Implementation Notes

  • Script location: scripts/e2e-fact-pipeline-smoke.ts
  • May need test database seeding utilities
  • Consider using Supabase test project or local instance
  • Some tests may need mocked AI responses (cost control)