1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! tatara-env — typed environments that compose tatara-domain
//! resources into one validated stack snapshot.
//!
//! ## What it solves
//!
//! Domains in isolation are useful — `(defgateway …)` is a typed
//! gateway, `(defciliumnetworkpolicy …)` is a typed network
//! policy. But a real platform is **the composition** — gateway
//! + network policies + monitors + BPF programs + storage +
//! policy, all coherent, all referencing each other. Without a
//! composition layer, every consumer (arch-synthesizer, FluxCD
//! manifest writer, tameshi attestation builder) reinvents the
//! "collect heterogeneous resources" wheel.
//!
//! `tatara-env` is the layer. One typed `Env` snapshot per stack,
//! produced by walking a program's top-level forms and dispatching
//! each through the global domain registry. The output is a
//! stable, serializable graph downstream pipelines consume.
//!
//! ## Authoring shape
//!
//! ```lisp
//! (defenv
//! :name "production"
//! :description "Edge-protected, observed, gateway-API gated"
//! :imports ("tatara-gateway-api"
//! "tatara-cilium"
//! "tatara-prometheus-operator"
//! "tatara-ebpf"))
//!
//! (defgateway :gateway-class-name "nginx" :listeners ())
//! (defbpf-policy
//! :name "edge_protection"
//! :description "L4 SYN-flood mitigation."
//! :programs ("drop_syn_flood")
//! :maps ("syn_counter"))
//! ; …more resource forms…
//! ```
//!
//! `compile_into_env` reads the whole list, finds the one
//! `(defenv …)` form, treats every other form whose head is a
//! registered domain keyword as a resource, ignores comments +
//! macros + non-domain forms.
//!
//! ## What's compounding
//!
//! - **Cross-resource validation** — a future `validate` pass
//! walks the resources looking for dangling refs (a `defservice`
//! pointing at a `secret` that doesn't exist).
//! - **Stable serialization** — JSON Schema-friendly output for
//! the rest of the pipeline.
//! - **Typed FluxCD / Helm / Pangea emission** — env →
//! per-platform manifests via `arch-synthesizer`.
//! - **Diff-based rollouts** — BLAKE3 the env JSON; only changed
//! resources reapply.
//!
//! Every one of those bolts on top of the typed graph this crate
//! produces.
pub use ;
pub use ResourceKey;
pub use EnvSpec;
pub use ;
/// Register the `(defenv …)` keyword form. Embedders call this
/// once during boot, alongside their other domain `register()`
/// calls.