Repository navigation
Conversation
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 29440eb
Verdict
NEEDS_REWORK
First-pass review (agent), own diff against plza/upstream/s1-03. Size accepted as stated (825 non-test lines). Code health job passes; CI at review time: build/no-tabs pass, Fork Draft CI ubuntu / build pending. I read the runner (run_checkpoint / run_event / recover / clear_interrupts) for loops and escalation: every retry path is bounded (recovery attempts, max_interrupts_per_event), GAME_NOT_RUNNING short-circuits recovery, and exceptions are logged and rethrown. No correctness bug found there.
High
Pokemon_StoryEvents.hheader: "See docs/design/AutoStory-Event-Model.md." - that file does not exist (not at this PR, not indocs/designon the fork, anddocs/designis not upstream at all). Put the needed design in the header comment (it mostly is already) and drop the pointer.
Medium
Pokemon_StoryEvents.cppis now the home ofOutcome's,Pose's,Condition's andRecovery's out-of-line functions (outcome_ok,certainty_covers,to_string(Pose),pose_known,recovery_name, ...), declared in the headers #530/#531 added. The description even notes thatPokemon_StoryOutcomeClassexists because of it. Each of those headers should get its own .cpp in the PR that adds it (see the #530/#531 reviews); then this PR is the runner only.Pokemon_TilePose.{h,cpp}:Positionis an open base class read back withdynamic_cast(tiles_of,facing_of), while #529'sDeclaredPosemodels the same "tile game or zone game" split as astd::variant. Two encodings of one idea in the same chain; a variant (or the game's pose type as a template parameter) would drop the casts and the empty-vector "not a tile pose" answer fromtiles_of. At least say in the header why it is open-ended.tile_pose(map, {}, ...)returns a pose with a non-nullwhereandUNKNOWNcertainty, whilePose's comment sayswhereis null whenever the position is unknown. Either returnwhere = nullptrfor no tiles or fix the comment.- Tests:
StoryEventTestCase::Expectation::descriptionis never compared (same shape issue as #530'sListCheckTestCase); the case table is a list of named functions wearing name/input/expectation. Plain registered functions would be honest; otherwise the expectation should be data the runner checks.
Low
event_log_line/checkpoint_log_linehere format"[Checkpoint] {}"again;Pokemon_StoryLog.cppalready hascheckpoint_prefix(). One formatter for the prefix.- Output parameters (T4):
stop_checkpoint(..., CheckpointReport& report)both mutates and returns a copy ofreport;describe_line(..., std::string& text),describe_event(..., std::string& text),lint_*(..., std::vector<std::string>& problems)thread an accumulator. Returning the line / the problems and appending at the caller reads simpler. lint_recoveries:(int)recovery.kind < (int)lastrelies onRecoveryKind's declaration order being the escalation order. Say so on the enum (// In order of escalation; lint_recoveries() relies on it.).run_event: a RETRY (from an interrupt) logs nothing, so a log with an interrupt followed by a second "start"-less attempt is hard to read; alog_status("retry", run)costs one line.- Comment voice:
// Registers unit tests for story event sequencing and execution.style; and test descriptions like "executes registered events in sequence and records traces" read generated. Nit.
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/cmake/SourceFiles.cmake
The Outcome, Pose, Condition and interrupt functions now live with the headers that declare them, so they leave Pokemon_StoryEvents.cpp. The header no longer points at a design note that is not in the repo, and the event tests are plain named tests: their descriptions were never compared.
|
Review fixes, tip Fixed: 1 (design-note pointer dropped), 2 (the Outcome/Pose/Condition/interrupt definitions moved to the PRs that declare them; this file is the runner only), 5 (StoryEvents cases are plain named tests). |
Depends on #531
Adds the story-event model: a checkpoint as events that each state what must hold before (require), do one thing (act) and check what the game shows after (expect), with skip_if, retries, named recoveries and interrupts. It also adds the failure class of an Outcome and the tile pose the tile games hand the engine. Tests: the StoryEvents suite, 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.