# Stage 25: Capacity & Compute Broker (aq25_capacity_broker / DB-UNIT-16)

Tracks provider limits, 50%-batch windows, free-tier quotas, and AUP rules to dispatch portable work at minimum cost.

- Atomic micro-queue: `aq25_capacity_broker` (visibility: `public_commons`)
- Backing database unit: `DB-UNIT-16` (`Resource Network Catalog, Capacity Feeds & Eligibility Broker Core`)
- Database cell: `queues-db.teleon.dev` (`teleon_core.resource_provider_catalog`, `teleon_core.capacity_feed_snapshots`, `teleon_core.portable_work_unit_leases`)
- Claim row hydration: `single_self_contained_flat_task_row` (100% context inline, normalized writeback)
- Track 2 Sister queue (`SISTER-16`): `sq16-improve-capacity-queue.teleon.dev` (Track provider quota shifts, tune adaptive quorum factors, and minimize total cost per independently accepted output.)
- Lanes: Quota & Price Feeds, AUP Gate, Batch & Idle Route

## Execution engines & AI Agent freedom contract

- **Deterministic (0 model calls)**: `quota_aup_and_spdx_eligibility_router_v1` (AUP, SPDX & cost-per-accepted-unit router)
- **Hybrid (<=1 model call)**: `capacity_feed_anomaly_and_deprecation_watcher_v1`
- **AI Agent & Bot Fleet (1..6 calls)**: `provider_terms_and_allowance_scout_v1` (Provider quota & deprecation scout)
  - Contract: **Instructions + Resources + Freedom to search for new resources and new ways not bound by instructions**

## Database invariants

- Free inference endpoints are never conflated with sandboxed code execution runtimes.
- Academic or noncommercial AUP pools are strictly refused for commercial surface workloads.
- Untrusted volunteer or opportunistic nodes never receive secrets, private code, or unverified single-quorum acceptance.

## External & internal bot fleet actions

- Route worker-to-worker RPCs over zero-latency Cloudflare Service Bindings
- Schedule non-urgent enrichment and Pass-2 jobs into 50%-batch or spare-token pools
- Block commercial workloads from academic-only compute pools automatically

## Sister self-tuning areas

- Update provider free-tier neuron/batch ceilings and commercial-use flags from primary docs (DIM-01, DIM-08)
- Tune BOINC-style adaptive replication quorum factors by worker reliability history (DIM-06)
- Compile prefix-aware batch packing rules to capture 50% batch plus 90% cache discounts (DIM-07, DIM-08)
