Skip to content

VER STAGE2 ROUTE

github-actions[bot] edited this page Jul 25, 2026 · 21 revisions

Verification: Stage 2 Route Integration Tests

Metadata

Covers the HTTP endpoint and card-by-card transition flow of the second stage of word verification against REQ-VERIFICATION-SCORING, REQ-SSR-STAGE-FLOW, and REQ-SESSION-STATE.

Code under verification

  • routes/stage2.tsx — implements Hono routes for GET and POST /stage/2, processing interactive word verification.

Tests

  • tests/stage2_route_test.ts (deno test + Hono app.request):
    • GET /stage/2 redirects to /stage/1 when no session cookie;
    • GET /stage/2 redirects to /stage/1 when word selection is empty;
    • GET /stage/2 returns HTML with the first verification card;
    • GET /stage/2 renders htmx Know/Don't know buttons;
    • POST /stage/2 redirects to /stage/1 when no session cookie;
    • POST /stage/2 htmx request stores answer and returns next card;
    • POST /stage/2 final htmx request stores result and sends HX redirect;
    • POST /stage/2 computes score and redirects to /result;
    • POST /stage/2 applies pseudoword penalty when pseudoword is claimed;
    • POST /stage/2 sets session cookie in response.

Requirement coverage

  • Verification cards — GET/POST requests return individual cards with "Know"/"Don't know" buttons dynamically utilizing htmx.
  • Truthfulness score and Scoring algorithm — POSTs correctly record answers on the server and apply pseudoword penalties during the final score calculation.
  • GET/POST/302 flow — GETs without valid session states redirect to /stage/1, and completing the stage redirects to /result.

Source: docs/requirements/verifications/VER-STAGE2-ROUTE.md

Clone this wiki locally