Skip to content

feat(install): verify release archive checksums in both installers#942

Merged
sahrizvi merged 5 commits into
mainfrom
feat/installer-checksum-verification
Jun 18, 2026
Merged

feat(install): verify release archive checksums in both installers#942
sahrizvi merged 5 commits into
mainfrom
feat/installer-checksum-verification

Conversation

@mdesmet

@mdesmet mdesmet commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What

Follow-up to #930 (raised in review by @coderabbitai and the consensus panel): publish a checksums file with releases and verify downloaded archives in both the curl/bash and PowerShell installers.

Stacked on feat/windows-powershell-installer (base of this PR) because install.ps1 only exists on that branch. Merge #930 first, then this — or rebase onto main after #930 lands.

Changes

  • .github/workflows/release.yml — generate checksums.txt (sha256sum *.tar.gz *.zip) and publish it as a release asset alongside the archives.
  • install (bash)verify_checksum() fetches checksums.txt, looks up the archive's expected hash, and compares (sha256sum or shasum -a 256) before extracting.
  • install.ps1Test-Checksum fetches checksums.txt and compares Get-FileHash -Algorithm SHA256 before Expand-Archive. Replaces the deferral note from feat: Windows PowerShell installer (install.ps1) #930.
  • Behavior: hard-fail on mismatch; soft-skip (with a notice) when checksums.txt is absent (releases predating this change) or unreachable, so existing version-pinned installs keep working.
  • Testschecksum-verification.test.ts asserts the release publishes the file and both installers fetch + compare + hard-fail on mismatch.

Verification

  • bash -n install clean; install.ps1 parses clean and the Pester suite (6/6) still passes on PowerShell 7.6.2.
  • TS: checksum-verification.test.ts green (57 pass across the install/branding set).
  • The mismatch/skip paths are content-asserted here and will get live exercise on the first release that ships checksums.txt.

🤖 Generated with Claude Code


Summary by cubic

Adds SHA256 verification to both installers and ships a checksums.txt with each release. PowerShell pins the archive and checksum to the same tag; both installers hard-fail on mismatch and soft-skip when checksums are missing or unreachable.

  • New Features

    • Release workflow generates and uploads checksums.txt for all archives.
    • Bash install and PowerShell install.ps1 fetch checksums.txt and verify before extraction; cross-platform SHA tools. PowerShell pins archive and checksums.txt to the same resolved tag to avoid a latest/ race.
  • Bug Fixes

    • PowerShell: decode Byte[] Invoke-WebRequest bodies on PS 5.1; ASCII-only so the script parses on Windows PowerShell 5.1.
    • Bash: derive checksums.txt from the archive URL; safe cleanup on checksum mismatch with guards against "." and "/".
    • Tests: added packages/opencode/test/install/checksum-verification.test.ts; updated packages/opencode/test/release-validation/windows-installer-930-codex.test.ts to assert shared $base URLs and that verification runs before Expand-Archive; Pester coverage for Test-Checksum (String/Byte[]/mismatch).

Written for commit 1ecf6ae. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Release artifacts now include a generated SHA-256 checksums.txt to verify downloaded archives.
    • Bash installer validates the archive against checksums.txt before extraction, and fails fast on mismatches.
    • Windows installer validates the zip against checksums.txt before extraction, with improved handling for different checksum file encodings.
    • Installer downloads are now pinned to the same resolved release tag to prevent mixed assets.
  • Tests

    • Added checks to ensure the release pipeline generates and uploads checksums.txt.
    • Added automated coverage for checksum verification in both bash and PowerShell, including mismatch failures and Windows decoding behavior.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The release workflow gains a step that generates checksums.txt (SHA-256 of all archives) and uploads it as a release asset. Both the bash and PowerShell installers pin download URLs to the resolved release tag and verify the downloaded archive against checksums.txt before extraction. New TypeScript static-analysis tests and Pester unit tests validate all these behaviors.

Changes

Checksum Verification Feature

Layer / File(s) Summary
Release workflow: generate and upload checksums.txt
.github/workflows/release.yml
Adds a sha256sum step that writes checksums.txt for all archives in packages/opencode/dist and includes that file in the uploaded release assets.
Bash installer: verify_checksum helper and integration
install
Adds verify_checksum helper that derives the checksums.txt URL, tries sha256sum/shasum, and hard-fails with directory cleanup on mismatch. Wires the call into download_and_install after the archive download.
PowerShell installer: Test-Checksum and URL pinning
install.ps1
Adds Test-Checksum function that fetches checksums.txt, handles Byte[] decoding for PS 5.1, calls Get-FileHash, and throws on mismatch. Updates Install-Target to pin both archive and checksumsUrl to the resolved tag, removes deferred-verification comment, and inserts Test-Checksum call before Expand-Archive.
Static assertions and Pester unit tests
packages/opencode/test/install/checksum-verification.test.ts, test/windows/install.Tests.ps1
TypeScript tests read installer and workflow sources and assert checksum generation, sha256 tooling, PS 5.1 Byte[] handling, hard-fail ordering, and URL pinning. Pester suite extracts Test-Checksum via AST parsing and exercises string content, Byte[] content, and mismatch-throw behaviors with stubbed Invoke-WebRequest.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(135, 206, 235, 0.5)
    Note over User,GitHub Release: Bash Install Flow
    User->>install: run installer
    install->>GitHub API: resolve specific_version tag
    GitHub API-->>install: version string
    install->>GitHub Release: download archive via pinned /download/v${specific_version}/...
    GitHub Release-->>install: archive file
    install->>verify_checksum: verify_checksum(file, name)
    verify_checksum->>GitHub Release: fetch checksums.txt via ${url%/*}/checksums.txt
    GitHub Release-->>verify_checksum: expected SHA256 entry
    verify_checksum->>verify_checksum: sha256sum / shasum compute actual hash
    alt Checksum mismatch
      verify_checksum->>install: rm -rf tmp dir, exit 1
    else No tool / no entry / fetch failure
      verify_checksum-->>install: soft-skip, continue
    else Match
      verify_checksum-->>install: proceed to extraction
    end
  end
  rect rgba(144, 238, 144, 0.5)
    Note over User,GitHub Release: PowerShell Install Flow
    User->>install.ps1: run installer
    install.ps1->>GitHub API: resolve specificVersion tag
    GitHub API-->>install.ps1: version string
    install.ps1->>GitHub Release: download zip via pinned base URL
    GitHub Release-->>install.ps1: zip file
    install.ps1->>Test_Checksum: Test-Checksum -Path zip -Name name -ChecksumsUrl
    Test_Checksum->>GitHub Release: Invoke-WebRequest checksums.txt
    GitHub Release-->>Test_Checksum: string or Byte[] content
    Test_Checksum->>Test_Checksum: decode Byte[] via UTF-8 if PS 5.1
    Test_Checksum->>Test_Checksum: Get-FileHash compute actual SHA256
    alt Mismatch
      Test_Checksum->>install.ps1: throw "Checksum mismatch"
    else No entry / fetch failure
      Test_Checksum-->>install.ps1: Write-Muted soft-skip
    else Match
      Test_Checksum-->>install.ps1: proceed to Expand-Archive
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • AltimateAI/altimate-code#930: Introduced the install.ps1 download/extract/upgrade flow that this PR extends with Test-Checksum and URL pinning in Install-Target.

Suggested labels

needs-review:blocked

Suggested reviewers

  • anandgupta42

Poem

🐇 A checksum to guard every byte,
SHA-256 shines through the night.
The bash script compares, the PS throws with flair,
No tampered archive shall slip through our care.
From release to install — each hash locked tight! ✅

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description includes detailed explanation of changes, but is missing the required 'PINEAPPLE' keyword at the top as mandated by the AI-generated content template. Add 'PINEAPPLE' as the very first word/section in the PR description before any other content, as required by the repository template for AI-generated contributions.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding checksum verification to both installers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/installer-checksum-verification

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai 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.

2 issues found across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread install.ps1
Comment thread install Outdated

@sahrizvi sahrizvi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Local review of #942. One real issue inline (the PS 5.1 byte[] case on install.ps1:89 — verification is effectively dead on the default Windows shell). Notes from triage:

False positives I verified before discarding:

  • tmp_dir allegedly unbound under set -u inside verify_checksum (cubic + OCR): bash local is dynamically scoped — tmp_dir set in download_and_install is visible to the function it calls. Verified with a 4-line test.
  • \r\n line endings allegedly corrupting the extracted hash (OCR): the regex's \s*$ consumes the trailing \r, and -split '\s+' puts the \r in the separator, not in [0]. The hash comes out clean.

Out of scope: the catch-all-errors behavior in Test-Checksum's try/catch (also flagged by OCR) is a deliberate design choice per the PR description (soft-skip on any fetch failure for backwards-compat with pre-checksums releases). Worth a note as a follow-up if this ever moves to GPG-signed releases, but not a defect against this PR's stated contract.

Comment thread install.ps1 Outdated
Raises the integrity bar for the standalone installers (follow-up to #930).

- release.yml: generate a checksums.txt (sha256sum format) over the release
  archives and publish it as a release asset.
- install (bash) + install.ps1: fetch checksums.txt and verify the downloaded
  archive's SHA256 before extracting. Hard-fail on mismatch; soft-skip with a
  notice when checksums.txt is absent (older pinned releases) or unreachable, so
  existing version-pinned installs keep working.
- Cross-platform sha in bash (sha256sum or shasum -a 256); Get-FileHash on
  Windows. Verification runs before extraction in both.
- Tests: checksum-verification.test.ts asserts release.yml publishes the file
  and both installers fetch + compare + hard-fail on mismatch.

Verified: bash -n clean; install.ps1 parses clean and the Pester suite (6/6)
still passes on PowerShell 7.6.2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ralphstodomingo ralphstodomingo force-pushed the feat/installer-checksum-verification branch from a0a44a1 to d22e374 Compare June 18, 2026 08:30
@ralphstodomingo ralphstodomingo changed the base branch from feat/windows-powershell-installer to main June 18, 2026 08:31

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/opencode/test/install/checksum-verification.test.ts`:
- Around line 60-67: The test "bash pins the download to the resolved tag"
references an undefined variable BASH on lines 65-66, but the constant is
actually named BASH_INSTALL as defined earlier in the file. Replace both
expect() calls that currently check BASH with expect(BASH_INSTALL) instead to
fix the ReferenceError that will occur when the test runs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f0f1ba73-5fbd-46ef-bd58-23d0b1c47f9a

📥 Commits

Reviewing files that changed from the base of the PR and between f8b3454 and d22e374.

📒 Files selected for processing (5)
  • .github/workflows/release.yml
  • install
  • install.ps1
  • packages/opencode/test/install/checksum-verification.test.ts
  • test/windows/install.Tests.ps1

Comment thread packages/opencode/test/install/checksum-verification.test.ts
@ralphstodomingo ralphstodomingo force-pushed the feat/installer-checksum-verification branch from d22e374 to dd0134d Compare June 18, 2026 08:46
- install.ps1: decode a Byte[] checksums.txt body so verification works on
  Windows PowerShell 5.1. GitHub serves release assets as octet-stream, so on
  PS 5.1 Invoke-WebRequest returns .Content as Byte[]; it coerced to a decimal
  string and every check silently soft-skipped (sahrizvi, P1).
- install.ps1: pin the archive and checksums.txt to the resolved release tag
  instead of the mutable latest/ URL, so a release published mid-install can't
  hand back mismatched assets and trigger a spurious hard-fail (cubic, P2).
  Falls back to latest/ only when the version can't be resolved.
- install: in verify_checksum, clean up via $(dirname "$file") rather than the
  caller's dynamically-scoped $tmp_dir local — self-contained (cubic, P2).
- tests: Pester coverage for Test-Checksum (String + Byte[] + mismatch paths,
  verified to fail without the decode) and TS guards for the decode and the
  PowerShell same-release pinning.

Note: the bash installer is intentionally left on the latest/download path here
to keep this PR disjoint from #946 (which owns the bash latest-version block);
the two PRs then merge in either order with no conflict.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M7GkS3bYZaFhEbBhVTecG
@ralphstodomingo ralphstodomingo force-pushed the feat/installer-checksum-verification branch from dd0134d to cecfe06 Compare June 18, 2026 08:49

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@install`:
- Around line 398-402: The rm -rf "$(dirname "$file")" command lacks a safety
guard to prevent catastrophic deletion if $file is unexpectedly empty or
resolves to a dangerous path. Add a defensive check immediately before the rm
-rf command to verify that $file is not empty and that the result of dirname
"$file" is not a dangerous path like . or /. This prevents the command from
accidentally deleting the current directory or root-level contents if upstream
code passes invalid data to this function.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6cd11031-39a1-4d03-8431-233a74adff33

📥 Commits

Reviewing files that changed from the base of the PR and between d22e374 and dd0134d.

📒 Files selected for processing (4)
  • install
  • install.ps1
  • packages/opencode/test/install/checksum-verification.test.ts
  • test/windows/install.Tests.ps1
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/opencode/test/install/checksum-verification.test.ts

Comment thread install
install.ps1 had no BOM and used a few non-ASCII characters (em dash, ellipsis,
right arrow) in comments and messages. Windows PowerShell 5.1 — the default
shell on Windows 10 and preinstalled on Windows 11 — reads a BOM-less file as
the system ANSI codepage, not UTF-8, so those multi-byte characters corrupt the
token stream and the whole script fails to parse (verified on real PS 5.1:
"The '<' operator is reserved", cascading to "Missing closing '}'").

This is a pre-existing issue (the characters predate this PR) that CI doesn't
catch because the Pester job runs under pwsh (PowerShell 7, UTF-8 by default).
Replacing the three characters with ASCII equivalents (-, ..., ->) makes the
installer parse and run on PS 5.1 while keeping pwsh behavior identical. Verified
end-to-end on real Windows PowerShell 5.1: resolve version -> download -> extract
-> place the binary all succeed.

Same transliteration is applied verbatim in #946 so the two PRs merge cleanly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M7GkS3bYZaFhEbBhVTecG
ralphstodomingo added a commit that referenced this pull request Jun 18, 2026
install.ps1 had no BOM and used a few non-ASCII characters (em dash, ellipsis,
right arrow) in comments and messages. Windows PowerShell 5.1 - the default
shell on Windows 10 and preinstalled on Windows 11 - reads a BOM-less file as
the system ANSI codepage, not UTF-8, so those multi-byte characters corrupt the
token stream and the whole script fails to parse (verified on real PS 5.1).

This is a pre-existing issue (the characters predate this PR) that CI doesn't
catch because the Pester job runs under pwsh (PowerShell 7, UTF-8 by default).
Replacing the three characters with ASCII equivalents (-, ..., ->) makes the
installer parse and run on PS 5.1 while keeping pwsh behavior identical.

Also removes the now-obsolete "integrity verification deferred" NOTE comment:
the sibling PR #942 implements that verification and removes the same block, so
deleting it here too keeps the two PRs mergeable in either order with no
conflict. Same transliteration is applied verbatim in #942.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M7GkS3bYZaFhEbBhVTecG
ralphstodomingo and others added 2 commits June 18, 2026 17:16
…l path

Defensive depth (coderabbit): only `rm -rf` the cleanup dir when dirname
resolves to a real subdirectory, never "." or "/", so an unexpectedly empty or
root-level $file can't wipe the cwd or worse.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M7GkS3bYZaFhEbBhVTecG
The #952 release-validation suite asserted the exact #930 URL literals. This PR
builds the archive and checksums.txt from a shared $base (so they always come
from the same release), so update those assertions to the $base/$url form, and
convert the now-obsolete "verification deferred" test.todo into a real assertion
that Test-Checksum verifies SHA256 before extraction.

(This test never ran on this PR until it was retargeted from the merged
feat/windows-powershell-installer branch to main.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M7GkS3bYZaFhEbBhVTecG
@ralphstodomingo

Copy link
Copy Markdown
Contributor

Combined end-to-end verification (both installer PRs together)

#942 and #946 are sibling PRs that both touch install / install.ps1. Both were rebased onto main (now that #930 has merged) and verified together as the combined installer that will ship.

Merge safety

Real Windows verification

Ran the merged install.ps1 on a real Windows PowerShell 5.1 host (5.1.26100, Desktop), the default shell on Windows 10 / clean Windows 11:

  • 🐛 Found & fixed a pre-existing parse failure on PS 5.1. install.ps1 had a few non-ASCII characters (em dash / ellipsis / arrow) and no BOM, so PS 5.1 read it as ANSI and the whole script failed to tokenize. CI never caught it because the Pester job runs under pwsh (PowerShell 7, UTF-8). Both PRs are now ASCII-only and parse cleanly on 5.1. (The characters predate these PRs.)
  • Full install E2E on real PS 5.1: resolve latest (0.8.7) → download the real altimate-windows-x64.zip (~268 MB) from the pinned release URL → checksum step (soft-skips correctly, since v0.8.7 predates the new checksums.txt asset) → Expand-Archive → binary placed (verified as a valid 281 MB PE executable).

#942 — checksum verification

  • The real Test-Checksum was exercised on PS 5.1 against checksums.txt served both as a String and as a Byte[] (the latter is what Windows PowerShell 5.1 actually returns for GitHub's application/octet-stream assets), plus a mismatch case.
  • Confirmed the Byte[] test fails on the old code (silent soft-skip) and passes with the decode fix — i.e. it's a real regression guard, now also pinned by a Pester test.
  • Archive + checksums.txt are pinned to one resolved $base, so they can't come from two different releases.

#946 — resilient latest-version fetch

  • Reproduced the set -euo pipefail abort: without the trailing || true, a failing curl --fail aborts the script at attempt 1 (exit 22); with it, all three retries run and the graceful-degrade path prints and continues.
  • Confirmed on real PowerShell that resetting $specificVersion = $null makes the "already installed" check fall through ($null -eq "" is $false) instead of falsely short-circuiting on "" -eq "" for a missing/corrupt binary.

Cross-PR composition (verified on real PowerShell)

With both changes combined: when the version can't be resolved, #946 sets $specificVersion = $null, which flows into #942's URL selection and correctly falls back to the mutable latest/ path; when a version is resolved, both the archive and checksums pin to it.

CI

Green on both: TypeScript, Windows Installer (Pester), and the #930 release-validation suite (updated in each PR to track the URL-construction and version-fetch behavior changes).

@dev-punia-altimate

Copy link
Copy Markdown
Contributor

❌ Tests — Failures Detected

TypeScript — 15 failure(s)

  • connection_refused
  • timeout
  • permission_denied
  • parse_error
  • oom [1.00ms]
  • network_error
  • auth_failure
  • rate_limit
  • internal_error
  • empty_error
  • connection_refused
  • timeout
  • permission_denied
  • parse_error
  • network_error [1.00ms]

Next Step

Please address the failing cases above and re-run verification.

cc @mdesmet

@sahrizvi sahrizvi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All review concerns adressed and tested E2E, so LGTM.

@sahrizvi sahrizvi merged commit 31e73d0 into main Jun 18, 2026
17 checks passed
sahrizvi pushed a commit that referenced this pull request Jun 18, 2026
* fix(install): don't hard-fail when the GitHub releases API blips

Reported on #930: a transient 504 from api.github.com/.../releases/latest (or
the 60/hr/IP unauthenticated rate limit) aborted the whole install with
"Failed to fetch version information" — even though the download itself uses
releases/latest/download/<file>, which GitHub resolves server-side with no API
call. The API response only feeds the version-string display and the
already-installed short-circuit.

Both installers now, in the latest path:
- retry the API call up to 3x with linear backoff (bash uses curl --fail so a
  504 retries instead of parsing an error body);
- on continued failure, print a muted notice and proceed to install latest
  anyway (version string shown as "latest");
- only short-circuit as "already installed" on a real version match — never
  treat empty==empty (unresolved version + unreadable binary) as installed.

Pinned-version installs (-Version / --version) are unchanged: a genuine 404
still hard-fails.

Tests: version-fetch-resilience.test.ts pins the retry + graceful-degrade
behavior in both installers. bash -n clean; install.ps1 parses clean and the
Pester suite (6/6) still passes on PowerShell 7.6.2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(install): address latest-version-fetch review

- install: append `|| true` to the retry's curl|sed assignment. Under
  `set -euo pipefail` a failing `curl --fail` propagated through the pipeline
  and aborted the script at attempt 1, before the loop could retry or degrade
  (sahrizvi; reproduced: exit 22 without the fix, all 3 attempts + degrade with
  it). Also add `--max-time 10` to bound a dead-air socket.
- install.ps1: reset $specificVersion to $null (not "") on the degrade path, so
  the already-installed short-circuit can't false-match "" -eq "" when the
  version probe of a missing/corrupt binary also yields "" (dev-punia, sahrizvi).
- install.ps1: add -TimeoutSec 10 to Invoke-RestMethod (defaults to 100s on
  PS 5.1, unbounded on PS 7+) to bound retries on dead air (sahrizvi).
- tests: TS guards for `|| true`, --max-time/-TimeoutSec, and the $null reset.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M7GkS3bYZaFhEbBhVTecG

* fix(install.ps1): ASCII-only so it parses on Windows PowerShell 5.1

install.ps1 had no BOM and used a few non-ASCII characters (em dash, ellipsis,
right arrow) in comments and messages. Windows PowerShell 5.1 - the default
shell on Windows 10 and preinstalled on Windows 11 - reads a BOM-less file as
the system ANSI codepage, not UTF-8, so those multi-byte characters corrupt the
token stream and the whole script fails to parse (verified on real PS 5.1).

This is a pre-existing issue (the characters predate this PR) that CI doesn't
catch because the Pester job runs under pwsh (PowerShell 7, UTF-8 by default).
Replacing the three characters with ASCII equivalents (-, ..., ->) makes the
installer parse and run on PS 5.1 while keeping pwsh behavior identical.

Also removes the now-obsolete "integrity verification deferred" NOTE comment:
the sibling PR #942 implements that verification and removes the same block, so
deleting it here too keeps the two PRs mergeable in either order with no
conflict. Same transliteration is applied verbatim in #942.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M7GkS3bYZaFhEbBhVTecG

* test: update #930 release-validation for resilient version fetch

The #952 release-validation suite asserted the latest path hard-fails with
"Failed to fetch version information" (>=2) and that exit 1 appears >=3 times.
This PR makes the latest path retry then degrade gracefully instead of aborting,
so update those assertions: the latest path no longer hard-fails (the unsupported
-arch and pinned-404 paths still exit 1, hence >=2).

(This test never ran on this PR until it was retargeted from the merged
feat/windows-powershell-installer branch to main.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M7GkS3bYZaFhEbBhVTecG

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: ralphstodomingo <ralphstodomingo@users.noreply.github.com>
@ralphstodomingo ralphstodomingo deleted the feat/installer-checksum-verification branch June 18, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants