Navigate Oak's Lab and select starter Pokemon#6
Merged
Conversation
…ridian goal - Add door_cooldown system to prevent re-entering buildings after exit - Add perpendicular escape when stuck 5+ turns on axis-aligned navigation - Add waypoint skipping when stuck 8+ turns within 3 tiles of target - Make map 0 EARLY_GAME_TARGET conditional on party_count == 0 - Expand Route 1 waypoints from 2 to 7 for finer navigation - Add Viridian City milestone detection - Increase position logging frequency (every 10 on map 0, 50 elsewhere)
Introduce a system for reading Claude Code JSONL tapes and distilling them into prioritized observations written to memory files. - tape_reader.py: pure-stdlib JSONL parser with dataclasses for entries, tool uses, tool results, token usage, and session/subagent grouping - observer.py: heuristic-based observer extracting errors, file creations, session goals, subagent dispatches, and token summaries - observe_cli.py: CLI with --dry-run, --session, --reset, --project-dir - 100% test coverage (89 new tests, 226 total)
Add section explaining the tape reader and observer pipeline, what it extracts, priority classification, and CLI usage. Update project structure to include new scripts.
Distinguish between the Tapes telemetry database (.tapes/tapes.sqlite) and Claude Code session logs (~/.claude/projects/). The observer reads the latter, not the former.
Replace JSONL file reader with SQLite reader that queries the Tapes database at .tapes/tapes.sqlite. Conversations are content-addressable DAGs traced via parent_hash chains. Root nodes (parent_hash IS NULL) serve as session identifiers. - tape_reader.py: queries nodes table with recursive CTEs - observer.py: takes db_path instead of project_dir - observe_cli.py: auto-detects .tapes/tapes.sqlite, --db flag - README: rewritten to reference Tapes as the sole data source - Removed SubagentSession (not needed with Tapes node model) - Removed make_tape_entry conftest fixture (tests use SQLite now) - 220 tests, 100% coverage
Document how Tapes provides durable memory across context compaction boundaries. Describe the session start/end pattern for long speed runs and update file structure with new observer scripts.
…mon into feat/viridian-city-milestone
Add a state machine to handle Oak's Lab (Map 40) when the player has no Pokemon. The agent now: - Uses B button to dismiss Oak's dialogue without re-triggering it - Walks south from (5,3) to clear Oak's position - Walks east to the Pokeball column - Faces up toward the table and presses A to select a starter - After selection, alternates A/down to advance the rival scripted sequence while moving away from furniture Also adds: - B button support in the action dispatch loop - Oak trigger sequence with wait/mash-A for the Route 1 escort - Door cooldown improvements to prevent re-entry loops - Diagnostic screenshots and logging for lab script progression - Post-intro state capture for debugging
Contributor
Author
Agent Run ResultsRan the agent against the current branch to validate the Pokemon selection flow. Pokemon selected at ~100 turns (party goes from 0→1 between turns 90-100). Full milestone breakdown:
Wall clock time: ~3 seconds total from boot to Pokemon selection (2s for intro/naming sequence, 1s for the 100 gameplay turns). After selection, the agent gets stuck at (7,5) in the lab — the |
Resolve conflicts from observational memory work merged via both PR #4 (main) and a direct branch merge. Take main's versions for shared files (observer, tape_reader, tests). Keep branch's README with SQLite description from main.
The run() method now calls take_screenshot("post_intro", force=True)
which bypasses the screenshots flag and hits Image.fromarray on a
MagicMock. Fix by:
- Using defaultdict(int) for mock memory so _read() returns ints
- Patching agent.Image to None in run() tests that don't need screenshots
- Updating lab test assertion for new B-button dismiss phase
- Blocking PIL import in dunder_main test's runpy.run_path
Move milestone detection before maps_visited.add() so it actually fires on first visit. Add tests for door cooldown, lab phases, Oak trigger, B-button dispatch, and waypoint logging to reach 100% coverage on agent.py.
bdougie
added a commit
that referenced
this pull request
Mar 13, 2026
* fix: use game-progression map for fitness scoring instead of raw map IDs Pokemon Red map IDs are arbitrary (Oak's Lab = 40, Viridian City = 1), so using them directly as a progress signal caused Oak's Lab to score 40x higher than Viridian City despite being earlier in the game. This led evolution runs to favor params that got stuck in Oak's Lab over params that reached Viridian. Adds MAP_PROGRESS dict mapping map IDs to sequential progress values reflecting actual game order: houses -> Oak's Lab -> Pallet Town -> Route 1 -> Viridian City -> Route 2 -> Viridian Forest -> Pewter City. * style: apply ruff formatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What changed
Test plan