Repository navigation
Conversation
…paths On Windows the update notice said "run 'proofline update'", but that command could never work there. It looked for the Unix installer folder ($HOME/.local/bin or PROOFLINE_INSTALL_DIR) and a binary called "proofline" without ".exe". So it failed with "set HOME or PROOFLINE_INSTALL_DIR", or with "this binary is outside the installer directory", even when PROOFLINE_INSTALL_DIR was the folder holding proofline.exe. It never showed the manual steps from the README. On Windows, install() now stops before any path check or download. It returns an error that lists the README's steps: close Proofline, download proofline-x86_64-pc-windows-msvc.tar.gz and SHA256SUMS from the latest GitHub release, check the hash with Get-FileHash, extract the archive and replace this binary (its path is printed). The exit status stays non-zero because nothing was updated. The Windows notice now says "'proofline update' shows how to install it". Linux and macOS behave exactly as before. Tests: windows_update_explains_the_manual_steps (tests/update.rs, Windows only, runs the real binary from a README-style folder with and without HOME) fails on main and passes now. windows_notices_point_to_the_manual_steps (src/update/tests.rs, runs on every OS) checks both notice texts and the steps.
| fn windows_steps(executable: Option<&Path>) -> String { | ||
| const ARCHIVE: &str = "proofline-x86_64-pc-windows-msvc.tar.gz"; | ||
| let executable = executable.map_or_else( | ||
| || "proofline.exe".to_owned(), |
There was a problem hiding this comment.
Serious · Windows update instructions can overwrite the installed executable
The Windows update command tells users to extract a root-level proofline.exe into the current directory, overwriting the installed copy if run from its directory.
Interrupted extraction can leave the installed proofline.exe unusable before the replacement step.
Direct users to extract into a fresh staging directory, then replace the installed executable only after extraction succeeds.
There was a problem hiding this comment.
Fixed in 92a28dd. You're right: tar -xzf writes proofline.exe into the current folder, so running it next to the installed copy overwrote it, and an interrupted extract left it broken. Step 4 now extracts into a new folder (mkdir proofline-new; tar -xzf ... -C proofline-new), and step 5 replaces the installed binary only if that succeeded. I followed the new steps on Windows 11 with v0.5.2: the hash matched SHA256SUMS, tar exited 0, and proofline-new\proofline.exe --version prints proofline 0.5.2.
| .latest | ||
| .as_ref() | ||
| .filter(|latest| newer(latest)) | ||
| .map(|latest| format!("proofline {latest} is available; run 'proofline update'")) | ||
| .map(|latest| notice(latest, cfg!(target_os = "windows"))) |
There was a problem hiding this comment.
Warning · Detached discovery test fails on Windows
The test still requires Unix-only wording after this change gives Windows a different update notice.
On Windows, the test panics after the refreshed cache yields the expected update notice.
Check for the platform-independent version announcement both before and after the cache refresh.
There was a problem hiding this comment.
Fixed in 92a28dd. Correct: the assertion at src/update/tests.rs:358 still wanted the Unix text. On this machine the C-1 pipe timeout (fixed in prooflinedev#79) currently hides it. Both checks now use the platform's text (notice("9.0.0", cfg!(target_os = "windows")) after the refresh, and the platform-independent proofline 9.0.0 is available; before it). Verified by merging prooflinedev#79's branch into a throwaway branch: update::tests 9/9 pass on Windows.
| fn windows_steps(executable: Option<&Path>) -> String { | ||
| const ARCHIVE: &str = "proofline-x86_64-pc-windows-msvc.tar.gz"; | ||
| let executable = executable.map_or_else( | ||
| || "proofline.exe".to_owned(), |
There was a problem hiding this comment.
Warning · Windows update instructions omit the replacement path on lookup failure
When current_exe() fails, proofline update tells users to replace proofline.exe with the extracted proofline.exe without identifying the installed copy.
Users may replace the wrong copy and leave their installation unchanged.
Say the installed path could not be detected and explain how to locate the executable they launched before replacing it.
There was a problem hiding this comment.
Fixed in 92a28dd. When current_exe() fails, step 5 now says replace the proofline.exe you ran (find it with '(Get-Command proofline).Source'). A unit test covers it (windows_steps(None, None)).
| .latest | ||
| .as_ref() | ||
| .filter(|latest| newer(latest)) | ||
| .map(|latest| format!("proofline {latest} is available; run 'proofline update'")) | ||
| .map(|latest| notice(latest, cfg!(target_os = "windows"))) |
There was a problem hiding this comment.
Warning · Windows update link can serve an older release than the notice
The Windows notice advertises the discovery version, but proofline update links to GitHub’s independently promoted latest release. The workflow advances discovery before promoting the GitHub release.
Users can verify and reinstall an older binary without getting the advertised update.
Link to version-pinned downloads for the advertised release, or tell users to confirm the release version before replacing their binary.
There was a problem hiding this comment.
Fixed in 92a28dd. Confirmed in release.yml: publish-r2.sh uploads latest (what the notice reads) before gh release edit --latest, so releases/latest can still show the old version for a while. install() on Windows now reads the local update cache, the same value the notice showed. When that is a newer version, the steps link to that version's pinned files, https://proofline.sh/cli/download/<version>/... (the files the Unix updater verifies). These exist before GitHub promotes the release. The value has already passed version() via newer(), so it is only digits and dots. Without a cached newer version, the GitHub page stays as the fallback. Still no network call, so the tests stay offline. The integration test now covers both cases.
| // `update` must explain those steps instead of failing on Unix installer paths. | ||
| #[cfg(windows)] | ||
| #[test] | ||
| fn windows_update_explains_the_manual_steps() { |
There was a problem hiding this comment.
Warning · PR checks skip the Windows update integration test
The Ubuntu test job excludes windows_update_explains_the_manual_steps, and the Windows job runs neither the test nor proofline update.
Removing the Windows early return can leave PR checks green while Windows users get installer errors instead of manual update instructions.
Run cargo test --locked --test update windows_update_explains_the_manual_steps in the Windows job.
Details
The helper test checks the instruction text directly, so it still passes if install stops calling windows_steps.
There was a problem hiding this comment.
Partly agree, no change in this PR. It's true that CI never runs cargo test on Windows, and the test is #[cfg(windows)], so Ubuntu never compiles it. But the README asks outside contributors to open an issue for workflow changes, not a PR. I'll raise it in a separate CI issue, together with the other Windows-only failures (C-1, the mcp SYSTEMROOT tests). On your detail: the integration test runs the real binary, so on Windows it does fail if install stops calling windows_steps. I ran it locally (RED on main, GREEN here). It just isn't run by CI yet.
There was a problem hiding this comment.
Proofline recorded no decision on this finding. To record one, reply with only fixed, dismiss, accept risk or confirm.
| .latest | ||
| .as_ref() | ||
| .filter(|latest| newer(latest)) | ||
| .map(|latest| format!("proofline {latest} is available; run 'proofline update'")) | ||
| .map(|latest| notice(latest, cfg!(target_os = "windows"))) |
There was a problem hiding this comment.
Warning · Notice tests miss Windows falling back to Unix wording
The new tests call notice directly, while the cached-discovery fixture expects Unix wording even on Windows.
The tests would pass if suggestion always selected Unix wording.
Assert platform-specific wording from the cached invocation and run that test on Windows.
There was a problem hiding this comment.
Fixed in 92a28dd. windows_notices_point_to_the_manual_steps now also asserts suggestion(&cache, ["status"], true) == notice("9.0.0", cfg!(target_os = "windows")). Mutation check on Windows: hard-coding notice(latest, false) in suggestion makes the test fail at src/update/tests.rs:218. The cached-discovery test checks the platform text as well (see the other thread).
| .arg("update") | ||
| .env("PROOFLINE_NO_UPDATE_CHECK", "1") | ||
| .env("LOCALAPPDATA", directory.path()) | ||
| .env_remove("PROOFLINE_INSTALL_DIR") |
There was a problem hiding this comment.
Warning · Windows update test fails when the temporary path contains HOME
The test requires stderr to include the executable path but rejects any occurrence of HOME, including within that path.
Correct manual update instructions fail the test under a temporary directory containing HOME.
Check for the specific installer diagnostic set HOME or PROOFLINE_INSTALL_DIR instead.
There was a problem hiding this comment.
Fixed in 92a28dd. The check is now !stderr.contains("set HOME or PROOFLINE_INSTALL_DIR"), the exact old error, so a temporary path containing HOME can't make it fail.
…fely Proofline review, round 1: - Extracting with 'tar -xzf' in the current folder could overwrite the installed proofline.exe (and leave it broken if interrupted). The steps now extract into a new 'proofline-new' folder and replace the binary only after that succeeded. - The notice's version comes from https://proofline.sh/cli/latest, which the release workflow publishes before GitHub marks the release as latest, so 'releases/latest' could still be the old version. When the local cache holds the newer version the notice showed, the steps now link to that version's pinned downloads on proofline.sh (the same files the Unix updater verifies). Still no network call. - When the binary's own path can't be read, the steps say how to find it: '(Get-Command proofline).Source'. - Tests: the cached-discovery test now accepts the Windows wording; a new assertion checks that suggestion() picks the platform's wording; the Windows integration test also covers the pinned links and checks for the exact old error instead of any "HOME".
| 2. Download {download}\n \ | ||
| 3. Run 'Get-FileHash -Algorithm SHA256 {ARCHIVE}' and check that the hash matches the archive's line in SHA256SUMS.\n \ | ||
| 4. Extract it into a new folder: 'mkdir proofline-new; tar -xzf {ARCHIVE} -C proofline-new'.\n \ | ||
| 5. Only if that succeeded, replace {executable} with proofline-new\\proofline.exe." |
There was a problem hiding this comment.
Serious · Windows update extraction can overwrite an existing staged executable
Step 4 uses a fixed staging directory and runs tar even if mkdir reports that the directory already exists.
Following the instructions can overwrite an existing proofline-new\proofline.exe before step 5.
Create a unique staging directory and extract only after its creation succeeds.
There was a problem hiding this comment.
Fixed in af2f6b2. Right: in PowerShell ; runs tar even when mkdir failed because the folder exists. The overwritten file was only a staged copy, never the installed binary, but an old staged copy could still be reused. Creating the empty folder is now its own step (mkdir proofline-new, choose another name if it already exists), and extracting is the next step. A name that changes on every run would be harder to type and to explain in one line.
| let download = latest.map_or_else( | ||
| || { | ||
| format!( | ||
| "{ARCHIVE} and SHA256SUMS from https://github.com/prooflinedev/cli/releases/latest" |
There was a problem hiding this comment.
Warning · Windows manual update can downgrade Proofline
Without a newer cached version, proofline update points Windows users to GitHub’s latest release and tells them to replace the executable without checking the release version.
Following the steps can replace a newer installed binary with a checksum-verified older one.
Tell users to compare the release version with proofline --version and stop unless the release is newer.
Details
The release workflow publishes versioned artifacts before promoting the GitHub release, so a user can already be running a newer version when the fallback points to the previous release.
There was a problem hiding this comment.
Fixed in af2f6b2. Correct: without a cached newer version, this binary may already be the newest one. The GitHub fallback now says (stop if that release is not newer than this proofline 0.5.2), with the running version from CARGO_PKG_VERSION. The unit test checks it.
| .map(|latest| notice(latest, cfg!(target_os = "windows"))) | ||
| } | ||
|
|
||
| fn notice(latest: &str, windows: bool) -> String { |
There was a problem hiding this comment.
Warning · CI misses regressions to Unix-only update notices on Windows
The routing assertions use the test runner’s platform. Only Ubuntu runs them in CI; the Windows smoke job never checks a cached update notice.
CI stays green if suggestion() always selects Unix wording.
Run windows_notices_point_to_the_manual_steps in the Windows CI job.
A person accepted this risk earlier. It is posted again because it cites new evidence: src/update/tests.rs lines 213–221 (not cited before).
Also at:
src/update/tests.rslines 372 to 376
| assert!( | ||
| !String::from_utf8(output.stdout) | ||
| .unwrap() | ||
| .contains("run 'proofline update'") | ||
| .contains("proofline 9.0.0 is available;") |
There was a problem hiding this comment.
Warning · Discovery test misses premature notices for other versions
The pre-refresh assertion only rejects notices for 9.0.0, so a notice for a fallback version can slip through while the cache still has no version.
The test can pass even if users see an update notice before discovery finishes.
Reject notice lines matching the shared proofline <version> is available; format for any version.
There was a problem hiding this comment.
Fixed in af2f6b2. The pre-refresh check now rejects any line with is available;, the text every notice shares, not only 9.0.0. With prooflinedev#79 merged locally, update::tests is 9/9 on Windows.
| // `update` must explain those steps instead of failing on Unix installer paths. | ||
| #[cfg(windows)] | ||
| #[test] | ||
| fn windows_update_explains_the_manual_steps() { |
There was a problem hiding this comment.
Warning · PR checks skip the Windows update regression test
Ubuntu excludes the Windows-only integration test, and Windows CI only builds and smoke-tests unrelated commands.
Removing the Windows early return from install() would leave PR checks green for both cached and uncached updates.
Run cargo test --locked --target x86_64-pc-windows-msvc --test update windows_update_explains_the_manual_steps in the Windows job.
Proofline review, round 2: - Without a cached newer version, the steps point to GitHub's latest release, which may not be newer than the running binary. They now print this binary's version and say to stop if the release isn't newer. - In PowerShell, 'mkdir proofline-new; tar ...' runs tar even when mkdir failed because the folder exists, so an older staged copy could be reused. Creating the empty folder is now its own step (pick another name if it exists), before extracting. - The cached-discovery test now rejects any "is available;" notice before the refresh, not only one for 9.0.0.
|
On the two CI findings (accept risk): CI never running |
| 4. Create an empty folder with 'mkdir proofline-new' (choose another name if it already exists).\n \ | ||
| 5. Extract into it with 'tar -xzf {ARCHIVE} -C proofline-new'.\n \ | ||
| 6. Only if that succeeded, replace {executable} with proofline-new\\proofline.exe." |
There was a problem hiding this comment.
Serious · Windows update can overwrite files in the existing staging folder
Step 4 tells users to choose another folder if proofline-new exists, but steps 5 and 6 still use proofline-new.
Copying the printed tar command can overwrite files in the existing folder and leave the new folder unused.
Store the chosen folder in a PowerShell variable and use it for both extraction and the replacement source.
| || { | ||
| // No newer version is known, so this may already be the newest one. | ||
| format!( | ||
| "{ARCHIVE} and SHA256SUMS from https://github.com/prooflinedev/cli/releases/latest \ |
There was a problem hiding this comment.
Warning · Windows update steps can reinstall an older release
If a browser renames duplicate downloads, the Windows guide still hashes and extracts the unsuffixed archive and checks the unsuffixed SHA256SUMS.
An older matching pair can pass verification and install the older executable even with an empty extraction folder.
Download both files into a fresh directory and use those exact paths for verification and extraction.
| fn windows_steps(executable: Option<&Path>, latest: Option<&str>) -> String { | ||
| const ARCHIVE: &str = "proofline-x86_64-pc-windows-msvc.tar.gz"; | ||
| let download = latest.map_or_else( | ||
| || { |
There was a problem hiding this comment.
Warning · Windows update recommends an unusable executable on 32-bit Windows
On 32-bit Windows, proofline update tells users to replace a working source build with the x86-64 release without checking OS compatibility.
Users who follow the guide can no longer run proofline until they restore a compatible build.
Recommend the archive only when Windows can run it; otherwise direct users to rebuild from source.
| 4. Create an empty folder with 'mkdir proofline-new' (choose another name if it already exists).\n \ | ||
| 5. Extract into it with 'tar -xzf {ARCHIVE} -C proofline-new'.\n \ |
There was a problem hiding this comment.
Warning · Windows update tests miss regressions that reuse a staging folder
The unit test checks mkdir and tar independently, and the CLI test checks only the extraction destination.
Both tests still pass if the collision warning disappears or directory creation and extraction become one unconditional command.
Assert that the guidance requires an empty folder, tells users to choose another name on collision, and puts extraction in a separate subsequent step.
| let cache = directory.path().join("proofline").join("update.json"); | ||
| std::fs::create_dir_all(cache.parent().unwrap()).unwrap(); | ||
| let checked = SystemTime::now() | ||
| .duration_since(UNIX_EPOCH) |
There was a problem hiding this comment.
Warning · Windows update tests miss stale cached versions
The CLI fixture tests only a missing cache or a newer version, and the helper test bypasses install(). Both would pass without the newer filter.
Windows update could recommend an older or equal release without the version warning, and these tests would still pass.
Add a CLI case caching the running version and assert that stderr gives the fallback URL and version warning, not a pinned download.
| assert!( | ||
| String::from_utf8(output.stdout) | ||
| .unwrap() | ||
| .contains("run 'proofline update'") | ||
| .contains(¬ice("9.0.0", cfg!(target_os = "windows"))) |
There was a problem hiding this comment.
Warning · Tests miss a Windows notice that promises automatic updates
The discovery test uses notice() to generate its expected text, and the wording test checks only fragments that stop short of the installation guidance.
Both tests can pass if the Windows notice incorrectly promises automatic installation.
Assert the full Windows notice against a fixed expected string, independent of notice().
| for (home, cached, download) in [ | ||
| ( | ||
| None, | ||
| false, |
There was a problem hiding this comment.
Warning · Windows update test misses downgrade guidance from an older cache
The Windows CLI test covers an empty cache and a newer cached release, so removing the newer() filter leaves both outcomes unchanged.
The test would still pass if proofline update offered pinned download links for an older cached release.
Seed an older cached version and assert that stderr shows the guarded fallback and no pinned links for that version.
The problem in one sentence
On Windows the CLI tells you to run
proofline update, but that command always fails there, with errors that send you the wrong way, and it never shows the manual update steps the README describes.Why it happens, step by step
suggestion()(src/update.rs) printsproofline X is available; run 'proofline update'on every OS.proofline updatecallsinstall(). Its first step,destination(), looks for the Unix installer folder:PROOFLINE_INSTALL_DIR, or else$HOME/.local/bin. A normal Windows PowerShell has noHOMEvariable, so the command stops withset HOME or PROOFLINE_INSTALL_DIR.HOMEorPROOFLINE_INSTALL_DIRset,install_path()expects<folder>/proofline, with no.exe. The Windows binary isproofline.exe, so this check can never pass, and the error says the binary is "outside the installer directory", even when that folder is the one holding it.target()would say "no official Proofline release is built for windows", which is false: every release shipsproofline-x86_64-pc-windows-msvc.tar.gz.Who is affected
Everyone who installed the official Windows release. They see the notice on every interactive command until they update, and the command it names can't help them.
What this PR changes (
src/update.rs, ~50 lines)install(): on Windows it now stops first, before any path check or download. It returns an error that lists the README's steps:SHA256SUMS.Get-FileHash -Algorithm SHA256.mkdir proofline-new, another name if it already exists).tar -xzf … -C proofline-new), so an interrupted extract can't damage the installed copy.current_exe(). If the path can't be read, the step says to find it with(Get-Command proofline).Source.The exit status stays non-zero because nothing was updated, so a script doesn't think the update worked.
Which download links: the notice's version comes from
https://proofline.sh/cli/latest, andrelease.ymlpublishes that file before GitHub marks the release as latest. If the local update cache holds a newer version (the one the notice showed), the steps link to that version's pinned files,https://proofline.sh/cli/download/<version>/…, the same files the Unix updater verifies. Otherwise they point to the GitHubreleases/latestpage and print this binary's version, with "stop if that release is not newer", so nobody downgrades by accident. The cached value has already passedversion()(only digits and dots) before it goes into a URL.notice(): the notice text moved into a small function. On Windows it readsproofline X is available; 'proofline update' shows how to install it. On Linux and macOS it is the same text as before.windows_steps(): builds the steps text. It is a plain function, so its test runs on Linux CI too.Linux and macOS behave exactly as before.
destination(),install_path()andtarget()are unchanged.Why not the obvious alternatives
.exe, so this needs a rename-aside step, cleanup on the next start, and zip/tar handling. That's a feature with its own risks, and the README says self-update doesn't install Windows binaries, so it should be the maintainer's call (offered in the issue).proofline updatewould still get the misleading errors.How I tested it (Windows 11, Rust 1.100.0)
Reproduced first on
main(105f387), withproofline.execopied into a folder as the README says:mainHOME)set HOME or PROOFLINE_INSTALL_DIRhttps://proofline.sh/cli/download/9.0.0/…, exit 1HOME=%USERPROFILE%…outside the installer directory C:\Users\…\.local/bin…PROOFLINE_INSTALL_DIR=<the folder holding proofline.exe>…outside the installer directory <that same folder>…proofline 9.0.0 is available; run 'proofline update'proofline 9.0.0 is available; 'proofline update' shows how to install itThe notice only appears when both output streams are a console, so I ran the binary in a new PowerShell window and read its screen buffer (
$host.UI.RawUI.GetBufferContents).The printed steps work: I followed them for v0.5.2 from both sources, GitHub
releases/latestand the pinnedhttps://proofline.sh/cli/download/0.5.2/….Get-FileHashgavee5631d11…500a, which matches its line inSHA256SUMS.mkdir proofline-newthentar -xzf … -C proofline-newexited 0, andproofline-new\proofline.exe --versionprintsproofline 0.5.2.New tests, written before the fix:
tests/update.rs::windows_update_explains_the_manual_steps(Windows only): runs the real binary from a README-style folder, with and withoutHOME, and with a cached newer version. It checks that the update fails, prints nothing on stdout, names the right download links,SHA256SUMS,Get-FileHash, the new-folder extract and the binary's own path, never shows the oldset HOME or PROOFLINE_INSTALL_DIR/ "outside the installer directory" errors, and leaves the binary untouched. Fails onmain(…missing from proofline: set HOME or PROOFLINE_INSTALL_DIR), passes now.src/update/tests.rs::windows_notices_point_to_the_manual_steps(every OS): checks both notice texts (the Unix one is unchanged), thatsuggestion()picks the wording of the platform it runs on, and the steps with and without a known path and version. Mutation check: hard-coding the Unix wording insuggestion()makes it fail.detached_discovery…now expects the platform's notice text after the refresh, and no notice of any version before it. It times out on Windows because of the pipe issue that Windows: don't make scripts wait for the background update check prooflinedev/cli#79 fixes. With Windows: don't make scripts wait for the background update check prooflinedev/cli#79 merged into a throwaway branch, all ofupdate::tests(9/9) passes on Windows.cached_update_preserves_schema_help_and_source_installationstill passes. On Windows the update still fails, prints nothing on stdout and leaves the files untouched.Whole suite:
cargo fmt --checkclean.cargo test --locked --no-fail-fastgives the same 8 failures onmainand on this branch, none of them about the update command's output:tests/mcp.rs(5),tests/agent_install.rs,tests/local_patch.rsandupdate::tests::detached_discovery…(the Windows pipe issue fixed in prooflinedev#79).cargo clippy --all-targetsreports the same 3 errors as onmain, all insrc/agent/tests.rs, which this PR doesn't touch.