1 Architecture
Dai Ha edited this page 2026-08-31 10:29:05 +07:00
Clone

Wiki Page Revisions

13 Commits

Author SHA1 Message Date
Dai Ha 06cceeee7c #168: rebuild chapters 1, 2, 7, 8 and 9 against the source
The audit marked all five REBUILD. Every factual claim on them is now checked in
the code and carries a file:line reference.

What was wrong and is now fixed:

- Ch.1 named a `fleet_read` tool and an SSE `GET /events` route. Neither exists.
  It also named Redis Streams and NATS JetStream as the queue; the shipped inbox
  is AMQP. The subscription boundary is back as its own section, sourced from
  SubscriptionGuard, and the REST list now matches FleetApp.build().
- Ch.2 described tool parameters that were never shipped. The tool table now
  comes from each tool's own schema method.
- Ch.7 was built on `ccs` profiles and on send parameters that do not exist.
  Every flow now uses the real tools. The portable CLAUDE.md block is unchanged,
  byte for byte, and the sync check still passes.
- Ch.8 presented old plans as the current stack. It is now a delivery record in
  four states, and "built, not switched on" means no host enables it today —
  AMQP and the coordinator mailbox are both on here, so both moved to live.
- Ch.9 had drifted from the source in its package, class and endpoint map.

Also: chapters 1, 2 and 8 had "I checked this in the code" written on the page
itself. That belongs in a worker's report, not in a reference page. The pages now
state the fact and cite the line.

Every Mermaid diagram was rendered with mmdc before this commit.
2026-08-31 10:29:05 +07:00
Dai Ha 3357960dd1 CB-634: rename bridged -> fleetd across the wiki
Match the code cutover: daemon name, config (fleetd.yaml), scripts, launchd/
systemd units, module dir, and MCP tool prefix bridge_* -> fleet_*. Kept:
the BRIDGED_MEMBER security marker, mcp__bridge__ (historical mount name), and
the .bridged-worktrees on-disk path. The portable CLAUDE.md block stays
byte-identical with the repo's CLAUDE.md.
2026-08-25 04:08:38 +02:00
Dai Ha 4d1548a3d8 wiki: CB-307 complete — Stage 2 durable inbox + Stage 3 active push loop (as-built)
Fold the now-shipped CB-307 into the as-built docs (was stale at Stage 1 only):
- Roadmap: Stage 2 (AmqpReplyInbox/LavinMQ, 2bc5f3a) and Stage 3 (ReplyPushLoop
  active push-to-primary, d4c9704, gitea #5 closed) marked shipped; diagram gains
  a Stage 3 node; all stages green.
- Implementation: msg core 4->6 classes (AmqpReplyInbox consume-and-hold, ReplyPushLoop
  status-gated loop); mcp 6->7 (PrimaryRegistry); bridge_ack tool; stranded-reply
  narrative extended with durable landing + active nudge + pull degradation.
- Architecture: late-replies note now covers durable + active push; split-host hook
  note clarifies a same-host primary IS injected into (Stage-3 nudge).

Push channel resolved: the same-host primary is a herdr pane, so the loop injects a
bounded, status-gated drain nudge into its own pane; off-host degrades to pull.
Mermaid roadmap diagram re-validated (renders clean).
2026-07-19 18:07:18 +02:00
Dai Ha bcf15a85c9 wiki: CB-307 reply-inbox (as-built) + CB-308 multi-host federation
- 9-Implementation: msg package 2->4 classes (ReplyInbox port + InMemoryReplyInbox),
  reply now HELD not dropped when no send is open; drain via bridge_poll(target) +
  GET /sessions/{id}/replies; forward-rendezvous stranded-reply note.
- 8-Roadmap: new 'Delivery reliability & multi-host' section (CB-306 shipped,
  CB-307 Stage 1 shipped / Stage 2 deferred, CB-308 designed) + staging diagram.
- 1-Architecture: multi-host federation topology (CB-308) + diagram; late-reply
  durability note (CB-307) in Mode 1.
2026-07-19 07:08:02 +02:00
Dai Ha 0a0f7d53d6 wiki: CB-401 Stage A — PeerLauncher SPI + ClaudeCodeLauncher rename
- 9-Implementation: new peer package section (PeerLauncher/PeerHandle/
  SpawnRequest/Capability); WorkerService->ClaudeCodeLauncher in component
  map, edge table, bootstrap wiring; nine->ten packages; refs main 3aa69a9.
  Capability noted as declare-only (verb-layer enforcement deferred).
- 1-Architecture: worker row notes swappable PeerLauncher adapter; core
  bus is peer-neutral.
- 8-Roadmap: Stage 4 relabeled 'Pluggable peers'; CB-401 Stage A complete
  (183 tests, main 3aa69a9); CB-402 Stage B + Stage C shown as future.

Reflects main @ 3aa69a9. Verified against source by primary.
2026-07-18 15:00:06 +02:00
kevin 479ccab9d1 Fix doc drift vs docs/MCP-Contract.md: no 'done' agent_status (turn-done = working→idle edge); bridge_sessions→bridge_list, bridge_poll→bridge_status drain, mode→block param
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 19:59:53 +07:00
Dai Ha 6835d0a89a wiki: Java stack + REST-as-test-surface + verified herdr 0.7.0 API
- Tech stack Go -> Java 21 (virtual threads, GraalVM native-image); MCP Java SDK;
  Javalin REST; UnixDomainSocketAddress; Jackson YAML; Lettuce; JUnit. Interface
  sketch rewritten in Java (2-Message-Server + 8-Roadmap).
- Testability: REST API is the contract surface — every feature = an endpoint =
  an acceptance test (no Claude/MCP in loop); MCP verified by parity. New
  Roadmap section + feature/endpoint/test map + diagram; Stage-1 tickets
  (CB-104/105) reframed around REST endpoints; CB-106 Jackson/SLF4J.
- Spike correction: verified against RUNNING herdr 0.7.0 (protocol 14). No
  session.snapshot (fixed 5 refs -> workspace.list/pane.list/ping). Documented
  the native agent.* namespace as a south-side opportunity; CB-102 now spikes
  agent.start first. pane.wait_for_output used.
- Envelope open-question already resolved -> Use Cases.
All 21 mermaid blocks validated.
2026-07-12 09:23:25 +02:00
Dai Ha 6b3c2a1d16 wiki: consistency pass vs rewritten Architecture (5-agent review)
Independent cold reads of every page against 1-Architecture found no invariant
violations; fixed the drift the rewrite introduced plus one real contradiction:

- terminology: Channel 1/2 -> Mode 1/2, 'two-channel' -> 'two invariants / two
  modes' (Approaches, Team, Home, Sidebar, Message-Server); north/south face ->
  SERVER/CLIENT face (Message-Server, 6 spots)
- contradiction reconciled: Architecture now acknowledges a non-MCP *worker*
  Stop-hook (POSTs reply to bridged) as well as the split-host-primary hook -
  both target bridged, never a broker; Message-Server tier table split into
  Unified / Hooked / Unmodified to match
- Approaches: footnote credits bridge_reply (Stop-hook = fallback); §4 subtitle
  reframed; <payload> mermaid label de-angled (parse-safe)
- Team: SERVER 'role router' -> 'policy brain'; fan-out sequence quoted; inference edges labeled
- Home/README: CLIENT-face node regains 'status-gated injector'
- Operations: 'broker' -> 'internal broker/queue'; Stop-hook framed as split-host exception
- async ticket/bridge_poll reframed as injection-first (push), poll = non-pane fallback
All 16 mermaid blocks validated with mmdc.
2026-07-12 07:11:03 +02:00
Dai Ha 22c1e20e83 wiki: rewrite 1-Architecture from scratch (clean-slate, final consolidated design)
Discard the incrementally-accreted Architecture page and compose a fresh,
coherent one around the two invariants (subscription boundary + sole gateway).
Tighter structure, 4 purposeful diagrams (system overview, blocking seq, async
seq, lifecycle state), no legacy framing. All validated with mmdc.
2026-07-12 06:57:01 +02:00
Dai Ha 78bb89fcf0 wiki: bridged is the sole communication gateway (no Claude<->broker, no mainline Stop-hook)
Now that every Claude session mounts bridged over MCP, make bridged the ONLY
thing a Claude session talks to. Claude never posts to / polls a broker; async
delivery is bridged injecting an idle pane (event-driven off agent_status). The
broker drops below the gateway line as bridged-owned durability/cross-host infra.
The Stop-hook survives only as a split-host escape hatch that polls bridged (not
the broker).

- 1-Architecture: add the gateway invariant; rewrite Channel 2 as bridged-mediated
  async; redraw components + deployment diagrams (broker below gateway, drop
  Claude/Hook -> broker arrows); guardrails now bridged-enforced; failure-modes
  updated (bridged down = whole gateway down)
- 2-Message-Server: reply-model, reply-envelope (hook posts bridged not broker),
  async-duplex sequence, components/API/tech-stack/milestones/trade-offs, both
  deployment diagrams
- 3-Approaches: sole-gateway notes in herdr/AgentAPI/queue sections, matrix + recs
- 4-Setup: split-host Stop-hook polls bridged; queue is internal
- 6-Team: detached jobs via bridged async, not broker
- Home + README: 'one gateway' bullet; intros updated
All 16 mermaid blocks validated with mmdc; 2 rendered to PNG for layout.
2026-07-12 06:50:00 +02:00
Dai Ha c71175e1c7 wiki: redraw diagrams — bridged as standalone daemon (SERVER/CLIENT faces + MCP)
Declutter every component diagram to show bridged as ONE standalone daemon
split into a SERVER (north) face — MCP server + REST/SSE + policy brain — and
a CLIENT (south) face — status-gated injector + herdr socket client. Claude
sessions are shown as herdr panes that mount the MCP server (call up) while the
client drives them down over the socket.

- 2-Message-Server: main architecture flowchart rebuilt (herd subgraph of
  panes + bridged subgraph with srv/cli); intro reframed; split-host node label
- 1-Architecture: components diagram — bridged subgraph with SERVER/CLIENT faces
- 6-Team: topology — bridged split into faces + role router; worker bridge_reply
- Home + README: overview flowchart — bridged subgraph with SERVER/CLIENT faces
All 16 mermaid blocks validated with mmdc.
2026-07-11 15:52:17 +02:00
Dai Ha b824a28d04 wiki: MCP as unified north-face contract (primary + workers mount bridged)
- 2-Message-Server: new 'client contract — MCP' section (tool surface,
  rendezvous, graceful herdr-only vs MCP-worker tiers); flowchart +
  sequence diagrams + components/API/tech-stack/milestones updated
- 1-Architecture: Channel 1 + diagrams framed around bridge_send/reply;
  worker->primary now rides bridged's MCP rendezvous (no primary-pane keystroke)
- 3-Approaches: north-face=MCP note; primary-direction bullet updated
- 4-Setup: unified 'claude mcp add' mount step; 5-Operations: MCP health check
- Home + README: MCP framing, unified-setup bullet, flowcharts
2026-07-11 15:36:54 +02:00
Dai Ha 0b73facb66 wiki: number page filenames (1-..5-) so Gitea Pages list sorts
- git mv content pages to N-Name.md (history preserved); Home + _Sidebar kept
- convert [[wiki-links]] to [display](numbered-slug) markdown links so
  resolution is unambiguous and prose display stays clean
2026-07-11 15:13:56 +02:00