Documentation Index
Fetch the complete documentation index at: https://pcmtg.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Sprint 11: Progression & Ranked Play
With the continuous poker table loop and simultaneous reveal mechanics locked in (Sprint 10), Sprint 11 focuses on the macro-economy and player progression. Before adding new features, we must stabilize the local development environment by fixing timestamp miscalculations and API error boundaries.🛠 Context & Required Skills for AI Agents
When working on this sprint, agents must adhere to the following technical contexts:- Firebase Timestamps: Firestore stores timestamps as objects containing seconds and nanoseconds. To compare them to frontend JavaScript
Date.now(), the agent MUST convert the Firebase timestamp properly (e.g.,timestamp._seconds * 1000ortimestamp.toMillis()depending on the SDK object type) to avoid instant-timeout bugs. - Graceful Failures: Edge-cached API routes fetching from Firestore must NEVER throw unhandled 500s. If a document (like
GlobalState/macro_state) is missing, return a200 OKwith a safe baseline fallback payload. - The Currencies: Faction-specific native currencies are: AuthRight (Dinars), AuthLeft (Collective Labor), LibLeft (Pronouns), LibRight (Monke).
- Standard Operating Procedure: The 5-Step “Definition of Done” found in
task.mdremains in full effect.
🗺 Sprint 11 Roadmap
[x] Phase 0: Technical Stabilization (Hotfixes)
- Objective: Fix integration bugs preventing local playtesting.
- Tasks:
frontend/app/api/macro-state/route.ts: Catch Firebase Admin initialization and missing document errors. Return fallback baseline:{"AuthRight": 2500, "AuthLeft": 2500, "LibLeft": 2500, "LibRight": 2500}instead of throwing HTTP 500.frontend/app/arena/[lobbyId]/page.tsx: Fix the 30-second Shot Clock. Correctly parse the FirebasestartedAttimestamp to milliseconds before calculatingDate.now()differences. Ensure the auto-play fallback ONLY triggers iftableState.status === 'DEBATE_PHASE'.
[x] Phase 1: Post-Match Math & Economy Payouts
- Objective: Award the victors and punish the losers.
- Tasks:
- Build
backend/src/routes/resolve.jslogic to calculate the Euclidean distance of played cards against the News Stub target vector. - Distribute ELO points (+/-) to the players based on ranking.
- Distribute native currency based on the “Based/Cringe” prisoner’s dilemma matrix.
- Update the backend to funnel a portion of the matched currency into the Global GIP pool, altering the
GlobalState/macro_state.
- Build
[x] Phase 2: Player Profile & Prestige UI
- Objective: Visualize the progression state globally.
- Tasks:
- Update
frontend/components/WalletOverlay.tsxto fetch and dynamically display the player’s current ELO tier (e.g., Bronze, Silver, Gold). - Add visual animations for currency payouts upon returning from an Arena match.
- Update
[x] Phase 3: ELO-Based Matchmaking Gates
- Objective: Prevent high-tier players from farming low-tier bots.
- Tasks:
[x]UpdatePOST /debate/inject-ghoststo query the human player’s ELO.[x]Scale the Euclidean precision (difficulty) of the generated Ghost Players’ hands based on the human’s ELO bracket.