enforce_host_only

Function enforce_host_only 

Source
pub(super) fn enforce_host_only(
    state: &mut State,
    ctx: &Ctx,
    op: &'static str,
) -> Option<Event>
Expand description

Phase B.4 — gate window-mirror reports to Host clients only. The host is the only source of truth about its own window lifecycle; allowing Renderer/Srv/Tool clients to mutate the mirror would let any registered process spoof open/close traffic and break the host-authoritative model. (codex P1 PR #576 round-1.)

Returns Some(Error) if the calling connection is not a Host; None if the call is allowed to proceed. Looks up the kind by PID rather than threading it through Ctx because processes is already the canonical source — single source of truth, no extra plumbing.