# barycenters (Rust)
**Govern any agent, and see what `/admit` would have blocked.** Ships in shadow mode. **Zero dependencies** — the HTTP transport is injected via the `Transport` trait, so you wire your own client (reqwest, ureq, std) and the crate pulls in nothing.
```rust
use barycenters::{Client, Config, Mode};
let mut c = Client::new(
Config { endpoint: Some("https://…".into()), namespace: "acme/eng".into(), ..Default::default() },
my_transport, // impl Transport
); // shadow by default
let d = c.admit("deploy_prod", "{\"env\":\"production\"}")?;
// shadow: admit never returns a refusal error; d.would_block tells you what enforce would do.
println!("{}", c.shadow_report().summary);
// → "2 of 17 action(s) would have been blocked by /admit"
```
Implement `Transport` once with the HTTP client of your choice:
```rust
struct MyTransport; // e.g. wrapping ureq or reqwest::blocking
impl barycenters::Transport for MyTransport {
fn post(&self, url: &str, body: &str, idempotency_key: &str) -> Result<barycenters::Resp, ()> {
// POST body to url with header `idempotency-key: {idempotency_key}` and content-type json;
// return Resp { status, body } or Err(()) on transport failure.
todo!()
}
}
```
## When you're ready: enforce
Flipping to `Mode::Enforce` is a deliberate **human** decision (`authority_effect` 0 → 1). A refusal returns `AdmitError::Refused`; an unreachable endpoint **fails closed**. Retries (default 3, transport failures only) carry one idempotency key → the service admits **at-most-once**; a decision is terminal and never retried.
## Honest by default
No endpoint wired → the decision is **AWAITING**; it never fabricates a pass or a block it cannot prove. Authority enters at exactly one point, and it is a human's — this crate only *asks*.