Skip to main content

av_harness/
lib.rs

1//! The Agent Harness: the drop-in inline proxy wrapping agent → LLM traffic.
2//!
3//! Hot path (per request): validate identity → check token quota → sanitize →
4//! compress → dispatch a copy to the async workers (non-blocking `try_send`,
5//! bounded channels) → forward upstream → stream chunks back. Workers do the
6//! heavy work: embeddings, loop delta, OCSF emission, bridge publish, ATIF
7//! appends. Receipts are signed once, at session close, asynchronously.
8//!
9//! Silent-error posture: every dropped worker message increments
10//! `av_events_dropped_total`; audited chat/tool work reserves worker capacity
11//! before quotas mutate, so ATIF-bearing jobs are admission-gated (fail
12//! closed), never dropped mid-flight; client aborts still finalize sessions;
13//! worker panics are supervised and counted.
14
15pub mod authz;
16pub mod authzen;
17pub mod backend;
18pub mod config;
19pub mod content;
20pub mod dashboard;
21pub mod http_serve;
22pub(crate) mod inflight;
23pub(crate) mod journal;
24pub(crate) mod mcp;
25pub mod mcp_client;
26#[cfg(feature = "otel")]
27pub mod otel_content;
28pub mod pipeline;
29pub(crate) mod provider;
30pub mod reconciler;
31pub(crate) mod recovery;
32pub mod revocation;
33pub mod routes;
34pub mod session;
35pub(crate) mod spool;
36pub(crate) mod token_routes;
37pub mod worker;
38pub mod workload;
39
40#[cfg(feature = "service-binding")]
41pub mod service_binding;
42
43pub use config::HarnessConfig;
44pub use journal::key_from_signer as control_key_from_signer;
45pub use pipeline::AppState;
46pub use routes::build_router;
47
48/// Internal-only re-exports for coverage-guided fuzzing. Not part of
49/// the stable API; do not depend on these outside `fuzz/`. The
50/// `#[doc(hidden)]` attribute keeps rustdoc from listing them.
51#[doc(hidden)]
52pub mod fuzz {
53    pub use crate::routes::__fuzz_parse_provider_chunk as parse_provider_chunk;
54    pub use crate::routes::__fuzz_sse_frame_end as sse_frame_end;
55}