Skip to content

Fair rotation and a faster backlog drain for live-402 pricing - #716

Merged
MikeyPetrillo merged 4 commits into
mainfrom
claude/sweet-brown-i99jl3
Aug 7, 2026
Merged

Fair rotation and a faster backlog drain for live-402 pricing#716
MikeyPetrillo merged 4 commits into
mainfrom
claude/sweet-brown-i99jl3

Conversation

@MikeyPetrillo

Copy link
Copy Markdown
Owner

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: quoteSource is 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, plus networks only where 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%.

MikeyPetrillo and others added 4 commits August 7, 2026 12:49
…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>
@MikeyPetrillo
MikeyPetrillo merged commit 777406c into main Aug 7, 2026
20 checks passed
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