Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fea4959
feat(windows): add verified CLI installer with journaled recovery
ThunderKhan Nov 23, 2026
aa12ba4
test(windows): cover archive validation and offline recovery
ThunderKhan Nov 23, 2026
2ab4218
test(windows): exercise real upgrades, locking, and interruption reco…
ThunderKhan Nov 23, 2026
d40ef39
ci(windows): test both PowerShell editions and User PATH persistence
ThunderKhan Nov 23, 2026
ef91fbf
docs(windows): document installation, tests, and safety boundaries
ThunderKhan Nov 23, 2026
55624bb
fix(windows): harden upgrade recovery, PATH integrity, and timeouts
ThunderKhan Nov 23, 2026
6202c61
test(windows): repair interruption harness and enforce syntax checks
ThunderKhan Nov 23, 2026
5c3cf20
test(windows): recognize quarantined partial-stage evidence
ThunderKhan Nov 23, 2026
af6e9e2
fix(windows): roll back upgrades when installed postcheck fails
ThunderKhan Nov 23, 2026
08129b5
fix(windows): address Proofline installer recovery review findings
ThunderKhan Nov 23, 2026
e5d1e41
fix(windows): harden recovery and CI against Proofline review findings
ThunderKhan Nov 23, 2026
b1d0424
fix(windows): close reviewed recovery and PATH concurrency gaps
ThunderKhan Nov 23, 2026
6025759
fix(windows): harden release validation and recoverable postchecks
ThunderKhan Nov 23, 2026
9495672
fix(windows): repair interruption CI and address review findings
ThunderKhan Nov 23, 2026
1544f30
test(windows): exercise production lock and locked-journal rollback
ThunderKhan Nov 23, 2026
5a56c54
test(windows): cover latest-release entrypoint and expandable PATH re…
ThunderKhan Nov 23, 2026
bfac24a
fix(windows): pin install directory chain across filesystem transactions
ThunderKhan Nov 23, 2026
c7db95e
test(windows): prove pinned install directory denies rename
ThunderKhan Nov 23, 2026
107c4da
revert(windows): avoid unproven directory pinning semantics
ThunderKhan Nov 23, 2026
9a007f2
fix(windows): close outstanding installer security and review regress…
ThunderKhan Nov 23, 2026
efa6fed
fix(windows): recover corrupt journals and verify recovery ordering
ThunderKhan Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,20 @@ jobs:
persist-credentials: false
- run: cargo build --release --locked --target x86_64-pc-windows-msvc
- run: python scripts/archive.py x86_64-pc-windows-msvc
- shell: pwsh
- name: Check packaged archive with PowerShell 5.1 and PowerShell 7
shell: pwsh
run: |
tar -xzf artifacts/proofline-x86_64-pc-windows-msvc.tar.gz -C artifacts
$archive = 'artifacts/proofline-x86_64-pc-windows-msvc.tar.gz'
$built = 'target/x86_64-pc-windows-msvc/release/proofline.exe'
foreach ($engine in @('powershell.exe', 'pwsh.exe')) {
& $engine -NoProfile -NonInteractive -File scripts/check_windows_release_archive.ps1 -ArchivePath $archive -ExecutablePath $built
if ($LASTEXITCODE -ne 0) { throw "$engine rejected the packaged Windows executable." }
}
tar -xzf $archive -C artifacts
if ((Get-FileHash -LiteralPath './artifacts/proofline.exe' -Algorithm SHA256).Hash -cne
(Get-FileHash -LiteralPath $built -Algorithm SHA256).Hash) {
throw 'Smoke-tested Windows executable differs from installer-validated archive.'
}
& ./artifacts/proofline.exe --version
if ($LASTEXITCODE -ne 0) { throw "Windows executable failed" }
& ./artifacts/proofline.exe setup --print
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ jobs:
fi
fi
python3 scripts/archive.py "$TARGET"
- name: Validate packaged Windows release with both PowerShell engines
if: matrix.target == 'x86_64-pc-windows-msvc'
shell: pwsh
Comment on lines 84 to +87

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Archive gate can pass packages Windows PowerShell 5.1 rejects

The package gates validate with pwsh only, whose gzip decoder can read a tar stream split across gzip members that Windows PowerShell 5.1 sees as truncated.

A packaging regression can pass validation but prevent installation on Windows PowerShell 5.1.

Validate the exact packaged archive under both PowerShell engines before upload.

Details

The current packager writes a single gzip member, so this is a regression-detection gap, not a failure of today's artifact. The two-engine fixture workflow does not consume the newly built archive.

View finding in Proofline

Also at:

run: |
$archive = 'artifacts/proofline-x86_64-pc-windows-msvc.tar.gz'
$built = 'target/x86_64-pc-windows-msvc/release/proofline.exe'
# Validate exactly the archive being uploaded, not the separate
# Checks workflow build. Both engines must accept its gzip stream.
foreach ($engine in @('powershell.exe', 'pwsh.exe')) {
& $engine -NoProfile -NonInteractive -File scripts/check_windows_release_archive.ps1 -ArchivePath $archive -ExecutablePath $built
if ($LASTEXITCODE -ne 0) { throw "$engine rejected the release archive." }
}
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cli-${{ matrix.target }}
Expand Down
134 changes: 134 additions & 0 deletions .github/workflows/windows-installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Windows installer tests

on:
pull_request:
paths:
- 'install.ps1'
- 'scripts/test_install*windows.ps1'
Comment on lines +4 to +7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Release-only PRs skip the Windows installer matrix

The installer workflow’s PR path filter omits .github/workflows/release.yml, which controls Windows archive validation and checksum generation.

PRs changing only release packaging skip installer tests on both PowerShell editions; regular CI checks its own archive instead.

Add .github/workflows/release.yml to the installer workflow’s PR path filter.

Details

The matrix uses fixtures and pinned official releases. Widening the trigger runs that suite, but does not validate the PR’s release archive or manifest end to end.

View finding in Proofline

- 'scripts/generate_windows_installer_fixtures.py'
- 'scripts/check_windows_release_archive.ps1'
- 'scripts/archive.py'
- 'Cargo.toml'
- 'Cargo.lock'
- 'src/**'
- '.github/workflows/ci.yml'
- '.github/workflows/release.yml'
- '.github/workflows/windows-installer.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
syntax-preflight:
name: Installer syntax (${{ matrix.engine }})
runs-on: windows-2025
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
engine: ['powershell.exe', 'pwsh.exe']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Parse Windows installer and test scripts
shell: pwsh
env:
TEST_ENGINE: ${{ matrix.engine }}
run: |
& $env:TEST_ENGINE -NoProfile -NonInteractive -File scripts/test_install_syntax_windows.ps1
if ($LASTEXITCODE -ne 0) { throw "Installer syntax preflight failed: $env:TEST_ENGINE" }

offline-validation:
needs: syntax-preflight
name: Installer offline tests (${{ matrix.engine }})
runs-on: windows-2025
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
engine: ['powershell.exe', 'pwsh.exe']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Check fixture generator
shell: pwsh
run: |
python -m py_compile scripts/generate_windows_installer_fixtures.py
if ($LASTEXITCODE -ne 0) { throw 'Fixture generator did not compile.' }

- name: Run validator and recovery fixtures
shell: pwsh
env:
TEST_ENGINE: ${{ matrix.engine }}
Comment on lines +63 to +66

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Windows CI skips real upgrades and forced-termination recovery

Both PowerShell jobs only parse the real integration suites. The offline upgrade and locking fixtures replace the production version check with digest checks.

Both jobs can pass even if the installer rejects an official executable or fails recovery after a forced stop that the offline fixtures do not reproduce.

Run both real integration suites in a separate Windows CI job for both PowerShell editions.

View finding in Proofline

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still present in this version: Proofline found the issue again. Proofline's finding in this version: Windows installer CI misses incompatible release archives. View review

Comment on lines +63 to +66

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Installer integration jobs run despite syntax validation failures

Only offline-validation runs the syntax preflight; neither integration job waits for it.

A syntax error in the interruption test can still let the upgrade job install two releases before encountering the error. The workflow still fails.

Make both integration jobs depend on a dedicated syntax job that checks both PowerShell editions.

View finding in Proofline

run: |
foreach ($script in @(
'scripts/test_install_syntax_windows.ps1',
'scripts/test_install_windows.ps1',
'scripts/test_install_upgrade_windows.ps1',
'scripts/test_install_concurrency_windows.ps1'
)) {
Write-Host "Running $script with $env:TEST_ENGINE"
& $env:TEST_ENGINE -NoProfile -NonInteractive -File $script
if ($LASTEXITCODE -ne 0) { throw "$script failed with exit code $LASTEXITCODE" }
}


real-release-integration:
needs: syntax-preflight
name: Real Windows install and interruption recovery (${{ matrix.engine }})
runs-on: windows-2025
# Up to 24 forced-termination workers x 90 seconds plus real upgrades,
# download/setup time, and test-runner overhead can exceed 30 minutes.
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
engine: ['powershell.exe', 'pwsh.exe']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install and upgrade pinned official releases
shell: pwsh
env:
TEST_ENGINE: ${{ matrix.engine }}
Comment on lines +96 to +99

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Interruption CI misses repair before downloads

The interruption harness calls Invoke-ProoflinePendingRepair directly, so its assertions still pass if the installer removes the pre-download repair call or moves it after downloads.

CI can pass even though rerunning the installer during a download failure leaves the interrupted upgrade unrepaired.

Rerun install.ps1 with a pending upgrade and a forced download failure, then assert the executable and receipt are restored and the journal is cleared.

View finding in Proofline

run: |
& $env:TEST_ENGINE -NoProfile -NonInteractive -File scripts/test_install_upgrade_real_windows.ps1
if ($LASTEXITCODE -ne 0) { throw "Real Windows upgrade test failed: $LASTEXITCODE" }

- name: Recover from twelve real process-termination checkpoints
shell: pwsh
env:
TEST_ENGINE: ${{ matrix.engine }}
run: |
& $env:TEST_ENGINE -NoProfile -NonInteractive -File scripts/test_install_interruption_real_windows.ps1
if ($LASTEXITCODE -ne 0) { throw "Real interruption recovery failed: $LASTEXITCODE" }

isolated-user-path:
needs: syntax-preflight
name: Default installer PATH persistence (${{ matrix.engine }})
# A separate GitHub-hosted VM provides a disposable Windows user profile.
# No other job or test in this workflow shares its HKCU registry hive.
runs-on: windows-2025
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
engine: ['powershell.exe', 'pwsh.exe']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Check full installer default user PATH integration in isolated profile
shell: pwsh
env:
TEST_ENGINE: ${{ matrix.engine }}
run: |
& $env:TEST_ENGINE -NoProfile -NonInteractive -File scripts/test_install_user_path_ci_windows.ps1
if ($LASTEXITCODE -ne 0) { throw "Isolated installer PATH test failed: $LASTEXITCODE" }
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The command-line client for the [Proofline review API](https://proofline.sh/docs/). See the [CLI documentation](https://proofline.sh/docs/cli/) for commands.

This repository is the published distribution of the Proofline CLI. `openapi.public.json` is the generated public API contract pinned for this revision. During the build, `build.rs` generates request URLs for the operations it declares. [Open an issue](https://github.com/prooflinedev/cli/issues) for changes to `openapi.public.json`, generated code, or workflows. Pull requests are welcome for the hand-written installer in `install.sh`, commands in `src/`, release scripts in `scripts/`, and tests in `tests/`.
This repository is the published distribution of the Proofline CLI. `openapi.public.json` is the generated public API contract pinned for this revision. During the build, `build.rs` generates request URLs for the operations it declares. [Open an issue](https://github.com/prooflinedev/cli/issues) for changes to `openapi.public.json`, generated code, or workflows. Pull requests are welcome for the hand-written installers in `install.sh` and `install.ps1`, commands in `src/`, release scripts in `scripts/`, and tests in `tests/`.

## Installation and setup

Expand All @@ -12,7 +12,41 @@ On Linux and macOS, install the CLI with `curl -fsSL https://proofline.sh/cli |

### Windows installation

Official releases include `proofline-x86_64-pc-windows-msvc.tar.gz` with `proofline.exe`. Download the archive and `SHA256SUMS` from the same GitHub release, and compare its SHA-256 hash using `Get-FileHash -Algorithm SHA256`. Extract the archive with `tar -xzf` and put `proofline.exe` in a directory on `PATH`. Run `proofline login` to store credentials in Windows Credential Manager. To update, close running Proofline processes and replace the executable from a verified release. The Unix shell installer and self-update command do not install Windows binaries.
On **Windows x64**, run the PowerShell installer from a checked-out copy of this repository. The effective PowerShell execution policy must permit local scripts; inspect it with `Get-ExecutionPolicy -List`. If your organization permits a per-process change, use `Set-ExecutionPolicy -Scope Process RemoteSigned` in the terminal running these commands. Do not override an organization-enforced policy: consult your administrator instead.

```powershell
powershell.exe -NoProfile -File .\install.ps1
```

It downloads the official release and `SHA256SUMS` from `https://proofline.sh`, validates the archive, verifies `proofline.exe --version`, and installs for the **current user** in `%LOCALAPPDATA%\Programs\Proofline\bin` without administrator rights. By default it attempts to append that directory to the user PATH while preserving expandable registry entries; this is best-effort and may warn if registry permissions or concurrent changes prevent an update. Cooperating Proofline installer processes serialize PATH updates with a per-user mutex, but unrelated registry editors do not share that lock. If the installer warns, first check **Windows Environment Variables → User variables → Path**. Add `%LOCALAPPDATA%\Programs\Proofline\bin` (or your custom `-InstallDir`) **only if it is missing**; a notification warning does not necessarily mean the registry update failed. Open a new terminal and run `Get-Command proofline -All` to check which executable has precedence. If an older copy is found first, run the new executable using its absolute path (for example, `& "$env:LOCALAPPDATA\Programs\Proofline\bin\proofline.exe" login`) or correct the stale PATH entry. The installer does not handle login or credentials.

To pin a version or install in a disposable folder without updating PATH:

```powershell
powershell.exe -NoProfile -File .\install.ps1 -Version 0.5.2 -InstallDir "$env:TEMP\proofline-test-bin" -NoModifyPath
```

Re-running the installer with the same verified version does not replace the executable or receipt, but User PATH may still be updated unless `-NoModifyPath` is selected. Upgrading an installer-managed version preserves the previous executable and uses a pending recovery record; an unmanaged or inconsistent existing installation is not overwritten. No administrator privileges or machine-level PATH changes are required.

User PATH updates use a cross-session per-user mutex to serialize cooperating installers. Unrelated registry editors that do not take the mutex can still race because Windows does not offer an atomic registry compare-and-swap for this value; verify PATH after simultaneous unrelated edits. If appending the directory would exceed the 30,000-character User PATH safety threshold, or REG_EXPAND_SZ would reinterpret percent-delimited tokens in the literal installation directory, the installer leaves PATH unchanged and warns rather than claiming that `proofline` is discoverable by name (the verified executable remains installed).

The installer script is currently distributed **in this repository**, not via a verified Windows one-liner on `proofline.sh`. Alternatively, manually download `proofline-x86_64-pc-windows-msvc.tar.gz` and its `SHA256SUMS` from the same official release, verify the SHA-256 with `Get-FileHash`, extract `proofline.exe` and place it on PATH.

Windows `proofline update` (self-update invoked from the CLI) remains unsupported; re-run `install.ps1` to upgrade an installer-managed installation. After a process interruption, a later installer run uses a pending journal to complete or recover a recognized transaction. A partial first-install or pre-switch stage can be retained with an `.incomplete` suffix for diagnostics without blocking a new attempt. Errors that cannot be safely classified preserve evidence and may require manual recovery.

The installer verifies the archive against the official SHA-256 manifest. Because both are fetched from the same HTTPS release origin, this establishes download consistency rather than independent cryptographic publisher authentication.

To verify the installer on Windows x64, run the following from the repository root (Python 3 is required for the offline fixtures):

```powershell
powershell.exe -NoProfile -File .\scripts\test_install_windows.ps1
powershell.exe -NoProfile -File .\scripts\test_install_upgrade_windows.ps1
powershell.exe -NoProfile -File .\scripts\test_install_concurrency_windows.ps1
powershell.exe -NoProfile -File .\scripts\test_install_upgrade_real_windows.ps1
powershell.exe -NoProfile -File .\scripts\test_install_interruption_real_windows.ps1
```

Run the same commands with `pwsh.exe` to verify PowerShell 7. The interruption test covers 12 hard-termination checkpoints, including checkpoints before receipt publication. The last two tests download pinned official releases; their installations use disposable directories and do not modify User PATH. The separate `scripts/test_install_user_path_ci_windows.ps1` test intentionally runs **only on disposable GitHub-hosted Windows runners** in its own isolated CI job, where it exercises the default PATH update and restores the prior raw registry value in `finally`.

On Linux, coding agents that omit `DBUS_SESSION_BUS_ADDRESS` and `XDG_RUNTIME_DIR`
can still use the stored sign-in when the standard `/run/user/<uid>/bus` socket
Expand Down
Loading