fix(installer): resolve releases from the public channel, not stale GitHub assets - #964
Merged
Merged
Conversation
…itHub assets
The documented one-liner resolved "latest" from the version-less GitHub assets
published under terraphim/terraphim-ai, which top out at v1.21.3 and do not
carry the names the current release line produces. The installer therefore
either installed an older release or failed outright.
Resolution is now manifest-driven:
* both scripts read <binary>/stable-v2.json from downloads.terraphim.ai, with
stable.json as a checksum-less fallback for the transitional period
* asset names come from the manifest, so the seven published targets resolve
correctly, including the architecture-specific macOS archives ahead of the
universal one
* the requested version must match what the channel serves; anything else is
a distinct exit code rather than a silent substitution
* downloads are verified against the manifest SHA-256 and unpacked from a
staging directory, so a mismatch or an unexpected archive leaves nothing in
the install directory
scripts/test-installer.sh replaces the previous harness, which asserted nothing
about the artefacts: it now installs and runs the real binary and proves, by
serving a manifest with wrong digests, that a manipulated release is refused.
scripts/SHA256SUMS pins the sibling utilities the installer fetches when it is
run through curl|bash and has no directory of its own.
Verified: 13/13 checks pass against the live channel; installer exit codes
0/2/3/5 exercised; all seven targets resolve; tampered manifest and tampered
utility both refused with nothing installed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The documented install one-liner:
resolved
latestfrom the version-less GitHub assets published underterraphim/terraphim-ai. That release line stops at v1.21.3 and never producesthe names the current line ships, so the installer either installed a release
thirteen patches behind or failed outright. The current release, v1.21.16, is
published through
downloads.terraphim.aias version-and-target archives.Change
Resolution is now manifest-driven. Both scripts read
<binary>/stable-v2.jsonfrom the channel, withstable.jsonas achecksum-less fallback for the transitional period. GitHub Releases is no
longer consulted for resolution.
including the architecture-specific macOS archives ahead of the universal one
with a distinct code rather than silently substituting another version
staging directory; the destination is written only after the bytes verify and
the archive is proved to contain the expected binary
gone
Exit codes:
0success,1usage,2manifest unreachable,3versionunavailable,
4download failed,5checksum mismatch,6install failed.scripts/SHA256SUMSpins the sibling utilities the installer fetches when itruns under
curl | bashand has no directory of its own.Test evidence
scripts/test-installer.shreplaces the previous harness, which reportedsuccess without asserting anything about the artefacts. It installs and runs
the real binary, and proves fail-closed behaviour by serving a manifest whose
digests are wrong while proxying the real archive bytes.
Run it with
bash scripts/test-installer.sh.Manually exercised as well: all seven targets resolve against the live
manifests;
--with-cli --with-grep,--cli-only,--version 1.21.16and--skip-verifyeach behave; a tampered manifest exits5with an empty installdirectory; a tampered helper script is rejected before any install.
Follow-up (not in this PR)
raw.githubusercontent.comcaches for several minutes, so the publishedone-liner picks up this script shortly after merge. The website will set
branch=mainon the raw URL to make the fix immediate, and can pinUTILS_REVISIONto a tag for reproducibility.