pub struct ServerState {Show 72 fields
pub config: ServerConfig,
pub daemons: HashMap<String, DaemonInfo>,
pub metrics: ServerMetrics,
pub started_at: Instant,
pub deploy_count: u64,
pub event_bus: EventBus,
pub supervisor: DaemonSupervisor,
pub versions: VersionRegistry,
pub dynamic_routes: HashMap<(String, String), DynamicEndpointRoute>,
pub dynamic_types: HashMap<String, TypeSchema>,
pub idempotency_store: IdempotencyStore,
pub axonendpoint_replay: AxonendpointReplayLog,
pub session: SessionStore,
pub scoped_sessions: ScopedSessionManager,
pub rate_limiter: RateLimiter,
pub tenant_rate_limiter: TenantRateLimiter,
pub request_logger: RequestLogger,
pub api_keys: ApiKeyManager,
pub webhooks: WebhookRegistry,
pub delivery_config: DeliveryConfig,
pub cors_config: CorsConfig,
pub middleware_config: MiddlewareConfig,
pub request_id_gen: RequestIdGenerator,
pub audit_log: AuditLog,
pub trace_store: TraceStore,
pub schedules: HashMap<String, ScheduleEntry>,
pub config_snapshots: Vec<NamedConfigSnapshot>,
pub execution_queue: Vec<QueuedExecution>,
pub execution_queue_next_id: u64,
pub cost_pricing: CostPricing,
pub cost_budgets: HashMap<String, CostBudget>,
pub flow_rules: HashMap<String, FlowValidationRules>,
pub flow_quotas: HashMap<String, FlowQuota>,
pub readiness_gates: ReadinessGates,
pub autoscale_config: AutoscaleConfig,
pub auto_persist_on_shutdown: bool,
pub flow_tags: HashMap<String, Vec<String>>,
pub flow_slas: HashMap<String, FlowSLA>,
pub canary_configs: HashMap<String, CanaryConfig>,
pub alert_rules: Vec<AlertRule>,
pub fired_alerts: Vec<FiredAlert>,
pub alert_silences: Vec<AlertSilence>,
pub health_history: Vec<HealthTransition>,
pub endpoint_rate_limits: HashMap<String, EndpointRateLimit>,
pub execution_cache: Vec<CachedResult>,
pub backend_registry: HashMap<String, BackendRegistryEntry>,
pub axon_stores: HashMap<String, AxonStoreInstance>,
pub dataspaces: HashMap<String, DataspaceInstance>,
pub shields: HashMap<String, ShieldInstance>,
pub corpora: HashMap<String, CorpusInstance>,
pub mandates: HashMap<String, MandatePolicy>,
pub refine_sessions: HashMap<String, RefineSession>,
pub trails: HashMap<String, TrailRecord>,
pub probes: HashMap<String, ProbeSession>,
pub weaves: HashMap<String, WeaveSession>,
pub corroborations: HashMap<String, CorroborateSession>,
pub drills: HashMap<String, DrillSession>,
pub forges: HashMap<String, ForgeSession>,
pub deliberations: HashMap<String, DeliberateSession>,
pub consensus_sessions: HashMap<String, ConsensusSession>,
pub hibernations: HashMap<String, HibernateSession>,
pub ots_secrets: HashMap<String, OtsSecret>,
pub psyche_sessions: HashMap<String, PsycheSession>,
pub axon_endpoints: HashMap<String, EndpointBinding>,
pub endpoint_calls: Vec<EndpointCallRecord>,
pub pix_sessions: HashMap<String, PixSession>,
pub backend_health_probes: HashMap<String, BackendHealthProbe>,
pub backend_health_history: HashMap<String, Vec<HealthCheckRecord>>,
pub shutdown: Option<Arc<ShutdownCoordinator>>,
pub storage: Arc<StorageDispatcher>,
pub resilient_backend: Arc<ResilientBackend>,
pub tenant_secrets: Arc<TenantSecretsClient>,
}Expand description
Shared server state, wrapped in Arc<Mutex<>> for thread safety.
Fields§
§config: ServerConfig§daemons: HashMap<String, DaemonInfo>§metrics: ServerMetrics§started_at: Instant§deploy_count: u64§event_bus: EventBus§supervisor: DaemonSupervisor§versions: VersionRegistry§dynamic_routes: HashMap<(String, String), DynamicEndpointRoute>§Fase 32.b — Dynamic HTTP routes registered from axonendpoint
declarations at deploy time (D1, D11). Key is
(method_uppercase, path); value carries the metadata needed
for request-time dispatch (flow name + transport + keepalive +
source file for the negotiation classifier).
Populated by register_axonendpoint_routes after every
successful /v1/deploy. Path conflicts detected at deploy
time per D2 (deploy fails with 409 when the same
(method, path) tuple is already owned by a different
(flow_name, source_file) pair). Re-deploying the same flow
updates its routes in place.
Cross-stack contract (D11): the Python AxonServer mirrors
this state via FastAPI route registration; both stacks
produce byte-identical route sets from the same source.
dynamic_types: HashMap<String, TypeSchema>§Fase 32.c — Per-name type T { … } snapshot consulted by the
dynamic-route fallback handler at request time to validate the
HTTP request body against the axonendpoint’s declared
body: T. Populated alongside dynamic_routes at every
successful /v1/deploy. Last-wins on cross-deploy type name
collision (a known limitation of the 32.c surface; a future
type-registry fase will add deploy-scoped namespacing).
idempotency_store: IdempotencyStore§Fase 32.f — Idempotency-Key store for POST/PUT axonendpoint
routes. Stripe-compatible. Indexed by (client_id, endpoint_path, idempotency_key). Cross-tenant isolation is a
property of the composite key — two adopters cannot collide.
Default 24h retention; eviction is lazy on lookup with a
reap_expired helper available for periodic background sweeps.
axonendpoint_replay: AxonendpointReplayLog§Fase 32.h — Axonendpoint replay log. Append-only, keyed by
trace_id. Populated on every successful 2xx response when the
route’s replay_enabled is true. Consulted by
GET /v1/replay/<trace_id> for regulatory audit.
session: SessionStore§scoped_sessions: ScopedSessionManager§rate_limiter: RateLimiter§tenant_rate_limiter: TenantRateLimiterPer-tenant request-rate + daily token quota enforcement (M4).
request_logger: RequestLogger§api_keys: ApiKeyManager§webhooks: WebhookRegistry§delivery_config: DeliveryConfig§cors_config: CorsConfig§middleware_config: MiddlewareConfig§request_id_gen: RequestIdGenerator§audit_log: AuditLog§trace_store: TraceStore§schedules: HashMap<String, ScheduleEntry>§config_snapshots: Vec<NamedConfigSnapshot>§execution_queue: Vec<QueuedExecution>§execution_queue_next_id: u64§cost_pricing: CostPricing§cost_budgets: HashMap<String, CostBudget>§flow_rules: HashMap<String, FlowValidationRules>§flow_quotas: HashMap<String, FlowQuota>§readiness_gates: ReadinessGates§autoscale_config: AutoscaleConfig§auto_persist_on_shutdown: bool§flow_slas: HashMap<String, FlowSLA>§canary_configs: HashMap<String, CanaryConfig>§alert_rules: Vec<AlertRule>§fired_alerts: Vec<FiredAlert>§alert_silences: Vec<AlertSilence>§health_history: Vec<HealthTransition>§endpoint_rate_limits: HashMap<String, EndpointRateLimit>§execution_cache: Vec<CachedResult>§backend_registry: HashMap<String, BackendRegistryEntry>§axon_stores: HashMap<String, AxonStoreInstance>§dataspaces: HashMap<String, DataspaceInstance>§shields: HashMap<String, ShieldInstance>§corpora: HashMap<String, CorpusInstance>§mandates: HashMap<String, MandatePolicy>§refine_sessions: HashMap<String, RefineSession>§trails: HashMap<String, TrailRecord>§probes: HashMap<String, ProbeSession>§weaves: HashMap<String, WeaveSession>§corroborations: HashMap<String, CorroborateSession>§drills: HashMap<String, DrillSession>§forges: HashMap<String, ForgeSession>§deliberations: HashMap<String, DeliberateSession>§consensus_sessions: HashMap<String, ConsensusSession>§hibernations: HashMap<String, HibernateSession>§ots_secrets: HashMap<String, OtsSecret>§psyche_sessions: HashMap<String, PsycheSession>§axon_endpoints: HashMap<String, EndpointBinding>§endpoint_calls: Vec<EndpointCallRecord>§pix_sessions: HashMap<String, PixSession>§backend_health_probes: HashMap<String, BackendHealthProbe>§backend_health_history: HashMap<String, Vec<HealthCheckRecord>>§shutdown: Option<Arc<ShutdownCoordinator>>§storage: Arc<StorageDispatcher>Persistent storage backend (PostgreSQL or InMemory).
resilient_backend: Arc<ResilientBackend>Resilient backend for LLM calls with retry, circuit breaker, and fallback.
tenant_secrets: Arc<TenantSecretsClient>Per-tenant API key resolver (AWS Secrets Manager + in-memory cache).
Implementations§
Source§impl ServerState
impl ServerState
pub fn new(config: ServerConfig) -> Self
Auto Trait Implementations§
impl !Freeze for ServerState
impl !RefUnwindSafe for ServerState
impl !UnwindSafe for ServerState
impl Send for ServerState
impl Sync for ServerState
impl Unpin for ServerState
impl UnsafeUnpin for ServerState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more