Repository navigation
Fix shared AutoStory engine review nits - #497
Merged
Merged
Conversation
dayfine
commented
Nov 14, 2026
dayfine
left a comment
Owner
Author
There was a problem hiding this comment.
Reviewed SHA: 019fa24
Verdict
NEEDS_REWORK
Four of the five #490 nits are done correctly and the test split is clean. The new reload_when_chained case does not cover the branch that nit 5 asked about, so that item is not done yet.
Major (blocking)
Pokemon_StoryFiles_Tests.cpp, case "a dev-only reload after a user row that does not autosave fails": the case does not test the!execution.dev_onlyskip. Its only predecessor, 01.00 ("save": "menu"), is the predecessor in both the dev run and the user run. So it fails on the DEVELOPER check, the same way the existing case "reload_when_chained after a row that does not autosave fails" does. It also passes whether or not!execution.dev_only &&is on line 107 ofPokemon_StoryFiles.cpp.- Nit 5 in the #490 review (#490 (review)) asked for the case that loads: a dev-only reloading row whose dev-run predecessor autosaves and whose user-run predecessor does not.
- Fix: replace the case with one shaped like this:
- input:
01.00{"save": "menu"}, then01.005{"dev_only": true, "save": "autosave"}, then01.01{"dev_only": true, "reload_when_chained": true} - expectation: a
.summary(it loads:autosave 01.005,chained 01.01,dev_only 01.005 01.01) - name: e.g. "a dev-only reload after a dev-only autosave row, the user's row before it not autosaving, loads"
- input:
- That case fails with "... in a user's run" if the
dev_onlyguard is removed, so it pins the guard. - The brief's wording ("a dev-only row that reloads after a user row that doesn't autosave") was ambiguous; the #490 review text is the source to follow.
Minor (non-blocking, follow-up OK)
2. Pokemon_StoryEngineSaveRetry_Tests.cpp: about 110 lines of test scaffolding are copied into the new file, not moved. The copies are joined, has_line, expect_inputs, look, game_step, checkpoint_of, game_action, flaky_game, RunsCase and StoryEngineRunsTest; the originals stay in Pokemon_StoryEngineRuns_Tests.cpp.
- This repeats an existing pattern:
joinedwas already defined in four other AutoStory test files. - The PR description says the block "moved unchanged". Please also say that the helpers are copied.
- Follow-up: put them in a shared test-only header.
Checked, OK
- RunKind (nit 1):
enum class RunKind{ DEVELOPER, USER }replaces the""sentinel at both call sites.run_suffixswitches over both values and throwsInternalProgramErrorif neither matches.- The message text is unchanged, so the existing "in a user's run" expectation still matches.
- The function comment was updated.
- Failure-class table (nit 2):
appendtakes each group by value from a prvalue, so the group is moved in and its elements are moved out. No copy is left.- The three stray blank lines before
};are removed.
ScreenEventLogCase(nit 3):ms,capacityanddroppedare now= 0.- The move (nit 5):
git diff --color-moved=zebra --color-moved-ws=allow-indentation-change 81e6a30c8 019fa241b: all 288 removed lines in the runs test file are marked as moved. The only exceptions are the 5 lines of the file-header comment that were rewritten.- In the new file, every line that is not marked as moved belongs to the copied scaffolding above. No test body changed.
- Case names are the same before and after: 37
.names across both files, compared after sorting. - The runs test file went from 990 to 700 lines.
- Registration:
SourceFiles.cmakelists the new.cppand.h.Pokemon_AutoStory_Tests.hincludes the new header and callsadd_tests_StoryEngineSaveRetry.- Fork Draft CI run 43653585677 logs PASSED for all 5 moved cases ("save gets its checkpoint", "no retry after a save step", "console_only refused off console", "no reload for console_only", "verify saves after all passed"). It also logs PASSED for the new StoryFiles case, and the run reports
Failed: 0.
- The new files are CRLF and have the standard header and include guard. CI code-health and no-tabs are green.
… and pins the dev_only skip
dayfine
marked this pull request as ready for review
November 15, 2026 00:07
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.
Fork draft based on
nav/sharedat81e6a30c8; the diff contains only these follow-up review fixes.The shared engine still used a string sentinel, copied failure-class groups, left scalar test fields uninitialized, and lacked the dev-only reload regression.
This replaces the sentinel with
RunKind, moves each failure group once, initializes the fields, adds the regression, and splits save/retry tests into a registered 442-line file while reducing the runs test file from 990 to 700 lines.Local checks passed with code health at 0 failures, all touched C++ units plus the test registry compiled under warnings-as-errors, and clean CRLF, no-tabs, and diff checks; Fork Draft CI provides the full build and test run.
How to review: the 257-line save/retry block moved unchanged from
Pokemon_StoryEngineRuns_Tests.cpp; read the small fixes and registration first, then usegit diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change nav/shared...autostory/engine-nitsto distinguish the move.About 110 lines of test helpers (joined, has_line, expect_inputs, look, game_step, checkpoint_of, game_action, flaky_game, RunsCase, StoryEngineRunsTest) are copied into the new SaveRetry tests file, not moved; the originals stay in the runs test file.