Skip to content

feat(windows): add verified CLI installer with recoverable upgrades - #1

Open
ThunderKhan wants to merge 21 commits into
mainfrom
feat/windows-installer
Open

ThunderKhan wants to merge 21 commits into
mainfrom
feat/windows-installer

Conversation

@ThunderKhan

@ThunderKhan ThunderKhan commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

Adds a secure Windows PowerShell installer for the Proofline CLI, supporting verified installations, recoverable upgrades, and automatic rollback after failed or interrupted updates.

This PR is opened in khan-dev-labs/cli to run Proofline's code review as part of my Software Engineering Intern application.

Implementation

  • Downloads official Windows x64 releases and verifies SHA-256 checksums.
  • Validates archive contents and executable versions before installation.
  • Supports Windows PowerShell 5.1 and PowerShell 7.
  • Installs without administrator privileges, with optional PATH modification.
  • Preserves the previous verified executable during upgrades.
  • Uses transaction journaling and recovery to handle interrupted installations.
  • Rolls back failed post-installation checks instead of accepting an executable based on its checksum alone.
  • Includes safeguards for concurrent installers, corrupted files, and incomplete transactions.

Testing

  • 20/20 offline upgrade and recovery tests passed on both PowerShell editions.
  • 12/12 archive and manifest validation tests passed.
  • 10/10 real Windows process-interruption recovery scenarios passed.
  • Windows installer CI and repository-wide checks passed.

Verification

Review focus

Please review the transaction recovery logic, executable verification, rollback behavior, filesystem safety, and handling of interrupted or partially completed upgrades.

In particular, assess whether the persistent checking and passed postcheck states correctly prevent an unverified upgraded executable from being finalized after a failure.

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 10 new findings to review. 14 open findings need attention in this pull request.

View full review in Proofline

4 more findings are on the Proofline Check.

Comment thread install.ps1 Resolved
Comment thread install.ps1 Resolved
Comment thread install.ps1 Resolved
Comment on lines +35 to +38
- name: Run validator and recovery fixtures
shell: pwsh
env:
TEST_ENGINE: ${{ matrix.engine }}

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 thread install.ps1 Resolved
Comment thread scripts/test_install_windows.ps1 Resolved

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 4 new findings to review.

View full review in Proofline

Comment thread install.ps1 Resolved
Comment thread install.ps1 Resolved
Comment thread install.ps1 Outdated
Comment on lines +271 to +274
function Get-ProoflineUpdatedUserPath([string]$Current, [string]$Directory) {
if ($null -eq $Current) { $Current = '' }
$normalized = $Directory.TrimEnd([char[]]@('\', '/'))
foreach ($entry in ($Current -split ';')) {

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 skips adding Proofline to a non-expandable User PATH

Duplicate detection expands entries even for REG_SZ, where Windows treats %VARIABLE% literally. If expansion matches the install directory, the installer skips the registry write.

The installer reports that Proofline is on PATH, but a new terminal may not find it.

Pass the registry kind to duplicate detection and expand entries only for REG_EXPAND_SZ.

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: Expandable user PATH can point outside the install directory. View review

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: Installer reports a PATH update that points to the wrong directory. View review

Comment thread install.ps1 Outdated
Comment on lines +271 to +274
function Get-ProoflineUpdatedUserPath([string]$Current, [string]$Directory) {
if ($null -eq $Current) { $Current = '' }
$normalized = $Directory.TrimEnd([char[]]@('\', '/'))
foreach ($entry in ($Current -split ';')) {

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 skips adding its directory to a literal user PATH

Duplicate detection expands variable references in REG_SZ entries, so a literal entry can falsely match the install directory.

The installer reports the directory is already on PATH and skips adding it, leaving proofline undiscoverable by name unless another entry provides it.

Pass the registry kind to duplicate detection and expand entries only for REG_EXPAND_SZ.

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 PATH guidance omits the append limit and silent edit loss. View review

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 more finding to review, 5 in this review run.

View full review in Proofline

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 4 more findings to review, 9 in this review run.

View full review in Proofline

Comment on lines +204 to +207
elseif ($Checkpoint -eq 'after-switch' -or $Checkpoint -eq 'corrupt-after-switch') {
$target = ' Invoke-ProoflineReplaceWithRetry $stage $destination $paths.api $hash $oldReceipt.sha256' +
"`n" + ' if ('
$damage = if ($Checkpoint -eq 'corrupt-after-switch') {

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 · after-switch passes without a persisted checking state

after-switch checks that the journal exists, not that it contains postcheck: checking. Recovery rolls back whether that state is present or missing.

The test still passes if the installer delays writing checking until after publication and the forced stop.

Read the on-disk journal before launching recovery and assert postcheck is checking at both switch checkpoints.

Details

Moving the write below the destination digest guard preserves the exact replacement-plus-if instrumentation anchor and still allows uninterrupted upgrades to record passed.

View finding in Proofline

Also at:

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: Upgrade tests miss dropped version subprocess failures. View review

Comment on lines +204 to +207
elseif ($Checkpoint -eq 'after-switch' -or $Checkpoint -eq 'corrupt-after-switch') {
$target = ' Invoke-ProoflineReplaceWithRetry $stage $destination $paths.api $hash $oldReceipt.sha256' +
"`n" + ' if ('
$damage = if ($Checkpoint -eq 'corrupt-after-switch') {

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 interruption tests miss premature receipt publication

First-install and upgrade checkpoints skip the interval between persisting passed and publishing the receipt; offline fixtures construct that state directly.

An extra receipt write after the executable check but before passed would leave every existing checkpoint and assertion passing.

Stop workers immediately after persisting passed, assert the receipt is absent or still names the old release, then verify recovery finalizes the install.

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: Interruption tests miss recovery with competing postcheck journals. View review

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: Passed interruption tests miss a missing journal backup. View review

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 2 more findings to review, 11 in this review run.

View full review in Proofline

1 more finding is on the Proofline Check.

Comment thread .github/workflows/windows-installer.yml Resolved
Comment on lines +45 to +48
$original = Get-RawUserPath
$directory = Join-Path $env:RUNNER_TEMP ('proofline-path-ci-' + [guid]::NewGuid().ToString('N'))
$token = '%PROOFLINE_CI_TEST_ROOT%\bin'
$seed = if ([string]::IsNullOrEmpty($original.value)) { $token }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Serious · The Windows CI test can erase a concurrent user PATH edit

Seeding overwrites Path from an unchecked snapshot, and cleanup restores or deletes it after a non-atomic ownership check.

An unrelated edit to Path can be lost even when it matches neither test value.

Run the persistence test under a dedicated disposable Windows user profile so it cannot overwrite another user's Path.

Details

The workflow invokes the default check mode. An edit between the snapshot and seeding is overwritten before cleanup can observe it, so cleanup can pass after restoring the older value. Separately, an edit after the cleanup read can be overwritten by the restore or deletion. Rereading immediately before each mutation would narrow the race but would not make the operation atomic.

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 PATH test can erase a concurrent PATH edit. View review

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: CI fixture can erase a concurrent installer’s User PATH update. View review

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 3 new findings to review.

View full review in Proofline

Comment thread install.ps1
Comment on lines +460 to +463
if (-not [IO.File]::Exists($Path)) {
Write-ProoflineAtomicRecord $Path $record
}
else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Serious · A locked but matching receipt blocks upgrade recovery

Rollback and pre-switch recovery replace the old receipt even when it already matches the verified executable.

A reader that denies delete sharing makes recovery abort before clearing the journal, blocking installer retries while the handle remains open.

Reuse the passed branch’s matching-receipt check in both old-version recovery paths and skip replacement when the version and hash match.

View finding in Proofline

Also at:

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: A corrupt receipt blocks recovery of a verified upgrade. View review

Comment thread install.ps1
Comment on lines +286 to +288
$result = if ($Current.TrimEnd(';') -eq '') { $Directory } else { $Current.TrimEnd(';') + ';' + $Directory }
if ($result.Length -gt 30000) { throw 'User PATH is too long; add the directory manually.' }
return $result

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Serious · Concurrent Windows installs can silently lose a user PATH entry

Add-ProoflineUserPath checks freshness separately from writing, so two installers can both pass the check and write updates based on the same snapshot.

The last write silently discards the other installer's PATH entry.

Lock the entire read–modify–write sequence per user, and document that editors outside the lock can still race.

View finding in Proofline

Comment thread install.ps1 Outdated
$fresh.kind -ne $previous.kind -or $fresh.exists -ne $previous.exists) {
throw 'User PATH changed concurrently; retry the installer or add the directory manually.'
}
$key.SetValue('Path', $result, $previous.kind)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Serious · Concurrent installs can erase a user PATH edit

The freshness check and SetValue are separate, so an edit made between them is overwritten by the earlier snapshot.

A concurrent installer can report success even though its directory is missing from the saved Path.

Hold a shared per-user lock across the full read–modify–write for installer runs, and document that other editors are not synchronized.

Details

The archive-install lock is released before the default PATH update, so it does not serialize even two installer runs.

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 installers in different sessions can lose a PATH update. View review

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 3 more findings to review, 6 in this review run.

View full review in Proofline

Comment on lines +59 to +62
foreach ($path in @($root, $case)) {
if (-not [IO.Directory]::Exists($path) -or
(([IO.File]::GetAttributes($path) -band [IO.FileAttributes]::ReparsePoint) -ne 0)) {
throw 'Interruption test sandbox directory does not exist or is a reparse point.'

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 · Worker can load an installer script outside its test sandbox

Worker checks the installer copy’s path spelling and existence, but does not reject a file reparse point before dot-sourcing it.

The interruption test can run a different script instead of the driver-generated installer.

Reject reparse points on the installer copy and dot-source the validated absolute path.

Details

The normal driver generates its own installer copy; no examined caller supplies a reparse point. The missing check is in the Windows test worker, not the production installer.

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: A mismatched holder can delete the test marker. View review

Comment on lines +298 to +301
elseif ($Checkpoint -eq 'fresh-after-move') {
$target = ' [IO.File]::Move($stage, $destination)' +
"`n" + ' if ('
$replacement = ' [IO.File]::Move($stage, $destination)' +

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 · First-install interruption test misses a late checking write

fresh-after-move checks that the journal exists but does not require postcheck: checking. Recovery quarantines the executable whether that field is missing or set to checking.

The scenario can pass even if proofline.exe is published before checking is persisted.

Assert that the on-disk journal contains postcheck: checking at fresh-after-move, before starting recovery.

View finding in Proofline

}
. $InstallerCopy
if ($Mode -eq 'Recover') {
Invoke-ProoflinePendingRepair $CaseDir

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 tests miss regressions in repair before download

The recovery worker calls Invoke-ProoflinePendingRepair directly, bypassing the installer entry point and its download ordering.

Every interruption scenario can pass even if the installer leaves a pending transaction unrepaired when a download fails.

Invoke Invoke-ProoflineInstaller with the interrupted directory and a downloader that always fails, then assert recovery completed despite the download error.

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 CI can pass with latest-release installation broken. View review

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 more finding to review, 7 in this review run.

View full review in Proofline

$pendingPath = Pending 'journal-backup-only'
Set-ProoflinePendingPostcheck $pendingPath 'checking'
Set-ProoflinePendingPostcheck $pendingPath 'passed'
[IO.File]::Copy($pendingPath, $pendingPath + '.postcheck.bak', $false)

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 · Journal-backup test misses interrupted upgrade rollback

The fixture copies a completed passed journal, but File.Replace backs up the previous checking journal when persisting passed.

The test still passes if recovery skips orphaned checking backups, leaving the new executable active instead of restoring the previous release.

Move the checking journal to .postcheck.bak, then assert recovery restores the old executable and receipt and clears the backup.

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: Passed checkpoints miss stale journal precedence. View review

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 more finding to review, 8 in this review run.

View full review in Proofline

2 more findings are on the Proofline Check.

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

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

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 3 new findings to review.

View full review in Proofline

Comment thread install.ps1
Comment on lines +779 to +782
foreach ($path in $paths.Values) { Assert-ProoflineNoReparse $path }
$activeHash = $null
if ([IO.File]::Exists($destination)) { $activeHash = Get-ProoflineSha256 $destination }

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 · A brief file lock can leave a rejected upgrade installed

After a failed postcheck, rollback attempts File.Replace only once and aborts on a transient sharing violation.

The rejected executable remains at proofline.exe while the receipt still describes the previous release.

Reuse the bounded replacement retry for rollback, checking both file hashes and confirming the backup path is absent before retrying.

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: A brief file lock can leave an unchecked upgrade installed. View review

Comment thread install.ps1 Resolved
Comment thread install.ps1 Outdated
Comment on lines +415 to +418
function Assert-ProoflineExeVersion([string]$Path, [string]$Version) {
# Run only checksum-verified images; bound both process termination
# and redirected output collection so descendants cannot hang the check.
$startInfo = [Diagnostics.ProcessStartInfo]::new()

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 · Version checks can execute unverified bytes

The installer launches the stage after closing its exclusive write handle, and launches the installed image after a separate hash read. Neither check protects the verified file through process creation.

A concurrent file change can cause the installer to execute bytes that were never verified.

Hash each executable while preventing writes and replacement, and keep that protection in place through process creation.

View finding in Proofline

Also at:

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: Offline version checks accept a mismatched expected digest. View review

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 2 more findings to review, 5 in this review run.

View full review in Proofline

Comment thread .github/workflows/ci.yml Outdated
# The normal tar smoke test alone does not reject extra members.
. ./install.ps1
$archivePath = 'artifacts/proofline-x86_64-pc-windows-msvc.tar.gz'
$binary = Get-ProoflineTarExecutable ([IO.File]::ReadAllBytes((Resolve-Path $archivePath).Path))

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 · Compatibility gate does not check the published Windows archive

The new installer assertion checks the archive built by Checks, but Release rebuilds and uploads a separate archive without running that assertion on it.

A release-only packaging regression can ship a Windows archive the installer rejects even when the gate passes.

Run Get-ProoflineTarExecutable on the release matrix’s Windows archive before uploading it.

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 package gates can miss archives PowerShell 5.1 rejects. View review

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +39 to +42
- run: python scripts/archive.py x86_64-pc-windows-msvc
- shell: pwsh
run: |
# Reject a packaged archive that the proposed installer cannot read.

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 can pass an archive the installer rejects as too large

The compatibility check calls the tar parser directly, bypassing the installer’s 64 MiB compressed-size limit.

An otherwise valid Windows archive can pass CI but fail to install.

Check the compressed file length against MaxArchiveBytes before reading and parsing it.

View finding in Proofline

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 more finding to review, 6 in this review run.

View full review in Proofline

Comment thread .github/workflows/windows-installer.yml Resolved

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 4 new findings to review.

View full review in Proofline

Comment thread install.ps1
Comment on lines +295 to +298
$result = if ($Current.TrimEnd(';') -eq '') { $Directory } else { $Current.TrimEnd(';') + ';' + $Directory }
if ($result.Length -gt 30000) { throw 'User PATH is too long; add the directory manually.' }
return $result
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Serious · Concurrent installs in different Windows sessions can lose a PATH entry

The per-SID Local\ mutex is session-scoped, but User PATH is shared across sessions. Two installers can both pass the freshness check before either writes.

Both installers can report success while the last write drops the other install directory from User PATH.

Hold a cross-session per-SID lock from the initial registry read through the write.

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: Manual PATH fallback can leave Proofline undiscoverable. View review

Comment thread install.ps1
Comment on lines +629 to +632
[IO.File]::Replace($temporary, $Pending, $backup)
$updated = Read-ProoflinePending $Pending
if ($updated.id -cne $record.id -or $updated.postcheck -cne $State) {
throw 'Could not verify the persisted upgrade postcheck state.'

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 · A locked journal backup blocks upgrade rollback

Recovery aborts if it cannot delete .postcheck.bak, even after validating the canonical journal.

A failed installed version check can leave the rejected proofline.exe in place instead of restoring the previous version.

Continue recovery from the valid journal when backup deletion fails, and retain the canonical journal until the backup is removed.

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: An invalid pending journal blocks recovery despite a valid backup. View review

Comment thread install.ps1
Comment on lines +393 to +396
function Assert-ProoflinePathTree([string]$Directory) {
# A pre-existing reparse-point ancestor can redirect writes outside the
# requested directory. Check all existing ancestors and refuse such paths.
$cursor = [IO.DirectoryInfo]::new($Directory)

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 · A concurrent directory change can redirect install and repair writes

The installer checks ancestors by name, then re-resolves the path to open its lock. A junction introduced between those operations can redirect the lock without tripping the leaf checks.

Installation or recovery can modify files outside the directory that was checked.

Validate and pin the directory chain before opening the lock, then perform managed operations relative to the pinned directory.

Details

Both paths are reached by normal script invocation. Pre-download repair also requires a pending journal or its backup. The exclusive lock protects the file it opened, not the identity of the directory inspected by the ancestor walk.

View finding in Proofline

Also at:

Comment thread install.ps1 Resolved

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 more finding to review, 5 in this review run.

View full review in Proofline

Comment thread .github/workflows/ci.yml Outdated
Comment on lines 51 to 54
$binary = Get-ProoflineTarExecutable ([IO.File]::ReadAllBytes($archiveFile))
if ($binary.Length -le 0) { throw 'PR-built Windows archive contains no supported Proofline executable.' }
Write-Host "Installer-compatible PR-built Windows archive validated ($($binary.Length) bytes)."
tar -xzf artifacts/proofline-x86_64-pc-windows-msvc.tar.gz -C artifacts

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 PR smoke tests can miss installer extraction regressions

The PR gate checks only the length of $binary, then smoke-tests a separate tar extraction without comparing the bytes.

An installer parser regression that returns different nonempty bytes can pass the PR gate.

Smoke-test the installer parser’s output or compare its SHA-256 with the smoke-tested executable.

Details

The current single-member packager does not demonstrate a mismatch. The release gate already compares the installer payload hash with the tested build.

View finding in Proofline

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 2 more findings to review, 7 in this review run.

View full review in Proofline

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

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

Comment on lines +297 to +299
$target = ' Assert-ProoflineExeVersion $stage $ReleaseVersion' +
"`n`n" + ' if ($null -eq $oldReceipt) {'
$replacement = ' Assert-ProoflineExeVersion $stage $ReleaseVersion' +

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 interruption tests abort at fresh-after-stage

The fresh-after-stage injector omits $hash from its exact-match anchor, but the installer passes it to Assert-ProoflineExeVersion.

On either PowerShell engine, reaching this checkpoint fails CI before its worker starts and skips the three remaining checkpoints.

Include $hash in both the anchor and the replacement so the injected copy preserves the validation call.

View finding in Proofline

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 2 more findings to review, 9 in this review run.

View full review in Proofline

3 more findings are on the Proofline Check.

Comment on lines +25 to +28
if ($Mode -eq 'Hold') {
if ([string]::IsNullOrWhiteSpace($CaseDir)) { throw 'Holder needs CaseDir.' }
$folder = [IO.Path]::GetFullPath($CaseDir)
$marker = Join-Path $folder '.proofline-test-only'

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 · Rejected lock holder can delete the valid test marker

Hold renames the marker before validation and deletes it in finally if reading or restoring it fails.

The matching holder can no longer claim the original marker, so the test can fail before exercising installer locking.

Delete only validated claims; restore rejected claims without overwriting a replacement, and preserve the claimed file if restoration fails.

Details

An ordinary mismatch restores the marker successfully. The driver supplies only the matching token and does not exercise the rejected-claim path.

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: Holder deletes the marker before refusing an invalid sandbox. View review

Comment thread install.ps1
Comment on lines +985 to +988
$lock = [IO.Path]::Combine($directory, '.proofline-install.lock')
foreach ($path in @($destination, $receipt, $pending, $lock)) {
Assert-ProoflineNoReparse $path
}

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 lock tests miss loss of installer exclusivity

Both tests use a fixture-held FileShare.None lock, which rejects the contender even if Install-ProoflineArchive switches to FileShare.ReadWrite.

Both tests would still pass even though two installers could acquire the same lock simultaneously.

Pause one installer after it acquires the production lock, then assert that a second installer is refused before releasing the first.

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: Contention test misses temporary staging before lock acquisition. View review

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 new finding to review.

View full review in Proofline

Comment thread install.ps1
Comment on lines +400 to +403
function Assert-ProoflinePathTree([string]$Directory) {
# A pre-existing reparse-point ancestor can redirect writes outside the
# requested directory. Check all existing ancestors and refuse such paths.
$cursor = [IO.DirectoryInfo]::new($Directory)

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 can write outside the directory it validated

The ancestor walk retains no directory handles. If an ancestor changes to a reparse point before lock acquisition, both install and repair resolve the lock and transaction files in the redirected tree.

The installer can create files or recover a transaction in a different directory than the one it checked.

Validate and retain stable directory handles, and bind all transaction operations to those identities.

View finding in Proofline

Also at:

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 more finding to review, 2 in this review run.

View full review in Proofline

Comment on lines 84 to +87
python3 scripts/archive.py "$TARGET"
- name: Validate exact Windows release archive with installer rules
if: matrix.target == 'x86_64-pc-windows-msvc'
shell: pwsh

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:

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 3 more findings to review, 5 in this review run.

View full review in Proofline

$script:smokeCount = 0
$script:failInstalledPostcheckPath = $null
$script:failInstalledPostcheckVersion = '0.5.2'
function Assert-ProoflineExeVersion([string]$Path, [string]$Version) {

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 · Offline install tests miss missing or incorrect version-check digests

The offline Assert-ProoflineExeVersion substitutes a fixture digest instead of checking the caller’s SHA-256 argument.

The offline cases still pass if the staged, fresh-install, or upgrade check receives a missing or incorrect digest.

Have both test doubles require ExpectedSha256 and compare it with the fixture digest before simulating any postcheck failure.

Details

The clean-upgrade case first installs the old fixture, then upgrades it, reaching all three calls. Its file and receipt assertions do not observe the third argument. The real interruption test separately checks the staged call’s exact text at scripts/test_install_interruption_real_windows.ps1:296–316; that does not close the gap in the offline doubles.

View finding in Proofline

Also at:

Comment on lines +329 to +332
Check 'missing canonical postcheck journal restores validated backup before recovery' {
$dir = PrepareOld 'journal-backup-only'
[void](MakePending $dir)
$pendingPath = Pending 'journal-backup-only'

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 · Recovery tests miss rollback caused by a stale journal backup

The recovery fixtures never pair a canonical passed journal with a stale checking backup for the same upgrade.

The tests could pass even if recovery chose the stale backup and rolled back a verified upgrade.

Keep a checking backup beside the passed journal and assert that repair retains the new executable and finalizes its receipt.

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: Interruption tests miss a missing postcheck journal backup. View review

Comment on lines +507 to +510
Check 'repeat upgrade is idempotent' {
$dir = PrepareOld 'repeat'
[void](Install-ProoflineArchive $script:newArchive $script:newSums '0.5.2' $dir)
$before = $script:smokeCount

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 repeat-install tests miss byte-identical rewrites

The offline and real-release repeat cases check final contents, not whether the matching executable and receipt were left untouched.

Both tests still pass if a same-version install rewrites either file with identical bytes without invoking the version checker.

Hold both files open with read sharing only during the repeat install and require it to succeed.

View finding in Proofline

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 3 new findings to review.

View full review in Proofline

Comment thread install.ps1
Comment on lines +649 to +652
if (-not [IO.File]::Exists($Path)) { return $null }
if (([IO.FileInfo]$Path).Length -gt 4096) { throw 'Pending transaction is too large.' }
$record = ConvertFrom-Json -InputObject ([IO.File]::ReadAllText($Path))
if ($null -eq $record) { throw 'Pending transaction is empty.' }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Serious · Malformed upgrade journal blocks verified rollback

Recovery reads the backup only when the canonical journal is missing, so a parse or validation error bypasses a valid checking backup.

Installer retries exit before downloading or restoring the previous release, even when a matching executable copy exists.

Keep a valid canonical journal authoritative; if it is malformed, preserve it and validate the backup before attempting digest-verified rollback.

View finding in Proofline

Comment thread install.ps1
Comment on lines +437 to +440
public static SafeFileHandle Open(string path) {
// SYNCHRONIZE | FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY:
// list-directory access makes the no-FILE_SHARE_DELETE lock effective.
// BACKUP_SEMANTICS permits directory handles; OPEN_REPARSE_POINT ensures

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 writes can escape the validated directory

Directory pins block renames but allow in-place reparse changes after validation. The installer then resolves absolute paths again.

The lock, journal, and executable can be created outside the requested install directory.

Open and move transaction files relative to the validated directory handle without following reparse points.

Details

The race requires a concurrent writer with permission to modify reparse metadata on the empty directory. The rename test does not cover in-place metadata changes. The repair path has the same path-resolution gap if its journal lookup resolves through a changed directory.

View finding in Proofline

Also at:

Comment thread install.ps1
Comment on lines +648 to +651
function Read-ProoflinePending([string]$Path) {
if (-not [IO.File]::Exists($Path)) { return $null }
if (([IO.FileInfo]$Path).Length -gt 4096) { throw 'Pending transaction is too large.' }
$record = ConvertFrom-Json -InputObject ([IO.File]::ReadAllText($Path))

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 · Malformed pending journal blocks rollback despite a valid backup

Restore-ProoflinePendingBackup only reads the backup when the canonical journal is absent; a parse or validation error in an existing journal escapes first.

Installer retries abort without restoring the previous verified executable.

On canonical validation failure, validate the backup, preserve the malformed journal for diagnosis, and resume digest-checked recovery from the backup.

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: A journal sharing violation can roll back a verified upgrade. View review

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 more finding to review, 4 in this review run.

View full review in Proofline

if ($archiveLength -le 0 -or $archiveLength -gt $script:MaxArchiveBytes) {
throw "Packaged Windows archive violates installer compressed-size limit: $archiveLength bytes."
}
$payload = Get-ProoflineTarExecutable ([IO.File]::ReadAllBytes($archive))

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 · Replacing the archive during validation can exhaust memory

The package checker checks file metadata, then reopens the path with ReadAllBytes, so a concurrent replacement can bypass the 64 MiB compressed-size limit.

Validation can fail from memory exhaustion instead of reporting an oversized archive.

Open the archive once and enforce the compressed-size limit while reading that stream.

Details

The CI and release workflows invoke the checker after packaging; neither shows a concurrent writer. The parser limits decompressed output only, after the compressed bytes have already been allocated.

View finding in Proofline

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 2 more findings to review, 6 in this review run.

View full review in Proofline

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

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

Comment on lines +24 to +27
throw "PowerShell syntax validation failed for $path."
}
}
Write-Host "PowerShell syntax validation: PASS ($($paths.Count) scripts parsed)."

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 syntax check can pass with malformed generated installers

The syntax gate parses the driver’s source, not the PowerShell emitted by its checkpoint templates, and the driver launches workers without parsing the generated copies.

A malformed template can pass the syntax job and surface only as a worker failure before the checkpoint.

Parse each generated copy with the selected PowerShell engine before launching its worker, and report any parser diagnostics directly.

View finding in Proofline

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 more finding to review, 7 in this review run.

View full review in Proofline

Comment on lines +181 to +184
. $validatedCopy
if ($Mode -eq 'Recover') {
Invoke-ProoflinePendingRepair $CaseDir
Write-Output 'RECOVERY_COMPLETED'

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 tests miss rollback when the latest lookup fails

The interruption suite calls repair directly, so moving repair after /cli/latest but before archive downloads would leave it green.

An unpinned retry could fail its lookup and leave the unchecked replacement active without a test failure.

Restart install.ps1 without -Version after the switch checkpoint, fail /cli/latest deterministically, and assert the specific error, nonzero exit, restored executable and receipt, and cleared journal.

Details

The offline unpinned case starts clean and returns a successful latest pointer. The pending-upgrade outage case pins the version, so it still repairs before its first archive request under the proposed regression.

View finding in Proofline

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 more finding to review, 8 in this review run.

View full review in Proofline

2 more findings are on the Proofline Check.

Comment on lines +420 to +423
Check 'latest release invocation uses pinned offline archive and passes installer postchecks' {
$dir = Join-Path $root 'latest-release-entrypoint'
$realDownload = (Get-Item Function:\Get-ProoflineOfficialBytes).ScriptBlock
try {

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 · Offline tests miss rollback blocked by latest-version lookup

The outage fixture pins the version, and the unpinned fixture has no pending upgrade and returns a successful /cli/latest response.

Both tests still pass if release selection moves before repair, leaving interrupted upgrades unrepaired when /cli/latest fails.

Add an unpinned outage case that fails /cli/latest and verifies the old executable and receipt are restored and the journal is cleared.

View finding in Proofline

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 new finding to review.

View full review in Proofline

Comment thread install.ps1
Write-ProoflineReceipt $Path $Version $Hash
}

function Read-ProoflineReceipt([string]$Path) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Serious · A malformed receipt blocks recovery of a verified upgrade

Even when the journal says passed and the installed digest matches, recovery aborts on a malformed receipt before it can rewrite it.

Installer retries exit without finalizing the upgrade.

Rebuild invalid receipt contents from verified journal data, while still surfacing access and sharing errors.

Details

The same parse-before-repair failure affects first-install recovery when the postcheck is already recorded as passed, and both rollback paths that call Ensure-ProoflineReceipt after verifying the old executable digest. Keep the no-rewrite fast path for a valid matching receipt.

View finding in Proofline

Also at:

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 3 more findings to review, 4 in this review run.

View full review in Proofline

Comment on lines +555 to +557
$realWrite = (Get-Item Function:\Write-ProoflineReceipt).ScriptBlock
try {
Set-Item Function:\Write-ProoflineReceipt -Value { throw 'Simulated receipt replacement lock.' }

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 · Receipt tests miss backup deletion when validation fails

The failure fixture replaces Write-ProoflineReceipt with a throwing stub, while the direct replacement test checks only successful cleanup.

Both tests would still pass if the writer deleted the previous receipt backup when validation throws after replacement.

Run the real writer, inject a failure in Assert-ProoflineRecord after replacement, and verify that the backup contains the original receipt.

View finding in Proofline

Comment on lines +576 to +579
Check 'only sharing/lock HRESULTs are retryable' {
$sharing = [IO.IOException]::new('temporarily held', -2147024864)
$lock = [IO.IOException]::new('range locked', -2147024863)
$denied = [UnauthorizedAccessException]::new('denied')

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 tests miss a regression in executable replacement retries

The HRESULT test calls only the classifier, and the rollback fixture locks the journal backup rather than the executable. Neither makes File.Replace fail transiently.

Both tests would pass if Invoke-ProoflineReplaceWithRetry rethrew the first sharing violation.

Add a test that forces the first replacement to fail with a sharing violation, releases the lock before the retry, and asserts that replacement succeeds.

View finding in Proofline

Comment on lines +643 to +646
Check 'corrupt active restored from verified previous copy' {
$dir = PrepareOld 'rollback'
$paths = MakePending $dir
[IO.File]::WriteAllText((Active 'rollback'), 'BROKEN', [Text.Encoding]::ASCII)

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 · Recovery tests miss executable corruption after postcheck passes

The fixtures test corrupt bytes and a passed journal separately, never together.

Removing the active digest comparison would leave the tests green even if recovery published the new receipt for corrupted bytes.

Persist passed, corrupt the active executable before recovery, and assert that recovery restores the previous executable and receipt.

View finding in Proofline

Also at:

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 2 more findings to review, 6 in this review run.

View full review in Proofline

Comment thread install.ps1
Comment on lines +148 to +151
foreach ($line in ($manifest -split "`n")) {
$line = $line.TrimEnd("`r")
if ($line.Length -eq 0) { continue }
if ($line -cnotmatch '\A([0-9a-fA-F]{64}) [ *](proofline-[a-zA-Z0-9_.-]+\.tar\.gz)\z') {

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 · Manifest test passes without filename validation

The SHA256SUMS-malformed fixture uses a valid filename with an invalid digest, and Must-Throw accepts the digest rejection.

The test stays green if filename restrictions are removed while digest validation remains.

Add a separate fixture with a correct Windows entry and a second row containing a valid digest but an invalid filename.

View finding in Proofline

(destination / "symlink.tar.gz").write_bytes(
pack(("proofline.exe", b"", tarfile.SYMTYPE))
)
(destination / "not-pe.tar.gz").write_bytes(

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 · The archive test passes without the MZ check

not-pe.tar.gz has both invalid MZ magic and an out-of-range PE offset, and Must-Throw accepts either rejection.

Removing the MZ check leaves the test green because the offset check still throws.

Corrupt only the MZ bytes in the otherwise valid fixture and assert the MZ-specific error.

View finding in Proofline

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 more finding to review, 7 in this review run.

View full review in Proofline

Comment on lines +323 to +326
elseif ($Checkpoint -eq 'fresh-after-receipt') {
$target = ' Write-ProoflineReceipt $receipt $ReleaseVersion $hash' +
"`n" + ' Clear-ProoflineJournalBackup $pending'
$replacement = ' Write-ProoflineReceipt $receipt $ReleaseVersion $hash' +

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 · First-install recovery test misses rewrites of a valid receipt

fresh-after-receipt runs repair without holding the published receipt open and checks only its final contents, so replacing it with an equivalent receipt still passes.

The test misses a regression that can block recovery when a reader denies delete sharing.

Hold the receipt open with FileShare.Read during repair and require successful journal cleanup.

View finding in Proofline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant