Repository navigation
Conversation
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 1f0cd80
Verdict
NEEDS_REWORK
First-pass review of this PR's own diff against plza/upstream/s2-05. Code health: 0 failures, 5 advisories; Pokemon_StorySavePolicy_Tests.cpp is 508 lines. Fork Draft CI build passed; the ubuntu job was still pending when read.
High
-
The tests here do not test this PR's code, and this PR's code is tested later.
decide_story_save()andstory_steps_hash()(Engine/Pokemon_StoryEnginePolicy.cpp) have no test in this PR. Their cases are inEngine/Pokemon_StoryEnginePolicy_Tests.cpp, which arrives in #542.- Most of the
StorySavePolicysuite added here tests code from earlier PRs.test_decision_tablecoversstory_save_allowed()(#531).test_none_never_savesthroughtest_verify_no_save_after_a_failed_run, nine cases, driveSegmentandSegmentHooks(#535).
Move the segment and save-mode cases to the PRs that add that code, and bring the
decide_story_savecases (phase × verified hash) here. The postcondition cases (test_postconditions_*,test_end_pose_from_the_plan) do belong here. -
A comment points at our notes branch.
Engine/Pokemon_StoryEnginePolicy.h:6: "(autostory/SAVE_POLICY.md on the notes branch)". Upstream has no such branch. State the policy in the comment, which the next sentences already do, and drop the reference (user theme T3).
Medium
Engine/Pokemon_StoryEnginePolicy.h:46StoryEngineReportis the engine's report. Nothing in this PR uses it, and onlyPokemon_StoryEngine.{h,cpp}(#542) does. It belongs with the engine.Engine/Pokemon_StoryEnginePolicy.cpp:53: a checkpoint in phase verification or reproduction with noverifiedrecord logs "steps_hash mismatch (recorded none, now ...)". Nothing mismatched; it was never verified. Give that case its own reason, e.g. "never verified: treated as testing".- Lab-run references in comments:
Pokemon_StorySavePolicy_Tests.cpp:8("FRLG 00.31's end state"),:202("FRLG 00.31, 2026-11-10: the run said it passed on the wrong floor"), and:280. Describe the fault (a run that reports success on the wrong floor) instead (T3).
Low
SavePolicyCaseis name / input / expectation in shape only:Inputis a function pointer andExpectationis a prose description. The table rows inSAVE_DECISIONSare positional. Use designated initializers there (T6).Pokemon_StoryPostconditionCheck.cppcheck_position:map_failedis read fromout.back(). That works only becausecheck_mapalways pushes exactly one result. Havecheck_mapreturn its verdict instead.
Checked: brace style, no std::filesystem/std::thread/std::mutex, CRLF kept, new files are in SourceFiles.cmake, and the includes resolve against the parents. A position postcondition that cannot be read is reported as not checked, never passed, as the PR body says.
# Conflicts: # SerialPrograms/Source/Pokemon/AutoStory/Pokemon_AutoStory_Tests.h # SerialPrograms/cmake/SourceFiles.cmake
The decision-table and segment save tests now live with the code they test; this suite gains the steps hash cases and a save decision table (phase by recorded hash). A checkpoint that was never verified gets its own reason instead of a hash mismatch against "none". Comments describe the faults, not our runs or notes.
|
Review fixes, tip Fixed: 1 (decision table moved to #531, segment/verify save tests to #535; this suite now has the steps hash cases from #542 and a decide_story_save table by phase and recorded hash), 2 (notes-branch reference), 4 (never verified gets its own reason), 5 (lab-run comments), 6 (plain named tests; the positional SAVE_DECISIONS rows are gone). |
# Conflicts: # SerialPrograms/Source/Pokemon/AutoStory/Pokemon_AutoStory_Tests.h # SerialPrograms/cmake/SourceFiles.cmake
StoryEnginePolicy.h keeps the engine's report and CheckpointVerdict; the postcondition tests stay.
Depends on #539
Adds the postcondition check (a checkpoint's declared end state checked against what the game read, with an unreadable condition reported as not checked, never passed) and the engine's save policy, which picks when a run may save from the checkpoint's phase and verified step hash. Tests: the StorySavePolicy suite (steps hash, the save decision by phase and recorded hash, the postcondition check); the policy's engine-level cases come with the engine. Fork Draft CI builds and runs them. 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.