diff --git a/CLAUDE.md b/CLAUDE.md index 9596d6f..1b44aa5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -862,7 +862,35 @@ ls -t log/stats/mini_stats_*.json | head -1 | xargs python -c "import json,sys;d after changing `src/`, kill and restart `main.py` — otherwise you are testing the old code and the log will show messages that no longer exist in the source. -### Bug 25: an empty rejuv column chickened the game at safe HP (2026-09-04) +### Bug 33: main's recaptured `a5_wp.png` was a crop of the mana globe (2026-09-04) +**File:** `assets/templates/a5_wp.png` +Commit `14f5876` ("recapture A5 waypoint template") replaced the real Harrogath waypoint with a +112x125 crop of the **blue mana globe**, so it matched the HUD at **0.966-0.99 on every frame**, +anywhere in the game — which is the template half of Bug 23/27. `A5.open_wp()` walked the +(teleporting) char to the bottom-right of the screen and clicked; `WaypointLabel` never appeared, +so `select_by_template` logged `Wanted to select A5_WP, but could not find it` **despite a 98% +match**, and each anchor retry pushed the char further out until it was stranded on top of the +Harrogath wall, outside walkable town. From there Larzuk, Qual-Kehk and every town marker were +off-screen, so repair, resurrect and `detect_current_act` failed too. + +`a5.py` already defends against this with `roi=cut_skill_bar` plus a best-match over +`["A5_WP", "A5_WP_2"]`, which is why the symptom was survivable on main — but the bad capture was +still one of the two candidates. Restored `a5_wp.png` to the pre-`14f5876` capture (201x120, the +real stone arch with two blue flames): it scores **0.30** on frames where the waypoint is absent, +versus 0.966 for the globe crop. Both WP templates are now genuine, so the dual search is a real +fallback rather than a workaround. + +**Diagnostic for this whole class** — a template that matches the HUD matches *everything*; score +it against a frame where the target is absent and look at WHERE it matched: +```python +import cv2 +img = cv2.imread("log/screenshots/error/.png"); t = cv2.imread("assets/templates/a5_wp.png") +print(cv2.minMaxLoc(cv2.matchTemplate(img, t, cv2.TM_CCOEFF_NORMED))[1::2]) # score, location +``` +A high score at a bottom-corner location (x>880, y>580 = the globes) means the template is HUD. +Only `a5_wp.png` was affected; every other `*_wp*.png` scores <0.46 on the same frame. + +### Bug 32: an empty rejuv column chickened the game at safe HP (2026-09-04) **File:** `src/health_manager.py` — rejuv branch of the potion ladder `take_rejuv_potion_health=0.45` triggers a rejuv attempt at 45% HP, but the real chicken line is `chicken=0.40`. When `belt.drink_potion("rejuv")` returned False the code chickened **immediately**, diff --git a/assets/templates/a5_wp.png b/assets/templates/a5_wp.png index 0f2dea0..6c2276a 100644 Binary files a/assets/templates/a5_wp.png and b/assets/templates/a5_wp.png differ