TA-live: real A→B federation over HTTP + a durable outbox (LIVE-VERIFIED)
Step 3 — federation, live-verified with TWO real host instances. - host/ta.sx: host/ta--post/make-http-wire/federate (POST a serialized activity to a peer's /inbox over real HTTP). host/blog.sx: POST /inbox (host/blog-inbox → receive! → process locally, does NOT re-federate — no loops). - DURABLE OUTBOX (fed-sx reliability, after the user asked 'if B is down does it still work?'): emit! processes locally (always succeeds), QUEUES per-peer to a persisted outbox, delivers best-effort. A peer being DOWN no longer fails the publish — delivery is GUARDED (SX guard catches the http-request connection error), failed items stay queued and retry on next emit / on boot / manual /flows?flush=1. /flows shows the outbox depth. - serve.sh: SX_PEERS → peers; boot load+flush of the outbox. docker-compose: a 2nd host sx_host_b (peer B, own store, no peers). LIVE PROOF: (1) a peer POSTs create/article to blog.rose-ash.com/inbox → A fires validate+notify. (2) publish on A → federates to B → B fires ITS behaviors on A's activity (B's /flows + /activities). (3) RESILIENCE: publish with B DOWN → A returns 303 (was 500) + queues; start B + flush → B receives the backlog + fires. blog 218/218 (+TA receive test), full host conformance green. A = blog.rose-ash.com (public/Caddy); B = sx_host_b (internal docker DNS only, no public domain). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -220,6 +220,24 @@ EPOCH=1
|
||||
echo "(epoch $EPOCH)"
|
||||
echo "(eval \"(host/blog-load-pendinglog!)\")"
|
||||
EPOCH=$((EPOCH+1))
|
||||
# TA-live: federate emitted activities to peer /inbox endpoints (comma-separated SX_PEERS, e.g.
|
||||
# "http://sx_host_b:8000"). Empty by default (no federation). A peer that receives does NOT
|
||||
# re-federate, so an acyclic peer graph doesn't loop.
|
||||
PEERS_SX="(list"
|
||||
IFS=',' read -ra _PEER_ARR <<< "${SX_PEERS:-}"
|
||||
for _p in "${_PEER_ARR[@]:-}"; do [ -n "$_p" ] && PEERS_SX="$PEERS_SX \\\"$_p\\\""; done
|
||||
PEERS_SX="$PEERS_SX)"
|
||||
echo "(epoch $EPOCH)"
|
||||
echo "(eval \"(host/blog--set-peers! $PEERS_SX)\")"
|
||||
EPOCH=$((EPOCH+1))
|
||||
# TA-live: rebuild the durable outbox + RETRY any deliveries that were pending from before a
|
||||
# restart (a peer that was down gets its backlog once it + we are back up).
|
||||
echo "(epoch $EPOCH)"
|
||||
echo "(eval \"(host/blog-load-outbox!)\")"
|
||||
EPOCH=$((EPOCH+1))
|
||||
echo "(epoch $EPOCH)"
|
||||
echo "(eval \"(host/blog--flush-outbox!)\")"
|
||||
EPOCH=$((EPOCH+1))
|
||||
# Seed a live demo of the composition fold (plans/composition-objects.md): /compose-demo
|
||||
# is one composition object rendered by host/comp-render — renders differently by context.
|
||||
echo "(epoch $EPOCH)"
|
||||
|
||||
Reference in New Issue
Block a user