Repository navigation
Conversation
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: f7cc972
Verdict
NEEDS_REWORK
First-pass review of this PR's own diff against plza/upstream/s2-03. Code health: 0 failures, 2 advisories. Two allow tags (char_pointer on Exception::name(), public_methods=10 on StoryBackend) carry reasons that hold up. Fork Draft CI build passed; the ubuntu job was still pending when read.
High
-
Code that nothing calls or tests, even at the chain tip (#545):
Engine/Pokemon_ZonePose.h:37direction_degrees()has no caller.Engine/Pokemon_StoryActionNotImplemented.h:21StoryActionNotImplementedis never thrown or caught.Engine/Pokemon_StoryPoseConcept.h:77pose_matches()(both overloads, GridPose and ZonePose) is never called. TheStoryPoseconcept (:58) requires it, but the engine never asks whether a pose matches a target.
So the tile-subset logic in
pose_matches(GridPose)has neither a user nor a test. Drop what no PR uses. For anything kept for a later PR, name that PR in the body and add a unit test here. -
same_screen()is declared here but defined in #541.CommonTools/ScreenMachine/ScreenObservation.h:42declares it, and the definition is inScreenMachine.cpp(#541). Nothing calls it before then, so this PR links, but an infra header declaring a function with no body does not stand alone. Move the declaration to #541 together with its definition and its tests, or define it here in aScreenObservation.cpp.
Medium
CommonTools/ScreenMachine/ScreenObservation.his infra, added in a PR about Pokemon story interfaces. Its header comment points atScreenState::matches_observation, which arrives in #541. Consider moving it into the ScreenMachine PR (#541) so the infra pieces get reviewed together at the infra bar. If it stays here, the comment should not depend on a type this PR does not have.- Logic in this PR without a test in this PR:
story_reader_supplies()(Engine/Pokemon_StoryGame.h:84, exact name or*prefix),story_heading(),pose_text(). The body says tests come with the fake backend in #539.story_reader_suppliesis pure and has edge cases ("*"alone,"bag.*"against"bag"). A few table cases here would keep each PR standing alone.
Low
ScreenObservation.h:30when = WallClock::min(): ismin()a "not set" sentinel any reader checks? If so, usestd::optional<WallClock>. If not, say it is only a default.ScreenObservation.h:32: the example readings ("bag.RARE_CANDY", "facing") are game words in an infra comment. Use neutral examples, or say "a game names its readings".Engine/Pokemon_ZonePose.h:37:direction_degrees()is not about zone poses (if it stays at all). It belongs next toDirectionor in the stick/walk action that would use it.
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.
…ines it The header declared same_screen() with no definition until the screen machine arrives; the declaration moves there. Its comments no longer point at a type that is not here yet or use one game's reading names.
|
Review fixes, tip Fixed: 2 (same_screen() declaration moved to ScreenMachine.h in #541, beside its definition and tests), 3 (comment no longer depends on ScreenState), 5 (when's default documented), 6 (neutral reading names). |
# Conflicts: # SerialPrograms/cmake/SourceFiles.cmake
Depends on #537
Adds the interface the story engine drives: the backend (input and observation only; a console or a simulation implements it), the pose concept with the zone pose of a game with no tile grid (PLZA), the screen observation a backend returns, and StoryGame, what a game hands the engine as data plus functions. Some helpers (direction_degrees(), StoryActionNotImplemented) have no caller in this chain: Used by the PLZA program PR (batch 2). This is interface only; the fake backend and the tests that drive it come with the action registry in the next PR. 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.