Repository navigation
Conversation
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 67c328b
Verdict
NEEDS_REWORK
First-pass review (agent), own diff against plza/upstream/s2-01. CI at review time: build, code-health, no-tabs and Fork Draft CI ubuntu / build (incl. unit tests) all pass. I traced load_story_data's reload checks (dev-run and user-run predecessors, string_views into data.checkpoints used before the push_back): correct.
High
- No caller:
load_story_data,StoryDevFile,load_authored_checkpointandstory_rows_for_modeare reached only from tests here and up to the chain tip (944abe8).Pokemon_StoryDevFiles.hitself says "The program passes none; the tests pass their own", whilePokemon_StoryFiles.hsells the dev-file override "so a walk can be retimed on the console without a rebuild" - a lab feature upstream would carry with no way to use it. Name the PR that wires a game to this (and how dev files reach it), or drop the dev-file path until then. Pokemon_StoryFiles.hpoints atcmake/EmbedTextFiles.cmake, which does not exist; nothing in the chain embeds checkpoint files. Same for the "built into the program" claim.read_authored_checkpointrequires"format": "pokesim-authored-checkpoint/1": the wire format of upstream's program is named after our PokemonSimulation tool. If the files are authored here, call the format what it is ("pa-autostory-checkpoint/1"); if they come from that tool, the dependency needs saying in the header.
Medium
ExecutionReaderreturnsvoid: the game's own execution type can only leave through a captured output variable, andread_authored_checkpointdrops it. Return it (template on the execution type, or returnStoryFileRow<...>-like pair) instead of a side-effect callback (T4).validate_json_fields(exact field set, public in a Pokemon header) duplicatesfields()inPokemon_StoryStepJson.cpp(no field outside a set) with different semantics and messages. One strict-object helper, in one place; a generic JSON check arguably belongs next toCommon/Cpp/Jsonrather than inPokemon/AutoStory/Data.- Lab words in shared comments (T3):
StoryRowExecution"which are for lab runs only",dev_only"a lab walk the story does not need". Upstream has no lab; "developer-mode only" says it. StoryRunPolicy::attempts_per_checkpoint = 1here andSegmentPolicy::attempts_per_checkpoint = 3(#535) are the same knob with two defaults in two structs; andStoryRunPolicylives inPokemon_StoryRowExecution.h, a JSON-reading header. Say which one a run uses, or merge them.
Low
EmbeddedJsonFile = std::pair<std::string, std::string>andStoryRows::dev_filesaspair<file name, path>:.first/.secondat use sites; small structs with named fields read better (T6).StoryData<Checkpoint> : StoryRowsinherits a set of row ids plusdev_files; composition (StoryRows rows;) keeps "which rows" and "where they came from" apart.read_dev_filere-parses the built-in file only to read its id; the caller already has the text and could pass the id once.- Include guard
PokemonAutomation_AuthoredCheckpointJson_HdropsPokemon_(as in #533).
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
The authored checkpoint tests lose their standalone main(), which nothing builds. Comments say what the dev-only rows and the format name are for instead of naming our lab and a cmake file that does not exist; the include guard gets the Pokemon_ prefix.
|
Review fixes, tip Fixed: 1 (description says load_story_data has no caller here: used by the PLZA program PR, batch 2), 2 (EmbedTextFiles.cmake claim dropped), 3 (the header says the format name comes from PokemonSimulation's story tools that write the files), 6 (lab words), 11 (include guard). Standalone test main() dropped. |
# Conflicts: # SerialPrograms/Source/Pokemon/AutoStory/Pokemon_AutoStory_Tests.h
"unverified": the row is believed to end on the game's autosave, not yet seen in a run log. A reload does not count on it; StoryRows::unverified_autosaves keeps the rows for a run to report.
Depends on #535
Adds reading a game's story from its checkpoint files: the authored checkpoint envelope (shared checkpoint plus the game's own execution object), the shared execution fields and the rows they mark, and the loader that takes the built-in files and lets a dev file of the same name replace one without a rebuild. load_story_data() has no caller in this chain: Used by the PLZA program PR (batch 2). Tests: the AuthoredCheckpointJson and StoryFiles 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.