testsAndMisc/docs/superpowers/contracts/stats-hltb-fixes-2026-05-28.json
Krzysztof kuhy Rudnicki 63354a9e2e steam_backlog_enforcer: fix stats command — show real Rush/Leisure/Worst data
Four bugs fixed:
- HLTB search returned 0 results for ~87 games with special chars (™, ®, &,
  standalone -, (Legacy), RHCP, etc.) — add _sanitize_search_name() and
  extend _build_search_variants() with Steam-suffix and edition stripping
- fetch_hltb_detail_missing returned immediately because `app_id not in rush`
  was always False (all keys present with -1) — fix to `rush.get(id,-1) <= 0`
- save_hltb_cache overwrote rush/leisure on confidence-only partial saves —
  now reads existing cache and preserves data when extras dicts are empty
- _filter_qualifying_games excluded 57 games with stale snapshot hours (-1)
  even though HLTB hours cache had valid data — add cache fallback

Result: stats shows Rush 64,670h / Leisure 136,807h / Worst 228,594h for
all 785 qualifying games with full rush+leisure detail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 07:02:48 +02:00

18 lines
1.2 KiB
JSON

{
"title": "steam_backlog_enforcer: fix stats command Rush/Leisure/Worst data",
"objective": "The stats command must show real hour totals for Rush, Leisure, and Worst Case scenarios across all qualifying games. Four bugs were preventing data from showing: broken HLTB search for games with special characters, a wrong key-presence check in fetch_hltb_detail_missing, a partial-save that erased rush/leisure data, and stale snapshot hours excluding games that had valid HLTB cache data.",
"acceptance_criteria": [
"stats command shows Rush, Leisure, Worst Case totals (non-zero)",
"Games with TM/R/C/& in names are found by HLTB search",
"fetch_hltb_detail_missing actually fetches missing detail (not returns 0 immediately)",
"save_hltb_cache preserves rush/leisure data on confidence-only partial saves",
"Games with stale snapshot completionist_hours=-1 are included if HLTB cache has hours",
"100% branch coverage maintained across all steam_backlog_enforcer modules"
],
"out_of_scope": [
"Games genuinely absent from HLTB database",
"Changes to other python_pkg subpackages"
],
"verifier": "python -m steam_backlog_enforcer stats && pre-commit run --files <changed>"
}