Skip to main content

Module state

Module state 

Source
Expand description

Reconciler-written sidecar state for declared machines.

R330-F15 split: .yah/infra/machines/<name>.toml is the declared identity (operator-edited, version-controlled, names the logical slot + shape). .yah/infra/state/machines/<name>.json is the observable state captured when the reconciler adopts a live server into that slot. State carries provider-side derivatives (Hetzner server id, current public IPv4, last adoption timestamp, hostkey fingerprint observed at attach time).

Why split: name is the binding identity (Hetzner enforces unique server names per project; names survive provider migration). Provider ids and observables are derived state — pinning them in machine.toml couples the declared shape to a particular provider instantiation, blocking the us-west-001-moves-Hetzner→DigitalOcean story by editing one TOML field.

Adoption-shape verification compares machine.toml against the live API, NOT against the state file. State is for humans/audit/idempotency. The reconciler reads it only to skip redundant API calls on re-run.

Structs§

MachineState
On-disk JSON shape for .yah/infra/state/machines/<name>.json.