Skip to content

Command File Runner: LZA story actions, type, and a steps file for recording - #287

Closed
dayfine wants to merge 5 commits into
plza/cfr-basefrom
plza/cfr-actions
Closed

dayfine wants to merge 5 commits into
plza/cfr-basefrom
plza/cfr-actions

Conversation

@dayfine

@dayfine dayfine commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Depends on #282 and #62

Base: plza/cfr-base, a merge-only branch of #282 + #62 + lab/main (the Command File Runner lives only on lab/main), so this diff shows only this change. Review commit by commit.

The Command File Runner gains game-level commands, so a person or agent playing Legends Z-A by hand through the lab channel records story steps as actions rather than raw presses, and a converter turns that recording into draft story table rows.

  • Registry: register_command_file_command() now takes a kind (DRIVES_CONSOLE / READS_STREAM); new register_command_file_reading() for values such as a heading. Games register from their panel list's constructor, so the Switch module includes no game headers. Unknown commands keep today's error.
  • type TEXT: types a name on the system keyboard with Switch: read the on-screen keyboard and type on it with feedback #62's type_on_system_keyboard() (clearing the field first), presses +, and fails unless the keyboard closed. New keyboard detector.
  • LZA commands over PokemonLZA AutoStory: shared story engine, Main Missions 01-03 table #282's actions: lza_talk [A|B], lza_talk_to, lza_pick N, lza_move ANGLE|ahead MS, lza_face ANGLE [TOL], lza_fly PLACE [LANG], lza_battle, lza_heal / lza_shop ITEM... (fail as not implemented), lza_save; detectors lza_dialog, lza_overworld, lza_arrow; reading lza_facing (detect lza_facing).
  • Steps file: every command appends one JSON line to <outbox>/<batch>.steps.jsonl: command, args, UTC start/end, duration, ok or error, the game detectors' state before and after (omitted when no game registered any), and the end frame (<batch>_step_L<n>.jpg). The .out journal is unchanged.
  • Converter: devtools/lab/cfr_steps_to_story.py (in devtools/lab beside cfrun.sh so it changes with the commands and table helpers): one step per action, a row per save, story_moves() entries, raw press/stick/dpad runs collapsed into one RAW n inputs line marked REVIEW.
  • CommandFileSession now carries a ProgramEnvironment (the lab channel builds one for the stopped program) because fight_battle() needs it.
  • From PokemonLZA AutoStory: shared story engine, Main Missions 01-03 table #282: dialog_choice_box() (so lza_arrow uses the actions' own box) and fight_battle_in_progress(), which lza_battle now calls.

Testing

  • Full SerialPrograms build on macOS (ccache, -j4).
  • SerialProgramsTests on the touched suites: PokemonLZA::AutoStory Commands (argument parsing for every command, registry lookup and kinds), NintendoSwitch::CommandFileRunner (incl. type arguments), NintendoSwitch::CommandFileRecorder (line format), PokemonLZA::AutoStory: 58 passed, 0 failed.
  • devtools/lab/test_cfr_steps_to_story.py: 8 passed, including a sample steps file against its reviewed draft.
  • Not run on a console.

🤖 Generated with Claude Code

https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

dayfine and others added 5 commits November 8, 2026 20:40
Someone playing Legends Z-A by hand through the lab channel can now record
story steps at the action level rather than as raw presses:

- Registry: games register commands with a kind (DRIVES_CONSOLE or
  READS_STREAM) and readings (values such as a heading) alongside
  detectors, from their panel list, so the Switch module includes no
  game headers.
- `type TEXT` types a name on the system keyboard (#62), presses + and
  checks that the keyboard closed.
- LZA commands over #282's actions: lza_talk, lza_talk_to, lza_pick,
  lza_move, lza_face, lza_fly, lza_battle, lza_heal, lza_shop, lza_save;
  detectors lza_dialog, lza_overworld, lza_arrow; reading lza_facing.
- Every command appends a JSON line to <outbox>/<batch>.steps.jsonl:
  command, args, times, ok/error, game detector state before and after,
  and the end frame. The .out journal is unchanged.
- devtools/lab/cfr_steps_to_story.py turns a steps file into draft
  story table rows, collapsing raw input runs into one RAW line to review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
It keeps its developer quality label: no story step has run on a console yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Story battles show no Run prompt, so fight_battle() never saw them start
and only pressed B for a minute. lza_battle now attacks with
TrainerBattleState until the dialog after the battle shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
AnyDialogDetector lives in the commands file; include VideoFeed for the
snapshot.

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 9, 2026
… Betas

fight_battle_in_progress() attacks in a battle that is already on screen
until the post-battle dialog shows; story battles have no Run prompt for
fight_battle() to start on. AutoStory moves from Developer Tools to the
Public Betas section of the program list.

Moved here from the Command File Runner PR (#287), which keeps only the
CFR side.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
@dayfine

dayfine commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Replaced by #418 (ported onto the new PLZA AutoStory chain, base plza/cfr-base-v2).

@dayfine dayfine closed this Nov 12, 2026
@dayfine
dayfine deleted the plza/cfr-actions branch November 13, 2026 05:44
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