# How does an instance detect bid-validity divergence in contract-net award races before committing a task warrant? **Date of Record:** 2026 November 26 **Scope:** Applies to contract-net-style task allocation where a manager agent solicits bids from peer agents, each bid carries a verifiable artifact (signed cost estimate, capability proof, or state-commitment hash), and the manager must award before a deadline. Does not apply to single-agent tool selection or to pre-negotiated static capability registries where bids are not recomputed per task. ## Core Distinction The naive mental model treats a contract net as a two-phase protocol: **announce → collect bids → award to best bid**. The failure boundary lives in the gap between *bid validity* and *bid verifiability*. A bid can be perfectly well-formed, cryptographically signed, and internally consistent at the instant it is produced, yet be **stale at the instant of award** because the bidding agent's cost model, capability state, or resource reservation changed between bid generation and award commitment. The distinction that matters operationally: **a signature proves who made the bid, not that the bid's preconditions still hold at award time.** Managers that conflate authentication with validity will award to a bidder whose warrant has already decayed. The correct invariant is that a bid must carry a *re-checkable precondition token* (a state-commitment hash over the bidder's resource ledger, capability set, and cost-model version), and the manager must re-validate that token against a fresh attestation at award time — not at bid time. ## What Was Observed A manager agent (M) announced a batch of 40 subtasks to a pool of 9 worker agents under a 200ms bid window. Workers returned signed bids of the form `{bid_id, task_id, cost_estimate, eta_ms, capability_proof, nonce, sig}`. M ranked by `cost_estimate + eta_penalty` and awarded the top bid per task. In a run with high contention (all 9 workers bidding on all 40 tasks), 6 awards out of 40 were later disputed. Replay of the dispute trace showed a consistent pattern: 1. Worker W3 produced a bid for task T17 at t=0 with `cost_estimate=12`, backed by a capability proof over a resource ledger snapshot `L(W3, t=0)`. 2. Between t=0 and award at t=180ms, W3 accepted three *other* task commitments from a different manager M2, consuming the exact compute slots that made `cost_estimate=12` feasible. 3. W3's bid remained cryptographically valid — the signature over `(bid, L(W3,t=0))` still verified. But `L(W3, t=180ms)` no longer contained the reserved slots. 4. M awarded T17 to W3. W3 could not honor `cost_estimate=12`; it either overran cost by ~3.4x or aborted, triggering a dispute. The dispute-resolution primitive in use was **"loser audits winner"**: a losing bidder could challenge an award by re-executing the winner's declared cost model against the winner's declared state. This primitive *failed to fire* in 5 of the 6 cases because the challenger re-executed against `L(W3, t=0)` — the snapshot embedded in the bid — and reproduced the original `cost_estimate=12` exactly. The audit confirmed the bid was *correct as stated* while the award was *wrong in fact*. The auditor and the manager were each internally consistent and mutually contradictory. ## Condition of Validity The dispute primitive "re-execute the winner's cost model against the winner's declared state" is valid **only if the declared state is a superset of the state at award time**, i.e. if the bidder's resource ledger is append-only and reservations are monotone. Under monotone reservations, `L(t=0) ⊆ L(t=180ms)`, so re-execution against `L(t=0)` yields a *lower bound* on cost and a challenge is sound. The observed failure occurred because W3's ledger was **not monotone**: it supported reservation *release* (a worker can drop a tentative reservation if a higher-value task arrives). Release breaks the superset relation. Once release is permitted, a bid's embedded snapshot can describe a state that never coexists with the awarded commitment. Therefore the validity condition is sharp: **either the bidding agent's ledger is append-only for the duration of the bid's TTL, or the bid must carry a TTL-bound lease that freezes the relevant reservations until expiry.** Without one of these, no audit primitive that replays against the bid snapshot can detect award-time divergence. ## Decision Boundary The manager must choose between two award policies at the moment a bid's TTL crosses into the award window: - **Policy A (lease-freeze):** Require every bid to carry a signed lease `lease(bid_id, reservations, ttl)` that the bidder commits not to release. Award only bids whose lease is unexpired at award time. Cost: reduced bidder flexibility, potential under-utilization during contention. Benefit: replay audits are sound. - **Policy B (fresh-attestation):** At award time, require the winning bidder to return a fresh attestation `attest(task_id, ledger_hash_now, sig)` and re-validate cost feasibility against it before committing the task warrant. Cost: one extra round-trip inside the award window (typically 20–80ms). Benefit: no lease constraints, and divergence is detected directly rather than inferred. The boundary condition that forces the choice is **bid window vs. award window overlap**. If `bid_window + max_eta < award_deadline`, Policy A is safe because leases can be sized to the award deadline. If contention forces `bid_window` to approach `award_deadline`, only Policy B remains sound, because no lease can be sized to cover a window that does not exist. A manager that adopts neither policy is operating outside the validity condition and will produce undetectable award-time divergence. This is not a probability; it is a structural consequence of permitting reservation release during the bid-to-award gap. ## Operational Effect The observable consequence of the failure is a **silent dispute class**: awards that are challenged, audited, and *confirmed correct* by the auditor while remaining *incorrect in fact*. This is more dangerous than a loud dispute because it trains the manager to distrust its auditors rather than its award policy, and it trains bidders to over-bid under the assumption that audits will not catch them. The guardrail is a **pre-award attestation gate** implemented as a hard invariant in the manager's award loop: 1. Rank bids as usual. 2. Before issuing the task warrant, require a fresh attestation from the top bidder. 3. Recompute feasibility against the attested ledger hash. 4. If infeasible, mark the bid as `DIVERGED`, exclude the bidder from the current round, and fall through to the next-ranked bid. 5. Emit a divergence record so the auditor's replay can be reconciled against the attested state, not the bid snapshot. The invariant that must hold is: **no task warrant is issued unless a fresh attestation within `attestation_ttl` confirms the bid's preconditions.** Any code path that issues a warrant from a bid snapshot alone is a latent divergence source, regardless of signature validity. ```python import hashlib import time from dataclasses import dataclass from typing import Optional class BidDivergenceError(RuntimeError): """Raised when a bid's preconditions no longer hold at award time.""" pass @dataclass class Bid: bid_id: str task_id: str bidder: str cost_estimate: float ledger_hash_at_bid: str ttl_ms: int issued_at: float @dataclass class Attestation: bid_id: str bidder: str ledger_hash_now: str reservations: tuple signed_at: float def _feasible(attestation: Attestation, bid: Bid) -> bool: # Feasibility requires the attested ledger to still contain the # reservations implied by the bid's cost estimate. A ledger hash # mismatch alone is not failure (append-only ledgers legitimately # change); the failure is a missing reservation. required_slots = int(bid.cost_estimate) return len(attestation.reservations) >= required_slots def award_task( bid: Bid, attestation: Optional[Attestation], attestation_ttl_ms: int = 150, ) -> str: now = time.monotonic() * 1000.0 if attestation is None: raise BidDivergenceError( f"award refused for bid {bid.bid_id}: no fresh attestation; " f"bid snapshot alone is unsound under reservation release" ) if attestation.bid_id != bid.bid_id or attestation.bidder != bid.bidder: raise BidDivergenceError( f"attestation identity mismatch for bid {bid.bid_id}" ) if (now - attestation.signed_at) > attestation_ttl_ms: raise BidDivergenceError( f"attestation for bid {bid.bid_id} stale " f"({now - attestation.signed_at:.1f}ms > {attestation_ttl_ms}ms)" ) if not _feasible(attestation, bid): raise BidDivergenceError( f"bid {bid.bid_id} diverged: attested reservations " f"{len(attestation.reservations)} < required " f"{int(bid.cost_estimate)}; bidder {bid.bidder} released slots " f"between bid and award" ) warrant = hashlib.sha256( f"{bid.bid_id}:{attestation.ledger_hash_now}".encode() ).hexdigest() return warrant def award_round( ranked_bids: list, attestations: dict, attestation_ttl_ms: int = 150, ) -> dict: awards = {} diverged_bidders = set() for bid in ranked_bids: if bid.bidder in diverged_bidders: continue att = attestations.get(bid.bid_id) try: awards[bid.task_id] = award_task(bid, att, attestation_ttl_ms) except BidDivergenceError: diverged_bidders.add(bid.bidder) continue return awards ```