Quota, operator visibility and integration contracts
Fleet and pm-stack share work, but each fact needs an owner. The quota gatherer observes a provider’s plan window. A queue broker can grant a lease. A runner can attest that a command exited successfully. An operator needs to connect those records without giving any one of them more authority than it has. This chapter records the inspected implementation and proposes the contracts that still need engineering and acceptance.
H. Plan quota and admission
What the projection already decides
The pm-stack admission projection consumes observations for an exact provider binding and window. At the inspected revision a missing, retained, failed, conflicting or stale observation can yield unknown. The freshness cutoff is the smaller of the window’s policy limit and 60 minutes. A prior wall in the same period is an independent input. A measured 100% walls a window. A reading of at least 99.5% requires a preceding, consistent reading at or above that threshold, using the same denominator and at least the collection interval between them. This is a decision about admission to a window. Disabling a provider also requires less than 1% remaining in its binding window and corroborating plan-limit failures under the program’s operating policy. Admission projection · Program ruling
The S4 projection accepts a fresh, scoped wall-time forecast. It can return pace_hold for an otherwise eligible window when predicted exhaustion precedes reset by the configured margin. The default is off. Enabling it requires a single named pool and a positive integer margin. The S4 implementation merged in #13271. Its live trial remains a separate acceptance gate on #12698. Keep the decision function in pm-stack so changes to freshness, window interpretation or failure handling have one implementation and one fixture set. Flag parser · S4 acceptance
Evidence for enabling a forecast
The S3 history format carries the observed live and shadow orderings and the inputs behind their differences. A rollout needs the deployed build, first and last qualifying production ticks, missing or duplicated ticks, and outcomes scored against S2. On November 23 an operator reported 56 history lines covering 02:30–16:00 UTC. The observation establishes an initial interval. An uninterrupted week starting at its reported first timestamp would reach November 30 at 02:30 UTC. The later on-host audit dates the first qualifying record and quantifies duplicate and missing quarter-hour buckets. Post the difference rate and realized outcomes to the existing epic. Then calibrate the margin for the designated S4 pool, run its own live week, and exercise the flag-only rollback. History format · Operator observation and remaining gates
S7 has produced a weekly review. The first report scored 1,213 forecasts across a table of 17 pools, including pools with zero scored forecasts. One report proves an invocation. Repeated timer invocations, S3 history and S4 live outcomes each need their own evidence. The epic also tracks a second weekly result. First S7 report · S7 closure
Proposed Fleet interface and acceptance
Publish a versioned decision containing the pool binding, billing mode, plan window, reset time, last attempted read, last genuine measurement, quality, verdict, policy revision and evidence IDs. On expiry attempt a bounded refresh. A failed refresh records its own time and leaves the genuine observation timestamp intact. Unknown capacity leaves an established plan-only route eligible. Fresh evidence is required to rank a pool by remaining quota or to introduce a new wall. Exclude funds-backed or unknown-billing routes. Prefer eligible nonreserve pools by binding expiry; keep OpenAI in reserve. A 402 ends the attempt. Allow at most one safe retry across plan-only routes under one logical request ID. A repeated failure for that same request cannot independently confirm provider-wide disablement.
Use a fixed-clock test for fresh versus stale reads at exactly 3,600 and 3,601 seconds, an intervening failed observation between high readings, reset rollover, and 1.00% versus 0.99% remaining. The oracle is the projected verdict, reason, evidence IDs and selected billing mode. Record retries at the provider-call boundary. Add per-section coverage and error by completed reset period to the weekly report. Send allowlisted, idempotent decision and observation summaries to Atlas. Preserve unallocated shared-plan burn explicitly and keep zero-sample rows visible.
I. An operator’s cross-system read
Fleet already has queue inspection and placement session reads. The PM work inspection design has its own issue and verification history. The following is a proposal for an aggregated operator view. Check registered verbs before assigning it a command name. Existing read contracts expose authorities with different clocks, outages and access scopes. Queue inspection · Placement sessions · PM work inspection
| Operator question | Primary evidence | Behavior when evidence is incomplete |
|---|---|---|
| Which work can run? | Queue counts and unmet requirements at one broker watermark, with current lease and eligibility reason | Count quarantined work once in its stored status and expose its defect class. A failed read yields unknown depth. |
| Which runs are executing? | Placement session, dispatch receipt, provider run ID and attempt | Expose submitted, queued, running and terminal observations separately. Keep uncorrelated submissions visible. |
| Which seat and build answered? | Authenticated seat principal and observed instance, generation registry, running executable identity | Show reported aliases and verified identity separately. An available endpoint alone cannot establish a source revision. |
| What is waiting? | Append-only task events, last substantive checkpoint, recorded blocker and declared wake condition | At 48 hours without progress show the item, age and blocker. Separate a deliberate future wake from an overdue one. Heartbeats measure liveness. |
| What capacity did it consume? | Provider billing scope, run attempt, observed plan window and task allocation | Deduplicate reruns and reports by their correct identities. Expose unknown attribution and distinguish included minutes, forecasts and measured usage. |
Implement the proposed aggregator as bounded, independently failing reads. Every section returns source, scope, observation time, watermark and freshness. Authorize each source before aggregation. A denied source must reveal neither counts nor identifiers. Generate a redacted report from the same records for Atlas ingestion. Its export watermark and schema revision make replay deterministic. Preserve a link to restricted source evidence for authorized operators. Coordinate with the existing work on queue figures and lane attribution. Queue-health provenance · Lane attribution
The first acceptance fixture holds one source offline while another legitimately returns zero. A second fixture supplies terminal and late running observations in reverse order, followed by a provider rerun; independently score each attempt. A third advances the clock over 48 hours with background heartbeats and compares a scheduled sleep with an overdue wake. A fourth divides a single included run between two tasks; attributable shares plus unknown must equal provider total. Re-run the export from the same watermark and require identical record identities.
J. Atlas, ID and mcpx
Atlas search and freshness
The Fleet search crate exposes a CLI client entry point. Serving is gated separately. The existing Atlas client parity work supplies an independent backend oracle for chunk identity and ranking. Preserve that oracle as a typed client is extracted. Atlas owns index freshness. Fleet owns authorization context, request semantics, timeout, cache identity and the age shown to the caller. Search crate · Client completion record · Atlas program
Key reusable results on normalized query, filters, result bound, index generation, ranking revision and authorization scope. A bounded batch returns a typed result or error for each request. Offline reads require an authorized local corpus, a known watermark and an explicit maximum age. Test scope changes, invalidated generations, mixed-success batches and attempted use after offline expiry. Compare IDs and scores under an immutable snapshot, then test metadata age independently. Use allowlisted query templates and explicit relevance judgments to propose additions to the Atlas golden set.
ID as a library consumer
A Rust library target proves that code compiles as a library only after a consumer actually builds it. Stable embedding also requires explicit configuration, source scope, cancellation, versioned behavior and control over process effects. The queue’s client feature exposes queue client and placement modules. Broker functions have separate gates. Fleet’s secrets resolver exposes source and retry types that support explicit injection. The pm-dispatch entry accepts CLI-style arguments and returns an exit code. Preserve the distinction between pm-dispatch and remote-build placement in a library API. Queue library · Secrets resolver · PM dispatch · ID program
Start with an external ID fixture using a synthetic, scope-limited secret source and a fake clock. Require a redacted error on denial, bounded timeout and no implicit ambient source. Extend to queue and remote-build session reads using a pinned fixture and the public CLI as a parity oracle. Admit claim and completion after stale-owner fencing and lost-reply recovery pass through both the library and broker.
mcpx and rollout
Propose an initial MCP tier for scoped queue summaries, individual task inspection, session status and bounded audit pages. Bind the caller’s authenticated principal to broker policy. Enforce row, byte, time and concurrency ceilings in the server; return a scoped continuation cursor when a page is incomplete. Compare two independent client implementations with the same broker snapshot. Test revocation, a cursor copied across principals, replay, timeout and partial reads. Evaluate a mutation tier only after idempotency, lease fencing and protocol negotiation are proven. Keep command execution and secret-value export outside that interface.
| Milestone | Deliverable | Release criterion |
|---|---|---|
| V1 — observations | Serialize existing quota and status evidence; add read-only external consumer fixtures | Fixed-clock policy fixtures and CLI/library parity pass at an immutable ref. |
| V2 — shared reads | Add authorized aggregation, page bounds, Atlas generation-aware caching and MCP read adapters | A denied caller cannot recover identifiers from counts, cursors, cache entries or errors. A single-source outage yields partial evidence. |
| V3 — operations | Publish scoped report exports and measured S4 acceptance; consider queue mutation interfaces separately | Export replay is idempotent, measured trials have dated receipts, and losing a response never creates duplicate effects. |
All milestones alter shared contracts. Tie the published chapter, command inventory, supported wire revision and named test oracle to the same reviewed change. Keep the existing PM, Atlas and ID tracking issues responsible for their own acceptance.