Skip to main content

lean_ctx/gateway_server/
mod.rs

1//! Self-hosted org gateway run-mode (`gateway-server` feature).
2//!
3//! Bundles the proxy (remote bind, enterprise#8), the per-request usage store
4//! (Postgres `usage_events`, enterprise#17/#18) and — in later waves — the
5//! admin usage API (enterprise#20) into one deployable server.
6//!
7//! LOCAL_OPTIONAL by classification (`server_capabilities.rs`): compiled in or
8//! out, never gated by account/license/plan — an org can self-host its gateway
9//! with `cargo build --features gateway-server` and full functionality
10//! (Local-Free Invariant; commercial enforcement lives in lean-ctx-enterprise).
11//!
12//! Fail-open is the design rule (enterprise#12): the store subscribes to the
13//! usage stream through `proxy::usage_sink` and persists asynchronously; a slow
14//! or down Postgres degrades metering, never live LLM traffic.
15
16pub mod admin_api;
17pub mod admin_status;
18pub mod admin_timeseries;
19pub mod admin_ui;
20pub mod doctor;
21pub mod evidence;
22pub mod init;
23pub mod keys_cli;
24pub mod report;
25pub mod security;
26pub mod serve;
27pub mod store;
28pub mod user_api;