Spike S13: headless clan driving — gates every clan-shaped slice (ADR 0002 / DDR 0010) #4
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spike S13 — headless clan driving
Gating spike (PROCESS.md Phase 2½): validates ADR feasibility, references no
seam contract, depends on nothing — a root by construction. Its findings feed
the seam gate: the review of
docs/seams/clan.md(status: proposed)happens with this spike's evidence in hand, not on paper.
Task manifest
Why this spike exists
ADR 0002 adopts clan.lol as the fleet layer: OurCloud generates clan
configuration and drives the clan CLI programmatically, so operators never see
Nix. Founding creates a community's first node; devices join via an enrollment
code and the install command; the control plane (config repo, deploy runner,
IdP, dashboard) lives on the cluster and is self-managing. None of this has
been exercised headlessly by us — clan is pre-1.0, mid-migration
(
clanModules→clanServices), and its docs assume an interactive human at aterminal. This spike determines whether ADR 0002 survives contact with
reality, and produces the integration notes the build codes against. Every
clan-shaped slice in the slice-map is gated on it. If it fails, the fallback (a
bespoke thin layer over plain NixOS + deploy-rs/colmena-class tools) needs the
same questions answered — nothing is wasted either way.
The earlier clan-mauke spike (
git.matou.nz/waipuna/clan-mauke-spike, DEVLOG)proved clan runs a real HA stack hand-driven; its 22 gotchas are already
absorbed as requirements in
docs/seams/clan.md. What it did not prove isthe load-bearing question here: driving clan from a program.
Environment
clan-labskill environment. Onedisposable DigitalOcean droplet from the
clan-lab-golden-*snapshot boots a3-machine clan.lol cluster (node1–node3 as libvirt VMs; node1 is
gateway-shaped — the droplet's public 80/443 forward to it) in ~2–3 min. See
the skill's SKILL.md for the CLI, guardrails, and honesty limits (functional
findings only — no perf/resource-floor numbers from nested VMs). Q2.3's
"VPS from a stock cloud image" runs as a stock-cloud-image VM inside the lab,
a functional stand-in; note it as such in the findings.
chase upstream during the spike. (The golden image pins clan-core
db4db726, recorded in/root/lab/GOLDEN-INFOon the lab host and indocs/spike-findings/clan-lab-golden.md— reuse that pin unless there is awritten reason not to.)
spikes/S13-clan-orchestration/— bash/Python glue +generated Nix is fine; quality bar is "reproducible by the next person".
The questions
Each gets an explicit verdict in the findings doc with evidence.
Q1. Headless, programmatic driving (load-bearing)
Can a program — not a human editing Nix — own the full clan lifecycle?
Generate clan configuration from structured data (JSON → rendered Nix or
clan's own APIs): is there a stable data interface, or are we templating Nix
text? Run every operation non-interactively (no TTY prompts, no editor
spawns): create machine, deploy machine, update fleet, remove machine. Capture
exit codes and machine-parseable output — can failures be detected and
explained programmatically? (Product context: errors must translate to plain
language for a non-technical operator; log-spelunking is banned. Assess
honestly what is catchable at generation time vs exploding at deploy time.
docs/seams/clan.mdassumes PTY driving with outcomes read from the log,never
$?— validate or refute that assumption.)Q2. Bootstrap paths (no ISO/USB anywhere)
founding payload — initial clan config, founding secrets, mesh enrollment —
such that first boot brings up the mesh + control plane unattended. How is
it parameterized per-community, how big, how long from create to
dashboard-up?
one-shot install command takes the code, the device calls in over the mesh;
after approval, NixOS takeover over that established connection
(nixos-anywhere/kexec-class). This is THE path for real Linux hardware —
measure reliability and failure legibility hardest.
confirm nothing assumes physical hardware.
(same enrollment, no takeover — already NixOS).
Confirm (a) paths 2–4 share one enrollment mechanism with takeover as the only
Linux-host extra; (b) founding VM and joiner VM are the same image
parameterized differently. The design assumes both.
Q3. Secrets — clan vars / sops-nix
Programmatic generation and management (no interactive prompts). Where do
secrets live at rest, who decrypts what, and can the tiered model be
implemented: deploy runner holds day-to-day secrets; per-operator keys
revocable individually without re-keying the world; crown jewels kept OUT of
the runner's reach (escrowed offline)? Rotate one secret, redeploy, confirm no
other secrets churned.
Q4. Self-management — the runner lives on the cluster
Stand up the control plane ON a fleet node: bare git repo + deploy runner
(systemd timer or webhook) applying clan config to all nodes including
itself. Does clan tolerate self-deploy? Footguns (restarting the runner
mid-deploy; SSH-to-self)? Demonstrate the full loop: dashboard-shaped mutation
→ commit → runner applies → fleet converges. Break-glass rescue: with the
runner node DOWN, drive the fleet from an external machine using only a clone
of the repo + operator key.
Q5. Mutation lifecycle & timings
Headlessly, timing each: add a machine; add a service instance across two
machines; move a service between machines; remove a machine cleanly (secrets
revoked?); roll back the last change (git revert → converge). Report
wall-clock times and idempotence (second run is a no-op).
Q6. Service module fit — port Garage as the template
Port ONE real catalogue service: Garage (behavioural reference:
matou-distributed-servers/roles/garage/— config template, RF=3, zones,per-app keys, bucket provisioning). Write it
clanServices-style with rolesacross 3 nodes. Is
clanServicesusable today or still moving? How much ofthe imperative post-daemon provisioning fits clan's declarative model vs needs
an out-of-band reconciler — this shapes all future catalogue ports.
Q7. Updates, rollback, channel mechanics
Bump a pinned input, deploy staged (one node, health-check, then rest) — does
clan give us staged rollout or do we script it? Break a node deliberately;
confirm NixOS generation rollback restores it and what the runner sees.
Channel model: can a community's flake pin OUR channel such that "pin/fork the
channel" (sovereignty exit) is real? Demonstrate a community repo consuming a
shared upstream + local overrides.
Q8. Mesh coupling
We are committed to Netbird (ADR 0039), not clan's default ZeroTier. Confirm
clan works with its VPN modules unused: deploys over SSH across our own mesh
IPs, no hidden ZeroTier assumptions. Note anything that gets harder without
their mesh module.
Q9. Resource floor & build placement
Deploy to a 4 GB RAM node (the declared gateway minimum): does on-device
evaluation/build fit, or does the model require builds elsewhere + a binary
cache? If a cache is required, sketch what OurCloud-as-supply-chain must run.
Rough numbers: eval time, closure download size, disk footprint.
Q10. Stability & maintenance judgment (qualitative)
After two weeks: doc accuracy, error quality, upgrade churn risk, community
responsiveness. Finish with the recommendation and the 5–10 integration
interfaces the build should code against — reconciled against
docs/seams/clan.md.Deliverables & exit criteria
docs/spike-findings/S13-clan-orchestration.md: verdictper Q1–Q10 with evidence, timings table (Q5), recommendation +
integration-interface list (Q10).
spikes/S13-clan-orchestration/: config generator, runnerscript, Garage module port, README reproducing the whole loop from scratch.
path — generate → found first node → self-managing cluster → add node → add
Garage → staged update → rollback.
Success = Q1–Q5 confirmed (workarounds acceptable if specified), Q6
answered decisively either way, confident Q10 recommendation.
Failure is a valid result = if Q1, Q2.1, or Q4 is broken, stop early and
write up; ADR 0002 gets reversed cheaply — that is the spike doing its job.
Timebox
Two weeks. If week 1 ends without Q1 + Q2.2 working, that is itself a major
finding — raise it then rather than grinding. Ugly-but-honest workarounds with
notes beat polished partial coverage.
Provenance: adapted for OurCloud from
idss:docs/plans/2026-07-02-s13-clan-orchestration-spike.md(2026-07-02),which DDR 0010 names as the gating validation for clan-shaped work.
Agent Brief
Category: enhancement
Summary: Run spike S13 (headless clan driving) on the clan-lab environment and deliver a verdict per question, closing with an adopt / adopt-with-wrapper / do-not-adopt recommendation.
Current behavior:
ADR 0002 adopts clan.lol, but nothing has exercised driving the clan CLI from a program. The
docs/seams/clan.mdcontract (status: proposed) rests on untested assumptions — notably that clan must be PTY-driven with outcomes read from logs, never$?. Spike step-zero (the clan-lab golden image build, findings indocs/spike-findings/clan-lab-golden.md) already made first contact: clan's own prompts are isatty-guarded, but service-levelprompt = truevars still demand interactive answers, and upstream CLI shapes drift fast. Those observations are leads, not verdicts.Desired behavior:
Every question Q1–Q10 in the issue body has an explicit verdict — confirmed / confirmed-with-workaround (described) / broken (described) — with evidence (commands, output, timings), written to the findings doc named in the task manifest. The doc ends with a recommendation and the integration interfaces the build should code against, checked against
docs/seams/clan.md. If Q1, Q2.1, or Q4 is broken (not merely awkward), stop early and write up — reversing ADR 0002 cheaply is a success outcome, not a failure.Environment (the resolved human decision):
Use the
clan-labskill — read its SKILL.md before any infrastructure action; provision only through theclan-labCLI, never rawdoctl.clan-lab createboots the 3-node lab from the golden snapshot in ~2–3 min. Reuse the golden image's clan-core pin (db4db726) unless a written reason says otherwise. Honesty limits apply: functional findings only — no performance or resource-floor numbers from nested VMs; the 80/443 port-forward simulates public reachability functionally. Q2.3 ("VPS from a stock cloud image") runs as a stock-cloud-image VM inside the lab and must be flagged as a functional stand-in in the findings.Key interfaces:
seam:and Environment sections) — the prototype's quality bar is "reproducible by the next person".docs/seams/clan.md— each of its stated assumptions the spike touches gets validated or refuted by name.clan-lab statusmust be empty when the spike ends.Acceptance criteria:
docs/seams/clan.mdclan-lab statusempty at the end (no droplets left running)Out of scope (from the manifest):
docs/seams/clan.mdwith itSeam-gate update (2026-07-09):
docs/seams/clan.mdopen decisions are now DECIDED (recorded in the doc): (1) during founding the operator app embeds the clan seam as a bundled Go helper (stdio JSON) — steady-state stays on the control plane; the package must build both ways. (2) Enrollment progress is checklist-only at stage/phase granularity — do not build percent-style progress. Q10's reconciliation againstdocs/seams/clan.mdshould read the updated doc.Spike S13 complete — recommendation: ADOPT clan.lol behind the
docs/seams/clan.mdwrapper.Ran headless against the
clan-lablab (pinned clan-coredb4db726). Every load-bearing question (Q1, Q2.1, Q3, Q4, Q5) confirmed; no stop-early gate tripped.inventory.jsonis clan's own JSON (emitted as data), machine configs are templated Nix.clan machines updatereturns truthful non-zero exits with legible messages for eval/connectivity/missing-var — this softens the seam's “never$?” to a layered model (trust$?pre/at-deploy; reserve log-derivation for activation-time masked exits). Classify connectivity before secrets (clan's SSH errors embed the sops-nix path).--build-hostalone is insufficient; the node needs flake-input + clan-helper closures offline. This is the concrete Q9 supply-chain requirement.git revertof a non-tip commit.clanServiceand run live at RF=3 across 3 zones with bucket + app key.clanServicesis usable today; layout/keys/buckets need an out-of-band reconciler — the pattern for every future catalogue port.Caveat: Q2.2 — a full disk-overwrite takeover of a fresh non-NixOS host — is mechanism-confirmed (
clan machines install --phases/--update-hardware-config nixos-facter) but not executed this run (all-NixOS lab + host load). A focused takeover follow-up is owed before the device-add slice ships. Does not trip the stop-early gate (Q2.1 founding-image proven; Q1/Q4 green).Deliverables (commit
984286a):docs/spike-findings/S13-clan-orchestration.md— verdicts per Q1–Q10, timings, recommendation, and 8 integration interfaces reconciled against the seam (3 amendments: layered outcome-detection, a supply/seeding interface, service-carried reconcilers).spikes/S13-clan-orchestration/—generate.sh(JSON→clan flake),runner.sh(commit→apply→classify),garage/(clanService port +reconcile-demo.sh),demo.sh, README.STATUS.md— clan validation debt resolved; clan seam now ready for the seam gate.Lab destroyed after evidence capture.
admin@archive.<apex>— under the private path's.idss.internalapex (ADR 0149) Omeka's installer rejects the TLD, aborts the first-boot install half-done, and no admin user ever exists #1274