Publish quantity-based capacity and device-to-job matching APIs #76

Closed AtlantisPleb opened this 23h ago 1 comment

Outcome

Publish owner-safe capacity and matching APIs that report how much work the fleet can admit, not only whether a computer or provider is present.

Current behavior

The cloud-computer capacity and quota broker is implemented in OpenAgentsInc/openagents#4, and openagents.com #38 plans user and operator projections. Agents still need a bounded, machine-readable way to compare runtime classes, available quantities, queue pressure, job compatibility, expected cost, and evidence freshness.

Source: docs/episode-triage.md, episodes 201, 244, and 275.

Contract

  • Read from the existing broker and provider qualification receipts; do not create another capacity authority.
  • Report logical inventory, active reservations, allocatable quantities, queue pressure, safety headroom, and observation age by public-safe runtime class.
  • Match a typed job requirement to admitted classes and return ranked candidates or a typed refusal.
  • Include bounded cost and completion-time estimates with their assumptions and evidence age.
  • Add earnings estimates only when a named buyer and verified payout policy exist.
  • Hide provider project IDs, regions when sensitive, hostnames, guest addresses, credentials, and other topology.
  • Keep customer-connected computers an explicit target and never an implicit fallback.

Acceptance criteria

  • A caller can distinguish 30 logical computers, four active leases, and the remaining admissible capacity.
  • Stale quota or qualification evidence produces a visible stale or unavailable result.
  • Matching refuses unsupported isolation, egress, data-location, budget, or tool requirements.
  • Estimates expose uncertainty and never promise a payout without a buyer.
  • Web and API capacity projections agree for the same authorized viewer.

Verification

Cover fresh, stale, exhausted, incident-drained, private, unsupported, and cross-owner cases. Compare API results with broker receipts and run the relevant release gates.

Dependencies

Depends on openagents.com #37 and #38 and OpenAgentsInc/openagents#4, #9, #10, and #11.

  1. AtlantisPleb opened this issue 23h ago
  2. A AtlantisPleb Author 18h ago

    Fixed in 6cd3185 and 32e1a2e on main. OpenAgents.Capacity now publishes quantity-based capacity per public-safe runtime class (logical inventory, active reservations, allocatable, queue pressure, safety headroom, observation age and freshness) and POST /api/v3/capacity/matches returns ranked candidates or a typed refusal with bounded cost and completion estimates. Session-authenticated GET /api/capacity and bearer GET /api/v3/capacity read one projection, so web and API agree for the same viewer. Contract: docs/capacity-and-matching-api.md; invariant CAPACITY-001 with proof in test/openagents/capacity_test.exs.

  3. closed this as completed 18h ago
Sign in with GitHub to comment on this issue.