Skip to content

AutoStory: shared run report (stats + log lines) - #45

Draft
dayfine wants to merge 51 commits into
switch/system-keyboardfrom
autostory/r3-shared-stats
Draft

dayfine wants to merge 51 commits into
switch/system-keyboardfrom
autostory/r3-shared-stats

Conversation

@dayfine

@dayfine dayfine commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Depends on #62 (base switch/system-keyboard); the diff shows only this change. #44's story_index() landed upstream as PokemonAutomation#1828.

What an AutoStory run reports, shared by the new AutoStory programs. SV's AutoStoryStats stays in SV unchanged; Pokemon/AutoStory/Pokemon_AutoStoryStats.h holds only the new StoryRunStats for the story engines, which shows Runs, Checkpoints Passed and Resets. A story splits into segments (chapters of checkpoints), checkpoints (the stretch between two saves, the unit a run retries) and events (one step inside a checkpoint); Pokemon_StoryLog writes the checkpoint lines (start, attempt, reset, pass) in one format for every game, plus story_short_line() for the overlay; a caller whose text already says "Checkpoint::" can skip the prefix so the word is not doubled. Tested with the unit test runner: the Pokemon:: suites, including the new StoryLog ones, pass.

dayfine and others added 3 commits October 25, 2026 02:04
SV built six near-identical databases by hand. make_story_select_database()
in Pokemon/AutoStory builds a section of a story list with the same labels
(name()) and slugs (index in the whole list), so other games can reuse it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…with tests

Depends on the shared select database commit. The six SV index helpers and
the two descriptions repeated the same tutorial/main-story offset maths;
story_index() does it once and is tested with SV's offsets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Pure move, so BDSP and FRLG AutoStories can use the same stats; SV keeps the
name through an alias. The stat keys are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine and others added 9 commits October 30, 2026 07:38
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
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
dayfine added a commit that referenced this pull request Nov 1, 2026
dayfine added a commit that referenced this pull request Nov 1, 2026
dayfine added a commit that referenced this pull request Nov 1, 2026
…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
dayfine and others added 3 commits November 1, 2026 13:12
…s it

Moved here from #44 (user decision): a section of a story list keeps its
whole-list slugs and the end is clamped to the list. #44 keeps
story_index() and its tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
… autostory/r2-story-index

The select-database test now comes from #43; this branch keeps
story_index() and its tests, so the test exists once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
… autostory/r3-shared-stats

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
SV AutoStory built six near-identical start/end dropdown databases by hand
and repeated the tutorial/main-story index offset maths in six helpers and
two descriptions. make_story_select_database() and story_index() in
Pokemon/AutoStory/Pokemon_AutoStorySelect.h do each once, for other games'
AutoStory to reuse, with their tests beside them. No behaviour change.

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 13, 2026
…w fixes

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 13, 2026
…iew fixes

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 13, 2026
dayfine added a commit that referenced this pull request Nov 13, 2026
dayfine added a commit that referenced this pull request Nov 13, 2026
dayfine added a commit that referenced this pull request Nov 13, 2026
A game whose checkpoints carry their own text that already says it is a
checkpoint (SV's "Checkpoint:: 004 - 02 ...") passes it as display_text,
and the line starts with it in place of "[Checkpoint] <id>", so the word
is not doubled. The default, empty, keeps the current lines. StoryLog
cases for both forms.

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 13, 2026
…y text

run_checkpoint_with_retries() passes SV's "Checkpoint:: ..." text as
the [Checkpoint] lines' display text (#45), so the lines read
"Checkpoint:: 004 - 02 ...: start" without the word doubled, and SV keeps
passing the text it has. CheckpointAttempts carries the display text for
the pass line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine and others added 3 commits November 13, 2026 15:07
The text a [Checkpoint] line starts with is its prefix; the local is
named prefix to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
checkpoint_reattempt_loop and its tutorial variant write the shared
attempt and reset lines, plus a new pass line, with checkpoint_text() as
the display text, so SV users still see "Checkpoint:: <name>. Start
point: ..." at the start of each line. Attempts now count from 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
StoryRunCounts and record_story_counts() have no caller in this PR; their
first user is SegmentReport::story_counts() in #114, so they move there.
AutoStoryStats and the log lines stay.

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 13, 2026
StoryRunCounts and record_story_counts() move here from #45, which has no
caller of them; SegmentReport::story_counts() is their first user. Their
tests move with them as the Pokemon::StoryRunCounts suite.

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 13, 2026
…moves here from #45

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

# Conflicts:
#	SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryRunCounts_Tests.cpp
#	SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryRunCounts_Tests.h
@dayfine

dayfine commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

StoryRunCounts and record_story_counts() moved to #114, where their first user is: removed here in 8310a2a, added next to SegmentReport::story_counts() in 2a17ebb (#114, not #332: story_counts() is defined in #114).

dayfine and others added 3 commits November 13, 2026 17:04
Full lines go to the log; the video overlay shows each without its
leading "[Tag] ". Table tests in Pokemon_StoryLog_Tests.cpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
The event line moves to the story engine that writes it, and the segment
reload line goes: a reload is a checkpoint reset, written by
checkpoint_reset_line with the attempt limit. The header says what a
segment, a checkpoint and an event are.

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
The checkpoint lines take `bool add_checkpoint_prefix = true` in place of
`display_text`. SV passes its checkpoint text as `checkpoint` with the prefix
off, so NO_CHECKPOINT_ID goes. Literal positional arguments carry a
parameter-name comment. SV's reset lines now pass the attempt limit slot
explicitly (they passed the text into it before).

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
…dd_checkpoint_prefix (#45)

Conflict in PokemonSV_AutoStoryTools.cpp reset lines: took #45's add_checkpoint_prefix form.

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
…_checkpoint_prefix (#45)

Conflicts in PokemonSV_AutoStoryTools.cpp: kept this PR's retry-loop
rewrite. CheckpointAttempts::display_text becomes add_checkpoint_prefix,
and CheckpointRetry passes its checkpoint text with the prefix off.

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
dayfine added a commit that referenced this pull request Nov 14, 2026
dayfine added a commit that referenced this pull request Nov 14, 2026
dayfine and others added 4 commits November 13, 2026 22:34
…sed, Resets)

SV keeps AutoStoryStats and its saved keys (Checkpoint, Segment, Reset);
the story engines get their own stats type whose names say what they count.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autostory AutoStory programs game:shared Shared or game-neutral code refactor No behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant