From 6f4a25c50eebf21abee6d2fcc24de27e1ed6fcbb Mon Sep 17 00:00:00 2001 From: dayfine Date: Sun, 8 Nov 2026 12:51:10 -0800 Subject: [PATCH] Process: start_dev launch, headless SerialProgramsTests, map-fix evidence skill Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .agents/agents/autostory-code.md | 13 +++++-- AGENTS.md | 10 +++++ skills/console-iteration/SKILL.md | 22 +++++++++++ skills/map-fix-evidence/SKILL.md | 63 +++++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 skills/map-fix-evidence/SKILL.md diff --git a/.agents/agents/autostory-code.md b/.agents/agents/autostory-code.md index edb044144a..75a970b9dc 100644 --- a/.agents/agents/autostory-code.md +++ b/.agents/agents/autostory-code.md @@ -31,9 +31,16 @@ without being restated. - one file: `ninja -C SerialPrograms/build CMakeFiles/SerialProgramsLib.dir/Source/.cpp.o`; - build: `ninja -j4 SerialPrograms` in `SerialPrograms/build`. If it reaches the 10-minute cap, run the same command again; ninja resumes; - - tests: `./SerialPrograms.app/Contents/MacOS/SerialPrograms --command-line-test-mode` in - `SerialPrograms/build`, output to a file, then read only the suites you touched. Other games' - image tests fail locally without the CommandLineTests checkout; only the touched suites count. + - tests: never the GUI app's `--command-line-test-mode`: with the default + settings it opens the default profile's serial port and camera, which are the user's live + console A (2026-11-08 an agent's test run cut console A's controller mid-program), and test + launches refuse `--profile`. Use the headless runner `SerialProgramsTests` (upstream #1845; in + `lab/main` since f5ed40689): `ninja -j4 SerialProgramsTests`, then + `./SerialProgramsTests --filter ` in `SerialPrograms/build`, output to a file; it + skips settings and devices and exits with the failure count. On a code branch without it, + merge `origin/upstream/headless-tests` into a local scratch build tree only, never into a PR + branch. Read only the suites you touched; other games' image tests fail locally without the + CommandLineTests checkout. Read the exit code from a file (`…; echo $? > rc`), never through a pipe. Never background a long command and end the turn waiting for it: nothing wakes a subagent. If a command does run in the diff --git a/AGENTS.md b/AGENTS.md index b675cd22c1..b28d729447 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -251,6 +251,14 @@ Rules set by the user on 2026-11-02. - **Wait for each screen by detector, never by a fixed delay.** A press sent before a menu is drawn goes to the text box behind it (seen 2026-11-02 at the FRLG PC). A step that has no detector for the screen it needs stops instead of pressing blind. +- **Launch lab apps with `lab/scripts/start_dev.py`** (build, stage, run with the slot's + profile); never hand-build or launch a slot dir. Details in `skills/console-iteration` §0. +- **Unit tests run headless**: `SerialProgramsTests --filter ` (upstream #1845, in + `lab/main`). Never the GUI app's `--command-line-test-mode` on this Mac: with the default + settings it opens console A's serial port (2026-11-08, cut the user's live run). +- **Map fixes need the user's approval** with evidence: failure screenshot, one PNG of the + desired and the actual route drawn with PokemonSimulation's tools, the wrong tile and how + it bent the route (`skills/map-fix-evidence`). - **FRLG has one save slot.** Never rerun an earlier checkpoint on a save that is further along, and a failed step stops without saving. @@ -476,6 +484,8 @@ checkout of this branch; edit it here and PR the change, not the local copy. run one BDSP AutoStory checkpoint on console B, and judge it from log and screenshots. - [skills/map-route-verify/SKILL.md](skills/map-route-verify/SKILL.md): build a navigation grid from a map, plan a route on it and verify both on the console. +- [skills/map-fix-evidence/SKILL.md](skills/map-fix-evidence/SKILL.md): the evidence pack + the user approves a navigation map fix from. - [skills/cpp-style-review/SKILL.md](skills/cpp-style-review/SKILL.md): judgement-level C++ style review of a fork PR, against the user's own review themes. - [skills/codex-dispatch/SKILL.md](skills/codex-dispatch/SKILL.md): hand bounded tasks to Codex diff --git a/skills/console-iteration/SKILL.md b/skills/console-iteration/SKILL.md index 1ba9077f4f..d83d504925 100644 --- a/skills/console-iteration/SKILL.md +++ b/skills/console-iteration/SKILL.md @@ -16,6 +16,28 @@ batch can show. Map and route work follows the `map-route-verify` skill, console rules `bdsp-autostory-test`. This skill is the loop around them. +## 0. Launch, drive, test (current as of 2026-11-08) + +- **Launch only with** `python3 /lab/scripts/start_dev.py B`: it builds + `lab/dev-bdsp` in `~/Projects/dev-builds/slot-B`, stages, signs and runs with profile + lab-B, holding `~/.lab/locks/B`. Needs a clean worktree. Run it detached; the app is + ready when its log says `Lab: reading requests`. To relaunch, `kill -TERM` the slot-B + pid, then run start_dev again. Never hand-build or launch slot dirs. +- **Drive** from `/lab/control` with + `export LAB_CONSOLE=B LAB_PROFILE="$HOME/Library/Application Support/SerialPrograms/Profiles/lab-B" LAB_OWNER=lab-B LABLOCK_TOKEN=$(cat ~/.lab/locks/B/token)` + (`LAB_PROFILE` must be the full path). `labctl.sh state|select|start|stop`, + `printf ... | sh cfrun.sh NAME` (shots in `lab-B/Lab/outbox/`). +- **AutoStory range**: `START_CHECKPOINT` / `END_CHECKPOINT` under + `99-Panels["PokemonBDSP:AutoStory"].RUN` in the profile JSON (UTF-8 BOM). Edit it only + while the app is closed; `labctl set START_CHECKPOINT` fails. Indices shift when rows + are added: check the log's first `[Event]` line after `start`. +- **Unit tests**: the headless `SerialProgramsTests --filter ` (in `lab/main`), never + the GUI app's `--command-line-test-mode`: with default settings it opens console A's + serial port (2026-11-08, cut A's live run). +- **Watch a run** by polling `lab-B/Lab/state` and the log for `[Segment] ... failed`, + not by tail+grep (a tail monitor missed a failure for 25 min). +- **Map fixes** need the user's approval with the `map-fix-evidence` pack. + ## 1. Define a segment, then code it A segment (checkpoint) is **one map, or one story event**, never both: diff --git a/skills/map-fix-evidence/SKILL.md b/skills/map-fix-evidence/SKILL.md new file mode 100644 index 0000000000..98c5bf8b7c --- /dev/null +++ b/skills/map-fix-evidence/SKILL.md @@ -0,0 +1,63 @@ +--- +name: map-fix-evidence +description: Gate for any change to a navigation map (tile grid, walls, doors, map points, coordinates) in AutoStory (BDSP/FRLG) or PokemonSimulation. The user approves every map fix; this skill builds the evidence pack they need - failure-point screenshot, a PNG of the desired route and the actual walked route drawn with PokemonSimulation's tools, and the wrong tile marked with how it bent the route. Use whenever a console failure tempts the conclusion "the map is wrong", before editing any map data. +--- + +# Map fix evidence + +**The user approves every map fix.** A failed walk is first a route, +walk or perception problem; "the map is wrong" is a claim to prove, not +a conclusion to act on (2026-11-08: I called Oreburgh's Center door "one +column off" from two runs; the user was not convinced, rightly). Until +approved: no edits to map data, map points, grid files or sim maps. +A route change that stops depending on the doubtful tile (clip to walls) +is allowed meanwhile; say that it sidesteps, not fixes, the tile. + +## The pack (all four, or it is not evidence) + +1. **Failure-point screenshot**, shrunk (`sips -Z 640`), with a landmark in + view (door, sign, counter, rock). If the failure frame has none, take one + by hand on the CFR at the spot (see `console-iteration` recipes). Say in + one sentence where the player stands, from the landmark, not the code. +2. **Desired route PNG**: the route the table/planner meant, drawn on the + pinned map with PokemonSimulation's tool: + ```sh + cd ~/Projects/PokemonSimulation + PYTHONPATH=src python3 -m pokesim.cli.route --game bdsp --map OreburghCity \ + --start 45,57 --goal pokemon_center_doorstep --png /tmp/desired.png --svg /tmp/desired.svg + ``` + (`--goal` must be a stable tile, not a door/warp: use the doorstep. Runtime + maps live in `data/games//maps/runtime/`. `pokesim.cli.render` only + reads `pokenav-map/1` files.) If the table's legs differ from the planner's + route, draw the table's legs (waypoints from the log's `[Route] Leg` lines). +3. **Actual route** on the same map: the tiles the console really walked, + from the run log's legs plus the screenshot's end tile, in a second colour, + in one PNG with the desired route. `pokesim.cli.route` draws one planned + route; if it has no option for an extra walked path yet, add one in + PokemonSimulation (small PR there: `--actual x,y ...` drawn with + `route_drawing` helpers) rather than hand-drawing. +4. **The wrong tile**: mark it, and state in one or two lines how it bent + the route: "map has (46,20) as wall, so the plan ran north 36 'to the wall' + expecting a stop at row 21; the console walked through a door there." + Plus the measurement that proves the tile's true kind: a CFR batch (tap + into it, shot before/after; door = fade, wall = PSNR still) and, when the + map came from a decomp, the decomp line (`pret-decomp-maps` memory). + +Also check map frames: the AutoStory table's coordinates and the runtime +map's may differ by an offset; confirm a known point (a door, a sign) in +both before claiming a tile is wrong. + +## Hand-off + +Show the user: the screenshot, the one PNG (desired + actual + wrong tile), +the two-line claim, the measurement. Ask for approval of the map edit. +After approval: edit the map in the PR that owns the file +(`pr-owns-its-files`), add a sim/map test that fails on the old tile, and +link the pack (images on the agents notes branch run record) from the commit. + +## Not evidence + +- "The run went wrong near here." (could be drift, an NPC, a battle re-plan) +- One run. Two runs that disagree (one stopped at row 21, one walked through) + point at something moving (the hiker) before they point at the map. +- The sim agreeing: the sim uses the same map.