Repository navigation
Conversation
A story checkpoint as a list of StorySteps (route, legs, step onto a trigger, talk, YES/NO, scene, battle, train, heal, shop, save, ready for a boss, and a game-only step), plain data, built into engine events by build_story_checkpoint(). Each event asks the game's StoryStepExecutor to do its step: one virtual per kind, failing as unsupported unless the game overrides it. Poses are the game's (TilePose); skip_if names conditions the executor answers. Tests run tables against a fake executor: event order, skip_if, pose propagation, failure naming, unsupported kinds, a segment with a reload, and lint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
SegmentPolicy is now where retries are set: attempts per checkpoint (default 3), stop at the first failure (no reload; the game stays where it failed), and in-place recoveries per event (SegmentHooks::recover, then the event again) before a checkpoint is reloaded, default 0. run_segment reports each checkpoint's attempts and recoveries and logs "[Checkpoint] 00.07: passed on attempt 2 (1 reset)" and "[Segment] 00: 2 of 3 checkpoints one-shot", so the one-shot rate can be tracked. StoryRunOptions is the program-option group both AutoStory programs embed: "Attempts per checkpoint" and "Stop at the first failure". A story step's skip_if condition is a run flag unless the game overrides holds(). Tests: the policy against the fake executor (attempts then fail, stop at first failure, recover in place, one-shot report). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
build_story_checkpoint() calls StoryStepExecutor::begin_attempt() before building, once per attempt, so a game can start the attempt afresh (BDSP: the trainers who can see us again; the row's failure mode). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
This was referenced Nov 1, 2026
…r Fast) StoryChecks: THOROUGH steps read the screen to confirm what they did (purchases, the Bag, status after battles, position); FAST trusts counts and timings. Each game decides what its steps check at each level. The executor carries it (checks(), set_checks(); THOROUGH by default), and StoryRunOptions gains a "Checks" dropdown, Thorough by default, read with checks(). Tests: the level reaches a step; the option group's defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…eed it StoryRunOptions gains "Game language" (any language the games have, English by default, never refused for lacking a reader), and the executor carries it (language(), set_language()) for the few reads that need text: item names in a shop or the Bag. The header states the rule: steps never match dialogue or menu text, and a game with no reader for the language falls back to language-free checks. Tests: the option's choices and the executor's language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
…s PR Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…d AutoStory stats, for story runs
StoryRunOptions (now "Story Run") takes the game's checkpoint database
and shows Start and End checkpoint dropdowns, labeled as SV labels its
segments ("00.09 Pewter Gym: Camper Liam, then Brock") and built with
#43's make_story_select_database(); a story in sections passes them joined,
so a section's entry is at #44's story_index(). A start after the end is
refused. record_story_stats() adds a segment's run to #45's
AutoStoryStats: the segment, each passed checkpoint, each reload.
Tests: the dropdowns' labels, slugs and defaults, the start/end check,
and the stats.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
The program's integer START/END options give way to the shared story run options' checkpoint dropdowns (#122), labelled from the table ("00.09 Pewter Gym: Camper Liam, then Brock"), and it counts the shared AutoStoryStats (#45): a segment per run, the checkpoints passed and the reloads. The reload and log hooks move into a helper, keeping program() under the function size limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
This was referenced Nov 1, 2026
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
The story maps, devtools/maps/bdsp_maps.py and the CMake embed are maps-v4's (add/add conflicts resolved to its versions); this brings in nav/story-steps (#122) underneath. The per-map grids still load the maps here until the next commits move them onto the shared MapData. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
This was referenced Nov 1, 2026
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
… stats) into bdsp/autostory-v4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…y) into nav/story-steps # Conflicts: # SerialPrograms/Source/Pokemon/Navigation/Pokemon_Navigation_Tests.h # SerialPrograms/cmake/SourceFiles.cmake
StorySteps and its tests move unchanged to Pokemon/AutoStory, next to the events and segments they build on (#114), and register from Pokemon_AutoStory_Tests.h. The story run options include them from there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Code health limits a class's public methods: the methods a game overrides for each step kind are now protected, reached through dispatch_story_step(), so an executor's public face is the attempt, the checks and language, run() and holds(). The test fake follows, and the segment-of-tables test moves its setup into a helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
The executor's and the simulation fake's step-kind overrides are protected, as the shared executor declares them (#122); the table's walks say WildBattles::FIGHT instead of a defaulted bool; the battle loop's body is braced on its own lines; and the panel list keeps its length. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
#122 made Grid's at() read-only and added cell_at() for writes; the story world and the Ravaged Path's smashed rocks follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…/story-steps # Conflicts: # SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySegments.cpp # SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySegments.h
…ion) # Conflicts: # SerialPrograms/Source/ComputerPrograms/ComputerPrograms_UnitTestRunner.cpp
…/story-steps # Conflicts: # SerialPrograms/cmake/SourceFiles.cmake
story_args_errors() now returns each error (#312 review); the action table's checkpoint lint reports one problem per error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…typed arg specs (after #312's review) The variant word tests go with Pokemon_StoryVariant; the segment test no longer sets in-place recoveries, which SegmentPolicy dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
# Conflicts: # SerialPrograms/cmake/SourceFiles.cmake
dayfine
added a commit
that referenced
this pull request
Nov 10, 2026
…122's action table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
The newer code-health rules failed 22 times against nav/story-engine. Declarations move unchanged into headers by concern, each included by the header they came from (ScreenEvents: event types, fades, event log; Interrupts: warp judge; StoryInterrupts: interrupt handlers; Transitions: fade profiles; AutoStory_Tests: the screen-state suites). The *_name() helpers return std::string and test rows hold std::string. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…ts) into nav/story-steps #313 now carries its own part of 7d04d13's header splits, so those files come in unchanged; ScreenStory_Tests.h keeps this branch's two extra suites. Registration lists keep this branch's order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
added a commit
that referenced
this pull request
Nov 10, 2026
The newer code-health rules (header symbol counts, no char* / char[]) failed 19 times against nav/story-engine. This is the #313 part of #122's 7d04d13, so the fix lands in the PR that owns these files: declarations move unchanged into headers by concern, each included by the header they came from (ScreenEvents: event types, fades, event log; Interrupts: warp judge; Transitions: fade profiles; AutoStory_Tests: the screen-state suites). The *_name() helpers return std::string and test rows hold std::string. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Brings in the #45 review fixes; add_tests_AutoStory() also registers the story action and interrupt suites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Pokemon_ScreenStory_Tests.h is gone upstream of this branch; the two suites it gained here get their own headers, Pokemon_StoryActions_Tests.h and Pokemon_StoryInterrupts_Tests.h. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…eader Follows #312's StoryStepExecutor::run(const StoryStep&, RunState&): TableExecutor::run, run_action, clear_interrupts, cleared_after_failure and clear_story_interrupt take the step before the RunState they change, and so do StoryActionFunction and InterruptAction (verdict, then state). Test helpers noting() and table_of() take the FakeGame last. String building uses std::format. add_tests_AutoStoryScreenEvents moves from the adapter's header to its own PokemonFRLG_AutoStoryScreenEvents_Tests.h. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
apply_interrupt_pose and run_segment now take their output last; the interrupt clearing and its tests follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
added a commit
that referenced
this pull request
Nov 10, 2026
StoryExecutor::run(step, state), run_segment(range, policy, segment, hooks, state), verify_checkpoint(id, policy, segment, hooks, state) and record_story_counts(counts, stats); story_checkpoint_database() now comes from Pokemon_AutoStorySelect.h. verify_story_checkpoint() takes its state last, and the PLZA strings use std::format instead of +. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
This was referenced Nov 10, 2026
dayfine
added a commit
that referenced
this pull request
Nov 11, 2026
The engine never includes StoryActions, StoryInterrupts, InterruptHandlers or the FRLG screen-events glue; they come back unchanged in the 2D core PR (nav/grid-story-steps), which replaces #122. autostory/engine now bases on nav/screen-state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
added a commit
that referenced
this pull request
Nov 14, 2026
AutoStory: story step types and engine (split from #122, layer 1 of 3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #313 (and through it #312 and #114).
Update 2026-11-09 (14010d1): #122 is split into three layers. The story step types and engine moved to #312, and screen state and interrupt tracking to #313, both unchanged. This PR is now the layer where story steps meet screen state:
Pokemon_StoryActions(the action table andTableExecutor) andPokemon_StoryInterrupts(looks for interrupts between steps), plus FRLG's screen-event adapter, which belongs with FRLG stage 1 (#213). Merging nav/screen-state in left the tree unchanged; Pokemon:: 210 passed, 0 failed (2 skipped) on the headless runner.FRLG's story was a declarative table and BDSP's a list of wrapped functions, with no shared way to say "walk here, talk, answer YES, fight". This adds one step vocabulary (
Pokemon_StorySteps.h), with a builder from table rows to engine events and an executor interface each game implements, and oneStoryRunOptionsgroup both programs embed: start and end checkpoint dropdowns (#43's select database, joined at #44'sstory_index()), attempts per checkpoint, stop at the first failure, a Thorough/Fast checks level and the game's language.SegmentPolicyis the one place retries are set, andrecord_story_stats()adds a run to #45'sAutoStoryStats. Tested with the StorySteps suite against a fake executor (event order, skip conditions, poses, failures, the retry policy, the options and the stats) and the existing StorySegments suite in fork CI; no console runs of its own.Design note
StoryStep{kind, name, why, target (Pose), direction, legs, fight_wild, yes, may_lose, battles, items, variant, skip_if, pose_after}andStoryCheckpoint{id, title, start (Pose), steps}.build_story_checkpoint()emits afrom_saveevent for the start pose, then one event per step; saving stays the game's (FRLG saves at the end, BDSP at the start).StoryStepExecutorhas one virtual per kind, each failing asunsupported_stepunless overridden, so a table using a kind the game lacks fails by name. Chosen over a table ofstd::functionbecause a fake overrides only what a test needs, and the kinds stay one list.run()wraps every step (FRLG turns console exceptions into failed Outcomes; BDSP goes through its runner for screenshots and the lab log line).begin_attempt()is called once per attempt.holds()answersskip_if, by default from run flags that earlier steps set.StoryCheckpoint(FRLG: supplies and START menu; BDSP: what a failure does). Per-step extras go invariant: BDSP route plan costs (town,robust), D-pad legs that may end a tile short, and segment-registered variants for the Mart lady, the signs' gap and the Jubilife stairs. Trainer sight lives in BDSP's executor (its route kind fights who sees us; trainers reset per attempt). Door line-up is inside BDSP's HEAL (lit doorway by sight).Pose/TilePose: FRLG one-tile poses with facing; BDSP sets of world tiles. Executors return where a step left the player;pose_aftercovers scenes.Update 2026-11-08 (0afc7c7): the story-engine additions the FRLG stack carried on its own copies are landed here so both game chains merge them from this PR:
StoryStep::once_per_savewithPreparedStepsand a three-argumentbuild_story_checkpoint()(a retry after a reload skips preparation that changed nothing),Outcome::changed_nothing/outcome_unchanged(), and a lint for once_per_save with skip_if. The two-argument builder is unchanged. StorySteps suite extended; #114's new LegWalker commit is merged in.Update 2026-11-09 (a7e440c, core plan stage 1, additive):
Pokemon_StoryActions.hadds aStoryActionTablekeyed by step kind and variant name (exact, then any kind, then the kind's default; an entry is the action, a needs-console flag and a declared but unusedwaits_for),TableExecutor, which overrides onlyrun()and falls back to the per-kind virtuals, and aStepGuardhook for the log line, the failure screenshot and stop rows that turns anOperationFailedExceptioninto theoperation_failedOutcome.Pokemon_StoryVariant.his the shared "name key=value" parser (modelled on FRLG's, which is unchanged), andlint_story_checkpoint(data, table)names steps without an action. No game uses it yet. New StoryActions suite (10 cases, fake actions); all 144 Pokemon:: tests pass on the headless runner.Update 2026-11-09 (3a7e743, core plan stage 4, additive):
ScreenEventLogrecords when each screen event rose and fell, bounded (256 changes, counting what it drops), andScreenEventWatchernow keeps one.Pokemon_Interrupts.haddsclassify_interrupt(log, window, knobs): a battle (wild, or trainer sight when a dialog box rose before the battle's fade), else a warp (a banner, or a fade back up with no battle forbattle_after_fade), else a dialog; a fade too recent to rule out an encounter isUNSETTLED, and the verdict carries the changes it used. Per-game timing is data (InterruptKnobs).judge_warp()checks a fade went down, held and came back up on another scene. Nothing calls them yet (stage 5). New Interrupts suite (20 cases from synthetic event sequences, including dialog during a fade, encounter flash vs cave-exit white, an empty and an overflowing log; the encounter-text and too-recent-fade cases were checked red against a broken classifier); all 164 Pokemon:: tests pass on the headless runner.Update 2026-11-09 (46b688e, core plan stage 6, additive):
Pokemon_Transitions.haddsTransitionTracker, which follows a fade frame by frame (scene, falling, uniform hold, rising, scene) instead offade_of()'s single frame, compares the scene before and after through a caller-supplied function, and reports kind (black fade, white fade, flash, or unsure white), start, peak, rise and end. A short fade whose hold falls between two frames is still reported when partial frames lead to another scene, so a missed 50 ms door fade no longer has to wait out the timeout.FadeProfileholds each game's thresholds as data: BDSP uses the shared walk's uniform stddev 10 for the hold andrun_into_door()'s 60 for the frames on the way, so the two no longer disagree; FRLG fades to true black and has no white fade. The flash and white-fade hold limits for BDSP are provisional until captured frames are timed, so the band between them reports unsure.judge_warp()gains an overload for a tracked transition. New Transitions suite (15 synthetic cases incl. missed fade, flash vs cave-exit white, dim floor, night street, timeout; plus a captured-frames test overCommandLineTests/<game>/Transitions/that skips when the folder is absent); all 181 Pokemon:: tests pass on the headless runner (2 skipped).Update 2026-11-09 (b3aa69e, core plan stage 5, shared half):
interrupt_step_time(verdict, lags)returns when the step that set a classified interrupt off was taken: the first rise in its evidence that the game's measuredEventLags time, less that lag. A walker that sees a wild battle only after its hold places it by what its timed log saw instead of by when the clearing watcher fired. FRLG uses it in #224; BDSP's half and engine-level between-step interrupts are not done yet. 4 new data-driven Interrupts cases; all 185 Pokemon:: tests pass on the headless runner (2 skipped).Update 2026-11-09 (bfaaab0, core plan stage 5, engine half): interrupts between steps. Today
Checkpoint::interruptsis never filled, so a dialog, battle or warp that comes up after a step has settled breaks the next step. Design, inPokemon_StoryInterrupts.h:StoryInterrupts: itslook(the screen as aScreenEventLogand a window), theInterruptKnobsfor the sharedclassify_interrupt(), and anInterruptHandlerTable(kind → handler action + what it does to the pose, plus which step kinds start on which kind, e.g. MASH on a dialog). It is data like the action table, not a type per game.TableExecutor::run()looks before each step, which catches what came up after the step before settled, and after a failed step. If the screen is clear, the step runs as before. If it finds an interrupt, the handler runs, then the step. If an interrupt explains a failure, it is cleared and the step runs again.max_looks(3), then fails withinterrupt_unsettled. A kind with no handler fails withunhandled_interruptand a failed handler withinterrupt_failed. Clearing more thanmax_per_step(3) interrupts fails withtoo_many_interrupts.StepGuard::on_interrupt()gives the log line.run_action()is now a protected virtual so a binding can wrap its actions, andapply_interrupt_pose()is public. Withoutset_interrupts()nothing changes.New StoryInterrupts suite (16 cases, fake game): each kind, a step that starts on its interrupt, a failing handler, no handler, the unsettled re-look and its bound, a failure explained (returned and thrown) and not explained, too many interrupts, and the table's rules. StoryActions 10/10. The BDSP binding is on #226; the FRLG binding comes later.
Update 2026-11-09 (2984456, structured step args):
StoryAction::argslists the args an action's steps may carry, andlint_story_checkpoint(data, table)reports a step whose args don't fit them as it reports a step without an action. #312's args and the story range options/log lines are merged in through #313. Pokemon:: 237 passed, 0 failed (2 skipped) on the headless runner.🤖 Generated with Claude Code
https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss