diff --git a/AGENTS.md b/AGENTS.md index 25f6c7c70d..81a802ed2f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -315,6 +315,9 @@ change a reviewer will notice, so keep it where it clearly pays off. ### Plans and state: where to look first +- [autostory/PR_PLAN.md](autostory/PR_PLAN.md): how the AutoStory work (shared + navigation core, BDSP MVP, FRLG MVP) becomes three collector PRs and then upstream + PRs; live status in [autostory/PR_PROGRESS.md](autostory/PR_PROGRESS.md). - [pokemon_sv/MILESTONE_STATE.md](pokemon_sv/MILESTONE_STATE.md): current state of each milestone and the active lab run (owned by Codex). - [pokemon_sv/ROADMAP.md](pokemon_sv/ROADMAP.md): milestones ordered by payoff diff --git a/autostory/DEMO_PLAN.md b/autostory/DEMO_PLAN.md new file mode 100644 index 0000000000..52707390be --- /dev/null +++ b/autostory/DEMO_PLAN.md @@ -0,0 +1,132 @@ +# AutoStory: from proof of concept to demo PRs + +Written 2026-11-01 13:00. The user paused console work after FRLG's proof of concept: "next step +is to have demo PRs in good shape and have a full fledged plan". [PR_PLAN.md](PR_PLAN.md) has +the older collector plan and the file-ownership rules; this file replaces its tree and order of +work. + +Sizes per PR, and estimates for what remains: [FRLG_SIZING.md](FRLG_SIZING.md). + +The approach (map-based, story as event tables, checks, interrupts, tests) is in [AutoStory-Architecture.md](https://github.com/dayfine/Arduino-Source/blob/docs/autostory-architecture/docs/design/AutoStory-Architecture.md) ([#133](https://github.com/dayfine/Arduino-Source/pull/133)). + +## Where we are + +- **FRLG proof of concept.** New game to the Boulder Badge on console B, in pieces: + - 00.01–00.06 in the morning run; + - 00.07, 00.08 and 00.09 on 2026-11-01 between 11:15 and 12:05. + - Brock was beaten in 4 turns with HP green and no Potions used. + - It is not yet 3/3 from a new game in one run. +- **BDSP.** New game to Floaroma passed on the v3 line earlier, with [#1717](https://github.com/PokemonAutomation/Arduino-Source/pull/1717) underneath. It is + being rebuilt without [#1717](https://github.com/PokemonAutomation/Arduino-Source/pull/1717) as [#127](https://github.com/dayfine/Arduino-Source/pull/127) and [#128](https://github.com/dayfine/Arduino-Source/pull/128). +- **Known walker bug, FRLG.** A wild battle in the middle of a leg can leave the player a tile + off the leg's line. "Walking to the wall again" then stops at the wrong wall, and nothing + notices. This failed the forest gate 4 times. + - On the passing run, the battles happened on the line, so nothing went wrong. + - A wall-ending leg never checks how far it walked. +- **Story simulations pass on both games** but don't model the walker; see "Walker simulator". + +## Target shape (user approved 2026-11-01): one linear shared stack, then the games + +``` +upstream main (= fork main) +├─ #43 AutoStory: shared start/end select databases (SV refactor) +│ └─ #44 AutoStory: shared story index +│ └─ #45 AutoStory: AutoStoryStats to Pokemon/AutoStory +│ └─ #114 Pokemon navigation core: grid, leg planner, LegWalker, route log, JSON maps, +│ │ story events, ScreenMachine; walker simulator +│ └─ #122 shared story steps, retry policy, run options (checkpoint dropdowns from +│ │ #43/#44, stats from #45, Checks, language) +│ ├─ FRLG: #117 maps + planner → #118 walker → #119 recovery +│ │ → #120 FRLG AutoStory MVP, new game → Brock (#123 folded in) +│ └─ BDSP: maps-v4 (JSON maps only) → #127 story maps, route records +│ → #129 walker → [#128 split: actions, battle, inference] +│ → #128 BDSP AutoStory MVP, new game → Floaroma (table like FRLG's) +├─ #107 lab tooling → #116 run records +├─ #125 route pictures (devtools/maps) +└─ docs: #100 design → #130 FRLG events after Brock; #113 notes (this plan) +``` + +PR links: [#43](https://github.com/dayfine/Arduino-Source/pull/43), [#44](https://github.com/dayfine/Arduino-Source/pull/44), [#45](https://github.com/dayfine/Arduino-Source/pull/45), [#100](https://github.com/dayfine/Arduino-Source/pull/100), [#107](https://github.com/dayfine/Arduino-Source/pull/107), [#113](https://github.com/dayfine/Arduino-Source/pull/113), [#114](https://github.com/dayfine/Arduino-Source/pull/114), [#116](https://github.com/dayfine/Arduino-Source/pull/116), [#117](https://github.com/dayfine/Arduino-Source/pull/117), [#118](https://github.com/dayfine/Arduino-Source/pull/118), [#119](https://github.com/dayfine/Arduino-Source/pull/119), [#120](https://github.com/dayfine/Arduino-Source/pull/120), [#122](https://github.com/dayfine/Arduino-Source/pull/122), [#123](https://github.com/dayfine/Arduino-Source/pull/123), [#125](https://github.com/dayfine/Arduino-Source/pull/125), [#127](https://github.com/dayfine/Arduino-Source/pull/127), [#128](https://github.com/dayfine/Arduino-Source/pull/128), [#129](https://github.com/dayfine/Arduino-Source/pull/129), [#130](https://github.com/dayfine/Arduino-Source/pull/130). + +Superseded; the user closes them, with branches kept: +- BDSP: [#111](https://github.com/dayfine/Arduino-Source/pull/111), [#112](https://github.com/dayfine/Arduino-Source/pull/112), [#121](https://github.com/dayfine/Arduino-Source/pull/121), [#124](https://github.com/dayfine/Arduino-Source/pull/124), [#68](https://github.com/dayfine/Arduino-Source/pull/68), [#109](https://github.com/dayfine/Arduino-Source/pull/109), [#54](https://github.com/dayfine/Arduino-Source/pull/54) (the [#1717](https://github.com/PokemonAutomation/Arduino-Source/pull/1717) mirror). +- FRLG: [#67](https://github.com/dayfine/Arduino-Source/pull/67), [#123](https://github.com/dayfine/Arduino-Source/pull/123) (folded into [#120](https://github.com/dayfine/Arduino-Source/pull/120)). +- Docs: [#126](https://github.com/dayfine/Arduino-Source/pull/126) (moved to [#130](https://github.com/dayfine/Arduino-Source/pull/130)). + +Upstream order: [#43](https://github.com/dayfine/Arduino-Source/pull/43), [#44](https://github.com/dayfine/Arduino-Source/pull/44), [#45](https://github.com/dayfine/Arduino-Source/pull/45) (small SV refactors, a good first handoff), [#114](https://github.com/dayfine/Arduino-Source/pull/114)'s parts, [#122](https://github.com/dayfine/Arduino-Source/pull/122), FRLG, BDSP, then tooling. + +## What "good shape" means for each PR + +1. **Only its own files.** `git diff parent...child --stat` shows nothing from a parent. Shared + code lives in [#114](https://github.com/dayfine/Arduino-Source/pull/114) or [#122](https://github.com/dayfine/Arduino-Source/pull/122). +2. **Reviewable size.** One concern per PR, about 400 changed lines excluding map data and tests. + Data tables are initializer lists. `std::format` for messages. +3. **Tests.** + - Unit tests for the new code. + - The story simulation for the program PRs. + - The walker simulator for the nav PRs, once it exists. + - Fork CI green on Mac, Windows clang and Ubuntu. +4. **Description.** 2–5 sentences, "Depends on #N" at the top, and one sentence on what was + checked on the console. +5. **Console evidence.** The last console run that covers the PR, recorded in PR_PROGRESS.md. + +## Work, in order + +1. **Shared core settles ([#114](https://github.com/dayfine/Arduino-Source/pull/114), [#122](https://github.com/dayfine/Arduino-Source/pull/122)).** In progress, agent: + - LegWalker and the shared route log move into [#114](https://github.com/dayfine/Arduino-Source/pull/114) and merge down the FRLG stack. + - Decide: keep [#122](https://github.com/dayfine/Arduino-Source/pull/122) separate or fold it into [#114](https://github.com/dayfine/Arduino-Source/pull/114). Recommend separate: it is a different + concern and can go upstream after [#114](https://github.com/dayfine/Arduino-Source/pull/114). +2. **Walker simulator ([#114](https://github.com/dayfine/Arduino-Source/pull/114)) and the walker fixes ([#119](https://github.com/dayfine/Arduino-Source/pull/119)).** + - A grid world from the JSON maps that tracks the player's real tile and facing. + - Holds move one tile per tile time; walls, NPCs and warps stop the player. + - Seeded wild encounters on grass, with a detection lag; trainer sight from pokefirered. + - Assertion: every story route, across many seeds, ends on its planned tile or fails loudly. + - Model it on the measured behaviour: the m28 run's before/after screenshots of every step, + `DebugDumps/AutoStory/legs`. + - Then fix [#119](https://github.com/dayfine/Arduino-Source/pull/119) against the failing simulated cases: + - the drift after a battle; + - a wall leg that stops far short of its length fails with a screenshot. +3. **FRLG stack in shape ([#117](https://github.com/dayfine/Arduino-Source/pull/117)–[#120](https://github.com/dayfine/Arduino-Source/pull/120)).** + - Fold [#123](https://github.com/dayfine/Arduino-Source/pull/123) into [#120](https://github.com/dayfine/Arduino-Source/pull/120). + - [#120](https://github.com/dayfine/Arduino-Source/pull/120) keeps the 00.07/00.08 split, the save-card check on load, the Checks level and + language-free reads. + - Review each PR against "good shape". Check that [#117](https://github.com/dayfine/Arduino-Source/pull/117)'s route tests run in CI (maps are + built in from [#118](https://github.com/dayfine/Arduino-Source/pull/118); decide whether to fold [#118](https://github.com/dayfine/Arduino-Source/pull/118)'s maps into [#117](https://github.com/dayfine/Arduino-Source/pull/117)). +4. **BDSP stack in shape ([#127](https://github.com/dayfine/Arduino-Source/pull/127), [#128](https://github.com/dayfine/Arduino-Source/pull/128)).** In progress, agent: + - The walker moves to [#127](https://github.com/dayfine/Arduino-Source/pull/127) with battle handling injected. + - Recorded stick holds are replaced by planned walks where maps exist. + - The simulation runs 00.00 → Floaroma in English and in Japanese. +5. **Console verification, after 2–4.** One train at a time on console B: + - FRLG 3/3 new game → Brock in one run each. + - BDSP v4 new game → Floaroma, 3/3, first on the replaced 00.00–00.05 walks. + - Each run gets route pictures ([#125](https://github.com/dayfine/Arduino-Source/pull/125)) and a run record ([#116](https://github.com/dayfine/Arduino-Source/pull/116)). +6. **Tooling PRs.** + - [#116](https://github.com/dayfine/Arduino-Source/pull/116): retitle it as run records, attach route pictures to failed runs. + - [#125](https://github.com/dayfine/Arduino-Source/pull/125): render route pictures as CI artifacts from the offline route tests. Not goldens. +7. **Gameplay plan (design; the user decides the targets).** + - Trainer sight, facing and type in the map schema; the planner scores sight lines and grass. + - Level targets per checkpoint. FRLG Squirtle, from the 2015 speedrun guide: 6 after Route 1, + 8 after the forest, 10 for Liam, 11 for Brock. + - Sammy is the only planned forest trainer. + - **Run modes (user, 2026-11-01):** SPEEDRUN / DEFAULT / SAFE. Strategy only (which + battles to take, flee or fight wild Pokémon, heal threshold, what to buy and when); the Checks + level (Thorough/Fast, screen verification) stays a separate option. SPEEDRUN follows + pokeguy's LeafGreen 1:59:34 (`pokemon_sv/FRLG_POKEGUY_15934_VIDEO_NOTES.md` on agents): + no Viridian shopping, flee every forest wild battle, Sammy L7→8, Liam to L11, Brock at + L11 with no Potion (survives at 1 HP), Water Gun at L13, first shopping in Pewter. + DEFAULT is today's table. SAFE heals at a threshold and takes extra wild battles to reach + the level targets. Not built now; the table should name these choices so a mode can + switch them. +8. **Upstream handoff (the user publishes; at most two open upstream).** + - Order: [#114](https://github.com/dayfine/Arduino-Source/pull/114)'s parts (grid and planner, ScreenMachine, story events and maps), then [#122](https://github.com/dayfine/Arduino-Source/pull/122), + then FRLG [#117](https://github.com/dayfine/Arduino-Source/pull/117) → [#120](https://github.com/dayfine/Arduino-Source/pull/120), then BDSP [#127](https://github.com/dayfine/Arduino-Source/pull/127) → [#128](https://github.com/dayfine/Arduino-Source/pull/128), then the tooling. + - Each is folded to one commit per upstream PR when handed over. + +## Decisions needed from the user + +- Fold [#123](https://github.com/dayfine/Arduino-Source/pull/123) into [#120](https://github.com/dayfine/Arduino-Source/pull/120) (recommended), or keep it as its own PR. +- Keep [#122](https://github.com/dayfine/Arduino-Source/pull/122) separate from [#114](https://github.com/dayfine/Arduino-Source/pull/114) (recommended), or fold it in. +- Fold [#118](https://github.com/dayfine/Arduino-Source/pull/118)'s built-in maps into [#117](https://github.com/dayfine/Arduino-Source/pull/117) so [#117](https://github.com/dayfine/Arduino-Source/pull/117)'s route tests run in CI. +- Close the superseded PRs listed above once [#127](https://github.com/dayfine/Arduino-Source/pull/127)/#128 and the FRLG stack are in shape. +- Level targets and the trainer list per checkpoint. +- When to resume console runs: after steps 2–4, as proposed. diff --git a/autostory/FRLG_SIZING.md b/autostory/FRLG_SIZING.md new file mode 100644 index 0000000000..accebdd35c --- /dev/null +++ b/autostory/FRLG_SIZING.md @@ -0,0 +1,178 @@ +# FRLG AutoStory: code size by PR, and what remains + +Measured on 2026-11-01 at about 13:10, as `git diff --numstat parent...child` on the fork branches. +"Code" excludes tests, map data (JSON), docs and cmake. The FRLG chain is being restacked, so these +shapes are close to final, not final. The plan and PR tree are in [DEMO_PLAN.md](DEMO_PLAN.md). + +## 1. Prep work (small refactors before the shared core) + +| PR | What | Code | Tests | +|---|---|---|---| +| [#43](https://github.com/dayfine/Arduino-Source/pull/43) | Shared start/end checkpoint dropdowns (SV refactor) | 56 | 0 | +| [#44](https://github.com/dayfine/Arduino-Source/pull/44) | Shared story index | 33 | 99 | +| [#45](https://github.com/dayfine/Arduino-Source/pull/45) | AutoStoryStats moved to Pokemon/AutoStory | 38 | 0 | +| **Total** | Ready to send upstream first | **127** | **99** | + +Outside the chain but related: [#86](https://github.com/dayfine/Arduino-Source/pull/86) FRLG bag detector tests, and [#61](https://github.com/dayfine/Arduino-Source/pull/61) FRLG party check (240 code, +263 tests), which belongs with the RNG work. + +## 2. Shared navigation and map infrastructure ([#114](https://github.com/dayfine/Arduino-Source/pull/114)) + +| Part | Code | Tests | +|---|---|---| +| Grid, route planner, LegWalker, MapData/JSON maps, route log, tile poses, map embedding | 1,813 | 1,010 | +| ScreenMachine / StepTrace | 329 | 0 | +| Shared route log (`Pokemon_RouteLog`: plan, step results, stops, re-anchors, arrivals; BDSP's lines lifted as they were) | incl. above | incl. above | +| **[#114](https://github.com/dayfine/Arduino-Source/pull/114) navigation part** | **~2,140** | **~1,010** (+151 lines of test maps) | + +Logging is split across the two halves: +- **Route log** (`Pokemon_RouteLog` in [#114](https://github.com/dayfine/Arduino-Source/pull/114)): one line format for a route walk in both games. FRLG calls it from 4 files on [#120](https://github.com/dayfine/Arduino-Source/pull/120)'s branch, BDSP from its walker in [#129](https://github.com/dayfine/Arduino-Source/pull/129). +- **Checkpoint and event log** (`[Segment]`, `[Checkpoint]`, `[Event]` in [#114](https://github.com/dayfine/Arduino-Source/pull/114)'s StoryEvents): shared by both games already. +- **Gap:** the route log is grid-bound: tiles, directions, tile counts. 3D games (SV, LA) have route legs too, but no tiles. Planned fix: a grid-free core (leg label, target, how it ended, how the end is known, and an optional position the game formats) with the grid lines as one form of it. The same records become [#116](https://github.com/dayfine/Arduino-Source/pull/116)'s run events, so the log and the run record carry one format. + +## 3. Shared AutoStory infrastructure + +| PR | What | Code | Tests | +|---|---|---|---| +| [#114](https://github.com/dayfine/Arduino-Source/pull/114) (story part) | Story events and segments as tables | 1,021 | 966 | +| [#122](https://github.com/dayfine/Arduino-Source/pull/122) | Shared story steps, retry policy, run options (Checks, language, dropdowns, stats) | 838 | 637 | +| **Total** | | **~1,860** | **~1,600** | + +[#114](https://github.com/dayfine/Arduino-Source/pull/114) holds both the navigation and the story-event code (~3.2k code). Upstream it could be split +in two: navigation first, then story events. + +## 4. FRLG game program (the MVP) + +| PR | What | Code | Tests | Map data | +|---|---|---|---|---| +| [#117](https://github.com/dayfine/Arduino-Source/pull/117) | FRLG maps (generator + 25 JSON maps) and route planning | 3,249 | 821 | 3,194 | +| [#118](https://github.com/dayfine/Arduino-Source/pull/118) | FRLG walker: steps, warps, grass, signs, ledges | 690 | 0 | | +| [#119](https://github.com/dayfine/Arduino-Source/pull/119) | Finding the player again after an interrupted step | 739 | 436 | | +| [#120](https://github.com/dayfine/Arduino-Source/pull/120) | FRLG AutoStory, new game → Brock: table, Mart and bag checks, save check, simulation | 3,124 | 837 | | +| **Total** | | **~7,800** | **~2,100** | **3,194** | + +[#123](https://github.com/dayfine/Arduino-Source/pull/123) is fully merged into [#120](https://github.com/dayfine/Arduino-Source/pull/120), shows no diff, and can be closed. [#117](https://github.com/dayfine/Arduino-Source/pull/117) is large; splitting the +generator and maps from the planner is an option. + +## 5. Still needed for the MVP (estimates) + +| # | PR | Where | Size (code + tests) | +|---|---|---|---| +| a | (moved to a parallel track: the game simulator) | [#114](https://github.com/dayfine/Arduino-Source/pull/114) | ~400 + 400 | +| b | Walker fixes: drift after battles; fail a wall step that stops far short | [#119](https://github.com/dayfine/Arduino-Source/pull/119) | ~150 + 200 | +| c | Run-record recorder (framework half of [#116](https://github.com/dayfine/Arduino-Source/pull/116)) | new PR on main | ~630 incl. tests | +| d | Run-event hooks: shared code and FRLG | [#114](https://github.com/dayfine/Arduino-Source/pull/114), [#120](https://github.com/dayfine/Arduino-Source/pull/120) | ~150 + 100 | +| e | Optionally split [#117](https://github.com/dayfine/Arduino-Source/pull/117): maps and generator vs planner | existing code | 0 new | +| | **Total** | 2–3 new PRs plus commits on existing ones | **~1.3k code + ~1k tests** | + +Then the console check: FRLG 3/3, new game → Brock, in one run each. + +## 6. Later features (rough estimates) + +| Feature | PRs | Code + tests | Notes | +|---|---|---|---| +| Run modes SPEEDRUN / DEFAULT / SAFE | 3 | ~1.0k + 0.6k | (1) the mode option and strategy in [#122](https://github.com/dayfine/Arduino-Source/pull/122); (2) FRLG level and party reading; (3) the FRLG speedrun route (no Viridian shopping, flee wild battles, Sammy only, Brock at level 11; pokeguy's 1:59:34 notes on the agents branch) | +| Trainer sight and level targets | 2 | ~0.6k + 0.4k | Trainer type, sight and facing in the map schema and generator; the planner scores sight lines and grass | +| RNG program integration | 2–3 | ~0.8k + 0.4k | AutoStory stops at a checkpoint and hands off to the RNG programs ([#61](https://github.com/dayfine/Arduino-Source/pull/61), Ten Lines seeds), then resumes the story | +| Mail glitch / ACE and detours | 3–4 | ~1.5k + 0.6k | Builds on [#81](https://github.com/dayfine/Arduino-Source/pull/81)'s naming-screen typer (722 code, 345 tests): mail-screen typing, the payload with verification, story detours to get the mail | +| Story after Brock ([#130](https://github.com/dayfine/Arduino-Source/pull/130)'s outline, 92 rows) | ~10–15 | ~8–12k + 3–4k | About one PR per segment, 500–1,000 lines each, plus new event types (HMs, puzzles, the Silph Scope) | + + +## How the current PRs break up for upstream + +Each fork PR above is a collector; upstream gets smaller PRs of about 400 changed lines of code or +less (tests and map data not counted), one concern each. + +| Fork PR | Upstream PRs | Split | +|---|---|---| +| [#43](https://github.com/dayfine/Arduino-Source/pull/43)–[#45](https://github.com/dayfine/Arduino-Source/pull/45) | 2–3 | [#43](https://github.com/dayfine/Arduino-Source/pull/43) with its own test; [#44](https://github.com/dayfine/Arduino-Source/pull/44); [#45](https://github.com/dayfine/Arduino-Source/pull/45) (or [#43](https://github.com/dayfine/Arduino-Source/pull/43)+[#44](https://github.com/dayfine/Arduino-Source/pull/44) as one) | +| [#114](https://github.com/dayfine/Arduino-Source/pull/114) | 5 | grid and route planner; ScreenMachine/StepTrace; MapData, JSON maps and embedding; LegWalker and the route log; story events and segments | +| [#122](https://github.com/dayfine/Arduino-Source/pull/122) | 2 | story steps and their builder; run options (dropdowns, stats, Checks, language) | +| [#117](https://github.com/dayfine/Arduino-Source/pull/117) | 2 | FRLG map generator and JSON maps (data); FRLG route planning and the facing reader | +| [#118](https://github.com/dayfine/Arduino-Source/pull/118) | 1 | the FRLG walker | +| [#119](https://github.com/dayfine/Arduino-Source/pull/119) | 1 | finding the player again | +| [#120](https://github.com/dayfine/Arduino-Source/pull/120) | 3 | program and story table with the simulation; Mart and bag checks; save-card check and language-free reads | +| MVP remainder (section 5) | 3–4 | walker simulator; walker fixes; run-record recorder; run-event hooks | +| **FRLG path total** | **~19–21** | upstream allows two open at a time, so this is a long serial queue | + +Tooling splits too: [#107](https://github.com/dayfine/Arduino-Source/pull/107) into about 3, [#116](https://github.com/dayfine/Arduino-Source/pull/116) into about 3, [#125](https://github.com/dayfine/Arduino-Source/pull/125) into 1–2, [#131](https://github.com/dayfine/Arduino-Source/pull/131) into about 7. + + +## Upstream PR tree and queue for the FRLG path + +Each upstream PR is cut from the fork collector named in brackets. Upstream allows two open PRs +from us at a time, so the queue runs about two deep. Sizes are code lines, with tests in brackets. + +``` +upstream main +U1 AutoStory: shared start/end select database (+ its test) [#43] ~60 (+40) +└ U2 AutoStory: shared story index [#44] ~35 (+60) + └ U3 AutoStory: AutoStoryStats to Pokemon/AutoStory (move) [#45] ~40 + └ U4 Pokemon navigation: grid types + leg planner [#114] ~600 (+370) + ├ U5 ScreenMachine + StepTrace [#114] ~330 + └ U6 Map data: JSON maps, schema, loader, CMake embedding [#114] ~450 (+240, test maps) + └ U7 LegWalker + shared route log [#114] ~430 (+370) + └ U8 Story events and segments (checkpoint/event log) [#114] ~1,000 (+970) split 2 if asked + └ U9 Story steps + builder + executor interface [#122] ~500 (+400) + └ U10 Story run options: dropdowns, stats, checks, language [#122] ~340 (+240) + └ U11 FRLG: map generator + 25 JSON maps (data) [#117] ~200 (+3.2k data) + └ U12 FRLG: route planning + facing reader [#117] ~3,000 (+820) split 2-3 + └ U13 FRLG: walker (steps, warps, grass, signs, ledges) [#118] ~690 + └ U14 FRLG: find the player again [#119] ~740 (+440) + └ U15 Walker simulator (believed vs real tile) [new, [#114](https://github.com/dayfine/Arduino-Source/pull/114)] ~400 (+400) + └ U16 Walker fixes: drift, short wall steps [new, [#119](https://github.com/dayfine/Arduino-Source/pull/119)] ~150 (+200) + └ U17 FRLG AutoStory: program, table, simulation [#120] ~1,600 (+500) + ├ U18 FRLG: Mart and bag checks [#120] ~800 (+200) + └ U19 FRLG: save-card check, language-free reads [#120] ~700 (+140) +side branch from main: +U20 Run records: recorder (framework half of [#116](https://github.com/dayfine/Arduino-Source/pull/116)) [new] ~450 (+180) +└ U21 Run-event hooks in story events and FRLG [new] ~150 (+100) +``` + +U12 is the one PR far over the ~400-line target. It should split into the planner and the +facing reader, maybe three PRs, once its code is reviewed. U8 may need the same. + +**Queue** (two open at a time; the next opens when one merges): + +| Slot | Order | Notes | +|---|---|---| +| 1 | U1 → U2 → U3 | small, refactor-only, SV-only: the first handoff | +| 2 | U20 alongside U1–U3 | independent of the AutoStory chain | +| then | U4 → U5/U6 → U7 → U8 | the navigation core; U5 can go in parallel with U6 | +| then | U9 → U10 | the shared story steps | +| then | U11 → U12 → U13 → U14 | FRLG navigation | +| then | U16 | the walker check (fails a wall step that stopped short) and fixes | +| last | U17 → U18/U19, U21 | the FRLG MVP program; U18 and U19 can go in parallel | + +That's 21 PRs, at roughly one merged per week if review keeps up: a few months of queue. The +shape lets each PR be reviewed alone, and the FRLG MVP only lands at the end. + +### Parallel tracks (independent of the U1–U19 chain) + +These are based on main, not on the AutoStory chain, so they can be worked on and sent upstream in parallel: + +| Track | PRs | What | Joins the chain at | +|---|---|---|---| +| Naming / keyboards | [#81](https://github.com/dayfine/Arduino-Source/pull/81) FRLG naming-screen typer (722 code, 345 tests); [#62](https://github.com/dayfine/Arduino-Source/pull/62) Switch on-screen keyboard (BDSP names) | Type "Kosmos" and nicknames instead of picking a preset name | FRLG 00.01 (player and rival names) after U17; BDSP intro on [#128](https://github.com/dayfine/Arduino-Source/pull/128) | +| Starter RNG | [#61](https://github.com/dayfine/Arduino-Source/pull/61) party check (240 code, 263 tests) + a starter-RNG entry point (~300) | Use the existing FRLG GiftRng (starters are gifts) from AutoStory's save in front of Oak's table | a hand-off after 00.03/00.04 once U17 lands; the RNG program itself can be built and tested now from a manual save | +| Game simulator | 2 PRs: (1) encounters, Repel, position; (2) HP, status, EXP, moves, whiteout, run-mode statistics | Seeded fake game with odds from the decomp; catches drift, exercises rare paths, sets level targets (architecture doc section 6a) | not blocking; core ~1.2k + 0.6k tests, per game ~0.5k + data | +| Run records | U20 [#132](https://github.com/dayfine/Arduino-Source/pull/132) → U21 | Recorder, then hooks | U21 needs U8 and U17 | +| Tooling | [#107](https://github.com/dayfine/Arduino-Source/pull/107) → [#116](https://github.com/dayfine/Arduino-Source/pull/116), [#125](https://github.com/dayfine/Arduino-Source/pull/125), [#131](https://github.com/dayfine/Arduino-Source/pull/131) | Lab channel, run records, route pictures, lab CLI | none (dev only) | +| BDSP | maps-v4 → [#127](https://github.com/dayfine/Arduino-Source/pull/127) → [#129](https://github.com/dayfine/Arduino-Source/pull/129) → [#128](https://github.com/dayfine/Arduino-Source/pull/128) | BDSP AutoStory v4 | after U10 | + +With 3–4 upstream slots, a sensible mix is one slot for the chain, one for naming/RNG, and one for tooling or run records. + +## Tooling, used by both games + +| PR | What | Size | +|---|---|---| +| [#107](https://github.com/dayfine/Arduino-Source/pull/107) | Lab tooling: lab channel, Command File Runner, scripts | 2.4k code, 0.5k tests | +| [#116](https://github.com/dayfine/Arduino-Source/pull/116) | Run records, about 3 PRs | ~1.5k | +| [#125](https://github.com/dayfine/Arduino-Source/pull/125) | Route pictures (devtools/maps, Python) | 1.5k code, 0.4k tests | +| [#131](https://github.com/dayfine/Arduino-Source/pull/131) | Agent integration: one lab CLI, MCP later; about 7 PRs | ~2k | + +## Summary + +The FRLG MVP is about 7.8k lines of game code on about 4.1k of shared code (navigation 2.1k plus +story engine 1.9k), with about 3.8k lines of tests. Finishing it needs roughly 1.3k more code plus +tests and one 3/3 console run. diff --git a/autostory/MILESTONES.md b/autostory/MILESTONES.md new file mode 100644 index 0000000000..9a3774a266 --- /dev/null +++ b/autostory/MILESTONES.md @@ -0,0 +1,87 @@ +# AutoStory milestones and issue drafts + +Drafts for one master tracking issue and one issue per milestone. They're not filed yet: where to +file them (upstream PokemonAutomation/Arduino-Source or the fork) is the user's call, and upstream +text is shown to the user before posting. Design: [AutoStory-Architecture.md](https://github.com/dayfine/Arduino-Source/blob/docs/autostory-architecture/docs/design/AutoStory-Architecture.md). +PR tree and sizes: [FRLG_SIZING.md](FRLG_SIZING.md), [DEMO_PLAN.md](DEMO_PLAN.md). + +## Master issue (draft) + +**Title:** AutoStory for FRLG and BDSP: map-based story programs (tracking) + +> This tracks a shared AutoStory engine for 2D-movement Pokemon games: story beats as tables, movement planned on maps generated from the decomps, every step checked on screen, and checkpoints that save and retry. FireRed reached the Boulder Badge from a new game on a Switch as a proof of concept; BDSP from a new game to Floaroma is being rebuilt on the same engine. Work lands as a queue of small PRs, two open at a time; each milestone below has its own issue with scope, PRs and the done check. +> +> - [ ] M1 Shared AutoStory and navigation core +> - [ ] M2 FireRed MVP: new game → Boulder Badge +> - [ ] M3 BDSP MVP: new game → Floaroma +> - [ ] M4 Run evidence and lab tooling +> - [ ] M5 Game simulator +> - [ ] M6 Run modes, trainer sight and level targets +> - [ ] M7 Names and starter RNG +> - [ ] M8 FireRed end to end: new game → Hall of Fame +> - [ ] M9 Other games: grid-free routes for 3D titles (later) +> - [ ] M10 FireRed end to end with options: other starters, choices, optional tasks +> - [ ] M11 FireRed end to end with the Sevii Islands and Mewtwo +> - [ ] M12 Full RNG integration + +## M1 Shared AutoStory and navigation core +- **Scope:** shared select database, story index and stats (SV refactors), grid and route planner, ScreenMachine/StepTrace, JSON maps and loader, LegWalker and the route log, story events and segments, story steps and run options (checkpoint dropdowns, Checks, language, attempts). +- **PRs:** U1–U10, from fork [#43](https://github.com/dayfine/Arduino-Source/pull/43), [#44](https://github.com/dayfine/Arduino-Source/pull/44), [#45](https://github.com/dayfine/Arduino-Source/pull/45), [#114](https://github.com/dayfine/Arduino-Source/pull/114), [#122](https://github.com/dayfine/Arduino-Source/pull/122). About 5k code, 3.3k tests. +- **Done when:** all merged upstream, with unit tests green on three platforms. No game behaviour changes except SV's dropdowns, which keep the same labels. +- **Follow-ups:** a joined multi-map view and coord events in the map schema (requested by BDSP). + +## M2 FireRed MVP: new game → Boulder Badge +- **Scope:** FRLG maps generated from pret/pokefirered (25 maps), route planning, the walker with interrupts and recovery, a position check that fails a wall step that stopped short, and the AutoStory program and table (00.01–00.09, with Mart and bag checks, the save-place check and language-free reads). +- **PRs:** U11–U19, from fork [#117](https://github.com/dayfine/Arduino-Source/pull/117), [#118](https://github.com/dayfine/Arduino-Source/pull/118), [#119](https://github.com/dayfine/Arduino-Source/pull/119), [#120](https://github.com/dayfine/Arduino-Source/pull/120). About 7.8k code, 2.1k tests, 3.2k map data. +- **Done when:** the story simulation passes, and the console goes 3/3 from a new game to Brock in one run each, with run records. +- **Known issue:** forest-gate position drift (4 failures on 2026-11-01, not reproduced in 52 legs); the position check catches the next one. + +## M3 BDSP MVP: new game → Floaroma +- **Scope:** BDSP JSON maps from pret/pokeplatinum, including interiors; story maps; the walker; actions, battle and screen readers; and the program with an FRLG-style table. No dependency on PokemonAutomation#1717; the pieces kept from it are credited. +- **PRs:** bdsp/maps-v4 → [#127](https://github.com/dayfine/Arduino-Source/pull/127) → [#129](https://github.com/dayfine/Arduino-Source/pull/129) → bdsp/actions-v4 → [#128](https://github.com/dayfine/Arduino-Source/pull/128). Replaces fork #111, #112, #121 and #124. +- **Done when:** the simulation passes in English and Japanese, and the console goes 3/3 from a new game (00.01–00.05 are new planned walks and need console proof). + +## M4 Run evidence and lab tooling +- **Scope:** run records (one folder per run: log, events, frames of failed attempts, build info), run-event hooks, route pictures (planned vs walked), the lab channel, and one lab CLI with guards (MCP optional later). Also the lab-channel fix: a window focus change cancels holds. +- **PRs:** [#132](https://github.com/dayfine/Arduino-Source/pull/132) (recorder), [#116](https://github.com/dayfine/Arduino-Source/pull/116) (lab half), [#107](https://github.com/dayfine/Arduino-Source/pull/107), [#125](https://github.com/dayfine/Arduino-Source/pull/125), [#131](https://github.com/dayfine/Arduino-Source/pull/131). +- **Done when:** a failed AutoStory run leaves a record with the failing attempt's frame, and a route picture can be drawn from that record. + +## M5 Game simulator +- **Scope:** a seeded fake game with odds from the decomp: encounters, Repel, battles (HP, status, EXP, level-ups, learn-move prompts), trainers, whiteouts, and the battle-detection lag. +- **PRs:** 2 (encounters, Repel and position; then the full battle model and run-mode statistics). About 1.2k code, 0.6k tests for the core, plus about 0.5k and data per game. +- **Done when:** every story route runs across 1,000+ seeds with no silent position errors, and per-checkpoint statistics are produced. Doesn't block M2 or M3. + +## M6 Run modes, trainer sight and level targets +- **Scope:** SPEEDRUN, DEFAULT and SAFE run modes (separate from Checks), trainer type, sight and facing in the map schema, the planner avoiding or seeking trainers, level targets per checkpoint, and the FRLG speedrun route (after pokeguy's LeafGreen 1:59:34). +- **PRs:** about 5. About 1.6k code, 1k tests. +- **Done when:** FRLG reaches Brock in each mode on the console, and the simulator's statistics match. + +## M7 Names and starter RNG +- **Scope:** typing names (FRLG naming screen [#81](https://github.com/dayfine/Arduino-Source/pull/81); BDSP Switch keyboard [#62](https://github.com/dayfine/Arduino-Source/pull/62)), with "Kosmos" as the lab default; and a starter-RNG hand-off from AutoStory to the FRLG gift RNG program ([#61](https://github.com/dayfine/Arduino-Source/pull/61) party check, plus an entry point). +- **PRs:** about 4–5. Can start now; it joins the story program after M2. +- **Done when:** AutoStory names the player and gets an RNG'd starter, then continues to Brock. + +## M8 FireRed end to end: new game → Hall of Fame +- **Scope:** segments from Pewter to the Hall of Fame, following the outline in [#130](https://github.com/dayfine/Arduino-Source/pull/130) (92 rows). Needs HMs and field moves, puzzles, party management, and the Silph Scope and Poke Flute events. +- **PRs:** about 10–15, one per segment. About 8–12k code, 3–4k tests. +- **Reuse:** the Elite Four and Champion segment builds on `EliteFourFarmer` and `PokemonLeagueDetectors`. +- **Done when:** each segment passes 3/3 on the console, and one run goes from a new game to the Hall of Fame with default choices. + +## M9 Other games (later) +- **Scope:** a grid-free route log and position type, and adapters for 3D games (SwSh, LA) on the same story engine. +- **Done when:** one 3D-game segment runs on the shared steps. + +## M10 FireRed end to end with options +- **Scope:** table rows that branch on a choice: the other two starters (rival teams change), gift picks such as the Mt. Moon fossil, and optional tasks (extra catches, items, side areas) a run can switch on. +- **PRs:** about 4–6, after M8. +- **Done when:** a new game → Hall of Fame run passes with each starter, and each optional task passes 3/3 in its segment. + +## M11 FireRed end to end with the Sevii Islands and Mewtwo +- **Scope:** the post-game story (Islands One to Seven, the Ruby and Sapphire, the Network Machine) and Cerulean Cave up to Mewtwo. +- **PRs:** about 6–8, after M8. Sevii maps come from the same pret/pokefirered generator. +- **Done when:** one run goes from the Hall of Fame save to Mewtwo caught, with each segment 3/3. + +## M12 Full RNG integration +- **Scope:** every RNG-able Pokemon on the way can be RNG'd in place: starter (M7), gifts (Lapras, Eevee, fossils), statics (Snorlax, legendary birds, Mewtwo) and the roaming dog, through `StarterRng`, `GiftRng`, `StaticRng`, `RoamingLegendaryRng` and the RNG navigation. AutoStory walks there and saves, the RNG program runs, AutoStory continues. Routines locked in program classes move to callable functions in small upstream PRs first. +- **PRs:** about 5–8, after M7; the post-game targets after M11. +- **Done when:** a full run with RNG switched on ends with each targeted Pokemon matching its RNG target. diff --git a/autostory/PR_PLAN.md b/autostory/PR_PLAN.md new file mode 100644 index 0000000000..e75a456d0b --- /dev/null +++ b/autostory/PR_PLAN.md @@ -0,0 +1,176 @@ +# AutoStory work → upstream PRs: the three collectors + +> **Superseded on 2026-11-01 13:00 by [DEMO_PLAN.md](DEMO_PLAN.md)** for the tree and order of work. The file-ownership rules and map notes below still hold. + +Written 2026-11-01 (user decisions of that day are in "Decisions"). Live status is in +[PR_PROGRESS.md](PR_PROGRESS.md). The BBQ equivalent is +[../pokemon_sv/PR_PLAN.md](../pokemon_sv/PR_PLAN.md); the rules for where PRs live are in +[../pokemon_sv/PR_WORKFLOW.md](../pokemon_sv/PR_WORKFLOW.md). + +## Goal + +Three fork PRs, each in the shape of fork #107 (a "collector"): a branch on a `base/*` copy +of upstream main, whose commits are the future upstream PRs, one concern each, in the order +they would go upstream. + +1. **Shared core** (`nav/shared`): what FRLG and BDSP both plan and run on. +2. **BDSP MVP** (`bdsp/mvp`): new game to Floaroma, minus the shared core, on Butters' #1717. +3. **FRLG MVP** (`frlg/mvp`): overworld navigation to Brock, minus the shared core. + +## Ground rules + +- **Rebuild from the existing PRs, do not merge their histories.** Each collector commit is the + source PR's three-dot diff (`git diff base...head`) applied on the collector, so + `git range-diff` against the source branch shows only the shared cmake and test-runner lines. +- **One commit = one future upstream PR**, about 400 changed lines or fewer where the code + allows it; map data and tests do not count. Commit titles are the PR titles. +- **The base is upstream main**, not fork main: `base/upstream-main` is a plain copy + (fast-forwarded, never rebased). BDSP's base adds Butters' #1717 head on top. +- **Upstream is serial**: at most two open there; the user publishes. Collectors and their + source PRs are fork drafts. Superseded PRs are closed by the user, not by an agent. +- **CRLF files stay CRLF** (`SerialPrograms/cmake/SourceFiles.cmake`, + `ComputerPrograms_UnitTestRunner.cpp`, most of CommonFramework). A diff the length of the + file is a line-ending accident. +- **`std::format` for multi-part messages** (AGENTS.md C++ style). Our code had none and + ~130 `std::to_string` chains; each collector commit converts its own sites with identical + output text (user, 2026-11-01). Butters' #1717 code is left as is. +- **Go slowly**: each collector is shown to the user before the next one starts. + +## Tree + +``` +base/upstream-main (copy of upstream main; refreshed to b3673f2a9 on 2026-11-01) +├── nav/shared = fork #114 (7008f8c67) ... collector 1, supersedes #72 #66 #108 #79 +│ S1 Common: MoveOnlyFunction ✅ merged upstream as #1810 (2026-11-01); nav/shared +│ merges the base back in, so S1 drops out of the diff +│ S2 Pokemon navigation: grid types + leg planner (#66, +733, 7 files) +│ S3 ScreenMachine + StepTrace (#108, +333, 5 files) +│ S4 Pokemon navigation: story checkpoints as events (#79, ~+1200, 6 files) +│ + story events take a game-defined position, a segment is a table of event +│ checkpoints, one JSON map schema and loader for both games (MapData, +│ StorySegments, TilePose) +│ S5 7008f8c67 Pokemon navigation: weigh open stops after a wild step (Step::wild, +│ Leg::wild, LegCosts::per_open_wild_stop, default 0; 4 toy-grid tests). Moved +│ from #119 (b4d1976a3) on 2026-11-01 +│ +│ ├── frlg/mvp = fork #117 (20291b6c8, merges nav/shared 7008f8c67) ... collector 3, +│ │ supersedes #67; F1–F6 as before, +3304 over nav/shared, 21 files +│ │ F0 BagDetector fix: dropped, already upstream (#1771) +│ │ F1 cc3450b8a devtools: generate FRLG overworld maps as JSON from pokefirered (+203) +│ │ F2 e770e3fa7 FRLG: overworld maps as plain data (tiles, grid, named points, flags) (+978) +│ │ F3 d0bb032e7 FRLG: plan overworld routes with the shared leg planner (+835) +│ │ F4 b734805ce Pokemon navigation: leg walker with game-supplied movers/interrupts (+465) +│ │ F5 6952e6c5a FRLG: read which way the standing player faces (+314) +│ │ F6 ab9a22e0b FRLG: walk overworld routes with the leg walker (+ BattleFlashWatcher) (+509) +│ │ └── #118 frlg/walk-wild-legs (d1afca983) ... wild legs 43ac578a0, signs f11a56672; +│ │ 7 FRLG Overworld files + frlg_maps.py, +139/−23 +│ │ └── #119 frlg/walk-interrupt-recount (08829d226) ... walker fixes from the Viridian +│ │ runs: open wild legs a tile at a time, ledge stops, overworld check, warp fade +│ │ vs battle, trainer battles, re-anchoring after a stopped leg. 12 files, +│ │ +1322/−78: FRLG Overworld + LegWalker (see "Who owns which file") +│ │ └── #120 frlg/autostory-mvp ... PokemonFRLG AutoStory, 00.01–00.08 new game → +│ │ Brock. Diff is PokemonFRLG only (19 files, AutoStory + BattleScreenDetector, +│ │ NamingScreenDetector, Panels, Tests, OverworldWalk 5 lines, cmake) +│ +└── base/bdsp-1717 = base/upstream-main + upstream #1717 head 381c055ac + nav/shared + └── bdsp/event-sandgem-center (lab line) ── #111 bdsp/maps-rederive + └── #121 bdsp/mvp-v3 (50edfb0e9) ... segments 00 and 01 as event tables, maps as + JSON; merges nav/shared at 5e3150565, #111 and #112. Its own 14 commits + change only PokemonBDSP files, SourceFiles.cmake and the new + devtools/maps/bdsp_maps.py. The shared files in its diff against #111 + (LegPlanner.h, Grid, StoryEvents, MapData, StorySegments, TilePose, the + removed old LegWalker copy, base/upstream-main's dpp/sockets/FRLG box) are + nav/shared's versions arriving through that merge: they leave #121's diff + once #111 has nav/shared. Not restructured yet; needs nav/shared 7008f8c67 + merged in (compiles: TileGrid.cpp and the BDSP planner tests checked with + -fsyntax-only) + └── bdsp/mvp collector (B1–B5), kit as before, waits for #111/#112 +``` + +### Who owns which file (user, 2026-11-01) + +A file is changed only in the PR that added it, so a child PR shows only its own files. +Changes a child needs in a parent's file go to the parent as new commits, with tests there, +and are merged back down (merges only; no rebase, no force-push). + +| Files | Owner | +| --- | --- | +| Pokemon/Navigation: Grid, LegPlanner, MapData, StoryEvents, StorySegments, TilePose, Navigation_Tests.h; CommonTools/ScreenMachine | #114 nav/shared | +| Pokemon/Navigation: LegWalker (+ tests) | #117 frlg/mvp (added in F4; only FRLG uses it) | +| Pokemon/Navigation: TileGrid, MapSet | BDSP line (#109 → bdsp collector B1) | +| PokemonFRLG Overworld, BattleFlashWatcher, frlg_maps.py | #117, changed by #118/#119 as walker fixes | +| PokemonFRLG Programs/AutoStory, BattleScreenDetector, NamingScreenDetector | #120 | + +Open: #119 still changes LegWalker.{h,cpp,_Tests.cpp} (+390, all game-agnostic: tile-at-a-time +open legs, stop_on_interrupt, stop_if_blocked, settle, warps). Under the rule they go to +#117 (or to #114 if LegWalker moves there; proposal in the 2026-11-01 restack report: +keep it in #117 until BDSP adopts it, as with TileGrid/MapSet). #120's 5-line OverworldWalk +change (BattleDialogWatcher → BattleScreenWatcher) uses #120's new detector; it moves with +the detector if that goes down to #119. + +Sizes from 2026-11-01. BDSP's delta over #1717's current head (381c055ac): AutoStory ++23.6k/−11.2k (StorySegments 20 files, Utils 12, Data 35 files +2.7k, Tests +2k). It will need +a finer split than B1–B5 once rebuilt; decide after the shared and FRLG collectors land. + +## Order of work + +1. `nav/shared`: refresh the base, apply S1–S4, fork CI on three platforms, draft PR. Show. +2. ✅ `frlg/mvp` = fork #117: from #67, regrouped as F1–F6 on `nav/shared`. Console fixes go on + branches off it (`frlg/walk-wild-legs`) and are collected later. +3. `bdsp/mvp`: after fork #110 and #111 merge into `bdsp/event-sandgem-center` and its three + pre-existing CI failures are fixed (`std::lround` without `` in + `PokemonBDSP_AutoStory_Tests.cpp`, `int-in-bool-context` in `PokemonBDSP_AutoStoryTools.cpp`, + the `std::move_only_function` static assertion in `MoveOnlyFunction_Tests.cpp` on Windows + clang). Refresh the #1717 mirror (#54 is behind Butters' 2026-10-30 push) and build + `base/bdsp-1717`. Show. +4. The user closes the superseded PRs and publishes upstream from the queue in PR_PROGRESS.md. + +## Where the maps live (2026-11-01) + +User, 2026-11-01: "keep maps as local files now and add TODOs to move them to Packages when +ready", and "why don't we do actual json files?". + +- **In the repo, as .json files, built into the program.** The program and its tests read + one copy; a deploy needs no map files. + - `SerialPrograms/cmake/EmbedTextFiles.cmake` (`pa_embed_text_files()`, #114 nav/shared + b426f749f, self-test on `Pokemon/Navigation/TestMaps/`) writes a C++ file into the build + folder returning each `/*.json`'s name and text, split into literals of at most + 16000 bytes for MSVC; nothing generated is committed. Each game calls it once in + `SerialPrograms/CMakeLists.txt`. + - The generator writes the folder and checks it: `--out [--check]`. + - FRLG: `--check` in #117 (a31833dd4). `Overworld/Maps/*.json` (25) and the CMake call in + #118 (910c460df); `overworld_maps()` reads `overworld_map_json()` in #118 (42d7e0aca), + the first PR whose generator writes sign tiles. #117 still loads from Packages, so its + route tests stay skipped in CI until the #118 → #117 fold is decided. + - BDSP: the same helper through BDSP's nav/shared merge; folder and placement by the BDSP + agent. +- **Packages later.** TODOs at `overworld_map_json()` and in `frlg_maps.py`. A local, + unpushed Packages branch `autostory/maps` (worktree + `/Users/difan/.claude/jobs/bea871c7/tmp/wt-maps-packages`, 25 FRLG + 16 BDSP maps with + READMEs) is kept for that move. Plain `Resources/` files are not versioned + (`ResourceDownloadList.json`/`version.json` cover only the downloaded zips), so no version + bump. When the maps move, the repo copy should stay the single source the Packages files + are copied from (`--check` both), or the repo copy goes and the tests read Packages, which + CI checks out. + +## Decisions (user, 2026-11-01) + +- #72 MoveOnlyFunction stays and is the shared collector's first commit (#79 keeps using it). +- #108 ScreenMachine/StepTrace is in the shared collector (BDSP uses it now, FRLG later). +- TileGrid/MapSet (#109) go into the BDSP collector, not the shared core, until FRLG adopts them. +- New collector PRs; the old PRs are closed as superseded (branches kept), as #107 did for + #105/#106. + +## Open items + +- `Pokemon_LegPlanner.h` on the BDSP lab branch is behind nav/core's "search steps" refactor + (79+/133−); the BDSP collector takes nav/core's version and re-checks the BDSP planner tests. +- #109's TileGrid is ~700 lines behind the lab branch (RobustPlanCosts, route costs): B1 is + rebuilt from the lab branch, not from #109. +- Upstream #1717 is Butters' open PR. B1–B5 cannot go upstream before it merges; the + alternative is PRs against Butters' branch. Decide with the user when the BDSP collector exists. +- Butters notes for the BDSP collector (in its PR body): Segment 01 clash, his 0006, program + options not adopted, PP budget kept, save-prompt check, two GCC errors, two screenshot tests. + Pre-upstream: strip DIAGNOSTIC options, #1717 merges first, close #62. +- Not part of the MVPs, stay separate: #81 naming screen, #62 system keyboard, #61 party check, + #86 bag detector tests, #107 lab tooling, #103 lab/main, #100/#78/#56 design notes, #85 notes. diff --git a/autostory/PR_PROGRESS.md b/autostory/PR_PROGRESS.md new file mode 100644 index 0000000000..217bb69fe6 --- /dev/null +++ b/autostory/PR_PROGRESS.md @@ -0,0 +1,126 @@ +# AutoStory PR progress + +Live status of [DEMO_PLAN.md](DEMO_PLAN.md) (the tree and order; [PR_PLAN.md](PR_PLAN.md) keeps the +file-ownership rules). Update whenever a PR changes state. + +Legend: ✅ merged upstream · 🔵 open upstream · 🟢 fork draft, builds and tests pass · 🟡 fork draft, +CI pending, red, or needs a merge · 🧪 console-verified · ⬜ not started · ❌ closed + +Last updated: 2026-11-02 ~15:10 PT (FRLG #120 gained the save-overwrite fix, start-save check, +rival preset name and absolute options via OptionMenuReader; console B 14:33–14:38, build frlg-m34: +new game 00.01 → 00.04 first try, stopped for Starter RNG at Squirtle's ball; new drafts #177–#181). + +## Upstream (two open at a time; the user publishes) + +| Upstream | Fork source | State | Next | +|---|---|---|---| +| [#1828](https://github.com/PokemonAutomation/Arduino-Source/pull/1828) AutoStory: shared start/end select database and story index | `autostory/story-select` 101f5744f (= #43 + #44, plus review fixes) | 🔵 jw098: "looks fine", sections answered; checks pass, mergeable | waiting for merge | +| [#1754](https://github.com/PokemonAutomation/Arduino-Source/pull/1754) PokemonSV: BBQ tests in their own file | #51 `bbq/tests-file` 9e681ce09 | 🔵 conflict fixed (upstream main merged in), mergeable; CI awaits maintainer approval | BBQ queue: ../pokemon_sv/PR_PLAN.md | +| (queued) Max Lair: test the current boss inference | #171 → then #172 the fix | 🟢 CI green, 3 platforms | when a slot frees: fold into one commit, user publishes | +| (queued) BBQ quest detector tests (redo of closed #1759, tests in the detector's own file like #1771) | #180 `sv/bbq-quest-detector-tests` | 🟡 16/16 via harness; CI running | when a slot frees; user posts | +| (candidate) FRLG: Ten Lines target search in the program | #181 `frlg/rng-target-search` | 🟡 reproduces all 50 rows of the user's LeafGreen artifact; CI running | **user decides:** Ten Lines is GPL; code written fresh from reading it | +| (queued) BDSP: MenuDetector past NEW tags; ShortDialogDetector long first line | #152, upstream copy `bdsp/detectors-upstream` dc884fdac | 🟡 CI red only for 26 missing images | after [CLT #42](https://github.com/PokemonAutomation/CommandLineTests/pull/42) merges (adds the images) | +| [CommandLineTests #42](https://github.com/PokemonAutomation/CommandLineTests/pull/42) BDSP AutoStory intro screens (16 images) | CLT `bdsp/autostory-intro-screens` 68604b1 | 🔵 open, no reviews | — | + +Recently merged upstream: #1810 (MoveOnlyFunction), #1791, #1798, #1771. Closed: #1767, #1759 (→ #180). + +## Fork tree + +``` +main (= upstream main, synced daily 07:00) +├─ 🟢 #43 autostory/r1-select-db ─ #44 r2-story-index (+ #1828's review version merged in) +│ └─ 🟢 #45 r3-shared-stats +│ └─ 🟢 #114 nav/shared (grid, planner, LegWalker, route log, JSON maps, ScreenMachine) +│ └─ 🟢 #122 nav/story-steps (shared story steps, retry policy, run options) +│ ├─ FRLG +│ │ └─ #117 frlg/mvp (maps + planner) +│ │ └─ #118 frlg/walk-wild-legs (walker; MoveSpeed RUN, [Speed] log) +│ │ └─ #119 frlg/walk-interrupt-recount (position recovery) +│ │ └─ 🧪 #120 frlg/autostory-mvp new game → Brock → Running Shoes +│ │ │ 00.01–00.11 run before; 11-02: 00.01–00.04 first try (frlg-m34). +│ │ │ CI red only for CLT image ItemListReader/ItemsPocket_Potion5_…png +│ │ └─ #177 frlg/autostory-player-name (typed player name) +│ │ └─ #178 frlg/autostory-sid-helper (SID Helper handoff) +│ │ └─ #179 frlg/autostory-starter-rng (Starter RNG handoff) +│ └─ BDSP +│ └─ #134 bdsp/maps-v4 → #127 nav-v4 → #129 walk-v4 → #152 detectors-v4 +│ → #148 actions-v4 → 🧪 #128 autostory-v4 (new game → Floaroma, r85) +│ ├─ #175 autostory-v4-seg01 (01.05–01.10 on the maps; not on console) +│ │ └─ 🟡 #173 shared-steps (named events → shared steps, to 01.03; CI: sim test crash) +│ ├─ #167 sim (grid simulation for unit tests) +│ └─ #168 view-shift (tap counts need the view to scroll; console check due) +├─ #171 swsh/maxlair-boss-tests → #172 maxlair-boss-fix 🟢 CI green +├─ #180 sv/bbq-quest-detector-tests · #181 frlg/rng-target-search (upstream candidates) +├─ #169 fix/fatal-exception-message (FatalProgramException::message empty) — upstream candidate +├─ #61 frlg/party-room-check · #81 frlg/naming-screen · #62 switch/system-keyboard +├─ #125 devtools/route-pictures · #132 common/run-records · #60 docs/lab-build-disk +├─ common/move-only-function (#1810 merged upstream as another commit) → #87–#91 migration stack +├─ #39 prototype/sv-isolated-hunt +└─ BBQ: #51 → (#37 → #38 → #53 → #8 → …), #24/#30, #29, #33 — see ../pokemon_sv/PR_PLAN.md +base/upstream-main +└─ 🟢 #107 lab/tooling (controller-ready guard; controller=ready on console B) → #131 design/agent-integration +lab/main (#103, lab builds only) → #149 run-records-base → #116 · #150 run-records (both 24 behind lab/main, conflict; not in lab builds) +design/autostory (#100) → #130 FRLG events after Brock (options reference; team plan per starter × + version: FR Lapras, LG Starmie via Super Rod) · #174 sections, postgame and DLC +agents → #85 lab navigation notes · #113 this plan · #176 FRLG demo plan (SID Helper, Starter RNG) +``` + +## Waiting on the user + +- Upstream order once a slot frees: #171 (Max Lair), #180 (BBQ detector tests), the detectors PR + (after CLT #42). +- #181 upstream or not (Ten Lines is GPL; ours is written fresh from reading it). #169 upstream or not. + +## Known gaps + +- Fork drafts skip CI; the stack's CI runs only when dispatched. +- #120 → #179: add `PokemonFRLG/ItemListReader/ItemsPocket_Potion5_Antidote3_ParlyzHeal1.png` to CLT + (only CI failure). BATTLE SCENE OFF not yet run on console. +- #173: Ubuntu CI aborts in "Simulation: a blackout in 00.04b's training resets to its save" (empty + `optional` dereferenced), besides the expected missing BDSP images. +- #87–#91 still sit on `common/move-only-function`, which upstream merged as a different commit (#1810). +- #7 `bbq/quest-detector-tests` is the closed #1759's branch, superseded by #180. +- BBQ children of #51 (#2, #7, #15, #19, #23, #37) are 54–63 commits behind it after #1754's merge. +- #131 is 1 behind #107; #149/#150 lag lab/main by 24 and conflict; left until lab builds need them. +- FRLG open items: preferred move set + post-battle learn-prompt loop (#120), wall-tap check + log-only (#119), walker recovery after wild battles. + +## Tips (2026-11-02 ~15:10 PT; CI = last dispatched run at this tip) + +| PR | Branch | Tip | CI | +|---|---|---|---| +| #43 | autostory/r1-select-db | 8698f8c23 | green | +| #44 | autostory/r2-story-index | 9ca64aa0c | green | +| #45 | autostory/r3-shared-stats | cee0b139b | — | +| #114 | nav/shared | 7cdb95bc8 | Mac green, Windows running | +| #122 | nav/story-steps | 371ac704d | — | +| #117 | frlg/mvp | fc901ecb4 | — | +| #118 | frlg/walk-wild-legs | b2e7d13dd | — | +| #119 | frlg/walk-interrupt-recount | f89a7bb21 | — | +| #120 | frlg/autostory-mvp | fff4697e0 | red: 1 missing CLT image | +| #177 | frlg/autostory-player-name | 701564a50 | — | +| #178 | frlg/autostory-sid-helper | 53eb31ade | — | +| #179 | frlg/autostory-starter-rng | f1c2f6006 | red: same CLT image | +| #134 | bdsp/maps-v4 | eb0df8510 | — | +| #127 | bdsp/nav-v4 | 71ad2b2fc | — | +| #129 | bdsp/walk-v4 | ace8659ca | — | +| #152 | bdsp/detectors-v4 | 0d4d23e23 | — | +| #148 | bdsp/actions-v4 | 1dd00bc3e | green | +| #128 | bdsp/autostory-v4 | 3a89c929e | green | +| #175 | bdsp/autostory-v4-seg01 | 098384a98 | green | +| #167 | bdsp/sim | 5ddac8976 | green | +| #168 | bdsp/view-shift | 7291808d2 | green | +| #173 | bdsp/shared-steps | 000326b46 | red: sim test abort + images | +| #171 | swsh/maxlair-boss-tests | e819c821e | green | +| #172 | swsh/maxlair-boss-fix | 66f83197b | green | +| #180 | sv/bbq-quest-detector-tests | bab44cdc6 | running | +| #181 | frlg/rng-target-search | 9803ace69 | running (Code Health green) | +| #61 | frlg/party-room-check | a5e50d152 | green | +| #107 | lab/tooling | 2b3eac8c6 | green 3/3 | +| #130 | docs/frlg-future-events | 013ba413c | — | +| #51 | bbq/tests-file | 9e681ce09 | upstream: awaits approval | + +When #1828 gets another review round: merge `autostory/story-select` into #44 again and cascade the +same order (#45 → #114 → #122 → FRLG #117–#120 → #177–#179 and BDSP #134 → … → #173). The conflicts +live in #44 (`Pokemon_AutoStorySelect.h`, `SourceFiles.cmake`) and #114 +(`ComputerPrograms_UnitTestRunner.cpp`).