Repository navigation
AutoStory: review fixes on the shared engine (#312, #313, #332, #474, #479) - #490
Merged
Merged
Conversation
A reload after that save would land mid-checkpoint while the retry runs from step 1. The engine now records the save and ends the checkpoint's attempts there.
…text A test pins that the engine's SAVE step saves nothing in a testing run; StoryStepExecutor::run says a game off the engine must gate it itself. The step reader accepts once_per_save. The Save and Verify Mode texts say when After verification saves.
Declared poses reach the run as the event layer's pose; a zone's spot and heading are not carried until a game has a position reader.
… value INTEGER_ROWS stays: FRLG's foe_threats and BDSP's avoid args use it.
A user's run skips dev-only rows, so the row a reload follows there must autosave as well.
story_failure_class_info() throws for a class with no row in its place, and a test checks every class has one.
Covers the first frame's rises, rose/fell edges, the capacity drop and describe().
dayfine
commented
Nov 14, 2026
dayfine
left a comment
Owner
Author
There was a problem hiding this comment.
Reviewed SHA: a80d9f3
Verdict
APPROVED
Approved with nits; nothing blocks the merge. All seven items do what the description says.
Checked
- No retry after a part-way SAVE:
m_saved_part_wayis declared beforem_game, so the gated handler's reference is safe. It is reset inrun_once()and is set only when the save succeeded.run_with_retriesreturns FINAL beforerepeats_on_reload. The new runs case checks that there is no[Test] reloadand that the no-retry line is logged. reload_when_chained: the user-run predecessor is held as an index, not as a view intodata.checkpoints, sopush_backcannot leave it dangling. A dev-only row skips the user-run check. Both new load cases cover the intended paths.- Failure-class table: function-local
static. The lookup checks both the index andfailure_class.every_class_has_a_rowtogether withrows_in_enum_ordercovers the whole enum. - Both
static_asserts match the last enumerators (SWITCH_HOME_MENU,TIMED_LEGS). The one onStoryArgTypechecks the count only, which is enough here. - CI: Fork Draft CI at this SHA (run 43649720085) ran and passed all 12 new tests: StoryEngine runs "no retry after a save step", StoryEngine save "save step skipped while testing", both StoryFiles reload cases, StoryStepJson "once per save" and "every time by default", StoryFailureClasses "every class has a row", and the four CommonTools::ScreenEventLog cases. The log has no FAILED lines.
- Code health against
origin/nav/shared: 0 failures. CRLF is kept in the touched files. - I also built
Pokemon_StoryStepJsonat this SHA against PokemonSimulation#104's wire cases. All 70 cases agree; see that PR.
Nits (follow-up or the next touch)
Pokemon_StoryFiles.cppcheck_reload_after(..., std::string_view run, ...):""stands for the developer's run, which is a string sentinel. Use a small enum (dev run / user run) that picks the suffix.Pokemon_StoryFailureClasses.cppclass_rows():for (std::vector<StoryFailureClassInfo> group : {...})copies each group out of the initializer_list, somake_move_iteratormoves from that copy. Useconst auto& groupwith a plaininsert. It runs once, so this is about clarity only.- Same file: there is a stray blank line before
};at the end ofrun_rows(),walk_rows()andwarp_rows(). ScreenEvents_Tests.cppScreenEventLogCase:int ms,size_t capacityandsize_t droppedhave no initializers. AGENTS.md says to initialize every scalar, so add= 0.- Test gap: there is no case for a dev-only row with
reload_when_chainedwhose user-run predecessor does not autosave. It should load, because only the dev run is checked. One row inLOAD_CASESwould pin that branch. - Advisory:
Pokemon_StoryEngineRuns_Tests.cppis at 990 of the 1000-line limit, so the next case added there needs a split first. TheStoryRunOptionsconstructor is at 50 of the 50-line limit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base:
nav/shared. Follow-up to #312, #313, #332, #474 and #479 (all merged); the diff shows only this change.Fixes the should-fix review findings left on the shared AutoStory engine before a game moves onto it.
StoryPoseTraits::from_declared()was never called; it is dropped, and the docs now say a zone's spot and heading are not carried until a game has a position reader.INTEGER_ROWSstays (FRLG'sfoe_threatsand BDSP'savoidargs use it); its comment now tells it apart fromTIMED_LEGS, and astatic_asserttiesStoryArgTypetoStoryArgValue.StoryStepExecutor::runsays a game off the engine must gate it itself; the step reader acceptsonce_per_save; the Save and Verify Mode texts say when After verification saves.reload_when_chainedis also checked against the row before it in a user's run, which skips dev-only rows.story_failure_class_info()throws for a class with no row, and a test checks every class has one.static_assertonSCREEN_EVENT_COUNT; table tests forScreenEventLog.Testing: new cases in the StoryEngine runs and save suites, StoryFiles, StoryStepJson, StoryFailureClasses and ScreenEventLog tests; touched files compiled locally, code health 0 against
nav/shared, Fork Draft CI runs the suites.