agentmux_cef\wrr/
mod.rs

1// Copyright 2026, AgentMux Corp.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Phase B.9.1 — Window Reality Reconciliation (WRR), host-side
5// hook layer.
6//
7// Subscribes to Win32 events that surface HWND lifecycle and
8// observability transitions, and forwards each as a typed
9// `Command::ReportHwnd*` over the existing launcher IPC pipe.
10// The launcher's reducer arm classifies divergences and emits
11// `Event::HwndDriftDetected` (see
12// `agentmux-launcher/src/wrr/mod.rs`).
13//
14// Pure event-driven: every report is in response to an OS
15// notification, never on a timer. The one heartbeat-shaped
16// caveat — position-change debounce — is purely a wire-volume
17// optimization (drag a window to its final position; the
18// reducer only needs the final rect, not 60 intermediate ones).
19// Debounce IS bounded; a final position event always lands
20// after the burst settles (see `position_debounce.rs`).
21//
22// Design lives at `docs/retro/wrr-design-2026-04-28.md`.
23
24#[cfg(target_os = "windows")]
25pub mod classify;
26#[cfg(target_os = "windows")]
27pub mod position_debounce;
28#[cfg(target_os = "windows")]
29pub mod win_event;
30
31#[cfg(target_os = "windows")]
32pub use win_event::{install_hooks, uninstall_hooks};
33
34#[cfg(not(target_os = "windows"))]
35pub fn install_hooks(_state: std::sync::Arc<crate::state::AppState>) {
36    // WRR is Windows-only — Phase 7 will revisit when cross-platform
37    // window-state mirroring lands. Stub matches the Windows signature
38    // so callers in main.rs compile across all targets without
39    // platform gating at the call site. (reagent #600 P1.)
40}
41
42#[cfg(not(target_os = "windows"))]
43pub fn uninstall_hooks() {}