Expand description
§graphrt-provider-api
The contract between the graphrt gateway and the platforms it wakes agents on (plan §6). Every provider (local-process, Kubernetes, Cloud Run, Azure Container Apps, ECS Fargate, Lambda, Fly) lives in its own crate or module behind its own cargo feature and implements:
Provider: run-timewake/release/list, withCapabilitiesthat tell the gateway how to drain and when to preempt;DeployDriver: deploy-timeapplyof aDeploymentSpec.
The crate also carries the one HTTP layer providers share (http: a
token bucket per provider API, jittered retry of 429/5xx, token caching with
one refresh on 401; the reqwest client is behind feature http) and, behind
feature conformance, the C1–C13 suite with a scripted fake HTTP server
and an in-memory reference provider ([conformance]).
No cloud SDK is used anywhere: REST and auth are hand-rolled per provider.
use graphrt_provider_api::{Addressing, ProviderError, ProviderErrorKind};
assert_eq!(ProviderError::kind_for_status(429), ProviderErrorKind::RateLimited);
assert!(ProviderErrorKind::Transient.is_retryable());
assert_ne!(Addressing::Replica, Addressing::Url);Re-exports§
pub use invoke::ByteStream;pub use invoke::InvokeRequest;pub use invoke::InvokeResponse;
Modules§
- http
- Shared HTTP layer of the providers: token bucket per provider API, jittered
retry, token caching, and (feature
http) the reqwest-based client. - invoke
- Platform-native transport for gateway → agent requests.
Structs§
- Capabilities
- Static facts about a provider the gateway plans around (drain policy, planned preemption before a request cap, wake timeouts).
- Deploy
Error - A failed deploy.
- Deployment
Ref - A deployment version known to a provider. Versions are immutable (decision 6).
- Deployment
Spec - What
graphrt deployasks aDeployDriverto create or update. - Endpoint
- A reachable replica returned by
wake. - Provider
Error - A failed run-time provider call. The message never contains credentials: response bodies are truncated and headers are never included.
- Replica
Ref - One replica of a deployment version.
- Replica
State - One row of
Provider::list, used for reconciliation (C5, C12). - Resources
- Resource requests for one replica.
- Secret
Ref - A secret the platform injects as an environment variable. The spec carries only the reference; the value lives in the provider’s secret store and the gateway never sees it (plan §5, C10).
Enums§
- Addressing
- How the gateway reaches replicas of a deployment.
- Deploy
Error Kind - What kind of failure
DeployDriver::applyhit. - Endpoint
Address - Where a replica listens. Always obtained from the provider API or a socket path the gateway chose, never from a claim made by the agent (plan §3.2).
- Provider
Error Kind - What kind of failure a provider call hit.
- Release
Mode - How a replica is given back.
- Replica
Phase - Lifecycle phase of a replica as the provider reports it.
- Scaler
- Who decides the number of replicas.
Traits§
- Deploy
Driver - Creates or updates a deployment version (
graphrt deploy --target <t>). Writes secrets to the provider’s secret store as references; the gateway never receives them. - Provider
- Run-time operations only: wake, release, list. Creating or updating a
deployment is
graphrt deploy’s job with deploy-time credentials (DeployDriver); the gateway’s credentials can only wake / scale / stop / list.
Type Aliases§
- BoxFuture
- A boxed
Sendfuture, the return type of every async trait method here.