Skip to content

feat(federation): remote-window UX guardrails + encrypted-transport & messaging plans - #872

Merged
huntharo merged 3 commits into
feat/pwragent-instance-federationfrom
claude/federation-followup
Jun 22, 2026
Merged

feat(federation): remote-window UX guardrails + encrypted-transport & messaging plans#872
huntharo merged 3 commits into
feat/pwragent-instance-federationfrom
claude/federation-followup

Conversation

@huntharo

Copy link
Copy Markdown
Contributor

Summary

Follow-up stacked on #735 (instance federation MVP). Ships verified dogfood UX guardrails for remote windows and lands two follow-up plans. Targets the federation feature branch so it stacks cleanly.

Shipped (code, verified)

  • Remote new-thread guard. A remote window no longer silently creates a LOCAL thread on the client instance. createThread and materializeDirectoryLaunchpad bail with a clear message when a renderer federation target is active; the launchpad path throws so the composer preserves the typed prompt.
  • Remote window badge. New RemoteWindowBadge in the sidebar masthead makes remote windows visually distinct (● Remote · <peer label>).
  • Peer reachability. Folded into the same badge as a connection-status dot (connected / pending / offline), polling federation health — covers both "which window is this" and "is the peer up" in one always-visible element.

All using existing theme tokens; the brand-token contract test still passes.

Plans (docs)

  • Encrypted LAN transportdocs/plans/2026-06-21-001-feat-federation-encrypted-lan-transport-plan.md. ssh-like Noise_IK channel over the existing WebSocket, reusing the pinned identity, closing the post-auth cleartext read/inject exposure when not behind a Cloudflare tunnel. This is the deferred "local-only transport" from the original plan.
  • Messaging → remote routingdocs/plans/2026-06-21-002-feat-federation-messaging-routing-plan.md. Wires the currently-dead federated messaging helpers into a reachable end-to-end path behind a default-off messaging_route capability.

Why these UX fixes

#735 is a genuinely working remote-thread control plane (auth handshake, real backend data, startTurn/steer over the wire). The gaps that made it unpleasant to dogfood were: silent wrong-instance thread creation, no way to tell a remote window apart, and no peer-offline signal. These three fixes address exactly those.

Verification

  • pnpm --filter @pwragent/desktop typecheck — clean
  • theme-contract test — 42/42
  • pnpm lint:boundaries — 0 violations
  • app-shell render — 20/20
  • new RemoteWindowBadge tests — 4/4

Not included (deliberately)

The messaging→remote routing implementation is held for its own PR — recon showed it's a feature, not a wiring (bindings never stamp federatedThread, browse never surfaces remote threads), with a security fork (remote agent control via messaging). It's fully specced in the plan doc above.

🤖 Generated with Claude Code

huntharo and others added 3 commits June 21, 2026 18:22
…e windows

Three dogfood UX fixes for the instance-federation MVP (#735):

- Block new-thread creation in a remote window instead of silently
  creating a LOCAL thread on the client instance. createThread and
  materializeDirectoryLaunchpad now bail with a clear message when a
  renderer federation target is active; the launchpad path throws so the
  composer preserves the typed prompt.
- Add RemoteWindowBadge in the sidebar masthead so remote windows are
  visually distinct from local ones.
- Surface peer reachability via a connection-status dot on the badge
  (connected / pending / offline), polling federation health.

Reuses existing theme tokens; the brand-token contract test still passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two follow-up plans for the instance-federation MVP (#735):

- Encrypted, identity-bound direct/LAN transport: a Noise_IK channel over
  the existing WebSocket reusing the pinned instance identity, closing the
  post-auth cleartext read/inject exposure when not behind Cloudflare.
- Messaging -> remote-thread routing: wires the currently-dead federated
  messaging helpers into a reachable end-to-end path (browse surfacing,
  bind stamping, bridge routing, remote event delivery) behind a
  default-off messaging_route capability.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the missing coverage flagged in review of #872:

- useThreadNavigation: createThread and materializeDirectoryLaunchpad
  no-op (set error / reject) in a remote window and never touch the local
  backend (ensureDirectoryLaunchpad / materializeDirectoryLaunchpad).
- RemoteWindowBadge: connecting peer renders the pending status dot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@huntharo
huntharo merged commit d0fd78d into feat/pwragent-instance-federation Jun 22, 2026
@huntharo
huntharo deleted the claude/federation-followup branch June 22, 2026 02:23
huntharo added a commit that referenced this pull request Jul 2, 2026
Federation feature collapsed onto current main as a single linear commit
(developed across #735/#872/#892 with interim merge commits). Rebuilt via one
3-way squash of the tested branch tip onto main; the only conflict was an
additive preload import list, resolved by keeping both.

Includes:
- Instance federation MVP: authenticated WebSocket control plane; peer
  enrollment / identity / policy / store; router + RPC backend bridge; remote
  window targets; federated search; Settings -> Federation; messaging
  federated-thread bindings.
- Remote-window UX guardrails: block remote-window thread creation (no silent
  local thread), RemoteWindowBadge with live peer connection status.
- Encrypted, mutually-authenticated transport: hand-written Noise_IK on Node's
  built-in crypto (locked to the official Noise test vectors), per-frame AEAD,
  gateway static key pinned via the invite, Ed25519 identity proof channel-bound
  to the handshake hash. Encrypted by construction (no plaintext LAN path).
- Plans: encrypted-LAN-transport and messaging-routing follow-ups.

Federation ships disabled by default; encrypted when enabled.

Verified: shared+desktop typecheck, lint:boundaries, lint:sql, and the federation
+ merge-sensitive suites (196 tests) green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
huntharo added a commit that referenced this pull request Jul 2, 2026
Federation feature collapsed onto current main as a single linear commit
(developed across #735/#872/#892 with interim merge commits). Rebuilt via one
3-way squash of the tested branch tip onto main; the only conflict was an
additive preload import list, resolved by keeping both.

Includes:
- Instance federation MVP: authenticated WebSocket control plane; peer
  enrollment / identity / policy / store; router + RPC backend bridge; remote
  window targets; federated search; Settings -> Federation; messaging
  federated-thread bindings.
- Remote-window UX guardrails: block remote-window thread creation (no silent
  local thread), RemoteWindowBadge with live peer connection status.
- Encrypted, mutually-authenticated transport: hand-written Noise_IK on Node's
  built-in crypto (locked to the official Noise test vectors), per-frame AEAD,
  gateway static key pinned via the invite, Ed25519 identity proof channel-bound
  to the handshake hash. Encrypted by construction (no plaintext LAN path).
- Plans: encrypted-LAN-transport and messaging-routing follow-ups.

Federation ships disabled by default; encrypted when enabled.

Verified: shared+desktop typecheck, lint:boundaries, lint:sql, and the federation
+ merge-sensitive suites (196 tests) green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
huntharo added a commit that referenced this pull request Jul 5, 2026
Federation feature collapsed onto current main as a single linear commit
(developed across #735/#872/#892 with interim merge commits). Rebuilt via one
3-way squash of the tested branch tip onto main; the only conflict was an
additive preload import list, resolved by keeping both.

Includes:
- Instance federation MVP: authenticated WebSocket control plane; peer
  enrollment / identity / policy / store; router + RPC backend bridge; remote
  window targets; federated search; Settings -> Federation; messaging
  federated-thread bindings.
- Remote-window UX guardrails: block remote-window thread creation (no silent
  local thread), RemoteWindowBadge with live peer connection status.
- Encrypted, mutually-authenticated transport: hand-written Noise_IK on Node's
  built-in crypto (locked to the official Noise test vectors), per-frame AEAD,
  gateway static key pinned via the invite, Ed25519 identity proof channel-bound
  to the handshake hash. Encrypted by construction (no plaintext LAN path).
- Plans: encrypted-LAN-transport and messaging-routing follow-ups.

Federation ships disabled by default; encrypted when enabled.

Verified: shared+desktop typecheck, lint:boundaries, lint:sql, and the federation
+ merge-sensitive suites (196 tests) green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant