Hive Topology

You open a shell on the road and type ssh manoir. It works. Two weeks later you type the same string on the same laptop at the chalet and it works again. Nobody renumbered a subnet. Nobody published a Tailscale subnet route. The laptop did not need a special VPN profile for “vacation mode.” The string was the product.
The failure mode this chapter exists to prevent is the opposite story: one flat 10.0.0.0/24 fantasy spanning two basements, a Firewalla that advertises the wrong site as a mesh, and a fine-tuned model that hardcodes “the Mini is always .10” as if there were only one Mini in the world. Multi-site Sanctum is a fleet of complete organisms, not one organism with two basements.
The product in one sentence
Section titled “The product in one sentence”Same design map at every site. Cross-site by node name only. Never merge L3.
| Plane | What it is | What it is not |
|---|---|---|
| Body | Per-site LAN design map (.1 FW · .2 Orbi · .3 HA · .10 Mini) |
A global address space |
| Hive | Tailscale + MagicDNS + nodes.* roster + vault / agents |
Subnet routes of whole hauses |
| Mind | Shared topology priors for prompts and fine-tunes | Per-haus fork of those priors (not the P5 predictor) |
Open mesh (signed LoRA champions between hauses) is a sibling plane — see Champion Gate. Do not overload it as the multi-site control plane.
Body — isomorphic enclave
Section titled “Body — isomorphic enclave”Every site reuses the same local map. Numbers collide across sites on purpose and stay safe because those prefixes are never advertised as Tailscale subnet routes.
| Role | Design IP | Identity pin (Firewalla) |
|---|---|---|
| Firewalla | 10.0.0.1 |
gateway |
| Orbi AP | 10.0.0.2 |
model / hostname match |
| HA Green (when present) | 10.0.0.3 |
homeassistant |
| Mini / brain | 10.0.0.10 |
model + Bonjour / dhcp name |
Those 10.0.0.x values are the design map (documentation-range style anchors for the isomorphic body). Live LAN discovery still goes through endpoint resolution — the hive never treats them as cross-site addresses.
Implementation: identity-rebind in openclaw-skills/firewalla-toolkit (config/identity-pins.json, install scripts on each box). Match by durable identity, not MAC, so Private Wi‑Fi rotation cannot orphan the pin. Sites are separated by Firewalla lan_uuid so manoir’s pins never apply on the chalet Purple and vice versa.
Hive — name-only nervous system
Section titled “Hive — name-only nervous system”Cross-site traffic uses node names. Naming is a product surface.
sanctum node names # cheat sheetsanctum node listsanctum node resolve chalet # preferred MagicDNS stemsanctum node whoami # .node_id must equal roster keyssh neo@manoir # MagicDNS when the machine is named manoir| Do | Don’t |
|---|---|
manoir, chalet, mbp |
Display codes (MM64, MBP128) as addresses |
manoir-fw, manoir-ha |
Dual live names without a deliberate recovery map |
Agent names for agents (ahsoka) |
Agent names as Tailscale hosts |
| Resolve at call time | Hardcoded 100.x (endpoint resolution) |
Naming contract (Apple-simple)
Section titled “Naming contract (Apple-simple)”Jobs test: What do you call it when you talk to it? That string is the only name — roster key, ~/.sanctum/.node_id, and MagicDNS stem are the same.
| Kind | Pattern | Examples |
|---|---|---|
| Site brain (Mini) | {place} |
manoir, chalet |
| Mobile | {device} |
mbp |
| Site infra on TS | {place}-{role} |
manoir-fw, manoir-ha, chalet-fw |
| Agent | Jedi seat | yoda, ahsoka — never a TS host |
# Live contract — one name, no dual identitymbp: type: mobile tailscale_name: mbpLegacy stems (berts-mbp, manoir-firewalla, …) may still appear in hive-names.yaml as recovery matches so a device that reappears under an old control-plane Name can be re-converged. They are not live aliases and must not be what you put in scripts.
Converging MagicDNS — apply-hive-names
Section titled “Converging MagicDNS — apply-hive-names”Control-plane renames (the MagicDNS Name, not only the device HostName) go through the Tailscale API. The durable path is the toolkit, live via symlink:
# Live path == repo (Durability Doctrine)# ~/.sanctum/tailnet → openclaw-skills/tailnet-toolkit~/.sanctum/tailnet/tools/apply-hive-names.sh status~/.sanctum/tailnet/tools/apply-hive-names.sh plan~/.sanctum/tailnet/tools/apply-hive-names.sh apply --sync-roster| Piece | Role |
|---|---|
hive-names.yaml |
Declarative want-names + match / reject / recovery exact-map |
apply-hive-names.sh |
Plan / apply / status; stem comparison (FQDN → first label) |
ha-check.sh |
manoir-ha peer + HTTP + optional LAN probe |
seed-oauth.sh |
One-time OAuth client → SOPS (+ keychain cache) |
tools/lib/ts-auth.sh |
Shared mint; never logs secrets |
Declarative SoT for names: hive-names.yaml.
Declarative SoT for API credentials: Mini SOPS store ~/.sanctum/keychain-secrets.enc.json keys tailscale-oauth-client-id / tailscale-oauth-secret. Keychain entries with the same service names are a cache for GUI sessions; headless tools prefer SOPS (ts-auth resolution order).
OAuth client scopes: ACL write + Devices › Core write (plus tags if you tag devices). Mint check:
source ~/.sanctum/tailnet/tools/lib/ts-auth.sh && ts_auth_check# expect: auth=ok devices=200Unit smoke (no network): python3 ~/.sanctum/tailnet/tools/test-hive-names-match.py.
Roster — instance.yaml nodes
Section titled “Roster — instance.yaml nodes”topology: design: isomorphic-enclave hive: name-only
nodes: manoir: type: hub tier: primary # primary | peer | edge site: manoir ssh_user: neo tailscale_name: manoir capabilities: - vault_authority - inference - ha_site
chalet: type: satellite tier: edge site: chalet ssh_user: neo tailscale_name: chalet sync: hub: manoir capabilities: - local_inference - satellite
mbp: type: mobile tier: edge tailscale_name: mbp| Field | Meaning |
|---|---|
type |
hub · satellite · mobile · sensor |
tier |
primary (config SoT) · peer (multi-hub) · edge |
site |
Design-map / identity-pins site id |
tailscale_name |
MagicDNS stem for sanctum node resolve |
capabilities |
Static offers for hive work placement |
CLI surface (hive roster + routing):
sanctum node list | get | whoami | resolve | validatesanctum node offers | can <capability> | route <capability> [--prefer local|fastest|primary|hub:NAME]sanctum node vault-host # primary hop for Memory Vault (name-only)sanctum node ensure-hub | declare-peer NAME | export-councilCouncil-router config/nodes.json stores hive names, not drift-prone 100.x. Delivery resolves at call time. Vault hop: memory-vault/scripts/vault-hive-hop.sh or sanctum node vault-host.
Capability routing
Section titled “Capability routing”| Capability | Typical offer |
|---|---|
vault_authority |
primary hub only |
inference / inference_heavy |
primary + peer hubs |
local_inference |
satellites + mobile |
ha_site |
hubs with HA Green |
train / mesh_seed / council |
hubs |
sanctum node route inference --prefer primarysanctum node route local_inference --prefer localThe hub opens every lane
Section titled “The hub opens every lane”A satellite is a dependent of the hub, never its peer, and since 2026-11-21 the tailnet enforces that. Four rules hold the line:
| Rule | How it holds |
|---|---|
tag:satellite reaches no tailnet node |
No policy rule has a satellite as its source, so a satellite cannot open a connection to a hub, an admin machine or another satellite. The policy’s tests assert deny for 14 ports across the three, and its SSH tests deny a satellite any login; Tailscale runs them on every save. Hubs and admin machines still reach satellites |
| The hub opens every lane | Every connection to a satellite starts on the hub. The rule for a lane: SSH the hub opens, a key for that one purpose, and on the satellite a forced command that pins what an unattended key may run. Whatever comes back is data the hub checks, never an instruction |
| Host keys are pinned | The hub keeps each satellite’s host key in ~/.sanctum/hive/known_hosts, written only when the hub’s existing trust and the fingerprint computed on the satellite agree |
| No council mail | Council Router refuses any message to or from a satellite, and its health check skips the node |
Two lanes follow that rule today, each with its own key:
| Lane | Hub key | Forced command on the satellite | What crosses |
|---|---|---|---|
| Screen | ~/.ssh/screen-lane/<site>_ed25519 |
/usr/local/libexec/sanctum/screen-gate, as _sanctumgate |
One request line out; one JSON line back, checked against a pinned schema and rendered as a fixed sentence. Gate 1.1 (2026-11-22) adds three verbs that only read: devices (counts by class and category, never a name or an address), curfews (the satellite watchdog’s enforcement ledger) and house (its Home Assistant doctor’s verdict) |
| Fleet | ~/.ssh/fleet/<site>_ed25519 |
/usr/local/libexec/sanctum/fleet-receiver, as the operator |
Status: one JSON line back. Apply: the hub’s build out, a proved result back |
Fleet parity
Section titled “Fleet parity”A satellite runs the hub’s exact Force Flow build, byte for byte, and the hub keeps it that way. The build has four parts, each read off the hub’s own running deployment: the Rust front door sanctum-force-flow (its sha256 against its manifest and the running process), the screen-time engine commit (the live tree’s HEAD against /screen/status), the worker that hosts the engine, and its Python packages, under one digest over every file. Nothing syncs while the hub itself has drifted.
fleet_sync.py in sanctum-config scripts/fleet/ pushes that build over the fleet lane. The receiver checks every sha256, imports the new engine under the production interpreter in a scratch worktree, and copies usage.db aside. Then it switches and restarts through a one-command sudoers envelope. It keeps the new build only when the new process proves it: the right binary on the port, the right engine and digests, no target gone, no hold released, a fresh tick. Anything else, an exception or a kill signal included, restores the exact prior node.
haus.sanctum.fleet-parity runs fleet_sync.py heal on the hub every 15 minutes. Parity counts the engine running and ticking, not only the bytes. On drift it applies, never forced, so a curfew defers it. It pages through the hub’s own Force Flow:
| The sentinel pages on | And again |
|---|---|
| A rollback, or an apply whose outcome is unknown and whose satellite then looks wrong | — |
| Three refusals in a row | — |
| An answer that fails the hub’s checks | — |
| 30 minutes without reaching the satellite: Yoda is blind up there, though the curfews hold locally | When the satellite is back |
Three curfew deferrals in a row, about 45 minutes, while the engine answers but its loop has stopped ticking or its enforcement_ready flag is false, which today says only that it holds no Firewalla bridge token. Nothing is applied during a curfew, so the page is the remedy. In Force Flow’s quiet hours, 22:00 to 08:00, it is a silent push read in the morning, unless the site’s not_ready_night is wake, which pierces Do-Not-Disturb |
When it reports ready again |
A bridge, SDK or Firewalla failure behind an engine that still ticks and reports ready pages nothing yet: the fleet status does not carry the satellite watchdog’s verdict.
A switch cut off halfway, by a kill or a power cut, is put back first on the next run. A satellite’s own data (its registry, usage database and tokens) never moves. A satellite’s Force Flow pages no one: its launcher aims Home Assistant and Sonos at a closed loopback port.
One flow starts on the satellite, as a documented exception: after a reboot, a Vault-Armored satellite asks the hub’s witness to evaluate its share through the reverse tunnel the hub opened, and the hub can cut that tunnel at any time. The night the rule went live, with its proofs, is Thirteen Knocks From the Pine Outpost.
Satellites and the vault
Section titled “Satellites and the vault”The Memory Vault lives on the primary hub. The laptop’s vault wrappers SSH to it; a satellite’s cannot, because the tailnet policy gives tag:satellite no outbound to any tailnet node. That supersedes the diagnosis in Three Nodes, One Inbox, which blamed DNS and the peer path when vault.sh who failed on chalet. The wall was the policy. So the relay turns it around: the hub reaches the satellite, carries its vault traffic, treats everything the satellite sends as untrusted, and decides what it may write. The satellite never opens a connection to the hub.
Once deployed, the LaunchAgent haus.sanctum.vault-relay on manoir runs a pass every 60 s, with two fixed calls over the hub’s automation SSH lane. vault_relay.py export on the satellite returns the 20 oldest queued requests that are not backing off or waiting, as bounded JSON lines. The hub runs the writes it accepts through its own vault.sh, then vault_relay.py apply hands the satellite its new mirror and the finished requests. Passes never overlap, each request is recorded as soon as it is delivered, and an idle pass sends unchanged instead of the whole mirror.
The satellite asks. The hub applies its own rules:
| Request | What the hub allows |
|---|---|
send |
Only into inbox/claude-code, inbox/grok or inbox/agy, from a session identity (claude-, grok- or agy- and 8 hex digits) that no other node uses: no notes from it on the hub in 14 days, no board claim under it, no Claude session open on the hub. The note is recorded as chalet.<session> (for example chalet.claude-<sid>), and to: all as to: chalet.all, so it reaches that inbox’s agent sessions and no unattended agent |
| Provenance | The body opens with a heading that names the relay and the request id, # [relayed from chalet as request <id>; sender identity asserted by the satellite], and the line type: relayed, so the satellite sets neither the title nor the type that vault.sh list and search show |
| Content | A topic is at most 120 characters of plain text and never carries a session identity, in any spelling the vault would turn into one, because it becomes part of the note’s name. A body holds at most 8 KB and may contain newlines and tabs, but no other control characters, line or paragraph separators, bidi marks or invisible characters; the zero-width joiner and presentation selector that emoji need are kept |
| Volume | At most 100 sends per rolling 24 h; beyond that a send waits, in order. At most 40 of the satellite’s notes stay live: a send past that first retires the satellite’s oldest note into read/, where search still finds it, and the hub logs which. Nothing retires by age, so a handoff left on a Sunday is still there the next weekend |
inbox/relay-smoke |
Only the fixed smoke ping (--from relay-smoke --to nobody --topic ping, a short plain body), recorded as chalet.relay-smoke: a new ping replaces the live one, 48 a day (a ping beyond that waits), deleted after 10 minutes, outside the budget and the live count |
ack |
Only one exact note in those three inboxes, addressed to one of the satellite’s sessions (chalet.<session>) |
seen |
Stays on the satellite: its broadcasts are marked seen there (an ack of one is refused), so the satellite never marks a shared message seen for everyone. The hub’s seen marks reach it, so a broadcast the hub’s sessions of an agent have seen is not shown again to that agent there |
board |
Claims only under the satellite’s namespace, for identities no other node uses: at most 10 claims and 200 changes a day, notes of printable ASCII without runs of blanks, 8 hex digits in a row or session identities, cleared after 2 h |
| Retries | A request the hub’s rules refuse (anything outside the rows above, or a malformed request) is rejected on its first pass. A write that keeps failing for a temporary reason backs off, up to an hour between tries, and is never rejected for it; once any write goes through, the others try again on the next pass. Of vault.sh’s failures, only “no live message” for an ack counts toward rejection, after 5 attempts. A request still queued 7 days after it was written is rejected, waiting or not |
The mirror and relay mode
Section titled “The mirror and relay mode”The mirror carries notes addressed to the satellite’s sessions, its own sends, broadcasts from the last 14 days (at most 300 notes or 2 MB per inbox) and the hub’s seen marks for them, plus only the satellite’s own board claims and a count of the others. It does not carry who: on the satellite, who lists its own sessions. Freshness is measured on the satellite’s own clock, from received_at.
Relay mode needs ~/.sanctum/vault-relay/ENABLED on the satellite, and it never applies where the authoritative vault lives. With the file in place, grok-vault.sh, agy-vault.sh and the Claude UserPromptSubmit hook work through the relay: writes queue for the hub, reads come from the mirror, and full-vault search and read stay on the hub and the laptop. Without it, the hub’s export and apply calls refuse to run, and the pass fails with an error that names the file. Delivery takes about a minute. The wrappers and the hook warn when the mirror is older than 5 minutes. When the relay looks down, or the hub would hold a write, the queued write says it is not yet delivered. python3 ~/.sanctum/scripts/lib/vault_relay.py status shows mirror age, budget, live count, queue and recent results.
The relay also changes the vault’s own readers:
| Reader | In the relay as built |
|---|---|
| Dashboards on the hub and the laptop | The Claude hook’s Haus dashboard and the Grok and agy brief count only bare session identities, so a relayed note can never pose as a hub session’s announcement. Each line prints the exact note name to read |
| Claude hook on the hub and the laptop | Local notes and broadcasts come first, all of them, then at most 10 relayed notes (those addressed to a session there first, then the newest) and a count of the rest. This is the row that held the relay: in 1.0.1 the hook prints only a count line the hub writes |
| Grok and agy brief | Local notes come ahead of relayed ones, and the brief says when its vault check timed out |
| Claude hook and wrappers on the satellite | Sessions there see each other’s notes. The hook lists at most 30: notes to the calling session first, then the hub’s and the laptop’s, then the satellite’s own, leaving out the caller’s own sends, and it gives the session its address on the hub, chalet.claude-<sid>. check --mark marks seen on the satellite only |
~/.sanctum/scripts/vault-relay-smoke.sh # offline self-test; on a relay-enabled satellite also the live mirror, wrappers, hook, refusals, backlog~/.sanctum/scripts/vault-relay-smoke.sh --live # plus a ping into inbox/relay-smoke~/.sanctum/scripts/vault-relay-smoke.sh --hub # on manoir: the LaunchAgent, its last pass, no failure since, nothing stuck on a retry, vault.sh answering, the mirror taken, no send waiting past the budgetThe --live ping lands in inbox/relay-smoke, a folder no hook reads, so the smoke never shows up in an agent’s inbox.
Multi-hub (peer join)
Section titled “Multi-hub (peer join)”Exactly one primary hub (config SoT, vault authority, adopt authority). Additional peer hubs keep the same body map and join the hive by name — no renumbering, no LAN merge.
sanctum node declare-peer montreal --tailscale-name montreal --site montreal# On that Mac: echo montreal > ~/.sanctum/.node_id# Deploy identity-rebind on that site's Firewalla with a new site block- Same local design map + identity-rebind for that site’s Firewalla.
- Tailscale node online; MagicDNS name stable.
sanctum node declare-peer <name>(or hand-edit roster)..node_idmatches the roster key.- Sync policy: pull config from primary; never dual-write
instance.yamlsilently. - Offer metal via
capabilities— route with--prefer hub:<name>.
Fine-tune mental model (“Sanctum-space”)
Section titled “Fine-tune mental model (“Sanctum-space”)”A model fine-tuned for Sanctum may assume:
- Every site has the design roles above (when the gear exists).
- Local
.10is this site’s Mini; other brains are named hubs/satellites. - Cross-site actions use node names, never guessing which
10.0.0.0/24is which. - A satellite runs on its local metal; online, the hub may route work to primary or peer capacity. A satellite never calls out to the hub.
- Vault authority lives on the primary hub unless a capability says otherwise.
Site-specific facts (room names, people, Nuheat zones) belong in memory / RAG, not in weights that hardcode one haus’s LAN quirks.
Why not merge the mesh?
Section titled “Why not merge the mesh?”| Merge L3 | Hive (this design) |
|---|---|
| Must renumber at least one site | Clone site N without renumber |
| Subnet routers = critical path + blast radius | Failure stays in the enclave |
| Optimizes bare IPs | Optimizes names (the product) |
| Breaks “same mental model” if maps diverge | Same map → one curriculum |
Subnet routes remain a special feature for dumb IoT that cannot run Tailscale — never the default architecture.
EETISMAD smoke
Section titled “EETISMAD smoke”| Letter | Proof for this feature |
|---|---|
| E2E Tested | ts_auth_check; apply-hive-names plan is a no-op when perfect; ha-check.sh; match unit test |
| in Sanctum-docs | This page + sidebar |
| Merged | openclaw-skills tailnet-toolkit + SOPS store on Mini config repo |
| And Deployed | ~/.sanctum/tailnet symlink → toolkit; live MagicDNS stems |
| Lane | Named smoke | Deployed proof |
|---|---|---|
| Screen | Gate suite screen-time/satellite/tests/run_tests.py, broker suite tests/test_screen_lane.py, screen_lane.py selftest; live screen_lane.py call --site chalet health |
The hub’s expected gate and policy sha256 in sanctum-config; health says the gate matches what the hub installed |
| Fleet | scripts/fleet/tests/test_fleet.py; live fleet_sync.py status --site chalet |
The 15-minute sentinel reads parity, liveness and the receiver’s own sha256 |
| Boundary | Tailscale’s policy tests on every save; council-router/tests/test-satellite-closed.sh |
The live policy parses identical to tailnet-toolkit/acl.hujson |
If apply-hive-names plan invents renames forever, the stem comparison regressed (FQDN vs short name). If auth fails, re-seed OAuth into SOPS first, then keychain cache.
Related
Section titled “Related”- Node topology — hub / satellite / mobile roles
- Satellite runtime — every job on the chalet, its pin, its lanes and its kits
- Endpoint resolution — discovery, no hardcoded IPs
- Naming — place layer + retired ledger
- Engineering discipline — EETISMAD shipping bar
- Satellite setup — adopt flow
- Three Nodes, One Inbox — the vault kit on every node; its DNS diagnosis is superseded above
- Thirteen Knocks From the Pine Outpost — the night satellites lost every outbound path, and why the relay waits
- Home Assistant — Green at design
.3on the hub site