- 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
`windows_allocation` built its UTF-16 argument with `to_string_lossy`, so a
path that an `OsString` can hold but a `String` cannot arrived at
`GetCompressedFileSizeW` with replacement characters in it, and any path past
the 260-character legacy limit was answered with `ERROR_PATH_NOT_FOUND` — the
deep `node_modules` trees this tool exists to measure cross that line
routinely. `wide_path` keeps every UTF-16 unit and adds the verbatim prefix
only where it is honest (absolute, no `.` or `..`), because the prefix also
switches off normalisation.
The scratch-directory fixture now removes itself even when an assertion
panics halfway through. That is not housekeeping: a file extended with
`set_len` is charged as if written in full, and one surviving fixture sat on
the test machine's disk at 11 GB — in `AppData\Local\Temp`, where squid then
correctly offered it back as junk.
`FileStandardInfo.AllocationSize` turned out to be the wrong question. Measured
against `fsutil` and `compact` on a real Windows 10 volume:
- it returns the cluster-rounded logical length for ordinary files, including
1 GiB files extended by `SetEndOfFile` (NTFS does hand over the whole tail,
and free space moves accordingly) and sub-cluster files living in `$MFT`;
- it reported the full 8 MiB for a file `compact` accounts as 1,572,864 stored
bytes, i.e. it is blind to NTFS compression, which is the one way Windows
really does hide size on disk;
- `FSCTL_QUERY_ALLOCATED_RANGES` reported that same compressed file as fully
allocated, so "which clusters exist" is not "what do they weigh".
`GetCompressedFileSizeW` answers 1,572,864, matching `compact` byte for byte.
It takes the path we already hold instead of a handle, so it is one query per
file rather than a `CreateFileW` pair, and it keeps answering while another
process holds the file open exclusively — the normal state of a cache file.
That also removes the `ALLOCATION_PROBE_MIN` cutoff: it existed to avoid a
handle per small file, and small files on a compressed volume need the honest
number just as much.
Guard the zero answer behind `FILE_ATTRIBUTE_COMPRESSED`/`SPARSE_FILE` (free
from the `Metadata` we already have) so a deleted-but-still-open file cannot
zero out a total the user is about to act on, and read `GetLastError` to tell
failure from a genuine 4 GiB-minus-one length.
Tests: each platform now gets the fixture that provokes its own divergence —
POSIX holes for `st_blocks`, and a `compact`-compressed file for the Windows
path. The old Windows sparse fixture proved nothing: extending a file does not
hole out on NTFS, and `FSCTL_SET_SPARSE` is refused outright on this volume
(`ERROR_INVALID_FUNCTION`), as is `FSCTL_SET_COMPRESSION`
(`ERROR_ACCESS_DENIED`) even for a file we created ourselves.
The purge test compared rendered path strings against `demo/node_modules` and
friends, so on Windows every positive assertion failed and the negative one —
`loose/dist` must not be offered — passed for the wrong reason. Assertions now
compare trailing components, which is what they meant all along and holds on
both separators.
`category_index` made the same assumption in production: it lowercased the path
and looked for `/library/caches`, so a leftover root was only ever reclassified
on the OS whose separator it was written for.
Real Windows 10 hardware turned up two failures the macOS and cross-compile
checks could not see:
- squid-core::fs reported every file's logical length as its allocated size,
because `allocated_bytes` returned 0 on non-Unix and `on_disk()` then fell
back to logical. NTFS only answers the allocation question through a handle,
so ask `GetFileInformationByHandleEx(FileStandardInfo)` for files big enough
to distort a total. Files below the cutoff keep counting as their length,
which is also what keeps MFT-resident entries — they report an allocation of
0 — from shrinking a cache cleanup down to nothing.
- the "a plain user can still uninstall into /Applications" safety test hard
coded a Unix path, so on Windows it asserted that a folder the policy never
looked at was refused. The fixture now comes from the policy's own shared
install folder, `/Applications` on Unix and the machine-wide program-data
folders on Windows.
Also added:
- `a_written_file_reports_what_the_volume_gave_it`, the cross-platform
invariant the missing backend silently violated.
- the sparse-file test now marks its file sparse via `fsutil` on Windows and
skips when the volume will not cooperate, instead of pretending a hole
exists.
- `scripts/win-sync.sh`, `scripts/win-check.ps1` and `scripts/win-hwcheck.ps1`
for iterating against a LAN Windows host over SSH without git credentials.
- new squid_core::elevation_hint(): sudo on Unix, elevated Administrator
terminal on Windows; used by the locked-item notes in clean/uninstall
and the user-only safety refusal.
- the Permission error no longer tells Windows users to grant Full Disk
Access (a macOS-only concept).
- paths: platform-semantic comparisons. Component keys are lower-cased
and canonical \\?\\ verbatim prefixes folded away on Windows, so
is_within/same_path/depth_below/relative_below match how the OS
actually resolves paths; pretty() got the same treatment.
- safety: drive roots and UNC roots are hard-denied (is_root_like);
Windows hard-deny grows env-derived entries (SystemRoot, ProgramFiles,
ProgramData, USERPROFILE, ...); DENY_EXACT gains the AppData tree and
shell folders; OUTSIDE_HOME_OK becomes platform-supplied
(%ProgramData%, %PUBLIC% mirror /Applications); a path containing
$Recycle.Bin / System Volume Information / Recovery is always refused;
the canonicalize-vs-expected symlink probe now compares with
platform semantics instead of raw equality.
- rules: $VAR heads stop at backslashes too; ${VAR} resolves in every
occurrence; glob component matching is case-insensitive on Windows;
protect patterns normalise \\ to / so protections keep working there;
anchor_for keeps drive prefixes instead of bailing out, and folds
Prefix+RootDir into a rooted C:\ anchor.
- rules/windows.toml: 30 rules for Win10/11 (temp, WER/crash dumps,
browser caches, shell caches, dev caches, Windows.old, Package Cache)
embedded under cfg(windows) and parse-checked on every host.
- 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