Pure formatting, no other change: taplo fmt (default configuration, taplo
0.10.0) over the manifests that the kfm toml-fmt check reported as not
properly formatted: crates/komorebi-bar-core, crates/komorebi-protocol,
komorebi-client, komorebi-daemon, komorebi-for-mac/komorebi and
komorebi-for-mac/komorebic. The other 19 files that check lists were
already clean.
Effect on other platforms: the first four are Windows manifests and
komorebi-protocol is also in the KDE closure. crane's dependency derivation
contains the manifests, so the Windows and KDE dependency derivations and
checks change once with this revision (one cold rebuild of the
dependencies, then stable again).
Verified: taplo fmt --check over the 25 files of the check passes after it
(it failed on exactly these six before).
The commands e2e scenario learns that a command does not exist in a platform only
by running it in a guest (error: unrecognized subcommand, skipped with its name),
about 7.6 minutes per Windows run.
crates/komorebic-core/tests/e2e_sweep.rs reads SWEEP and PRINTED out of
e2e/lib/komorebi_vm/core/scenarios/commands.py (skipped when the e2e library is not
in the source tree) and parses each line with the platform's clap command: every
one is a command of the Windows komorebic, and the macOS one lacks exactly the
eight the scenario would skip there (focus-follows-mouse enable/disable, the
Windows implementation of toggle-focus-follows-mouse, toggle-maximize, the
transparency commands). 3 tests. mirrors: commands / <command> (the command is
understood, for the command line only).
Stays e2e only: that the daemon then answers; the KDE komorebic's own command set.
Verified: cargo test -p komorebic-core --test e2e_sweep, 3 passed (native Linux;
platform independent). No source change.
should_act and should_act_individual exist in the Windows, KDE and macOS
window.rs. Diffed arm by arm: KDE and macOS are byte-identical; Windows
differs only in taking one class instead of a list and in not stripping
`.exe` from the rule id. Strategies, regex lookup, case handling (none),
path handling (as given) and the last-match-wins composite logic are the
same. docs/dev/rule-matching.md has the table and the plan: one shared
implementation in komorebi-config with a single platform flag.
Verified: diff of the extracted functions. Docs only.
BEHAVIOUR (Windows runtime): CycleMoveContainerToWorkspace,
CycleSendContainerToWorkspace, CycleFocusMonitor, CycleMoveContainerToMonitor,
CycleSendContainerToMonitor, FocusMonitorWorkspaceNumber,
MoveContainerToMonitorWorkspaceNumber and SendContainerToMonitorWorkspaceNumber
are one call each of the functions of komorebi_core::command (the text that
moved is the one the Windows arms had byte for byte), and WindowManager
implements MonitorCommandHost by forwarding to its own methods. By
construction the calls are the old ones; marked because it was only
type-checked.
Windows e2e scenarios needed: commands (cycle-move-to-workspace,
cycle-send-to-workspace, cycle-monitor, cycle-move-to-monitor,
cycle-send-to-monitor, focus-monitor-workspace, move-to-monitor-workspace,
send-to-monitor-workspace) with two monitors if the guest has them, and
workspaces.
Verified: Windows cargo clippy -p komorebi-windows --locked --all-targets -D
warnings: PASS. Not run: Windows tests, e2e.
Review finding 5. WindowsBackend::live() failed with WindowGone before
Window::hide, restore, maximize and unmaximize ran, so the bookkeeping those
do to HIDDEN_HWNDS never happened for a dead handle: restore, maximize and
unmaximize always removed the handle from the list (original behaviour), and
a handle hidden before its window died stayed in the list for ever (the
reaper's cache and the border and layout code read it). live() now removes the
handle (forget_hidden, a pure helper) before it returns the early WindowGone,
which callers that need it still get. Every backend operation goes through
live() (hide, restore, minimize, unminimize, maximize, close, raise, focus,
set_rect), so every path cleans up. A hide of a dead window no longer pushes
the dead handle into the list, which the original did and nothing ever removed.
Tests: forget_hidden (pure, native logic) and live() on a handle that is not a
window; they compile here (clippy --all-targets passes) but the Windows crate's
tests cannot run on this host: NOT run.
BEHAVIOUR: dead-window cleanup only. e2e: lifecycle_hidden, commands.
Verified: Windows clippy -D warnings via tools/fast-check PASS.
Pins the cost rule the macOS fix depends on: Registry::insert of a new id runs no
handle's drop, a replaced handle is handed back and dropped only when the
caller drops it, get drops nothing, and remove hands the handle back. A probe
handle counts its drops.
Verified: native cargo test -p komorebi-backend: 40 unit, 7 doc, 1 compile_fail
passed, 0 failed.
BEHAVIOUR (Windows runtime): restores the original read of the title-bar
tables. WindowsPlatform::begin_pass takes REMOVE_TITLEBARS, NO_TITLEBAR
and REGEX_IDENTIFIERS once per placement pass (after the layout is
computed, as the old pass loop did) and place_container reads that
snapshot from Placement::pass, instead of locking and cloning the two
tables for every container, where a configuration reload in the middle of
a pass could give two containers two tables. Reviewer finding F3
(Windows review finding 6).
Windows e2e scenarios needed: layouts, stackbars and title-bar scenarios
(remove-title-bar, toggle-title-bars, no_titlebar rules), config_reload
(a reload while windows are being placed).
Verified: Windows clippy --locked --all-targets -D warnings: PASS; KDE
cargo test -p komorebi-linux (lite env): 664 passed, 0 failed; macOS
fake-CC check: PASS; komorebi-core tests: 30 passed. Not run: Windows
tests, e2e.
tests/state_roundtrip.rs (15 tests) reads the monitors of the e2e fixtures
(Windows kfw-tiled, kfw-stack, kfw-float; KDE kfde-tiled, kfde-stack) into the
shared Monitor<P> with a platform shaped like each daemon (Windows: isize id,
optional serial number, the name/device_id/workspace_names extra; KDE: u32 id,
string serial number, no extra; macOS: window_hiding_position extra), writes
them again and compares the parsed JSON: every fixture is written as it was
read. Also pins that the corner is the last macOS monitor key and cannot be
omitted, that the workspace keys are the same whatever the platform, the exact
set of KDE monitor keys, and which keys an old state file may omit (23 optional
keys at monitor, workspace and container level, e.g. container locked and
workspace layout_options_rules) and which it may not (18 required keys,
including layer, work_area_offset_rules and apply_window_based_work_area_offset:
a file from before those existed does not load; pinned, not judged).
The fixtures are copied into tests/common/fixtures.rs as Rust text because the
nix source filters keep .rs files and drop .json; a test compares the copies with
e2e/lib/tests/fixtures when the checkout has them. The macOS fixture is NOT real
macOS output: it is kfde-tiled reshaped with jq to the macOS window and monitor
shape of the state_pin tests (no Mac here), and says so in its comment; replace
it with 'komorebic state' from a Mac when one is at hand.
Verified: cargo test -p komorebi-core (27 unit + 179 integration passed, 1
ignored) with and without --features schemars; cargo clippy -p komorebi-core
--all-targets has no warning in the crate. Windows clippy and macOS check not run:
the tests are portable crate tests and no platform source changed.
One page with the exact commands for each platform, so nobody has to
reconstruct them from the flakes and the progress notes:
- Windows: nix cross build of the binaries, the crane checks (clippy is the
pre-landing gate), the e2e-tests check, native tests of the neutral crates;
- KDE: cargo check/test with the right package names (the unit tests are in
komorebi-linux, not the thin komorebi binary package), the schema test with
one thread, the kfde-* checks of the root flake, the VM suites with `just vm`,
the tier lists, E2E_ONLY and KOMOREBI_RECORDER for VM runs;
- macOS: cargo build/test/clippy with `-p komorebic -p komorebi -p komorebi-bar`,
never `-p komorebic-macos` together with `-p komorebic`, and the Linux-only
type-check;
- Windows e2e: `nix run .#e2e-windows`, the `bar` scenario, E2E_ONLY, trace,
recorder, KEEP_GUEST, SCALE, STATE, bins from another commit;
- a what-to-run table and the known flakes with counts, summarised from the
flake registry kept by the gate runs (no personal paths).
It also records that komorebi-for-kde/justfile still assumes a KDE-only
workspace (`just check` would build the Windows crates).
Verified by running: `cargo metadata --no-deps` (package names), `cargo check
-p komorebi-linux -p komorebi -p komorebic` in komorebi-for-kde (ok), `nix eval
--json .#legacyPackages.x86_64-linux.vmTiers` (the tier lists match). Other
commands were read from flake.nix, justfiles and the e2e README, not run.
docs/cli lagged behind the Windows komorebic: 35 pages had out-of-date
help text (possible values now listed with their descriptions, new doc
comments, the Scrolling commands without the komorebic.exe usage name) and
3 pages did not exist yet. They are regenerated from the current Windows
CLI definition (komorebic-core docgen-all example, platform windows,
COLUMNS=1000 so nothing is re-wrapped like the existing pages), and the
page conventions of each file are kept: header line only where the page had
one, komorebic.exe as the binary name, trailing newline. The other 149
pages are byte-identical to the fresh output. The KDE and macOS pages are
untouched (decision D20: Windows was the only stale set).
Docs only, no behaviour. Verified: regenerated twice, second compare shows no
diff; the real Windows binary was not run (the pages come from the shared
definition rendered on Linux, class text normalised to the Windows one).
LayoutRatios, Query, NamedWorkspaceRule and InitialNamedWorkspaceRule were
the same code inline on macOS as set_layout_ratios, answer_query,
add_named_workspace_rule and add_initial_named_workspace_rule on KDE
(compared with whitespace removed). The macOS arms call methods with those
names and bodies and are byte-identical to KDE's. No behaviour change. The
other inline macOS arms differ in what they do (ReplaceConfiguration has
the run loop and no warning, ToggleWorkspaceWindowContainerBehaviour,
SessionFloatRule, IgnoreRule, ToggleWorkspaceLayer and ResizeWindowAxis
have other bodies) and stay.
Verified: fake-CC cargo clippy -p komorebi-macos ... --all-targets -D
warnings: PASS (type-check only). Not run: the macOS tests (the Mac Mini).
Plan step 10, S4 for Windows. TRANSPARENCY_ENABLED and TRANSPARENCY_ALPHA are
no longer statics: the Transparency, TransparencyAlpha and ToggleTransparency
commands write settings().shared.transparency with one update, the load
applies the two keys as one update (Windows keeps the value when a key is
absent, unlike KDE), the transparency thread, process_event, window.rs and
the state/config dump read through the accessors.
BEHAVIOUR: ToggleTransparency was a load then a store and is now one update;
a load publishes the two keys together. Gate: Windows e2e (transparency,
config_reload).
Verified: Windows clippy -D warnings --locked --all-targets on
komorebi-windows (cross): clean. e2e not run.
Runs only the checks a jj diff needs (KDE cargo check and tests, macOS type-check, Windows
clippy through the nix dev shell, native crate tests, nix evaluation only) with persistent
target dirs, and prints the time of each. Copy of the host-side script (the original stays
in use outside the repository) with these differences:
- FAST_CHECK_SCRATCH defaults to `${XDG_CACHE_HOME:-$HOME/.cache}/komorebi-fast-check`
instead of a /tmp/claude-1000/... scratchpad path (usage text updated);
- the fake C compiler is `$HERE/cc-fake.sh` (the script directory, resolved with readlink -f)
instead of `$S/kfm/cc-fake.sh`;
- `tools/*` is classified like docs (no check), so a change to the tools alone prints
"nothing to run" instead of listing every file as unclassified;
- the second `case` arm lost the patterns `Cargo.toml | Cargo.lock | .cargo/*`, which an earlier
arm already catches (shellcheck SC2221/SC2222; no change in behaviour);
- header comment: "from anywhere inside a jj workspace of the repository", no mention of komomono.
Everything else is byte-identical (diff against the host copy).
Verified: bash -n and shellcheck clean; `tools/fast-check --list` from this workspace.
Pure formatting, no other change: nightly rustfmt --edition 2024 with
komorebi-for-mac/rustfmt.toml (imports_granularity = Item) over
komorebi-for-mac/**/*.rs and the macOS modules in the shared directories
komorebic/src/macos and komorebi-bar/src/macos. 11 files; the kfm fmt check
of the previous revision reported them. Windows and KDE code is not touched,
and the Windows source filter excludes those macos files, so no Windows or
KDE derivation changes.
Verified: the rustfmt --check command of the fmt check passes on the result
locally; nix eval of drvPath in a throwaway git copy: Windows deps and
clippy, kfde deps, clippy and vm stacks are identical before and after it.
The commands e2e scenario (265 checks, about 7.6 minutes on the Windows gate, a
stall-prone sweep) asserts after each of about 216 komorebic commands that the
daemon is alive, answers state and manages every window. For the commands that
only mutate the model that is not a property of a real OS.
komorebi-for-kde/komorebi/tests/command_sweep.rs sends the SocketMessage of each
model command of the scenario's SWEEP, in its order (focus, move, stack,
resize, promote, flip, layouts, toggles, workspaces, monitors, offsets,
padding, behaviours, rules, scrolling), through WindowManager::process_command
over a FakeBackend with two monitors and three windows, and after each asserts
that every window is still managed (any monitor, workspace, layer), and that the
state query answers JSON. A command may refuse (a direction with no window): only
that refusal is accepted as an error. The sweep runs in 0.2 s.
mirrors: commands / <command> leaves the daemon healthy.
What stays e2e only: komorebic parsing each command and writing that message,
the pointer, files and config reload commands, a command that stalls the
daemon while the socket waits, and everything the real OS does with the windows
(the sweep's healthy check against the OS's windows).
Verified: cargo test -p komorebi-linux --test command_sweep in komorebi-for-kde,
1 passed (native, Linux). KDE daemon only: the Windows and macOS daemons have no
native harness. No source change, no bug found.
The same eight arms as on KDE (they were byte-identical) are one call each of
the functions of komorebi_core::command, and WindowManager implements
MonitorCommandHost by forwarding to its own methods. No behaviour change.
Verified: fake-CC cargo clippy -p komorebi-macos ... --all-targets -D
warnings: PASS (type-check only). Not run: the macOS tests (the Mac Mini).
Reverts 3d2386e3 (review finding 8). The detached latest-wins writer thread
left the file lagging behind the daemon (a command that returned, or stop, could
precede the write, and std::process::exit cut a write in progress), and it
opened and truncated the file in place, so a reader could see it half written.
The file is small and the synchronous write was the original behaviour; the
stall analysis did not show it to be a cause of any hold (the per-step and
lock-holder instrumentation of the same stack will show whether it ever is).
Restoring the synchronous write in update_known_hwnds and the reaper is the
simplest form that is correct: the file is complete when the command returns
and when stop exits.
Behaviour is the original again for the file. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e: lifecycle and commands (the file is
written again before the reply).
BEHAVIOUR (registry only). Review finding 4, the part that can be done where a
window id is known.
Window::observe now registers the windows that are really observed (previous
revision), and a window that closes while its application runs left its entry
until the application quit. WindowManagerEvent::Destroy carries no window id,
but reap_invalid_windows_for_application is where the daemon works out which of
the application's windows are gone, and it already removes them from the
workspace: it now also forgets them in the registry (tiled and floating
alike); the reaper's reap_window did already.
What stays: an observed window that closes without passing through either
(for example one that was unmanaged and then closed, or whose Destroy was not
followed by a reap) keeps its entry (an element, an observer and an inert
application) until its application quits; the table is bounded by the number
of windows the daemon has observed per running application, and a periodic
sweep would cost one Accessibility call per entry under the window manager lock.
Hand check H4 measures the Mach ports held (the one unverified cost: whether an
AXObserver holds a port).
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified: any
run. Verified on the Mini: not yet.
WorkspacePlatform::begin_pass(workspace) is called once per placement
pass, after the layout is computed and before the containers are placed,
and what it returns is handed to adjust_layout and place_container as
Placement::pass (Placement now carries that borrow). A platform that has
something to read once for the whole pass takes it here, so that two
containers of a pass cannot see two different values. The default returns
None. A test with the stub platform pins the order (once per pass, before
the placements) and that the hooks see the answer.
For reviewer finding F3 (S/review/core.md): the Windows title-bar tables
were read once per pass and the shared update read them once per
container; the Windows revision that follows uses this hook.
Verified: cargo test -p komorebi-core --features schemars (native): 30
passed, 0 failed. Not run: the daemons (the next revision builds them).
tests/monitor_workspaces.rs (22 tests) over the recording stub platform:
ensure_workspace_count (grows with default workspaces, never shrinks, leaves
the focus), focus_workspace (last_focused_workspace bookkeeping including
focusing the focused one, creating every workspace up to a focused index past
the end, the empty monitor), the known workspace name (without a known name
names stay; with one only the focused workspace takes it, and an EXISTING
workspace's name is overwritten at every focus although the comment says
only at creation: pinned as it is, inherited from the Windows tree),
remove_workspace_by_idx (index not moved, past-the-end focuses idx-1 creating
workspaces, empty monitor gets a default one), remove_workspaces, add_container
with and without a workspace index and the error cases, the focused layout
only while tiling, and the JSON of last_focused_workspace and a round trip.
Verified: cargo test -p komorebi-core --test monitor_workspaces, 22 passed.
No non-test source changed.
A new reader had no single page that said where things are: three platform
trees, nine shared crates, the four unified packages, the shims that remain,
and which differences are on purpose. The page gives:
- the three trees and what lives in each (root = Windows, komorebi-for-kde,
komorebi-for-mac) and that the root Cargo.toml is the only workspace;
- the packages komorebi (komorebi-daemon, cfg_select! over komorebi-windows,
komorebi-linux, komorebi-macos), komorebic, komorebi-client, komorebi-bar
and their cfg(target_os) layout, and the shim packages until the cutover;
- the crates/ map (protocol, config, collections, transport, backend, core,
settings, bar-core, komorebic-core);
- where the platforms differ on purpose, with a pointer to seam.md,
core-model.md, settings.md, unified-binaries.md, bar-unification.md and
macos-handcheck.md;
- the oracles (wire goldens, config and bar schemas, CLI docs, derivation
drift) and the tiered feedback loops;
- the tools outside the repository (fast-check, mac-check.sh,
kde-closure-check, e2e-needed, gate-lock, ...) with a proposal of which to
commit; nothing was moved.
Statements were checked against Cargo manifests (cargo metadata --no-deps
lists the package names used), flake.nix and the source directories. The
version numbers and the packages list were read from manifests. Not built;
macOS statements are what the progress log says, not observed.
enforce_resize_for_right_vertical_stack said "Zero is actually on the right"
but locked top, bottom and right of resize_dimensions[1], so the main
container (index 0, drawn on the right: arrangement.rs primary_left =
area.right - primary_width) was never constrained and the first stack
container could not be resized at all. Index 0 now loses top, bottom and
right (it can only grow to the left); the stack loop over [1..] is unchanged
(nothing in it goes left, first not up, last not down).
The test that pinned the buggy result is replaced by the previously ignored
test of the intended behaviour, un-ignored and extended to 1 to 4 tiles:
[l, rb], [l, rb, tr], [l, rb, trb, tr].
BEHAVIOUR (all three daemons share this function): resizing in the
right-main-vertical-stack layout changes. Gate: Windows e2e resize
scenarios; the ones that run in right-main-vertical-stack are none by name
(resize_commands uses the default layout; layouts.py and commands.py only
tile and cycle through right-main-vertical-stack), so a pointer or
resize-edge scenario in that layout would need adding.
Verified: cargo test -p komorebi-core, with and without --features schemars,
all pass; no e2e run.
Part of the router converge between KDE and macOS: CycleFocusWorkspace,
CycleFocusEmptyWorkspace, CloseWorkspace, MoveContainerToLastWorkspace
(and SendContainerToLastWorkspace, which is the same method with
follow = false), EagerFocus and BorderColour were the same lines inline on
macOS as the methods cycle_focus_workspace, cycle_focus_empty_workspace,
close_workspace, move_container_to_last_workspace, eager_focus and
set_border_colour on KDE (compared with the arms' text, apart from where
rustfmt wrapped a line). The macOS arms now call methods with those names
and bodies; the arms are byte-identical to KDE's. No behaviour change.
Verified: fake-CC cargo clippy -p komorebi-macos -p komorebic-macos -p
komorebi-client-macos -p komorebi-bar-macos --all-targets -D warnings:
PASS (type-check only). Not run: the macOS tests (the Mac Mini), KDE and
Windows gates (no KDE or Windows file changed).
tests/reload.rs: transparency is kept by a load without the key when the
daemon passes the keys as they are (Windows) and reset to false and 200 when
it passes unwrap_or (KDE); an animation block with a per-kind map replaces
the map and leaves the global flag, a load with no block keeps everything, a
global flag clears the map and a block without fps resets fps to 60. Test
only.
Verified: native cargo test -p komorebi-settings: 18 unit + 5 integration
passed.
macOS cannot be built or linked on the Linux host; the way to type-check it is
`cargo check --target aarch64-apple-darwin --all-targets` with a fake C compiler so the
C -sys crates' build scripts succeed. That compiler was only a scratchpad file outside the
repository and mac-check.sh hardcoded a workspace path.
tools/cc-fake.sh: verbatim copy of the scratchpad cc-fake.sh (emits an empty object for
every compile, hands -E to the real gcc). No difference.
tools/mac-check.sh: new copy of the old script with these differences:
- no hardcoded `cd /home/jado/komomono-work/ws-step4/komorebi-for-mac`: the root comes from
`jj root` (fallback `git rev-parse --show-toplevel`);
- the fake CC is `$HERE/cc-fake.sh` (next to the script) instead of `$S/kfm/cc-fake.sh`;
- the target dir is `${FAST_CHECK_SCRATCH:-${XDG_CACHE_HOME:-$HOME/.cache}/komorebi-fast-check}/target-fast-mac`
instead of a /tmp/claude-1000 scratchpad;
- in the merged tree (komorebi-for-kde has its own Cargo.toml only in the old layout) it checks the
packages fast-check checks (-p komorebi -p komorebi-macos -p komorebic-macos
-p komorebi-client-macos -p komorebi-bar-macos) from the root; with the old separate workspace it
keeps `cd komorebi-for-mac` and --workspace;
- /bin/sh became bash with `set -euo pipefail`; the old script's omission of --locked is kept
(pass it as an extra argument).
Verified: bash -n and shellcheck clean. Not run: the check itself needs nix and the toolchain build.
The kfm fmt check ran stable `cargo fmt -p ...` on the stubbed workspace
source and failed twice: rustfmt follows the `mod windows;` of the shared
entry files (komorebi-bar, komorebi-client; their windows modules are not in
the macOS source), and the stable rustfmt ignores the nightly options of
this tree's rustfmt.toml. The check is now a runCommand: the nightly rustfmt
(already in the flake for treefmt) with --edition 2024 (the edition of the
macOS manifests; cargo fmt uses it too) and komorebi-for-mac/rustfmt.toml,
over komorebi-for-mac/**/*.rs, komorebic/src/macos, komorebi-bar/src/macos and
komorebi-client/src/macos.rs. The entry files of the shared crates are not
checked; their macos modules are. The macOS code is not clean under it: the
next revision formats it.
Verified: the command reproduced locally with the nightly rustfmt (11 files
differ). The nix attribute is evaluated in the final eval table. Not built.
The rules, rules_class, rules_exe, manage_rules and title_rule e2e scenarios
need a real window to decide WHICH window a rule catches; that decision is the
pure should_act / should_act_individual of the daemon, which no existing test
exercised strategy by strategy (the KDE tests only add a rule or two).
komorebi-for-kde/komorebi/tests/rule_matching.rs adds 13 tests: Equals,
StartsWith, EndsWith, Contains and the four DoesNot* strategies over title,
class, exe and path; each kind reads only its own part of the window; Regex with
and without a compiled regex and over several classes; the .exe suffix of an id
is ignored; no strategy and Legacy keep the old semantics; simple and composite
rules; the last matching rule wins; no rules match nothing; a rule by title
follows the title asked about; an ignore rule keeps a window out and a manage
rule rescues one (through SocketMessage::IgnoreRule / ManageRule and a
FakeBackend desktop). Each test names the e2e check it mirrors.
What stays e2e only: that the daemon evaluates rules when a window opens and not
when it is renamed, that the window then lands on the right workspace and is put
away or shown, and the title, class and exe the real OS reports. The rule
matching exists once per platform (no shared function in komorebi-config), so
this covers the KDE copy only; the Windows and macOS copies stay unproven natively.
Verified: cargo test -p komorebi-linux --test rule_matching in komorebi-for-kde,
13 passed (native, Linux). No source change, no bug found.
The arms CycleMoveContainerToWorkspace, CycleSendContainerToWorkspace,
CycleFocusMonitor, CycleMoveContainerToMonitor, CycleSendContainerToMonitor,
FocusMonitorWorkspaceNumber, MoveContainerToMonitorWorkspaceNumber and
SendContainerToMonitorWorkspaceNumber are one call each of the functions of
komorebi_core::command (their bodies moved there, unchanged), and
WindowManager implements MonitorCommandHost by forwarding to its own methods.
No behaviour change.
Verified: KDE cargo test -p komorebi-linux (lite env): 678 passed, 0 failed.
Not run: VM suites.
Review finding 4 on the stall fix.
- BAR_RUNNING was a process-wide static written by on_message and read by
whichever replace-configuration ran next: a dropped message (paused, lock not
acquired) left a stale answer, and two connections overwrote each other. It
is now a thread_local Cell<Option<bool>>: the per-connection thread that
reads a message (on_message) and then handles it (inside try_lock_for) is the
same thread, every message read replaces the cell (None unless it is a
ReplaceConfiguration), and replace_configuration takes it. TCP clients never
set it and the handler scans for itself, as before.
- The bar section of the config is read before the thread is spawned and its
error is returned to the client as it was (the original read it after a
successful Stop-Process, which cannot fail differently: the same file was read
successfully at the top of the command); only the PowerShell work moves to
the thread (restart_bars takes the bar configuration, no longer a path).
- The restart thread's handle is kept in BAR_RESTART; finish_bar_restart() joins
it and is called before process::exit in WindowManager::stop and in the
ctrl-c path of daemon.rs, and by the next replace-configuration, so komorebic
stop (which stops the bars after the daemon is gone) cannot be followed by a
bar that the restart thread starts late.
BEHAVIOUR: as the earlier revision (the reply no longer waits for the bars), plus
stop now waits for a running restart. Gate needed: Windows e2e commands and
config_reload; manual: replace-configuration then stop with a bar running.
Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run.
BEHAVIOUR (registry only). Review finding 3.
process_event returned at 'if self.is_paused' and at the space-id mismatch before
reaching the Destroy arm where forget_pid was, so NSWorkspaceDidTerminateApplication
seen while paused (a locked screen pauses, so does toggle-pause) or on another space
was discarded and the entries of that pid stayed for a process that reuses it.
The forget_pid call is now the first thing process_event does for that
notification, with a comment, and the Destroy arm keeps the rest as it was (the
enhanced-UI forget there is pre-existing and not moved). forget_pid takes only
the registry's own lock: it does not take the window manager lock or dispatch to
the main queue.
Test (Mac): forget_pid removes the windows of that pid and no others.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified: any
run; a WindowManager-level test of the paused case needs the process_command.rs
harness and is left to the Mini. Verified on the Mini: not yet. Hand check: H6.
Workspace::remove_floating_window calls the hook before it takes the
window out of the ring (the KDE and macOS originals move the focus to the
previous floating window first, and the focus index moves back by one
whatever the length), but the hook was named after_floating_removed and its
doc said after. Name and doc now say before; the behaviour is the one KDE
and macOS had. KDE's and macOS's implementations are renamed with it (the
only users; Windows keeps the no-op default). A stub test pins the order:
the hook sees both floating windows when one is removed.
Reviewer finding F2 (S/review/core.md). No behaviour change.
Verified: cargo test -p komorebi-core --features schemars (native): 30
passed, 0 failed; KDE cargo test -p komorebi-linux (lite env): 664
passed, 0 failed; Windows clippy --locked --all-targets -D warnings:
PASS; macOS fake-CC check: PASS. Not run: VM suites, Windows e2e.
tests/update_shared.rs (34 tests) over the recording stub: the exact call log
for plain tiling (begin_update, containers_pruned with the old focus index,
adjust_layout then place_container per container, end_update with the around
and viewport arguments, guard dropped last), monocle (place_monocle with the
work area less workspace, container, border offset and border width padding;
no end_update), maximized, monocle beating maximized, scrolling (adopt widths,
scrolling_layouts, hidden flags into place_container, again), empty, tile off,
a skipped begin_update, end_update returning Again (pass numbers, the places
repeated, begin and prune once). Error policy per hook: begin_update,
place_container, place_monocle, maximize_in_layout and end_update errors all
propagate; the guard is still dropped; a failing place_container leaves
latest_layout and the resize vector untouched while a failing end_update has
already kept the layout. Also the layout rules (highest threshold wins and
sticks), container behaviour rules (none reached clears it), work area offset
priority (rule, workspace, monitor; monocle counts as one), the window-based
offset limit, paddings (workspace Some(0) wins over the monitor), resize vector
resizing (not while monocle) and constraint enforcement before layout.
Verified: cargo test -p komorebi-core --test update_shared, 34 passed. No
non-test source changed.
The documents in docs/dev were written at different points of the
consolidation and some of their statements are history (for example
unified-binaries.md still says "never write -p komorebi", true before step 8).
Each now opens with a "Status (wip-cand4)" line saying whether it is design,
evidence or a log, what has landed, what has not, and, for
unified-binaries.md, which part is superseded.
The statuses were taken from the revision list wip-main..wip-cand4 and the
progress log, not from re-measuring. Only the line under the title was added;
no existing text changed. Not built.
Both daemons' window_manager.rs read the focused window's id the same
way: `foreground_window_id()` from their own window.rs (KDE's is the
backend query it already had there; macOS gets the one-line wrapper of
MacosApi::foreground_window_id). The inline `backend().foreground_window()
.and_then(WindowId::to_u32)` chains on KDE and the `MacosApi::` calls on
macOS go, which is the first step to the same text in the two files (the
Windows one is not touched). No behaviour change.
Verified: KDE cargo test -p komorebi-linux (lite env): 664 passed, 0
failed; fake-CC cargo clippy -p komorebi-macos -p komorebic-macos -p
komorebi-client-macos -p komorebi-bar-macos --all-targets -D warnings: PASS
(type-check only). Not run: the macOS tests (the Mac Mini), VM suites.
Plan step 10, S5 for macOS. The seven ANIMATION_* statics are gone. The
Animation, AnimationDuration, AnimationFps and AnimationStyle commands each
write settings().shared.animation with one update (global value clears the
per-prefix map, a prefix inserts one entry); the animation block of a load is
one update through SharedDelta::apply (global clears the map, a map replaces
it, a block without fps has the default, no block keeps everything).
animation::motion_for reads enabled, duration and style from one snapshot
(Animation::motion_for) where it read three separate statics, and
frame_period reads fps from settings. The suspend() counter
(ANIMATIONS_SUSPENDED) is runtime state and stays as it is: it is the model
for the KDE and Windows guards. The test-only AnimationsOn helper in
window_manager.rs writes through settings().
BEHAVIOUR: the animator, lane and border threads no longer see a half-applied
animation reload or command (they can no longer mix the enabled flag of one
configuration with the duration or style of another), and a load publishes the
block once. Gate: macOS hand check (animation section of the hand-check list).
Verified: macOS fake-CC cargo clippy --locked --target aarch64-apple-darwin
-p komorebi-macos --all-targets -- -D warnings: clean. Nothing run on a Mac;
value semantics rest on the settings crate tests (merge, reset of fps, global
clears the map) and the KDE tests that exercise the same delta.
The kfm clippy check failed with: couldn't read
komorebi-for-mac/komorebi/src/../../komorebic/fixtures/pan3-{long,flick,slow}.transcript.txt.
The macOS tests include_str! them, and the source filter drops .txt files
(craneLib.filterCargoSources), as the Windows filter did before its own fix.
The filter now keeps files under a komorebic/fixtures directory.
Verified: the kfm deny drvPath still evaluates (shared source filter); the
clippy attribute needs a darwin builder, so it is not verified here.
The layouts, flipping, layout_flip, padding, tiling and closing e2e scenarios
assert, among other things, that each layout puts one tile per window inside
the work area, none over another, that a flip mirrors the layout and that
container padding shrinks each tile. That is arithmetic of komorebi-layouts and
needs no window manager.
komorebi-layouts/tests/layouts_everywhere.rs runs the eight layouts of the
layouts scenario over three work areas (one off the origin, one with negative
left), 1 to 12 windows and paddings none/0/10/30, and asserts: one tile per
window; inside the area; no overlap; tiles fill the area exactly (all but
grid); fewer windows give a tile at least as big; one window has the area less
padding; padding shrinks every tile; the three flips equal the unflipped tiles
mirrored as a set; a vertical flip only moves tiles up or down. Each test names
the e2e checks it mirrors.
What stays e2e only: that a daemon hands these rectangles to the OS, and that
the OS frames agree (borders, client rounding, timing, the layouts scenario's
wait for the windows to settle).
Verified: cargo test -p komorebi-layouts --test layouts_everywhere, 8 passed
(native, Linux). No source change, no bug found.
Eight arms' worth of the router as functions of komorebi_core::command:
cycle_move_container_to_workspace (the move and the send arm, by follow),
cycle_focus_monitor, cycle_move_container_to_monitor (move and send),
focus_monitor_workspace_number and move_container_to_monitor_workspace_number
(move and send). They need five more operations of the window manager, in
a second trait MonitorCommandHost: CommandHost (mouse_follows_focus,
update_focused_workspace, direction_from_monitor_idx,
move_container_to_monitor, focused_workspace_idx), so the daemons that
implement only the first trait still compile. The text is the KDE text,
which Windows and macOS have byte for byte. tests/commands.rs mirrors the
e2e checks of commands.py: cycle-move-to-workspace and cycle-send-to-workspace,
cycle-monitor (the wrap), cycle-move-to-monitor and cycle-send-to-monitor,
focus-monitor-workspace, move-to-monitor-workspace and
send-to-monitor-workspace.
Verified: cargo test -p komorebi-core --features schemars (native): the
commands test file 14 passed, 0 failed (the rest of the crate unchanged).
Not run: the daemons (nothing calls the functions yet).
Reverts 4bdda86f. A write timeout can deliver a truncated JSON document: part
of the notification is written, the write then fails with TimedOut, and the
subscriber, which stays subscribed, reads the prefix followed by the next
notification. It also does not bound the stall: nothing evicts the subscriber
(each push to it waits another second under the window manager lock), the
connect has no timeout (uds_windows offers none), and that Winsock honours
SO_SNDTIMEO on AF_UNIX sockets is unverified. The transport change and the
Windows connect closure are both reverted, including the skip-on-timeout test
(the connect parameter of notify_sockets was already there and is unchanged).
Follow-up, not done: an eviction policy for a subscriber that does not take a
notification, together with a timeout that was verified on Windows (or a
non-blocking write with a per-subscriber queue). Decision D-coord-10.
Behaviour is back to cand4's predecessor (no timeout). Verified: tools/fast-check
(native, Windows clippy -D warnings) PASS; e2e not needed beyond commands.
BEHAVIOUR (registry only; the reaper notification that Window::drop already
sends is the pre-existing behaviour and is untouched). Review finding 2.
Window::drop runs for every clone, including the one State::from makes of each
window on every command and event notification, and alive() is false for any
failed Accessibility call (a busy or launching app, a modal animation). The
registry forget that the registry revision put there therefore made a
transient failure drop the entry of a live, managed window. It was redundant
with the places that really know a window is gone (reap_window, and forget_pid when
an application quits), so it is removed and a comment says why.
Test (Mac): registering a window and dropping a clone of it leaves the entry.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified: any
run. Verified on the Mini: not yet. Hand check: H7, and H3 (kill -STOP an app,
focus around it: its windows must stay managed).
Candidate 4: wip-cand3c (core line with macOS on komorebi-core, HideSpot, settings S1-S3, bar e2e scenario, handover scenario fix), wip-u-core3 (shared Workspace update_shared and the Windows converge of window_manager/process_command), wip-u-stallfix (lock-holder instrumentation, sysinfo scan before the lock, bar restart and hwnd file off the lock, subscriber write timeout) and wip-u-pkg2 (one komorebi package and binary, daemons as libraries). Conflicts, if any, are resolved here.
tests/workspace_layers.rs (33 tests): monocle toggle, reintegration (index
restore, padding past the end), cycling and its wrap; new_floating_window from
a container, a stack, the monocle and the maximized window (unmaximize hook, the
failure leaving the window maximized); floating removal and the
after_floating_removed hook; the layer enum (default, Display, JSON) and that the
shared code never changes it; Workspace::hide order (floating from the back at the
window spot, containers at the display spot, maximized, monocle) with the error
policy: a floating or container window that will not hide is skipped, a maximized
one is an error that stops before the monocle.
tests/resize_constraints.rs (11 tests): the sides each default layout leaves
adjustable for 1..4 containers, None tiles, and no containers.
BUG FOUND (one ignored test): enforce_resize_for_right_vertical_stack indexes
resize_dimensions[1] where its own comment says zero is on the right, so the main
container is never constrained and the second may not be resized at all; this is
inherited unchanged from the Windows tree. The current behaviour is pinned by a
passing test and the intended one by an #[ignore = "bug: ..."] test.
Verified: cargo test -p komorebi-core --test workspace_layers --test
resize_constraints: 33 and 10 passed, 1 ignored. No non-test source changed.
COMPARE.md is a snapshot of kfw 173aa802 and kfm 125a9a5 (2026-10-27), before
the commands, messages and configuration types moved into crates/. Its
generated tables count duplicated definitions that no longer exist, and the
generator cannot read the new layout: running it against this tree
(`--kfw .. --kfm ../komorebi-for-mac --kfde .`) stops with "cannot find
^enum SubCommand" because the command definitions are in crates/komorebic-core.
Rather than regenerate tables that would be wrong, the document gets a STALE
banner naming the snapshot, the reason and where the current description is
(docs/dev/ARCHITECTURE-UNIFIED.md, core-model.md), and the script docstring
says it must be ported or retired. No tables were rewritten.
Verified: ran the script as above (fails as described); the script still
parses. Not built. Executable mode of the script is unchanged.
Plan step 10, S5 for KDE. The seven ANIMATION_* statics are gone. The
Animation, AnimationDuration, AnimationFps and AnimationStyle commands each
write settings().shared.animation with one update (a global value clears that
setting's per-prefix map, a prefix inserts one entry, as before); the
animation block of a load is one update through SharedDelta::apply (a global
value clears the map, a map replaces it, a block without fps has the default,
no block keeps everything); movement_animation and movement_style read one
snapshot (Animation::motion_for).
The seven commands that rearrange a stack (StackWindow, UnstackWindow,
StackAll, UnstackAll, CycleStack, CycleStackIndex, FocusStackWindow) used
ANIMATION_ENABLED_GLOBAL.swap(false) and store(restore), which overwrote a
reload or command that ran in between, and was skipped by an early return.
They now hold settings::animation_off(): Handle::scoped on the global enabled
flag, which puts the previous value back on drop only if the field still holds
false (a change made meanwhile wins, an early return still restores). Same
scope as before: the global flag only, not the per-animation map.
BEHAVIOUR: (1) one publish per load / command; (2) the restore no longer
clobbers a concurrent change; (3) an error return in a stack command now
restores the flag. Gate: KDE VM suites that stack windows (stacks, animation).
Verified: KDE cargo test --locked -p komorebi-linux --lib --tests (lite
env): 58 binaries, 623 passed, 0 failed; the existing tests animation.rs,
animation_config.rs (reload: global versus per-kind, fps default) and
animation_stack.rs (animation back on after each stack command) read through
settings(). VM suites not run.
The first darwin build of the root flake failed in komorebi-workspace-deps:
rustc 1.92.0 is not supported by sysinfo@0.39.6 (requires rustc 1.95).
rust-toolchain.toml says channel = stable, and kfm-rust-overlay was pinned
to 1d3f83ba (January 2026), whose stable is 1.92.0, while the unified lock
now has sysinfo 0.39/0.40 and parking_lot 0.13 (rust-version 1.95, the
highest in the macOS and the KDE closures by cargo metadata).
kfm-rust-overlay (flake.nix, flake.lock, and the pin in
komorebi-for-mac/flake.lock) now uses 19ecdd08, the revision the root
flake's own rust-overlay and kfde-rust-overlay lock; its stable is 1.99.1.
kfm-nixpkgs and every other input are unchanged.
Verified (nix eval of drvPath, throwaway git copy before/after): the
Windows deps, clippy and nextest, and the kfde deps, clippy, nextest and
VM suite stacks are identical; kfm deny, fmt and toml-fmt change (the
toolchain). rust-bin.stable.latest version evaluated: 1.99.1 at the new
rev, 1.92.0 at the old one. Not verified: the darwin clippy, nextest and
deps drvPaths cannot be evaluated on this Linux host (the stub source is a
derivation the host cannot build); no build run.
The four navigation methods of the macOS window manager (the ones that
were already the KDE text) call the functions of komorebi_core::command, the
FocusLastWorkspace arm is `self.focus_last_workspace()` (a new method that
calls the shared function; the macOS arm had the pointer preamble commented
out, which is the host default), and WindowManager implements CommandHost by
forwarding to its own methods. No behaviour change.
Verified: fake-CC cargo clippy -p komorebi-macos -p komorebic-macos -p
komorebi-client-macos -p komorebi-bar-macos --all-targets -D warnings: PASS
(type-check only). Not run: the macOS tests (the Mac Mini).
BEHAVIOUR (what is registered, and when; nothing reads the registry yet
except the unused MacosBackend). Review findings 1 (cost) and 6 (wrong
observer).
Window::new created a fresh AXObserver and registered the window each time,
so one event registered up to three constructions on the event thread under the
window manager lock (the attach-check, the re-check and the managed one), each
replacing the last, and the managed window's attached observer (the one
window.observe put on the run loop) was replaced by the third throwaway's
unattached one; window_by_title at start-up made n x n of them for an
application with n windows. Registration now happens in Window::observe, after
add_observer_to_run_loop succeeded: a Window made only to ask an app something
is never observed and never registered, the registry holds the observer that is
really attached, and a window is registered once (process_event.rs after
should_manage, and macos_api.rs at start-up). The decision is documented in
ax_registry.rs in the docs revision of this stack.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified: any
run. Verified on the Mini: not yet. Hand checks: H3 (start-up with a many-window
app: time to ready), H7 (native tabs).
Gate candidate 3c: wip-cand3b (cand3 + the bar e2e scenario) plus wip-u-kdefix (handover precondition in both copies of the shared e2e lib, KDE vm-commands bring_back step). The shared e2e/lib handover scenario is also what the Windows runner runs, so the Windows gate must include it.
notify_subscribers connects to every subscriber socket and write_all()s the
notification with the window manager locked (every command, the reaper and
the event thread), with no timeout: a subscriber that stops reading stalls the
lock holder, and with it every thread.
komorebi_transport::notify_sockets skips a subscriber whose write fails with
TimedOut or WouldBlock (warns, keeps it subscribed, goes on to the next);
every other write error still aborts as before. The timeout itself is the
caller's: the connect closure passed by the Windows daemon sets a 1 s write
timeout on the stream. KDE and macOS pass connect closures without a timeout,
so nothing changes for them. A new unit test covers the skip. The connect
itself cannot be bounded (uds_windows has no connect timeout), and the
listener's lock wait is untouched.
BEHAVIOUR: a Windows subscriber that does not read for a second misses that
notification instead of blocking the daemon. Gate needed: Windows e2e commands
and config_reload, the lock stress, subscriber scenarios if any. Verified:
native cargo test -p komorebi-transport 14 passed (incl. the new test);
tools/fast-check native, Windows clippy -D warnings and KDE check + lib tests
PASS; macOS type-check run by hand (fast-check's macOS step fails to select
a package on this merged tree) PASS. e2e not run.
tests/workspace_containers.rs (41 tests) over the recording stub: where a new
window goes (empty, after the focused container, scrolling hook index,
preselection, every initial placement rule incl. the 1-based index and its
fallback), resize-slot bookkeeping on insert and remove, locked containers
keeping their index on insert, swap and promote, the note_scrolling_departure
hook before a removal, the focus index after remove_container (idx-1 of the
FOCUSED container, not of the removed one), stacking (move_window_to_container)
and unstacking with the exact hide/restore call order and the hide spot passed,
focus by window, window lookup across containers, monocle, maximized and
floating windows, location_from_exe order, visible_windows order, directions
with and without layout flip, cycling and the pointer lookup.
Verified: cargo test -p komorebi-core --test workspace_containers, 41 passed.
No non-test source changed.