Files
Jeremy 2841ec0c4d fix: no deal verdict until the price has actually moved
A product said "Great time to buy" the moment it was added. With a flat or
single-point history the beat fraction is 0, but the current price is trivially
the lowest ever seen, so isAllTimeLow fired and floored the score at 9.5. The
claim was about a price nothing had been compared to.

DealScoreCalculator now takes hasPriceVariation and beatsOtherListings, and
short-circuits before the percentile and all-time-low logic when the price has
never moved:

- no variation, not the cheapest listing -> new `unknown` verdict, "Not enough
  data yet", score 0
- no variation but cheaper than the product's other URLs -> "Great time to buy",
  score 8. Not history, but real evidence: it is the best place to buy this today
- variation -> unchanged

isAllTimeLow is false in both no-variation cases. A low only means something next
to a high, and the flag also drives the hero's "cheapest it has ever been" line
and the dashboard's ordering.

Side effect worth having: the dashboard's "Buy now" section filters on
dealScore.score >= 6, so every newly added product used to land in it at 9.5.
An `unknown` product scores 0 and stays out.

Recomputed against real data: 3 of 11 products change, all of them two readings
at an identical price on a single URL. The rest are untouched. Existing products
keep their cached verdict until the next price change or
`artisan buddy:regenerate-price-cache`.
2026-08-08 19:11:43 +10:00
..
2026-07-02 13:55:58 +10:00
2026-06-13 13:05:05 +10:00