Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .agents/agents/autostory-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ without being restated.
- one file: `ninja -C SerialPrograms/build CMakeFiles/SerialProgramsLib.dir/Source/<path>.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 <suite text>` 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
Expand Down
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <text>` (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.

Expand Down Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions skills/console-iteration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <agents checkout>/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 `<agents checkout>/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 <text>` (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:
Expand Down
63 changes: 63 additions & 0 deletions skills/map-fix-evidence/SKILL.md
Original file line number Diff line number Diff line change
@@ -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/<game>/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.
Loading