Skip to main content

Crate axon

Crate axon 

Source
Expand description

AXON runtime library — exposes the full AXON runtime: compiler frontend (re-exported from axon-frontend), handlers, runtime primitives, ESK, HTTP/WebSocket servers, persistence, OTS pipelines.

Used by the axon binary and by integration tests.

§Frontend vs runtime

§Fase 12.a — the compiler frontend (lexer, parser, AST, type checker, IR generator, top-level checker, and the closed catalogs used by the type checker) lives in the sibling crate axon-frontend, which has zero runtime dependencies. This crate re-exports those modules transparently so every existing caller (76 call sites across 26 files) keeps compiling without changes. The crate axon-lsp consumes axon-frontend directly, skipping the runtime surface.

Modules§

anchor_checker
Anchor runtime checkers — validate LLM output against AXON anchor constraints.
api_keys
API Key Management — multi-tenant key registry for AxonServer.
ast
AXON AST node definitions — direct port of axon/compiler/ast_nodes.py.
audit_cli
CLI handlers for the ESK audit commands (dossier, sbom, audit, evidence-package). AXON CLI — ESK audit commands (§Fase 8.6 CLI parity).
audit_trail
Audit Trail — append-only log of administrative operations on AxonServer.
auth_middleware
Auth Middleware — role-based authentication gate for AxonServer.
auth_scope
§Fase 32.g — Auth scope (capability subset matching) for first-class axonendpoint routes.
axon_server
AxonServer — native reactive daemon platform.
axonendpoint_replay
§Fase 32.h — Replay-token binding for first-class axonendpoint routes.
backend
AXON Backend — Multi-provider LLM API clients.
backend_error
Backend Error Classification — structured error types for LLM API calls.
backend_resolution
§Fase 36.b — the Backend Resolution Contract (D1): the pure, deterministic precedence ladder that resolves a flow’s execution backend (request → axonendpoint backend: → server default → environment-available auto → honest failure). §Fase 36.b — the Backend Resolution Contract (D1).
backends
§Fase 24.b — Native Rust LLM backends. Per-provider async clients behind a Backend trait + Registry. Per-provider modules (anthropic.rs / openai.rs / gemini.rs / kimi.rs / glm.rs / ollama.rs / openrouter.rs) land in 24.c–24.i; this module ships the shared infra (trait + types + error + retry + observability + locked_model
buffer
Zero-copy multimodal buffers — §λ-L-E Fase 11.b.
cancel_token
§Fase 33.f — Cancellation primitives (D6 cancel-safety).
checker
axon check native implementation.
circuit_breaker
Circuit Breaker — per-provider failure protection for LLM API calls.
cli_fmt
§Fase 39.f — axon fmt subcommand (Rust binary parity).
cli_parse
§Fase 39.f — axon parse subcommand (Rust binary parity).
compiler
axon compile native implementation.
config_persistence
Config Persistence — save and restore AxonServer runtime configuration.
conversation
Conversation history — multi-turn message accumulation between steps.
cors
CORS Middleware — Cross-Origin Resource Sharing configuration for AxonServer.
cost_estimator
Execution Cost Estimator — estimate token usage and USD cost before running a flow.
db_pool
Database Pool — PostgreSQL connection pool management for AxonServer.
deployer
axon deploy — hot-deploy .axon source to a running AxonServer.
effects
§Fase 23.f — Algebraic effects runtime. FSM dispatch loop + handler stack + Free-Monad interpretation of CPS-lowered IR (consumes the JSON IR emitted by the Python frontend in 23.b/c/d). AXON Algebraic Effects Runtime — Fase 23.f
emcp
ℰMCP Transducer — Epistemic Model Context Protocol runtime bridge.
epistemic
AXON Epistemic Lattice — type subsumption, join, meet, uncertainty propagation.
epistemic_capture
§Fase 55.a — capture the epistemic envelope from a tool’s effect row.
esk
§ESK Fase 6 — Epistemic Security Kernel. Port of axon/runtime/esk/. AXON Runtime — Epistemic Security Kernel (§ESK Fase 6).
event_bus
Event Bus + Daemon Supervisor — reactive infrastructure for AxonServer.
exec_context
Execution context — runtime variables accessible between steps.
flow_dispatcher
§Fase 33.y.b — Per-IRFlowNode async dispatcher skeleton. Closed- catalog, compiler-enforced exhaustive match over the 45-variant IRFlowNode enum. Subsequent sub-fases 33.y.c–j replace the transitional legacy shim with real per-variant async handlers. 33.y.l retires the shim + the LegacyShimHandled outcome variant once every IR variant has its real handler. §Fase 33.y.b — Per-IRFlowNode async dispatcher skeleton.
flow_execution_event
§Fase 33.b — Flow execution event stream (Layer 1: data-flow integrity).
flow_inspect
Flow Inspector — runtime introspection for deployed AXON flows.
flow_plan
§Fase 33.x.b — Streaming-shaped execution plan extractor. Builds StreamingExecutionPlan from .axon source for the production async SSE path; pre-resolves per-step BackpressurePolicy via stream_effect_dispatcher so the hot per-chunk loop in axon_server::server_execute_streaming_async does not re-walk the AST per chunk. Rejects flows that use 33.x.b-unsupported features (anchors / lambda apply / let bindings / mid-stream use_tool / hibernate / pix) with a closed-catalog PlanFallback so the SSE handler can route them to the legacy synchronous path. §Fase 33.x.b + 33.x.c — Streaming execution plan extraction + unified .axon source compilation pipeline.
flow_version
Flow Versioning — version tracking and rollback for deployed flows.
graceful_shutdown
Graceful Shutdown — signal handling and orderly server termination.
graph_export
Graph Export — render dependency graphs as DOT (Graphviz) or Mermaid.
handlers
§λ-L-E Fase 2 — Handler layer (Free Monad + CPS). Port of axon/runtime/handlers/. AXON Runtime — Handler layer (§λ-L-E Fase 2).
health_check
Health Check — structured health assessment for AxonServer subsystems.
hooks
Execution hooks — pre/post step callbacks for instrumentation.
http_tool
HTTP tool provider — executes tool calls as REST requests via reqwest.
idempotency
§Fase 32.f — Idempotency-Key store for first-class axonendpoint routes.
ingest
Network ingest paths that deposit bytes directly into crate::buffer::ZeroCopyBuffers.
inspect
axon inspect native implementation — introspect the AXON standard library.
ir_generator
AXON IR Generator — AST → IR transformation.
ir_nodes
AXON IR node definitions — direct port of axon/compiler/ir_nodes.py.
jwt_verifier
JWT signature verification + JWKS client.
lambda_data
Lambda Data (ΛD) — Epistemic State Vector codec.
lambda_runtime
AXON Runtime — Lambda Data (ΛD) Apply (Fase 15.c — Rust mirror).
legal_basis
Legal-basis catalogue — §λ-L-E Fase 11.c.
lexer
AXON Lexer — direct port of axon/compiler/lexer.py.
logging
Logging — production-grade structured logging for AxonServer.
migrations
Migrations — embedded database schema migration runner.
multiparty
Multiparty session types — the global view + projection.
ots
Ontological Tool Synthesis — §λ-L-E Fase 11.e binary pipeline synthesis.
output
Execution output formats — structured report for programmatic integration.
parallel
Parallel step scheduler — depth-based wave execution with threads.
parser
AXON Parser — recursive descent, fail-fast.
pcc
§Fase 51 — Proof-Carrying Code. apx/axonendpoint carry a portable, machine-checkable proof object an INDEPENDENT verifier checks against the artifact WITHOUT trusting the compiler that produced it (the move from esk’s builder-signed attestation to a consumer- verifiable proof). §51.a ships the kernel + the ComplianceCoverage property class. §Fase 51 — Proof-Carrying Code (PCC).
pcc_cli
§Fase 51.f — CLI handlers for the PCC commands (axon pcc prove / axon pcc verify). Closes the Proof-Carrying Code loop at the command line: generate a proof bundle from source, then independently verify it against a recompile of that source. §Fase 51.f — axon pcc CLI: prove + verify.
pem
Persistent Epistemic Modeling (PEM) — §λ-L-E Fase 11.d.
plan_diff
Plan Diff — compare two exported execution plans.
plan_export
Execution plan export — JSONB-compatible structured output.
rate_limiter
Rate Limiter — sliding window rate limiting for AxonServer.
refinement
Refinement types — Trusted<T> / Untrusted<T> + closed Trust Catalog.
repl
axon repl native implementation — interactive Read-Eval-Print Loop.
replay
Execution Replay — reconstruct and analyze recorded traces.
replay_token
Deterministic replay tokens — §λ-L-E Fase 11.c.
request_binding
§Fase 37 — The Request Binding Contract (runtime delivery).
request_log
Request Logger — structured audit log for AxonServer API requests.
request_middleware
Request Middleware — automatic request ID, timing, and logging for AxonServer.
request_tracing
Request Tracing — Tower middleware layer for structured request observability.
resilient_backend
Resilient Backend — production-grade LLM call wrapper with retry, circuit breaker, and fallback.
retry_policy
Retry Policy — exponential backoff with jitter for LLM API calls.
route_schema
§Fase 32.c + 32.d — Schema validation for first-class axonendpoint routes.
runner
axon run native implementation — stub + real execution.
runtime
§λ-L-E Fase 3 + 5 runtime primitives. Port of axon/runtime/ (lease kernel, reconcile loop, ensemble aggregator, immune kernels). AXON Runtime primitives (§λ-L-E Fases 3 + 5; §Fase 13.f.2 typed channels).
runtime_flags
§Fase 33.x.h — Process-wide runtime opt-in flags. Today carries the tokenizer_fallback flag that gates BPE-tokenized chunking on the SSE LEGACY path (D9 — opt-in; defaults OFF for v1.24.0 wire byte-compat). §Fase 33.x.h — Process-wide runtime opt-in flags.
runtime_warnings
§Fase 33.x.g — Closed-catalog runtime warnings for the SSE production path. Surfaces axon-W002 streaming-not-supported when the async streaming path falls back to legacy synchronous delivery (D5 — no silent degradation). §Fase 33.x.g — Closed-catalog runtime warnings for the streaming production path.
server_config
Server Config API — runtime-adjustable configuration for AxonServer.
server_metrics
Server Metrics — Prometheus exposition format for live AxonServer metrics.
session
Session types — the algebra of typed bidirectional dialogue.
session_runtime
§Fase 41.d — the runtime of a session-typed dialogue. The static algebra (axon_frontend::session: duality, regular-coinductive equality, credit-refined backpressure index !ⁿA.S) gets a dynamic counterpart here: an operational state machine (SessionRuntime) with one method per algebra rule, a wire envelope (Frame), and an RFC 6455 WebSocket carrier (ws::drive) that runs a session type against a peer. Carrier-agnostic core; the WS layer is one binding. §Fase 41.d — the runtime of a session-typed dialogue.
session_scope
Session Scoping — namespaced session isolation for AxonServer.
session_store
Session state / memory persistence — file-backed key-value store.
shield_registry
§Fase 40.b — Shield scanner extension point.
stdlib
AXON Standard Library — built-in personas, anchors, flows, and tools.
step_deps
Step dependency analysis — variable-based dependency graph between steps.
storage
Storage Backend — trait abstraction for persistent state in AxonServer.
storage_postgres
PostgreSQL Storage Backend — full persistent storage for AxonServer.
store
§Fase 35 — the axonstore cognitive data plane runtime.
store_introspect
§Fase 38.h (D10) — pure manifest-building logic for the axon store introspect <store> CLI.
store_schema
§Fase 38.b (D1) — the closed axonstore column-schema catalog, Rust frontend side.
store_schema_manifest
§Fase 38.c (D4, D6) — The .axon-schema.json manifest format + resolver.
stream_effect
Stream<T> — temporal algebraic effect with mandatory backpressure.
stream_effect_dispatcher
§Fase 33.e — Stream-effect dispatcher (Layer 4).
stream_runtime
Runtime implementation of Stream<T> with the four closed backpressure policies from crate::stream_effect.
streaming_via_dispatcher
§Fase 33.z.b — Streaming-via-dispatcher graft skeleton. Lifts flow_dispatcher::dispatch_node (Fase 33.y, 45/45 structurally complete) into the production SSE hot path behind the AXON_STREAMING_VIA_DISPATCHER runtime flag (default OFF; flip to ON for v1.27.0 stable in 33.z.c; legacy path retired in 33.z.e). §Fase 33.z.b — Streaming-via-dispatcher graft skeleton.
tenant
tenant_secrets
Per-tenant API key resolution via AWS Secrets Manager (M3).
tokens
AXON token types and keyword lookup table. Direct port of axon/compiler/tokens.py.
tool_dispatch_bridge
§Fase 34.d (v1.29.0) — Bridge between ToolEntry (the registry shape) and Tool trait impls (the dispatcher’s streaming surface).
tool_executor
Native tool executors — Calculator and DateTimeTool.
tool_registry
Tool registry — extensible tool dispatch for AXON execution.
tool_trait
§Fase 34.b (v1.29.0) — Tool trait + ToolChunk closed-catalog struct.
tool_validator
Tool result validation and effect tracking.
trace_export
Trace Export — export analytics as Prometheus exposition format or CSV.
trace_stats
Trace Analytics — aggregate statistics across multiple execution traces.
trace_store
Trace Store — in-memory execution trace buffer for AxonServer.
tracer
axon trace native implementation — pretty-print execution traces.
trust_verifiers
Runtime implementations of the closed crate::refinement::TrustProof catalogue.
type_checker
AXON Type Checker — Phase 1: symbol table, duplicates, references, field validation.
version_diff
Version Diff — line-based source diff between flow versions.
webhook_delivery
Webhook Delivery — async HTTP delivery with retry and exponential backoff.
webhooks
Webhooks — outgoing HTTP notification system for AxonServer events.
wire_envelope
§Fase 39.b — Pure Silicon Cognition: the canonical wire payload type for axonendpoint responses on transport: json.
wire_envelope_producers
§Fase 39.c.y + 39.c.z — Wire envelope producer helpers.
wire_format
§Fase 33.z.k (v1.28.0) — Wire-format adapter framework.