Claude Code. Any Model. The most powerful AI coding agent now speaks every language.
ci: verify the magmux download against checksums pinned in magmux.env
Jack Rudenkoa9a35a19e63e
diff --git a/.github/magmux.env b/.github/magmux.envindex b35e4b6b..e014b34e 100644--- a/.github/magmux.env+++ b/.github/magmux.env@@ -1,4 +1,10 @@# The ONE magmux pin, read by test.yml (the pane suites run against it) and release.yml# (the binaries ship it), so the magmux that ships is the magmux that was tested.-# Bump it deliberately, after the pane suites pass against the new release.+# Bump the tag and all four checksums together, deliberately, after the pane suites+# pass against the new release. The sums are copied from the release's checksums.txt+# and verified independently of it: a replaced asset or a moved tag fails the download.MAGMUX_TAG=v0.14.0+MAGMUX_SHA256_darwin_amd64=3ad723b3b2ea8ab55aff1df0a91d7cdb4eef2afc121e22fbdf76b31de1d49ded+MAGMUX_SHA256_darwin_arm64=a00ebd3f0c2b9fab14b1bd1ca554aaa1f60bbdddbae4e6dd634d65fb5ffda9e3+MAGMUX_SHA256_linux_amd64=4a37911687f781e312239f86f82e259c1937f69a249897d6ee386737be4b01d7+MAGMUX_SHA256_linux_arm64=bb22ce371d136cde07a407965898ff9f6c1a46d93b19d05bd7f0cc511b9603b2diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex dec6ffdd..5f2821df 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -52,8 +52,8 @@ jobs:# PINNED, never "latest": MCP team slots and create_session run in magmux panes# and need magmux >= MIN_MAGMUX_VERSION (packages/cli/src/pane/pane-launch.ts),# and a new magmux release must not change what an existing claudish tag ships.- # The tag lives in .github/magmux.env, which test.yml installs from too:- # what ships is what the pane suites ran against.+ # The tag and checksums live in .github/magmux.env, which test.yml installs+ # from too: what ships is what the pane suites ran against.set -a; . .github/magmux.env; set +aMIN=$(sed -n 's/^export const MIN_MAGMUX_VERSION = "\(.*\)";$/\1/p' packages/cli/src/pane/pane-launch.ts)if [ -z "$MIN" ]; then echo "MIN_MAGMUX_VERSION not found in pane-launch.ts"; exit 1; fi@@ -62,8 +62,11 @@ jobs:fiecho "Using magmux ${MAGMUX_TAG} (panes need >= ${MIN})"ASSET="magmux_${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz"- gh release download "${MAGMUX_TAG}" --repo MadAppGang/magmux --pattern "${ASSET}" --pattern checksums.txt --dir /tmp- (cd /tmp && grep " ${ASSET}\$" checksums.txt | shasum -a 256 -c -)+ WANT=$(eval echo "\$MAGMUX_SHA256_${{ matrix.goos }}_${{ matrix.goarch }}")+ if [ -z "$WANT" ]; then echo "no pinned checksum for ${ASSET} in .github/magmux.env"; exit 1; fi+ gh release download "${MAGMUX_TAG}" --repo MadAppGang/magmux --pattern "${ASSET}" --dir /tmp+ # the PINNED sum, not the release's own checksums.txt: that one moves with the asset+ echo "${WANT} /tmp/${ASSET}" | shasum -a 256 -c -tar xzf "/tmp/${ASSET}" -C /tmp/tmp/magmux --version | grep -q "${MAGMUX_TAG#v}" || { echo "downloaded magmux is not ${MAGMUX_TAG}"; /tmp/magmux --version; exit 1; }# Rename to Node.js platform-arch convention (amd64 → x64)diff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlindex f723e769..1c18c244 100644--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@ -63,8 +63,8 @@ jobs:- name: Install dependenciesrun: bun install --frozen-lockfile- # The pane suites run against the SAME magmux the release ships: the tag in- # .github/magmux.env, which release.yml reads too. The Homebrew+ # The pane suites run against the SAME magmux the release ships: the tag and+ # checksums in .github/magmux.env, which release.yml reads too. The Homebrew# tap served whatever was current, so CI could go green against 0.15 while# 0.14.0 shipped untested. Installed to /usr/local/bin, a path# findMagmuxForTest() and the launcher both search (no Homebrew copy exists on@@ -74,8 +74,9 @@ jobs:set -a; . .github/magmux.env; set +aARCH=$(uname -m); case "$ARCH" in (arm64|aarch64) ARCH=arm64;; (x86_64) ARCH=amd64;; esacASSET="magmux_darwin_${ARCH}.tar.gz"- gh release download "${MAGMUX_TAG}" --repo MadAppGang/magmux --pattern "${ASSET}" --pattern checksums.txt --dir /tmp- (cd /tmp && grep " ${ASSET}\$" checksums.txt | shasum -a 256 -c -)+ WANT=$(eval echo "\$MAGMUX_SHA256_darwin_${ARCH}")+ gh release download "${MAGMUX_TAG}" --repo MadAppGang/magmux --pattern "${ASSET}" --dir /tmp+ echo "${WANT} /tmp/${ASSET}" | shasum -a 256 -c -tar xzf "/tmp/${ASSET}" -C /tmpsudo install -m 0755 /tmp/magmux /usr/local/bin/magmuxmagmux --version | grep -q "${MAGMUX_TAG#v}" || { echo "installed magmux is not ${MAGMUX_TAG}"; magmux --version; exit 1; }