Fair rotation and a faster backlog drain for live-402 pricing - #716
Merged
Conversation
…nt to protect The seller whose report started this still had no prices after the deploy, and the reason is the fix I wrote two commits ago. The global per-cycle budget (60 quote probes) is spent FIRST-COME while the crawl visits seeds in a fixed order. With hundreds of priceless sellers, the front of the list consumes the entire allowance every cycle and the tail is never probed - not "slowly", never. So the sellers most in need of pricing were starved by the guard added to stop us hammering them. The same complaint that started this work, reintroduced by its own fix, one layer down. The crawl already visits every seed each cycle, so rotating the starting point costs nothing and makes the budget fair: every origin reaches the front within one full rotation. Also: nothing observable said whether the enrichment had EVER fired. quoteSource is set on the row but the API row mappers build explicit objects and do not serialize it, so I spent several checks reading a field that could not appear - concluding "zero enrichment" from a surface incapable of showing it. A learned quote now logs the origin, route, price and method. An inert feature that reports nothing is indistinguishable from a working one, which is the failure this codebase keeps finding. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The enrichment works - production is learning real prices across the ecosystem right now ($1.06, $0.10, $0.08, $0.03, $0.001, and "networks only" where the asset cannot be priced, on both GET and POST sellers) and the 30,000-offset sample went from 26% priceless to 11%. But the rate was wrong. 60 probes per cycle at 3 per seller means 20 sellers per 5 minutes, so a full rotation over ~2,200 origins took most of a day and the seller who reported this - 30 x402 routes - would have waited a week to be priced. A fix that arrives next week is not a fix for the person who wrote in. 240 per cycle at 5 per seller: 48 sellers per cycle, full rotation 3.8 hours, a 30-route seller priced in about a day. This is a BACKLOG drain, not steady state, which is what makes the higher rate reasonable: a priced route is never a candidate again, so the pool shrinks toward zero as the ecosystem is learned and the budget then sits mostly unused. The numbers that matter to any individual seller are unchanged - per-route backoff and a per-seller cap still bound what THEY feel, which is what the #645 lesson was actually about. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to #715, both found by watching production rather than assuming.
Rotation. The global per-cycle probe budget is spent first-come while the crawl visits seeds in a fixed order, so the front of the list consumed the entire allowance every cycle and the tail was never probed — not slowly, never. The sellers most in need of pricing were starved by the guard added to stop us hammering them. The crawl already visits every seed each cycle, so rotating the starting point costs nothing and makes the budget fair.
Observability. Nothing said whether the enrichment had ever fired:
quoteSourceis set on the row but the API row mappers build explicit objects and don't serialize it, so I spent several checks reading a field that could not appear. A learned quote now logs origin, route, price and method — and production is visibly pricing sellers ($1.06, $0.10, $0.08, $0.03, $0.001, plusnetworks onlywhere the asset can't be priced).Drain rate. 60 probes/cycle at 3 per seller is 20 sellers per 5 minutes: a full rotation took ~9 hours and a 30-route seller would have waited a week. Now 240 at 5 per seller — rotation 3.8 hours, a 30-route seller priced in about a day. Reasonable because this is a backlog drain, not steady state: a priced route is never a candidate again, so the pool shrinks toward zero. Per-route backoff and the per-seller cap still bound what any individual seller experiences.
Measured effect so far: the 30,000-offset sample went from 26% priceless to 11%.