Repository navigation
Architecture Decision Record
Status: Approved at Phase 0 exit
Date: 26 October 2026
Decision owner: Project owner
Requirements baseline: Word Association Game Requirements v2.6
Build Wordpairs as a TypeScript modular monolith using Next.js App Router, deployed on Vercel after coding Phases 1–6. Use Supabase Postgres as durable system of record and Supabase Realtime only to deliver authorized, committed updates. Use Supabase Cron/pg_cron through a deadline-scheduler port; verify Free-tier availability during Phase 7 deployment entry.
Organize the code into Identity/Profile, Lobby, Match, Content/Moderation, Public Read Model, and Delivery/Operations bounded contexts. The first five contexts own game behavior and projections. Delivery/Operations owns TR-only provisioning, build, SWBOM, and release processes and is implemented in Phase 7.
The web server is the authority for identity, room membership, readiness, match state, answer acceptance, scoring, moderation, and public projection filtering. Browser clients use allowlisted read models and submit commands. Database transactions serialize conflicting aggregate mutations, enforce command idempotency, and write outbox events atomically. Realtime transports outbox events; clients refetch authorized projections after reconnect or a version gap.
Use npm with a committed lockfile. Vitest runs domain/use-case/component tests; MSW and explicit fakes replace external boundaries; Testing Library covers React interactions; Playwright covers browser journeys. The implemented transport boundaries use explicit allowlisted parsers and domain validation. Server-side OpenID Connect uses openid-client; PostgreSQL persistence uses pg; Realtime uses @supabase/supabase-js in infrastructure adapters. Zod and @supabase/ssr were reviewed planning options and are not installed or required by the current implementation. The server issues its own opaque session cookies backed by hashed PostgreSQL session records.
Use the reviewed package versions in ATTRIBUTIONS.md as direct dependencies and generate the lockfile before any production implementation. Apache-2.0 packages remain build/test tools and are not bundled into game runtime assets. Wordpairs source and game are GPL-2.0-only.
- Domain modules import no Next.js, React, Supabase, OIDC, or transport packages.
- Application use cases depend on ports for repositories, clock, randomness, identity, scheduler, quota state, and event publication.
- Room commands use one aggregate transaction and version; database constraints backstop domain invariants.
- A fake validates application behavior but does not claim to prove database locking, RLS, or durability. Those checks are TR integration evidence and do not count as AC coverage.
- Public landing queries use a separate allowlisted read model and never expose room codes, player names, target answers, guesses, observer views, moderation records, or secrets.
- Vercel Preview/Production setup, provisioning, deployment, deployment SWBOMs, and release publication happen only in Phase 7 after coding Phases 1–6.
The design keeps lobby, game, and moderation rules independently testable while retaining one deployment and one transactional persistence boundary. It avoids relying on Vercel process memory for shared state and permits deterministic fake-clock and mocked-port tests. The Free-tier scheduler capability and provider/account entitlements remain external Phase 7 TR checks; they do not change AC expectations.
The project owner approved Phase 0 on 26 October 2026. The remote-anchored hostile review at commit 8ded5ff293928744dd8735006f3121738528fe67 scored 99.5% accuracy and 99% completeness. The approval record is phase0_approval_receipt.jsonl.
Generated from MCP requirements wiki export.
- Home
- Guest Game and GitHub Admin PWA
- Functional Requirements
- Technical Requirements
- Testing Requirements
- TR per FR Mapping
- Requirements Matrix
- Wordpairs
- Local Development
- Testing and Evidence
- Administration and Access Control
- Requirements Baseline v2.8
- Architecture Decision Record
- Architecture Design
- Architecture Patterns
- Content Moderation
- Deployment and Release Plan
- Acceptance Criteria Gap Analysis
- Acceptance Criteria Test Inventory
- Implementation Plan
- Phase 0 Execution
- Phase 0 Interface and Data Contracts
- Phase 1A Execution
- Phase 1 Execution
- Phase 2 Execution
- Phase 3 Execution
- Phase 4 Execution
- Phase 5 Execution
- Phase 6 Execution
- Optional Phase 6 Human Feedback
- Historical Chromium Crash Diagnosis
- Completed Coding Goal and Review Agreement
- Third Party Attributions
- Software Bill of Materials Contract
- Phone Installation and PWA
- Live Multiplayer Runtime and UI Integration
- UI Test Case Index
- UI Design Coverage
- UI Criterion Gaps
- UI Design Questions
- UI Test Persistence
- TEST-ACCESSIBLEGAMECONTROLS-044 UI Case
- TEST-ACLAUTHORIZATION-132 UI Case
- TEST-ADMINUI-136 UI Case
- TEST-AUTHORITATIVEANSWERHANDLING-045 UI Case
- TEST-BROWSEOPENLOBBIES-022 UI Case
- TEST-CATALOGVERSIONING-133 UI Case
- TEST-CATEGORYART-005 UI Case
- TEST-CATEGORYCHOICE-011 UI Case
- TEST-CATEGORYSUGGESTIONUNLOCK-019 UI Case
- TEST-CONFIGUREDCAPACITY-024 UI Case
- TEST-CONNECTIONRECOVERY-109 UI Case
- TEST-CONTENTVALIDATION-016 UI Case
- TEST-DEEPLINKJOINANDFULLROOM-026 UI Case
- TEST-FINALSTANDINGS-013 UI Case
- TEST-FIRSTCATEGORY-004 UI Case
- TEST-FREETIERQUOTAHANDLING-037 UI Case
- TEST-FULLROOMOBSERVER-027 UI Case
- TEST-GUESTPLAY-021 UI Case
- TEST-HINTPROGRESSION-009 UI Case
- TEST-HINTSCORING-007 UI Case
- TEST-HOLDOUTWARNINGANDREMOVAL-032 UI Case
- TEST-IDLELOBBYREADINESSPROMPT-033 UI Case
- TEST-INROUNDEMOJIREACTION-029 UI Case
- TEST-LANDINGPAGEPUBLICDATA-050 UI Case
- TEST-LIVESCORECARD-010 UI Case
- TEST-MODERATIONANDCATALOGBOUNDARY-047 UI Case
- TEST-NOHINTSOLVE-006 UI Case
- TEST-NOMINATIONELIGIBILITY-017 UI Case
- TEST-NOMINATIONMODERATION-114 UI Case
- TEST-NOMINATIONTHRESHOLDANDMODERATION-018 UI Case
- TEST-OBSERVERPERSPECTIVEANDPERMISSIONS-028 UI Case
- TEST-OIDCTOKENVALIDATION-046 UI Case
- TEST-OPENAIOIDCPROFILE-020 UI Case
- TEST-ORIENTATION-015 UI Case
- TEST-PLAYERLIMIT-002 UI Case
- TEST-PRECOUNTDOWNOBSERVERPROMOTION-030 UI Case
- TEST-PROFILEICON-003 UI Case
- TEST-PUBLICGAMELANDINGPAGE-043 UI Case
- TEST-PWAINSTALL-137 UI Case
- TEST-PWAPRIVACY-138 UI Case
- TEST-QUICKMATCH-023 UI Case
- TEST-READYCOUNTDOWNANDROSTERLOCK-031 UI Case
- TEST-ROOMINVITATIONS-025 UI Case
- TEST-ROOMJOINING-001 UI Case
- TEST-ROOMSYNC-139 UI Case
- TEST-ROUNDSUMMARY-012 UI Case
- TEST-SUGGESTIONREVIEW-115 UI Case
- TEST-TIMETIEBREAK-014 UI Case
- TEST-UNSOLVEDRESULT-008 UI Case
- UI Gap Decisions and Synchronization
- TEST-ACCESSIBILITYDETAILS-144 UI Case
- TEST-CANDIDATEHOLD-141 UI Case
- TEST-LOBBYMATCHING-117 UI Case
- TEST-NAVIGATIONDRAFTS-142 UI Case
- TEST-NOSOLVERFALLBACK-146 UI Case
- TEST-REQUESTFEEDBACK-143 UI Case
- TEST-RESPONSIVEMATRIX-145 UI Case
- TEST-REVIEWCHANGES-140 UI Case
- TEST-ROOMCODES-110 UI Case
- UI Gap Implementation Plan
- UI Gap Implementation and Evidence
- Contest Readiness
- Hostile Validation Evidence
- Category Artwork
- 10-Player Release Completion Plan
- Deadline Report and Token Accounting
- Deadline Report Supporting Evidence
- Deadline Timeline and Review Finding Analysis
- Stopped Wordpairs Release Handoff