Skip to content

fix(backfill): merge-preserving regen, real recipe yields, single-flight resolve#22

Merged
icemansparks merged 5 commits into
merkerhoodfrom
fix/backfill-tooling
Jul 2, 2026
Merged

fix(backfill): merge-preserving regen, real recipe yields, single-flight resolve#22
icemansparks merged 5 commits into
merkerhoodfrom
fix/backfill-tooling

Conversation

@icemansparks

Copy link
Copy Markdown
Collaborator

Fixes three defects found in a code review of the price-backfill toolchain.

Silent override loss on in-place regeneration

backfill.py --out-sql (which defaults to --existing-sql, documented as in-place regeneration) emitted only rows derived from the current candidates run. Any currently-overridden item absent from candidates.csv (BoP gear, legendaries, or simply a narrower candidate query) silently disappeared from the regenerated SQL, reverting to default AH pricing. write_outputs() now seeds the output from the existing overrides and overlays only items present in the new records, mirroring derive.py's merge. Regression test added.

Recipe yield hardcoded to 1

spelldbc.py recorded every crafting recipe with yield 1, so multi-output recipes (e.g. basePoints=4 -> 5 per cast) were over-priced by the yield factor in recipe_prices.py, and the error propagated recursively into higher-tier recipes using the output as a reagent. Yield is now extracted as EffectBasePoints + 1 (the 3.3.5a minimum-yield formula; variable rolls use the minimum, so derived prices are never inflated). Non-positive yields (bogus data) skip the recipe with a stderr warning instead of silently pricing at yield 1. Tests cover yield-1, fixed multi-yield, recursive propagation, and the negative-basePoints skip.

Lock held across network I/O

BuildIdState.note_result held the state lock across the sentinel fetch and buildId re-resolve, collapsing worker concurrency to 1 during every redeploy check. The lock now guards only shared state; a _resolving flag (held until the buildId update completes) keeps the re-resolve single-flight. Concurrency tests added (verified to fail against the pre-fix code).

Test suite: 51 passed.

@icemansparks
icemansparks merged commit ab3cddd into merkerhood Jul 2, 2026
1 check passed
@icemansparks
icemansparks deleted the fix/backfill-tooling branch July 2, 2026 14:51
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