Skip to content

Max Lair: recover the boss from the summary when it is still unknown - #357

Closed
dayfine wants to merge 9 commits into
mainfrom
maxlair/recover-boss
Closed

dayfine wants to merge 9 commits into
mainfrom
maxlair/recover-boss

Conversation

@dayfine

@dayfine dayfine commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Base main; independent, the diff shows only this change.

Following PokemonAutomation#1851, a rental misread at the Max Lair boss battle no longer becomes the boss, but it left the boss empty, and BossFinder then threw "Unrecognized boss slug" when picking the boss ball on the fourth win. The new GlobalState::opponent_fits_stage() says whether a read fits the battle stage (no boss before the boss battle; at the boss battle, the known boss, or a single boss species while none is known); process_header_read returns it, so a read that does not fit falls back to the summary read, and accept_opponent() records the boss only from a fitting read. boss_if_caught() now returns the boss only after the fourth win, BossFinder is unchanged from main; a comment at the boss ball call notes it can still throw if no read in the boss battle ever gave a boss species. Tested with the MaxLair state suite (boss-state and new fits-stage cases, former TODO cases now at their correct expectations) in the headless SerialProgramsTests runner (--filter MaxLair); nothing was run on a console.

🤖 Generated with Claude Code

https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

dayfine and others added 5 commits November 10, 2026 21:52
At the boss battle, a battle-screen read that is not a single boss species
now triggers the summary read, so a rental misread no longer leaves the boss
empty. BossFinder falls back to the normal ball for an empty or unknown boss
instead of throwing.

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
Add GlobalState::opponent_fits_stage() and use it in accept_opponent()
and process_header_read(), so a read that does not fit the battle stage
falls back to the summary read. boss_if_caught() returns the boss only
after the fourth win. throw_balls() uses the normal ball when the boss is
unknown, so BossFinder stays unchanged from main.

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

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

bool boss = inferred.wins == 4;
if (boss){
// Still crashes (BossFinder throws on an empty boss) if no battle-screen

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.

This will crash if inferred.boss is still empty after battle-screen and the fallback summary read (OCR misses)

dayfine and others added 4 commits November 11, 2026 07:00
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine dayfine closed this Nov 14, 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