Standalone host-pool resource SSOT β owns the .resource DSL format,
the parser, the roster CRUD CLI, the lint/audit/selftest plumbing, and
(in progress) the hexa:// URL scheme infrastructure.
.resource is the registry of reachable targets; hexa:// is the URL
transport that invokes against that registry. Both live here so the
two evolve together.
In addition to the registry layer, this repo ships:
tool/resource_init.shβ one-shot bootstrap for a fresh Mac + ubu pool (binary wrappers, rsx deploy, ML stack, self-hosted WireGuard mesh).bin/{hexa-r,claude-r,py-r,rr,hxr,hexa-tcp,py-tcp}β offload wrappers for routing local invocations to a resource host.
hx install resource(Short form resolves via the default probe orgs β dancinlab is in
hx orgs. Use hx install dancinlab/resource if your HX_ORGS is
overridden to exclude it.)
~/core/resource/tool/resource_init.sh ubu-1 ubu-2Idempotent. Re-running is safe (skips anything already in place). What it sets up automatically:
| Layer | Mac side | Per ubu |
|---|---|---|
| zsh / ssh ControlMaster | sources bin/aliases.zsh, ensures ~/.ssh/cm |
β |
| binary wrappers | python3 / hexa / hexa_interp* / claude versions |
β |
| offload symlinks | hxr / rr / claude-r / hexa-r / py-r β ~/.local/bin |
β |
| rsx (cross-built ELF) | cross-compile via hexa build |
scp β ~/.local/bin/rsx, verify |
| ML stack | β | uv (astral), torch nightly cu128, tool/host_deps.txt |
| WireGuard provisioning | brew install wireguard-tools, keypair, write wg-{ubu1,ubu2}.conf + -fb.conf |
apt install wireguard, keypair, /etc/wireguard/wg0.conf, wg-quick@wg0 |
| DuckDNS pusher | β | (designated host only) /etc/cron.d/duckdns 5-min IP push, token from secret CLI |
WG operational lifecycle (up/down/health, audit emit, policy gate) belongs to
dancinlab/ghostmk2.cond.1 βghost wg-self up ubu1etc. resource-init only handles provisioning: install + keygen + conf write + systemd enable. The Tailscale-rejection rationale lives inghost cpre/scope.ai.md("Operator infra coordination must not create fixed metadata leak").
- Router port-forward (admin page β NAT β port-forwarding):
- UDP
51234β ubu-1 LAN IP UDP51820 - UDP
52345β ubu-2 LAN IP UDP51820
- UDP
- DuckDNS (optional fallback when home IP rotates):
- sign up at https://www.duckdns.org, add a subdomain, copy token
secret set duckdns.subdomainthensecret set duckdns.token
- SSH config (
~/.ssh/config) βresource-initprints a Match-exec stanza you append manually (user-sensitive file, never auto-edited):With this,Match host ubu-1 exec "ping -c1 -W1 192.168.50.119 >/dev/null 2>&1" HostName 192.168.50.119 Host ubu-1 HostName 10.142.0.1 User aidenssh ubu-1uses LAN IP at home, falls through to WG IP from outside β no alias change needed.
Skip the entire WG block: RESOURCE_INIT_SKIP_WG=1 resource-init β¦.
Skip the ML provision block: RESOURCE_INIT_SKIP_PROVISION=1 resource-init β¦.
The topology table (WG_PEERS) at the top of tool/resource_init.sh
is the single edit point for IP / external port mapping.
resource list # show host pool (reachable + load + mem + nexus)
resource status [host] # detailed health (ssh + nexus + claude + slots)
resource add <host> # probe + bootstrap disclosure
resource remove <host> # unregister
resource fix <host> # nexus shim auto-repair + claude bin probe
resource oauth-status <host> # per-slot OAuth health
resource oauth-reset <host> # slot-pool reset disclosure
resource sync <host> --tool <path> # rsync local Mac canonical β host
resource patch <host> --tool <path> --content-b64 <b64> # ssh + base64 heredoc
resource exec <host> --command "<cmd>" --c3 "<rationale>" # cross-host exec
resource bootstrap <host> # zero-touch bootstrap (delegates to RM4)
resource log [tail-n] # tail audit ledger
resource --selftest # canonical-form sanity (no host I/O)
Universal kind registry (operates on $HIVE/spec/sync_registry.spec.yaml):
resource list <kind> # dump rows for a kind
resource list kinds # enumerate registered kinds
resource add <kind> <name> [k=v ...] # register a row
resource remove <kind> <name> # delete a row
resource verify [<kind>] # child-exec each handler with --verify
resource apply [<kind>] # child-exec each handler with --apply
Routes a local invocation to a resource host over ssh (or TCP for
specific paths). All wrappers honor a global kill switch
(touch ~/.resource-off) and a per-invocation bypass env var.
| Wrapper | Routes | Bypass env |
|---|---|---|
hexa-r <host> <subcmd> [args] |
hexa run/parse/test/... to <host> (TCP for local *.hexa, ssh otherwise) |
RESOURCE_LOCAL_HEXA=1 |
py-r <host> <args> |
python3 invocation to <host> |
RESOURCE_LOCAL_PY=1 |
claude-r <host> [args] |
full Claude TUI session over ssh -t |
RESOURCE_LOCAL_CLAUDE=1 |
rr <host> <command...> |
generic ssh exec | (no bypass β explicit by definition) |
hxr <args> |
wildcard pass-through to hxr-r family |
β |
hexa-tcp <script.hexa> [args] |
submit local .hexa to TCP compute server (tcp/server.py) |
β |
py-tcp <script.py> [args] |
submit local .py to TCP compute server |
β |
After resource-init mac-side runs, all wrappers are symlinked into
~/.local/bin (PATH-visible). The binary wrappers (e.g. python3,
hexa run) intercept invocations by all callers (agent Bash, scripts,
launchd) β not just shell aliases β and route them via the wrappers
above by default.
# server (run on a worker host)
python3 tcp/server.py --bind 127.0.0.1 --port 5555 --worker tcp.workers:echo_worker
# tunnel (Mac side)
./tcp/ssh_tunnel.sh ubu-1 5555
# clients
python3 tcp/client.py ping
./bin/py-tcp path/to/script.py
./bin/hexa-tcp path/to/script.hexaSee doc/compute-pull-tcp.md and
tcp/README.md.
After install, edit ~/.hx/packages/resource/.resource to declare your
host inventory. Replace the example blocks with actual SSH aliases,
remote homes, capabilities, and scoring weights. Keep the resource
state deferred until the entry is ready to participate in pool
routing, then flip to live.
The shim self-locates the package root via $0 (POSIX-portable symlink
walk), so it works for any user installing via hx install
regardless of $HOME path layout.
Resolution priority:
$RESOURCE_ROOTenv var (explicit override)- self-located via
$0β resolves to~/.hx/packages/resourceon hx install
This repo owns .resource format + parser + CLI + scorer/LB libraries +
(in progress) hexa:// URL scheme. Hive (~/core/hive) keeps the
runtime decisions on top: nexus-kick orchestration, zero-touch
bootstrap chain, TS bridge, hexa://sync/* and hexa://gate/* verb
bodies. See doc/boundary.md for the full contract.
hexainterpreter (~/.hx/bin/hexa) β install viahx install hexa.wireguard-tools(Mac: brew, ubu: apt) β auto-installed byresource-init.secretCLI (~/core/secret/bin/secret) β used for DuckDNS token storage (token never lands on argv or shell history).- ghost: optional, but recommended for audit + policy gate. See
ghostmk2.cond.1.
MIT.