Repository navigation
Conversation
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 80eb57e
Verdict
NEEDS_REWORK
First-pass review of this PR's own diff against plza/upstream/s2-07 (#541). Engine logic (Pokemon_StoryEngine.cpp) reads correct: save only on PASSED, retry only while the start save is reachable, saved_part_way stops retries, verify saves only on the last run after all passed, attempts == 0 still runs once. The findings are about where tests live and comments that won't survive upstream. Code health: 0 failures (9 advisories, function length). CRLF kept, no banned APIs, new files listed in SourceFiles.cmake. Fork Draft CI (ubuntu / build) was still pending when I looked.
High
- Infra tests live here, not in the infra PR (#541).
Pokemon_StoryEngineRuns_Tests.cppobservation_machine_ends,observation_machine_fails,still_states(lines ~255-425) andPokemon_StoryEnginePolicy_Tests.cppScreenObservationTest(lines ~345-415) testrun_screen_machine_on_observations()/match_screen_state(): terminal state, "matches none",max_visits, timeout,max_still, the 8-step stall. None of them touchStoryEngine. As split, #541 lands CommonTools infra with no tests for those behaviors. Move them into #541 (and out of thePokemon::StoryEnginesuite names). - Comments about our PR history.
Pokemon_StoryEngineRuns_Tests.cpp:5-11("the PLZA move, #335", "what PLZA found on the engine"), the "Gap 1".."Gap 10" labels throughout Runs/SaveRetry tests (a list that is not in the repo),Pokemon_StoryEngineSaveRetry_Tests.cpp:224("(#329)", a fork PR number that resolves to an unrelated upstream PR), andPokemon_StoryEngine.cpp:24-26("The old executor interface ... Goes once StoryStepExecutor is deleted"). Say what each test checks; drop the gap numbers and PR numbers.
Medium
- More tests belong to parent PRs.
StoryStepsHashTesttestsstory_steps_hash()(#540),StoryMetadataTesttests the metadata reader (#533/#540),stick_and_heading/buttons_by_nametestFakeStoryBackend(#538),handler_sees_stepcalls onlyStoryActionRegistry::dispatch(#539),pause_hook_from_the_installed_waittestsmake_story_pause_hook(#531). Each parent ships that code untested until here. Pokemon_StoryEngine.h:12points to "MIGRATION.md in this folder", which does not exist at this tip or at the chain tip (#545). Add it or drop the line.
Low
Pokemon_StoryEngine.cpp:72-92with_gated_save_step()returns results through captured references to engine members (mode,current,saved); it is correct only becauseStoryEngineis non-copyable and the members are declared beforem_game(header comment at the members carries that invariant). Hidden mutation (user theme T4). Consider a smallSaveGateStatemember the handler holds by pointer, built in the constructor body.Pokemon_StoryEngine.cpp:96/:216:"lint_failed"is a bare literal in two places whileGAME_NOT_RUNNING/CONSOLE_ONLYare named constants; name it too.- No non-test caller of
StoryEngineanywhere through #545; the description should say which later PR wires it in, so the engine isn't read as dead code. RUNS_CASESand the SaveRetry.checktable: every.expectationis{}and the check is a function pointer, so the name/input/expectation shape is cosmetic. Fine to keep, but plain named tests would read more honestly.
…istory The screen machine tests moved to CommonTools::ScreenMachine and the steps hash cases to the save policy suite; the global pause wait test goes with the global. The run and retry tables are plain named tests, the never-verified case expects its own reason, and comments drop the gap numbers, fork PR numbers and the pointer to a MIGRATION.md that is not in the repo.
|
Review fixes, tip Fixed: 1 (screen machine tests moved to #541), 2 (#335, Gap labels, #329 and the old-executor comment), 4 (MIGRATION.md pointer), 7 (description names the PLZA program PR, batch 2), 8 (run and retry tables are plain named tests). 3 in part: steps hash cases moved to #540, the pause hook test to #531. |
…ify mode and save points The game's save decides how (autosave row or menu). SAVE steps always save.
# Conflicts: # SerialPrograms/Source/Pokemon/AutoStory/Pokemon_AutoStory_Tests.h
Depends on #541
Adds the story engine, the one executor for every game and both backends: it lints a checkpoint's steps against the game's actions, runs them through the event layer with the step runner, checks postconditions and saves by the policy. Nothing in this chain constructs a StoryEngine: Used by the PLZA program PR (batch 2). Tests: the StoryEnginePolicy, StoryEngineRuns and StoryEngineSaveRetry suites over the fake backend, built and run by Fork Draft CI. Part of the re-split of #522/#524/#525 into reviewable steps; review fixes are new commits on the PR that owns each problem, merged up the chain.