Repository navigation
AutoStory 2D core: story actions and interrupts between steps - #362
Conversation
…tory/engine" This reverts commit b305df5.
Start preparation, the runner's reload, and the finish of a run or a verify run, written once for both games. A start at a checkpoint with a save always loads that save first; a failure leaves the game where it failed, with the same log lines in both games. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Pokemon_AutoStoryShell{,_Tests} -> Pokemon_StoryRun{,_Tests}; include
guards, header titles, test suite name and registration follow. No
behaviour change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
AutoStory: shared story-run start and finish for BDSP and FRLG
prepare_story_start() now logs the checkpoint that starts, then runs the game's preflight (video alive, controller ready, game not on HOME); one that fails returns precondition_failed with nothing pressed. A shared console reader lends the same preflight to BDSP and FRLG. story_first_save_allowed(): only a new game saves at its first checkpoint's start; after a load the save is there, and from the game as it is the place is unconfirmed (console B, 2026-11-11 13:32). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
StoryStartGate.h mixed the start enum, the preflight reading, its failure code and two start rules. StoryPreflight is now the one concept in its own header: the preflight hook's reading, its check() and its FAILURE code. StoryStart and story_first_save_allowed() go back to Pokemon_StoryRun.h with the start sequence; story_start_name() is internal to it. Behavior is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Keeps Pokemon_StoryRun.h at its symbol limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
StoryStart moves to Types/Pokemon_StoryStart.h. The console reader joins StoryPreflight as StoryPreflight::read(); the picture check is internal. Behavior unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Tap lengths, tile times per gait and axis, start delay and how open legs are pressed (BDSP taps, FRLG timed holds on foot), with an entry for BDSP and one for FRLG and a check of each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Maps joined by their warps and edges, with the player's place as a map and a tile of it. Where a warp or an edge leads is computed once here; whether a step is allowed stays per game. connect_by_world() joins maps placed on one world grid, for BDSP's maps, which have no connections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…edge entry split out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Conflict in PokemonFRLG_Tests.cpp's registration list: kept main's sorted list and added this branch's BagDetector, BattleMoveSelectionArrow and AutoStoryScreenEvents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Conflict in SourceFiles.cmake: kept both file lists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…e messages name expected and actual (#402 review) FRLG's Bicycle taps 40 ms at one per 100 ms, its walk 66 ms with a 700 ms release, so the step tap moves from MoveMechanics onto Gait. Every scalar gets a default, and the test reports which gait and which value failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…exes, orders MapPlace (#408 review) The rvalue constructor is deleted, map() throws InternalProgramError past the last map, and MapPlace gets a defaulted <=> over TilePos's. The test art matches the maps, the Lake to Route edge has two cases, and stale map indexes have their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…ealth) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Conflict in ComputerPrograms_UnitTestRunner.cpp: kept both add_tests_ConnectedMaps and add_tests_MoveMechanics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…-map-tests links Pokemon_Direction.cpp) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…ule) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
|
API review (claude-sonnet-5-5) at b681c75: changes_requested The table executor lets a throwing interrupt handler escape its guard handling, and it drops a GAME_NOT_RUNNING found after a step failed. The rest is comment hygiene, a sentinel in a test input and include order. The PR description also covers only part of what the diff adds.
|
… a failed step (red) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
… a failed step stops the segment; comment content, include order, named literals, optional frame colour Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 8e67a91
Verdict
LGTM_with_nits
All four requested changes from the earlier review (b681c75) are fixed at this tip; one nit is left. No bug-level findings. I read the diff and the sources; I did not compile or run the unit tests (CI covers that). Code health (run from the agents checkout against origin/nav/grid-screen-state): 0 failures, advisories only (function lengths, header symbol counts).
Prior findings
- Throwing interrupt handler: fixed.
run_handler()inPokemon_StoryInterrupts.cppcatchesOperationFailedExceptionandclear_story_interrupt()returnsinterrupt_failed.test_handler_throwschecks it does not escape the executor and the step is not run. - GAME_NOT_RUNNING after a failed step: fixed.
look_after_failure()returnsGAME_NOT_RUNNINGfor both the failed-outcome and the thrown path, andrun()returnsoutcome_game_not_running()without retrying.test_home_menu_after_a_failed_stepcovers both and asserts the step ran once. - Handler throws while looking after a failure: keeps the step's own failure (
test_handler_throws_after_a_failure). - Sentinel test input: fixed,
std::optional<uint32_t> colorand the frame is built only when set. - Run-history comments: dates and console names are gone from the Interrupts and StoryRun tests, and the PR description now lists the restored files. The empty-frame readers (
FrlgScreenObserver::observe,judge_settle,StoryPreflight) handle empty input without crashing.
Nit
SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h:70still has "(2026-11-09, Jubilife)" in a comment. Say what was measured and drop the date.
SourceFiles.cmake and Pokemon_AutoStory_Tests.h: keep both sides' lists. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Depends on #361 (base nav/grid-screen-state; the diff shows only this change). Replaces #122.
Third 2D core PR: brings back #122's story-steps layer unchanged by reverting b305df5:
Pokemon_StoryActions(action table andTableExecutor),Pokemon_StoryInterruptsandPokemon_InterruptHandlers, their suites, and FRLG's screen-event adapter with its test registration. BDSP and FRLG chains that sat on nav/story-steps move here; the engine itself never included these files. The same revert also restoresPokemon_StoryRun,Pokemon_StoryPreflight,Types/Pokemon_StoryStart.h,Pokemon_ConnectedMapsandPokemon_MoveMechanicswith their test registrations. Review fixes on top: a throwing interrupt handler becomes aninterrupt_failedoutcome, and a HOME menu found after a failed step stops the segment.🤖 Generated with Claude Code
https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss