From a818a20f5732b3d17f6f093908edc080296cd119 Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 00:06:46 -0800 Subject: [PATCH 01/11] Command File Runner: LZA story actions, `type`, and a steps file Ported from #287 (a6d441519, 1f1b28381) onto the PLZA AutoStory chain's Actions/ API. lza_move and lza_face drive run_story_move() and face_heading() through a small PlzaBackend over the lab channel's console and fail the line on a failed Outcome. lza_move's MS is one leg that walks straight on. lza_battle takes "now [SECONDS]", parsed. lza_heal and lza_shop are dropped: no action backs them on the chain. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .github/workflows/lab-instance-tools.yml | 1 + .../Source/CommonFramework/Windows/Lab.md | 23 +- .../NintendoSwitch_CommandFileParsing.cpp | 7 + .../NintendoSwitch_CommandFileParsing.h | 4 + .../NintendoSwitch_CommandFileRecorder.cpp | 66 ++++ .../NintendoSwitch_CommandFileRecorder.h | 57 ++++ ...ntendoSwitch_CommandFileRecorder_Tests.cpp | 135 ++++++++ ...NintendoSwitch_CommandFileRecorder_Tests.h | 23 ++ .../NintendoSwitch_CommandFileRunner.cpp | 262 ++++++++++++--- .../NintendoSwitch_CommandFileRunner.h | 52 ++- ...NintendoSwitch_CommandFileRunner_Tests.cpp | 54 +++ .../NintendoSwitch_LabCommands.cpp | 22 +- .../Programs/CommandFileRunner/README.md | 8 +- .../PokemonLZA/PokemonLZA_Panels.cpp | 6 +- .../PokemonLZA/PokemonLZA_Tests.cpp | 2 + .../PokemonLZA_AutoStoryCommands.cpp | 312 ++++++++++++++++++ .../AutoStory/PokemonLZA_AutoStoryCommands.h | 100 ++++++ .../PokemonLZA_AutoStoryCommands_Tests.cpp | 207 ++++++++++++ .../PokemonLZA_AutoStoryCommands_Tests.h | 26 ++ SerialPrograms/cmake/SourceFiles.cmake | 8 + devtools/lab/README.md | 1 + devtools/lab/cfr_steps_to_story.py | 195 +++++++++++ devtools/lab/test_cfr_steps_to_story.py | 63 ++++ .../testdata/cfr_steps_sample.expected.cpp | 30 ++ .../lab/testdata/cfr_steps_sample.steps.jsonl | 19 ++ 25 files changed, 1612 insertions(+), 71 deletions(-) create mode 100644 SerialPrograms/Source/NintendoSwitch/Programs/CommandFileRunner/NintendoSwitch_CommandFileRecorder.cpp create mode 100644 SerialPrograms/Source/NintendoSwitch/Programs/CommandFileRunner/NintendoSwitch_CommandFileRecorder.h create mode 100644 SerialPrograms/Source/NintendoSwitch/Programs/CommandFileRunner/NintendoSwitch_CommandFileRecorder_Tests.cpp create mode 100644 SerialPrograms/Source/NintendoSwitch/Programs/CommandFileRunner/NintendoSwitch_CommandFileRecorder_Tests.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryCommands.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryCommands.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryCommands_Tests.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryCommands_Tests.h create mode 100755 devtools/lab/cfr_steps_to_story.py create mode 100644 devtools/lab/test_cfr_steps_to_story.py create mode 100644 devtools/lab/testdata/cfr_steps_sample.expected.cpp create mode 100644 devtools/lab/testdata/cfr_steps_sample.steps.jsonl diff --git a/.github/workflows/lab-instance-tools.yml b/.github/workflows/lab-instance-tools.yml index ebf48e6600..55e47d1eb4 100644 --- a/.github/workflows/lab-instance-tools.yml +++ b/.github/workflows/lab-instance-tools.yml @@ -19,3 +19,4 @@ jobs: with: python-version: '3.12' - run: python3 -m unittest discover -s devtools/lab -p 'test_lab_instance.py' -v + - run: python3 -m unittest discover -s devtools/lab -p 'test_cfr_steps_to_story.py' -v diff --git a/SerialPrograms/Source/CommonFramework/Windows/Lab.md b/SerialPrograms/Source/CommonFramework/Windows/Lab.md index 37ccad0e5e..0bde2bbefc 100644 --- a/SerialPrograms/Source/CommonFramework/Windows/Lab.md +++ b/SerialPrograms/Source/CommonFramework/Windows/Lab.md @@ -27,6 +27,7 @@ takes effect at the next launch. | `Lab/done/.txt` | app moves | The request, moved here when it starts. | | `Lab/outbox/.out` | app writes | The request's journal (below). It appears only once the request has finished; `.tmp` shows the progress so far. | | `Lab/outbox/_