Commit Graph
15 Commits
Author SHA1 Message Date
LGUG2Z f05d7fe737 build(just): test-partition-check, test-windows (the partitioned subset) and test-windows-full (the whole Windows suite by hand) 2026-11-05 15:51:50 -08:00
LGUG2Z 8e1a2b261c refactor(macos): the animation maths, the arrival record and the enhanced-UI rules move into komorebi-macos-core, which needs no macOS 2026-11-05 15:51:50 -08:00
LGUG2Z b83cf06cc6 feat(tools): test-partition says which packages are tested where, and fails when the classification and the workspace disagree 2026-11-05 15:51:50 -08:00
LGUG2Z c234b1d884 build(tools): route the justfile and tools to crates/ 2026-11-05 15:03:27 -08:00
LGUG2Z f7f444efb6 build(tools): tools, justfile and scripts name the outputs of the one flake
fast-check classifies the paths of the final directories (komorebi-linux, komorebi-macos,
komorebi-hotkeys, nix/{windows,linux,macos}, docs and schemas per platform), runs the Linux
check from the repository root and evaluates one check and one package per platform in the
root flake; kde-closure-check reads nix/linux/root-crates.json and compares it with the cargo
tree of the Linux packages (the listed crates besides komorebi-linux, komorebi-hotkeys and
komorebi-daemon); mac-check.sh drops the nested-workspace branch; e2e-needed treats nix/windows,
nix/workspace-src.nix, nix/lib.nix and nix/common.nix as fixed inputs of the Windows binaries
and the Linux and macOS trees as outside them; build-ref.sh builds `windows-NAME` for a REF with
the one-flake layout and keeps the old names for an older REF with its own flake. The justfile
names linux-nix-options-validation and runs a VM suite as legacyPackages.<system>.vm.NAME
(the vm-* checks are heavyChecks for now). scripts/linux/{run-kde,vm-mac,sync-e2e-core,
scenario-status} find the repository root and the VM library from scripts/linux/ and nix/linux/
(on the rebase onto wip-cutover-all the coordinator versions of run-kde, vm-mac and
scenario-status were kept: same change).

Not touched: scripts/linux/compare-gen.py, a migration comparison between the three old trees
that still looks for komorebi-for-mac/ (obsolete; open).

Verified: bash -n on the changed scripts; tools/kde-closure-check passes (14 root crates);
tools/fast-check --list classifies this revision as nix-only. fast-check commands for the
platforms were not run.
2026-11-05 15:03:27 -08:00
LGUG2Z 73c43239b5 chore(repo): one rustfmt, toolchain, gitignore and licence; format-all checks one group
komorebi-for-kde and komorebi-for-mac each had a rustfmt.toml (the root one minus
newline_style), a rust-toolchain.toml and .envrc (identical to the root's), a .gitignore and
a LICENSE.md; they are deleted, and the root .gitignore gains the KDE entries (/.vm,
__pycache__/, *.pyc). tools/format-all now has one group: every .rs file of the repository,
file by file with skip_children, with the root rustfmt.toml and the dev shell's nightly
(the --tree option is gone).

Verified: tools/format-all --check passes on the whole tree (the formatting of the six
files edited in the path-fix revision was applied to that revision).
2026-11-05 15:03:27 -08:00
LGUG2Z 170952596f refactor(repo): delete the shim packages
komorebic-linux, komorebi-client-linux, komorebic-macos, komorebi-client-macos and
komorebi-bar-macos were #[path] includes of the unified komorebic, komorebi-client and
komorebi-bar modules, kept only so the old package names kept building. The unified
packages are the only ones now, so the five directories and their workspace members are
gone (Cargo.lock loses their dependency entries).

Things that named the old packages follow: the clarify entries of the two per-tree
deny.toml files, tools/fast-check, tools/mac-check.sh and tools/kde-closure-check (it now
walks komorebic and komorebi-client), and the doc comment of komorebic/src/main.rs.
komorebi-for-kde/nix/root-crates.json gains komorebic, komorebi-client and
crates/komorebi-version, because those are root crates the KDE build depends on now.
komorebi-for-mac/komorebi/src/pan.rs read its transcripts from the deleted
komorebic/fixtures; they are byte-identical to the root komorebic/fixtures, so the three
paths point there.

Not touched here (done in the flake and justfile revisions of this stack): the nix
flakes and justfiles of the trees, which still name the removed packages, and docs/dev.

Verified: Windows cargo clippy --locked --all-targets -D warnings (default members) passes;
KDE cargo test -p komorebi -p komorebic -p komorebi-client -p komorebi-linux passes; macOS
cargo check --target aarch64-apple-darwin (fake CC) of komorebi, komorebi-macos, komorebic,
komorebi-client, komorebi-bar passes; tools/kde-closure-check passes. The nix flakes were
not run.
2026-11-05 15:03:27 -08:00
LGUG2Z 2544012c2e fix(nix): check the KDE formatting file by file with the flake's nightly rustfmt
The kfde fmt check ran `cargo fmt -p ...` and failed with `failed to resolve
mod windows` for komorebic and komorebi-client: rustfmt follows the
cfg_select! branches of the shared entry files into files the KDE source does
not have. It is now a runCommand running tools/format-all --tree kde with the
rustfmt of the flake's own nightly (fmtToolchain, the toolchain craneLibFmt
already used) over komorebi-for-kde/**/*.rs and the linux modules of the
shared crates, file by file with skip_children and komorebi-for-kde/rustfmt.toml.
tools/format-all now takes the rustfmt of the root dev shell first (the same
pinned nightly) before a nightly on PATH, because a different nightly may
format differently or not follow cfg_select.

Verified: with the rustfmt of that very nightly (rust-overlay 19ecdd08,
rustfmt 1.11.0-nightly 2026-10-27, built from the flake's pins)
tools/format-all --check passes for kde, mac and windows on this tree, so the
only failure was the module resolution, not different formatting. The nix
attribute evaluates; not built.
2026-11-05 15:03:27 -08:00
LGUG2Z c670ab35c8 fix(tools): format-all passes its own arguments on when it re-runs inside the dev shell
format-all re-executes itself under 'nix develop' to get the nightly rustfmt, but it did so after its argument loop had shifted every argument away, so the re-run always used the defaults (--check, all trees): '--apply' silently only checked. The original arguments are now saved before parsing and passed on. Found when applying the final formatting of candidate 8: '--apply --tree windows' printed diffs and changed nothing. Verified: bash -n; the revisions after this one are the result of running --apply.
2026-11-05 15:03:27 -08:00
LGUG2Z c0ca0a83ad fix(nix): check the Windows formatting with the nightly rustfmt over the Windows files; add tools/format-all
The Windows fmt check ran the stable `cargo fmt` over the stubbed workspace
source: it failed on the empty stub lib.rs files of the other platforms, on
`mod linux;`/`mod macos;` of the shared entry files (the Windows source does
not have those modules), and its stable rustfmt ignores the nightly options of
rustfmt.toml. It is now a runCommand running tools/format-all --tree windows
with the nightly rustfmt over the files of the Windows source (build.real, no
stubs), file by file with skip_children.

tools/format-all runs the same check locally (--check, or --apply to format;
--tree windows|mac|kde|all; the nightly rustfmt from $RUSTFMT, PATH or the
root dev shell). mac is the explicit-file invocation of the kfm check, kde is
`cargo fmt -p ...` as the KDE check does.

Verified: in a throwaway copy of wip-cand7, --apply formats 17 Windows files
(+211 -88; crates/ komorebi-backend, bar-core, core, protocol, bar windows
modules, client windows.rs, komorebi-gui, testwin) and 12 KDE files
(+22 -29); afterwards --check passes for windows, mac and kde. The formatting
itself is not in this revision (other agents are editing those files). The nix
attribute evaluates; not built.
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 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 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
LGUG2Z 131a3cb9f8 build(tools): add fast-check, the minimal checks for the touched paths
Runs only the checks a jj diff needs (KDE cargo check and tests, macOS type-check, Windows
clippy through the nix dev shell, native crate tests, nix evaluation only) with persistent
target dirs, and prints the time of each. Copy of the host-side script (the original stays
in use outside the repository) with these differences:
- FAST_CHECK_SCRATCH defaults to `${XDG_CACHE_HOME:-$HOME/.cache}/komorebi-fast-check`
  instead of a /tmp/claude-1000/... scratchpad path (usage text updated);
- the fake C compiler is `$HERE/cc-fake.sh` (the script directory, resolved with readlink -f)
  instead of `$S/kfm/cc-fake.sh`;
- `tools/*` is classified like docs (no check), so a change to the tools alone prints
  "nothing to run" instead of listing every file as unclassified;
- the second `case` arm lost the patterns `Cargo.toml | Cargo.lock | .cargo/*`, which an earlier
  arm already catches (shellcheck SC2221/SC2222; no change in behaviour);
- header comment: "from anywhere inside a jj workspace of the repository", no mention of komomono.
Everything else is byte-identical (diff against the host copy).

Verified: bash -n and shellcheck clean; `tools/fast-check --list` from this workspace.
2026-11-05 15:03:26 -08:00
LGUG2Z 2a8b71f1c9 build(tools): add the fake C compiler and mac-check.sh for the macOS type-check on Linux
macOS cannot be built or linked on the Linux host; the way to type-check it is
`cargo check --target aarch64-apple-darwin --all-targets` with a fake C compiler so the
C -sys crates' build scripts succeed. That compiler was only a scratchpad file outside the
repository and mac-check.sh hardcoded a workspace path.

tools/cc-fake.sh: verbatim copy of the scratchpad cc-fake.sh (emits an empty object for
every compile, hands -E to the real gcc). No difference.

tools/mac-check.sh: new copy of the old script with these differences:
- no hardcoded `cd /home/jado/komomono-work/ws-step4/komorebi-for-mac`: the root comes from
  `jj root` (fallback `git rev-parse --show-toplevel`);
- the fake CC is `$HERE/cc-fake.sh` (next to the script) instead of `$S/kfm/cc-fake.sh`;
- the target dir is `${FAST_CHECK_SCRATCH:-${XDG_CACHE_HOME:-$HOME/.cache}/komorebi-fast-check}/target-fast-mac`
  instead of a /tmp/claude-1000 scratchpad;
- in the merged tree (komorebi-for-kde has its own Cargo.toml only in the old layout) it checks the
  packages fast-check checks (-p komorebi -p komorebi-macos -p komorebic-macos
  -p komorebi-client-macos -p komorebi-bar-macos) from the root; with the old separate workspace it
  keeps `cd komorebi-for-mac` and --workspace;
- /bin/sh became bash with `set -euo pipefail`; the old script's omission of --locked is kept
  (pass it as an extra argument).

Verified: bash -n and shellcheck clean. Not run: the check itself needs nix and the toolchain build.
2026-11-05 15:03:26 -08:00