Repository navigation
Conversation
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 3d68225
Verdict
NEEDS_REWORK
First-pass review (agent), own diff against plza/upstream/s1-06. Code health job passes; CI at review time: build/no-tabs pass, Fork Draft CI ubuntu / build pending. I traced run_segment / run_row / set_save / verify_checkpoint against story_save_allowed: a failed attempt never saves, a row after the first is not reloaded unless every checkpoint saves, GAME_NOT_RUNNING ends the loop without a reload, and verify saves only after the last run when every earlier run passed. No correctness bug found.
High
- Comments that are about our process, not the code (T3):
SegmentHooks::statussays "once run records land (#132)" (a fork PR number);VerifyPolicy's comment carries the lab rule "a battle lost twice or more gets its own checkpoint, saved right before it". Describe what the hook/policy does; leave the lab policy to the notes.
Medium
Pokemon_CheckpointAttempts.hsays "SV's loop (Pokemon_CheckpointRetry.h), the story segments and the story engine all run their checkpoints through it". There is noPokemon_CheckpointRetry.hin the tree, and at the chain tip (944abe8) onlyStorySegmentsandStoryEnginecallrun_checkpoint_attempts. Drop the SV claim or land the SV change with it.run_checkpoint_attemptshas no direct test: FINAL stops without a reset, a failed reset stops,max_attemptscaps,max_attempts == 0still runs one attempt (is that intended?). It is the shared retry loop the description sells; it should have its own small table here rather than being tested only through segments.run_row(segment, row, policy, hooks, report, run, state): seven parameters, two of them output parameters (SegmentReport& reportforreloads,CheckpointRun& runforattempts/passed), plus theresultcaptured and overwritten by both lambdas (T4). Return{CheckpointReport, CheckpointRun, reloads}and letrun_segmentfold it in;stop_segment/verify_summaryalso mutate-and-return theirreport.
Low
CheckpointAttempts::max_attemptshas no initializer while every other field does; a designated initializer that omits it reads garbage (and Windows clang flags missing fields).size_t max_attempts = 1;or= {}.CheckpointAttempts/CheckpointLoggerusestd::functionwhileSegment,SegmentHooksand the event model useMoveOnlyFunction; pick one for the chain.bool add_checkpoint_prefixreappears here as a struct field (same follow-up as #530's defaulted bool: an enum).SegmentPolicy's comment says "Retry and timeout configuration" - there is no timeout. "The options' default is NONE; the engine's stays the playthrough's" is hard to parse; say which default wins where.SegmentReport::failed_checkpoint/failed_eventuse empty strings for "nothing failed" / "not an event" (sentinels);std::optional<std::string>or reuseCheckpointReport's failed-where.- Comment voice:
// Collection of ordered checkpoints...,// Summary of checkpoint attempts and pass status.,// Execution results and failure diagnostics...,// Verification results for multiple runs of a checkpoint.
No brace-style, tabs, CRLF, Qt, std::filesystem or threading issues; SourceFiles.cmake lists every new file.
# Conflicts: # SerialPrograms/Source/Pokemon/AutoStory/Pokemon_AutoStory_Tests.h # SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryStepExecutor_Tests.cpp
run_checkpoint_attempts() gets a case table (pass, reset, max_attempts, FINAL, a failed reset, max_attempts 0). The segment and verify save-mode tests move here from the save policy suite, beside the runner they test. The segment tests are plain named tests, max_attempts has a default, the prefix flag is the CheckpointPrefix enum, and comments describe the code rather than our records or the SV loop.
|
Review fixes, tip Fixed: 1 (#132 and the lab rule out of comments), 2 (SV claim dropped), 3 (new StorySegmentSaves suite: run_checkpoint_attempts table incl. FINAL, failed reset, max_attempts cap and 0 still running once; plus the nine segment/verify save-mode tests moved here from #540), 5 (max_attempts = 1), 7 (CheckpointPrefix enum). Segment cases are plain named tests. |
StorySaveMode and its save-decision tests left #531; this PR, their first user, keeps them unchanged (conflict in SourceFiles.cmake resolved to this branch's list).
|
StorySaveMode ( |
The story engine is the one runner; a checkpoint that passes saves as its row's execution says. Their tests go with them.
Depends on #534
Adds the retry loop every AutoStory runs a checkpoint in (CheckpointAttempts) and story segments: a segment as a table of checkpoints, each built fresh per attempt, run in order from a save with a reload when one fails, plus the segment run's policy, range and report types and StorySaveMode, the rule for when a run may save. Tests: the StorySegments and StorySegmentSaves suites (the retry loop's cases, and when a segment and verify mode save), the StoryRunTypes save decision table, and the StoryStepExecutor cases that run segments, 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.