Expand description
Executable, offline-frozen runtime bindings for StateKnot graphs.
Declarative graph descriptors remain in stateknot-core. This crate binds
those immutable descriptors to locally installed JSON Schemas, reducers,
and node executors, then drives them against a durable provider without
loading code or schemas from the network while a run is active.
DurableAgentAdmission validates one authenticated immutable Agent intent
against that same deployment snapshot before atomically initializing its
executable PostgreSQL run. DurableAgentRuns adds tenant-scoped durable
submission keys and integrity-verifying public run/result snapshots for
lost-ack recovery and polling.
Modules§
- agent_
maintenance - Owned, bounded maintenance over the existing durable Agent state machines. No node execution, implicit migrations, retention, pool closure or public routes.
- agent_
policy - Bounded declarative resource authorization, separate from identity verification. Default-deny, offline resource policy for trusted static/service-account ACLs. Retain artifacts privately before activation. No ownership inference, network PDP, persistent read/deny audit ledger or distributed policy cache is provided.
Structs§
- Agent
Builder - Startup-only builder for one immutable, strongly typed agent definition.
- Agent
Cancellation Ids - Stable caller-retained identities for one cancellation request.
- Agent
Deadline Item - One candidate’s typed result; payload bodies are not accumulated in a tick.
- Agent
Deadline Sweep Cursor - Per-tenant scan continuation. Restart with
Noneafter process loss. - Agent
Deadline Tick - A finite maintenance quantum, not a terminal Run outcome.
- Agent
Invocation Accounting Reference - Immutable identity of an offline invocation-accounting implementation.
- Agent
Loop Result - Outcome and bounded execution counters for one loop call.
- Agent
RunActivity Page - Public metadata for at most one durable activity notification and a current snapshot. These are separate observations, NOT a historical state projection. Journal payloads, custom kinds and worker details never cross this boundary.
- Agent
RunIds - Stable identities allocated once at trusted request ingress.
- Agent
RunSnapshot - Public, fully revalidated snapshot of one durably admitted Agent run.
- Agent
Schema Registration Error - Failure while registering generated agent schemas.
- Agent
Service Caller - An authenticated caller supplied by the embedding transport after token or mTLS verification.
- Agent
Service Registry - Immutable exact-version registry used by
AgentServiceV1. - Agent
Service Registry Builder - Startup-only builder for immutable, exact-version Agent service bindings.
- Agent
Service RunAuthorization - Complete trusted input to a run read or cancellation authorization decision.
- Agent
Service RunGrant - Public-safe proof that a trusted policy granted run access.
- Agent
Service Submission Authorization - Complete trusted input to an Agent submission authorization decision.
- Agent
Service Submission Grant - Granted submission policy snapshot returned by the trusted authorizer.
- Agent
Service V1 - Production service facade for exact-version durable Agent submission, authorization-first reads, and two-phase cancellation.
- Agent
Tool Policy Context - Immutable input to one ordinary tool policy decision.
- Agent
Tool Policy Reference - Immutable identity of a locally installed tool-authorization policy.
- Child
Join Publication Cursor - Tenant-bound in-process continuation. After a restart begin a new sweep at None.
- Child
Join Publication Item - Per-request publication result; errors never silently disappear or block later keys.
- Child
Join Publication Tick - One finite publication pass, separate from cancellation and accounting lanes.
- Child
Reconciliation Cursor - In-process scan continuation. Retain it between ticks; restart at
Noneafter a crash. Each lane automatically starts a new sweep once it reaches the end. - Child
Reconciliation Item - One bounded, inspectable result. Errors do not prevent other keys from progressing.
- Child
Reconciliation Tick - Result of one finite tick; this is neither a child Join nor an Agent execution result.
- Durable
Agent Admission - Trusted runtime facade for one all-or-nothing durable Agent admission.
- Durable
Agent Admission Request - Fully retained input for an exact atomic Agent-admission retry.
- Durable
Agent Deadline Reconciler - Trusted deadline maintenance for admitted roots and children. The host must authorize each tenant, enforce fairness/cadence, preserve cursors, and alert on failures and sweep lag. Run this alongside child reconciliation and independently leased execution/cleanup workers, even when no run is runnable. No implicit task is spawned and no execution lease is held between ticks.
- Durable
Agent Loop - Production binding of driver execution and lifecycle coordination.
- Durable
Agent Runs - Public durable Agent admission and run/result query facade.
- Durable
Child Join Publisher - Trusted, tenant-scoped Join publisher; no node or provider code is dispatched.
Schedule alongside
DurableChildReconcilerand execution workers. The host authenticates tenants, retains cursors, applies fairness, and alerts on errors. No parent lease or transaction is retained between calls. - Durable
Child Reconciler - Trusted control-plane worker for owned children; never dispatches user/provider code. The caller authenticates the tenant and controls scheduling, fairness and tick cadence. Schedule alongside execution workers. No lease or transaction is held between ticks.
- Durable
Child Reconciler Options - Finite retry policy. Each tick scans at most 16 cancellation and 16 settlement keys.
- Durable
Fair Scheduler - Distributed weighted-fair scheduler layered over tenant-isolated workers.
- Durable
Fair Scheduler Options - Retry policy for one durable global slot reservation.
- Durable
Graph Driver - Fenced durable graph execution service over one
PostgreSQLprovider pool. - Durable
Graph Driver Options - Resource, lease, deadline, and retry policy for one durable driver.
- Durable
Graph Lifecycle - Fenced graph-to-agent lifecycle coordinator.
- Durable
Graph Lifecycle Options - Retry policy for atomic graph lifecycle mutations.
- Durable
Invocation Executor - First-party durable model/tool attempt executor.
- Durable
Invocation Executor Options - Bounded identical-mutation retry policy for invocation ledger commits.
- Durable
RunFailure Closer - Completes original failures after child cancellation/settlement reconciliation. The host must authorize tenants, supply fair recurring finite ticks, and inspect every error. No task is implicitly spawned. Direct evidence was frozen by the worker before lease release; this coordinator must not call providers again.
- Durable
Tenant Scheduler - One tenant-isolated durable scheduler worker.
- Durable
Tenant Scheduler Options - Bounded scan and claim policy for one tenant scheduler worker.
- Executable
Graph - One declarative graph with all executable bindings frozen and verified.
- Executable
Graph Registry - Immutable deployment snapshot resolved only by complete graph reference.
- Executable
Graph Registry Builder - Startup-only builder for a closed executable deployment snapshot.
- Fair
Scheduler Tick - Complete result of one globally fair scheduler tick.
- Graph
Blocked Handoff - Exact recovery plan and lease retained for supervision.
- Graph
Cancellation Evidence - Complete cumulative accounting recovered before cancellation acknowledgement.
- Graph
Cancellation Evidence Context - Payload-free trusted context for terminal cancellation accounting recovery.
- Graph
Cancellation Handoff - Exact lease-bound input for terminal cancellation acknowledgement.
- Graph
Child Join - Verified publication and lazy, exact-slot terminal access for resumed node code. The context retains compact terminal proofs, never all child output bodies. Each read revalidates ownership, settlement, frozen graph and output schema. Holding or reading this handle does not consume the Join or authorize writes.
- Graph
Drive Blockers - Aggregate classifications that prevent further node dispatch.
- Graph
Drive Report - Observable work and recovery evidence from one drive call.
- Graph
Drive Result - Complete result of one bounded drive call.
- Graph
Execution Activity - Shared completion accounting for node futures dispatched by one driver. Clones do not own the store or executors and do not cancel execution.
- Graph
Failure Evidence - Public failure and cumulative accounting selected by durable supervision.
- Graph
Failure Evidence Context - Payload-free trusted context for blocked-run failure evidence recovery.
- Graph
Lifecycle Barrier Handoff - Exact lease-bound Wait/Terminal commit input for a lifecycle integrator.
- Graph
Node Context - Exact, already-started execution context passed to one graph node.
- Graph
Node Execution Error - Public-safe failure of one graph-node attempt before journal causation.
- Graph
Terminal Evidence - Trusted admission and cumulative accounting required for success.
- Graph
Terminal Evidence Context - Payload-free trusted context for terminal evidence recovery.
- Invocation
Attempt Event Ids - Stable start and terminal event identities for one physical attempt.
- Invocation
Budget Context - Payload-free trusted request to an admission/accounting implementation.
- Invocation
Budget Provider Error - Payload-redacted trusted accounting-provider failure.
- Invocation
Clock Observation - Trusted wall/monotonic clock pair captured at one process observation.
- Json
Schema Registry - Immutable, shareable registry of eagerly compiled offline validators.
- Json
Schema Registry Builder - Mutable startup-only builder for an immutable offline schema registry.
- Json
Schema Registry Limits - Resource ceilings applied while an executable schema registry is built.
- Model
Attempt Handoff - Retained model-attempt handoff safe to retry before physical dispatch.
- Model
Event Sink Error - Payload-redacted model event sink failure.
- Model
Provider Registry - Immutable exact-version model provider registry.
- Model
Provider Registry Builder - Startup-only builder for immutable object-safe model provider bindings.
- Model
Terminal Commit Error - Terminal model commit failure retaining exact retry evidence.
- Model
Terminal Commit Handoff - Retained terminal model evidence after a database commit failure.
- Provider
Native Agent Graph - Compiled schemas, state machine, and declarative graph for one agent version.
- Provider
Native Agent Lifecycle Evidence - Read-only lifecycle evidence recovery for one compiled provider-native graph.
- Provider
Native Agent State - Bounded checkpoint state for the provider-native agent graph.
- Provider
Native Completed Turn - Compact ledger references for one completed model/tool turn.
- Provider
Native Model Plan - Stable identities retained before one model invocation can start.
- Provider
Native Tool Plan - Stable identities and policy proof retained before a tool can start.
- RunFailure
Close Item - One bounded candidate and its outcome; inspect errors even when later items succeed.
- RunFailure
Close Sweep Cursor - Tenant-bound continuation. Reset after process loss; not a durable watermark.
- RunFailure
Close Tick - At most 16 attempts at closure per tick, each with finite mutation retries.
- System
Invocation Clock - Production system/monotonic clock implementation.
- Tenant
Fairness Weight - One tenant’s positive service weight inside a fairness shard.
- Tenant
Scheduler Report - Bounded observations made while selecting one run.
- Tenant
Scheduler Tick - Scheduler outcome plus bounded selection counters.
- Tenant
Starvation Bound - Exact reservation-count starvation bound for one continuously eligible tenant.
- Tool
Attempt Handoff - Retained tool-attempt handoff safe to retry before physical dispatch.
- Tool
Dispatch Handoff - Fresh durable tool start retained for exactly one provider dispatch.
- Tool
Provider Registry - Immutable exact-version tool provider registry.
- Tool
Provider Registry Builder - Startup-only builder for immutable schema-validated tool bindings.
- Tool
Reconciliation Attempt Handoff - Retained request to probe one exact unknown tool attempt.
- Tool
Reconciliation Commit Error - Reconciliation failure retaining the exact evidence for a no-dispatch retry.
- Tool
Reconciliation Handoff - Retained, validation-bound evidence for reconciling an unknown tool attempt.
- Tool
Terminal Commit Error - Terminal tool commit failure retaining exact retry evidence.
- Tool
Terminal Commit Handoff - Retained terminal tool evidence after a database commit failure.
- Typed
Agent - Strongly typed codec bound to a fully frozen agent and schema registry.
- Typed
Agent Definition - Generated typed schemas plus an immutable agent descriptor, before binding to one complete offline schema registry.
- Weighted
Fairness Policy - Immutable deterministic weighted schedule shared by every shard replica.
Enums§
- Agent
Builder Error - Invalid typed-agent construction.
- Agent
Cancellation Outcome - Result of a durable, idempotent public cancellation request.
- Agent
Deadline Build Error - Startup failures; none falls back to unvalidated audit payloads.
- Agent
Invocation Charge - Monetary accounting result for one terminal external invocation.
- Agent
Loop Error - Payload-redacted durable loop failure.
- Agent
Loop Outcome - Closed result of one bounded claimed-run execution quantum.
- Agent
RunAdmission Outcome - Result of public-facade Agent admission.
- Agent
RunSnapshot Error - Invalid public Agent run snapshot shape.
- Agent
RunTerminal Outcome - A closed terminal outcome returned by the durable Agent run facade.
- Agent
Schema Role - Position of a generated schema in one typed agent definition.
- Agent
Service Authorization Error - Closed authorization failure returned to the service boundary.
- Agent
Service Build Error - Startup failure for
AgentServiceV1. - Agent
Service Deployment Error - Closed startup/runtime failure from an installed Agent definition.
- Agent
Service Error - Payload-redacted failure from the versioned Agent service boundary.
- Agent
Service Readiness Error - Closed dependency-readiness failure; contains no database or deployment details.
- Agent
Service Registry Error - Exact service-deployment registry failure.
- Agent
Service RunOperation - Run operation evaluated before any durable existence lookup.
- Agent
Service RunTarget - Target form supplied to authorization without exposing a raw idempotency key.
- Agent
Tool Policy Decision - Closed result of a tool policy evaluation.
- Agent
Tool Policy Error - Payload-redacted dependency failure while evaluating tool policy.
- Child
Admission Preparation Error - Read-only child preparation failed; no admission or reservation was written.
- Child
Reconciler Build Error - Startup validation error; no runtime network schema loading is allowed.
- Child
Reconciliation Commit - Successful per-key maintenance observation.
- Child
Reconciliation Kind - Maintenance lane, for bounded-cardinality counters.
- Durable
Agent Admission Build Error - Startup failure while binding the durable admission facade.
- Durable
Agent Admission Error - Payload-redacted failure while preparing or committing Agent admission.
- Durable
Agent Admission Request Error - Invalid retained admission request.
- Durable
Agent Loop Build Error - Startup failure while building a consistent durable loop.
- Durable
Agent Runs Build Error - Startup failure for the public durable Agent run facade.
- Durable
Agent Runs Error - Payload-redacted failure from public durable Agent admission or reads.
- Durable
Fair Scheduler Build Error - Startup failure for a distributed fair scheduler.
- Durable
Fair Scheduler Options Error - Invalid distributed fairness retry policy.
- Durable
Graph Driver Build Error - Startup failure while binding the driver to a provider and registry.
- Durable
Graph Driver Options Error - Invalid durable driver options.
- Durable
Graph Lifecycle Build Error - Startup failure while binding graph lifecycle coordination.
- Durable
Graph Lifecycle Options Error - Invalid lifecycle retry policy.
- Durable
Invocation Executor Build Error - Startup failure for the durable invocation executor.
- Durable
Invocation Executor Options Error - Invalid durable invocation executor retry policy.
- Durable
Tenant Scheduler Build Error - Startup failure while building a tenant scheduler worker.
- Durable
Tenant Scheduler Options Error - Invalid tenant scheduler policy.
- Executable
Graph Registry Error - Startup-time failure while freezing executable graph bindings.
- Fair
Scheduler Error - Failure after a fair scheduler is fully registered.
- Graph
Barrier Lifecycle Outcome - Converged result of one lifecycle handoff.
- Graph
Drive Outcome - Closed reason one bounded drive call stopped.
- Graph
Driver Error - Durable driver failure with payload-redacted diagnostics.
- Graph
Lifecycle Error - Payload-redacted graph lifecycle failure.
- Graph
Lifecycle Evidence Error - Closed, payload-redacted evidence-provider failure.
- Graph
Node Context Error - Invalid durable attempt/checkpoint binding for node execution.
- Graph
Node Execution - A completed semantic result or a dedicated durable child suspension.
- Graph
Node Execution Error Build Error - Invalid node-execution failure returned before durable completion.
- Graph
Node Scheduling - Trusted scheduling contract for one executable graph node.
- Invocation
Attempt Event IdsError - Invalid attempt event identity pair.
- Invocation
Attempt Handoff Error - Invalid durable attempt handoff.
- Invocation
Boundary Kind - Closed external boundary whose next-attempt budget is requested.
- Invocation
Clock Error - Failure to capture a representable runtime clock observation.
- Invocation
Event Payload Error - Invalid standard invocation journal event data.
- Invocation
Terminal Commit Failure - Payload-safe cause of a retained terminal invocation commit failure.
- Json
Schema Registry Error - Startup-time failure while constructing an offline schema registry.
- Json
Schema Registry Limits Error - Invalid executable schema-registry limits.
- Model
Attempt Execution Error - Failure before or around one model attempt dispatch.
- Model
Attempt Outcome - Closed result of one model attempt executor call.
- Model
Attempt Terminal Kind - Whether a newly dispatched model attempt committed a response or error.
- Model
Provider Registry Error - Startup or exact-resolution failure for model providers.
- Provider
Native Agent Graph Build Error - Startup failure while compiling a prebuilt provider-native graph.
- Provider
Native Agent Phase - Current durable phase of the prebuilt agent graph.
- Provider
Native Agent Registration Error - Startup failure while binding one compiled provider-native graph.
- Provider
Native Agent State Error - Invalid generated or restored provider-native checkpoint state.
- RunFailure
Close Build Error - Startup fails closed if the exact offline schema is unavailable.
- Standard
Agent Admission Schema Error - Internal release-artifact failure for the standard admission schema.
- Standard
Agent Admission Schema Registration Error - Startup failure while adding the standard admission schema to a registry.
- Standard
Agent Cancellation Schema Error - Internal release-artifact failure for the embedded standard schema.
- Standard
Agent Cancellation Schema Registration Error - Startup failure while adding the standard cancellation schema to a registry.
- Standard
Agent Service Control Schema Error - Internal release-artifact failure for the embedded standard schema.
- Standard
Agent Service Control Schema Registration Error - Startup failure while adding the standard Agent service control schema.
- Standard
Graph Driver Schema Error - Internal release-artifact failure for the embedded standard schema.
- Standard
Graph Driver Schema Registration Error - Startup failure while adding the standard driver schema to a registry.
- Standard
Graph Lifecycle Schema Error - Internal release-artifact failure for the embedded standard schema.
- Standard
Graph Lifecycle Schema Registration Error - Startup failure while adding the standard lifecycle schema to a registry.
- Standard
Invocation Execution Schema Error - Internal embedded invocation-schema release-artifact failure.
- Standard
Invocation Execution Schema Registration Error - Startup failure while adding the standard invocation schema.
- Tenant
Fairness Weight Error - Invalid individual tenant fairness weight.
- Tenant
Scheduler Error - Payload-redacted scheduler infrastructure failure.
- Tenant
Scheduler Outcome - Closed result of one tenant scheduler tick.
- Tool
Attempt Execution Error - Failure before or around one tool attempt dispatch.
- Tool
Attempt Outcome - Closed result of one tool attempt executor call.
- Tool
Attempt Start Outcome - Closed result of the durable-before-dispatch half of one tool attempt.
- Tool
Attempt Terminal Kind - Whether a newly dispatched tool attempt committed a result or error.
- Tool
Provider Registry Error - Startup or exact-resolution failure for tool adapters.
- Tool
Reconciliation Attempt Execution Error - Failure before, during, or after one automated reconciliation probe.
- Tool
Reconciliation Attempt Handoff Error - Invalid request to execute an automated reconciliation probe.
- Tool
Reconciliation Attempt Outcome - Result of one bounded provider-backed reconciliation probe.
- Tool
Reconciliation Commit Failure - Payload-safe cause of a durable tool reconciliation commit failure.
- Tool
Reconciliation Handoff Error - Invalid binding between reconciliation evidence and durable invocation state.
- Tool
Reconciliation Kind - Authoritative evidence classification for one ambiguous tool attempt.
- Tool
Reconciliation Outcome - Result of durably committing authoritative tool reconciliation evidence.
- Typed
Agent Bind Error - Startup-time typed-agent binding failure.
- Typed
Agent Input Error - Typed input preparation failure. No input value is retained or formatted.
- Typed
Agent Output Error - Typed terminal-output verification or decoding failure.
- Weighted
Fairness Policy Error - Invalid immutable weighted fairness policy.
Constants§
- AGENT_
SERVICE_ API_ VERSION - The stable major version of this service contract.
- PROVIDER_
NATIVE_ MODEL_ NODE_ ID - Stable model node identifier used by every v1 provider-native graph.
- PROVIDER_
NATIVE_ TOOLS_ NODE_ ID - Stable ordered tool node identifier used by every v1 provider-native graph.
- PROVIDER_
NATIVE_ TOOLS_ ROUTE_ ID - Conditional route selected when a committed response proposes tools.
- STANDARD_
AGENT_ ADMISSION_ EVENT_ SCHEMA_ ID - Stable identity of the v1 Agent-admission event-data schema.
- STANDARD_
AGENT_ CANCELLATION_ EVENT_ SCHEMA_ ID - Stable identity of the v1 agent cancellation event-data schema.
- STANDARD_
AGENT_ DEADLINE_ EVENT_ SCHEMA_ ID - Offline identity of the exact embedded audit schema.
- STANDARD_
AGENT_ SERVICE_ CONTROL_ EVENT_ SCHEMA_ ID - Stable identity of the v1 Agent service control event-data schema.
- STANDARD_
CHILD_ JOIN_ EVENT_ SCHEMA_ ID - Offline identity of the embedded, closed Join audit schema.
- STANDARD_
CHILD_ RECONCILIATION_ EVENT_ SCHEMA_ ID - Offline identity of the embedded reconciliation audit schema.
- STANDARD_
GRAPH_ DRIVER_ EVENT_ SCHEMA_ ID - Stable identity of the v1 durable graph-driver event-data schema.
- STANDARD_
GRAPH_ LIFECYCLE_ EVENT_ SCHEMA_ ID - Stable identity of the v1 graph lifecycle event-data schema.
- STANDARD_
INVOCATION_ EXECUTION_ EVENT_ SCHEMA_ ID - Stable identity of the v1 invocation execution event-data schema.
- STANDARD_
RUN_ FAILURE_ CLOSE_ EVENT_ SCHEMA_ ID - Offline immutable release identity; never fetched at runtime.
Traits§
- Agent
Invocation Accounting - Offline, deterministic pricing boundary for durable model and tool ledgers.
- Agent
Service Authorizer - Mandatory authorization boundary for every public Agent service operation.
- Agent
Service Deployment - Executable Agent definition installed into the service registry.
- Agent
Tool Policy - Side-effect-free policy boundary invoked before any tool preparation.
- Graph
Lifecycle Evidence Provider - Trusted recovery boundary for admission snapshots and cumulative accounting.
- Graph
Node Executor - Object-safe executable implementation of one exact graph node.
- Invocation
Budget Provider - Trusted admission/accounting source for exact remaining run capacity.
- Invocation
Clock - Trusted clock source for attempt contexts.
- Model
Event Sink - Runtime-owned sink for already validated semantic model stream events.
Functions§
- register_
standard_ agent_ admission_ event_ schema - Registers the standard Agent-admission event schema in a startup registry.
- register_
standard_ agent_ cancellation_ event_ schema - Registers the standard agent cancellation event schema in a startup registry.
- register_
standard_ agent_ deadline_ event_ schema - Registers the exact deadline schema before the deployment registry freezes.
- register_
standard_ agent_ service_ control_ event_ schema - Registers the standard Agent service control schema in a startup registry.
- register_
standard_ child_ join_ event_ schema - Registers the Join schema before freezing a Join-enabled deployment.
- register_
standard_ child_ reconciliation_ event_ schema - Registers the exact audit schema before freezing the deployment registry.
- register_
standard_ graph_ driver_ event_ schema - Registers the standard graph-driver event schema in a startup registry.
- register_
standard_ graph_ lifecycle_ event_ schema - Registers the standard graph lifecycle event schema in a startup registry.
- register_
standard_ invocation_ execution_ event_ schema - Registers the standard invocation event schema in a startup registry.
- register_
standard_ run_ failure_ close_ event_ schema - Register before freezing a deployment with child-enabled graph lifecycles.
- standard_
agent_ admission_ event_ schema - Returns the immutable reference and owned JSON Schema document shipped with this runtime release.
- standard_
agent_ cancellation_ event_ schema - Returns the immutable reference and owned JSON Schema document shipped with this runtime release.
- standard_
agent_ deadline_ event_ schema - Returns the closed release schema without fetching it over HTTP.
- standard_
agent_ service_ control_ event_ schema - Returns the immutable reference and owned JSON Schema document shipped with this runtime release.
- standard_
child_ join_ event_ schema - Returns the exact release schema, without fetching its identity URL.
- standard_
child_ reconciliation_ event_ schema - Returns the closed schema shipped in the binary; no HTTP lookup is performed.
- standard_
graph_ driver_ event_ schema - Returns the immutable reference and owned JSON Schema document shipped with this runtime release.
- standard_
graph_ lifecycle_ event_ schema - Returns the immutable reference and owned JSON Schema document shipped with this runtime release.
- standard_
invocation_ execution_ event_ schema - Returns the immutable reference and embedded JSON Schema document.
- standard_
run_ failure_ close_ event_ schema - Returns the exact closed embedded audit schema.