docs(@projects/@magic-civilization): 📝 p2-86 phase 1 done — auto-start + TCP rendered driver verified

Mark Phase 1 acceptance complete: MC_AUTO_START rendered boot, mcp_render_driver
TCP autoload (screenshot/open_screen/ping), plum-verified. Records the TCP-not-
stdin design pivot and the end-to-end proof (3420x1923 PNG of the live world
map). Phase 2 (TS MCP tools + npm install + .mcp.json + restart) remains.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Natalie 2026-06-18 20:30:48 -05:00
parent 5c06a9d923
commit 6721f3f2f3
3 changed files with 47 additions and 22 deletions

View file

@ -16,9 +16,9 @@
|---|---|---|---|---|---|---|---|
| **P0** | 44 | 0 | 0 | 0 | 0 | 0 | 44 |
| **P1** | 79 | 0 | 13 | 1 | 0 | 1 | 94 |
| **P2** | 102 | 0 | 17 | 6 | 5 | 1 | 131 |
| **P2** | 102 | 0 | 19 | 5 | 5 | 1 | 132 |
| **P3 (oos)** | 22 | 0 | 2 | 0 | 0 | 29 | 53 |
| **total** | **247** | **0** | **32** | **7** | **5** | **31** | **322** |
| **total** | **247** | **0** | **34** | **6** | **5** | **31** | **323** |
</td><td valign='top' style='padding-left:2em'>
@ -31,9 +31,9 @@
| [asset-sprite](../team-leads/asset-sprite.md) | 6 |
| [shipwright](../team-leads/shipwright.md) | 4 |
| [unassigned](../team-leads/unassigned.md) | 3 |
| [wireguard](../team-leads/wireguard.md) | 2 |
| [asset-audio](../team-leads/asset-audio.md) | 1 |
| [testwright](../team-leads/testwright.md) | 1 |
| [wireguard](../team-leads/wireguard.md) | 1 |
</td></tr></table>
@ -316,8 +316,9 @@
| [p2-82](p2-82-climate-input-save-fidelity.md) | ✅ done | Climate-input save-fidelity — persist (or re-derive) worldgen-static grid inputs across save/load | — | 2026-06-09 |
| [p2-83](p2-83.md) | ❌ missing | Phase/round state machine + speculative parallel simulation of player-action-independent turn work | [simulator-infra](../team-leads/simulator-infra.md) | 2026-06-09 |
| [p2-84](p2-84.md) | ❌ missing | "Dev-only compute profiling — per-feature CPU/RAM/GPU cost over time, trigger-attributed, zero-cost in release" | [simulator-infra](../team-leads/simulator-infra.md) | 2026-06-09 |
| [p2-85](p2-85-poi-sprites-and-tooltips.md) | 🔴 stub | "POI sprites + hover tooltips — lairs (and resources) legible on the map" | [asset-sprite](../team-leads/asset-sprite.md) | 2026-06-18 |
| [p2-85](p2-85-poi-sprites-and-tooltips.md) | 🟡 partial | "POI sprites + hover tooltips — lairs (and resources) legible on the map" | [asset-sprite](../team-leads/asset-sprite.md) | 2026-06-18 |
| [p2-86](p2-86-mcp-rendered-driver.md) | 🟡 partial | "Claude-player MCP — rendered driver mode (drive UI + capture screenshots)" | [simulator-infra](../team-leads/simulator-infra.md) | 2026-06-18 |
| [p2-87-single-color-system-sot](p2-87-single-color-system-sot.md) | 🟡 partial | "Single game-wide colour system — one source of truth, layered tokens, every consumer derives from it" | [wireguard](../team-leads/wireguard.md) | 2026-06-18 |
## Out of Scope (Game 2 / Game 3)

View file

@ -26,18 +26,32 @@ complementing the headless state API.
## Acceptance criteria
- [ ] A second harness mode runs a **windowed/offscreen Godot** instance of the
real scenes (`world_map`, `city_screen`, menus) with `gl_compatibility`.
- [ ] New MCP tools: **`magic_civ_screenshot`** (capture viewport →
PNG via `get_viewport().get_texture().get_image().save_png`, same mechanism as
`standin_sprite_proof.gd`), **`magic_civ_open_screen(screen)`** (navigate UI),
optional `magic_civ_navigate` / `magic_civ_click`.
- [ ] Godot-side **MCP-driver autoload** that receives open-screen/screenshot
commands (over the existing harness stdio/socket) and returns the image path.
- [ ] Works on plum (windowed); document the cloud path (weston/xvfb + GPU node,
per the cloud-pivot handoff).
- [ ] Proof: from a Claude session, open `city_screen` and capture a screenshot
via the MCP tool.
- [x] A rendered boot path that loads the **real game** windowed with
`gl_compatibility` — done via `MC_AUTO_START=1` (`main.gd`, commit a1d5b3187),
which skips the menu into an interactive seeded game.
- [x] Godot-side **MCP-driver autoload** (`mcp_render_driver.gd`) that handles
`screenshot` / `open_screen` / `ping` / quit against the live rendered game and
returns the image path. Done via a **localhost TCP socket** (commit 22197a81c).
- [x] Works on plum (windowed); cloud path documented (weston/xvfb + GPU node).
- [ ] New MCP tools: **`magic_civ_screenshot`**, **`magic_civ_open_screen`** in
`index.ts` + `harness.ts` methods (connect to the driver's TCP port).
- [ ] `npm install` (never run — p2-67 phase 13) + `.mcp.json` entry + restart.
- [ ] Proof: from a Claude session, open a screen and capture via the MCP tool.
## Progress (2026-06-18) — Phase 1 done
- `MC_AUTO_START` boots straight into an interactive game (auto-start prereq).
- `mcp_render_driver` autoload, active on `MC_MCP_RENDER=1`, serves JSON-Lines
over a polled **TCP socket** (`MC_MCP_PORT`, default 8787).
- **Design pivot — TCP, not stdin:** `OS.read_string_from_stdin` blocks an open
pipe and freezes a rendered main loop; a `TCPServer` polled in `_process` is
non-blocking and also avoids Godot's windowed-stdout block-buffering (which
would have starved the MCP's stdout reader anyway). `player_api_main`'s stdin
pump is fine only because it runs `--headless`.
- **Verified end-to-end without MCP:** a raw TCP client →
`ping {ok}`, `screenshot` → a real **3420×1923 PNG** of the live world map.
- Phase 2 = the TS MCP tools + `harness.ts` TCP transport + npm install +
`.mcp.json` + restart (the only step that needs a Claude restart to verify).
## Verified architecture (2026-06-18) + implementation plan

File diff suppressed because one or more lines are too long