Skip to content

AutoStory grid-core: step and checkpoint data fields - #653

Draft
dayfine wants to merge 6 commits into
autostory/shared-corefrom
autostory/grid-core
Draft

dayfine wants to merge 6 commits into
autostory/shared-corefrom
autostory/grid-core

Conversation

@dayfine

@dayfine dayfine commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Depends on #648

Base autostory/shared-core; the diff shows only this change.

The core is grid-free now (#648: 3b8c9aa reverted, then d3f0a9c takes Direction, tap/hold and PoseCertainty out and adds two extension points: StoryArgType::REGISTERED with a game-registered StoryArgKind, and a per-game declared-pose kind for read_story_checkpoint()). This PR is the grid layer on top. It owns Navigation/Pokemon_Direction and Pokemon_Grid, Types/Pokemon_GridPose.h, and Grid/Pokemon_GridStoryArgs: StoryLeg, StoryItem, TileDeclared and the registered kinds DIRECTION, GRID_POSE, LEGS, ITEMS and TILE_DECLARED. It also adds the grid games' data fields to the shared types: StoryStep skip_if / declared_after / gates_after / flags_after, StoryCheckpoint steps_json / postconditions / start_gates / start_flags + checkpoint_gates(), and metadata verified, all read by the step JSON. GateState, StoryPostconditions and CheckpointGates come unchanged from frlg/lean. Tested with the StoryStepJson suite, which runs in the main unit-test runner (Pokemon::add_tests_AutoStory) on Fork Draft CI.

Field sort, frlg/lean vs shared-core:

Class Count Where it went
Closed-list members (arg kinds DIRECTION, GRID_POSE, LEGS, ITEMS; TileDeclared) 5 Registered kinds on this PR, not core enum values
Grid data fields, this PR 10 StoryStep 4, StoryCheckpoint 5, metadata 1
Grid-generic, later grid-core PRs 16 once_per_save, verify, ActionSpec check, RunState gates, Event conditions/recoveries, Checkpoint interrupts, StoryGame hooks, StepRunner run()/holds(), StoryPoseTraits, engine verify/postconditions, story_heading, same_screen, ScreenMachine next/max_in_a_row, PoseCertainty in a tile Position, grid backend moves (tap/hold)
FRLG-only / old runner, stays on frlg/lean 9 StorySegments types, PreparedSteps, StepTrace ScreenMachine, story_checkpoint_database
Core is newer, core wins at the merge 7 Milliseconds timed legs, story_arg<>, CheckpointPrefix, StorySavePolicy, log_detail, find_story_action, = {} defaults

dayfine and others added 6 commits November 18, 2026 00:59
The grid games' plain-data fields on the shared story types, read by the
step JSON:

- StoryStep: skip_if, pose_after ("declared_after"), gates_after,
  flags_after.
- StoryCheckpoint: steps_json, postconditions, start_gates, start_flags,
  and checkpoint_gates().
- StoryCheckpointMetadata: verified (StoryVerification).

Pokemon_GateState.h/.cpp, Types/Pokemon_StoryPostconditions.h and
Types/Pokemon_StoryCheckpointGates.cpp come unchanged from frlg/lean.
The core no longer holds the grid items, so grid-core takes them back as
its own: Navigation/Pokemon_Direction and Pokemon_Grid, Types/Pokemon_GridPose.h,
and Grid/Pokemon_GridStoryArgs (StoryLeg, StoryItem, TileDeclared and the
registered arg kinds DIRECTION, GRID_POSE, LEGS, ITEMS, TILE_DECLARED).
A tile game's declared poses ("start", "declared_after") read through the
TILE_DECLARED kind; postconditions read grid poses and items from it.
…story/grid-core

# Conflicts:
#	SerialPrograms/cmake/SourceFiles.cmake
grid_story_actions<Pose, Backend>() registers "legs" and "face" for a tile
game whose backend adds move_leg(direction, tiles, pace) and face(direction)
(GridMoveBackend). They read the grid arg kinds; on another backend they fail
as unsupported_step before any input. Tests run them from JSON on the
scripted backend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant