Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

chore: pinned sandbox images for every release

Samrat Talukdarc18de7e39d7a
diff --git a/.github/workflows/box-images.yml b/.github/workflows/box-images.yml
index d9cbe139..330b24ff 100644
--- a/.github/workflows/box-images.yml
+++ b/.github/workflows/box-images.yml
@@ -1,26 +1,70 @@
-# Builds and pushes the OmniRush box images (apps/desktop/box/images/<stack>/Dockerfile,
-# the same files as omnirush-cli box/images) for linux/amd64 and linux/arm64: base first,
-# the stacks FROM base@digest. Manual only. Published from this public repository, the
-# packages are public and linked to it. The refs are the ones the CLI and the app pin
-# (src/box/images.json); the job prints each digest.
+# Publishes one box version (apps/desktop/box/VERSION): the sandbox images
+# ghcr.io/omnirush-ai/box-{base,go,rust,java,ruby}:<version> for linux/amd64 and
+# linux/arm64, and the OmniRush WSL image (omnirush-wsl-<version>-<arch>.tar.gz) on the
+# `box-<version>` release of this repository, with box-pins.json beside it.
+#
+# Published from this public repository with GITHUB_TOKEN, the packages are public and
+# linked here. Each image and WSL asset carries a hash of its sources: a version that
+# already exists with the same sources is reused as it is, so a run is safe to repeat; one
+# that exists with other sources fails (bump apps/desktop/box/VERSION).
+#
+# Afterwards both repositories take the pins with `node scripts/box/pins.mjs <version>`
+# (images.json and wsl.json, byte-identical) and commit them. The release guard
+# (scripts/box/check-pins.mjs) refuses an app release without them. See RELEASING.md.
name: box-images
on:
+ push:
+ branches: [main]
+ paths:
+ - apps/desktop/box/VERSION
+ - apps/desktop/box/images/**
+ - apps/desktop/box/wsl/**
workflow_dispatch:
inputs:
- version:
- description: "image tag, e.g. 2026.10.1"
- required: true
- stacks:
- description: "stacks after base (space separated)"
- default: "go rust java ruby"
+ adopt_existing:
+ description: "Reuse images of this version published before source hashes were recorded"
+ type: boolean
+ default: false
permissions:
- contents: read
+ contents: write
packages: write
+concurrency:
+ group: box-images
+ cancel-in-progress: false
+env:
+ BOX_DIR: apps/desktop/box
jobs:
- build:
+ prepare:
runs-on: ubuntu-latest
- timeout-minutes: 150
+ outputs:
+ version: ${{ steps.v.outputs.version }}
+ steps:
+ - uses: actions/checkout@v4
+ - id: v
+ run: |
+ set -euo pipefail
+ version=$(tr -d ' \n' < "$BOX_DIR/VERSION")
+ [[ "$version" =~ ^[0-9]{4}\.[0-9]{1,2}\.[0-9]+$ ]] || { echo "::error::bad box version '$version'"; exit 1; }
+ echo "version=$version" >> "$GITHUB_OUTPUT"
+ - name: Release box-${{ steps.v.outputs.version }}
+ env:
+ GH_TOKEN: ${{ github.token }}
+ VERSION: ${{ steps.v.outputs.version }}
+ run: |
+ set -euo pipefail
+ if ! gh release view "box-$VERSION" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
+ gh release create "box-$VERSION" --repo "$GITHUB_REPOSITORY" --target "$GITHUB_SHA" --latest=false \
+ --title "Sandbox images $VERSION" \
+ --notes "Sandbox images for box version $VERSION: the OmniRush WSL image for Windows, and box-pins.json with the pinned image digests. The Linux images are ghcr.io/omnirush-ai/box-{base,go,rust,java,ruby}:$VERSION."
+ fi
+
+ images:
+ needs: prepare
+ runs-on: ubuntu-latest
+ timeout-minutes: 180
env:
+ VERSION: ${{ needs.prepare.outputs.version }}
+ ADOPT: ${{ inputs.adopt_existing || false }}
SOURCE: https://github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v4
@@ -31,26 +75,133 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- - name: base
- id: base
+ - name: Build or reuse each image
run: |
set -euo pipefail
- ref=ghcr.io/omnirush-ai/box-base:${{ inputs.version }}
- docker buildx build --platform linux/amd64,linux/arm64 --provenance=false --push \
- --label "org.opencontainers.image.source=$SOURCE" -t "$ref" --metadata-file base.json apps/desktop/box/images/base
- digest=$(jq -r '."containerimage.digest"' base.json)
- echo "digest=$digest" >> "$GITHUB_OUTPUT"
- echo "base $ref@$digest" >> pins.txt
- - name: stacks
+ tree_hash() { (cd "$1" && find . -type f -print0 | sort -z | xargs -0 sha256sum) | sha256sum | cut -c1-64; }
+ base_src=$(tree_hash "$BOX_DIR/images/base")
+ base_digest=""
+ echo '{}' > digests.json
+ for stack in base go rust java ruby; do
+ ref="ghcr.io/omnirush-ai/box-$stack:$VERSION"
+ if [ "$stack" = base ]; then src=$base_src; else src=$(printf '%s %s' "$(tree_hash "$BOX_DIR/images/$stack")" "$base_src" | sha256sum | cut -c1-64); fi
+ if docker buildx imagetools inspect "$ref" >/dev/null 2>&1; then
+ digest=$(docker buildx imagetools inspect "$ref" --format '{{json .Manifest}}' | jq -r .digest)
+ label=$(docker buildx imagetools inspect "$ref" --format '{{json .Image}}' | jq -r '."linux/amd64".config.Labels["ai.omnirush.box.source"] // empty')
+ if [ "$label" = "$src" ]; then echo "box-$stack:$VERSION exists with these sources: reused"
+ elif [ -z "$label" ] && [ "$ADOPT" = true ]; then echo "::warning::box-$stack:$VERSION has no source hash: adopted as published"
+ else echo "::error::box-$stack:$VERSION exists with other sources: bump $BOX_DIR/VERSION"; exit 1; fi
+ else
+ args=(--platform linux/amd64,linux/arm64 --provenance=false --push -t "$ref" --metadata-file "$stack.meta.json"
+ --label "org.opencontainers.image.source=$SOURCE" --label "ai.omnirush.box.source=$src")
+ [ "$stack" = base ] || args+=(--build-arg "BASE=ghcr.io/omnirush-ai/box-base@$base_digest")
+ docker buildx build "${args[@]}" "$BOX_DIR/images/$stack"
+ digest=$(jq -r '."containerimage.digest"' "$stack.meta.json")
+ fi
+ [ "$stack" = base ] && base_digest=$digest
+ jq --arg s "$stack" --arg d "$digest" '.[$s] = $d' digests.json > d.tmp && mv d.tmp digests.json
+ echo "$stack $ref@$digest"
+ done
+ - name: images.json
run: |
set -euo pipefail
- for stack in ${{ inputs.stacks }}; do
- ref=ghcr.io/omnirush-ai/box-$stack:${{ inputs.version }}
- docker buildx build --platform linux/amd64,linux/arm64 --provenance=false --push \
- --label "org.opencontainers.image.source=$SOURCE" \
- --build-arg BASE=ghcr.io/omnirush-ai/box-base@${{ steps.base.outputs.digest }} \
- -t "$ref" --metadata-file "$stack.json" "apps/desktop/box/images/$stack"
- echo "$stack $ref@$(jq -r '."containerimage.digest"' "$stack.json")" >> pins.txt
- done
- cat pins.txt
- cat pins.txt >> "$GITHUB_STEP_SUMMARY"
+ node --input-type=module -e '
+ import { readFileSync, writeFileSync } from "node:fs";
+ const version = process.env.VERSION, digests = JSON.parse(readFileSync("digests.json", "utf8"));
+ const ACCEPT = "application/vnd.oci.image.index.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.oci.image.manifest.v1+json";
+ const images = {};
+ for (const stack of ["base", "go", "rust", "java", "ruby"]) {
+ const repo = `omnirush-ai/box-${stack}`;
+ const { token } = await (await fetch(`https://ghcr.io/token?scope=repository:${repo}:pull`)).json();
+ const get = async (ref) => (await fetch(`https://ghcr.io/v2/${repo}/manifests/${ref}`, { headers: { Authorization: `Bearer ${token}`, Accept: ACCEPT } })).json();
+ const index = await get(digests[stack]);
+ const amd64 = index.manifests.find((m) => m.platform?.architecture === "amd64");
+ const bytes = (await get(amd64.digest)).layers.reduce((n, l) => n + l.size, 0);
+ images[stack] = { ref: `ghcr.io/omnirush-ai/box-${stack}:${version}`, digest: digests[stack], approx_mb: Math.round(bytes / 1e7) * 10 };
+ }
+ writeFileSync("images.json", JSON.stringify({ version, registry: "ghcr.io/omnirush-ai", images }));'
+ cat images.json
+ - uses: actions/upload-artifact@v4
+ with:
+ name: box-images-json
+ path: images.json
+
+ wsl:
+ needs: prepare
+ strategy:
+ matrix:
+ include:
+ - arch: amd64
+ runner: ubuntu-24.04
+ - arch: arm64
+ runner: ubuntu-24.04-arm
+ runs-on: ${{ matrix.runner }}
+ timeout-minutes: 60
+ env:
+ VERSION: ${{ needs.prepare.outputs.version }}
+ ARCH: ${{ matrix.arch }}
+ GH_TOKEN: ${{ github.token }}
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-go@v5
+ with:
+ go-version-file: apps/desktop/box/go/go.mod
+ cache: false
+ - name: Build or reuse the WSL image
+ run: |
+ set -euo pipefail
+ tag="box-$VERSION"; name="omnirush-wsl-$VERSION-$ARCH"
+ src=$( (cd "$BOX_DIR/wsl" && find . -type f -print0 | sort -z | xargs -0 sha256sum) | sha256sum | cut -c1-64)
+ mkdir -p dist
+ if gh release view "$tag" --repo "$GITHUB_REPOSITORY" --json assets -q '.assets[].name' | grep -qx "$name.tar.gz"; then
+ gh release download "$tag" --repo "$GITHUB_REPOSITORY" -p "$name.tar.gz" -p "$name.source" -D dist
+ [ "$(cat "dist/$name.source")" = "$src" ] || { echo "::error::$name exists with other sources: bump $BOX_DIR/VERSION"; exit 1; }
+ echo "$name exists with these sources: reused"
+ else
+ for cmd in boxrun boxd; do
+ (cd "$BOX_DIR/go" && CGO_ENABLED=0 GOOS=linux GOARCH="$ARCH" go build -trimpath -buildvcs=false \
+ -ldflags "-s -w -X main.version=box-$VERSION" -o "../bin/linux-$ARCH/$cmd" "./cmd/$cmd")
+ done
+ bash "$BOX_DIR/wsl/build-rootfs.sh" "$VERSION" "$ARCH" dist
+ printf '%s\n' "$src" > "dist/$name.source"
+ gh release upload "$tag" --repo "$GITHUB_REPOSITORY" "dist/$name.tar.gz" "dist/$name.source"
+ fi
+ sha=$(sha256sum "dist/$name.tar.gz" | cut -d' ' -f1); bytes=$(stat -c %s "dist/$name.tar.gz")
+ url="https://github.com/$GITHUB_REPOSITORY/releases/download/$tag/$name.tar.gz"
+ jq -n --arg url "$url" --arg sha "$sha" --argjson bytes "$bytes" '{url: $url, sha256: $sha, bytes: $bytes}' > "wsl-$ARCH.json"
+ cat "wsl-$ARCH.json"
+ - uses: actions/upload-artifact@v4
+ with:
+ name: box-wsl-${{ matrix.arch }}
+ path: wsl-${{ matrix.arch }}.json
+
+ pins:
+ needs: [prepare, images, wsl]
+ runs-on: ubuntu-latest
+ env:
+ VERSION: ${{ needs.prepare.outputs.version }}
+ GH_TOKEN: ${{ github.token }}
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/download-artifact@v4
+ with:
+ path: parts
+ merge-multiple: true
+ - name: box-pins.json
+ run: |
+ set -euo pipefail
+ base=$(sed -n 's/^FROM \(debian:[^ ]*\).*/\1/p' "$BOX_DIR/wsl/Dockerfile" | head -1)
+ jq -n --slurpfile images parts/images.json --slurpfile a parts/wsl-amd64.json --slurpfile b parts/wsl-arm64.json \
+ --arg version "$VERSION" --arg base "$base" \
+ '{images: $images[0], wsl: {version: $version, distro: "OmniRushBox", base: $base, assets: {amd64: $a[0], arm64: $b[0]}}}' > box-pins.json
+ gh release upload "box-$VERSION" --repo "$GITHUB_REPOSITORY" --clobber box-pins.json
+ - name: Check the pins and show them
+ run: |
+ set -euo pipefail
+ node scripts/box/pins.mjs --file box-pins.json
+ node scripts/box/check-pins.mjs
+ {
+ echo "### Box $VERSION pins"
+ echo 'In each repository: `node scripts/box/pins.mjs '"$VERSION"'`, then commit `images.json` and `wsl.json` (CLI: src/box/, desktop: apps/server/src/box/).'
+ echo '```diff'; git diff -- apps/server/src/box/images.json apps/server/src/box/wsl.json; echo '```'
+ } >> "$GITHUB_STEP_SUMMARY"
diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml
index a40d96dc..4bfcf3d3 100644
--- a/.github/workflows/release-desktop.yml
+++ b/.github/workflows/release-desktop.yml
@@ -46,6 +46,19 @@ jobs:
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "version=${tag#v}" >> "$GITHUB_OUTPUT"
+ # Before anything is built or a release is created: the sandbox images this release
+ # ships with are pinned by digest, anonymously pullable for amd64 and arm64, and the
+ # WSL image URL returns its pinned sha256 (scripts/box/check-pins.mjs; RELEASING.md).
+ - name: Check out release tag
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ steps.release.outputs.tag }}
+ fetch-depth: 1
+
+ - name: Sandbox images are pinned and published
+ shell: bash
+ run: node scripts/box/check-pins.mjs apps/server/src/box/images.json apps/server/src/box/wsl.json
+
- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
diff --git a/RELEASING.md b/RELEASING.md
new file mode 100644
index 00000000..714bd1c8
--- /dev/null
+++ b/RELEASING.md
@@ -0,0 +1,46 @@
+# Releasing
+
+## How a release gets its sandbox images
+
+The Linux sandbox runs every project on a prebuilt image, `ghcr.io/omnirush-ai/box-{base,go,rust,java,ruby}`. On Windows, the OmniRush WSL backend imports its own root filesystem. The app pins both:
+
+- `apps/server/src/box/images.json`: each image by its multi-arch digest (linux/amd64 and linux/arm64);
+- `apps/server/src/box/wsl.json`: the WSL image's URL and sha256, for amd64 and arm64.
+
+The CLI ships byte-identical copies in `src/box/`. Both repos list them in `PARITY.sha256`.
+
+The images have their own version, the **box version** (`apps/desktop/box/VERSION`, for example `2026.10.2`). App releases don't change it, so most releases reuse the pinned images as they are and need nothing extra.
+
+The release workflow refuses to publish unless `node scripts/box/check-pins.mjs` passes. That means:
+
+- every image has a digest, and is pullable without a login for amd64 and arm64;
+- the WSL URL returns the pinned sha256.
+
+## When the images change
+
+Rebuild only when `apps/desktop/box/images/` or `apps/desktop/box/wsl/` changes. The CLI's `box/` must stay the same (`apps/desktop/box/PARITY.sha256`).
+
+1. Bump the box version in both repos, the one command being:
+
+ ```sh
+ echo 2026.10.3 > apps/desktop/box/VERSION # CLI: box/VERSION
+ ```
+
+ Merge that to `main`. The `box-images` workflow runs on its own (or start it from Actions). It:
+ - builds and pushes the five images for amd64 and arm64;
+ - builds the WSL image for both;
+ - attaches both WSL images and `box-pins.json` to the `box-<version>` release.
+
+ The packages are public because this repository is.
+2. Take the pins, in each repository, and commit them:
+
+ ```sh
+ node scripts/box/pins.mjs 2026.10.3 # writes images.json, wsl.json and their PARITY list
+ node scripts/box/check-pins.mjs # the release guard, run locally
+ ```
+
+A run is safe to repeat. An image or WSL asset that already exists with the same sources is reused. One that exists with other sources fails the run, which means the box version needs a bump.
+
+## Desktop release
+
+Push a signed `v<version>` tag on `main`. `release-desktop.yml` checks the sandbox pins first, then builds, signs and publishes.
diff --git a/apps/desktop/box/PARITY.sha256 b/apps/desktop/box/PARITY.sha256
new file mode 100644
index 00000000..aee26170
--- /dev/null
+++ b/apps/desktop/box/PARITY.sha256
@@ -0,0 +1,11 @@
+# The sandbox image sources: the same files in omnirush-cli (box/) and omnirush-gui (apps/desktop/box/).
+# A change to one must be ported to the other and this list updated in both (scripts/box/pins.mjs refreshes the pins' list).
+c314a88a6333258f07228d9472629cb4f1365807786cfbce285b560616a03f53 VERSION
+4318ca0c74f47444ba42bab9e02f603188e12c9ef02001c1062d0e5ab04452c3 images/base/Dockerfile
+789e75f84e6977c034fec626a4882e00d3acaad0bba32273f27e12883766b39f images/go/Dockerfile
+33a3256b9b7ce5a07ffc9486e6ce310d8c4c83f5e3e9574a3747dcb3fd9e394b images/rust/Dockerfile
+e80096eddeb85b1b9164382511c576a7b9c1847188d3986aadb29c863eb59da1 images/java/Dockerfile
+d2ded63441637089b8b19561d1bddff003c92cce9769721c86a4a20c6fb1cc99 images/ruby/Dockerfile
+7bf26aa39fb1d91b79dd36f0bc1e6be24365e26d6a86aa80c04ecede3b6c23d0 wsl/Dockerfile
+7fbd3f78323f2d36ebcd0a8bb941dafc4fdfaf3ccc229c656ebc632483836368 wsl/build-rootfs.sh
+65493e3c3c8a2c434ab7062506fa364670710800b611b174eb4392d7d4783f9c wsl/wsl.conf
diff --git a/apps/desktop/box/VERSION b/apps/desktop/box/VERSION
new file mode 100644
index 00000000..6e34cd3d
--- /dev/null
+++ b/apps/desktop/box/VERSION
@@ -0,0 +1 @@
+2026.10.2
diff --git a/apps/desktop/box/wsl/Dockerfile b/apps/desktop/box/wsl/Dockerfile
new file mode 100644
index 00000000..6020e1a7
--- /dev/null
+++ b/apps/desktop/box/wsl/Dockerfile
@@ -0,0 +1,17 @@
+# OmniRushBox, the WSL 2 distro the Windows backend imports (`wsl --import`): the same pinned
+# Debian base the box images are built FROM, plus boxrun/boxd, which run each project's box
+# inside it from the same pinned images (so a Windows box is the Linux box). Exported as a
+# root filesystem tarball by build-rootfs.sh; pinned by sha256 in src/box/wsl.json.
+FROM debian:bookworm-slim@sha256:7c7b2c966bc9ee8cedfeef67e0e279108992c77681fa595db4a9d65c06ccc587
+ARG VERSION=dev
+RUN set -eux; \
+ apt-get update; \
+ apt-get install -y --no-install-recommends ca-certificates; \
+ rm -rf /var/lib/apt/lists/* /usr/share/doc/* /usr/share/man/* /usr/share/info/* /var/cache/debconf/*-old /var/log/*.log; \
+ command -v unshare nsenter; \
+ mkdir -p /opt/omnirush /var/lib/omnirush/store /var/lib/omnirush/boxes
+COPY wsl.conf /etc/wsl.conf
+COPY boxrun boxd /opt/omnirush/
+RUN chmod 0755 /opt/omnirush/boxrun /opt/omnirush/boxd \
+ && echo "$VERSION" > /etc/omnirush-wsl-version \
+ && /opt/omnirush/boxrun --version
diff --git a/apps/desktop/box/wsl/build-rootfs.sh b/apps/desktop/box/wsl/build-rootfs.sh
new file mode 100755
index 00000000..b3d45030
--- /dev/null
+++ b/apps/desktop/box/wsl/build-rootfs.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# Build OmniRushBox's root filesystem tarball (the Windows backend's `wsl --import` input):
+# box/wsl/build-rootfs.sh <version> [amd64|arm64] [out dir]
+# Needs docker (buildx for a foreign arch) and the Linux helpers in box/bin (scripts/build-box.mjs).
+# Prints the asset line for src/box/wsl.json. Nothing is published from here.
+set -euo pipefail
+VERSION=${1:?version, e.g. 2026.10.1}; ARCH=${2:-amd64}; OUT=$(mkdir -p "${3:-dist}" && cd "${3:-dist}" && pwd)
+HERE=$(cd "$(dirname "$0")" && pwd); ROOT=$(cd "$HERE/../.." && pwd)
+for f in boxrun boxd; do [ -x "$ROOT/box/bin/linux-$ARCH/$f" ] || { echo "missing box/bin/linux-$ARCH/$f (node scripts/build-box.mjs)"; exit 1; }; done
+CTX=$(mktemp -d); trap 'rm -rf "$CTX"; docker rm -f "omnirush-wsl-build-$$" >/dev/null 2>&1 || true' EXIT
+cp "$HERE/Dockerfile" "$HERE/wsl.conf" "$CTX/"; cp "$ROOT/box/bin/linux-$ARCH/boxrun" "$ROOT/box/bin/linux-$ARCH/boxd" "$CTX/"
+TAG="omnirush-wsl-build:$VERSION-$ARCH"
+docker build -q --platform "linux/$ARCH" --build-arg "VERSION=$VERSION" -t "$TAG" "$CTX" >/dev/null
+docker create --name "omnirush-wsl-build-$$" --platform "linux/$ARCH" "$TAG" /bin/true >/dev/null
+FILE="$OUT/omnirush-wsl-$VERSION-$ARCH.tar.gz"
+# A WSL root filesystem: the container's files without Docker's own marker; gzip without a timestamp.
+docker export "omnirush-wsl-build-$$" | python3 -c '
+import sys, tarfile
+src = tarfile.open(fileobj=sys.stdin.buffer, mode="r|")
+dst = tarfile.open(fileobj=sys.stdout.buffer, mode="w|", format=tarfile.PAX_FORMAT)
+for m in src:
+ if m.name in (".dockerenv", "./.dockerenv"):
+ continue
+ dst.addfile(m, src.extractfile(m) if m.isfile() else None)
+dst.close()' | gzip -n -9 > "$FILE"
+docker rm -f "omnirush-wsl-build-$$" >/dev/null; docker rmi "$TAG" >/dev/null
+SHA=$(sha256sum "$FILE" | cut -d' ' -f1); BYTES=$(stat -c %s "$FILE")
+echo "{\"$ARCH\": {\"url\": \"<release asset url>\", \"sha256\": \"$SHA\", \"bytes\": $BYTES}}"
+echo "$FILE" >&2
diff --git a/apps/desktop/box/wsl/wsl.conf b/apps/desktop/box/wsl/wsl.conf
new file mode 100644
index 00000000..2a5972fe
--- /dev/null
+++ b/apps/desktop/box/wsl/wsl.conf
@@ -0,0 +1,24 @@
+# OmniRushBox: OmniRush's own WSL 2 distro (src/box/backends/wsl.js). It only hosts the
+# per-project boxes; Windows stays out of it.
+[boot]
+systemd=false
+
+[automount]
+enabled=true
+root=/mnt/
+# Linux permissions on Windows folders (the project is bound into each box from /mnt/<drive>).
+options="metadata"
+mountFsTab=false
+
+[interop]
+# No Windows programs inside, and no Windows PATH: a bare `npm` must never be the Windows npm
+# (the 2.2.x WSL failure, seen again in the 2026-10-11 bake-off).
+enabled=false
+appendWindowsPath=false
+
+[network]
+generateResolvConf=true
+hostname=omnirush-box
+
+[user]
+default=root
diff --git a/apps/server/src/box/PARITY.sha256 b/apps/server/src/box/PARITY.sha256
new file mode 100644
index 00000000..610ae6f7
--- /dev/null
+++ b/apps/server/src/box/PARITY.sha256
@@ -0,0 +1,4 @@
+# The sandbox image pins: the same files in omnirush-cli (src/box/) and omnirush-gui (apps/server/src/box/).
+# A change to one must be ported to the other and this list updated in both (scripts/box/pins.mjs refreshes the pins' list).
+bfeb941029a3f956690d777dd9bdee8634ed58efb574adc2ac213dbe47e7a81e images.json
+f8876b786122b231fd4e97994a0142f26bd07e21944d6ecfeb4c9a89548e18c4 wsl.json
diff --git a/apps/server/src/box/box-parity.test.ts b/apps/server/src/box/box-parity.test.ts
new file mode 100644
index 00000000..19b9c28d
--- /dev/null
+++ b/apps/server/src/box/box-parity.test.ts
@@ -0,0 +1,25 @@
+// The sandbox image files that are the same in omnirush-cli and omnirush-gui: the pins
+// (images.json, wsl.json), their sources (apps/desktop/box) and the scripts (scripts/box).
+// Each list is the same in both repositories; this checks that every listed file still
+// has its listed hash, so a change in one repository shows up until it is ported.
+import { describe, expect, test } from "bun:test";
+import { createHash } from "node:crypto";
+import { readFileSync } from "node:fs";
+import path from "node:path";
+
+const repo = path.resolve(import.meta.dir, "..", "..", "..", "..");
+const lists = ["apps/server/src/box", "apps/desktop/box", "scripts/box"];
+
+describe("CLI/desktop parity: sandbox images", () => {
+ for (const dir of lists) {
+ test(`${dir}/PARITY.sha256 matches its files`, () => {
+ const rows = readFileSync(path.join(repo, dir, "PARITY.sha256"), "utf8").split("\n").filter((line) => line && !line.startsWith("#"));
+ expect(rows.length).toBeGreaterThan(0);
+ for (const row of rows) {
+ const [hash, name] = row.split(/\s+/);
+ const actual = createHash("sha256").update(readFileSync(path.join(repo, dir, name ?? ""))).digest("hex");
+ expect(`${name} ${actual}`).toBe(`${name} ${hash}`);
+ }
+ });
+ }
+});
diff --git a/scripts/box/PARITY.sha256 b/scripts/box/PARITY.sha256
new file mode 100644
index 00000000..21ea0c14
--- /dev/null
+++ b/scripts/box/PARITY.sha256
@@ -0,0 +1,4 @@
+# The sandbox image scripts: the same files in omnirush-cli and omnirush-gui (scripts/box/).
+# A change to one must be ported to the other and this list updated in both (scripts/box/pins.mjs refreshes the pins' list).
+f882b7074027fc2c942fda7d3032c0c33a010f95cfa6851023f378df3290f5b6 check-pins.mjs
+80200f750b2c0fc89554497986943c38ef2e0f67cdba8a282741929befeb272c pins.mjs
diff --git a/scripts/box/check-pins.mjs b/scripts/box/check-pins.mjs
new file mode 100644
index 00000000..32357ace
--- /dev/null
+++ b/scripts/box/check-pins.mjs
@@ -0,0 +1,118 @@
+#!/usr/bin/env node
+// Release guard for the sandbox images (the same file in omnirush-cli and omnirush-gui,
+// scripts/box/check-pins.mjs). Fails (exit 1) when a release would ship without working,
+// pinned images:
+// - an image in images.json has no sha256 digest;
+// - a pinned digest is not an image index anonymously pullable for linux/amd64 and linux/arm64;
+// - wsl.json lacks a url or sha256 for amd64 or arm64, or the url does not return that sha256.
+// No login is used, as a user's machine has none.
+//
+// node scripts/box/check-pins.mjs [images.json] [wsl.json]
+// Defaults: src/box/ (CLI) or apps/server/src/box/ (desktop), whichever exists.
+import { createHash } from "node:crypto";
+import { existsSync, readFileSync } from "node:fs";
+import path from "node:path";
+import { pathToFileURL } from "node:url";
+
+const ARCHES = ["amd64", "arm64"];
+const ACCEPT = [
+ "application/vnd.oci.image.index.v1+json",
+ "application/vnd.docker.distribution.manifest.list.v2+json",
+ "application/vnd.oci.image.manifest.v1+json",
+ "application/vnd.docker.distribution.manifest.v2+json",
+].join(",");
+
+export function defaultDir(root = process.cwd()) {
+ const desktop = path.join(root, "apps", "server", "src", "box");
+ return existsSync(path.join(desktop, "images.json")) ? desktop : path.join(root, "src", "box");
+}
+
+/** Problems with the files alone (no network): missing digests, urls, sha256s. */
+export function staticProblems(images, wsl) {
+ const out = [];
+ const entries = Object.entries(images?.images ?? {});
+ if (!entries.length) out.push("images.json: no images");
+ for (const [name, pin] of entries) {
+ if (!/^[^\s@]+:[^\s@/]+$/.test(String(pin?.ref ?? ""))) out.push(`images.json: ${name}: bad ref ${JSON.stringify(pin?.ref)}`);
+ if (!/^sha256:[0-9a-f]{64}$/.test(String(pin?.digest ?? ""))) out.push(`images.json: ${name}: no digest (publish the images and pin them: scripts/box/pins.mjs)`);
+ }
+ for (const arch of ARCHES) {
+ const asset = wsl?.assets?.[arch];
+ if (!/^https:\/\//.test(String(asset?.url ?? ""))) out.push(`wsl.json: ${arch}: no https url`);
+ if (!/^[0-9a-f]{64}$/.test(String(asset?.sha256 ?? ""))) out.push(`wsl.json: ${arch}: no sha256`);
+ }
+ return out;
+}
+
+function repoOf(ref) {
+ const name = ref.replace(/:[^/:]+$/, "");
+ const slash = name.indexOf("/");
+ return { host: name.slice(0, slash), repo: name.slice(slash + 1) };
+}
+
+async function anonymousToken(host, repo, fetchImpl) {
+ if (host !== "ghcr.io") throw new Error(`only ghcr.io is checked (got ${host})`);
+ const res = await fetchImpl(`https://ghcr.io/token?scope=repository:${repo}:pull`);
+ const body = await res.json().catch(() => ({}));
+ if (!res.ok || !body.token) throw new Error(`no anonymous pull token for ${repo} (HTTP ${res.status}): is the package public?`);
+ return body.token;
+}
+
+/** The pinned index of one image, checked anonymously: both platforms present and fetchable. */
+export async function checkImage(name, pin, { fetchImpl = fetch } = {}) {
+ const { host, repo } = repoOf(pin.ref);
+ const token = await anonymousToken(host, repo, fetchImpl);
+ const get = (ref) => fetchImpl(`https://${host}/v2/${repo}/manifests/${ref}`, { headers: { Authorization: `Bearer ${token}`, Accept: ACCEPT } });
+ const res = await get(pin.digest);
+ if (!res.ok) throw new Error(`${name}: ${repo}@${pin.digest}: HTTP ${res.status}`);
+ const index = await res.json();
+ const platforms = new Map((index.manifests ?? []).filter((m) => m.platform?.os === "linux").map((m) => [m.platform.architecture, m.digest]));
+ const missing = ARCHES.filter((arch) => !platforms.has(arch));
+ if (missing.length) throw new Error(`${name}: ${repo}@${pin.digest} is not an index for linux/${missing.join(", linux/")}`);
+ for (const arch of ARCHES) {
+ const one = await get(platforms.get(arch));
+ if (!one.ok) throw new Error(`${name}: linux/${arch} manifest: HTTP ${one.status}`);
+ await one.arrayBuffer();
+ }
+ return `${name}: ${repo}@${pin.digest.slice(0, 19)}… linux/amd64 + linux/arm64`;
+}
+
+/** One WSL asset: the url answers with exactly the pinned bytes. */
+export async function checkAsset(arch, asset, { fetchImpl = fetch } = {}) {
+ const res = await fetchImpl(asset.url, { redirect: "follow" });
+ if (!res.ok || !res.body) throw new Error(`wsl ${arch}: ${asset.url}: HTTP ${res.status}`);
+ const hash = createHash("sha256");
+ let bytes = 0;
+ for await (const chunk of res.body) { hash.update(chunk); bytes += chunk.length; }
+ const got = hash.digest("hex");
+ if (got !== asset.sha256) throw new Error(`wsl ${arch}: ${asset.url}: sha256 ${got} is not the pinned ${asset.sha256}`);
+ if (Number.isInteger(asset.bytes) && asset.bytes !== bytes) throw new Error(`wsl ${arch}: ${bytes} bytes, pinned ${asset.bytes}`);
+ return `wsl ${arch}: ${asset.url} sha256 ok (${bytes} bytes)`;
+}
+
+export async function check(imagesFile, wslFile, { fetchImpl = fetch, log = console.log } = {}) {
+ const images = JSON.parse(readFileSync(imagesFile, "utf8"));
+ const wsl = JSON.parse(readFileSync(wslFile, "utf8"));
+ const problems = staticProblems(images, wsl);
+ if (!problems.length) {
+ for (const [name, pin] of Object.entries(images.images)) {
+ try { log(await checkImage(name, pin, { fetchImpl })); } catch (error) { problems.push(String(error?.message ?? error)); }
+ }
+ for (const arch of ARCHES) {
+ try { log(await checkAsset(arch, wsl.assets[arch], { fetchImpl })); } catch (error) { problems.push(String(error?.message ?? error)); }
+ }
+ }
+ return problems;
+}
+
+if (import.meta.url === pathToFileURL(path.resolve(process.argv[1] || "")).href) {
+ const dir = defaultDir();
+ const imagesFile = process.argv[2] || path.join(dir, "images.json");
+ const wslFile = process.argv[3] || path.join(dir, "wsl.json");
+ const problems = await check(imagesFile, wslFile);
+ if (problems.length) {
+ for (const problem of problems) console.error(`::error::sandbox images: ${problem}`);
+ process.exit(1);
+ }
+ console.log("sandbox images: pinned and anonymously pullable; WSL image matches its sha256");
+}
diff --git a/scripts/box/pins.mjs b/scripts/box/pins.mjs
new file mode 100644
index 00000000..435afe52
--- /dev/null
+++ b/scripts/box/pins.mjs
@@ -0,0 +1,73 @@
+#!/usr/bin/env node
+// Writes the sandbox image pins (images.json, wsl.json) from a published box release
+// (the same file in omnirush-cli and omnirush-gui, scripts/box/pins.mjs). The pins come
+// from the `box-<version>` release of the public omnirush-gui repository (asset
+// box-pins.json, written by its box-images workflow), so both repositories get
+// byte-identical files without any token.
+//
+// node scripts/box/pins.mjs <box version> e.g. 2026.10.1
+// node scripts/box/pins.mjs --file box-pins.json a local copy
+// Then run scripts/box/check-pins.mjs and commit the two files.
+import { createHash } from "node:crypto";
+import { existsSync, readFileSync, writeFileSync } from "node:fs";
+import path from "node:path";
+import { pathToFileURL } from "node:url";
+
+export const RELEASES = "https://github.com/omnirush-ai/omnirush-gui/releases/download";
+
+const line = (value) => `{ ${Object.entries(value).map(([k, v]) => `${JSON.stringify(k)}: ${JSON.stringify(v)}`).join(", ")} }`;
+
+/** A pins file in the house style: top-level keys one per line, each image or asset on one line. */
+export function render(doc, nested) {
+ const keys = Object.keys(doc);
+ const rows = keys.map((key, i) => {
+ const comma = i < keys.length - 1 ? "," : "";
+ if (key !== nested) return ` ${JSON.stringify(key)}: ${JSON.stringify(doc[key])}${comma}`;
+ const inner = Object.entries(doc[key]);
+ const body = inner.map(([name, value], j) => ` ${JSON.stringify(name)}: ${line(value)}${j < inner.length - 1 ? "," : ""}`).join("\n");
+ return ` ${JSON.stringify(key)}: {\n${body}\n }${comma}`;
+ });
+ return `{\n${rows.join("\n")}\n}\n`;
+}
+
+export function renderImages(images) { return render(images, "images"); }
+export function renderWsl(wsl) { return render(wsl, "assets"); }
+
+export function targetDir(root = process.cwd()) {
+ const desktop = path.join(root, "apps", "server", "src", "box");
+ return existsSync(path.join(desktop, "images.json")) ? desktop : path.join(root, "src", "box");
+}
+
+/** PARITY.sha256 beside the pins (the CLI/desktop parity list), its hashes taken again. */
+export function refreshParity(dir) {
+ const file = path.join(dir, "PARITY.sha256");
+ if (!existsSync(file)) return false;
+ const lines = readFileSync(file, "utf8").split("\n").map((row) => {
+ const m = /^([0-9a-f]{64}) (\S+)$/.exec(row);
+ return m ? `${createHash("sha256").update(readFileSync(path.join(dir, m[2]))).digest("hex")} ${m[2]}` : row;
+ });
+ writeFileSync(file, lines.join("\n"));
+ return true;
+}
+
+export async function loadPins(arg, { fetchImpl = fetch } = {}) {
+ if (arg === "--file") throw new Error("--file needs a path");
+ if (arg && existsSync(arg)) return JSON.parse(readFileSync(arg, "utf8"));
+ if (!/^\d{4}\.\d{1,2}\.\d+$/.test(String(arg ?? ""))) throw new Error("usage: pins.mjs <box version, e.g. 2026.10.1> | --file box-pins.json");
+ const url = `${RELEASES}/box-${arg}/box-pins.json`;
+ const res = await fetchImpl(url, { redirect: "follow" });
+ if (!res.ok) throw new Error(`${url}: HTTP ${res.status}`);
+ return res.json();
+}
+
+if (import.meta.url === pathToFileURL(path.resolve(process.argv[1] || "")).href) {
+ const args = process.argv.slice(2);
+ const source = args[0] === "--file" ? args[1] : args[0];
+ const pins = await loadPins(args[0] === "--file" && !args[1] ? "--file" : source);
+ if (!pins?.images?.images || !pins?.wsl?.assets) throw new Error("box-pins.json: no images or wsl block");
+ const dir = targetDir();
+ writeFileSync(path.join(dir, "images.json"), renderImages(pins.images));
+ writeFileSync(path.join(dir, "wsl.json"), renderWsl(pins.wsl));
+ refreshParity(dir);
+ console.log(`wrote ${path.relative(process.cwd(), path.join(dir, "images.json"))} and wsl.json for box ${pins.images.version}`);
+}