Architecture¶
One repo, one checkout, four artifacts: the felt CLI and shuttle CLI
(Go), the shuttle daemon (Elixir/OTP), and the board UI (TypeScript,
ui/). felt is a lean fiber library and notes CLI; shuttle is the orchestration
layer built on felt. The daemon is the production dispatcher.
Architecture stance¶
- Two Go CLIs, one-way dependency.
feltowns fiber storage and generic frontmatter.shuttleowns the network and orchestration, and reads and writes fibers through felt's Go library. felt has no dependency on shuttle or messaging packages; a test enforces that import boundary. - One repo, one checkout, four artifacts.
cmd/feltandcmd/shuttlebuild the two CLIs, while the same source tree builds the daemon release and board UI. Shuttle needs no separate browser application or dispatcher. - The
shuttle:block is opaque to felt. felt preserves it as ordinary frontmatter. shuttle owns the schema, validation, resolution, and lifecycle fields. The daemon reads and writes fiber content through felt and shells shuttle for Shuttle-owned behavior. Continuation state (session_uuid/dispatched_at/handed_off_at) lives in the block. - Resolved views belong to shuttle.
shuttle lsandshuttle showuse felt's fiber readers and add Shuttle's resolved facet; felt's JSON output contains the plain frontmatter without aresolvedsub-key.
The Elixir/OTP daemon is the production dispatcher. Dispatch, the
per-worker watcher, and the :4000 API are where OTP earns its keep. A Go
rewrite collapsing everything into a single binary is a deferred, must-earn-
itself idea.
Continuity across dispatches lives in frontmatter and git, not an event log.
The daemon detects clean worker exits via the shuttle.runtime.handed_off_at
frontmatter field. The editorial chain lives in the constitution body's
## Status block plus the git log of the fiber.
Pages¶
Beside the board, the UI bundle holds pages: small views, each at an
address of its own, meant to stand in a Rex pane beside a worker's chat or in
a browser tab. They are a second Vite entry, ui/pages.html →
ui/src/pages/main.ts, which the daemon serves at each page's one-segment
path, so the bundle's relative asset base holds:
/thread?f=<uid>@<host>shows one constitution as the board's view of it (FamilyPage): its head, its last post, its live sub-threads and its tapestry or sent files, unfolding in place. Its feed polls/api/v1/fibers/compositewithIf-None-Matchonly while the page is visible, and lists no tempered or discarded fiber but its own. Its head draws no lifecycle verbs./deskshows the host's Desk page in Rex whenpages.deskis enabled./mapshows the Fleet Map terrain view overGET /api/v1/map/terrainand opens threads throughPOST /api/v1/go. In Rex withpages.deskenabled,RexLayoutopens aFleet Maptab besideDeskon first creation and after a Rex restart, respects manual tab closure on subsequent reconciles, and reopens it onPOST /api/v1/go {"target": "map"}.
A page never touches the history API, voice, Rex focus or swipe handling. It
moves Rex with one verb, POST /api/v1/go, and
only when its address carries in=rex; without it, going to another fiber
opens that fiber's page in place. ui/test/pagesImports.test.ts fails if the
pages entry ever loads the workspace, the board shell, its history or voice.
Thread results¶
A child constitution publishes lifecycle results to its nearest ancestor constitution that is not archived (tempered or discarded).
Only the child's owning daemon publishes them.
Results reach only that nearest orchestrator; each orchestrator decides what to pass on, with no automatic upward propagation.
Every result is context in the orchestrator's inbox.
A close or ask wakes only the session that asked for the thread, recorded by shuttle thread in shuttle.thread_parent.asked_by as the asking session and the constitution it worked: when that constitution is the orchestrator, its worker is woken; otherwise the asking session gets a waking notice of its own, sent once through its session transport and retried only while the daemon cannot learn what that transport answered.
A thread with no recorded asker wakes no one, and shuttle close --quiet publishes context whoever asked.
A wake is weighed against its cost (Shuttle.WakeCost: a Claude conversation with a cold prompt cache and at least 250k tokens of context is costly). An ordinary shuttle message to a costly idle conversation is held as context (a session address's receipt says what a wake would cost); a waking thread result for a costly idle worker launches a fresh session, which takes the result from the inbox. shuttle message --wake and --fresh are the explicit choices.
A thread resting until a fiber (shuttle.blocked_on, set by shuttle rest --until) publishes unblocked as context when that fiber closes with any verdict; it never wakes and arms nothing.
The quiet marker names its exact close timestamp and an ordinary close clears it, so it cannot affect a later publication.
The first capture freezes the wake choice with the publication through retries and restarts.
Before the first poll, the daemon establishes a durable first-deployment timestamp, the capture baseline, in mailboxes/threads.json.
Signals stamped at or before that baseline stay in fiber history and are never backfilled.
The baseline survives restarts; a corrupt one holds boot rather than replaying historical results.
The sender captures each publication, with its intended parent's UID (felt's intrinsic frontmatter identity), text and message ID, into its host's routing inbox before attempting delivery.
That one inbox holds every publication the host has not yet placed; a placed result is an ordinary entry in its recipient's inbox, and no routed entry sits in a worker's inbox.
Each poll resolves the UID from fresh authoritative documents, past an archived parent and never by slug, and uses the recipient's current host.
The first resolution is frozen in the entry: moving the child does not change a pending publication's recipient, and a missing parent leaves it pending.
A result for a fiber this host owns is placed in that fiber's inbox; one for another host's fiber is forwarded to its owner's /api/v1/deliver by UID, and settles only when the owner confirms a durable enqueue.
A lost confirmation repeats the same enqueue, which stores nothing new.
On the owner, the result stays pending until a worker takes it or currency checking drops it as superseded.
Settled routing entries keep their ids for 14 days, so a re-capture stores nothing; they settle after their signal is stamped, and the inbox refuses a stamp older than 14 days, so a signal cannot publish again after they expire.
Boot establishes the capture baseline once; a corrupt capture state holds boot without discarding anything.
See The inbox for routing and the baseline, and its rollback notes.
The parent Poller publishes one durable receiver identity and epoch synchronously with worker registration, recovery, removal and conversation rotation. A CLI claim binds its supplied conversation UUID in worker metadata before registration publishes authority, never borrowing the predecessor's runtime UUID. Recovery restores the durable receiver for the same live execution before consulting frontmatter: a known conversation and an explicitly unknown identity both survive failed runtime-mirror writes. The execution retains its committed receiver harness in worker metadata and restores it from that record on adoption, independently of the current agent registry. A missing registry entry remains visibly unresolved in the fiber and live-worker view; it neither blocks startup nor changes the receiver identity, address, or epoch. A claim whose frontmatter write fails retains its committed receiver, exposes the mirror error, and retries the identity mirror during polling. Mirror repair does not rotate the receiver epoch or append a duplicate session-resume event. Boot recovery completes only after both the session scan and document listings are healthy; an uncertain boot defers authority reconciliation to a healthy poll. Recovery adopts live workers before revoking untracked receivers. An unchanged worker keeps its epoch across flushes and daemon restarts. Publishing a worker transition revokes the predecessor before the Poller reports completion, even before a successor's delivery task runs. Hooks check the current receiver under the mailbox emission lock; asynchronous delivery carries its epoch and cannot change authority. A failed authority write aborts the transition instead of reporting success.
Stores and views¶
Fiber documents synchronize through ordinary Git. Workers use felt sync
before substantive work and publish committed changes with
felt sync --push. The syncing agent first commits the store's dirty fiber
changes, whoever wrote them, including daemon lifecycle writes. Mixed commits
are fine. A worker resolves relevant conflicts with the work's
context. Role charters at roles/<role>, or <mount>/roles/<role> in a repository
linked in at the store's top level (the rule),
have intrinsic IDs and no host owner. A task's top-level role names its office (the first segment, whose charter it is) and the person responsible; shuttle.seat
marks whether the constitution is a seat of that office.
Synchronizing a constitution does not change its shuttle.host dispatch gate.
Armed cross-host creation writes through the owner daemon; dispatch never depends on archive synchronization.
A remote shuttle resume or shuttle dispatch carries the caller's copy of the fiber, and the owner runs shuttle adopt on it before the verb.
The owner holds a constitution when its copy has a shuttle: block naming the owner; a held copy stands, because the caller's mirror may lag the owner's worker-written state, unless the caller passes --carry.
A copy with no block, or a block for another host, takes the caller's document, and an owner without the fiber has it created from the caller's copy.
The command output says so whenever the two copies differ.
The daemon never runs Git or felt sync, and a missing document returns not-found naming its host and identifier.
Remote-owned live state comes from the owner daemon. An unreachable-owner
fallback to an archive copy is explicitly marked stale.
Host-addressed board requests use the daemon's routing for that host's
current content, artifacts, and execution controls.
A store is a .felt/ directory and everything under it — one namespace,
one git repo. A view (or substore) is a project whose .felt is a symlink
into a subdirectory of a larger store: this repo's .felt points into
~/loom/.felt/pando/felt, where pando is itself a link to a shared
repository mounted in the loom. The loom is the store; the project is a lens on
it. A lens narrows what is listed, never what can be found or reached.
An id is resolved against the local store first, then — on a miss — against
the enclosing store, which resolves it by its own scope and suffix rules from
this view's position out there. A hit is reported as external and the command
runs where the fiber lives, appending (in <root>) so a cross-store write is
never silent. The one thing that never crosses is the basename rescue (the
"your path went stale but the slug is unique" guess): the external probe sits
above it, so felt never guesses at a fiber and then deletes or moves it.
The verb contract, in one line each:
felt lslists the view. Every flag filters this store's own listing. Fast, local, always — in a substore a filtered ls closes with a line namingfelt findand the store it would search.felt findsearches the store. Local hits first, the rest of the enclosing store under a separator naming it, each by its full id there, capped with an exact remainder count (--limit).-jmerges both halves into one array, each entry naming itsstore.- An id reaches anywhere.
show,edit,rm,nest,tree, and everyshuttleverb acts on the fiber the id names, in the store that holds it.
The shuttle: block¶
The shuttle: block is opaque frontmatter to felt. felt preserves it like
any other unknown field and does not validate or resolve it. The shuttle CLI
owns its typed facet and lifecycle writes; the Elixir daemon reads fiber content
with felt, then uses shuttle ls/shuttle show when it needs resolved
Shuttle data and shuttle for Shuttle-owned operations. shuttle contract
checks the CLI/daemon contract at boot, and a test keeps felt's import graph
free of shuttle and messaging packages.
Execution backends¶
The agent registry selects a harness, model and reasoning effort. Every worker
runs through the host's selected terminal backend. Shuttle assigns fibers,
observes worker lifecycle and records native conversation identity so an
existing session can be recovered after a daemon restart. Closing a terminal
viewer does not end its worker. shuttle attach <fiber> opens the existing
session when the terminal backend supports attachment.
Codex conversations run through the Codex CLI in the terminal, like Claude
Code and Pi. Dispatch, capture, messaging and resume use the terminal worker's
native identity. A shuttle.surface value is opaque data that does not
affect execution; config writes preserve it.
Trust boundaries¶
The daemon's control plane has no authentication: anything that reaches its listener can read and write every registered fiber, read transcripts, and launch or kill workers as the user running it. The stance this follows from is that the listener is the boundary, so the listener has to match the trust of the host it runs on rather than the daemon carrying its own authentication layer.
A host declares its trust class — single-user, shared-multi-user, or
exposed — in ~/.config/shuttle/host.json, set with shuttle host class
and read with shuttle host --json, which also reports the host id. The
daemon reads host.json with the same rules, but takes its host id from
shuttle at boot. The class is a declared fact the operator asserts, not
something the daemon infers from the host; shuttle doctor checks that the
assertion still holds against reality (logged-in users, the socket directory's
mode, every fleet-owned listening socket).
The class determines where the daemon binds. single-user listens on
tcp://127.0.0.1:4000 (SHUTTLE_PORT). shared-multi-user and exposed
listen on the Unix socket $SHUTTLE_DATA_DIR/sock/daemon.sock (default
~/.shuttle/sock/daemon.sock), inside a 0700
directory the daemon creates and verifies before binding — a directory found
with looser permissions is a refusal to bind, not a downgrade. host.json's
listen key or SHUTTLE_LISTEN overrides either default, and the CLI
resolves the same address to reach the daemon it is driving. A Unix socket
changes who can even open a connection: a caller has to traverse the
filesystem to the socket path, so only sshd running as the host's owner (an
SSH tunnel's far end) or the local CLI can reach it, which is a permission
check the kernel enforces rather than one the daemon has to implement. A host
whose only inbound is SSH tunnels can run entirely off the socket.
An unprivileged userspace tailscaled cannot target a Unix socket with
tailscale serve, and the macOS system tailscaled cannot reach a filesystem
socket at all. A shared host using either arrangement needs a loopback TCP
listener. An exposed host instead places a front proxy before the daemon; that
proxy dials the daemon's Unix socket.
On shared TCP listeners, PeerGatePlug runs before static assets or
request-body parsing and admits only a peer whose uid from /proc/net/tcp or
/proc/net/tcp6 matches the daemon's effective uid. An unresolved or foreign
uid receives a 403 response. The plug also refuses exposed TCP requests that
reach it, while daemon boot refuses to create an exposed TCP listener.
The gate identifies the last local process, not the original client. A relay
running as the daemon's owner can pass co-tenant traffic with that owner's uid;
examples include userspace Tailscale SOCKS/HTTP proxies, ssh -D/-L, socat,
and code-server or Jupyter /proxy/ routes. Operators must not run relays as
themselves. Root has no separate admission exception; it can already inspect
or control the daemon process.
The daemon refuses defaults.https_proxy on shared and exposed hosts because
the local Tailscale HTTP proxy is an unauthenticated loopback gateway to the
whole tailnet.
For https:// remotes, defaults.tailscale_socket asks the daemon to open a
private, owner-only Unix socket per remote and dial the remote through
tailscaled's LocalAPI. On shared/exposed hosts using the default Unix listener,
bridge sockets sit beside daemon.sock under the same 0700 directory guard.
The bridge verifies the remote TLS certificate and hostname before it relays
traffic; it never exposes a loopback proxy to co-tenants.
When the private socket is configured, HTTPS requests fail closed if their
bridge is missing or unavailable; they never fall back to direct or proxy
routing. The two transport defaults are mutually exclusive. Tailnet discovery
uses the same socket: it reads the status from the LocalAPI and dials each probe
through it with the same certificate and hostname checks.
Every connection gets peer facts in conn.assigns.peer: transport (unix or
tcp), TCP uid when /proc resolves it, whether forwarding headers are
present, and a tailscale_login header. The uid gate consumes those facts on
shared and exposed TCP listeners; single-user TCP and Unix connections bypass
that gate. Unix reachability is bounded by the socket directory's filesystem
permissions. The tailscale_login value is retained on TCP only after the uid
gate admits the peer, but the header remains an assertion rather than an
independent credential. A shared TCP listener refuses to boot when
/proc/net/tcp is unreadable; an exposed TCP listener is refused regardless
of /proc. Use the class's Unix socket or declare the host single-user when
loopback is private to its operator.
Four host-boundary traps hold across implementations and tests:
- Shared-hub umask
002:mkdirand temporary directories inherit0775, which fails the ancestor-permission guard unless explicit0700modes are applied. - Linux
/proc/net/tcpuid0beforeaccept()and on unowned rows:SYN_RECV,TIME_WAIT, and orphaned closing rows carryuid 0(andinode 0on orphans) rather than a live peer's uid;Shuttle.ProcNetTcpadmits only uid-bearing states with a nonzero inode. - Literal-path
lstatancestry checks:Shuttle.Host.private_socket_problem/3walks every component below the trusted root literally withlstatand refuses symlinks, rather than resolving symlinks first and validating the target path instead of the traversed ancestors. - macOS ACL
delete_child: POSIX mode bits can read0700while an extended ACL grantsdelete_childto another principal; inspect ACLs (ls -le) when auditing macOS directory boundaries.
The fleet¶
Every daemon finds the others itself. Shuttle.TailnetPeers reads the tailnet
status, keeps the peers owned by this node's own Tailscale user, probes each
online one at https://<magicdns-name>/api/v1/version, and names every
Shuttle daemon that answers by the host id it reports there. Fibers route by
shuttle.host, so a peer is named by its host id, never by its MagicDNS label.
A node shared in from another tailnet is never probed or trusted; a peer that
reports this daemon's own id, reports no id, or shares an id with another peer
is dropped. Phones and other nodes without a daemon drop out because they do
not answer. The round runs shortly after boot, off the boot path, and every
minute after that. A peer that answered once survives ten minutes of failed
probes, so a daemon restarting for a deploy goes stale on the board instead of
vanishing from it.
~/.config/shuttle/remotes.json holds the exceptions: hosts outside the
tailnet (reached through an ssh tunnel port), non-default URLs, ssh names for
the recovery cascade, and deploy metadata. Shuttle.Remotes.resolve/2 merges
the two sources. A configured entry wins over a discovered peer with the same
name or https authority, "enabled": false suppresses a discovered host, and
defaults.discover: false turns discovery off. The resolved fleet feeds the
registries, Shuttle.OriginRouter, messaging, and the dial bridges. A newly
discovered peer reaches them without a restart, because the discovery
generation is part of Shuttle.Remotes.config_token/0.
The Go CLI does not probe the tailnet. shuttle remotes list and every verb
that routes by host name read the local daemon's discovered peers from
/api/v1/version and merge them with the file through resolveRemotes, the Go
mirror of the Elixir resolver; daemon/test/fixtures/remotes/ and
daemon/test/fixtures/tailnet_peers/ hold the shared parity cases. shuttle
remotes list|add|rm|path manages the file, and list doubles as the validator
behind the board's settings sheet. Nothing about hosts is baked into a build.
When Tailscale is absent, stopped, or failing, the daemon retains verified peers for up to ten minutes after their last successful probe, then uses the file alone.
It records the reason, and shuttle doctor reports it.
The daemon shares one-second snapshots of small local documents: fleet config,
Rex bindings, worker migration aliases, and store/project path lists.
Shuttle.RuntimeDocuments serializes cache fills and writes per path;
daemon writers invalidate the snapshot before returning. External edits enter
within one second. Binding mutations read the current file under their write
lock. Kernel process evidence and socket authorization bypass these snapshots.
Expired runtime cache entries are reclaimed every minute.
Listen and recorder routing¶
Shuttle.Voice owns one Listen switch, its follow/pin target, and the spoken-time route journal.
Shuttle.Recorder controls one retained hark --voice launch, named hark-voice; desktop and phone are sources of that same recorder.
Follow, system transcription and relay thresholds live in voice.json.
Following targets the latest board or Rex view, while pinning keeps a target until follow is enabled again.
A pin selects its target and disables follow in one /voice request.
The recorder runs independently of the target worker's owner; delivery routes to that owner through /deliver.
There is no separate recording lifecycle attached to Capture or a scribe claim.
Shuttle.Voice.TranscriptRelay ingests Hark JSONL, assigns routes by spoken start, and appends every utterance to recorder-local day files under <Shuttle.data_dir()>/transcripts/.
Cold-dropped, unrouted and discarded words remain readable through /api/v1/voice/transcript?date&fiber&since.
A delivered batch is the speaker-labelled text alone; shuttle transcript --since HH:MM:SS reads around it.
Following drops cold batches unless they close with send; pinned batches start cold workers without a trigger.
Both use at-most-once automatic delivery attempts, with durable offsets, buffers, outboxes and per-destination FIFO ordering under voice-transcript-relays/.
No transcript mirror or worker claim is needed to route speech.
Shuttle.ServedFibers supplies the fiber documents that voice name resolution and spoken output share.
Shuttle.RecorderRouter selects a recorder independently of the worker origin.
Desktop requests default to the receiving daemon; source: "phone" prefers a reachable desktop-capable remote before starting, and an explicit recorder always wins.
Capability probes are bounded addressed /voice reads, so they cannot recurse into another selection round.
Every response names its recorder; later polling, control, transcript reads and phone audio carry that address.
Controls forward once without automatic retries or fallback after an uncertain response.
Phone audio stays phone audio even when a remote Mac records it.
The browser connects only to the hub's /voice/audio?recorder&launch WebSocket, relayed one hop to the recorder's endpoint.
Shuttle.PhoneAudioRelay and the phone socket modules retain the launch-bound transport; Shuttle.Recorder.phone_socket/1 resolves the local Hark socket.
The recorder runs hark --voice --phone and validates the launch before accepting audio.
Connections have bounded connection and send deadlines, propagate status and closure, and never replay audio after a disconnect.
Desktop voice starts with --system-audio when enabled and toggles live through Hark's system gate, independently of the system reference used for mic echo cancellation.
Platform story¶
Linux and macOS are both supported for single-host use. One host runs the
shuttle CLI, daemon, board, and workers on either OS. The keep-alive differs —
a launchd LaunchAgent on macOS, a systemd user unit on Linux (shuttle daemon
install picks the branch from uname -s) — and so does the log path, but the
CLI, daemon, and bundle are built from this repo.
Either platform can be the fleet's hub. shuttle tunnels install
writes the hub's autossh jobs as launchd LaunchAgents on macOS and systemd
--user units on Linux, picking the branch the way shuttle daemon install does.
A Linux host with no systemd user session (an HPC login node usually has none)
gets a refusal naming --write-only, not units nothing would start. Either way
the tunnel is installed on the hub, not on the remote. One asymmetry remains:
the daemon's recovery cascade bounces a stalled tunnel with launchctl
kickstart, so on a Linux hub a quiet remote skips the bounce and advances to
the cascade's ssh check.
Terminal backends and opening. Shuttle.Terminal launches through the host's configured backend (tmux by default, rex when selected) and retains tmux as an observation and stop backend on Rex hosts when available.
The worker name is Shuttle's identity; Rex's daemon-written session/window/block binding is authoritative.
A Rex session holds a constitution family, resolved from the topmost constitution ancestor at launch, and each worker or viewer has its own window.
Session labels name the family; tab labels and order present its fiber tree; block labels retain worker names for recovery.
Shuttle closes worker windows independently and destroys only empty daemon-created sessions.
Shuttle.Opener selects Rex or Kitty for the local display: Rex selects a local worker's session and window, and provides viewer windows for local or remote tmux sessions.
Remote Rex opening is not supported.
Remote Control and Hark use the selected terminal. On Rex, Shuttle.RetainedTerminal records immutable launch addresses, configuration metadata, exit receipts and output under the Shuttle data directory. A changed Rex server instance makes an old launch dead, even if Rex restored its block. Remote Control retries through its reconciler; an interrupted Hark capture remains failed with its transcript intact. Cluster daemon supervision loops retain tmux.
Windows is unsupported.
Codex terminal workers¶
Codex workers launch through the selected terminal backend. The daemon does
not manage a separate Codex App Server dependency. Codex CLI authentication,
configuration and model selection remain in the worker's normal environment.
Existing terminal conversations retain their session identity and resume
through their harness. App Server APIs used by felt setup codex are transient
hook-trust operations; they do not run Shuttle workers.