5.4 KiB
Project Tracker — Status Scratchpad
Use this file for progress and checklists. Do not store these in CLAUDE.md.
Current Status (High Level)
| Phase | Status | Description |
|---|---|---|
| Phase 0: Project Init | Done | Repo scaffold, Node+TS, Playwright, docs, CLAUDE.md |
| Phase 1: Perception | In Progress | Playwright Spy + /api/simple-chat → current_state.json |
| Phase 2: War Room | Pending | Populate constitution, handbook, ledger schema |
| Phase 2.5: Advisor | Pending | Query advisor chat, scrape response into context |
| Phase 3: Brain | Pending | Context assembly, LLM reasoning, action batch generation |
| Phase 4: Hand | Pending | Batch execution via Playwright (action box submit) |
Phase 0: Project Init — Done
- Reorganize repo: PRD →
docs/PRD.md, diagrams →docs/diagrams/ - Add
CLAUDE.md(constitution),docs/project-tracker.md,docs/logs/ - Add scaffold script (
scripts/scaffold.sh) - Initialize Node.js + TypeScript project (Playwright, tsx, Zod, tsconfig)
- Create
war-room/placeholders (constitution.md, crisis_handbook.txt, strategic_ledger.json, current_state.json) - Create
src/skeleton (spy/, brain/, hand/, index.ts) - Consolidate game research into
docs/pax-historia-research.md - Lock CLAUDE.md: tech stack, coding standards, folder structure, data-flow contracts
Phase 1: Perception — In Progress
Goal: Intercept /api/simple-chat responses and write parsed game state to current_state.json.
Files to create/modify:
src/shared/schemas.ts— Zod schema for GameStatesrc/shared/index.ts— barrel exportsrc/spy/interceptor.ts— Playwright route handler for/api/simple-chatsrc/spy/state-parser.ts— parse raw API response → validated GameStatesrc/spy/state-writer.ts— write GameState towar-room/current_state.jsonsrc/spy/index.ts— barrel export
Sub-tasks:
- Capture a real
/api/simple-chatresponse (need DevTools network tab — human task) - Define Zod GameState schema from captured payload
- Implement route interceptor (Playwright
page.route()) - Implement state parser (raw JSON → Zod-validated GameState)
- Implement state writer (GameState →
war-room/current_state.json) - Wire into
src/index.tsentry point - Smoke test: launch browser, trigger a game event, verify
current_state.jsonis written
Phase 2: War Room — Pending
Goal: Populate the War Room template files with real strategic content and validate the ledger schema.
Files to create/modify:
war-room/constitution.md— long-term goals (populate with real content)war-room/crisis_handbook.txt— tactical playbook (populate with real content)src/shared/schemas.ts— Zod schema for StrategicLedger (add to existing)src/brain/war-room-reader.ts— read + validate all War Room files
Sub-tasks:
- Write constitution content (long-term goals, identity, constraints)
- Write crisis handbook content (tactical doctrines, procedures)
- Define Zod StrategicLedger schema
- Implement War Room reader (read all files, validate, return typed context)
Phase 2.5: Advisor — Pending
Goal: Query the in-game advisor and scrape the response into the Brain's context.
Files to create/modify:
src/hand/advisor.ts— type query into advisor box, wait for response, extract textsrc/hand/index.ts— barrel export
Sub-tasks:
- Identify advisor box selectors (need DevTools — human task)
- Implement advisor query function (type → submit → wait → scrape response)
- Add advisor response to Brain context assembly
Phase 3: Brain — Pending
Goal: Assemble all context, call Claude API, generate a validated batch of actions.
Files to create/modify:
src/brain/context-assembler.ts— read all inputs, build promptsrc/brain/llm-client.ts— Anthropic Claude API wrappersrc/brain/action-generator.ts— call LLM, parse + validate ActionBatchsrc/shared/schemas.ts— Zod schema for ActionBatch (add to existing)src/brain/index.ts— barrel export
Sub-tasks:
- Define ActionBatch Zod schema
- Implement context assembler (GameState + War Room files + advisor → prompt)
- Implement Claude API client
- Implement action generator (prompt → ActionBatch)
- Update strategic_ledger.json with new plans after generation
Phase 4: Hand — Pending
Goal: Execute the action batch by typing each action into the game UI.
Files to create/modify:
src/hand/executor.ts— iterate ActionBatch, type + submit each actionsrc/hand/index.ts— barrel export (update)
Sub-tasks:
- Identify action box submit selectors/mechanics (need DevTools — human task)
- Implement batch executor (loop through actions, type + submit)
- Implement time-jump trigger
- Final ledger commit after execution
- Wire full cognitive loop in
src/index.ts
Blocking / Human Tasks
These require a human with a browser and DevTools open:
- Capture
/api/simple-chatJSON payload (Phase 1 blocker) - Identify diplomacy chat selector
- Identify timeline/jump selector
- Determine submit mechanics for each UI element (button? Enter? both?)
Logs
Timestamped writeups go under docs/logs/ (e.g. 2026-02-07-scaffold.md).