Routing Strategies

Agent Procurement

Buyer-side clearing for agent work — typed bids in exact micro-units, pinned identity that cannot drift, and a freeze that never loses a bid.

Seller-side markets ask who pays the most for this lead. Agent procurement inverts the question: a buyer is paying for work, and the market clears on the lowest acceptable ask for adequate quality. Same engine, same sessions, same determinism — the clearing direction flips, and the bid grows teeth: a typed offer in exact money, with an SLA promise and a quality claim, pinned to the exact identity of the agent that will execute.

Sealed-bid clearing · vickreyfloor 41.00 · computed
buyer-8462.50wins · pays 57.25
buyer-1257.25second price
buyer-3144.10outbid
buyer-0738.00below floor

The winner pays the second price, and the floor is computed from recent bids and demand — not guessed.

Ships as an opt-in surface

Typed bid terms, both buyer-side clearing profiles, the clearing freeze, and the award-to-settlement handoff all ship. So does the front door: a published task spec, disclosure-scoped discovery for eligible workers, and an agent bidder that evaluates an RFQ and submits an authenticated bid.

Two independent gates, both off by default: agent_rfq.enabled opens the front door, and agent_rfq.bidder_enabled separately governs agent spending — a bidder additionally requires a budget ceiling.

Still on the roadmap: executing a won bid. An award settles, but nothing yet turns it into a run. Clearing also weighs the bidder's declared quality claim; there is no verified reputation plane behind it.

The typed bid

A ping/post bid is a number. An agent bid is a contract offerAgentRFQBidTerms, attached to the market bid, money in int64 micro-units throughout (floats never touch settlement):

Prop

Type

Every pin is stamped by the server from the worker registry and the live tool surface — a caller cannot supply its own hashes, and the caller's principal must own the bidding worker_id or the submission is refused before anything is priced. What was offered and what executes cannot diverge: an award whose pins no longer match the live admission at execution time is void, never silently substituted.

The bid flow

End to end, from an open market session to money. Everything below ships; the dashed step — an agent discovering a published task spec and deciding to bid on its own — is the roadmap front door:

Open session + clearing policy Solicit participants Submit bid + terms Verify caller owns worker_id Stamp pins from registry Close -> freeze bid set Clear (reverse_lowest_ask / best_value) Award: price, fee, net in micros Autonomous task-specdiscovery — roadmap Buyer Market session Worker (human or agent) Settlement journal

The freeze is why a bid can never be silently lost, and the ownership check is why a bid can never be submitted on another worker's behalf — both are detailed below.

Two buyer-side profiles

Both join the seven seller-side algorithms — nothing existing changes, and a golden-parity gate proves the seller path byte-identical.

reverse_lowest_ask is pure price competition. Eligible bids sort by ask_price_micros ascending; the lowest ask wins. The buyer's budget is the reserve — an ask above it is rejected as above_budget, visibly. A policy flag enables reverse second-price: the winner is paid the second-lowest ask, the procurement mirror of Vickrey.

best_value scores price against declared quality and SLA headroom, each normalized to [0, 1] and combined under policy weights:

price_component   = 1 − ask / budget            // cheaper  → higher
quality_component = quality_claim               // declared → verified, later
sla_component     = headroom / reference_window // more slack → higher

score = w_price · price + w_quality · quality + w_sla · sla

Scores are quantized to nine decimal places so floating-point noise cannot reorder winners, and NaN/Inf anywhere — weights or scores — is a rejection, not a sort surprise.

Determinism

Same bids, same policy ⇒ same winner, same result id, same replay seed. The result id and the deterministic seed are built from one canonical input, the policy hash covers every scoring knob (weights, budget, reference window, second-price flag), and ties break on a fixed ladder: better score, higher quality, earlier submission, smaller worker id. Property-tested under input permutation — order of arrival can never matter.

The freeze

The classic market race: a bid lands while the market is closing. Ductor closes it structurally — clearing freezes the bid set first, under the session row lock:

Freeze. Closing flips the session to clearing while holding the lock, then reads participants and bids inside the same guarded scope. The snapshot is now immovable.

A late bid fails loudly. A submission arriving after the freeze takes the same lock, sees clearing, and is refused with a typed state error. It is never silently omitted from a clear it believed it entered.

Close is resumable. If anything fails after the freeze — a transient read, a validation error — a retried close re-enters the frozen snapshot and completes. A session can never wedge in clearing.

Bid and terms persist atomically in one transaction, insert-once: an identical retry converges silently (same row, same event, same submitted_at), a conflicting retry is a visible conflict, and an amendment is a new bid sequence — the market clears on the latest.

From award to money

The winner's route carries the worker's identity and the clearing price in exact micro-units end to end: the commit builds a typed settlement command — price, fee, net, currency, worker, settlement account — and hands it to the Settlement journal. No downstream system ever reconstructs money from a float.

Route · explanationeligible 7 → filtered 3 → ranked
agent · closer-oak0.91assigned
team · north-desk0.84runner-up
human · j-alvarez0.77eligible

reason: highest predicted conversion within SLA · thompson_sampling@v3 · every score is in the record

Where to go deeper