Files
swarm-house/docs/adr/ADR-0008-runtime-data-paths.md
T
eSlider d3ccd6f94e
CI & Release / Verify simulator (push) Successful in 11s
CI & Release / Trivy scan (push) Successful in 8s
CI & Release / Semantic Release (push) Successful in 5s
docs: record architecture decisions (ADR-0001..0009) and operations knowledge
Add docs/adr/ with a chronological ADR set reconstructed from the project
history (no orchestrator, one storage format, derived-state sync,
SQL-over-SSH contract, WireGuard beneath SSH, IaC boundaries, non-root
image, runtime data paths, bounded lake scans), an index README, and a
template. Distinguish repo-local ADRs from ecosystem-wide ASRs.

Expand AGENTS.md with a decision-records section and a runtime/operations
guide (service URLs, rebuild workflow, CPU budget knobs). Reference the
ADRs from README, CONTRIBUTING, and the affected design docs, and add an
open question for T1 partition pruning.
2026-07-09 11:41:05 +01:00

41 lines
1.5 KiB
Markdown

# ADR-0008: Shared `var/t1` / `var/t3` runtime paths; state out of Git
## Status
Accepted (2026-07-08)
## Context
Compose, the k3d fleet, and the ground offload job all need to read and write
the same data lake, so that "go live" in the prototype shows the data the
simulator just generated. Early on, Terraform state and the provider cache were
accidentally committed (~6 MB of `*.tfstate` and a vendored provider binary),
polluting history and risking stale/secret data in Git.
## Decision
Standardise two **gitignored** runtime directories at the repo root:
| Path | Tier | Contents |
| --- | --- | --- |
| `var/t1/` | T1 live lake | In-flight Parquet from Compose or the k3d fleet |
| `var/t3/` | T3 warehouse | Offloaded historical partitions |
They are created automatically and overridable via
`SWARM_T1_DIR` / `SWARM_WAREHOUSE_DATA` / `SWARM_SIM_DATA`. Treat `var/` as
**runtime-only** per the ecosystem canonical layout. `.gitignore` excludes
`*.tfstate`, `*.tfstate.backup`, and `.terraform/` while **keeping**
`.terraform.lock.hcl` (the lock is source, the state is not).
## Consequences
- One lake feeds every component; the live prototype reflects real generated
data.
- Git history carries no machine state or large binaries; `terraform` treats
its state as local/remote-backend concern, not versioned source.
- Ownership of these paths is fixed to uid 10001
([ADR-0007](ADR-0007-non-root-image.md)).
- Recovery from earlier state drift is documented in
[`../../infra/terraform/README.md`](../../infra/terraform/README.md)
(`terraform import`).