Repository navigation
Conversation
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 09e802e
Verdict
NEEDS_REWORK
First-pass review (agent), own diff against plza/upstream/s1-02. Code health: 0 failures. CI at review time: build/code-health/no-tabs pass, Fork Draft CI ubuntu / build pending.
High
Types/Pokemon_StoryBreakpoints.{h,cpp}set_story_pause_wait()/installed_wait(): a mutable process-widestd::functionthat a "lab build installs", read from the run's thread with no synchronization. Even at the chain tip (944abe8) the only caller ofset_story_pause_waitis a unit test, so upstream would get a global knob for a fork-only lab feature. Pass the wait down (an option of the run, or the game'spause_pointhook) instead of a global; if a global stays, it needs aMutexand a why. Alsomake_story_pause_hookre-reads the global on every pause: if the wait is removed after the hook is made, the hook calls an emptystd::functionand throwsbad_function_call.- Declarations without definitions, as in #530:
apply_interrupt_pose(Pokemon_StoryCheckpointTypes.h),condition,pose_known,recovery_name(Pokemon_StoryEvent.h) are defined only later in the chain (Pokemon_StoryEvents.cpp). Move them with their definitions, or add the .cpp here. - Comments about history and our notes branch (T3): "Split out of Pokemon_StoryEvents.h, unchanged; it includes this header." in
Pokemon_StoryCheckpointTypes.handPokemon_StoryEvent.h; "(autostory/SAVE_POLICY.md on the notes branch)" inPokemon_StoryCheckpointMetadata.h; "a lab build installs one" inPokemon_StoryBreakpoints.h. Upstream has neither the notes branch nor a lab build; say what the phase policy is inline instead.
Medium
- "No suite of its own" is not quite true:
story_save_allowed()(the save policy - the one decision here that can overwrite a user's save),read_story_phase()andStoryPausePoints(mode OFF/STEPS/LEGS, label carry-over) have behavior in this PR. Their tests should be in this PR, per "tests belong to the code in the same PR". A table of mode x verdict x point forstory_save_allowedis a few lines. Pokemon_StoryCheckpointTypes.hCheckpointReport::failed_event:0means "start check, end check, save, or nothing failed" - four meanings in one sentinel.std::optional<size_t>plus a small enum for where it failed (START / EVENT / END / SAVE) says it in the type.Checkpoint::max_interrupts_per_event = 5: why 5? A one-line reason or a named constant (T2).
Low
StoryPausePoints::before_step(const std::string&),before_leg(const std::string&),pause(const std::string&): read-only string params;std::string_viewby value per the repo pointer (before_stepcopies intom_step_labelanyway).Event::when_skippedisstd::functionwhile every other callable in these structs isMoveOnlyFunction; pick one or say why.StoryVerification::runs("3/3"),date,buildare free strings in a model the engine compares; fine as recorded text, but say so (the engine never parses them), or giverunstwo integers.- Comment accuracy/voice:
// Specification of an atomic story task with actions and postconditions.(StoryStephas no postconditions);// Story milestone containing...,// Callback receiver for...,// Predicate callable evaluating current run state.,// Returns the readable name...restate types with//instead of the file's//. Several comments point at files and names not in the chain yet at this PR (Pokemon_StoryStepExecutor.h,PreparedSteps,StoryStepExecutor::holds(),Pokemon_StoryPostconditionCheck.h,Engine/Pokemon_StoryEnginePolicy.h,StoryGame::pause_point,StoryRunOptions).
No brace-style, tabs, CRLF, Qt or std::filesystem issues; SourceFiles.cmake lists every new file.
…es get tests condition(), pose_known(), recovery_name() and apply_interrupt_pose() get their own .cpp files beside the headers that declare them. The pause wait is passed to make_story_pause_hook() instead of living in a process-wide global, so a hook keeps the wait it was made with. New suite StoryRunTypes covers the save decision table, phase names and the pause points. Pokemon_DeclaredPose.h comes here with the step types that hold one.
|
Review fixes, tip Fixed: 1 (no global: make_story_pause_hook(wait, scope) takes the wait and the hook keeps its own copy, so no bad_function_call), 2 (Pokemon_StoryEvent.cpp and Pokemon_StoryCheckpointTypes.cpp), 3 (split, notes-branch and lab-build comments), 4 (new StoryRunTypes suite: save decision table, phase names, pause points OFF/STEPS/LEGS, pause hook, labels), 6 (a reason for max_interrupts_per_event), 7 (string_view), 10 (comment voice in the two event headers). Pokemon_DeclaredPose.h now lands here. |
|
Second fix round, tip |
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).
|
Third fix round, tip |
Depends on #530
Adds the plain data a checkpoint is made of: a story step, a checkpoint with its metadata and postconditions, debugger breakpoints, the declared pose a step or checkpoint holds, and the StoryEvent and checkpoint types with their few functions. Tests: the StoryRunTypes suite (phase names, pause points and the pause hook). Fork Draft CI builds it. 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.