Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(ci): install native fixtures from authoritative registry pins

Steven Enamakeld409d83bfd18
diff --git a/.github/workflows/ci-full.yml b/.github/workflows/ci-full.yml
index 5335226503..e5cab2dbb1 100644
--- a/.github/workflows/ci-full.yml
+++ b/.github/workflows/ci-full.yml
@@ -126,42 +126,12 @@ jobs:
- name: Install checksum-pinned native test modules
run: |
- # tinybus validates every directory ancestor. GitHub mounts the
- # checkout as the host runner uid while this container runs as root,
- # so keep native fixtures in a root-owned, ephemeral tree.
- # The downloaded tinyjuice archive's version and sha256 are ONE decision:
- # the archive name, the release tag and the checksum below all carry the
- # version, so a bump must update every one of them or a stale digest only
- # fails after the download. They are the ubuntu-22.04-x86_64 row of
- # `crates/openhuman-core/src/modules/registry.rs`, which is the
- # authoritative pin — copy them from there, never recompute.
+ # Keep fixtures in a trusted tree and resolve their verified releases
+ # from the same registry the product uses.
module_root="/opt/openhuman-test-modules/${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
- juice_dir="$module_root/tinyjuice"
- connectors_dir="$module_root/tinyconnectors"
- search_dir="$module_root/tinysearch"
- juice_archive="$juice_dir/tinyjuice-module-0.5.2-ubuntu-22.04-x86_64.tar.gz"
- rm -rf "$juice_dir" "$connectors_dir"
- mkdir -p "$juice_dir" "$connectors_dir" "$search_dir"
- curl --fail --location --silent --show-error --retry 4 --retry-delay 2 \
- "https://github.com/tinyhumansai/tinyjuice/releases/download/v0.5.2/$(basename "$juice_archive")" \
- --output "$juice_archive"
- echo "1a9bc9479ce51c87d82a6f145408cfcbe7d06de4613b0ca7cec1fd04bbc2b5b5 $juice_archive" \
- | sha256sum --check
- tar --no-same-owner -xzf "$juice_archive" -C "$juice_dir"
- bash scripts/ci-cancel-aware.sh cargo build --release \
- --manifest-path vendor/tinyconnectors/crates/tinyconnectors/Cargo.toml
- cp vendor/tinyconnectors/target/release/libtinyconnectors.so \
- "$connectors_dir/libtinyconnectors.so"
- bash scripts/ci-cancel-aware.sh cargo build --release \
- --manifest-path vendor/tinysearch/crates/tinysearch/Cargo.toml
- cp vendor/tinysearch/target/release/libtinysearch.so \
- "$search_dir/libtinysearch.so"
- echo "TINYJUICE_TEST_MODULE=$juice_dir/libtinyjuice_module.so" \
- >> "$GITHUB_ENV"
- echo "TINYCONNECTORS_TEST_MODULE=$connectors_dir/libtinyconnectors.so" \
- >> "$GITHUB_ENV"
- echo "TINYSEARCH_TEST_MODULE=$search_dir/libtinysearch.so" \
- >> "$GITHUB_ENV"
+ bash scripts/ci/self-hosted/install-test-modules.sh \
+ "$module_root" "$module_root/modules.env"
+ cat "$module_root/modules.env" >> "$GITHUB_ENV"
- name: Run Rust E2E suite
# Wrapped so the cancellation watchdog covers the whole suite (mock
@@ -326,33 +296,13 @@ jobs:
- name: Install native test modules
run: |
- # tinybus validates every directory ancestor. GitHub mounts the
- # checkout as the host runner uid while this container runs as root,
- # so keep native fixtures in a root-owned, ephemeral tree.
+ # Keep fixtures in a trusted tree and resolve their verified releases
+ # from the same registry the product uses.
module_root="/opt/openhuman-test-modules/${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
- juice_dir="$module_root/tinyjuice"
- connectors_dir="$module_root/tinyconnectors"
- search_dir="$module_root/tinysearch"
- juice_archive="$juice_dir/tinyjuice-module-0.5.2-ubuntu-22.04-x86_64.tar.gz"
- rm -rf "$juice_dir" "$connectors_dir"
- mkdir -p "$juice_dir" "$connectors_dir" "$search_dir"
- curl --fail --location --silent --show-error --retry 4 --retry-delay 2 \
- "https://github.com/tinyhumansai/tinyjuice/releases/download/v0.5.2/$(basename "$juice_archive")" \
- --output "$juice_archive"
- echo "1a9bc9479ce51c87d82a6f145408cfcbe7d06de4613b0ca7cec1fd04bbc2b5b5 $juice_archive" \
- | sha256sum --check
- tar --no-same-owner -xzf "$juice_archive" -C "$juice_dir"
- bash scripts/ci-cancel-aware.sh cargo build --release \
- --manifest-path vendor/tinyconnectors/crates/tinyconnectors/Cargo.toml
- cp vendor/tinyconnectors/target/release/libtinyconnectors.so \
- "$connectors_dir/libtinyconnectors.so"
- bash scripts/ci-cancel-aware.sh cargo build --release \
- --manifest-path vendor/tinysearch/crates/tinysearch/Cargo.toml
- cp vendor/tinysearch/target/release/libtinysearch.so \
- "$search_dir/libtinysearch.so"
- echo "TINYJUICE_TEST_MODULE=$juice_dir/libtinyjuice_module.so" >> "$GITHUB_ENV"
- echo "TINYCONNECTORS_TEST_MODULE=$connectors_dir/libtinyconnectors.so" >> "$GITHUB_ENV"
- echo "TINYSEARCH_TEST_MODULE=$search_dir/libtinysearch.so" >> "$GITHUB_ENV"
+ bash scripts/ci/self-hosted/install-test-modules.sh \
+ "$module_root" "$module_root/modules.env"
+ cat "$module_root/modules.env" >> "$GITHUB_ENV"
+
- name: Install Playwright Chromium dependencies
run: bash scripts/ci-cancel-aware.sh pnpm --filter openhuman-app exec playwright install-deps chromium
diff --git a/.github/workflows/e2e-playwright.yml b/.github/workflows/e2e-playwright.yml
index 58436e0539..b88e4a1ff6 100644
--- a/.github/workflows/e2e-playwright.yml
+++ b/.github/workflows/e2e-playwright.yml
@@ -65,27 +65,12 @@ jobs:
- name: Install native test modules
run: |
- # tinybus validates every directory ancestor. GitHub mounts the
- # checkout as the host runner uid while this container runs as root,
- # so keep native fixtures in a root-owned, ephemeral tree.
+ # Keep fixtures in a trusted tree and resolve their verified releases
+ # from the same registry the product uses.
module_root="/opt/openhuman-test-modules/${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
- juice_dir="$module_root/tinyjuice"
- connectors_dir="$module_root/tinyconnectors"
- juice_archive="$juice_dir/tinyjuice-module-0.5.2-ubuntu-22.04-x86_64.tar.gz"
- rm -rf "$juice_dir" "$connectors_dir"
- mkdir -p "$juice_dir" "$connectors_dir"
- curl --fail --location --silent --show-error --retry 4 --retry-delay 2 \
- "https://github.com/tinyhumansai/tinyjuice/releases/download/v0.5.2/$(basename "$juice_archive")" \
- --output "$juice_archive"
- echo "1a9bc9479ce51c87d82a6f145408cfcbe7d06de4613b0ca7cec1fd04bbc2b5b5 $juice_archive" \
- | sha256sum --check
- tar --no-same-owner -xzf "$juice_archive" -C "$juice_dir"
- bash scripts/ci-cancel-aware.sh cargo build --release \
- --manifest-path vendor/tinyconnectors/crates/tinyconnectors/Cargo.toml
- cp vendor/tinyconnectors/target/release/libtinyconnectors.so \
- "$connectors_dir/libtinyconnectors.so"
- echo "TINYJUICE_TEST_MODULE=$juice_dir/libtinyjuice_module.so" >> "$GITHUB_ENV"
- echo "TINYCONNECTORS_TEST_MODULE=$connectors_dir/libtinyconnectors.so" >> "$GITHUB_ENV"
+ bash scripts/ci/self-hosted/install-test-modules.sh \
+ "$module_root" "$module_root/modules.env"
+ cat "$module_root/modules.env" >> "$GITHUB_ENV"
- name: Build Playwright web E2E bundle + standalone core
run: bash scripts/ci-cancel-aware.sh pnpm --filter openhuman-app test:e2e:web:build
diff --git a/.github/workflows/e2e-reusable.yml b/.github/workflows/e2e-reusable.yml
index 22470cc4a5..bb96d12917 100644
--- a/.github/workflows/e2e-reusable.yml
+++ b/.github/workflows/e2e-reusable.yml
@@ -438,32 +438,12 @@ jobs:
- name: Install checksum-pinned native test modules
run: |
- # Keep module-backed RPC coverage independent of release-metadata
- # lookup. tinybus validates every directory ancestor, so keep each
- # fixture outside the checkout owned by the host runner.
- # Version and digest are the ubuntu-22.04-x86_64 registry pin; do
- # not derive a replacement checksum from a local build.
- juice_version="0.5.2"
- juice_sha256="1a9bc9479ce51c87d82a6f145408cfcbe7d06de4613b0ca7cec1fd04bbc2b5b5"
+ # Keep fixtures in a trusted tree and resolve their verified releases
+ # from the same registry the product uses.
module_root="/opt/openhuman-test-modules/${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
- juice_dir="$module_root/tinyjuice"
- connectors_dir="$module_root/tinyconnectors"
- juice_archive="$juice_dir/tinyjuice-module-${juice_version}-ubuntu-22.04-x86_64.tar.gz"
- rm -rf "$juice_dir" "$connectors_dir"
- mkdir -p "$juice_dir" "$connectors_dir"
- curl --fail --location --silent --show-error --retry 4 --retry-delay 2 \
- "https://github.com/tinyhumansai/tinyjuice/releases/download/v${juice_version}/$(basename "$juice_archive")" \
- --output "$juice_archive"
- echo "${juice_sha256} $juice_archive" | sha256sum --check
- tar --no-same-owner -xzf "$juice_archive" -C "$juice_dir"
- bash scripts/ci-cancel-aware.sh cargo build --release \
- --manifest-path vendor/tinyconnectors/crates/tinyconnectors/Cargo.toml
- cp vendor/tinyconnectors/target/release/libtinyconnectors.so \
- "$connectors_dir/libtinyconnectors.so"
- echo "TINYJUICE_TEST_MODULE=$juice_dir/libtinyjuice_module.so" \
- >> "$GITHUB_ENV"
- echo "TINYCONNECTORS_TEST_MODULE=$connectors_dir/libtinyconnectors.so" \
- >> "$GITHUB_ENV"
+ bash scripts/ci/self-hosted/install-test-modules.sh \
+ "$module_root" "$module_root/modules.env"
+ cat "$module_root/modules.env" >> "$GITHUB_ENV"
- name: Run Rust E2E suite (tests/*_e2e.rs vs mock backend)
run: bash scripts/ci-cancel-aware.sh pnpm test:rust:e2e
diff --git a/scripts/__tests__/test-module-installation.test.mjs b/scripts/__tests__/test-module-installation.test.mjs
new file mode 100644
index 0000000000..c5b2c8c420
--- /dev/null
+++ b/scripts/__tests__/test-module-installation.test.mjs
@@ -0,0 +1,34 @@
+import assert from "node:assert/strict";
+import { spawnSync } from "node:child_process";
+import { mkdtempSync, mkdirSync, writeFileSync, existsSync, rmSync } from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import test from "node:test";
+import { fileURLToPath } from "node:url";
+
+const installer = fileURLToPath(new URL("../ci/self-hosted/install-test-modules.sh", import.meta.url));
+
+for (const [description, resolverExit] of [["failed", 7], ["empty", 0]]) {
+ test(`${description} module asset resolution refuses to publish fixture paths`, () => {
+ const root = mkdtempSync(join(tmpdir(), "module-install-"));
+ try {
+ const bin = join(root, "bin");
+ mkdirSync(bin);
+ writeFileSync(join(bin, "node"), `#!/bin/sh\nexit ${resolverExit}\n`, { mode: 0o755 });
+ // No builds or downloads are needed to verify failure admission.
+ for (const command of ["git", "cargo", "rustc", "curl"]) {
+ writeFileSync(join(bin, command), `#!/bin/sh\ntouch '${root}/attempted'\nexit 0\n`, { mode: 0o755 });
+ }
+ const envFile = join(root, "modules.env");
+ const result = spawnSync("bash", [installer, join(root, "modules"), envFile], {
+ encoding: "utf8",
+ env: { ...process.env, PATH: `${bin}:${process.env.PATH}`, CI_CACHE_DIR: "" },
+ });
+ assert.notEqual(result.status, 0, result.stdout + result.stderr);
+ assert.equal(existsSync(join(root, "attempted")), false, "resolve pins before building or downloading");
+ assert.equal(existsSync(envFile), false, "unresolved modules must not be exported");
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+ });
+}
diff --git a/scripts/ci/self-hosted/install-test-modules.sh b/scripts/ci/self-hosted/install-test-modules.sh
index cd5ad26544..96c5a5af69 100755
--- a/scripts/ci/self-hosted/install-test-modules.sh
+++ b/scripts/ci/self-hosted/install-test-modules.sh
@@ -28,6 +28,14 @@ mkdir -p "${blobs}" "${dest}"
verify() { echo "$1 $2" | sha256sum --check --status; }
+# Resolve before starting work: process substitution hides the resolver's exit
+# status, which used to continue with missing fixtures after a registry error.
+assets="$(node scripts/ci/self-hosted/test-module-assets.mjs "${host_key}")"
+if [ -z "${assets}" ]; then
+ echo "::error::registry resolved no native test module assets" >&2
+ exit 1
+fi
+
while IFS=$'\t' read -r id url archive sha; do
cached="${blobs}/${sha}-${archive}"
if [ -f "${cached}" ] && verify "${sha}" "${cached}"; then
@@ -48,7 +56,7 @@ while IFS=$'\t' read -r id url archive sha; do
mkdir -p "${dest}/${id}"
# Do not restore the release builder's uid into the trusted tree.
tar --no-same-owner -xzf "${cached}" -C "${dest}/${id}"
-done < <(node scripts/ci/self-hosted/test-module-assets.mjs "${host_key}")
+done <<< "${assets}"
# The checkout action initializes root submodules, but the module build also
# needs tinyconnectors' nested tinybus dependency.