engine-adapters: clan-adapter-config-vars-supply — inventory as data, recipient sets, closure seeding #164

Closed
opened 2026-07-29 05:09:29 +00:00 by ben · 1 comment
Owner

Parent

Engine-adapters child spec: #161 (ADRs 0102–0107; scoped on wayfinder #160 — Ben ruled live: per-family clan-lab smokes gate each family, the arc closes on a real-hardware end-to-end, tickets arm the swarm). Everything else agent-decided, post-hoc review pending.

What to build

The escape-hatch faces real (ADR 0102): Config drives inventory.json as structured data (AddNode/AssignRole/AttachService/SetVarSpec) with the one quarantined Nix-templating layer for per-machine text; Vars exposes recipient-set control (machine keys, per-operator keys, the deliberately-excluded recovery recipient — S13 Q3's tiered model) with per-secret rotation churning nothing else; Supply seeds eval + helper closures onto a node over the established connection (S13 Q4/Q9).

Acceptance criteria

  • Given an AddNode/AttachService edit, When it lands, Then inventory.json changes as data (no text-with-holes) in one commit
  • Given a var rotated, When Generate --regenerate runs, Then only that secret's ciphertext changes
  • Given a recipient set excluding the recovery key, When vars generate, Then the exclusion is a declarative fact readable back
  • Given a cache-starved node, When Supply.Seed runs, Then the node evaluates offline afterwards

Blocked by

  • engine-adapters:clan-adapter-core

Task manifest

task: engine-adapters:clan-adapter-config-vars-supply
implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)"
interface: "clan.Config/Vars/Supply per docs/seams/clan.md — contract unchanged"
seam: "internal/clan seam tests with fakes + contract tests over the CLI double"
acceptance:
  - given: recipient-set specs; when: generate/rotate; then: churn is scoped to the rotated secret
depends_on: [engine-adapters:clan-adapter-core]
out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160)]
needs_human_decision: []
## Parent Engine-adapters child spec: #161 (ADRs 0102–0107; scoped on wayfinder #160 — Ben ruled live: per-family clan-lab smokes gate each family, the arc closes on a real-hardware end-to-end, tickets arm the swarm). Everything else agent-decided, post-hoc review pending. ## What to build The escape-hatch faces real (ADR 0102): Config drives `inventory.json` as structured data (AddNode/AssignRole/AttachService/SetVarSpec) with the one quarantined Nix-templating layer for per-machine text; Vars exposes recipient-set control (machine keys, per-operator keys, the deliberately-excluded recovery recipient — S13 Q3's tiered model) with per-secret rotation churning nothing else; Supply seeds eval + helper closures onto a node over the established connection (S13 Q4/Q9). ## Acceptance criteria - [ ] Given an AddNode/AttachService edit, When it lands, Then inventory.json changes as data (no text-with-holes) in one commit - [ ] Given a var rotated, When Generate --regenerate runs, Then only that secret's ciphertext changes - [ ] Given a recipient set excluding the recovery key, When vars generate, Then the exclusion is a declarative fact readable back - [ ] Given a cache-starved node, When Supply.Seed runs, Then the node evaluates offline afterwards ## Blocked by - engine-adapters:clan-adapter-core ## Task manifest ```yaml task: engine-adapters:clan-adapter-config-vars-supply implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)" interface: "clan.Config/Vars/Supply per docs/seams/clan.md — contract unchanged" seam: "internal/clan seam tests with fakes + contract tests over the CLI double" acceptance: - given: recipient-set specs; when: generate/rotate; then: churn is scoped to the rotated secret depends_on: [engine-adapters:clan-adapter-core] out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160)] needs_human_decision: [] ```
Author
Owner

Built the Config / Vars / Supply escape hatches on the production internal/clan Adapter (commit 42586cb, on origin/main).

  • Config (inventory.go + config.go): edits the structured inventory.json AS DATA — AddNode/RemoveNode/AssignRole/AttachService/DetachService/SetVarSpec — each landing as ONE commit through the single-writer ConfigRepo.Mutate; bad edits refused at call time; the one quarantined Nix-templating layer stays BuildNodeConfig.
  • Vars (vars.go): headless clan vars generate — seals missing secrets or rotates exactly one (--regenerate --generator g) so per-secret churn touches nothing else; unanswered prompt is a typed FailMissingVar (never a hang); answers ride a temp --prompt-input data file (never a TTY, cleaned up); Missing is a pure repo read; Get returns a redacting Secret. SetVarSpec records the S13 tiered recipient set (recovery/escrow excluded) readable back.
  • Supply (supply.go): nix flake archive --to ssh-ng://<target> seeds eval+input closures (S13 offline-eval fix); target from inventory deploy.target_host (no target => fail loud, Netbird capture rides #163); idempotent; Missing is nix copy --dry-run.

Acceptance: all four ACs proven by contract tests over scripted clan/nix doubles + a real single-writer git repo — config_test.go (AC1 data/one-commit, AC3 recovery-excluded recipients readable back), vars_test.go (AC2 rotation churns one secret), supply_test.go (AC4 no closures missing after seed). Enroll/Resume remain fail-loud (#163). go build ./.../vet/gofmt + full clan and wireconvention suites clean.

Built the Config / Vars / Supply escape hatches on the production `internal/clan` `Adapter` (commit `42586cb`, on `origin/main`). - **Config** (`inventory.go` + `config.go`): edits the structured `inventory.json` AS DATA — AddNode/RemoveNode/AssignRole/AttachService/DetachService/SetVarSpec — each landing as ONE commit through the single-writer `ConfigRepo.Mutate`; bad edits refused at call time; the one quarantined Nix-templating layer stays `BuildNodeConfig`. - **Vars** (`vars.go`): headless `clan vars generate` — seals missing secrets or rotates exactly one (`--regenerate --generator g`) so per-secret churn touches nothing else; unanswered prompt is a typed `FailMissingVar` (never a hang); answers ride a temp `--prompt-input` data file (never a TTY, cleaned up); `Missing` is a pure repo read; `Get` returns a redacting `Secret`. `SetVarSpec` records the S13 tiered recipient set (recovery/escrow excluded) readable back. - **Supply** (`supply.go`): `nix flake archive --to ssh-ng://<target>` seeds eval+input closures (S13 offline-eval fix); target from inventory `deploy.target_host` (no target => fail loud, Netbird capture rides #163); idempotent; `Missing` is `nix copy --dry-run`. **Acceptance:** all four ACs proven by contract tests over scripted clan/nix doubles + a real single-writer git repo — `config_test.go` (AC1 data/one-commit, AC3 recovery-excluded recipients readable back), `vars_test.go` (AC2 rotation churns one secret), `supply_test.go` (AC4 no closures missing after seed). `Enroll`/`Resume` remain fail-loud (#163). `go build ./...`/`vet`/`gofmt` + full clan and wireconvention suites clean.
ben closed this issue 2026-07-29 23:15:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#164
No description provided.