# Stage 72: Hash Ring, Scaling & SPC (aq72_route_hash_ring_and_spc / DB-UNIT-16)

Dispatches 50+ bots via bounded-load consistent hash rings (c=1.25), deficit WRR, and aging priority queues while monitoring latency, throughput, downtime, and stuck leases on SPC control charts.

- Atomic micro-queue: `aq72_route_hash_ring_and_spc` (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: Bounded Hash Ring, Aging Priority & WRR, Shewhart/EWMA/CUSUM SPC

## Execution engines & AI Agent freedom contract

- **Deterministic (0 model calls)**: `quota_aup_and_spdx_eligibility_router_v1` (Bounded consistent-hash router, starvation-free priority ager & 3-sigma/EWMA/CUSUM monitor)
- **Hybrid (<=1 model call)**: `capacity_feed_anomaly_and_deprecation_watcher_v1`
- **AI Agent & Bot Fleet (1..6 calls)**: `provider_terms_and_allowance_scout_v1` (Fleet bottleneck diagnostician & horizontal/vertical scaling planner)
  - 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 cache-sensitive prefixes via consistent hash rings with automatic c=1.25 spillover
- Prevent low-priority queue starvation via monotonic wait-time priority aging
- Trigger horizontal slot expansion or vertical high-RAM routing when SPC charts detect drift

## 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)
