feat: thin-node cluster rearchitecture (headless nodes, keypair enrollment, instant browsing) #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/thin-node-cluster"
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?
Rearchitects the cluster to a thin-node / authoritative-main model
(ADR 0001 —
docs/adr/0001-thin-node-cluster-architecture.md; build plan indocs/plans/thin-node-implementation-plan.md). Nodes become headless,database-free agents; main owns all state and the UI.
Topology: node → main only over signed HTTPS (main can't dial a node). Ships as
a single unit; validated on a local 2-node harness before merge.
Phases (each independently reviewable)
role=noderuns no web/UI server; Docker healthcheckfalls back to process liveness.
POST /api/cluster/checkinreturns queued commands + a
next_poll_afterhint (idle 15s / active 1s),keep-alive connection, single agent loop. No held connections (scales wide).
BackupMonitorreporter hook; boundedEventSpool(JSONL) buffers through amain outage and replays on reconnect; idempotent ingest keyed by
event_uuid.node_files): node reports its fullmanifest on (re)connect + daily, deltas via events; UI browses main's DB
(instant),
?refresh=1forces a live re-fetch. Download/restore stay live.identity.json; signs everyrequest (
X-Bak-*, UTC-bound date, ±300s replay window).pending+ 401; operator approves thekey on the Nodes page (fingerprint + first-seen IP + time). Optional join
secret gates the pending list;
BT_CLUSTER_AUTO_APPROVEfor hands-off."Approve all" (shown only when ≥1 pending); revoke.
long-poll code removed.
Invariant
Events are the fast path; a full manifest reconcile is the authoritative
backstop — so a lossy/bounded spool self-heals and dropped events never diverge.
Tests
Full suite green — 1112 examples, 0 failures. New coverage for signing,
identity, spool, adaptive check-in, idempotent ingest, manifest mirror, DB-free
DI, and the signed enrollment/approval endpoints.
Validation & rollout (post-merge)
docker-compose.cluster.yml+docs/thin-node-harness-runbook.md— run on anisolated Docker context (the node backs up every labelled container on the
daemon).
generated) → appears pending → approve once. Backout = revert the merge;
citadel's old data is untouched.
🤖 Generated with Claude Code