acpmux: fence mailbox identities by session receipts
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 passedcargo test -p acpmux --lib mailbox::tests— 17 passedcargo test -p acpmux --lib session_identity— 2 passedcargo test -p acpmux --lib hub::peers::tests— 1 passedcargo test -p acpmux --test peer_integration peer_sessions_are_listed_prompted_and_permission_routed— 1 passedcargo fmt --package acpmux -- --checkgit diff --check
Changelog
Changed: ACPMUX mailbox identity is bound to attached server-derived session receipts and generation.
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
sessionReceiptandqualifiedSessionId; receipts bind on attach and unbind on detach. - New
session_identity.rsdefines the receipt format, withlocalas 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-corewith tests and updates the spec.