Sprint 12: Stack & Shift Overhaul
Sprint 12 introduces the “Stack & Shift” combinatorial mechanics, transforming PCMTG’s battle system from single-card reveals to a sophisticated tactical staging system. Players can now chain modifiers (ITEM and POLICY cards) to their base MEME cards to shift coordinates, preview vectors in real-time on a glassmorphic Tactical HUD, and check economic cast requirements.
Additionally, this sprint includes a deep-cleaning Technical Debt & Architectural Cleanup pass to eliminate all any types, achieve a 100% warning-free Next.js production build, and extract duplicate 3D math and quadrant configurations into central, shared helper modules on both backend and frontend.
🛠 Context & Required Skills for AI Agents
When working on this sprint, agents must adhere to the following technical contexts:- Combinatorial Stacking Rules:
- A valid hand stack must contain exactly one core
MEMEcard acting as the base coordinate anchor. - Up to two modifier cards (
ITEMorPOLICY) can be stacked behind theMEMEcard, only if a coreMEMEis already staged. - Deselecting the base
MEMEcard triggers a cascading selection clear, emptying the entire staged stack.
- A valid hand stack must contain exactly one core
- Euclidean Shifting & Clamping:
- Accumulate all modifier axis shifts (
x,y,z) before applying coordinate bounds limits. Clamping the final coordinate strictly between[-10, 10]once at the end (rather than step-by-step) ensures mathematical client-server parity.
- Accumulate all modifier axis shifts (
- No-Implicit-Any Strictness:
- Explicit typescript interfaces must define all profile models, result payloads, and card states. The Next.js compiler must build clean in non-interactive production modes.
🗺 Sprint 12 Roadmap
[x] Phase 1: Balanced Hand Deals & Smart Ghost AI
- Objective: Ensure player hands have modifier diversity and bots can use them strategically.
- Tasks:
- Refactored both
/queueand/inject-ghostsinbackend/src/routes/debate.jsto deal exactly 2 coreMEMEcards matching the player’s affinity, and 2 modifier cards (ITEMorPOLICYtype, centrist or matching affinity). - Upgraded high-ELO Ghost Bots (ELO >= 1200) to mathematically select and stack optimal modifiers on top of their base card during reveal simulations.
- Refactored both
[x] Phase 2: Combinatorial Player Hand & 3D Staged HUD
- Objective: Give players the ability to stage card stacks with rich, tactile UI.
- Tasks:
- Upgraded
frontend/components/PlayerHand.tsxinto a controlled component governed byselectedCardIds. - Implemented cascading deselection rules and margin overlapping card fans.
- Engineered the Staged Stack HUD displaying modifier cards stacked behind the base
MEMEcard via depth scaling and 3D CSS transforms (slight skewing, rotation, and custom glow backdrops).
- Upgraded
[x] Phase 3: Tactical preview HUD & Live Wallet Sinks
- Objective: Calculate coordinate offsets in real-time and validate casting cost balances.
- Tasks:
- Built a glassmorphic preview dashboard on the Arena page summarizing current coordinates, active offset deltas, and projected coordinate points.
- Mapped faction currencies directly to player wallets. Enabled dynamic casting cost authorization checks, displaying an Authorized transaction status or a glowing Insufficient Funds warning panel.
[x] Phase 4: Technical Debt Reduction & Consolidated Utilities
- Objective: Refactor duplication out of the codebase and secure type-safety.
- Tasks:
- Shared Backend Module (
backend/src/utils/cardUtils.js): Consolidated quadrant currency mapping arrays, card predicates (isMeme,isModifier), and coordinate vector summation logic. - Shared Frontend Module (
frontend/lib/cardUtils.ts): Built strong TypeScript typings (Vector3D,UserProfile,PlayerResultEntry) and centralized styling metadata registry entriesQUADRANT_REGISTRY. - TypeScript Integrity: Cleared all occurrences of
anyvariables inside the page states, hooks, and SVG map visualizers to achieve a compile-clean Next.js production build.
- Shared Backend Module (
📡 E2E Verification & Type-Check Results
-
Frontend Production Compile:
- Result:
✓ Compiled successfullyand✓ Finished TypeScriptin 2.4s. Clean, zero-warning production build achieved with allanytypes eliminated.
- Result:
-
Backend Post-Match Resolution Test:
- Result: Passed 100% successfully. All coordinate summation, ELO calculations, ledger entries, and Firestore state sync operations verified.