acpmux: fence mailbox identities by session receipts

Merged
TE
19d ago
+625-142

Summary

Mailbox sends, reads, waits, and acknowledgements now require daemon-issued SessionReceipt identities bound to the connection attachment. The fence checks host, mux session, agent session, and generation, canonicalizes qualified routing, rejects spoofed or stale identities, and keeps Web/Peer bearer mailbox paths denied.

Validation

  • cargo test -p acpmux --lib server::requests::mailbox::tests — 6 passed
  • cargo test -p acpmux --lib mailbox::tests — 17 passed
  • cargo test -p acpmux --lib session_identity — 2 passed
  • cargo test -p acpmux --lib hub::peers::tests — 1 passed
  • cargo test -p acpmux --test peer_integration peer_sessions_are_listed_prompted_and_permission_routed — 1 passed
  • cargo fmt --package acpmux -- --check
  • git diff --check

Changelog

Changed: ACPMUX mailbox identity is bound to attached server-derived session receipts and generation.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fences mailbox send, read, wait, and acknowledgement RPCs behind daemon-issued session receipts tied to the connection attachment. Receipts carry the daemon host, mux session, agent session, and generation, so bare names and caller metadata no longer establish mailbox ownership and spoofed or stale identities are rejected. Web/Peer bearer mailbox paths stay denied.

Adds a read-only agent-session-observe-v1 capability that reuses the attach lifecycle but refuses session mutations.

  • Session summaries now carry a host-qualified sessionReceipt and qualifiedSessionId; receipts bind on attach and unbind on detach.
  • New session_identity.rs defines the receipt format, with local as the daemon's host id.
  • Attachments are now mode-locked: an observe attachment cannot switch to writable attach, and a writable attach cannot switch to observe.
  • Adds agent session observe support in cmux-tui-core with tests and updates the spec.