Skip to content

ChromieCraft price backfill tool for AH-bot overrides#11

Merged
icemansparks merged 10 commits into
merkerhoodfrom
feature/chromiecraft-price-backfill
Jul 1, 2026
Merged

ChromieCraft price backfill tool for AH-bot overrides#11
icemansparks merged 10 commits into
merkerhoodfrom
feature/chromiecraft-price-backfill

Conversation

@icemansparks

Copy link
Copy Markdown
Collaborator

What

A standalone, zero-dependency Python tool (tools/price-backfill/) that regenerates data/sql/db-world/2023_11_16_mod_auctionhousebot_priceOverride.sql from ChromieCraft's live auction prices, filling the coverage gap where most AH-tradeable items currently fall back to fixed default pricing.

How

  • Reads candidate item IDs exported from acore_world.item_template (AH-tradeable filter: bonding IN (0,2,3), Quality <= 5, excl. quest/key classes).
  • Fetches per-item price stats from wowauctions.net's Next.js _next/data JSON endpoint (queried by item ID only; browser UA; buildId resolved fresh, re-resolved on mid-run redeploy).
  • Maps avg_price → avgPrice, minimum_buyout → minPrice; floors both at vendor SellPrice; clamps min ≤ avg; configurable PRICE_SCALE (default 1.0).
  • Full refresh of the override table, and emits deviations.csv — a worst-first review worklist of every item whose new price differs ≥1.5× from the shipped override, so contested prices can be decided by hand.

Robustness

  • Concurrent fetch with polite rate limiting, exponential backoff on 429/5xx, checkpoint/resume.
  • Worker exceptions are recorded (fetch-failed/error), never silently dropped.
  • Generation-keyed recovery pass re-fetches items falsely 404'd during a mid-run site redeploy.

Tests

cd tools/price-backfill && python3 -m unittest discover — 26 passing (stdlib unittest, no network in unit tests). Live smoke run verified end-to-end.

Notes

  • The tool writes to the working tree; the regenerated SQL is intended to be reviewed via git diff (and deviations.csv walked) before committing — it is not included in this PR. This PR is the tool, spec, and plan only.
  • Design + implementation plan under docs/superpowers/.

@icemansparks
icemansparks merged commit 128bcf4 into merkerhood Jul 1, 2026
1 check failed
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.

1 participant