Skip to main content

axon/
lib.rs

1//! AXON runtime library — exposes the full AXON runtime: compiler
2//! frontend (re-exported from `axon-frontend`), handlers, runtime
3//! primitives, ESK, HTTP/WebSocket servers, persistence, OTS pipelines.
4//!
5//! Used by the `axon` binary and by integration tests.
6//!
7//! # Frontend vs runtime
8//!
9//! v1.4.2 — the compiler frontend (lexer, parser, AST, type checker,
10//! IR generator, top-level checker, and the closed catalogs used by the
11//! type checker) lives in the sibling crate `axon-frontend`, which has
12//! zero runtime dependencies. This crate re-exports those modules
13//! transparently so every existing caller (76 call sites across 26
14//! files) keeps compiling without changes. The crate `axon-lsp`
15//! consumes `axon-frontend` directly, skipping the runtime surface.
16
17// ── v1.4.2 — frontend re-exports (transparent to callers) ───────
18pub use axon_frontend::{
19    ast,
20    checker,
21    // v2.76.0 — the Epistemic Module System (resolver · interfaces ·
22    // ECC · linker · cache · driver). Re-exported so the CLI and the
23    // enterprise workspace reach the module pipeline through the single
24    // `axon = …` dep, exactly like the rest of the frontend.
25    compilation_cache,
26    ems,
27    epistemic,
28    epistemic_compat,
29    ir_generator,
30    ir_nodes,
31    module_interface,
32    module_linker,
33    module_resolver,
34    legal_basis,
35    lexer,
36    parser,
37    refinement,
38    // v2.3.0 — the session-type algebra (duality, regular-coinductive
39    // equality, v2.3.0 credit-refined backpressure, v2.3.0 SSE-polarity
40    // predicate). Re-exported so downstream consumers (the enterprise
41    // server's v2.3.0 WS surface in `axon-enterprise`) reach it via the
42    // single `axon = …` workspace dep without an extra `axon-frontend`
43    // dependency line.
44    session,
45    // v2.3.0 — multiparty session types (global types + projection).
46    // The orchestration story for n-agent skill/tool topologies: declare
47    // a `GlobalType`, project per role, drive each role's binary
48    // `SessionType` over the v2.3.0 runtime — composition stays in
49    // lock-step by construction.
50    multiparty,
51    store_introspect,
52    store_schema,
53    store_schema_manifest,
54    stream_effect,
55    tokens,
56    type_checker,
57    // v2.37.0 — the blessed preset catalog + the voice/preset
58    // desugar surface (`axon desugar` renders from these).
59    upstream_presets,
60    voice_desugar,
61};
62
63// `ots_catalog` is the compile-time slug catalog; the runtime `ots`
64// module (below) re-exports these constants for backward compatibility.
65
66// ── Runtime modules (stay in this crate) ────────────────────────────
67
68pub mod anchor_checker;
69pub mod api_keys;
70pub mod audit_trail;
71pub mod auth_middleware;
72// v2.81.0 — the HTTP server, behind the `server` feature. 29,734 lines of
73// `axum` router, and — until this step — the reason every adopter who only
74// wanted `axon check` compiled a web framework. `axon serve` STAYS IN `--help`
75// under every profile and refuses in writing, naming `axon-server`; see
76// `main.rs`. The v2.67.0 doctrine: the advertised surface stays advertised.
77#[cfg(feature = "server")]
78pub mod axon_server;
79pub mod backend;
80pub mod backend_error;
81pub mod circuit_breaker;
82pub mod compiler;
83pub mod config_persistence;
84pub mod conversation;
85pub mod cors;
86pub mod cost_estimator;
87pub mod daemon;
88/// v2.63.0 — the deterministic columnar engine behind `dataspace`
89/// (immutable record batches, validity bitmaps, zone maps, provenance).
90pub mod dataspace_engine;
91/// v2.66.0 — Governed Human Notification: the canonical contract
92/// (evidence labels, recipient custody, fail-closed provider port).
93pub mod notification;
94// v2.81.0 — the sqlx pool builder, behind `postgres`.
95#[cfg(feature = "postgres")]
96pub mod db_pool;
97pub mod deployer;
98pub mod emcp;
99pub mod event_bus;
100/// v2.31.0 — the durable event outbox (the append-only log + processed
101/// cursor that makes `emit` survive the consumer being down).
102pub mod event_outbox;
103/// v1.1.0 — Handler layer (Free Monad + CPS). Port of `axon/runtime/handlers/`.
104pub mod handlers;
105/// v1.1.0 + 5 runtime primitives. Port of `axon/runtime/` (lease kernel,
106/// reconcile loop, ensemble aggregator, immune kernels).
107pub mod runtime;
108/// v2.3.0 — the **runtime** of a session-typed dialogue. The static
109/// algebra (`axon_frontend::session`: duality, regular-coinductive
110/// equality, credit-refined backpressure index `!ⁿA.S`) gets a dynamic
111/// counterpart here: an operational state machine (`SessionRuntime`)
112/// with one method per algebra rule, a wire envelope (`Frame`), and an
113/// RFC 6455 WebSocket carrier (`ws::drive`) that runs a session type
114/// against a peer. Carrier-agnostic core; the WS layer is one binding.
115pub mod session_runtime;
116/// v2.37.0 — the `upstream` runtime: the CLIENT dual of the v2.3.0
117/// carrier. Dials OUT to a third-party vendor (STT/TTS/realtime speech)
118/// over RFC 6455 + TLS, applies the declared auth handshake, transcodes
119/// wire↔session per the compiled `map:` projection (T849-total), applies
120/// the declared `overflow:` policy when the vendor is the slow side, and
121/// reconnects with witnessed, fail-closed exponential backoff. A new
122/// vendor is a new DECLARATION, never new Rust code.
123pub mod upstream_runtime;
124/// v2.4.0 — the `quant` cognitive primitive's RUNTIME: the
125/// [`quant::QuantBackend`] port + a usable dense-statevector reference
126/// simulator capped at n ≤ 10 (the OSS half; enterprise mounts the QuIDD /
127/// VRAM / QPU engine behind the same trait in v2.4.0–i).
128pub mod quant;
129/// v1.17.0 — Algebraic effects runtime. FSM dispatch loop +
130/// handler stack + Free-Monad interpretation of CPS-lowered IR
131/// (consumes the JSON IR emitted by the Python frontend in 23.b/c/d).
132pub mod effects;
133/// v1.18.0 — Native Rust LLM backends. Per-provider async clients
134/// behind a `Backend` trait + `Registry`. Per-provider modules
135/// (anthropic.rs / openai.rs / gemini.rs / kimi.rs / glm.rs / ollama.rs
136/// / openrouter.rs) land in 24.c–24.i; this module ships the shared
137/// infra (trait + types + error + retry + observability + locked_model
138/// + tokens dispatch).
139pub mod backends;
140/// v1.31.0 — the Backend Resolution Contract (D1): the pure,
141/// deterministic precedence ladder that resolves a flow's execution
142/// backend (request → axonendpoint `backend:` → server default →
143/// environment-available `auto` → honest failure).
144pub mod backend_resolution;
145/// v2.22.0 — pure capability-aware model resolution: a step's
146/// `requires_context:` + a backend's v2.22.0 model catalog → the smallest model
147/// that fits, or honest fail-closed (never a too-small model).
148pub mod model_resolution;
149/// v2.23.0 — the Advantage Witness: a transversal law
150/// (`axon://logic/no_unwitnessed_advantage`). A primitive may not claim an
151/// advantage over a cheaper baseline without a machine-checkable witness on real
152/// data; the `AdvantageWitness` trait + closed metric catalog + verdict.
153pub mod advantage_witness;
154/// v2.23.0 — quant as the first Advantage-Witness instance: the amplitude-
155/// fidelity ≡ cosine theorem made executable + the `QuantKernelWitness` that
156/// fails closed (no advantage over the classical baseline).
157pub mod quant_witness;
158/// v2.23.0 — the SECOND Advantage-Witness instance (transversality proof):
159/// retrieval / navigate via the `ranking_lift` metric over flat cosine retrieval.
160pub mod retrieval_witness;
161/// v1.2.0 — Epistemic Security Kernel. Port of `axon/runtime/esk/`.
162pub mod esk;
163/// v2.4.0 — Proof-Carrying Code. apx/axonendpoint carry a portable,
164/// machine-checkable proof object an INDEPENDENT verifier checks
165/// against the artifact WITHOUT trusting the compiler that produced it
166/// (the move from `esk`'s builder-signed attestation to a consumer-
167/// verifiable proof). v2.4.0 ships the kernel + the ComplianceCoverage
168/// property class.
169pub mod pcc;
170/// CLI handlers for the ESK audit commands (dossier, sbom, audit, evidence-package).
171pub mod audit_cli;
172/// v2.4.0 — CLI handlers for the PCC commands (`axon pcc prove` /
173/// `axon pcc verify`). Closes the Proof-Carrying Code loop at the
174/// command line: generate a proof bundle from source, then
175/// independently verify it against a recompile of that source.
176pub mod pcc_cli;
177pub mod flow_inspect;
178/// v1.24.0 — Closed-catalog runtime warnings for the SSE
179/// production path. Surfaces `axon-W002 streaming-not-supported`
180/// when the async streaming path falls back to legacy synchronous
181/// delivery (D5 — no silent degradation).
182pub mod runtime_warnings;
183/// v1.24.0 — Process-wide runtime opt-in flags. Today carries
184/// the `tokenizer_fallback` flag that gates BPE-tokenized chunking
185/// on the SSE LEGACY path (D9 — opt-in; defaults OFF for v1.24.0
186/// wire byte-compat).
187pub mod runtime_flags;
188/// v1.24.0 — Streaming-shaped execution plan extractor. Builds
189/// `StreamingExecutionPlan` from `.axon` source for the production
190/// async SSE path; pre-resolves per-step `BackpressurePolicy` via
191/// `stream_effect_dispatcher` so the hot per-chunk loop in
192/// `axon_server::server_execute_streaming_async` does not re-walk
193/// the AST per chunk. Rejects flows that use 33.x.b-unsupported
194/// features (anchors / lambda apply / let bindings / mid-stream
195/// use_tool / hibernate / pix) with a closed-catalog `PlanFallback`
196/// so the SSE handler can route them to the legacy synchronous path.
197pub mod flow_plan;
198/// v1.24.0 — Per-IRFlowNode async dispatcher skeleton. Closed-
199/// catalog, compiler-enforced exhaustive match over the 45-variant
200/// `IRFlowNode` enum. Subsequent steps 33.y.c–j replace the
201/// transitional legacy shim with real per-variant async handlers.
202/// 33.y.l retires the shim + the `LegacyShimHandled` outcome variant
203/// once every IR variant has its real handler.
204pub mod flow_dispatcher;
205/// v1.24.0 — Streaming via the dispatcher. Lifts
206/// `flow_dispatcher::dispatch_node` into the production SSE hot path.
207///
208/// v2.83.0 — this doc used to describe the graft as pending, behind an
209/// `AXON_STREAMING_VIA_DISPATCHER` flag defaulting to OFF. That migration
210/// FINISHED: 33.z.c flipped the default and 33.z.e deleted the flag together
211/// with the legacy paths. `server_execute_streaming` now calls
212/// [`streaming_via_dispatcher::run_streaming_via_dispatcher`]
213/// unconditionally, and there is no other streaming entry point.
214pub mod streaming_via_dispatcher;
215pub mod flow_version;
216pub mod epistemic_capture;
217pub mod exec_context;
218pub mod graceful_shutdown;
219pub mod graph_export;
220pub mod health_check;
221pub mod hooks;
222pub mod http_tool;
223/// v2.53.0 — the deterministic OOXML writer (DOCX/PPTX/XLSX) behind the
224/// `DocumentRenderer` native tool. Byte-deterministic + provenance-embedding.
225#[cfg(feature = "documents")]
226pub mod ooxml;
227/// v2.54.0 — the read-only filesystem capability + path sandbox.
228pub mod fs_sandbox;
229/// v2.54.0 — the OOXML reader: bounded, born-Untrusted, Parsed text tree.
230#[cfg(feature = "documents")]
231pub mod ooxml_read;
232/// v2.54.0 — the surgical edit engine + per-part hash manifest.
233#[cfg(feature = "documents")]
234pub mod ooxml_edit;
235/// v2.54.0 — the `Inferred`-extraction contract: the `ExtractionEngine`
236/// trait, the born-`Inferred` span with measured confidence, and the
237/// confidence-floor quarantine gate. The producers v2.54.0 left the class without.
238pub mod extraction;
239/// v2.54.0 — the IDP-E recognizer kernel: the deterministic geometry+topology
240/// engine (Otsu → cubical β₀/β₁ → geometric discrimination → reading order →
241/// pix-navigable canonical tree). Reads a bounded PGM/PBM raster; real image
242/// decode is the sidecar (v2.54.0). Scoped to clean machine-print.
243pub mod idpe;
244/// v2.54.0 — the active-inference foveation planner: spend the recognizer on
245/// the highest-information-scent regions until the answer resolves or the budget
246/// (v2.28.0) is exhausted; every foveation is a replayable `ledger` trail entry.
247pub mod foveation;
248/// v2.54.0 — the IDP-E image front-end: deterministic Perona-Malik anisotropic
249/// diffusion (Catté-regularised) + Gabor phase-tensor orientation energy that
250/// clean and analyse a raster before recognition. The CVE-prone image DECODE is
251/// isolated in the sidecar binary (`src/bin/idpe_sidecar.rs`), which feeds this
252/// front-end already-decoded grayscale — hostile bytes never reach the runtime.
253pub mod idpe_frontend;
254pub mod inspect;
255/// v2.52.0 — Native Web Acquisition runtime (`scrape_http` / `scrape_dom` /
256/// `scrape_crawl`); born-Untrusted content, pluggable stealth fetcher.
257pub mod scrape_tool;
258/// v2.58.0 — Governed Contact Enrichment (`scrape_enrich`): structured
259/// contact lookup via a pluggable enterprise provider; results born Inferred
260/// (≤ believe-ceiling) + Untrusted. OSS default = typed refusal (no fabrication).
261pub mod enrichment;
262/// v2.77.0 — axon-agora governed social connectors (`agora_linkedin` /
263/// `agora_facebook` / `agora_instagram` / `agora_tiktok`): the first official
264/// library of axon-lang. Per-platform pluggable `SocialConnector` cores; every
265/// result born Untrusted. OSS default = typed refusal (no fabrication).
266pub mod agora_runtime;
267/// v2.77.0 — the agora OAuth token-refresh orchestration (the OSS core the
268/// enterprise v2.4.0 daemon drives): enumerate → decide → exchange → atomically
269/// persist, closing the rotating-refresh-token trap. Clock injected; the vault
270/// is the `SecretCustody` port.
271pub mod agora_refresh;
272/// v2.60.0 — Governed CRM Delivery (`deliver`): the egress-dual of acquisition.
273/// Canonical, idempotent CRM operations delivered via a pluggable enterprise
274/// transducer; each field carries its epistemic provenance or the author
275/// vouched (T920). OSS default = typed refusal (no fabricated receipt).
276pub mod delivery;
277pub mod lambda_data;
278pub mod lambda_runtime;
279pub mod logging;
280// v2.81.0 — `sqlx::migrate!` is a compile-time macro over `./migrations`.
281#[cfg(feature = "postgres")]
282pub mod migrations;
283pub mod output;
284pub mod mdn;
285pub mod mdn_memory;
286pub mod mdn_provenance;
287pub mod parallel;
288pub mod pix_mdn_pcc;
289pub mod pix_navigator;
290pub mod plan_diff;
291pub mod plan_export;
292pub mod rate_limiter;
293pub mod request_binding;
294pub mod request_log;
295pub mod request_middleware;
296pub mod repl;
297pub mod replay;
298// v2.81.0 — an `axum::middleware::from_fn` handler end to end (request
299// span, trace-id header, latency record). Nothing in it survives without the
300// framework, so it is gated whole rather than split.
301#[cfg(feature = "server")]
302pub mod request_tracing;
303// v1.23.0 — Body schema validation for first-class axonendpoint
304// routes. `route_schema` hosts the pure `validate_body` primitive +
305// `collect_type_table` walker. The fallback handler in `axon_server`
306// consults the table at request time per (method, path).
307pub mod route_schema;
308// v1.23.0 — Idempotency-Key store for POST/PUT axonendpoint routes.
309// Stripe-compatible. Cross-tenant isolation via (client_id, path, key)
310// composite key. 24h default retention. Same-key-different-body
311// returns 422 per industry convention.
312pub mod idempotency;
313// v1.23.0 — Auth scope (capability subset matching) for first-class
314// axonendpoint routes. `requires: [admin, legal.read, ...]` declarations
315// gate dispatch on declared_requires ⊆ token_capabilities. Closed slug
316// grammar shared with `axon_frontend::parser`. Mirror of Python
317// `_is_valid_capability_slug`.
318pub mod auth_scope;
319// v1.23.0 — Replay-token binding for first-class axonendpoint routes.
320// Append-only log keyed by trace_id; populated on every successful 2xx
321// POST/PUT where `replay:` resolves to true. `GET /v1/replay/<trace_id>`
322// returns the original request body + response body + metadata for
323// regulatory audit (PCI DSS Req 10, FedRAMP AU-2, FRE 502, 21 CFR Part 11).
324pub mod axonendpoint_replay;
325// v1.24.0 — Layer 1: flow execution event stream. Closed catalog of
326// {FlowStart, StepStart, StepToken, StepComplete, FlowComplete,
327// FlowError} per D2. Consumed by execute_sse_handler (33.c) for live
328// SSE forwarding; cross-stack drift-gated against the Python mirror.
329pub mod flow_execution_event;
330pub mod resilient_backend;
331pub mod retry_policy;
332pub mod runner;
333// v2.81.0 — the version string in a leaf module with no dependencies. It
334// used to live in `runner`, which put the whole flow executor (sqlx, reqwest,
335// tokio, axum, axon-csys) into the reachable set of every compiler-side
336// subcommand that wanted a string literal. See `version.rs`.
337pub mod version;
338// v2.81.0 — the ingest provenance lattice, dependency-free. See the module
339// docs: it lived in `ooxml_read` and dragged the OOXML surface behind it.
340pub mod ingest_provenance;
341// v2.81.0 — THE THIRD INSTANCE OF THE SMELL, and the largest. The flow
342// execution RESULT (`ServerExecutionResult`, `EnforcementSummaryWire`) lived in
343// `axon_server`, so `flow_dispatcher`, `streaming_via_dispatcher` and
344// `wire_envelope` — the core execution path — could not name their own output
345// without the HTTP server. Both are pure data; `axon_server` re-exports them.
346pub mod execution_result;
347// v2.81.0 — `parse_truthy_env`, the cross-stack truthy contract shared
348// with the Python CLI. It reads an env var; it lived in `axon_server`, and
349// `main.rs` called it there while building `ServerConfig`.
350pub mod env_flags;
351// v2.81.0 / the design decision — the pinned-connection PORT. The executor used to name
352// `sqlx::pool::PoolConnection<sqlx::Postgres>` in its own signatures, threading a
353// concrete database type through `runner` -> `flow_dispatcher` ->
354// `streaming_via_dispatcher`, i.e. the cognition path. It now names `PinnedConn`
355// and cannot reach the driver at all. See the module docs for why a newtype beat
356// a trait (the executor never calls a method on a pin — it only holds one).
357pub mod pinned_conn;
358// v2.0.0 — public shield-scanner registration hook. OSS ships no
359// scanners (identity); enterprise vertical crates register HIPAA/legal/AML
360// scanners here at boot. The `shield apply` handler consults it.
361pub mod shield_registry;
362/// v2.67.0 — the Cognitive-I/O supervisor: the loop that instantiates the
363/// declared λ-L-E dataflow graph (`observe` → {`ensemble`, `immune`} →
364/// {`reflex`, `heal`}, plus `reconcile`) and drives it. The language was complete
365/// and the kernels took the IR directly; **nobody had ever built the loop.**
366pub mod cognitive_io_supervisor;
367/// v2.67.0 — the source adapter registry: what an `observe` actually looks at.
368/// **Deny-by-default** — an unregistered source is UNKNOWN, not healthy, and the
369/// observation refuses rather than fabricating a reading.
370pub mod source_registry;
371pub mod server_config;
372pub mod server_metrics;
373pub mod session_scope;
374pub mod session_store;
375pub mod step_deps;
376pub mod storage;
377// v2.81.0 — the tenant-scoped RLS storage layer. `storage.rs` (the port +
378// the in-memory backend) stays in every build; only this implementation goes.
379#[cfg(feature = "postgres")]
380pub mod storage_postgres;
381// v1.30.0 — the `axonstore` cognitive data plane runtime. 35.b ships
382// `store::filter` (the parameterized where-expression compiler).
383pub mod resource_lease;
384pub mod resource_resolver;
385pub mod store;
386pub mod stdlib;
387// v2.81.0 — tenant EXTRACTION (JWKS verification + the axum middleware
388// that resolves a tenant from an inbound request) is server code and is gated as
389// such. Tenant IDENTITY — the task-local, `TenantPlan`, `TenantContext`,
390// `current_tenant_id`, `scope_tenant` — moved to `tenant_context` below, because
391// `storage_postgres` reads it in 31 places to build the RLS `SET LOCAL` of every
392// query and should never have needed a web framework to do it. `tenant`
393// re-exports all of it, so `axon::tenant::current_tenant_id` still resolves.
394#[cfg(feature = "server")]
395pub mod tenant;
396/// v2.81.0 — tenant identity, dependency-free. See the module docs.
397pub mod tenant_context;
398pub mod tenant_secrets;
399// v1.4.0 — JWT signature verification + JWKS client. Used by
400// tenant::tenant_extractor_middleware when AXON_JWT_JWKS_URL is set.
401pub mod jwt_verifier;
402// v1.4.0 runtime — `trust_verifiers` holds the runtime
403// implementations that the compiler recognises; `stream_runtime` is
404// the Stream<T> channel with policy dispatch. The compile-time
405// `refinement` and `stream_effect` catalogs live in `axon-frontend`.
406pub mod trust_verifiers;
407pub mod stream_runtime;
408// v1.24.0 — Stream-effect dispatcher (Layer 4 of the v1.24.0 cycle).
409// Bridges the `effects: <stream:<policy>>` declarations on tool
410// definitions to actual runtime backpressure behavior on the SSE
411// wire. The dispatcher itself is a thin composition over
412// `stream_runtime::Stream<T>` (which carries the policy semantics)
413// and the AST resolver (which extracts the declared policy from the
414// tool referenced by each step).
415pub mod stream_effect_dispatcher;
416// v1.24.0 — Cooperative cancellation primitives (D6 cancel-safety).
417// `CancellationFlag` + `CancelOnDrop` are the building blocks that
418// bind SSE response lifetime to the executor's spawn_blocking task:
419// when the wire client disconnects, the consumer cancels the flag,
420// which the producer observes between event emissions and exits
421// early instead of running the flow to completion against a dropped
422// channel.
423pub mod cancel_token;
424pub mod channel_semaphore;
425// v1.28.0 — Wire-format adapter framework.
426// `wire_format` defines the WireFormatAdapter trait + per-dialect
427// adapters (axon / openai / anthropic). The SSE producer in
428// `axon_server::execute_sse_handler` uses `select_adapter(dialect)`
429// to translate internal FlowExecutionEvents into the dialect-
430// specific wire shape adopters' SDKs expect.
431//
432// v2.81.0 — behind the `server` feature. Every adapter builds
433// `axum::response::sse::Event`, and its only consumer is the SSE producer in
434// `axon_server`. D: GATE, do not define our own event type — an SSE `Event` is
435// four fields, but inventing a parallel one with a single consumer would add an
436// abstraction to avoid a dependency that the only caller already has. If a
437// non-HTTP dialect consumer ever appears, that is the moment to own the type.
438#[cfg(feature = "server")]
439pub mod wire_format;
440// v2.0.0 — Pure Silicon Cognition wire envelope. The canonical
441// `FlowEnvelope` payload for `transport: json` axonendpoint responses
442// + legacy `POST /v1/execute`. Isomorphic serialization of the
443// ψ-vector `⟨T, V, E⟩`. See `the design plan`.
444pub mod wire_envelope;
445// v2.0.0 — Wire envelope producer helpers. Closed-taxonomy
446// translators from runtime execution metadata into the wire envelope's
447// epistemic fields (`provenance_chain` + `blame_attribution`).
448pub mod wire_envelope_producers;
449// v2.0.0 — Rust CLI binary parity. New subcommands that closed
450// the gap vs the Python CLI (`axon parse` aggregator + `axon fmt`
451// round-trip formatter).
452pub mod cli_parse;
453pub mod cli_fmt;
454// v1.4.0 — Zero-Copy Multimodal Buffers.
455// `buffer` defines ZeroCopyBuffer (Arc<[u8]>-backed) + BufferKind
456// (open registry) + BufferPool (slab allocator with per-tenant
457// soft-limit accounting). `ingest` hosts the network deposit paths
458// (multipart/form-data streaming parser, WebSocket binary-frame
459// accumulator) that populate buffers without intermediate copies.
460pub mod buffer;
461pub mod ingest;
462// v1.4.0 runtime — `replay_token` hosts ReplayToken canonical
463// hashing + pluggable ReplayLog + ReplayExecutor for re-running from
464// any token. The compile-time `legal_basis` catalog lives in
465// `axon-frontend`.
466pub mod replay_token;
467// v1.4.0 — Stateful PEM over WebSocket. `pem::state`
468// defines CognitiveState with Q32.32 fixed-point float encoding
469// so density-matrix round-trips are bit-identical across reconnects.
470// `pem::continuity_token` is an HMAC-signed handshake that proves
471// a reconnecting client is the original party. `pem::backend`
472// exposes the PersistenceBackend async trait + in-memory impl;
473// production uses axon_enterprise::cognitive_states (Postgres +
474// envelope encryption).
475/// v2.83.0 — the `mandate` enforcement engine: the closed loop that
476/// refuses to release any output its constraint set rejects.
477pub mod mandate_engine;
478/// v2.83.0 — the name-keyed `ots` transformer registry (shield_registry's
479/// proven shape). An unregistered ots REFUSES at dispatch — a transformation
480/// that transforms nothing is the v2.67.0 F18 lie.
481pub mod ots_registry;
482/// v2.83.0 — `hibernate`: the parking lot, the continuation id, and the
483/// lazy-expiry timeout. The flow HALTS; resume rides `emit`.
484pub mod hibernation;
485pub mod pem;
486// v1.4.0 — Ontological Tool Synthesis binary pipelines.
487// `ots::pipeline` hosts Transformer trait + TransformerRegistry +
488// Dijkstra-based path search. `ots::native` seeds μ-law ↔ PCM16
489// + resample (8k/16k/48k ladder). `ots::subprocess::ffmpeg` is
490// the subprocess fallback with warm-pool + availability detection.
491// The compile-time slug catalog lives in `axon-frontend::ots_catalog`.
492pub mod ots;
493pub mod tool_executor;
494pub mod tool_registry;
495// v1.29.0 — Tool trait + ToolChunk closed-catalog
496// surface for tools-as-stream-producers. Bridges adopter-source
497// `effects: <stream:<policy>>` declarations into the runtime via
498// the dispatcher's per-chunk wire emission path (v1.29.0 lands
499// the wiring; this module is the structural foundation).
500pub mod tool_trait;
501// v1.29.0 — Bridge from ToolEntry (registry shape) to
502// Tool trait impls (dispatcher's streaming surface). The dispatcher's
503// `pure_shape::run_step` calls `tool_dispatch_bridge::resolve_streaming_tool`
504// for is_streaming-flagged tools + drains the resulting Stream<ToolChunk>
505// chunk-by-chunk into the wire.
506pub mod tool_dispatch_bridge;
507// v2.39.0 — Remote Hands runtime: pure argv render + confirmation-hash
508// binding + output bounding + the axon⇄agent wire protocol.
509pub mod technician_dispatch;
510// v2.40.0 — result-memoization cache core: content-addressed keys,
511// in-process LRU tier with single-flight + TTL jitter + size bound, the
512// `CacheBackend` trait (enterprise injects Redis), and policy resolution.
513pub mod cache_runtime;
514// v2.41.0 — the mathematical core of `forge` Directed Creative Synthesis:
515// Boden profiles, NCD novelty (the computable Kolmogorov-novelty proxy),
516// best-of-N selection, and fail-closed verification.
517pub mod forge;
518// v2.42.0 — the `HolographBackend` port + the OSS reference HRR codec
519// (circular-convolution binding via a self-contained radix-2 FFT), the
520// `savant` long-horizon memory-compression layer (paper section 5).
521pub mod holograph;
522// v2.42.0 — the remaining `savant` runtime ports + OSS reference impls:
523// `inference` (classical VFE/EFE active inference, no advantage claim),
524// `topology` (Vietoris–Rips β₀/β₁ + PHC-proxy centrality), and `synth`
525// (deny-by-default dynamic tool synthesis — the Extism executor is enterprise).
526pub mod inference;
527pub mod synth;
528pub mod topology;
529// v2.43.0 — the `WardenBackend` port + the OSS reference static analyzer
530// (attested `Vulnerability` findings; authorization + deny-by-default enforced;
531// paraconsistent finding-validator). The enterprise LLM engine mounts v2.43.0.
532pub mod warden;
533pub mod tool_validator;
534pub mod trace_export;
535pub mod trace_store;
536pub mod trace_stats;
537pub mod tracer;
538pub mod version_diff;
539pub mod webhook_delivery;
540pub mod webhooks;
541/// v2.46.0 — the `CredentialMinter` port behind the `mint` flow verb
542/// (attenuated, TTL-bounded ephemeral credentials; fail-closed when absent).
543pub mod credential_minter;
544/// v2.48.0 — the `SecretCustody` port behind the `backend: secrets`
545/// metadata store, the `rotate` verb and the `tool { secret: }` injection
546/// (`rotation_without_revelation`; fail-closed when absent).
547pub mod secret_custody;
548/// v2.46.0 — declared cognitive time: the runtime half of `now:` (one
549/// capture per run, deterministic prompt line, envelope record).
550pub mod temporal_context;
551/// v2.27.0 — the runtime for the `window` temporal execution guard
552/// (timezone-aware `is_in_window` / `next_window_open` via chrono-tz).
553pub mod window;