Skip to content

BBQ Farmer: log quest boards and attempts - #1625

Closed
dayfine wants to merge 2 commits into
PokemonAutomation:mainfrom
dayfine:bbq/diagnostics-and-baseline
Closed

dayfine wants to merge 2 commits into
PokemonAutomation:mainfrom
dayfine:bbq/diagnostics-and-baseline

Conversation

@dayfine

@dayfine dayfine commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Depends on: #1631. Merge #1631 first. Until it merges, this PR also shows #1631's commit; only the last commit is new here.

BBQ failures are hard to attribute to a specific quest and attempt from the existing logs. This adds one-line BBQ ... diagnostic events.

Changes

  • Programs/Farming/PokemonSV_BBQLogger.{h,cpp} depends only on Logger and Options/PokemonSV_BBQuests.h (from PokemonSV: move BBQ quest identity into its own Options module #1631). The quest and catch/photo modules call into it, and nothing points back.
    • BBQLogger::board(): whether the panel was detected, and the quest slugs in board order. Called from read_quests().
    • BBQLogger::battle_entry_timeout() and retry_exhausted().
    • BBQAttemptLog: start / route_return / result for each attempt, with attempt/limit, and route, verification and total durations in both ms and a readable form (duration_to_string).
  • Unknown quests log as unknown.
  • Four PokemonSV::BBQDiagnosticLogs tests use a recording logger and fixed steady_clock timestamps. They cover board formatting, success, failure with retry exhaustion, and long/zero durations.

Example:

BBQ event=board panel_detected=1 quests=photo-swim,sneak-up,auto-10
BBQ quest=catch-any attempt=2 limit=2 event=start
BBQ quest=catch-any attempt=2 limit=2 event=route_return elapsed_ms=3345 elapsed="3.345 seconds"
BBQ quest=catch-any attempt=2 limit=2 event=result outcome=still_on_board verification_ms=765 verification="0.765 seconds" total_ms=4110 total="4.110 seconds"
BBQ quest=catch-any event=retry_exhausted recovery=skip_current_batch

Validation

Native arm64 macOS build of the full app passes. The 4 BBQDiagnosticLogs tests and #1631's round-trip test pass. No new Switch trial was run for this rework.

Scope

Controller sequences, retry limits and reroll policy are unchanged. Logging the BP balance on the board event will be a small follow-up once #1628 (BP OCR crop) merges. Failure screenshots are in #1629.

🤖 Generated with Claude Code

@dayfine
dayfine force-pushed the bbq/diagnostics-and-baseline branch from 155646c to 4ce2d5d Compare October 20, 2026 22:30
@jw098

jw098 commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Do you have a screenshot of the failing OCR read (remember to use the Screenshot button to get accurate screenshots)? If so, you can then add it to the test suite.

@dayfine
dayfine force-pushed the bbq/diagnostics-and-baseline branch from 4aa5a95 to c0d2540 Compare October 21, 2026 02:57
@dayfine dayfine changed the title BBQ Farmer: add attempt diagnostics and fix BP OCR crop BBQ Farmer: log quest boards and attempts Oct 21, 2026
@dayfine

dayfine commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@jw098 Added — the failing frames (6750 → read as 67501) are now regression tests in #1628, split out from this PR. Would you mind taking a look? CI also needs a maintainer to approve the workflow runs since this is my first contribution.

The BBQuests enum lived in Options/PokemonSV_BBQOption.h, but its slug
map and string_to_enum lived in Programs/Farming/
PokemonSV_BlueberryQuests.{h,cpp}. Anything that needed a quest name
had to depend on the whole BBQ program module, and
BlueberryCatchPhoto.h included BlueberryQuests.h only for these types
while BlueberryQuests.cpp included BlueberryCatchPhoto.h.

Move the enum and slug mapping into Options/PokemonSV_BBQuests.{h,cpp},
next to BBQOption.h, which now includes it. Add
BBQuests_enum_to_string, backed by a reverse map built once from the
existing slug map.

Move CameraAngle into BlueberryCatchPhoto.h, its only user. The
catch/photo module no longer includes BlueberryQuests.h.

No behavior change. Add a unit test that every quest round-trips
through its slug.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine force-pushed the bbq/diagnostics-and-baseline branch from c0d2540 to 50d9264 Compare October 21, 2026 03:27
BBQ failures are hard to attribute to a specific quest and attempt from
the existing logs. Add one-line "BBQ ..." events:

- board: panel detected and quest slugs in board order, each time
  read_quests() reads the panel
- per attempt: start, route_return and result, with attempt/limit and
  route, verification and total durations
- catch battle-entry timeout, and retry exhaustion

BBQLogger depends only on Logger and the Options/PokemonSV_BBQuests
leaf, so the quest and catch/photo modules call into it without a
dependency back. Durations use explicit steady_clock timestamps so
tests can check them without depending on wall-clock time.

Add four PokemonSV::BBQDiagnosticLogs tests with a recording logger
covering board formatting, success, failure with retry exhaustion, and
long/zero durations. Controller sequences, retry limits and reroll
policy are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine force-pushed the bbq/diagnostics-and-baseline branch from 50d9264 to 0ceac54 Compare October 21, 2026 03:32
@Mysticial
Mysticial requested review from kichithewolf and removed request for kichithewolf October 21, 2026 05:39
@Gin890

Gin890 commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Can you delete the dialogues of you talking to your Claude on the PR? That makes it difficult to know what are the comments reviewers should follow 😃

@dayfine

dayfine commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing for now to keep the upstream queue to PRs that are ready: this one waits on unmerged parent PRs. It continues on my fork as dayfine#2, and I'll reopen it here once its parents merge.

@dayfine dayfine closed this Oct 22, 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.

3 participants