> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pcm.game/llms.txt
> Use this file to discover all available pages before exploring further.

# Sprint 18: The Crucible and the Cutover

> Transitioning to TDD methodologies: E2E manual verification, security auditing, macro-economy stress testing, and closed beta execution.

# Sprint 18: The Crucible and the Cutover

Following the successful locking of the core gameplay loop and telemetry pipelines, Sprint 18 shifts the monorepo from feature development to strict system validation, Test-Driven Development (TDD), and infrastructure hardening.

## 🛠 Context & Required Skills for AI Agents

When operating within Sprint 18, all agentic workflows must adhere to the following directives:

1. **Zero-Mock Policy:** We are testing production parity. Do not generate or inject placeholder data, mock JWTs, or bypass the Bouncer middleware. All tests must execute against real PostgreSQL and Firestore staging states.
2. **Strict Error Logging:** Any fatal crash (HTTP 500, Prisma Unique Constraint violation, React Unhandled Runtime Error) is a **P0 hotfix**. Stop current execution and resolve the root cause.
3. **Cosmetic Debt Tracker:** Non-fatal errors (CSS padding, Framer Motion jank, responsive overflow) must not derail the testing loop. Log these immediately to a root `tech-debt.md` file for asynchronous resolution.
4. **The Monorepo Rule:** All test harnesses and bot scripts must be contained within `pcmtg-core` and respect the existing `npm` workspace boundaries.

***

## 🗺 Sprint 18 Roadmap

### \[ ] Phase 1: The Sandbox Crucible (Local E2E Verification)

* **Objective:** End-to-end manual verification of the core loop.
* **Tasks:**
  * Execute Google OAuth on `frontend/app`.
  * Navigate the Entryway UI, select faction, and queue via `POST /debate/queue`.
  * Play a 60-second round against Ghost Bots.
  * Verify the Stack and Shift combinatorial mechanics and Projected Vector UI mathematically.
  * Log cosmetic debt; immediately hotfix fatal state/database crashes.

### \[ ] Phase 2: The Data Scientist Audit (Security & Indexing)

* **Objective:** Codebase security, database efficiency, and architectural hardening (Led by Collaborator: Sam).
* **Tasks:**
  * Audit Neon PostgreSQL `schema.prisma` for B-tree index efficiency on high-volume queries.
  * Review Cloud Run concurrency parameters.
  * Audit Zero-Trust Bouncer middleware for SQL injection or double-spend vectors.
  * Execute agent-driven refactors based on audit findings.

### \[ ] Phase 3: The Macro-Economy Stress Test (Headless Harness)

* **Objective:** Simulate massive scale to validate zero-sum economy limits.
* **Tasks:**
  * Build a headless Node.js bot harness to simulate concurrent users.
  * Hammer the `/market` and `/resolve` Cloud Run endpoints.
  * Monitor Google Cloud Memorystore (Redis) rate limiters for Sybil resistance.
  * Audit BigQuery/Looker Studio to verify GIP decay metronome integrity and hyperinflation defenses.

### \[ ] Phase 4: The Closed Beta (Human Factors)

* **Objective:** Test psychological mechanics (Prisoner's Dilemma) with live users.
* **Tasks:**
  * Purge development scaffolding, CLI bypass tokens, and mock scripts.
  * Lock production environment variables via GCP Secret Manager.
  * Wire production Firebase App Hosting domains.
  * Monitor human interaction with the hidden Z-Axis (Populism vs. Elitism) and the "Based/Cringe" button.
