Commit Graph
2824 Commits
Author SHA1 Message Date
LGUG2Z 730f12e719 docs(core): section 22, what the macOS deep dedup did and why update is not adopted
Records the container API unification (ContainerExt gone, Workspace::hide_spot), the nine
window manager functions that are now identical on KDE and macOS (76 of 92 shared
function names identical, 1521 of KDE's 2713 stripped lines: 56%), the five router arms
that became methods, the four that stay macOS's, and the exact differences between
the macOS update and update_shared (a scrolling workspace returns early and skips the
resize-dimensions fix-up and places the windows itself; the SkyLight batch is wider; the
rest folds with hooks), which is why update is not adopted without the owner's decision.

Verified: documentation only.
2026-11-05 15:03:26 -08:00
LGUG2Z 008c112964 refactor(mac): five router arms are methods with the KDE names
Deep dedup D-coord-13 (3), the part that is a move. BEHAVIOUR (a pure move; type-checked
and clippy-clean with the fake CC).

The inline arms of ToggleWorkspaceLayer (88 lines), ResizeWindowAxis (59),
SessionFloatRule, IgnoreRule and ReplaceConfiguration in process_command.rs become the
methods toggle_workspace_layer, resize_window_axis, add_session_float_rule,
add_ignore_rule(identifier, &str) and replace_configuration(&Path) (KDE's is &PathBuf, which clippy::ptr_arg flags) of the same
names as KDE's, with the bodies the arms had (de-indented, ending in Ok(())); the router
arms are now the same text as KDE's. Two spellings changed because the KDE
signature has them: the ignore rule's id is a &str (compared with ==, copied with
to_string()), and replace_configuration takes the run loop from self as the arm did.

What stays macOS's own and is not moved, because the body is the platform's:
Minimize and Close (AdhocWindow on the foreground element), DebugWindow and
ManageRule (role against class; no KDE method to match yet), and the macOS
bodies of the five moved methods (the role in the session float rule, the run loop in
replace_configuration, the animation suspension in resize_window_axis): they are
the methods' own differences now, behind the same names.

Verified: fast-check macOS PASS; fake-CC cargo clippy -p komorebi-macos
--all-targets -D warnings clean. Not verified: any macOS test or run. Verified on the
Mini: not yet. Hand check row added to docs/dev/macos-handcheck.md.
2026-11-05 15:03:26 -08:00
LGUG2Z 0373d7f0b4 refactor(kde): the nine container functions of the window manager have the macOS text
Deep dedup D-coord-13 (2), the KDE side (kfde had not edited it; no other KDE
revision touches these functions). add_window_to_container, cycle_container_window_in_direction,
cycle_container_window_index_in_direction, focus_container_window, stack_all,
monocle_on, monocle_off, cycle_monocle and transfer_window are replaced by the macOS
text: 'let spot = workspace.hide_spot(); container.load_focused_window(spot)?;'
(and hide(None, spot)?, restore()?) where KDE had 'let _ = container.load_focused_window(())'.
The shared form is ?, which is equivalent here: the KDE window operations always answer
Ok, so no ? ever returns; hide_spot() is () on KDE. The functions are now byte-identical
in the two daemons (checked with the function splitter diff: no changed line).
The binding of a () value is allowed for the file with a comment
(clippy::let_unit_value) because the point is the identical text.

BEHAVIOUR: none intended (the ? cannot fail), so the gate is to confirm that.
Gate for the coordinator: KDE fast tier and VM scenarios that stack, unstack,
cycle a stack, monocle on and off and cycle, move a window to another workspace.

Verified: KDE cargo check + lib tests (fast-check) PASS; cargo clippy
-p komorebi-linux --all-targets -D warnings shows only errors that predate this
revision (a ptr_arg in process_command.rs:456 and useless conversions in
kwin/mod.rs), none in these files. Not run: the VM.
2026-11-05 15:03:26 -08:00
LGUG2Z a478495049 refactor(mac): the daemon uses the shared Container API with the hide spot
Deep dedup D-coord-13 (1), the container API. BEHAVIOUR (type-checked and
clippy-clean with the fake CC; the macOS tests are the oracle).

ContainerExt is deleted. Its four methods were the shared Container's with
the monitor's corner as an argument; every call (about 28 sites in
window_manager.rs, process_event.rs, scrolling.rs, workspace.rs, monitor.rs) is now
the shared one: add_window(window, spot), load_focused_window(spot), hide(omit,
spot), restore(), with spot = workspace.hide_spot() (MacosPlatform::hide_spot:
the workspace's corner, no display, which is what the old calls passed;
hide_on's screen argument was None at every remaining caller; the whole-workspace
hide with the display is Workspace::hide, already shared). The nine window
manager functions that differed from KDE's only in these calls (add_window_to_container,
cycle_container_window_in_direction, cycle_container_window_index_in_direction,
focus_container_window, stack_all, monocle_on, monocle_off, cycle_monocle,
transfer_window) now differ from KDE's text only in the spot and in the
error policy (let _ against ?), which the next revisions remove.

Two things change at run time, both small: monocle_on and cycle_monocle took the
corner from the monitor (monitor.extra.window_hiding_position) and now take it
from the workspace's state, which the monitor writes into every workspace when it
updates their globals, so they differ only if a workspace's globals are stale
(a config reload without a layout update in between); and Container::restore
skips the Accessibility call under cfg!(test), as hide and load_focused_window
already did.

Verified: fast-check macOS PASS; fake-CC cargo clippy -p komorebi-macos
--all-targets -D warnings clean. Not verified: any macOS test or run.
Verified on the Mini: not yet. Hand check row added to docs/dev/macos-handcheck.md.
2026-11-05 15:03:26 -08:00
LGUG2Z 401ce9112a refactor(core): Workspace::hide_spot and hide_spot_on_display as methods
Convenience for the callers that have a workspace and no platform type to name
(the window manager functions, which are the same text on KDE and macOS): the
same as P::hide_spot(self) and P::hide_spot_on_display(self). Nothing calls them
yet in the KDE and Windows daemons; no behaviour change.

Verified: native cargo test -p komorebi-core passes; fast-check all trees PASS.
2026-11-05 15:03:26 -08:00
LGUG2Z 176dc0a8ba test(core): make the command tests clean under clippy -D warnings
komorebi-core is in the workspace default-members since the review fixes, so a bare clippy --all-targets -D warnings now covers its test files. crates/komorebi-core/tests/commands.rs (wip-u-cmd) had two findings that only show there: an unused Result of new_container_for_window (now unwrap()ed: the stub window cannot fail) and a never-read field pointer_for_all (removed: the Windows switch is tested through the associated const in its own host type). No behaviour change; verified: cargo test -p komorebi-core and the Windows clippy (bare, default-members).
2026-11-05 15:03:26 -08:00
LGUG2Z e870eca239 chore(repo): combine candidate 6 with the shared rule matcher, the stall fixes, the bar scenario fix and the shared commands (candidate 7)
Candidate 7: wip-cand6 plus wip-u-rulematch (one window-rule matcher in komorebi-config), wip-u-stall2 (lock-holder guard, should_manage before the lock, reaper unlock, heartbeat), wip-u-bar3 (bar e2e scenario fix, skip when the guest cannot draw, bar config tests) and wip-u-cmd (komorebi_core::command: 16 shared router arms). Conflicts, if any, are resolved here.
2026-11-05 15:03:26 -08:00
LGUG2Z 2d6919438b perf(nix): keep the dependency derivations independent of the source files
cargoLock, cargoToml and the vendor directory of the three flakes were taken
as "${real}/Cargo.lock" and crane.vendorCargoDeps { src = real; }. A string
that names a file inside the filtered source carries the whole source in its
context, so every edit of any file in it (a .rs file, a doc) changed the
dependency derivation (komorebi-workspace-deps, about 1000 crates) and the
dependencies rebuilt on every change: the constant COMMIT_HASH alone did not
help once the stubbed workspace source was introduced.

The lock and the root manifest are now builtins.path copies of those two
files (lockFile, tomlFile) and the vendor directory is made from the lock
(vendorCargoDeps { cargoLock = lockFile; }), so the dependencies depend on
Cargo.lock, Cargo.toml and the manifests the dummy source keeps, as before.

Verified (nix eval of drvPath in a throwaway git copy, three commits:
unchanged tree, an edit of crates/komorebi-config, a docs edit): Windows
deps and kfde deps are identical in all three (before: both changed with any
edit); Windows clippy changes with the source edit and the docs edit (docs are
in the Windows source), kfde clippy and vm stacks change with the
komorebi-config edit only; the kfm deny attribute still evaluates. The kfm
deps and clippy cannot be evaluated on this Linux host (the same change was
made there by analogy). Not built: one cold build, then a second commit must
be a cache hit.
2026-11-05 15:03:26 -08:00
LGUG2Z a1e59871c1 test(config): rule matching tests for the Windows input shape
Adds four tests to crates/komorebi-config/tests/rule_matching.rs next to
the KDE/macOS ones moved there: a Windows exe rule names the program with
its extension (mirrors rules_exe, where platform.exe_id adds `.exe` on
Windows) and the id without it does not match; a regex id is looked up as
written on Windows and with `.exe` removed elsewhere; the whole grid of
kinds x strategies x ids agrees between RuleQuirks::WINDOWS and UNIX for a
window with one class (mirrors rules_class); a negated class rule for a
window of another class and for one with no class. Each names the e2e
check it mirrors. docs/dev/e2e-to-unit.md points at the shared file.

Verified: cargo test -p komorebi-config --test rule_matching (16 passed);
bare cargo clippy --locked --all-targets -D warnings clean.
2026-11-05 15:03:26 -08:00
LGUG2Z b7b3c1c8f4 feat(windows): heartbeat thread and an accept log line, evidence for a daemon-wide stall
The stall analysis could not tell a frozen daemon (or guest) from a lock hold:
in both, the threads are silent. A heartbeat thread (komorebi/src/heartbeat.rs)
sleeps 100 ms in a loop and logs a warning, "heartbeat was N ms late: the
daemon was not scheduled for that long", when a beat comes 500 ms or more
after it should; started next to the command listener. If it is late exactly
when the other threads are silent, the process was not scheduled; if it keeps
beating while they are silent, something holds a lock (see the lock holder
warnings). The Windows connection policy's on_accept also logs, at debug,
"accepted a command connection (N ms since the previous one)", so a request
that waited in the backlog during a stall shows up at its late accept. Both
cost next to nothing (a 100 ms timer and one debug line per connection).
komorebi-transport is unchanged: KDE and macOS do not see either.

Diagnostics only, no behaviour change. Verified: tools/fast-check Windows clippy
-D warnings PASS; e2e: none needed.
2026-11-05 15:03:26 -08:00
LGUG2Z fa2d630701 test(e2e): the bar scenario says when the guest cannot draw, and the bar config is tested
The Windows gate showed that the bar cannot open a window in the golden
guest (no OpenGL 2.0: "egui_glow requires opengl 2.0+"). The scenario now
reads the bar's own output (`classify`): that exact failure turns the
window, stays-alive and daemon-restart checks into visible
`skipped: guest has no OpenGL 2.0` lines (counted in `result.json` and
printed as `skipped: N` by the runner); the schema equality, "the bar reads
its configuration" (real: the configuration is parsed before the window),
`komorebic state` and `stop --bar` stay checks; any other early exit of
the bar (a configuration error, a panic) is a failure with the bar's
output in the message, and a bar that opens its window gets the full walk as
before. Unit tests for `classify` run with the runner tests.

komorebi-bar-core gets tests/config.rs: windows-only widgets and the `mouse`
block are accepted on every platform, `supported()/unsupported()/enabled()`
name and skip what the platform cannot run (D-coord-1), a Command mouse
message is a plain string and the tagged form is rejected (the e2e finding),
the network widget accepts `default_interface_options` and the old key
names, layouts read from their names, `KomobarConfig::read` fills the frame
and refuses a non-json file. The warning text itself is not asserted (no
tracing subscriber in the core).

docs/dev/bar-e2e.md records the limitation and an analysis of getting
rendering into the guest (wgpu with the WARP adapter recommended; a mingw
Mesa is not offered by nixpkgs); nothing was added.

Verified: runner and library tests (161 passed), ruff clean on the scenario
(three older findings in other files are not mine), bar-core native tests 3
unit + 7 oracle + 6 config. Windows clippy and the macOS check: see the
report. The scenario itself was not run.
2026-11-05 15:03:26 -08:00
LGUG2Z 20df9c98df docs: the shared commands, what moved and what stays
docs/dev/core-model.md section 21: the CommandHost mechanism, the sixteen
router arms that now live in komorebi-core (workspace navigation, the
moves across workspaces and monitors, lock and unlock by index), the one
platform switch (the pointer picks the monitor on Windows), and why the
rest of the router stays (each remaining arm needs a WindowManager method
or field).

Verified: not applicable (documentation).
2026-11-05 15:03:26 -08:00
LGUG2Z 219cf65b83 style(macos): format the files the merge of settings3 left unformatted
Pure formatting, no other change: the same rustfmt invocation as the kfm fmt
check (nightly rustfmt, edition 2024, komorebi-for-mac/rustfmt.toml) over
komorebi-for-mac/komorebi/src/animation/mod.rs and static_config.rs, which the
merge took from wip-u-settings3 unformatted.

Verified: the check's rustfmt --check over the macOS files passes after it.
2026-11-05 15:03:26 -08:00
LGUG2Z 008b5145fa refactor(windows): match window rules with the shared komorebi-config::rules
BEHAVIOUR (expected none; gate needed): Windows' should_act and
should_act_individual become thin wrappers over komorebi_config::rules
with RuleQuirks::WINDOWS (a rule id is compared as written, no `.exe`
stripping, unlike KDE and macOS) and the window's one class passed as a
one-element slice. Signatures, should_act_window* and every call site are
unchanged. Equivalence was checked arm by arm: for a one-element slice the
any-of loops of the shared body are the single comparisons of the old one,
negated strategies included (docs/dev/rule-matching.md).

Verified: bare cargo clippy --locked --all-targets -D warnings
(default-members) clean. Not verified: any Windows run. Gate owed: the
Windows e2e scenarios rules, rules_class, rules_exe, manage_rules,
title_rule and startup_rules (the ones that assert which window a rule
catches) plus a smoke of the transparency blacklist and
window_manager_event show/hide rules that also call should_act.
2026-11-05 15:03:26 -08:00
LGUG2Z d0ee249ba2 perf(windows): the reaper releases the window manager lock before it notifies and writes the hwnd file
The reaper held the lock across workspace.update(), notify_subscribers for each
reaped window and the komorebi.hwnd.json write (the stall analysis: real holds
of 1.0 to 1.3 s in the state_fidelity and placement scenarios, with a command
dropped meanwhile). Now it reaps and updates under the lock, builds the
Destroy notifications there (each carries the state as it was after that
window was reaped), takes a sequence number for the list of known handles
(HWND_LIST_SEQ), and then drops the lock; the subscribers are pushed to, the
borders notified and the file written afterwards. The write stays synchronous
and on the same thread (no writer thread).

Ordering. The notifications still go out in the order they were made and each
carries its own snapshot, but a command may now run between the reap and the
push, so its notification can reach subscribers before the Destroy of the
reaper; subscribers get full states, so the later one is still correct. The
hwnd file: update_known_hwnds (commands) and the reaper both write it through
reaper::write_known_hwnds(seq, list), which holds a small mutex around the write
and skips a list older than the one in the file, so the two writers do not
interleave and an older list never overwrites a newer one. If workspace.update()
fails for a window (the existing ? ), the notifications made before it are
dropped with the lock released; before they had been sent.

BEHAVIOUR: notification order relative to commands, and the file written
after the unlock. Gate needed: Windows e2e lifecycle, lifecycle_hidden,
state_fidelity, placement, commands, and the lock stress; the next hold ranking
should lose the reaper holds. Verified: tools/fast-check Windows clippy
-D warnings PASS; e2e not run.
2026-11-05 15:03:26 -08:00
LGUG2Z fdd9f0891d test(e2e): the bar scenario's mouse command is a plain string
`MouseMessage::Command(String)` is an untagged variant, so
`"on_middle_click": {"Command": ...}` in the scenario's bar configuration
did not deserialize and the bar exited at start ("data did not match any
variant of untagged enum MouseMessage"). The value is the string itself.

Found by the Windows gate on candidate 5 (win-e2e, S/e2e-win/gate-cand5.md,
bar section; the fix is its bar-fix.diff). Verified: ruff clean; not run.
2026-11-05 15:03:26 -08:00
LGUG2Z b18cb58416 refactor(windows): the lock and unlock arms call komorebi-core
BEHAVIOUR (Windows runtime): LockMonitorWorkspaceContainer and
UnlockMonitorWorkspaceContainer call komorebi_core::set_container_locked (the
text the Windows arms had byte for byte), and WindowManager implements
ContainerCommandHost. By construction the same; marked because it was only
type-checked.

Windows e2e scenarios needed: commands (toggle-lock, and lock/unlock by
index if the sweep has them), stacking.

Verified: Windows cargo clippy -p komorebi-windows --locked --all-targets -D
warnings: PASS. Not run: Windows tests, e2e.
2026-11-05 15:03:26 -08:00
LGUG2Z 97c21b9360 merge: wip-cand6
Merge of wip-cand5, wip-u-bugfix, wip-u-wm, wip-u-settings3, wip-u-repotools,
wip-u-nix3 and wip-u-e2e2unit.

Resolutions:
- docs/dev/macos-handcheck.md: every section is kept, in order. The bugfix
  agent's section F (bar clicks) and the settings agent's section (also
  headed F) both appended after E; the settings one is renamed G, text
  unchanged.
- komorebi-for-mac/komorebi/src/animation/mod.rs and static_config.rs: the
  formatting-only revision of wip-u-nix3 (76ab52da, import order) conflicts
  with the semantic edits of wip-u-settings3 (S4/S5). The files are taken
  from wip-u-settings3 as they are; the following style(macos) revision
  formats them again with the check's rustfmt invocation.

Verified: see the following revisions and the report.
2026-11-05 15:03:26 -08:00
LGUG2Z 0da55d8709 refactor(mac): match window rules with the shared komorebi-config::rules
macOS' should_act and should_act_individual become thin wrappers over
komorebi_config::rules (RuleQuirks::UNIX: a `.exe` in a rule id is
ignored, as before). Signatures and the trait methods in workspace.rs that
call them are unchanged. The old bodies were byte-identical to KDE's, which
the shared tests (crates/komorebi-config/tests/rule_matching.rs) now cover.

No behaviour change intended. Verified: cargo clippy --target
aarch64-apple-darwin -p komorebi -p komorebi-macos -p komorebic-macos -p
komorebi-client-macos -p komorebi-bar-macos --all-targets -D warnings with
the fake CC: clean. Not run: any macOS test (type-check only on Linux);
the Mini must run the suite on this revision.
2026-11-05 15:03:26 -08:00
LGUG2Z e24a446fe3 perf(windows): ask should_manage for an event before the window manager is locked
The stall analysis of the cand5 gate: the remaining real holds of 1 to 4.5 s
are process_event for Show/Uncloak/FocusChange of freshly created windows, with
no log line between the lock and the first line of the handler: that gap is
Window::should_manage, i.e. Win32 calls on the new window (IsWindow,
GetWindowRect, title, DwmGetWindowAttribute for the cloaked state, process
name and path, class, styles) and rule matching, run with the lock held.

Read: should_manage reads only the window, the rule lists (taken in the order
documented at the statics in lib.rs, unchanged), the transparency manager's
list of known layered windows (its own lock) and size settings. It does not
touch the WindowManager. The event thread now calls ManageCheck::compute(event)
before locking, and process_event_checked(event, check) uses it. The old
process_event(event) stays and computes inline.

Race windows this opens, and the guards. (1) The rule lists change between the
check and the handling: only commands change them, so COMMAND_GENERATION is read
before the check and incremented when each command ends (a drop guard in
process_command, after the command has changed what it changes); if it differs
under the lock the check is thrown away and computed again there, as it always
was. (2) The window changes while the event waits for the lock (closed,
cloaked, retitled): the wait was already there before (the event sat in the
queue; the check used to run after the lock, now it runs up to one wait
earlier) and the handlers cope with a window that is gone or different, as for
any queued event; no state of the window manager is read from the old answer.
(3) Paused: the check is wasted work, the paused test still comes first under
the lock.

BEHAVIOUR: events are classified up to one lock wait earlier. Gate needed:
Windows e2e commands, config_reload, lifecycle, rules (rules_class, rules_exe),
placement, scrolling, and the lock stress; the hold ranking of the next gate
should lose the process_event holds of new windows. Verified: tools/fast-check
Windows clippy -D warnings PASS; e2e not run.
2026-11-05 15:03:26 -08:00
LGUG2Z 1aa9c580de refactor(mac): the lock and unlock arms call komorebi-core
The same two arms as on KDE call komorebi_core::set_container_locked, and
WindowManager implements ContainerCommandHost. 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).
2026-11-05 15:03:26 -08:00
LGUG2Z acbe816fb4 test(core): follow the rename of the floating-window hook to before_floating_removed
wip-u-coretests (written against the hook's old name after_floating_removed) and wip-u-core4 (which renamed it to before_floating_removed because it runs before the window leaves the ring) were merged in candidate 5; the stub platform and the expected hook logs now use the new name. No behaviour change: the order test already pinned 'before the removal'. Verified: cargo test -p komorebi-core (with and without the schemars feature).
2026-11-05 15:03:26 -08:00
LGUG2Z b212b554cd docs(dev): macOS hand-check rows for the bar clicks and a list of findings needing a decision
macos-handcheck.md gets section F (rows M1-M3) for the battery, CPU/network
and update clicks fixed in the two preceding revisions (appended, the file is
kfm's). known-issues.md is new: four findings that are not fixed because
whether they are bugs, or the fix, is the owner's call, each with evidence
(file and line), why it may or may not be a bug, the platforms and a proposed
fix: KDE FocusWorkspaceNumber/Numbers/LastWorkspace without the pointer
monitor preamble, Monitor::focus_workspace overwriting a workspace name,
remove_container focusing focused-1, and the macOS subscriber push without a
write timeout.

Docs only. The line references were read in this tree (pointer-monitor
preamble compared between the Windows and KDE process_command.rs); nothing
was run.
2026-11-05 15:03:26 -08:00
LGUG2Z 7b070fffda docs: KDE and macOS window_manager.rs and router after the converge, and the blockers
docs/dev/core-model.md section 20: what the converge batch did (two
platform accessors, eleven macOS arms onto KDE's named methods), where the
two daemons stand (137 of 155 router arms byte-identical, 45% of KDE's
window_manager function lines identical with macOS), why it is below the
60% bar (macOS's ContainerExt against the shared Container with a hiding
spot, the ? against let _ policy, the platform entry points, the one-sided
functions) and the four blockers with the recommended next step.

Verified: not applicable (documentation); counts from the arm and function
comparison at this tip.
2026-11-05 15:03:26 -08:00
LGUG2Z 278ef8f3fc docs(settings): S4 and S5 as landed, macOS hand-check section F
docs/dev/settings.md section 10: what S4 and S5 moved, the differences
between the daemons that were kept on purpose (KDE resets transparency keys
on load and Windows keeps them; Windows animates a kind when the global flag
is on or the per-kind value is true, KDE and macOS let the per-kind value
win; the scoped guard on KDE, the suspend counter on macOS, the Windows
shutdown write). docs/dev/macos-handcheck.md section F (appended, nothing
else changed): the Mac checks for S3 and S5.

Verified: not applicable (documentation).
2026-11-05 15:03:26 -08:00
LGUG2Z f9b18a6f34 docs(tools): add tools/README.md and point build-and-test.md at the committed tools
tools/README.md describes each tool, the tiered loops of fast-check (tier 1 cargo check and
unit tests of the edited tree, tier 2 other-platform type-check or clippy, nix builds as the
pre-landing gate), the prerequisites (jj, nix develop, jq, flock) and how the fake C compiler
works for the macOS type-check. The measured warm times come from the host README and are dated
2026-10-31 (revision c89651fa). Personal progress-log and scratchpad references are removed.

docs/dev/build-and-test.md gets a "Developer tools" section and links to tools/ where it named
fast-check, kde-closure-check and the fake-CC command (the macOS block now says
`tools/mac-check.sh`).

Verified: links and commands read against the committed scripts; nothing else run.
2026-11-05 15:03:26 -08:00
LGUG2Z 7bfaf6479d perf(nix): stamp the commit only into the final macOS package
As for Windows and KDE: COMMIT_HASH was in the kfm commonArgs, so
buildDepsOnly (about 1000 dependencies) and every kfm check got a new
derivation for every commit and rebuilt in full on the Mac. commonArgs now
has the constant "nix-check"; only fullBuild, and so packages.default and
the extracted binaries, gets the real commit.

Verified: the darwin clippy, nextest and deps attributes cannot be
evaluated on this Linux host (a derivation of the stub source has to be
built), so the drvPath table of the other attributes is the evidence; see
the report. Needs a Mac build: after one cold build of the clippy check, a
docs-only commit must be a cache hit.
2026-11-05 15:03:26 -08:00
LGUG2Z f085064af9 docs(dev): e2e-to-unit, which e2e checks the shared crates made testable natively
Inventory of every Windows/shared e2e scenario and the KDE VM suites against the
native tests that exist after the consolidation: class A (covered, cited), B
(coverable with the shared crates, proposed test) and C (needs a real OS), with
effort and value, ordered with the Windows-only e2e behaviours first. Gives the
estimate of gate minutes saved today and if the B items existed, the seams the
shared crates lack (daemon command handler, rule matching shared in
komorebi-config, monitor reconciliation, stack cycling), and the tests added
with the e2e check each mirrors.

Verified: not applicable (documentation); the cited tests were read, and the
added ones were run (see their revisions).
2026-11-05 15:03:26 -08:00
LGUG2Z ac168c9657 refactor(kde): match window rules with the shared komorebi-config::rules
KDE's should_act and should_act_individual become thin wrappers over
komorebi_config::rules (RuleQuirks::UNIX: a `.exe` in a rule id is
ignored, as before); their signatures and the should_act_window wrappers
are unchanged, so no call site moves. The 12 pure matching tests of
komorebi-for-kde/komorebi/tests/rule_matching.rs move to
crates/komorebi-config/tests/rule_matching.rs with their assertions
untouched (they call same-signature local wrappers over the shared
function); the manage-rule rescue test, which needs the fake backend, stays
in the KDE file.

No behaviour change: the function bodies were identical (docs/dev/
rule-matching.md). Verified: cargo test -p komorebi-config --test
rule_matching (12 passed); KDE cargo test -p komorebi-linux --lib (292
passed) and --test rule_matching (1 passed), command_sweep, rules; cargo
check --all-targets clean. KDE clippy -D warnings fails on 4 pre-existing
lints in process_command.rs and kwin/mod.rs (not touched here). Not run:
VM suites.
2026-11-05 15:03:26 -08:00
LGUG2Z f6ad736dca feat(windows): time the steps of process_event
The event thread logs, per event, how long it waited for the window manager
lock and how long handling took (debug, or info when either is 200 ms or more:
"process_event <event>: waited for the lock N ms, handled in N ms"), and
process_event logs how long should_manage took (debug). The stall analysis of
the cand5 gate puts every remaining real hold of 1 to 4.5 s in process_event
for Show/Uncloak/FocusChange of new windows, silent before the first log line
of the handler; these lines say whether that is should_manage (Win32 and rule
matching on the new window) or the rest.

Diagnostics only, no behaviour change. Verified: tools/fast-check Windows
clippy -D warnings PASS; e2e: none needed.
2026-11-05 15:03:26 -08:00
LGUG2Z bab5fac915 refactor(kde): the lock and unlock arms call komorebi-core
LockMonitorWorkspaceContainer and UnlockMonitorWorkspaceContainer call
komorebi_core::set_container_locked, and WindowManager implements
ContainerCommandHost with its own monitors_mut. No behaviour change.

Verified: KDE cargo test -p komorebi-linux (lite env): 678 passed, 0 failed.
Not run: VM suites.
2026-11-05 15:03:26 -08:00
LGUG2Z ba094355d4 chore(repo): combine the review fixes, new tests and docs (candidate 5)
Candidate 5: wip-cand4 plus kfw's review fixes (wip-u-fix5: revert of the subscriber write timeout and the hwnd writer thread, BAR_RUNNING tied to the message, dead-window HIDDEN_HWNDS cleanup, core in default-members), kfm's macOS registry fixes (wip-u-kfm3), kfde's hook rename and per-pass title-bar snapshot (wip-u-core4), the komorebi-core characterization tests (wip-u-coretests) and the docs (wip-u-docs). Conflicts, if any, are resolved here.
2026-11-05 15:03:26 -08:00
LGUG2Z 89f2872609 fix(bar): open the macOS settings, Activity Monitor and links with open
The macOS bar's battery click spawned cmd.exe /C start ms-settings:batterysaver
and the update click spawned explorer.exe, neither of which exists on macOS
(the move kept them on purpose, handcheck D.B). Both now go through `open`,
as the CPU, memory and network clicks already did.

The decision which program and arguments a click runs is a pure function,
system_tool_command(&SystemTool) -> (program, args), so the argv is unit
tested: task manager is `open -a 'Activity Monitor'`, the battery is
`open x-apple.systempreferences:com.apple.Battery-Settings.extension` (the
pane id of System Settings in macOS 13 and later, the scheme the network pane
already used; unconfirmed on a real Mac, hand-check row added), a URL is
opened as is, a storage label opens its path. The module is macOS only
(cfg(target_os = "macos") at the crate root), so none of this is built
elsewhere.

BEHAVIOUR (macOS): clicks on the battery and update widgets now open
something. Gate: macOS hand-check rows M1-M3 in docs/dev/macos-handcheck.md and
the unit tests on the Mac (cargo test -p komorebi-bar). Verified: type-check
only on Linux (see the fast-check result in the progress log); tests not run
here.
2026-11-05 15:03:26 -08:00
LGUG2Z 595e9c46a1 refactor(kde,mac): monitor_idx_from_current_pos asks window::monitor_id_at_cursor()
Both daemons' window.rs have monitor_id_at_cursor() (KDE: the backend's
pointer position resolved to the monitor under it; macOS: MacosApi's
monitor_from_point of its cursor position), and monitor_idx_from_current_pos
in both window_manager.rs files is now the same text up to its macOS-only
comment block. No behaviour change.

Verified: KDE cargo test -p komorebi-linux (lite env): 664 passed, 0
failed; fake-CC cargo clippy -p komorebi-macos ... --all-targets -D
warnings: PASS; Windows cargo clippy -p komorebi-windows --locked
--all-targets -D warnings: PASS (the whole-workspace Windows clippy fails
in komorebi-bar, E0046 missing release_page_url, which is not in this
change and fails at the base). Not run: the macOS tests (the Mac Mini).
2026-11-05 15:03:26 -08:00
LGUG2Z b12be4b1a7 refactor(windows): move window_handling_behaviour to the platform settings, scoped guard in the border test
Plan step 10, part of S7 and the scoped guard asked for in S5.
WINDOW_HANDLING_BEHAVIOUR is no longer a static: it is
settings().platform.window_handling_behaviour (WindowsSettings, default
Sync). The load writes it with one update when the key is present (a missing
key keeps it, as before); windows_api (the position calls) and scrolling read
it through settings::window_handling_behaviour(), once per call.

The border paint test (border_manager/border.rs is_painted) saved the static,
stored a value and stored the old one back, which overwrote any change made in
between. It now holds Handle::scoped on the field, which puts the previous value
back on drop only if the field still holds the value it set.

BEHAVIOUR: the position calls read a snapshot instead of an atomic cell (one
RwLock read and Arc clone per call), and the load publishes the key through the
handle. Gate: Windows e2e (commands, config_reload, lifecycle; anything that
moves windows with window_handling_behaviour async if configured).

Verified: Windows clippy -D warnings --locked --all-targets on
komorebi-windows (cross): clean. e2e not run; the border paint test needs a
desktop and was not run.
2026-11-05 15:03:26 -08:00
LGUG2Z 1879b86a5c build(tools): add trim-target, gate-lock and lite-env
Optional helpers for a shared host: trim-target deletes stale test executables from the
persistent cargo target dirs, gate-lock is a FIFO flock for heavy and timing-sensitive gates,
lite-env sources debug-info-off cargo settings. Copies of the host-side scripts with these
differences:
- trim-target: the default scratch dir is `${XDG_CACHE_HOME:-$HOME/.cache}/komorebi-fast-check`
  (was a /tmp/claude-1000/... scratchpad path), the same as fast-check;
- gate-lock: GATE_LOCK_DIR defaults to `${XDG_STATE_HOME:-$HOME/.local/state}/komorebi-gate`
  (was /home/jado/komomono-work/.gate), in the header and in the code;
- gate-lock: "/proc/$pid/cmdline" is quoted and a shellcheck directive disables SC2012 and
  SC2016 (ls of plain queue ticket names, and a bash -c script expanding its own $1);
- lite-env: a `# shellcheck shell=bash` first line.
Not committed: mini (host and credential specific), host-sample and jitter-probe (host
measurement), the .bak files.

Verified: bash -n and shellcheck clean. Not run: gate-lock was tested by its author with a scratch
GATE_LOCK_DIR before this change; the default path change is untested.
2026-11-05 15:03:26 -08:00
LGUG2Z af5ac69749 fix(deny): clarify the license of the workspace crates the macOS deny check sees
The kfm deny check failed with `licenses FAILED`: the unified workspace's
crates have no license field and the macOS deny.toml only clarified the old
crate names. Twelve clarify entries (LicenseRef-Komorebi-2.0, as for the
existing ones) now cover komorebi-backend, -bar, -bar-core, -client,
-collections, -config, -core, -protocol, -settings, -transport, komorebic and
komorebic-core.

Verified: cargo deny --offline --workspace with the flake's 11 --exclude
arguments and `check --config komorebi-for-mac/deny.toml bans licenses
sources` (nix shell nixpkgs#cargo-deny, on the Linux host over the same
Cargo.lock): bans ok, licenses ok, sources ok; taplo --check passes on the
file. The check on the Mini is not re-run.
2026-11-05 15:03:26 -08:00
LGUG2Z 231e50b3fc test(core): tiling arithmetic of update_shared as native checks of the e2e layouts
The Windows e2e scenarios layouts (111 checks), flipping, layout_flip, padding,
closing, minimizing, floating, stacks, tiling and tiling_off assert where the
tiles of a workspace are. Since the consolidation every daemon gets those tiles
from komorebi-core's Workspace::update_shared, so they can be checked on the
stub platform on Linux (and on the Mac Mini for macOS) instead of in a guest.

crates/komorebi-core/tests/e2e_layouts.rs (6 tests) runs update_shared on a
StubPlatform workspace for the 8 layouts of the scenario, 1 to 8 containers and
three padding settings: one tile per container, inside the work area, not on
each other; workspace padding moves tiles 40 px in, container padding shrinks
every tile, and back as it was; each of the three flips equals the plain tiles
mirrored (as a set); removing a container (what a closed, minimized or floated
window does) leaves the others at least as much room; two containers, one a
stack of two, are two tiles; with tiling off nothing is placed in any layout.
Each test names the e2e checks it mirrors. They protect Windows, KDE and macOS
alike. Platform dependent: the stub adds no border and no frame adjustment, so
the Windows border of 7 px (windows_padding) and each daemon's own
adjust_layout stay e2e only, as does the OS frame matching the tile.

Verified: cargo test -p komorebi-core --test e2e_layouts, 6 passed (native
Linux; macOS crates run later on the Mini). No source change, no bug found.
2026-11-05 15:03:26 -08:00
LGUG2Z b3bcf4a2c3 refactor(config): add the shared window-rule matching
komorebi_config::rules holds should_act and should_act_individual, the
evaluation of MatchingRule/MatchingStrategy against a window
(RuleSubject: title, exe_name, classes, path). The body is the KDE/macOS
copy moved verbatim; the single difference of the Windows copy (a rule id
is compared as written, no `.exe` stripping) is RuleQuirks::WINDOWS vs
RuleQuirks::UNIX, and Windows' single class is a one-element slice. The
regex cache is passed in (the daemons keep REGEX_IDENTIFIERS and its lock
order). regex 1 becomes a dependency of komorebi-config (already in the
lock; one Cargo.lock line).

Nothing calls it yet, so no daemon behaviour changes. Verified: cargo
clippy -p komorebi-config --all-targets -D warnings, fmt check.
2026-11-05 15:03:26 -08:00
LGUG2Z 1acdd9bb20 fix(windows): the lock-holder record is released with the lock guard, not after it
The Held record was a separate local next to the lock guard, so it outlived
the guard where the guard was dropped early: in the border manager the record
ran on through everything the thread does after drop(state) (foreground
lookup, border windows, painting), and in the monitor reconciliator through the
3 s thread::sleep of the "potential monitor removal" verification, which runs
with the lock released. The stall analysis of the cand5 gate counted both as
holds (rank 2 and 3 of the ranking; artifacts). lock_holder::lock(&mutex,
site) now returns a HeldGuard that owns the lock guard and the record, derefs
to the window manager, and drops the record first and the guard second, so
drop(guard) ends both together. All six sites that recorded a holder use it
(process_event, reaper, border manager, monitor reconciliator including its two
re-locks, transparency and stackbar managers); the per-command record in
process_command stays (it is dropped just before the transport's guard).

Diagnostics only, no behaviour change (the locks are taken and released where
they were). Verified: tools/fast-check Windows clippy -D warnings (default
members, own target dir) PASS; e2e: none needed, the next gate's hold ranking
should lose the two artifacts.
2026-11-05 15:03:26 -08:00
LGUG2Z 0bf26a6d14 feat(core): lock and unlock a container by index, with native tests
komorebi_core::set_container_locked is the body of the
LockMonitorWorkspaceContainer and UnlockMonitorWorkspaceContainer arms
(the two differ by the flag; the text is the same on all three daemons),
over a third small host trait ContainerCommandHost: CommandHost that has
monitors_mut. Tests: lock then unlock, a container index that is not there
is ignored and a missing monitor or workspace is an error.

Verified: cargo test -p komorebi-core --features schemars --test commands
(native): 16 passed, 0 failed. Not run: the daemons.
2026-11-05 15:03:26 -08:00
LGUG2Z 4a829a886c chore(repo): komorebi-core is a default member of the workspace
Review finding 3. crates/komorebi-core was a member but not in default-members,
so a bare cargo test or cargo clippy at the root did not build it and its tests
(27, 30 with the schemars feature) never ran in the Windows set. komorebi-daemon
was already in the list. cargo test -p komorebi-core passes with and without
--features schemars: komorebi-layouts keeps Layout::Custom without the Win32
dependency, so no cfg needed fixing. (The komorebi-config crate prints an
unused-import warning of its own when built alone with default-features off,
pre-existing and not an error in the workspace build, where features unify.)

Verified: cargo test -p komorebi-core: 27 passed; with --features schemars: 30
passed; tools/fast-check (native, Windows clippy -D warnings, KDE, macOS) PASS.
2026-11-05 15:03:26 -08:00
LGUG2Z ba25355cca docs(macos): the review's checks H1-H12, the registry's lifetime rules, and the known subscriber hang
docs/dev/macos-handcheck.md: a prioritised section with the independent review's twelve
hand checks and their exact steps (hide spot on the right display, event
latency with a stopped app, native tabs, floating and monocle, scrolling, config
reload, old state with the bar, pause and quit, bar config, unsupported commands,
registry growth, hung subscriber), a row for the wip-u-kfm3 registry fixes, and
a known-issue note: a subscriber that stops reading can stall the daemon (the
push writes under the window manager lock with no timeout; pre-existing and
the same in the original). A write timeout was deliberately not added: the
Windows review found it can truncate the JSON notification and does not bound
the stall, so the fix is a design, not a timeout.

ax_registry.rs module docs: when an entry is created (when the observer is
attached), the inert application, where it ends (the reapers, application
quit), why not in Window::drop, and what is not enforced (an observed
window that closes without passing through the reapers keeps its entry until its
application quits; cost and the unverified Mach-port question).

Verified: fake-CC cargo clippy --locked -p komorebi-macos --all-targets -D
warnings clean; tools/fast-check --since wip-cand4: native, Windows clippy, KDE
check + lib tests, macOS PASS; cargo test -p komorebi-core -p komorebi-backend
pass. Not verified: any run on macOS.
2026-11-05 15:03:26 -08:00
LGUG2Z 48861ece10 docs: correct the title-bar claim and name the renamed hook (F2, F3)
docs/dev/core-model.md section 19: remove_floating_window's hook is
before_floating_removed (behaviour unchanged), and the Windows title-bar
tables are taken once per pass through begin_pass; the sentence of
section 16 that called the per-container read an improvement is
corrected.

Verified: not applicable (documentation).
2026-11-05 15:03:26 -08:00
LGUG2Z fa3ec1ba2e test(core): add the review's gaps: floating hook order, placement rules, hook defaults, key sets
Follow-up to the review of komorebi-core (S/review/core.md, F2 and F4 and its
untested-behaviours list); most of the list was already pinned, this adds the rest:
- the after_floating_removed hook is pinned to run BEFORE the window is taken out
  (it sees both windows and the old focus index), today's KDE/macOS order, although
  the trait doc says after; the stub now logs len and focus for the hook.
- resolve_placement_index with Rules maps (Single and Many matching, Secondary,
  no match falls back after the focused container); the stub gained a match id and a
  path (a window without a path never matches Rules: it falls back).
- the JSON key set of a default workspace, and of Windows and macOS monitors per extra.
- the documented defaults of every optional hook on a platform that overrides nothing
  (the KDE-shaped test platform), and that the default place hooks make update_shared fail.
- Monitor remove_workspace_by_idx at the length, and an old monitor file with a
  non-empty ring of workspaces missing optional keys.

Verified: cargo test -p komorebi-core 215 passed, 1 ignored (the known bug), and with
--features schemars 217 passed, 1 ignored; clippy --all-targets has no warning in the
crate. No non-test source changed.
2026-11-05 15:03:26 -08:00
LGUG2Z 824c8b6d07 docs: point CONTRIBUTING.md at the developer documentation
The root CONTRIBUTING.md is only the licence terms and did not say where the
layout and the build commands are. It now names docs/dev/ARCHITECTURE-UNIFIED.md
and docs/dev/build-and-test.md. Docs only, nothing built.
2026-11-05 15:03:26 -08:00
LGUG2Z d7673d436f fix(bar): the update widget asks the platform for its release URLs
The update widget's refresh thread polled the Windows repository's GitHub
API on every platform (a hard-coded second URL, while the first fetch went
through BarPlatform::latest_release_api_url), and the page the click opens
was built for the Windows repository, so on macOS the widget compared the
mac version against Windows releases after the first refresh and linked to
the wrong project.

The refresh now uses latest_release_api_url, and a new
BarPlatform::release_page_url(version) builds the click target: Windows
keeps https://github.com/LGUG2Z/komorebi/releases/v{version} exactly,
macOS gets https://github.com/LGUG2Z/komorebi-for-mac/releases/tag/v{version}.

BEHAVIOUR (macOS): the update widget compares against and links to the
komorebi-for-mac releases. Windows output is unchanged (same URLs). Gate:
macOS hand-check (see docs/dev/macos-handcheck.md); Windows needs no e2e.
Verified: see the following revisions' fast-check results; not run on a Mac.
2026-11-05 15:03:26 -08:00
LGUG2Z 4836a39b1c refactor(mac): ToggleWorkspaceWindowContainerBehaviour calls the named method KDE has
The arm was the same code inline as toggle_workspace_window_container_behaviour
on KDE (the two differ only in how rustfmt wrapped the match arms). The macOS
arm calls a method with that name and body. 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).
2026-11-05 15:03:26 -08:00
LGUG2Z 482c42d64f refactor(windows): move the animation settings to settings
Plan step 10, S5 for Windows. The six ANIMATION_* statics (global enabled,
style, duration; per-kind enabled, style, duration) and ANIMATION_FPS are
gone (ANIMATION_MANAGER and GHOST_MOVEMENT_ENABLED stay: runtime state and a
Windows-only setting). The Animation, AnimationDuration, AnimationFps and
AnimationStyle commands each write settings().shared.animation with one
update; the animation block of a load is one update through
SharedDelta::apply (a global value clears that setting's per-kind map, a map
replaces it, a block without fps has the default, no block keeps all);
shutdown (daemon.rs, window_manager.rs) is animation_off_for_good(), one
update that clears the per-kind map and turns the global flag off.

Readers keep Windows' own rules, which are NOT the KDE and macOS ones: a kind
is animated when the global flag is on OR its per-kind value is true (a
per-kind false does not turn off a global true), and the workspace transition
helpers keep their per-kind-wins rule; the accessors in settings.rs
(animation_enabled_for, animation_for) encode the first and the existing
transitions_enabled_by / duration_for / style_for are fed from one snapshot.
Window::move/transparent/opaque and the maximize wait read enabled, duration
and style from one snapshot, and no longer hold the per-kind map's lock for the
rest of the function.

BEHAVIOUR: no thread can see half an animation reload; one publish per load or
command. Gate: Windows e2e (animation, config_reload, lifecycle for the
shutdown path, commands).

Verified: Windows clippy -D warnings --locked --all-targets on
komorebi-windows (cross): clean. e2e not run.
2026-11-05 15:03:26 -08:00
LGUG2Z 27b36a457e build(tools): add kde-closure-check and e2e-needed
kde-closure-check fails when komorebi-for-kde/nix/root-crates.json differs from the KDE cargo
closure; e2e-needed says whether a diff touches anything the Windows e2e binaries are built
from. Copies of the host-side scripts with these differences only:
- kde-closure-check: none (it already finds the repository relative to the script); verbatim.
- e2e-needed: `tools/*` joins the paths that cannot change the binaries (docs, .github), so a
  change to the tools is NO instead of "not understood: treated as needed";
- e2e-needed: `# shellcheck disable=SC2001` before `set` (the sed one-liners indent multi-line
  output); no behaviour change.

Verified: bash -n and shellcheck clean; `tools/kde-closure-check .` prints "ok: 11 root crates
match the KDE cargo closure"; `tools/e2e-needed --since <rev>` gives the same output as the host
copy on a range without tools/ files, and NO for a tools-only range.
2026-11-05 15:03:26 -08:00