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.
`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.
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.
BEHAVIOUR (KDE): FocusWorkspaceNumber, FocusWorkspaceNumbers and
FocusLastWorkspace now focus the monitor under the pointer first when
its workspace is empty, then run the workspace command, as on Windows.
This resolves item 1 of docs/dev/known-issues.md. Done by setting
CommandHost::POINTER_PICKS_THE_MONITOR_FOR_ALL to true in the KDE
CommandHost impl; the shared komorebi-core functions do the rest.
New tests/pointer_monitor.rs on FakeBackend: three of four failed
before the flip, all pass after it (the fourth checks that a pointer
on the focused monitor changes nothing).
Verified: cargo test -p komorebi-linux in the lite env, 670 passed,
0 failed. Not verified: KDE VM suites. Gate owed: KDE VM commands and
workspace-switch.
komorebi-bar gets a second renderer, wgpu, for machines without OpenGL 2.0
(the Windows e2e guest is one: egui_glow refuses its generic OpenGL 1.1).
wgpu draws through Direct3D 12 on Windows, which has the software adapter
WARP, so it needs no driver. The feature is on only in the
`[target.cfg(windows)]` table of komorebi-bar, so the macOS bar and the
shared bar-core are untouched and nothing here compiles for them.
Cargo.lock gains exactly one entry, `pollster` 0.4.0 (eframe's optional
block_on helper) and two dependency lines of eframe and nothing else: the
wgpu stack (wgpu 27, naga, wgpu-hal, egui-wgpu, ash, gpu-allocator ...) was
already locked as optional dependencies. pollster was not in the offline
registry, so `cargo metadata` fetched it from crates.io; no other version
changed.
Cost measured with `cargo tree -e normal --target x86_64-pc-windows-msvc -p
komorebi-bar`: 622 -> 664 distinct crate versions (+42) for the Windows bar.
With both features compiled, eframe's default renderer becomes Wgpu, so the
next revision names the renderer explicitly.
Verified: lock diff reviewed; not built yet (the next revision builds).
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.
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.
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.
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.
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).
komorebi_core::command gets focus_workspace_number (show a workspace unless
it is in front) and focus_workspace_numbers (show it on every other monitor,
then on the focused one), both with the pointer preamble when the host's
POINTER_PICKS_THE_MONITOR_FOR_ALL says so, over a new CommandHost method
show_workspace_on (focus the workspace of a monitor and load it, which the
daemons already did inline). The three daemons' arms call them (Windows keeps
its focus_workspace_numbers method as a wrapper) and implement
show_workspace_on. The const is unchanged: true for Windows, false for KDE and
macOS, so nothing changes yet; the next revisions flip it. Tests: the
Windows-switch test becomes a test of all five commands with the switch off and
on, and focus_workspace_number(s) are tested on the stub host (commands.py:
focus-workspace, focus-workspaces).
Verified: cargo test -p komorebi-core --features schemars --test commands: 18
passed; KDE cargo test -p komorebi-linux (lite env): 666 passed, 0 failed; fake-CC cargo
clippy -D warnings on the macOS packages: PASS; Windows cargo clippy -p
komorebi-windows --locked --all-targets -D warnings: PASS. Not run: Windows
tests, VM and Mac.
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.
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).
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.
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.
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).
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.
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.
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).
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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).
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.
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.
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.