Sprint 16: The Pill Box & Grand Consensus
With the Global Market and Gacha loops deployed in Sprint 15, Sprint 16 focuses on the development of the Pill Box HUD, Personal Bunker, and the high-friction, zero-trust mechanics governing the premium non-market currency: Based Pills. The objective is to implement a robust, transaction-safe ledgers, dual consumption pathways (ideological defection and card forging), and couple them with elite, interactive interfaces on the frontend.🛠 Context & Required Rules for AI Agents
- Atomic Consumption (Zero-Trust): All Based Pill consumption pathways must execute inside
prisma.$transactionblocks with pessimistic raw SQLSELECT ... FOR UPDATErow locks on the player wallet to prevent double-spending under concurrent serverless workloads. - High-Friction Safety Guards: Destructive or high-impact actions like ideological defection and permanent asset forging must be protected by explicit, case-sensitive text confirmation inputs (“DEFECT” and “FORGE”) on the client-side to eliminate accidental clicks.
- Database Ledger Integrity: Every transaction must emit a permanent, audit-ready receipt log containing the precise player ID, transaction type, currency ticker (
BASED_PILL), and asset adjustments.
🗺 Sprint 16 Roadmap
[x] Phase 0: Schema Expansion
- Objective: Support the premium Based Pill ledger currency inside Neon Postgres database registers.
- Tasks:
- Add explicitly stored
based_pillsinteger property to thePlayerWalletschema inschema.prisma. - Regenerate Prisma client models and run database migration syncs.
- Add explicitly stored
[x] Phase 1: Consensus Mint (Resolution Engine)
- Objective: Physical minting and ledgering of Based Pills during a Grand Consensus event.
- Tasks:
- Update
backend/src/routes/resolve.jspost-match resolution engine. - Dynamically award 1 Based Pill during full consensus (4/4 matching coordinates), incrementing the player’s wallet inside the transaction.
- Automatically append a structured transaction receipt into the global audit logs.
- Update
[x] Phase 2: Consumption API
- Objective: Build atomic endpoints to consume Based Pills for game-theoretic and tactical adjustments.
- Tasks:
- Build
POST /inventory/defectto allow players to consume 1 Based Pill, re-map their matchmaker faction alignment, and swap standard payouts to target currencies. - Build
POST /inventory/forgeto allow players to consume 1 Based Pill, permanently forging an owned card asset with a1.5000xmultiplier upgrade. - Secure both endpoints using the
bouncerJWT token validation middleware.
- Build
[x] Phase 3: Bunker UI & Pill Box HUD
- Objective: Design the premium Personal Bunker and public intimidation indicators.
- Tasks:
- Update the global
<WalletOverlay />to render glowing, animated Based Pill rows in both the inline dashboard and floating dropdown drawers. - Inject the “Pill Box” public intimidation HUD block in the Matrix selection entryway page.
- Scaffold
/bunkerdisplaying active allegiances, live inventories, owned cards registry, and high-friction confirmation modals requiring case-sensitive type confirmations before committing ledger changes.
- Update the global
🏁 Retrospective & Conclusion
Sprint 16 successfully hardened the PCMTG transactional economy. By combining zero-trust PostgreSQL raw row locks (FOR UPDATE) with high-friction “Type-to-Confirm” client inputs, we have constructed a cheat-proof, user-safe operational model. Automated integration tests successfully proved that concurrent, fraudulent double-spends and duplicate card-forge upgrades are fully blocked by our database state machine.