diff --git a/crates/maestro-daemon/src/broker.rs b/crates/maestro-daemon/src/broker.rs index 7b6d7e4..98e63a1 100644 --- a/crates/maestro-daemon/src/broker.rs +++ b/crates/maestro-daemon/src/broker.rs @@ -1,9 +1,16 @@ -//! Home-daemon broker handle (NAP-247). +//! Home-daemon broker handle (NAP-247, extended in NAP-327). //! -//! The HTTP `WS /api/attach/:id` handler uses this to ask the registry to -//! resolve a peer-owned session into an [`AttachCandidates`] (a pair-scoped -//! JWT + the target daemon's T2 perimeter info). The actual control-link -//! send and the reply correlation live here so the handler stays thin. +//! The HTTP handlers use this to issue correlated request/reply RPCs over the +//! daemon's single registry control link, keeping themselves thin: +//! +//! - `WS /api/attach/:id` → `resolve_attach`: resolve a peer-owned session into +//! an [`AttachCandidates`] (pair-scoped JWT + T2 perimeter info) (NAP-247). +//! - `POST /api/sessions` / `DELETE /api/sessions/:id` for a peer target → +//! `forward_create` / `forward_kill`: relay the op to the owning daemon and +//! await its result (NAP-327). +//! +//! Each call correlates its reply by `reply_to`, fails fast while the link is +//! down (NAP-263), and cleans up its pending entry on every exit path (NAP-259). use std::collections::HashMap; use std::hash::Hash; diff --git a/crates/maestro-daemon/src/local_api.rs b/crates/maestro-daemon/src/local_api.rs index a5ad0da..f27546b 100644 --- a/crates/maestro-daemon/src/local_api.rs +++ b/crates/maestro-daemon/src/local_api.rs @@ -14,12 +14,14 @@ //! trust — same model `maestro-web` documents per the connection-orchestration //! spec. Cookie auth can be added later if a real use case demands it. //! -//! ## Scope (v1) +//! ## Scope //! -//! The daemon only surfaces its own sessions and itself. Peer-catalog mirroring -//! is NAP-246; cross-daemon broker attach is NAP-247. Until those land, -//! `POST /api/sessions` rejects requests targeting other daemons and -//! `WS /api/attach/:id` only handles sessions this daemon owns. +//! The daemon surfaces its own sessions plus the peer-catalog mirror (NAP-246). +//! Cross-daemon operations are brokered over the registry control link: +//! `WS /api/attach/:id` dials a peer over T2 (NAP-247), and `POST /api/sessions` +//! / `DELETE /api/sessions/:id` for a peer-owned target relay a create/kill RPC +//! to the owning daemon (NAP-327) — control-plane only, no session bytes +//! traverse the registry. use std::sync::Arc;