start is the same dance in all three komorebic: look whether komorebi is running, start it, wait three seconds and look again, give up after three attempts by running it in front of the user so its stderr can be read. launcher::start runs that loop over a Launcher (daemon_name, spawn, is_running, diagnose) that each platform implements by hand; what follows a successful start (companions, the licence text) stays in each komorebic, as does stop's handling of companions, whose order differs per platform; only stop_message(ignore_restore) is shared. The loop flushes standard output after 'Waiting for ... to start...' (KDE did, macOS and Windows did not) and puts the same space after it; both are invisible in the text printed. Nothing uses it yet.
Verified: native cargo test -p komorebic-core: 31 passed, 0 failed (4 new launcher tests with a fake launcher: already running, second try, three tries then diagnose, stop message).
komorebi-for-mac/komorebic/src/pan.rs (810 lines) is deleted: it differed from the Windows copy by three doc comments only (whkd wording versus a generic one, 21 changed lines), so the shared module keeps the Windows wording of those comments; no code differs. pan --stream runs komorebic_core::pan with a PanLink over the client connection.
Verified: macOS fake-CC cargo check --locked --workspace --all-targets: 0 errors. The 16 pan tests of the macOS tree were the same tests as Windows'; they run in komorebic-core (27 passed). Not verified on macOS itself.
komorebic/src/pan.rs (809 lines) is deleted; pan --stream runs komorebic_core::pan with a PanLink that is the client connection (the orphan impl the crate cannot have). Behaviour is the same code.
Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; the 16 pan tests now run in komorebic-core (native, 27 passed with the crate's own 11). oracle unchanged by construction (no clap definition touched).
komorebic/src/pan.rs (parse_line, Forwarder, next_merged, the Sink and Link traits, Socket and run, with their 16 tests) is copied into the crate with its imports pointed at komorebi-layouts and komorebi-protocol. The one impl that needs the client, Link for komorebi_client::Connection, is left to each komorebic (an orphan); the tests read the transcripts of komorebic/fixtures, which the pan tests of both daemons use as well. The 16 tests could not run on Linux before and now do. Nothing uses the copy yet.
Verified: native cargo test -p komorebic-core --lib: 27 passed, 0 failed (11 + the 16 pan tests).
Adds crates/komorebic-core/tests/platforms.rs (49 lines). It builds the clap command for the Windows, KDE and macOS option sets and asserts each keeps its subcommand count, so a variant dropped from the shared Messages enum fails loudly. Verified: cargo test -p komorebic-core passes natively on Linux.
WindowsCommands and the argument structs of the subcommands that are not in Messages (start, stop, check, kill, the border, stackbar and custom-layout commands, the app-specific-configuration converters and the ones whose help still differs between the trees) move from komorebic/src/main.rs to komorebic-core::platform::windows with their fields pub; the Windows main.rs keeps the handlers (2164 to 1520 lines). Three fields named after a protocol type that a struct of the same name shadows (BorderStyle, BorderImplementation, StackbarMode) are written with their full path. docgen-all now writes the Windows pages too, so no harness is needed any more.
Verified: oracle (step4/oracle-check.sh, Windows pages from the docgen-all example): windows 187 of 187 pages byte-identical, macos 158 of 158, kde 166 of 166; Windows cargo clippy --workspace --locked --all-targets -D warnings clean.
MacosCommands and the argument structs of the subcommands that are not in Messages (start, stop, quickstart, permissions, pan, the animation commands and the 18 whose help still differs between the trees) move from komorebi-for-mac/komorebic/src/main.rs to komorebic-core::platform::macos with their fields made pub; the macOS main.rs keeps the handlers (1293 to about 600 lines). The definitions have no macOS-only dependency, so the pages of the macOS command line can now be written on any host: the docgen-all example of the crate does it, and replaces the harness that compiled the clap section of main.rs. clap_complete joins the crate for Completions.
Verified: oracle (step4/oracle-check.sh, macOS pages now from the docgen-all example): macos 158 of 158 pages byte-identical (windows 187 and kde 166 still pass); macOS fake-CC cargo check --locked --workspace --all-targets: 0 errors; KDE cargo check -p komorebic: ok.
Same change as for KDE and macOS in the Windows komorebic: the 121 common subcommands come from Messages, the Windows ones stay in WindowsCommands, the command line is Opts<WindowsCommands>, send_or_query writes or prints any message and docgen goes through komorebic_core::docgen with DocFormat::PLAIN. main.rs goes from 3532 to 2164 lines. komorebic --help lists the Messages first.
Verified: oracle (step4/oracle-check.sh): windows 187 of 187 pages byte-identical (after the usual normalisation of the one cfg(target_os) line); Windows cargo clippy --workspace --locked --all-targets -D warnings clean. Not verified: the 16 pan tests of the Windows komorebic (they cannot run on Linux).
Same change as for KDE: the 121 common subcommands come from komorebic_core::messages::Messages, the macOS ones stay in MacosCommands (SubCommand renamed), the command line is Opts<MacosCommands>, send_or_query writes or prints any message, and docgen goes through komorebic_core::docgen with DocFormat::PLAIN. main.rs goes from 2661 to 1293 lines. komorebic --help lists the Messages first (see the KDE revision).
Verified: oracle (step4/oracle-check.sh, harness = the tree's clap section plus core's Opts<P>): macos 158 of 158 pages byte-identical (windows 187 and kde 166 still pass); macOS fake-CC cargo check --locked --workspace --all-targets: 0 errors, no warning in komorebic.
The 121 subcommands that are one message in all three komorebic are no longer declared in the KDE komorebic: its SubCommand enum becomes KdeCommands (the 44 subcommands that are KDE's own, start, stop, check, hotkeys, quickstart, completions and the ones whose help still differs between the trees), the command line is komorebic_core::cli::Opts<KdeCommands>, and one send_or_query turns any Messages into its SocketMessage and writes it or prints the answer. The docgen arm calls komorebic_core::docgen with DocFormat::KDE. main.rs goes from 2294 to 911 lines. The platform enum stays in the KDE package because hotkeys needs komorebi-hotkeys.
One visible difference outside the generated pages: komorebic --help lists the subcommands of Messages first and the KDE ones after (a flattened enum is listed where it is declared, and Opts flattens Messages before the platform enum), where the old order was one hand-sorted list. The pages, aliases and arguments are unchanged.
Verified: oracle (step4/oracle-check.sh): kde 166 of 166 pages byte-identical (windows 187 and macos 158 still pass); KDE cargo test -p komorebic --locked: 10 + 12 + 49 + 9 passed, 0 failed.
Messages holds the 121 subcommands that are identical in the three komorebic (same arguments, same help, one SocketMessage each; the six that ask something are named by Messages::is_query). Every variant carries the doc comment and attributes it had, so the help is unchanged, and one exhaustive match turns a Messages into the SocketMessage it names, so a subcommand added to the enum cannot be left without its message. The argument structs those subcommands used (about 20 of them) join the blocks in args.rs; the ones that repeated the monitor/workspace pair, the application identifier or the four sides of an offset flatten the shared block.
cli.rs adds Opts<P>, the whole command line generic over the subcommands P of a platform, with Messages and P flattened side by side (so every subcommand stays top level, and no cfg is needed to pick the platform), plus Meta for the texts at the top of the help and command()/parse() so each komorebic passes its own about, author and version. Nothing uses them yet.
Verified: native cargo test -p komorebic-core: 11 passed, 0 failed (includes clap's debug_assert of the command built with Messages and a platform enum).
Same change as for KDE and macOS in the Windows komorebic: the ten gen_* macros, BooleanState and the paste dependency (only the macros used it) are replaced by the blocks of komorebic-core, with the arms reading args.value or args.target.monitor. About 395 lines of macros and invocations are removed.
Verified: the oracle (step4/oracle-check.sh, harness over the real protocol crate): 187 of 187 Windows pages byte-identical to the pre-move output (after normalising the one cfg(target_os) line of ApplicationIdentifier::Class that a Linux build words differently); Windows clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets: 0 errors.
Same change as for KDE: the macOS komorebic drops its ten gen_* macros and the BooleanState enum for the blocks of komorebic-core, and the pastey dependency that only the macros used. About 380 lines are removed; the hand-written structs stay until the Messages enum takes them.
Verified: the oracle (step4/oracle-check.sh macos, harness over the real protocol crate): 158 of 158 pages byte-identical to the pre-move output; macOS fake-CC cargo check --workspace --all-targets: 0 errors.
The KDE komorebic drops its ten gen_* macros and the BooleanState enum and takes the blocks of komorebic-core instead: Focus(Focus) is now Focus(OneEnum<OperationDirection>), MoveToMonitor(MoveToMonitor) is MoveToMonitor(Target), and so on, with the arms reading args.value or args.target.monitor where the macro structs had one field per name. The pastey dependency, only used by the macros, goes. 391 lines of macros and of invocations are removed; the hand-written structs that are not macro output stay until the Messages enum takes them.
Verified: the oracle (step4/oracle-check.sh kde): 166 of 166 pages byte-identical to the pre-move output; KDE cargo test -p komorebic --locked: 10 + 12 + 49 + 9 passed, 0 failed.
The ten gen_* macros of komorebic (textually the same in the three trees) become plain structs in komorebic-core: Target, NamedTarget, WorkspaceTarget, Size, NamedPadding, WorkspacePadding, PaddingAdjustment, ApplicationTarget and the generic OneEnum<T>, WorkspaceEnum<T> and NamedWorkspaceEnum<T>, which flatten the shared blocks instead of repeating them. A generic positional would be named VALUE, so ValueName gives OneEnum<T> the name the field of the macro struct had (OPERATION_DIRECTION, CYCLE_DIRECTION, ...) and the help stays the same. Limits of generic clap structs (T needs Send + Sync + 'static; a doc comment on a generic field is the help of every instantiation, so the String workspace name has its own struct; flattening two instantiations into one command panics at run time) are in the module docs. The blocks carry plain comments, not doc comments: clap takes the doc comment of an Args struct as the about of the command it is flattened into. Nothing uses the blocks yet.
Verified: native cargo test -p komorebic-core: 6 passed, 0 failed.
komorebi-for-kde/docs/cli was 162 of 166 pages in step with the real output after the protocol crate (step 2) took the shared types: animation, animation-duration and animation-style list the union of the animation prefixes (movement, transparency, workspace; D19) and border-colour lists the possible values of WindowKind with their docs. Regenerated with komorebic docgen; only these four pages change and the diff is the possible-values lists and 'Print help (see a summary with -h)'. This is the baseline the step 4 oracle compares against.
Verified: komorebic docgen into docs/cli, then diff -r against the output: 166 of 166 pages identical.
A new workspace member crates/komorebic-core, the home of the clap definitions the three komorebic packages share (step 4, D20-D22). This revision only has the docgen renderer: DocFormat keeps what differs between the trees (KDE pins the width at 100, fences with ```text, ends with a newline and writes a page for a subcommand of a subcommand; Windows and macOS set no width) and the list of commands that get no page, which is the same in all three. Nothing uses it yet.
Verified: native cargo test -p komorebic-core: 3 passed, 0 failed.
Same change as the KDE revision: the OnceLock channel, the try_send with the drop warning and the ResizeStep claim/release flag in window_manager_event_listener.rs are now a komorebi_transport::EventChannel<WindowManagerEvent> (capacity 20, predicate matches!(.., ResizeStep(_, _, _))), behind the same three functions. The overflow flag exists and nothing reads it. The macOS keeps its early resize_step_taken call in process_event.rs untouched. The three macOS unit tests of the coalescing (claim/release helpers) moved to the transport crate as tests of EventChannel (D23); the helper functions they tested no longer exist here. The Cargo.lock of the macOS workspace gets the crossbeam-channel dependency of the transport crate. Logs use the target komorebi::transport (D29).
Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: 0 errors. macOS unit tests cannot run on Linux (the 3 moved tests run in the transport crate).
window_manager_event_listener.rs keeps its three functions (event_rx, resize_step_taken, send_notification) and its callers, but the channel, the try_send with the drop warning and the ResizeStep coalescing flag are now a komorebi_transport::EventChannel<WindowManagerEvent> made with capacity 20 and the predicate matches!(.., ResizeStep(..)). The overflow flag exists in the channel and nothing reads it. The KDE bug where a ResizeStep that arrives while paused leaves the flag set (process_event.rs, paused return before resize_step_taken) is NOT fixed here: that is R5, a behaviour change. 25 lines of channel code removed. Logs use the target komorebi::transport (D29).
Verified in komorebi-for-kde: cargo check -p komorebi --all-targets: no errors or warnings. The full workspace test run follows in the next progress entry.
EventChannel<E> is the window-event channel that KDE and macOS each write by hand in window_manager_event_listener.rs: bounded, send is try_send and never blocks, an event that does not fit is dropped with the warning 'channel is full; dropping notification', and an optional predicate (EventChannel::coalescing) lets one coalesced event (the ResizeStep of a drag) wait at a time, released by coalesced_taken(), also when the send of the claiming event fails. The channel also records that an event was dropped (take_overflow); no tree reads it (R6 is a behaviour change, out of scope here). The flag orderings are SeqCst as in the KDE copy (macOS used AcqRel/Release; stronger on one variable, no visible difference). Nothing uses it yet. Logs use the target komorebi::transport (D29).
Verified: cargo test -p komorebi-transport: 13 passed, 0 failed (5 new, the three macOS coalescing tests rewritten against the API, plus no-predicate and drop/overflow); cargo clippy -p komorebi-transport --all-targets -D warnings: clean.
notify_subscribers keeps the Windows override events (TitleUpdate, Uncloak and Show, no Monitor), the registry statics and the whole named-pipe part (SUBSCRIPTION_PIPES, error codes 2 and 232), and hands the socket push to komorebi_transport::notify_sockets with uds_windows::UnixStream::connect. Both locks are still held to the end of the function and the early return on a write error still skips the pipes. 33 lines removed from lib.rs. Behaviour-preserving; logs of the socket part use the target komorebi::transport (D29).
Verified: nix develop --command cargo clippy --workspace --locked --all-targets -- -D warnings (x86_64-pc-windows-msvc): finished, no warnings or errors. Not verified: Windows tests and scenarios (subscribers are exercised by the bar and the scenarios).
Same as the KDE revision: notify_subscribers keeps the macOS override events (Monitor, AddSubscriberSocket, AddSubscriberSocketWithOptions, Theme, ReloadStaticConfiguration, WindowManager Show) and the registry statics and hands the push to komorebi_transport::notify_sockets. 40 lines removed from lib.rs. Behaviour-preserving; logs use the target komorebi::transport (D29).
Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: 0 errors, no new warnings. Unit tests cannot run on Linux.
notify_subscribers keeps its KDE-specific part (the override events: Monitor, AddSubscriberSocket, AddSubscriberSocketWithOptions, Theme, ReloadStaticConfiguration, WindowManager Show) and the registry statics, and hands the push to komorebi_transport::notify_sockets. 40 lines of connect/write/stale-removal code removed from lib.rs. Behaviour-preserving; logs use the target komorebi::transport (D29).
Verified in komorebi-for-kde: cargo check -p komorebi --all-targets: no errors or warnings; cargo test -p komorebi --lib: 293 passed, 0 failed; the notify_subscribers doctest (it pushes to a real socket and removes a stale one): passed.
komorebi_transport::notify_sockets is the mechanics of notify_subscribers that the three daemons each copy: for each subscriber socket, skip it if it wants state changes only and nothing changed and the event is not an override event, connect, write the notification, collect the sockets that cannot be connected to, then remove those from the registry and delete their socket file (errors logged). The daemon keeps the registry statics and their locks (the public SUBSCRIPTION_SOCKETS path is used by the bar, main and a KDE doctest, and the Mutex type is the daemon's own parking_lot) and passes what differs per platform: the registry, the push_unchanged decision (state modified or one of its platform's override events), the data dir and the connect function (uds_windows on Windows). Nothing uses it yet. Logs use the target komorebi::transport (D29).
Verified: cargo test -p komorebi-transport: 8 passed, 0 failed (2 new: push and stale removal, state-change filter); cargo clippy -p komorebi-transport --all-targets -D warnings: clean.
listen_for_commands and read_commands_uds call komorebi_transport::listen_for_commands and read_commands. What only Windows does stays Windows-side behind the ConnectionPolicy hook (WindowsConnectionPolicy): the 1 s read timeout set after accept (on_accept) and the 30 s timeout set when a PanGesture::Begin is read (on_message, called before the 1 s try_lock_for, at the same point of the loop as before). WindowManager implements CommandTarget over uds_windows::UnixListener/UnixStream (the transport crate implements the stream traits for them on Windows). The window manager keeps the 1 s try_lock_for. The TCP listener and read_commands_tcp (blocking wm.lock(), 1024-byte reads, TCP_CONNECTIONS) and the named-pipe subscribers are untouched. Behaviour-preserving, not a literal text move. Cosmetic: the accept-error log line now reads 'failed to get unix stream <error>' like KDE and macOS and logs come from the target komorebi::transport (D29). 80 lines of loop code removed from process_command.rs.
Verified: nix develop --command cargo clippy --workspace --locked --all-targets -- -D warnings (x86_64-pc-windows-msvc): finished, no warnings or errors. NOT verified: the Windows unit test and the scenarios; the PanGesture timeout and TCP paths have no test in any tree. Needs the Windows e2e (commands, pausing, pan) before landing.
Same change as the KDE revision: listen_for_commands and read_commands_uds call komorebi_transport::listen_for_commands and read_commands with NoPolicy (macOS sets no read timeouts), and WindowManager implements CommandTarget (clone of command_listener under the lock, try_lock_for on parking_lot, is_paused, process_command). #[tracing::instrument] stays on listen_for_commands. read_commands_uds keeps its name and signature for the unit test. Behaviour-preserving, not a literal text move; logs now use the target komorebi::transport (D29). 75 lines of loop code removed from process_command.rs.
Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: 0 errors. macOS unit tests cannot run on Linux.
listen_for_commands and read_commands_uds now call komorebi_transport::listen_for_commands and read_commands with NoPolicy (KDE has no read timeouts); WindowManager implements CommandTarget (clone of command_listener under the lock, try_lock_for on the parking_lot mutex, is_paused, process_command). The 3 hand-written loops (accept loop of 40 lines, read loop of 35 lines) are gone from process_command.rs. read_commands_uds keeps its name and signature, so the unit tests still call it. Behaviour-preserving, not a literal text move: the loop is generic and the message is cloned once more on the paused path. Logs now come from the target komorebi::transport instead of komorebi::process_command (D29). The test module needed three imports (BufRead, BufReader, FromStr) that it used to get from the parent through use super::*; no test body changed.
Verified in komorebi-for-kde: cargo check -p komorebi --all-targets: no errors, no warnings; cargo test -p komorebi --lib process_command: 11 passed, 0 failed; tests socket + no_kwin + hot_reload: 1 + 3 + 3 passed, 0 failed. Full workspace run: see the next revision's message.
komorebi-transport gets the accept loop and the read loop that the three daemons each carry a copy of: listen_for_commands (restart-on-panic outer thread, listener cloned under the window manager lock, one thread per client) and read_commands (one message per line, the 1 s try_lock_for on the window manager with the warn-and-drop when it is not got, the pause filter, return after a paused message). The window manager is reached through small traits: CommandTarget (shared handle type, listener handle, try_lock_for, is_paused, process_command), CommandListener/CommandStream (implemented here for std::os::unix::net and, on Windows, uds_windows), and a ConnectionPolicy hook (on_accept, on_message; NoPolicy by default) for the Windows read timeouts. The lock itself is taken by the daemon (CommandTarget::try_lock_for) because KDE uses parking_lot 0.13 and the other trees 0.12, so the crate cannot name the Mutex type (D30). This is a behaviour-preserving generalisation of the loops, not a literal text move. Nothing uses it yet.
The crate logs under the target komorebi::transport: the KDE and macOS daemons filter with RUST_LOG=komorebi=<level>, which would silence a target named komorebi_transport (D29).
Verified: cargo test -p komorebi-transport: 6 passed, 0 failed (5 new: messages in order, paused ends the connection, invalid line is an error, policy sees messages, listener serves a connection over a real socket); cargo clippy -p komorebi-transport --all-targets -D warnings: clean.
Both read_commands_uds and read_commands_tcp now ask komorebi_transport::allowed_while_paused instead of listing TogglePause, State, GlobalState and Stop. The one token that differed between the two copies (process_command(message, stream) in the TCP reader, where stream is already a &mut TcpStream, against &mut stream in the UDS reader) is only how the reply stream is passed: each call site keeps its own form, so TCP behaviour is unchanged. A paused connection still ends after the first message. komorebi-transport becomes a dependency of the Windows daemon.
Verified: nix develop --command cargo clippy --workspace --locked --all-targets -- -D warnings: finished, no warnings or errors (tier 2). Not run: Windows unit tests or scenarios.
read_commands_uds now asks komorebi_transport::allowed_while_paused instead of listing TogglePause, State, GlobalState and Stop in a match. Same behaviour: while paused those four are handled, any other message is dropped with the same trace log, and the connection ends after either. komorebi-transport is added as a path dependency of the macOS workspace.
Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets in komorebi-for-mac: 0 errors (warnings only, pre-existing). Unit tests cannot run on Linux.
read_commands_uds now asks komorebi_transport::allowed_while_paused instead of listing TogglePause, State, GlobalState and Stop in a match. The behaviour is the same: while paused those four are handled, any other message is dropped with the same trace log, and the connection ends after either. komorebi-transport is added as a path dependency of the KDE workspace.
Verified: cargo check -p komorebi --all-targets in komorebi-for-kde: no errors; cargo test -p komorebi --lib process_command: 11 passed, 0 failed (includes while_paused_only_toggle_pause_state_and_stop_are_handled). Full workspace run is done once at the end of the KDE listener stage.
A new platform-neutral crate, crates/komorebi-transport (edition 2024, member of the root workspace), that will hold the command transport shared by the three daemons (D23/D24). It starts with allowed_while_paused(&SocketMessage) -> bool: the four messages (TogglePause, State, GlobalState, Stop) a daemon still handles while it is paused. It is a free function and not a method of the protocol enum because it is daemon policy, not wire format. Nothing calls it yet. A unit test lists the four and checks that other messages are refused.
Verified: cargo test -p komorebi-transport: 1 passed, 0 failed (native, tier 1). The tree gates run in the revisions that adopt it.
Adds section 7 (the seven consequences of plan step 7, each with its supporting citations and a status: CONFIRMED, CORRECTED or TARGET; plus three findings the plan did not list: a batch/transaction scope, the workspace methods that exist only on KDE, and error-type differences) and section 8 (everything not confirmed, with how to confirm it on a Mac, a Windows guest or by reading). Verified against the citations of sections 2 to 6 on wip-main aa52fdc4d9e5. Not verified: see section 8.
Adds section 6: event sources per platform and how they reach the window manager (references the step 5 prep entries rather than redoing them) and the evidence for the 'set_rect returns once requested, the frame is observed later' contract: KDE queued commands with an optimistic table write, macOS arrival.rs, settle.rs and animator verification, Windows live_resize settling. Verified against wip-main aa52fdc4d9e5: K/kwin/mod.rs, K/kwin/state.rs, K/window_manager_event_listener.rs, K/backend/mod.rs, M/arrival.rs, M/settle.rs, M/animation/animator.rs, M/window.rs, M/window_manager_event_listener.rs, W/winevent_listener.rs, W/windows_callbacks.rs, W/live_resize.rs. Not verified: any runtime ordering of events.
Adds sections 4 (identity: id types per platform, what acting on a macOS window from a bare id would need, where each tree keeps per-window platform data, HWND width including an observation of 440 distinct HWNDs from the Windows guest logs) and 5 (coordinates: Rect convention, origin and y direction, DPI and scale handling, shadow and frame compensation, and where each conversion lives). Closes two plan items: Windows HWND width and macOS Retina points versus pixels. Verified against wip-main aa52fdc4d9e5: komorebi-layouts/src/rect.rs, W/window.rs, W/windows_api.rs, W/lib.rs, K/kwin/state.rs, K/kwin/bridge.js, M/window.rs, M/application.rs, M/macos_api.rs, M/core_graphics/mod.rs, M/core/rect_ext.rs, M/border_manager/border.rs, M/animation/ghost.rs, M/animation/capture.rs, and ~/e2e-w0 logs read-only for the HWND range. Not verified: HWND width as a Microsoft guarantee, AX values on scaled-resolution or mixed-DPI displays, negative monitor origins on Windows.
Adds section 3.3: the macOS main thread (AppKit and CFRunLoop loop, what runs there), every other thread with its locks, every DispatchQueue::main exec_sync/exec_async/blocking-channel site with file:line and whether the main-side closure takes the window-manager lock, and a precise statement of the possible event-thread/main-thread deadlock, marked by reading, not reproduced. Verified against wip-main aa52fdc4d9e5: M/main.rs, M/macos_api.rs, M/monitor_reconciliator.rs, M/border_manager/{mod,border,ns_window}.rs, M/animation/{animator,ghost}.rs, M/process_event.rs, M/process_command.rs, M/reaper.rs, M/settle.rs, M/workspace_reconciliator.rs, M/window.rs, M/application.rs, dispatch2-0.3.1/src/queue.rs. Not verified: that NSWorkspace and CG display callbacks arrive on main (Apple behaviour), that CFRunLoopAddSource from a non-main thread is safe, that AXUIElement is thread-safe (the code asserts Send+Sync), and the deadlock itself (needs a Mac).
Adds sections 3.1 (KDE) and 3.2 (Windows): every thread that exists, what it locks, and which threads call the platform API. Closes two items the plan listed as unverified: which threads call backend() in KDE (traced: main at start-up and stop, the event thread, command threads, the monitor reconciliator and its settle thread, and tests through with_backend; never the KWin bridge or the hotkey threads) and which threads call WindowsApi, with the thread-affine subset. Verified against wip-main aa52fdc4d9e5: K/main.rs, K/kwin/mod.rs, K/kwin/hotkeys.rs, K/process_event.rs, K/process_command.rs, K/monitor_reconciliator.rs, K/backend/mod.rs, W/main.rs, W/winevent_listener.rs, W/windows_callbacks.rs, W/border_manager, W/stackbar_manager, W/animation, W/live_resize.rs, W/reaper.rs. Not verified: Microsoft's documented behaviour of WINEVENT_OUTOFCONTEXT and cross-thread SetWindowPos, and every Windows call chain (the table lists thread entry points and the API each reaches, not every path).
Adds section 2: the operation table (one row per operation present on at least two platforms: KDE Backend method | Windows | macOS | semantic differences), the platform-subsystem table, and the re-measured counts with the exact method. Verified against wip-main aa52fdc4d9e5: K/backend/mod.rs, K/kwin/mod.rs, W/windows_api.rs, W/window.rs, M/macos_api.rs, M/window.rs, M/core_graphics/mod.rs, M/lib.rs. Not verified: how each AX call behaves against real applications (needs a Mac), and the counts are of source text, not of executed calls.
Creates docs/dev/seam.md with sections 1 (purpose and how to read) and the corrections list. Verified against wip-main aa52fdc4d9e5 by reading K/backend/mod.rs, K/kwin/mod.rs, K/kwin/state.rs, M/macos_api.rs, M/window.rs, M/arrival.rs, M/process_event.rs, M/process_command.rs, W/windows_api.rs. Counts quoted here are measured in the next revision. Not verified: any runtime behaviour (the document is reading-only).
The root flake got the code of komorebi-for-kde and komorebi-for-mac through two locked path inputs (kfde, kfm), so the root flake.lock pinned the content of those directories and needed 'nix flake update kfde kfm' after any edit under them; a stale pin gave 'attribute lib missing'.
Now the root imports komorebi-for-kde/flake.nix and komorebi-for-mac/flake.nix as plain files and calls their outputs/lib.mkOutputs with inputs declared in the root under the names kfde-* and kfm-* (nixpkgs, nixpkgs-lib, flake-compat, flake-parts, crane, rust-overlay, treefmt-nix, git-hooks-nix, and gitignore for kfm), pinned by revision in the URL to exactly the revisions of each nested flake.lock, with the same follows structure. The nested flakes are unchanged and still have their own locks. The kfde and kfm nodes are gone from flake.lock. When a nested flake.lock is bumped, update the revisions of the matching kfde-*/kfm-* inputs by hand.
Verified (tier 2): derivation paths unchanged before and after for kfde fmt, deny, nextest, schema-fresh, the Windows workspace clippy check, kfde-komorebic and kfm-komorebic (aarch64-darwin, eval only); every narHash of the nested locks is present in the root lock; nix flake check --no-build passes on x86_64-linux; nixosModules, overlays, darwinModules evaluate; kfde-vm has 34 suites.
Merge revision: wip-main (history merges, fixes, step 0 path dependencies, step 1 komorebi-collections, KDE A3 fixes, flake phase 2) and wip-step2 (the komorebi-protocol crate, goldens and the unified SocketMessage used by all three trees). Conflicts in the root Cargo.toml members line, the trees' Cargo.toml dependency tables and the Cargo.lock files are resolved in this revision by keeping both sides' additions.
The root flake.lock pins the content of komorebi-for-kde and komorebi-for-mac (D14 of the flake phase 2 work: the root passes its own self to the nested mkOutputs, and the lock records the nested directories). Their trees changed with the step 1 crate and the crates directory in the source filter, so the pins are updated with nix flake update kfde kfm. Only flake.lock changes.
Delete macOS's SocketMessage, as_bytes and FromStr and its now unused imports, and re-export the crate's SocketMessage from core. process_command stays an exhaustive match: the 41 variants macOS does not handle (33 Windows only, 6 Windows and KDE, 2 KDE only) get one explicit or-pattern arm that writes the 'not supported on this platform' reply and returns before anything else happens. Behaviour change: those variants used to fail to parse on macOS and now parse and are answered that way.
Verified: fast-check macOS (fake CC) cargo check --workspace --all-targets: PASS (0 errors, only the existing komorebi-bar warnings). macOS tests not run (cannot).
The nested flakes cut the repository down to their own tree and the root crates they depend on by path (rootCrates). Step 1 added crates/komorebi-collections, which both trees now depend on, so crates/ must be in that list or the root flake cannot build kfde (and kfm cannot evaluate its sources). Listing the directory rather than each crate means later shared crates (protocol, config, ...) are picked up without another flake change. Verified: see the following progress entry.
Two tests against the fake desktop: ForceFocus, StackbarMode and ToggleTitleBars (Windows only) are answered with 'X is not supported on this platform', and a message KDE handles (Retile) is not.
Verified: cargo test -p komorebi --test unsupported_messages in komorebi-for-kde: 2 passed, 0 failed.
Merge revision: wip-main (history merges, fixes, step 0 path dependencies, step 1 komorebi-collections, KDE A3 fixes) and wip-flake (the root flake builds the KDE package with the whole repository as source, the macOS package evaluates the same way, the root flake no longer requires dirtyRev). The root flake.lock pins the content of the nested flakes, so it is relocked in the next revision.
Delete KDE's SocketMessage, as_bytes and FromStr and its now unused imports, and re-export the crate's SocketMessage from core. process_command stays an exhaustive match: the 34 variants KDE does not handle (33 Windows only, plus PanGesture which only Windows and macOS have) get one explicit or-pattern arm that writes the 'not supported on this platform' reply and returns before anything else happens (no notification to subscribers). Behaviour change: those variants used to fail to parse on KDE and now parse and are answered that way. The doctest of SocketMessage lives in the crate now.
Verified: cargo check --workspace --all-targets in komorebi-for-kde: 0 errors, no warnings; cargo test -p komorebi --lib --test schemas --test rule_commands: 302 + 5 + 6 passed, 0 failed; komorebic static-config-schema byte-identical to schema.json. Full workspace run at the end of the stage.
Merge revision on the integration line: wip-step1 (the komorebi-collections crate and its wiring in all three trees, on top of the step 0 path dependencies) and wip-a3-kde (the KDE path-coupling, test-isolation, dirtyRev and lock-order fixes). No file needed manual resolution. Verification of this merge: not run separately; each side passed its own gates (step 1: Windows clippy, KDE 885 tests, macOS type-check; KDE A3: 895 tests three times).
The root flake no longer re-exports the nested flakes' own outputs. It keeps them as inputs for their pinned nixpkgs, crane and rust-overlay (inputs.<name>.inputs), but calls their lib.mkOutputs with the whole repository (self) as the source, a nested self carrying the root rev, dirtyRev and inputs, and the tree's directory, then re-exports packages, checks (without vm-*), legacyPackages.kfde-vm, nixosModules, overlays and darwinModules from those. flake.lock is updated for the changed nested flakes: the lock pins their content, so it needs 'nix flake update kfde kfm' whenever a file under komorebi-for-kde or komorebi-for-mac changes.
Verified (Linux, x86_64): nix build -L of packages.kfde-komorebic and kfde-komorebi succeed and both binaries run with --help (exit 0); checks kfde-schema-fresh, nix-options-validation, keybindings-fixtures, komorebi-bridge-js, nixos-module-eval, plasma-guests-eval, run-kde-dry-run, run-kde-doctor, komorebi-workspace-fmt, -deny and -nextest build; kfde-komorebi-workspace-toml-fmt FAILS because komorebi-for-kde/Cargo.toml itself is not taplo-formatted (same result running taplo on the file directly; not caused by this change). nix eval of aarch64-darwin kfm-komorebic and kfm-komorebi drvPath print .drv paths (evaluated, not built). Windows clippy and default drvPaths are identical to those before this revision. nix flake check --no-build passes for x86_64-linux. Not verified: any darwin build, kfde clippy/doc, the VM suites.
Delete the Windows SocketMessage, its as_bytes and FromStr (now in the crate) and re-export komorebi_protocol::message::SocketMessage from core, so komorebi::SocketMessage and komorebi_client::SocketMessage keep working. process_command stays an exhaustive match: the two KDE-only variants (ReloadHotkeys, HotkeysState) get one explicit arm that writes the 'not supported on this platform' reply (SocketMessage::not_supported_reply) and returns before anything else happens, so subscribers are not notified either. Behaviour change: those two used to fail to parse on Windows and now parse and are answered that way.
Verified: Windows clippy --workspace --locked --all-targets -D warnings clean; native cargo test -p komorebi-protocol passes. Windows unit tests and e2e not run (cannot on Linux).