From add4b7bb052df7c33a4efe9a36458b120a27f89a Mon Sep 17 00:00:00 2001 From: Adil Date: Thu, 12 Nov 2026 20:46:14 +0500 Subject: [PATCH] docs: humds peer through the relay mesh, and hives grow under groves The docs still described a daemon that bound direct-only, a relay path nobody had crossed, a hint list without `iroh-relay:`, and hives grown in orchd namespaces. hum peers through the n0 relay mesh since 0.34.3 and runs on orchd 0.5, where --grove replaced --namespace, since 0.35.0. - ensemble/README.md: the NAT row, the T3 transport and the daemon line describe the relay and DNS lookup. The iroh example shows an `iroh-relay:` hint and says only `iroh:` is needed. The "relay path is unproven" gap is gone, with tests/iroh_relay.rs as the proof. - THRUM.md: the iroh transport is the relay mesh, not direct-only. - hum/README.md, hum-paths/README.md, man/hum.1: the hint lists carry `iroh-ip:` and `iroh-relay:`. - hives/README.md and the ollama-server, dwarfstar and apple-fm READMEs: hives grow in a grove, beside the `orch` orchd reads Orchfiles through. - man/hum.1: the installed binaries include orch and the rootstocks, pulled from orchd's release, pinned and checksum-verified. --- THRUM.md | 4 +++- ensemble/README.md | 23 ++++++++++++++--------- hives/README.md | 4 ++-- hives/apple-fm/README.md | 2 +- hives/dwarfstar/README.md | 2 +- hives/ollama-server/README.md | 2 +- hum-paths/README.md | 4 ++-- hum/README.md | 6 ++++-- man/hum.1 | 10 +++++++--- 9 files changed, 35 insertions(+), 22 deletions(-) diff --git a/THRUM.md b/THRUM.md index a189dd8d..7c1b414a 100644 --- a/THRUM.md +++ b/THRUM.md @@ -1198,7 +1198,9 @@ The stream runs on four carriers: you trust. - **TLS**, the same stream wrapped in TLS. - **iroh**, QUIC with Noise, ALPN `hum/0.5`, hole-punching through the - public relay mesh when bound relayed; the daemon binds direct-only. + public n0 relay mesh. A humd publishes its home relay under its node + id, so `iroh:` alone is enough to dial it; `iroh-ip:` + and `iroh-relay:` hints skip the lookup. Between humds the stream opens with an Ed25519 handshake: each humd sounds a `hello` signed by its key, carrying `humd_id`, `proto_version`, diff --git a/ensemble/README.md b/ensemble/README.md index 031b7015..2014a966 100644 --- a/ensemble/README.md +++ b/ensemble/README.md @@ -50,7 +50,7 @@ the *same* humd talk, they're already on `thrum`. When nestlers on | how does humd A reach humd B? | `Transport` trait + a `peers.json` of known addresses, or `kad_find(target)` for discovery among peers already known. | | how do messages flow? | `chi:"prompt"` / `chi:"unfurl"` / `chi:"wilt"` between humds via `route(tone)` (unicast) or `publish(topic, …)` (gossip). | | how do you trust a stranger? | Ed25519-signed `hello` handshake. `Hid` = hash(pubkey), so the signature proves identity. | -| who handles NAT, firewalls, dynamic IPs? | `IrohEndpoint::bind_relayed()`, which is QUIC + Noise + hole-punching via the public iroh relay mesh. The daemon binds direct-only; the relay path lives in the crate and needs a network that can reach the relay servers. | +| who handles NAT, firewalls, dynamic IPs? | `IrohTransport`, which is QUIC + Noise + hole-punching via the public n0 relay mesh. The daemon binds with `bind_with_key_on()`: each humd keeps a home relay and publishes it under its node id through n0's DNS, so a humd behind NAT is dialled by its `iroh:` hint alone. An `iroh-relay:` hint skips the lookup. | Nothing in ensemble knows about models, MCP, JSONL, plugins, or billing. Those live in `humd` and `hives`. This crate is purely @@ -62,14 +62,14 @@ billing. Those live in `humd` and `hives`. This crate is purely |---|---|---|---|---| | **T1** own-devices | implicit (you own all) | static `peers.json` | `InMemoryEndpoint` (tests) or `TcpEndpoint` (LAN) | laptop ↔ phone roam | | **T2** trusted-group | pre-shared (team, family) | static + fingerprint pinning | `TlsTcpEndpoint` with pinned-fingerprint verifier | co-pilot session, 2-3 operators | -| **T3** federation | signed handshake (cross-org) | static `peers.json` | `IrohEndpoint` (direct) or `TlsTcpEndpoint` | partner-with-partner agents | +| **T3** federation | signed handshake (cross-org) | static `peers.json` | `IrohEndpoint` or `TlsTcpEndpoint` | partner-with-partner agents | | **T4** open p2p | verify everything (strangers) | Kademlia DHT + ensemble gossip | `IrohEndpoint` + relay | autonomous agents finding each other on the open mesh | Daemon code is identical across all four tiers. The tier is *which* `Transport` impl you plug in. The transport column lists what the -crate implements; the daemon ships T1 and T3 over TCP and direct -iroh, and wires neither TLS nor the relay. See [not here -yet](#not-here-yet). +crate implements; the daemon ships T1 and T3 over TCP and over +iroh through the n0 relay mesh, and does not wire TLS. See [not +here yet](#not-here-yet). ## Quick tour @@ -136,12 +136,20 @@ let peer_id = Hid::random_humd(); let transport = IrohTransport::bind_relayed().await?; let addr = HumdAddr::new(peer_id) .with_hint("iroh:0fb1c87a4d5e4e3a9c1b2d3e4f5061728394a5b6c7d8e9f0a1b2c3d4e5f60718") - .with_hint("iroh-ip:203.0.113.4:18820"); + .with_hint("iroh-ip:203.0.113.4:18820") + .with_hint("iroh-relay:https://euc1-1.relay.n0.iroh-canary.iroh.link./"); let conn = transport.connect(&addr).await?; # Ok(()) # } ``` +Only the `iroh:` hint is needed. With it alone the dialer looks up +the peer's current home relay by its node id and meets it there, then +hole-punches to a direct path when the NATs allow it. `iroh-ip:` and +`iroh-relay:` are shortcuts that skip the lookup. `tests/iroh_relay.rs` +proves both ways across the live n0 mesh with no reachable IP; it is +`#[ignore]`d so CI never depends on n0. + ### Sending a tone to one peer ```rust,no_run @@ -250,9 +258,6 @@ These are written as if they work. They do not. `peers.json` and from the persisted routing store. There is no DNS seeding, no bootstrap node, no contact exchange, so `kad_find` can only find peers the node already knows. -- **The relay path is unproven.** `bind_relayed()` exists; the n0 - relay servers were unreachable from the network this was developed - on, and no traffic has crossed a relay. - **TLS is a library capability the daemon never uses.** `TlsTcpEndpoint` and its pinned-fingerprint verifier are here and tested; `humd` wires only TCP and iroh. diff --git a/hives/README.md b/hives/README.md index d2b020ed..21450723 100644 --- a/hives/README.md +++ b/hives/README.md @@ -56,7 +56,7 @@ A forager picks a contract that already exists in the wild and hides the rest of Put an `Orchfile` at the root of your hive's directory. That is what makes it a hive, and the directory's name is the hive's name, a plain name of letters, digits, `-`, `_` and `.` that does not start with `.`. hum recognises one unit in it, `hive-install`, and nothing else. `hum hive install` records the hive on the humd and then runs that unit's `RUN` with `sh -c` in the foreground, in the unit's `WORKDIR` or else your directory, with the unit's `ENV`, `HUM_SRC` set to your directory, `HUM_HIVE` to your hive's name, `HUM_HIVE_STATE` to your hive's state directory, and `hum` on its `PATH`; if the unit fails, the hive is not installed. An `ARG` your Orchfile declares takes its value from the environment of `hum hive install`, which the unit inherits. The copy hum records carries `HUM_SRC`, `HUM_HIVE` and `HUM_HIVE_STATE` as `ARG`s. A supervisor that reads your own Orchfile sees an `ARG` only as you pass it: the bundled `install` passes orchd every `ARG` the Orchfile declares that is set in its environment, which is how a unit there can say `${HUM_HIVE_STATE}`. -What the unit does is yours: build, fetch a model, start processes and keep them alive with whatever supervisor you like. The bundled hives that run a process use one small `install` script each, which runs the hive's `build` and then grows the hive's units under [orchd](https://github.com/adiled/orchd), in the namespace `hum-` with its state in `${HUM_HIVE_STATE}/orch`: the unit named after the hive, or every unit for a hive with several (dwarfstar, one per model; ollama-server, its forager and its nurse). The process enters its own bee when it starts. A unit's settings are empty `ARG`s passed on as its `ENV`, as in `bp7/Orchfile`, so `BP7_ROUTE=router.local:4556 hum hive bp7 install` sets one, and an empty one keeps the process's own default. vercel-ai, whose bee lives in the app that imports it, only builds. Every other unit in the Orchfile is only what your own tooling makes of it. +What the unit does is yours: build, fetch a model, start processes and keep them alive with whatever supervisor you like. The bundled hives that run a process use one small `install` script each, which runs the hive's `build` and then grows the hive's units under [orchd](https://github.com/adiled/orchd), in the grove `hum-` with its state in `${HUM_HIVE_STATE}/orch`: the unit named after the hive, or every unit for a hive with several (dwarfstar, one per model; ollama-server, its forager and its nurse). The process enters its own bee when it starts. A unit's settings are empty `ARG`s passed on as its `ENV`, as in `bp7/Orchfile`, so `BP7_ROUTE=router.local:4556 hum hive bp7 install` sets one, and an empty one keeps the process's own default. vercel-ai, whose bee lives in the app that imports it, only builds. Every other unit in the Orchfile is only what your own tooling makes of it. ``` ARG HUM_SRC= @@ -150,7 +150,7 @@ Whatever the shape, the humd a bee lands on must have its hive installed and the In the **ensemble**, a bee nestled on one humd is gossiped to others. A humd routes to a remote bee only when it has that bee's hive installed too, so it knows the kind it is handing work to; it need not have entered any bee of it. It hands a prompt to a peer's nurse only with `humd.trustRemoteNurses` in `hum.json` (or `HUM_TRUST_REMOTE_NURSES=1`), and a reach or a bloom's tools to a peer's attendant only with `humd.trustRemoteAttendants` (or `HUM_TRUST_REMOTE_ATTENDANTS=1`); both are off by default. A humd dials the peers in its `peers.json` (`hum ensemble peer add`), and one entry is enough to join an ensemble. The `source` URL stays purely informational. -As a **managed service** your hive keeps its processes alive itself. The bundled hives do it with orchd, which the hum installer puts at `~/.local/bin/orchd`, pinned, for any hive to use; nothing in hum calls it. +As a **managed service** your hive keeps its processes alive itself. The bundled hives do it with orchd, which the hum installer puts at `~/.local/bin/orchd`, pinned, beside the `orch` it reads Orchfiles through, for any hive to use; nothing in hum calls it. ``` hum hive --list # the catalogue, what is installed, bees entered under each diff --git a/hives/apple-fm/README.md b/hives/apple-fm/README.md index 0ac412b7..10b381f5 100644 --- a/hives/apple-fm/README.md +++ b/hives/apple-fm/README.md @@ -147,7 +147,7 @@ hum hive apple-fm install `install` builds the nurse (`cargo build --release --locked`) and the bridge beside it (`swiftc`, into `target/release/apple-fm-gen`), and keeps the Orchfile's `apple-fm` unit running under orchd, in the -`hum-apple-fm` namespace. A setting rides in the environment of the +`hum-apple-fm` grove. A setting rides in the environment of the install: ```bash diff --git a/hives/dwarfstar/README.md b/hives/dwarfstar/README.md index ad32a60c..1f2740cc 100644 --- a/hives/dwarfstar/README.md +++ b/hives/dwarfstar/README.md @@ -35,7 +35,7 @@ DWARFSTAR_DIR=~/ds4 hum hive ./hives/dwarfstar install ``` `install` builds the bee and grows every unit of the Orchfile under -orchd, in the `hum-dwarfstar` namespace. Each unit's bee enters itself +orchd, in the `hum-dwarfstar` grove. Each unit's bee enters itself under the hive, as the unit's name, when it starts. A unit whose model is not on this machine logs so and stays down. It builds on macOS, where ds4's Metal backend is what it links. diff --git a/hives/ollama-server/README.md b/hives/ollama-server/README.md index 4eae9060..4bca9147 100644 --- a/hives/ollama-server/README.md +++ b/hives/ollama-server/README.md @@ -258,7 +258,7 @@ hum hive ollama-server install `install` builds both binaries (`cargo build --release --locked`) and keeps both of the Orchfile's units running under orchd, `ollama-server` -and `ollama-nurse`, in the `hum-ollama-server` namespace. A setting +and `ollama-nurse`, in the `hum-ollama-server` grove. A setting rides in the environment of the install: ```bash diff --git a/hum-paths/README.md b/hum-paths/README.md index 337982fe..60e2e31a 100644 --- a/hum-paths/README.md +++ b/hum-paths/README.md @@ -72,8 +72,8 @@ small struct humd writes to `state_dir/runtime.json` when it boots and removes when it shuts down. Other tools (`hum status`, `hum ensemble`, dev scripts, third-party probes) read it to learn the running daemon's pid, socket path, version, and the wire-shaped reach -hints (`ensemble_addrs`: `iroh:`, `iroh-ip:`, `tcp:...`) -a peer would paste into its `peers.json`. +hints (`ensemble_addrs`: `iroh:`, `iroh-ip:`, +`iroh-relay:`, `tcp:...`) a peer would paste into its `peers.json`. ```rust let info = RuntimeInfo { diff --git a/hum/README.md b/hum/README.md index 431b8bba..2227c09b 100644 --- a/hum/README.md +++ b/hum/README.md @@ -80,8 +80,10 @@ Inspect or edit on-disk peer-mesh state. | `hum ensemble peer rm ` | drop matching entries | Hints are wire-shaped strings: `tcp:host:port`, `iroh:<64-hex>`, -`iroh-ip:`. The `reach` field of `hum ensemble` is exactly -what a remote peer pastes in. +`iroh-ip:`, `iroh-relay:`. An `iroh:` hint alone reaches +a humd anywhere, through the n0 relay mesh; `iroh-ip:` and +`iroh-relay:` are shortcuts to it. The `reach` field of `hum ensemble` +is exactly what a remote peer pastes in. ### `hive` Hives are the kinds this humd understands. A directory with an diff --git a/man/hum.1 b/man/hum.1 index f6241529..64b3f811 100644 --- a/man/hum.1 +++ b/man/hum.1 @@ -127,7 +127,8 @@ Inspect or edit the peer-mesh state. .B hum ensemble peer add \fIhumd_id\fR [\-\-hint \fIHINT\fR]... [\-\-alias \fIname\fR] \(em append a peer to peers.json. \fIhumd_id\fR is hex (with or without the \fBhumd_\fR prefix). Repeated \fB\-\-hint\fR flags accumulate; hints are -\fBtcp:host:port\fR or \fBiroh:<64-hex>\fR. An existing entry with the same +\fBtcp:host:port\fR, \fBiroh:<64-hex>\fR, \fBiroh-ip:\fR or +\fBiroh-relay:\fR. An existing entry with the same humd_id is replaced (idempotent). Alias enables \fBhum:///path\fR URI resolution. .br @@ -212,7 +213,9 @@ them. Source checkout the installer builds from. .TP .B ~/.local/bin/ -Installed binaries: \fBhum\fR, \fBhumd\fR, \fBhumctl\fR, \fBorchd\fR. +Installed binaries: \fBhum\fR, \fBhumd\fR, \fBhumctl\fR, \fBorchd\fR, +with \fBorch\fR, which orchd reads Orchfiles through, and orchd's +\fBorchd-rootstock-*\fR plugins. hum never calls \fBorchd\fR; it is installed as a supervisor hives may use for their own processes, as the bundled hives do. .SH ENVIRONMENT @@ -280,7 +283,8 @@ curl -fsSL https://raw.githubusercontent.com/adiled/hum/main/install | bash .PP The installer builds and registers \fBhumd\fR as a user service (launchd on macOS, systemd-style on Linux), mints the identity key, pulls in the -\fBorchd\fR supervisor binary for hives to use, and installs this page into +\fBorchd\fR supervisor and \fBorch\fR from orchd's release, pinned and +checksum-verified, for hives to use, and installs this page into \fB/usr/local/share/man/man1\fR or \fB~/.local/share/man/man1\fR. Re-running it upgrades in place.