Expand description
EnvMatrixSpec — the ephemeral-environment permutation generator.
One (defenvmatrix …) declaration fans a single EphemeralSpec base out
across a set of named axes into the whole permutation set of environments,
spawned together. This is generation-over-composition (Pillar 12) applied
to environments: author the matrix once, get every variant.
Each permutation overlays its axis values into the base’s
aplicacao.values_overlay (or a well-known @-target like @version),
yielding a distinct canonical spec — so each variant gets its own
deterministic EphemeralEnvId (blake3(spec)[:8]) and FQDN
({app}.{envId}.{cluster}.{location}.{domain}) for free, via the existing
crate::hostname machinery. The matrix is workload-agnostic: the base
can install any OCI chart, so the same primitive sweeps echo servers,
gateways, migrations, or test suites.
Lisp authoring:
(defenvmatrix echo-sweep
:base (:aplicacao (:chart-ref "oci://ghcr.io/pleme-io/charts/echo"
:version "0.1.0" :profile "minimal" :values-overlay ())
:ttl "2h" :teardown Always)
:axes ((:name "version" :path "@version" :values ("0.1.0" "0.2.0"))
(:name "replicas" :path "replicaCount" :values (1 3))
(:name "flag" :path "feature.flag" :values ("on" "off")))
:select Cartesian
:budget (:max-envs 12 :cost-ceiling "$5/h")
:breathe (:dimensions ((:kind "memory" :floor "128Mi" :ceiling "1Gi")
(:kind "cpu" :floor "100m" :ceiling "1"))
:cooldown-seconds 60 :dry-run #t))→ 2×2×2 = 8 named EphemeralSpecs. tatara-lispc renders each as a
Process CR plus its breathe Band CRs (one per dimension), so the whole
sweep is cost-bounded under the shared :budget and auto-scales within the
:breathe floor/ceiling limits.
Structs§
- Breathe
Dimension - One banded resource dimension: which breathe Band kind and its bounds.
- Breathe
Envelope - The breathe envelope inherited by every env in a sweep — the per-dimension homeostasis bounds plus dev-loop-tuned cadence.
- EnvMatrix
Spec EnvMatrixSpec— authors(defenvmatrix …). Expands to a set of namedEphemeralSpecvalues viaEnvMatrixSpec::expand.- Matrix
Axis - One permutation axis: a named dimension and the values it ranges over.
- Matrix
Budget - Shared budget across the sweep.
- Named
Ephemeral - A single generated environment: a deterministic name plus the lowered
EphemeralSpec. The name is{matrix}-{axis-value}…; the env’sEphemeralEnvIdis derived downstream from the spec’s canonical hash, so distinct overlays ⇒ distinct ids ⇒ distinct FQDNs automatically. - Unknown
Select Strategy Kind
Enums§
- Breathe
Dimension Kind - Closed-set typed identifier for the three reachable breathe Band CR
kinds a
BreatheDimension::kindkeyword can target —Self::Memory→MemoryBand,Self::Cpu→CpuBand,Self::Storage→StorageBand— as a Rust enum, so the (keyword-set, CR-kind, name-segment) triple binds at ONE site on the typed algebra rather than at three byte-identical string-literal sites scattered acrossEnvMatrixSpec::breathe_bandsand the deletedband_kind_forhelper. - Matrix
Target - Closed-set typed identifier for the
@-prefixed magic targets aMatrixAxis::pathcan write into on the baseEphemeralSpec— the three reachable aplicacao-field write targets (Self::Version→aplicacao.version,Self::Profile→aplicacao.profile,Self::ChartRef→aplicacao.chart_ref) — as a Rust enum, so the three-way (path-string, aplicacao-field) pairing binds at ONE site on the typed algebra rather than at three byte-identical inline arms in [apply_axis]. - Select
Strategy - How the permutation set is drawn from the axes.
- Select
Strategy Kind - The closed set of
SelectStrategykinds — the discriminator view, payload-stripped, that sibling closed-set enums in this crate carry (seecrate::lifetime_clock::TerminateReasonKind,MatrixTarget,BreatheDimensionKind).
Functions§
- compile_
env_ matrix_ source - Compile a
(defenvmatrix …)Lisp source into namedEnvMatrixSpecvalues.