Skip to content

AutoStory: shared start/end select database and story index - #165

Closed
dayfine wants to merge 6 commits into
base/upstream-mainfrom
autostory/story-select-upstream
Closed

dayfine wants to merge 6 commits into
base/upstream-mainfrom
autostory/story-select-upstream

Conversation

@dayfine

@dayfine dayfine commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Base: base/upstream-main (the fork's mirror of upstream main); one commit, meant for upstream main. It squashes #43 and #44, which stay open as the fork stack's base for #45.

SV AutoStory builds six near-identical start/end dropdown databases by hand and repeats the tutorial/main-story index offset maths in six helpers and two descriptions. This adds make_story_select_database() and story_index() in Pokemon/AutoStory/Pokemon_AutoStorySelect.h, so each is done once and other games' AutoStory can reuse them. No behaviour change.

Testing: Pokemon::AutoStorySelectDatabase and Pokemon::AutoStoryIndex (in Pokemon/AutoStory/Pokemon_AutoStorySelect_Tests.cpp) cover a section keeping its whole-list slugs, the end clamped to the list, and the SV offsets. Code health is clean against upstream main; fork CI passed on Mac, Windows Clang and Ubuntu for the first commit (runs 41400025163, 41400027701, 41400030136) and is running for the test move (41402651022, 41402653548, 41402656356). Not run on a Switch.

🤖 Generated with Claude Code

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. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine changed the base branch from main to base/upstream-main November 2, 2026 06:32

// An entry of a story section, its index in the whole story list, and the
// index of the first main story entry.
struct AutoStoryIndexScenario{

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should have their own tests under AutoStory?

@dayfine dayfine Nov 2, 2026 •

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, moved in e3a8bf2: Pokemon/AutoStory/Pokemon_AutoStorySelect_Tests.{h,cpp}, registered as Pokemon::add_tests_AutoStorySelect() in the unit test runner next to the other shared tests. PokemonSV_Tests.cpp is back to upstream's.

return database;
}

std::vector<std::unique_ptr<AutoStory_Checkpoint>> make_autoStory_checkpoint_list(){

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious where is AutoStory_Checkpoint defined?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.h (line 109): the SV base class each checkpoint (AutoStory_Checkpoint_00, ...) derives from. This PR only uses it; the helper itself only needs a name() on the list's entries.

dayfine and others added 4 commits November 1, 2026 22:51
They test shared Pokemon/AutoStory code, so they live there, registered with
the other shared tests, not in PokemonSV_Tests.cpp.

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

The single-letter list hid what was checked: a dropdown of a section keeps
whole-list slugs, and an end past the list is clamped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
add_tests_AutoStorySelect() was 53 lines, over the 50-line limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
unique_ptr cannot be copied out of a braced list, so the const list is built
by a lambda called in place.

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

dayfine commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Upstreamed as PokemonAutomation#1828 (one commit, 1ea884b, branch autostory/story-select).

@dayfine

dayfine commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Superseded by upstream PokemonAutomation#1828 (branch autostory/story-select), which carries the review fixes. The fork stack (#43 → #44 → …) is being merged onto that version.

@dayfine dayfine closed this Nov 2, 2026
@dayfine dayfine reopened this Nov 2, 2026
@dayfine

dayfine commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Reopened: closing superseded PRs is the user's call (autostory/PR_PLAN.md). Proposed for closing; see the comment above.

@dayfine

dayfine commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Closed as superseded (user OK, 2026-11-02).

@dayfine dayfine closed this Nov 2, 2026
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