nex_squid/crates
mula.liu 9f1cf348a4 Tell the truth about a run, in prose and in JSON
Found by pointing the hardware checks at the binary they were meant to test.

`purge --json --yes` printed a human plan on stdout before its JSON, so the
first thing a machine reading that output saw was `Invalid JSON primitive`.
The design already had the right rule — `diag`/`shout`/`heading` go to stderr
under `--json` — but anything that printed an already-formatted line bypassed
it. `say` is now that one writer, and the `\r` progress spinner writes to
stderr whenever `--json` owns stdout, so a progress bar can no longer land
inside a document.

Being quiet on stdout is only useful if the document is still complete, and it
was not: the early return was conditioned on `!yes`, so `--json --dry-run`
printed no JSON at all, and the nothing-to-do paths returned before the
summary existed. Both now emit one document; `undo` keeps its own shape because
it always reaches the remove plan and would otherwise print twice.

`undo` also lied. It reported "1 could not be put back (path in use)" for every
entry, because the ledger's recycle-bin destination is always empty on Windows:
`IFileOperation` moves the file and the shell takes over the bookkeeping, so
squid never has a destination to move back from. The run had succeeded. It now
checks the session's mode and says the true thing — those files are in the
Recycle Bin, restore them there.

Finally, the copy that named the wrong operating system: `--trash` help, the
confirmation prompt, `history` and `doctor` all said Trash on a box whose shell
says Recycle Bin. The history column widens for the longer name instead of
eliding it.
2026-10-15 18:55:01 +08:00
..
squid-cli Tell the truth about a run, in prose and in JSON 2026-10-15 18:55:01 +08:00
squid-core Measure long paths, and clean up after a failing fixture 2026-10-15 18:53:31 +08:00
squid-engine Stop matching path separators in suffixes 2026-10-15 16:51:00 +08:00
squid-platform Let the platform answer questions about the platform 2026-10-15 18:54:51 +08:00
squid-rules Windows: safety layer, rule engine fixes, and 30 built-in cleanup rules 2026-10-15 15:23:19 +08:00
squid-stats Windows: real platform layer, recycle-bin trash backend, cross-compile CI 2026-10-15 14:56:55 +08:00
squid-tui Draw what the Windows console can actually carry 2026-10-15 18:54:51 +08:00