- Hide up-to-date messaging in the update panel
- Simplify primary navigation to Overview, Cleanup, and Applications
- Keep Squid running in the tray with cleanup and purge actions
- Package macOS, Windows, and update manifest artifacts
The system panel has listed processes for a while, and a list of what is running
gets one question asked of it more than any other: this one is wedged, make it
stop. A panel that can name the hung app and then shrugs is scenery, so the
answer here is yes — spent through the machinery the interface already has for
irreversible things, a dialog that names what it is about to do and a log line
afterwards that says what it did.
The *how* is two lines and not very interesting: `kill(2)` with `SIGKILL`, or
`OpenProcess(PROCESS_TERMINATE)` followed by `TerminateProcess`. Both are the
same promise, which is why `squid_platform::process::force_stop` is called a
forced stop on every platform and the dialog says 强制结束 rather than anything
about saving. There is no TERM-then-KILL handshake in here, because there is no
polite promise to keep: the second line of the dialog is 它不会有机会保存任何内容.
`squid_stats::Sampler::stop` does not use `sysinfo`'s own `Process::kill`, and
the reason is the shape of its answer. It returns `false` for every way a stop
can fail, and two of those ways want opposite things from the reader. `ESRCH`
means the process left on its own and nothing is owed but a redraw; `EPERM`
means it is alive and the reader should go find an elevated terminal. Windows
serves the same pair up as `ERROR_INVALID_PARAMETER` and `ERROR_ACCESS_DENIED`.
A bool cannot carry that difference, so squid makes the call itself and keeps
the words the OS gave, quoted inside a sentence this program owns — the OS's
sentence arrives in the language of the OS, and translates no further than its
own frame.
The *whether* is where the damage is, so it is answered twice. First by rule, in
`squid-platform`: never this squid, never the first process of the machine, and
on Windows never one of the six names a boot rests on. Those rules exist because
the operating system does not enforce all of them. An unelevated squid on macOS
cannot reach `WindowServer` whatever it tries; an elevated squid on Windows
*can* open `csrss.exe` for termination, and the reward for one misplaced Enter
is a machine that reboots without asking. Six names is the whole cost of that
guard. `svchost` is deliberately absent from it, because it hosts services a
user may genuinely need to restart and the machine survives losing one — which
is the test a name has to pass before it belongs on that list.
Then by the operating system, whose answer is the only one with any authority
over this user, this token, this moment. Between the two sits the question the
platform module cannot answer, because it is a question about a sample rather
than about a pid: is the process holding this number still the process whose
name the user read? Pids are seat numbers, handed out again, and a process table
is drawn the moment the panel opens and read from seconds later. So
`squid_stats::Sampler::stop` reads the pid again through the new `sample_of`,
applies the rules to the process that is really there, and calls a name that no
longer matches *gone* — the thing that was pointed at really is gone, whichever
direction the pid moved. `shown_name` is why that comparison means anything:
macOS hands over a path and Windows a bare name, and the process table had been
trimming with `split('/')`, which does nothing at all to a Windows path. Nothing
was wrong on screen, because the name was already short there; it became
evidence, and evidence has to be spelled one way.
`x` is the same verb it has always been. On the three file panels it makes the
row under the cursor go away; the system panel has nothing to delete and does
have a process, so the same finger reaches the same meaning, and
`x_is_still_the_delete_key_on_a_list_of_files` pins the old meaning down so that
this one cannot push it aside. `d` still deletes everywhere. The rules are
applied in `ask_stop_process` *before* the dialog rather than after the answer:
a dialog that can only be answered "no" teaches the user that the dialog is
theatre, and the toast that names the rule says the same thing in less time.
Three crates now each hold a `sleeper()`, which is a duplication worth keeping
on purpose. The thing under test has to be a process — `sleep 60`, or
`ping -n 60 127.0.0.1` where `sleep` is not — and a kill feature tested against
a struct is a kill feature that has never killed anything. Twelve tests come
with this: five in the platform module, including the boot list and a vacant pid
reporting itself as gone; three in the sampler, one of which hands a pid to
`stop` under the wrong name and then checks that the innocent process is still
running; four in the interface, walking `x`, `y`, and a refusal from the key
press to the corpse being reaped. 190 tests green across the workspace, with
`cargo fmt --check` and `cargo clippy --workspace --all-targets` clean for the
host and for `x86_64-pc-windows-msvc` — the target where the boot list,
`TerminateProcess` and the parameter-is-incorrect mapping compile at all, which
is also where `the_processes_a_boot_rests_on_are_named_not_guessed` exists.
The Windows 10/11 box carries the part a mac can only compile. `squid.exe`
there builds with `Win32_System_Threading`, clippy clean under `-D warnings`,
185 tests green; and the dialog was read off the screen rather than off the
buffer — `TUI_COLS=140 TUI_ROWS=35 TUI_CP=936`, 2604 samples of the raw ConPTY
stream, 291 settled frames, 0 of them failing the layout judge, including the
confirm itself: `╭ 结束 iNodeCmn.exe? ╮` / `pid 9080 · 1.2% · 15.4 MB` /
`它不会有机会保存任何内容` / `回车 / y 确认 · n / esc 取消`, and 「已取消」 after `n`.
`docs/ARCHITECTURE.md` gains the module and the key, and one of its diagrams
finally admits that `squid-stats` has depended on `squid-platform` for weeks.
- squid-core: trash moves behind a platform seam — Windows recycles via
IFileOperation (shell owns $Recycle.Bin bookkeeping; ledger records no
physical path there), Unix keeps the rename/copy path untouched
- squid-core: default cleanup anchors per platform; Unix-only helpers
(getuid, statvfs-style trash dirs, symlink copy) gated
- squid-platform: windows.rs rewritten — installed apps from the uninstall
registry (HKLM 64/32-bit views + HKCU, SystemComponent/patch filtering),
BIOS/NT version keys for hardware/OS strings, sysinfo for volumes and
running processes; winreg replaces the PowerShell stub
- squid-stats: COMPUTERNAME hostname off-unix; battery parsers gated
- CI: .gitlab-ci.yml with a Linux job that cross-checks the whole workspace
against x86_64-pc-windows-msvc, plus a manual tagged Windows job driven by
scripts/ci-windows.ps1 (build + test on a real machine)
- host (macOS) tests, clippy -D warnings and fmt stay green