Repository navigation
Conversation
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 15d9c5a
Verdict
NEEDS_REWORK
First-pass review (agent), own diff against plza/upstream/s1-01. Code health: 4 failures, all the known defaulted bool add_checkpoint_prefix in Pokemon_StoryLog.h (inherited; follow-up: an enum class CheckpointPrefix{ADD, AS_GIVEN} or an options struct, which also removes the /*add_checkpoint_prefix=*/false comments at the SV call sites). CI at review time: build/no-tabs pass, Fork Draft CI ubuntu / build pending.
High
Pokemon_StoryOutcome.h,Pokemon_StoryPose.h: this PR declaresOutcome::succeeded(),outcome_ok,outcome_unchanged,outcome_failed,outcome_game_not_running,to_string(const Outcome&),certainty_name,certainty_coversandto_string(const Pose&), but none is defined here: the definitions are inPokemon_StoryEvents.cpp, which arrives later in the chain. It compiles only because nothing calls them yet; the first caller in this PR or a cherry-pick of it would fail to link. Either add the definitions here (aPokemon_StoryOutcome.cpp/Pokemon_StoryPose.cpp, which is where they belong anyway) or move these two headers to the PR that defines them. They also have no tests here.- Comments about the split, not the code (user theme T3): both headers say "Split out of Pokemon_StoryEvents.h, unchanged; it includes this header." - that file does not exist at this PR and the history belongs in the commit message. Replace with what the header is for (an Outcome is how an action or check ended; a Pose is where the player is believed to be). Same in
Pokemon_StoryFailureClasses_Tests.cppbeforeOUTCOME_CASES: "the engine's code returns (autostory/engine), and #477's launch_failed" names a branch and a PR number.
Medium
Pokemon_StoryOutcome.hOutcome: emptyfailuremeans success - a sentinel in a new API that every later PR builds on.succeeded()hides it, but every caller can still writeoutcome.failure.empty()/ build anOutcomewith an empty failure and a class. Considerstd::optional<Failure>(name, detail, class) so success has no failure fields at all. Same pattern, smaller:Position::describe()returns""for "nothing to say".Pokemon_StoryFailureClasses.cpprow tables: eachStoryFailureClassInfois a positional aggregate of six fields, three of them adjacentstring_views (meaning,detected_byand the id). Swapping two lines compiles. Use designated initializers (.failure_class =,.id =,.meaning =, ...) - user theme T6.Pokemon_StoryFailureClasses_Tests.cppListCheckTestCase:Expectation::holdsis never read, so the "expectation" is a comment in a struct; the check function is the whole test. Either drop the name/input/expectation shape for these (plain named functions are clearer) or make the expectation something the runner compares. SimilarlyPokemon_StoryLog_Tests.cpp:Input::lineis the formatter's output, computed during static initialization of the table; an exception there would abort before the runner starts. Make the input the call's arguments (or a lambda) and call it inrun().
Low
Pokemon_StoryFailureClasses_Tests.cppheader comment: "every sim fault ... maps to one class" - no test here looks at sim faults.SIM_MISMATCH/ "the story sim" also refer to a simulator that is not in this repo; say what it is or drop the row until it lands.read_story_failure_class_tag()matches the firstclass=anywhere, including inside another word (subclass=lost_tap) or an earlier unrelated field. Fine for today's lines; a word-boundary check costs one comparison.GAME_NOT_RUNNINGinPokemon_StoryOutcome.hduplicates the"game_not_running"id/outcome strings in the class table; use the constant in the table (and test) or drop it.- Unused includes:
Pokemon_StoryPose.hincludesMoveOnlyFunction.h,Pokemon_StoryLog.h,<vector>,<string_view>,<cstddef>;Pokemon_StoryOutcome.hincludes<memory>,<set>,<vector>,Pokemon_StoryLog.h. - Comment voice:
// Constructs a successful event outcome...,// Formats a Pose as a human-readable string.,// Returns the string label...,// Callable action executed for a story event.restate the signature and use//where the file uses//.Pokemon_StoryPose.halso points atPokemon_TilePose.h, which is not in this PR.
No brace-style, tabs, CRLF, Qt, std::filesystem or threading issues; SourceFiles.cmake lists every new file.
# Conflicts: # SerialPrograms/cmake/SourceFiles.cmake
…hat they claim Outcome's and Pose's functions were declared here but defined only with the event runner; they get their own .cpp files. The checkpoint prefix flag is an enum instead of a defaulted bool. The log tests call the formatter when they run instead of during static initialization, the list checks are plain named tests, and the failure class rows use designated initializers.
|
Review fixes, tip Fixed: 1 (Pokemon_StoryOutcome.cpp and Pokemon_StoryPose.cpp define Outcome's and Pose's functions here), 2 (split-history comments and the #477/branch reference), 4 (designated initializers in the class rows), 5 (list checks are plain named tests; the log tests call the formatter in run()), 6 (header no longer claims sim faults), 9 (unused includes), 10 (comment voice in the two headers, no Pokemon_TilePose.h pointer). Also the follow-up from the header: add_checkpoint_prefix is now enum class CheckpointPrefix{ADD, AS_GIVEN}. |
Depends on #529
Adds the story log (one line format for checkpoint start, attempt, reset and pass in every game), the shared list of step failure classes (id, meaning, how a run sees it, what a retry should do), and the step Outcome and Pose, each with its own .cpp. These are what a run reports a step by, so every later layer names failures the same way. Tests: the StoryLog and StoryFailureClasses suites, 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.