tractor/ai/tpt-backends
Gud Boi c7ae606504 Clarify the `wg`-over-TIPC motivation, harden caveats
Follow-on to 4aa7a890 now that the encryption premise is
corrected: reframe *why* we want a `wg` mesh under TIPC (#502)
rather than leaving a "wg adds the crypto TIPC lacks" reading
lying around, since that reading is flat wrong.

The motivation is different but still real,
- TIPC's keys are **symmetric + pre-shared**, so distribution,
  rotation and revocation are all on the operator; `wg` brings
  public-key identity and a handshake.
- `wg` is an overlay *every* tpt can sit on (tcp now, quic
  later), not a TIPC-only mechanism.
- NAT traversal / roaming, which raw TIPC bearers have no story
  for at all.

Which to actually default to wants **benchmarking** — native
crypto skips a tunnel hop and may win for LAN-local clusters.

Also lean much harder on the udp-bearer-only caveat in the
handoff doc; it's the one that bites. A wg iface is L3/`tun` w/
no L2 addr, so there's no device for `media eth` to name — which
means #378's "ethernet bearers pair most excellently w/ wg
tunnelling" framing does NOT hold: on a given link the L2 path
and the wg path are mutually exclusive. Any design assuming both
is broken from the start.

(this patch was generated in some part by `claude-code` using `claude-opus-5` (`anthropic`))
2026-08-17 17:44:58 -04:00
..
00_shared_backend_contract.md Proto-key the unwrapped-addr form in the plans 2026-08-12 20:08:15 -04:00
01_tipc_HANDOFF.md Clarify the `wg`-over-TIPC motivation, harden caveats 2026-08-17 17:44:58 -04:00
01_tipc_backend.md Reconcile plan 01 w/ the live-kernel findings 2026-08-14 22:13:52 -04:00
02_quic_iroh_backend.md Add `QUIC`-via-`iroh` tpt-backend plan 2026-08-12 20:08:15 -04:00
03_wg_tunnel_bindspace.md Update `wg` docs for the merged py-multiaddr#108 2026-08-14 09:51:36 -04:00
README.md Document TIPC-over-`wg`, add a handoff doc 2026-08-17 17:38:05 -04:00

README.md

next-gen tractor.ipc transport backend plans

Implementation specs for three prospective .ipc transport backends, written so each can be worked independently (by a different model/provider) without design or lib-selection drift.

Read 00_shared_backend_contract.md first — it is the normative description of what a tractor transport backend is as of main@83b34884 (the backend duck-type, the 10-item registration checklist, the test-harness plumbing, the code-style rules). The three plans assume it and document only their own deltas.

plan issue dep size lands
01 — TIPC #378 none (stdlib) small landed, PR #493 — see the handoff
02 — QUIC/iroh #353 iroh (uniffi FFI) large needs a prep PR
03 — wg bindspace #482, #443 pyroute2 medium, 3 layers layer A now

Headline conclusions:

  • TIPC is the cheap win. Verified: trio.SocketStream and trio.SocketListener are address-family agnostic (only SOCK_STREAM + a trio socket), and CPython ships AF_TIPC + 23 TIPC_* constants. So the backend is ~one module of contract boilerplate, zero new deps, and it buys kernel-native service discovery: bind() publishes, connect()-by-name resolves — no registrar in the loop. (modprobe tipc is required; hard-gate everything.)
  • QUICs cost is entirely in two adapters, not in QUIC. The iroh python bindings are uniffi-generated asyncio, but the asyncio dependency is confined to one future-poll callback — a ~40-line trio bridge (TrioToken.run_sync_soon) replaces it. The second cost is that an iroh listener isnt a socket, which needs a small, independently-reviewable prep PR to _server.py/_types.py.
  • WireGuard is not a transport. Its an iface-layer tunnel, so it belongs as a nested bindspace (TunnelledAddress + open_bindspace() @acms) wrapping whatever L4 tpt is in use — which is also what finally implements the long-specd Address.namespace, and what generalizes to veth/vxlan/gre.

Ordering rationale: plan 01 first as the cheap proof the table-registration story generalizes to a genuinely new proto; plan 03 layer A is already deployable-today doc/example work; plan 02 last (and gated on its prep PR). Plans 01 and 02 both want the same Address.rebind_from_sockname gate — whichever lands first ships it.