The bare "config-3.py" omit never matched the phantom's absolute path
(D:\a\...\config-3.py), so coverage xml only survived via --ignore-errors
and still logged the alarming "No source for code" line. Use a glob
(*config-*.py) that matches the phantom at any path while keeping
src/config.py measured (verified via coverage GlobMatcher).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Make the standalone exe work with OCR out of the box — no separate
Tesseract install, no tesserocr DLL hell. Verified end-to-end: built the
exe, ran it frozen with the system Tesseract blinded, confirmed it
resolves the bundled binary and reads text ("CHAM RUNE").
- ocr.py: resolve an _APP_BASE (exe dir when frozen, else cwd) and prefer
a bundled <exe_dir>/tesseract/tesseract.exe over PATH / Program Files.
Resolve assets/tessdata to an absolute path so OCR no longer depends on
the current working dir. Applies to both the tesserocr and pytesseract
paths.
- build.py: copy a portable Tesseract (exe + DLLs) from TESSERACT_DIR
(default C:\Program Files\Tesseract-OCR) into <release>/tesseract/. Our
trained models in assets/tessdata are used via --tessdata-dir, so their
tessdata is skipped. Warns (non-fatal) if Tesseract isn't present.
- ci.yml: choco install tesseract before the build so the bundle is
reproducible on the runner; verify it landed in the release dir.
- test/conftest.py: apply the SSL cert-store workaround so pytest can be
collected on Windows boxes with a corrupted cert store (no-op on CI).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- git rm --cached data/d2jsp_pages (102 files, already gitignored) — saved
authenticated HTML embedded the live d2jsp msec session token
- apply_manual_cookies.py: read member_id/msec from env vars instead of
hardcoding the real session token
History purge of these blobs follows in the same cleanup.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pre-public cleanup:
- Remove cookies.txt from tracking (held live d2jsp session cookies
member_id + msec) and delete the local copy
- .gitignore: cookies.txt, cookies_temp*, *.cookies, config/custom.ini
- fg_scrape_pipeline.sh: replace hardcoded /c/Users/alex/Downloads path
and /c/Python313/python with a script-relative cd and $PYTHON from PATH
NOTE: cookies.txt still exists in git history (commit e3d6605) — a
history purge + cookie rotation is still required before going public.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Switch from the upload-to-an-existing-release model (create release in
UI/CLI first, release:published triggers CI) to a tag-driven flow:
git tag v0.8.5 && git push --tags
-> CI builds + smoke-tests both exes
-> softprops/action-gh-release creates the release and attaches the zip
Build fails => no release is ever created (no more empty/half-published
releases). Removes the release: trigger so the workflow can't double-fire
when the action publishes the release. Keeps permissions: contents: write.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The build job's "Upload to Release" step failed with HTTP 403
"Resource not accessible by integration" because the default
GITHUB_TOKEN is read-only. Add top-level permissions: contents: write.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Verified by building locally and running both exes to their menus.
build.py: prepend the conda env's Library\bin, Library\lib and DLLs
dirs to PATH before invoking PyInstaller. PyInstaller resolves binary
deps via PATH (not --paths, which only affects Python imports), so
without this the frozen exe crashed at startup with
"DLL load failed while importing _ctypes" (missing ffi-8.dll, plus
liblzma/libbz2). Now ffi-8/lzma/bz2/leptonica/tesseract52 all bundle.
src/shopper.py: mirror main.py's startup header — add the
ssl.load_default_certs monkey-patch (corrupted Windows cert store made
aiohttp crash at import with ASN1 NOT_ENOUGH_DATA) and drop Library\bin
from os.add_dll_directory (it ships mismatched OpenSSL DLLs that break
_ssl). shopper.exe previously crashed on any machine with a bad cert
store; CI's clean runner masked it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Split monolithic 'Validate Botty' into 4 named steps so failures are
visible per-step without log diving: Python version / Syntax check /
Tests / Coverage report
- Add scripts/ to compileall so new scripts are syntax-checked too
- Add -v to pytest for per-test pass/fail in CI output
- Fix coverage xml exiting 1 on conda phantom config-3.py:
- Move ignore_errors to [report] section (was wrongly in [xml])
- Add --ignore-errors flag on coverage xml command (belt+suspenders)
- Omit config-3.py and site-packages paths from [run] tracking
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- pickit: run-scoped loot accumulator (item names of every successful
pickup), consumed once per run.
- bot._run_wrapper: at run end (success, battle-fail, and approach-fail
paths) logs "Loot from run_diablo: JAH RUNE, 2x FLAWLESS SAPPHIRE" (or
"nothing picked up") at INFO level.
- game_stats: run_finished events now carry a counted loot dict, so
events_*.jsonl can be mined for per-boss drop value over time.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Session evidence (2026-06-11/12): 2 merc deaths vs Hell Diablo with exactly
1 heal fired and 0 rejuvs. The pipeline works (read 30% -> fed a potion)
but the tuning loses: Hell bosses chunk a merc 30-50% per hit, so the
25% rejuv band was skipped straight past between polls, leaving only the
slow 10.24s-cooldown health pot branch. Rejuv (instant, 4s cooldown) now
covers the real danger band under 45%; pots top up from 70%.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The most valuable drop must never be lost to pickup order or a chicken:
- pickit: ground items now sort high-value-first (HIGH_VALUE_KEYWORDS:
Ist+ runes, Tyrael's, DWeb, Griffon's, SoJ, facets, HC, etc.), nearest
of them first, junk after - if looting gets interrupted, the Jah is
already in the bag.
- dive mode (health_manager.set_loot_priority): while a high-value drop
is being picked up, the chicken threshold is halved (hard floor 20%
HP), the two-juv panic and merc chicken are suppressed, and potions
keep flowing - the bot spends its belt to secure the item instead of
save+exiting away from it. Auto-expires after 15s so a stuck flag can
never disable safety permanently; engaged/cleared around each
high-value pickup attempt.
Unit-tested (Jah-first ordering incl. over nearer gold/potions, flag
expiry) and validated in a live profile-enabled Pindle run.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per-user character profiles (gitignored, survive git pulls):
- config/profiles/<name>/profile.ini overrides any params.ini key
(runs, difficulty, char type, keybinds...). Priority:
custom.ini > profile.ini > params.ini. Injected into _select_val and
all 22 build-section merges.
- Active profile selected via config/active_profile.txt (gitignored);
Config.get/set_active_profile + list_profiles/list_pickit_profiles.
Shared pickit profiles (git-tracked team content):
- config/pickit_profiles/<set>/*.bnip - one folder per season phase,
built once, shared via git. Selected per user with
[general] pickit_profile=<set> in their profile.
- Pickit dir priority: config/profiles/<me>/pickit/ (personal)
> config/pickit_profiles/<set>/ > config/bnip/ > default.bnip.
Menu integration (main.py):
- startup banner shows active profile + pickit set + available lists
- "end" hotkey cycles character profiles (applies on restart)
Verified: fistman profile active end-to-end (general/char/build-section
overrides + shared pickit set resolution + 474 expressions loaded).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mirrors the D2R settings check: on the first on_maintenance of a bot
session, validate_build_skill_icons presses each configured skill hotkey
and verifies the icon on the right slot, warning loudly (with a pointer to
tools/set_binds_from_params.py) when a bind does not match params.ini.
Non-blocking; ~5s once per session.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Live finding (fresh game, 2026-06-12): D2R skill hotkeys select onto the
RIGHT skill slot, not the left as the old comments assumed. The left slot
permanently holds Blessed Hammer. Consequence: _cast_hammers pressing the
hammer hotkey after activating an aura was REPLACING the aura on the right
slot every cast cycle - the true root cause of fights running without
Concentration. _cast_hammers no longer touches the hammer hotkey: select
aura (lands on right, stays active), hold stand-still, spam left-click.
Verified live: full Diablo kill at 09:04, ~55s from last seal to kill.
Auto skill binding proven end-to-end (tools/set_binds_from_params.py):
blessed_hammer/concentration/redemption/vigor/holy_shield/teleport all
bound via the in-game picker and visually verified (6/7 OK; conviction
correctly reported missing - not skilled on this char).
- capture tool + preflight verify now watch the RIGHT slot
- fresh skill slot templates + clean PICKER_* cell templates captured at
current settings (blessed_hammer, concentration, redemption, vigor,
holy_shield, teleport)
- removed bogus conviction.png (had captured vigor's icon)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
transfer_items now filters protected items out of BOTH the sell and drop
paths (previously only shields, only on sell): anything whose name contains
"charm" is blocked by default (charms live in the inventory permanently -
a pickit misread must not vendor them), shields stay protected, and
never_sell_keywords in [char] params can extend the list. Blocked items
stay untouched in the inventory.
Motivated by a real grand-charm-sold-by-mistake incident.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Layer 1 (Controls page / .keyo): tools/set_controls_keyo.py parses the
character keyo (same binary format as utils/key_detector) and verifies every
skill hotkey in params.ini is bound to a skill slot; --fix writes missing keys
into free skill slots with a backup (D2R must be closed). Picks the configured
character file. Verified: fistman controls match params.
Layer 2 (skill assignment / picker): enabled the existing skill_hotkey_setter
machinery for the hammerdin build:
- skill_preflight: hammerdin build rules (blessed_hammer left/required,
concentration right/required, redemption/vigor/conviction/holy_shield/
teleport right/optional) + PALADIN_TEMPLATE_ALIASES, merged TEMPLATE_ALIASES.
- skill_hotkey_setter: paladin picker template aliases with slot-icon fallback.
- tools/set_binds_from_params.py: end-to-end runner - opens the in-game picker,
binds each skill to its params hotkey, verifies via slot icon, reports
match/mismatch per skill.
- tools/capture_skill_hotkeys.py now saves crops straight into
assets/templates/ui/skills/ so captures immediately become live templates
for both the preflight and the picker search.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- hammerdin.py _cast_hammers: skip aura/hammer re-selection when the slot
already holds the wanted skill (tracked via _active_skill, invalidated by
pre_move/_weapon_switch/cast_buffs and all raw redemption/vigor hotkey
sends). Visible effect: aura stays on right-click and hammers fly from
plain left-click spam instead of constant F1/F3/F8 churn.
- 35 mid-clear attack casts switched from Redemption to Concentration
(damage aura while fighting); Redemption still pulses between packs and
after kills for corpse cleanup.
- DEPENDENCIES.md: full verified working-state snapshot (env paths, package
versions, tesseract wiring, D2R settings, DPI specifics, safety nets).
- tools/capture_skill_hotkeys.py: presses each params.ini skill hotkey
in-game and saves labeled left-slot icon crops - verifies binds match the
character and builds skill-icon templates for future aura checks.
- CLAUDE.md: remove stale main.exe mention (no exe build exists; bat runs
current source directly).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Session fixes (2026-06-11), all live-tested over multiple farm games:
- input_layer/hotkey.py: no-arg keyboard.wait() returned on ANY keypress,
silently killing the process right after F11 (all bot threads are
daemons). Now blocks forever like the original keyboard lib. Poll loop
is edge-triggered (no ~20ms refire while a hotkey is held) and callback
exceptions print instead of being swallowed. (Bug 13)
- d2r_image/ocr.py: pytesseract never read PYTESSERACT_TESSERACT_CMD;
tesseract_cmd is now wired from env var / PATH / winget default, fixing
exit 0xC0000135 on every OCR call. (Bug 14)
- bnip/utils.py + config/default.bnip: undefined NipSyntaxError ->
BNipSyntaxError, and Shaefershammer -> Schaefershammer typo; 474 pickit
expressions load (was 473 + parser error). (Bug 15)
- town_manager/a5/bot: A5 WP death-loop containment - per-game WP failure
budget (2 strikes), quick=True direct-path-only retries, sweep trimmed
10->6 steps with 4s select timeouts, A5 select thresholds lowered
(WP 0.62, stash 0.60/0.45; safe - every select is success_func-gated).
Worst case dropped from 10+ min wandering to ~4.5 min contained fail
with fresh-game recovery. (Bug 16)
- bot.py: vendor trip gating - the failure-prone A5->A4 Jamella round
trip now only runs when consumables are needed or 3+ sell items pend.
- town_manager.py: Cain identify skips acts whose Cain timed out this
session (straight to working A5 fallback).
- char/i_char.py: Battle Command buff check waits 0.6-0.8s after the
hotkey (icon fade-in) to reduce double weapon-swaps.
- char/paladin/hammerdin.py: kill_diablo fights with Concentration
instead of Conviction (useless for magic-damage hammers) and drops
mid-fight Redemption downtime - faster kills, merc survives. (Bug 17)
- inventory: stash supports all 6 pages (personal + 5 shared, D2R 2.7+);
gold deposits navigate via OCR-verified select_stash_page instead of
raw 4-tab clicks; rotation %6, shared-first starts at page 5. (Bug 18)
Docs: CLAUDE.md Bugs 13-18; .hermes/plans/dia_run_test_state.md has the
full test log (two complete Diablo kills verified end-to-end today).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
OpenSSL 3.x + corrupted Windows cert store causes aiohttp to crash
at import time. Monkey-patch ssl.SSLContext.load_default_certs to
fall back to certifi when Windows store fails.
traverse_nodes previously gave up after one random-guess move when a node
template wasn't on screen, failing every travel path where the char was
mis-positioned (the A5-after-Pindle stranding was the worst case). Now,
on timeout during travel pathing (timeout > 3.1s, so boss approaches keep
their fast fail), it walks an expanding 12-step sweep, re-scanning for the
node each step, and only fails once the sweep is exhausted. Makes ALL
node pathing self-healing, not just A5.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The A5 waypoint was unopenable after a Pindle return: the char lands in
the NE near Anya, where the town_start->WP node templates are off-screen,
so the pather random-guessed and timed out. Pathing to NPC spots
(Qual-Kehk/Malah) DOES work from there, and each has a defined path to
the WP. New open_wp: direct -> re-anchor via Qual-Kehk/town_start/Malah
-> directed sweep that re-attempts node pathing + full-screen WP scan
each step. This is the linchpin: it unblocks the A5->A4 vendor redirect,
maintenance, stash, and the Diablo run's travel out of A5.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CRITICAL loot-loss bug: buy_consumables failure called end_game and
returned BEFORE the stash step, so Pindle runes/items piled in inventory
and were never banked (zero stash events across a whole session). Buying
pots is optional (belt refills from drops); stashing loot is the point.
Now warn + re-anchor + fall through to stash. Also raise
max_maintenance_time_s 120->240 so the A5 vendor thrash completes and
reaches stash instead of timing out first (transitional — disappears once
a Diablo run shifts spawns to A4).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A5-spawn games burn on the Malah vendor step (stale patch templates);
A4-spawn games sail through Jamella. The Diablo run ends with a TP to
A4 town, so running it LAST makes every next game spawn in A4.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The blind ESC after a failed sweep click opens the ESC game menu when no
dialogue was actually open (seen covering the screen during the Tyrael
hunt). Detect SaveAndExit after the ESC and close the menu again.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diablo died in 22s but picked_up_items was false: his death animation /
lingering effects register as visible targets, so the mobs-alive guard
skipped his drops. pick_up_items(force=True) at the Diablo loot site.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The sweep for Tyrael clicked Deckard Cain (stands in the same zone) and
left his TALK dialogue open, blinding the rest of the sweep. Also sweep
the full search area as a second pass since NPCs can stand outside the
stored ROI, with a total time budget.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- OCR reads FISTMAN as "fabiman" — SequenceMatcher >= 0.6 on the first
word of the row handles the mangling
- start_bot_detached.bat kills existing main.py instances first: F11/F12
are global hotkeys, so duplicate bots receive every press and fight
each other (one starts while the other pauses/exits)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Body templates went stale with the June 2026 patch (Malah, Cain,
Tyrael, Larzuk, Qual-Kehk all undetectable), but name tags on hover
score 0.9+ reliably. When the body-template hunt times out, sweep a
coarse hover grid over the NPC ROI and click wherever the name tag
appears.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
User-tuned detection thresholds and a safety guard against teleporting
into live packs during loot phases.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A misclick on the stash chest (Cain stands beside it) opens the stash
UI which covers most of the screen and blinds every template search:
NPC hunts, A5_WP selection, act detection. The old guard pressed the
inventory key, which leaves a stash panel open — ESC closes both.
Panels are now closed at hunt start, per hover-loop iteration, and
before WP traversal.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Malah wanders and her body templates predate the patch; the hunt fails
most games and the failed-hunt position strands the char. Jamella is
static and detects at 0.99+. Travel cost ~30s vs a lost game.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A full CS clear takes ~10 min; the 600s watchdog force-quit a game that
had all three seals open and was waiting for Diablo to spawn.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
After a failed NPC hunt the char can be in a corner where no path nodes
anchor; both node traverses fail and the game dies. Walk a search
pattern across the small town scanning the whole screen for the WP
template directly each step.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Seal 36 has two visual variants; dia_a2y4_36b_closed.png existed in
assets but was never searched, so the B variant could never be clicked
(8 sealdance tries then aborted the run)
- info_failed_seal_ screenshot name contained ": " (illegal on Windows)
producing 0-byte files
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
After Vizier/De Seis are dead, a failed recalibration traverse aborted
the whole Diablo run (threw away two boss kills at 13:43). The seal
stage re-anchors at the pentagram via template loop immediately after,
so just skip the extra loot pass and continue.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>