Skip to content

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

fix(ci): stage pinned wallet and channel modules for full suites

Steven Enamakeld49000ca728d
diff --git a/.github/workflows/e2e-reusable.yml b/.github/workflows/e2e-reusable.yml
index b12572c99f..cf7cd6583f 100644
--- a/.github/workflows/e2e-reusable.yml
+++ b/.github/workflows/e2e-reusable.yml
@@ -346,20 +346,12 @@ jobs:
- name: Install native E2E test modules
run: |
- # Every shard calls Composio RPCs. Supply the connectors module
- # (built from the checked-out submodule) so the packaged app never
- # depends on release metadata or a runner-owned cache while tests
- # are running.
+ # Stage all native capabilities under a trusted tree, including
+ # release manifests for confidential wallet and channel calls.
module_root="/opt/openhuman-test-modules/${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
- connectors_dir="$module_root/tinyconnectors"
- rm -rf "$connectors_dir"
- mkdir -p "$connectors_dir"
- bash scripts/ci-cancel-aware.sh cargo build --release \
- --manifest-path vendor/tinyconnectors/crates/tinyconnectors/Cargo.toml
- node scripts/ci/stage-connector-test-module.mjs \
- vendor/tinyconnectors/target/release/libtinyconnectors.so "$connectors_dir"
- 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 E2E shard (${{ matrix.shard.name }} — suites=${{ matrix.shard.suites }})
env:
diff --git a/scripts/__tests__/connector-fixture-attestation.test.mjs b/scripts/__tests__/connector-fixture-attestation.test.mjs
index c2f3a69574..33c764f585 100644
--- a/scripts/__tests__/connector-fixture-attestation.test.mjs
+++ b/scripts/__tests__/connector-fixture-attestation.test.mjs
@@ -55,18 +55,82 @@ test("native E2E installation attests the connector module before launching the
const command = block[1]
.replace(/^ /gm, "")
.replace("/opt/openhuman-test-modules", join(root, "modules"));
- const source = join(root, "vendor/tinyconnectors/target/release");
- mkdirSync(source, { recursive: true });
const bytes = "pinned native connector module";
- writeFileSync(join(source, "libtinyconnectors.so"), bytes);
- mkdirSync(join(root, "scripts/ci"), { recursive: true });
+ const bin = join(root, "bin");
+ const cache = join(root, "cache");
+ mkdirSync(bin);
+ mkdirSync(join(cache, "blobs"), { recursive: true });
+ const rustcVersion = "fixture rustc\n";
+ const rustcDigest = createHash("sha256")
+ .update(rustcVersion)
+ .digest("hex")
+ .slice(0, 12);
+ writeFileSync(
+ join(cache, "blobs", `tinyconnectors-fixture-${rustcDigest}.so`),
+ bytes,
+ );
+ const assets = [];
+ for (const id of [
+ "tinyjuice",
+ "tinysearch",
+ "tinydocs",
+ "tinywallet",
+ "tinychannels",
+ ]) {
+ const archive = `${id}.tar.gz`;
+ const contents = join(root, `archive-${id}`);
+ mkdirSync(contents);
+ writeFileSync(join(contents, "module-fixture.so"), `released ${id}`);
+ const packed = spawnSync("tar", [
+ "-czf",
+ join(root, archive),
+ "-C",
+ contents,
+ ".",
+ ]);
+ assert.equal(packed.status, 0, packed.stderr?.toString());
+ const sha = createHash("sha256")
+ .update(readFileSync(join(root, archive)))
+ .digest("hex");
+ writeFileSync(
+ join(cache, "blobs", `${sha}-${archive}`),
+ readFileSync(join(root, archive)),
+ );
+ assets.push(
+ [id, "https://fixture.invalid/unused", archive, sha].join("\t"),
+ );
+ }
+ writeFileSync(join(root, "assets.tsv"), assets.join("\n") + "\n");
+ writeFileSync(
+ join(bin, "node"),
+ `#!/bin/sh\ncase "$1" in *test-module-assets.mjs) cat assets.tsv;; *) exec '${process.execPath}' "$@";; esac\n`,
+ { mode: 0o755 },
+ );
+ writeFileSync(
+ join(bin, "git"),
+ '#!/bin/sh\ncase "$*" in *rev-parse*) echo fixture;; esac\n',
+ { mode: 0o755 },
+ );
+ writeFileSync(join(bin, "rustc"), `#!/bin/sh\nprintf '${rustcVersion}'\n`, {
+ mode: 0o755,
+ });
+ for (const command of ["curl", "cargo"]) {
+ writeFileSync(
+ join(bin, command),
+ "#!/bin/sh\necho unexpected build or download >&2\nexit 99\n",
+ { mode: 0o755 },
+ );
+ }
+ mkdirSync(join(root, "scripts/ci/self-hosted"), { recursive: true });
writeFileSync(
join(root, "scripts/ci/stage-connector-test-module.mjs"),
readFileSync(stage),
);
writeFileSync(
- join(root, "scripts/ci-cancel-aware.sh"),
- 'test "$1" = cargo && test "$2" = build && test "$3" = --release\n',
+ join(root, "scripts/ci/self-hosted/install-test-modules.sh"),
+ readFileSync(
+ new URL("../ci/self-hosted/install-test-modules.sh", import.meta.url),
+ ),
);
const envFile = join(root, "env");
const result = spawnSync("bash", ["-c", command], {
@@ -77,6 +141,9 @@ test("native E2E installation attests the connector module before launching the
GITHUB_RUN_ID: "fixture",
GITHUB_RUN_ATTEMPT: "1",
GITHUB_ENV: envFile,
+ PATH: `${bin}:${process.env.PATH}`,
+ CI_CACHE_DIR: cache,
+ OPENHUMAN_MODULE_PATH: "",
},
});
assert.equal(result.status, 0, result.stdout + result.stderr);
@@ -91,7 +158,12 @@ test("native E2E installation attests the connector module before launching the
);
assert.equal(
readFileSync(envFile, "utf8").trim(),
- `TINYCONNECTORS_TEST_MODULE=${destination}/libtinyconnectors.so`,
+ [
+ `TINYJUICE_TEST_MODULE=${join(root, "modules/fixture-1/tinyjuice/libtinyjuice_module.so")}`,
+ `TINYSEARCH_TEST_MODULE=${join(root, "modules/fixture-1/tinysearch/libtinysearch.so")}`,
+ `OPENHUMAN_MODULE_PATH=${["tinydocs", "tinywallet", "tinychannels"].map((id) => join(root, "modules/fixture-1", id)).join(":")}`,
+ `TINYCONNECTORS_TEST_MODULE=${destination}/libtinyconnectors.so`,
+ ].join("\n"),
);
} finally {
rmSync(root, { recursive: true, force: true });
diff --git a/scripts/__tests__/test-module-installation.test.mjs b/scripts/__tests__/test-module-installation.test.mjs
index 3062ae0970..6616d19fbb 100644
--- a/scripts/__tests__/test-module-installation.test.mjs
+++ b/scripts/__tests__/test-module-installation.test.mjs
@@ -83,3 +83,19 @@ for (const [description, resolverExit] of [
}
});
}
+
+for (const id of ["tinywallet", "tinychannels"]) {
+ test(`native ${id} regressions receive their pinned release fixture`, () => {
+ const assets = resolveTestModuleAssets(
+ readRegistrySource(),
+ "ubuntu-22.04-x86_64",
+ );
+ const artifact = assets.find((asset) => asset.id === id);
+ assert.ok(
+ artifact,
+ `${id} must not fall back to an untrusted runner cache`,
+ );
+ assert.match(artifact.sha256, /^[a-f0-9]{64}$/);
+ assert.match(artifact.url, /\/releases\/download\/v/);
+ });
+}
diff --git a/scripts/ci/self-hosted/install-test-modules.sh b/scripts/ci/self-hosted/install-test-modules.sh
index 9b0258c541..47f35f9584 100755
--- a/scripts/ci/self-hosted/install-test-modules.sh
+++ b/scripts/ci/self-hosted/install-test-modules.sh
@@ -85,7 +85,7 @@ node scripts/ci/stage-connector-test-module.mjs \
{
echo "TINYJUICE_TEST_MODULE=${dest}/tinyjuice/libtinyjuice_module.so"
echo "TINYSEARCH_TEST_MODULE=${dest}/tinysearch/libtinysearch.so"
- echo "OPENHUMAN_MODULE_PATH=${dest}/tinydocs${OPENHUMAN_MODULE_PATH:+:$OPENHUMAN_MODULE_PATH}"
+ echo "OPENHUMAN_MODULE_PATH=${dest}/tinydocs:${dest}/tinywallet:${dest}/tinychannels${OPENHUMAN_MODULE_PATH:+:$OPENHUMAN_MODULE_PATH}"
echo "TINYCONNECTORS_TEST_MODULE=${dest}/tinyconnectors/libtinyconnectors.so"
} > "${env_file}"
log "wrote ${env_file}"
diff --git a/scripts/ci/self-hosted/test-module-assets.mjs b/scripts/ci/self-hosted/test-module-assets.mjs
index c886839ea7..b6c1804917 100644
--- a/scripts/ci/self-hosted/test-module-assets.mjs
+++ b/scripts/ci/self-hosted/test-module-assets.mjs
@@ -17,7 +17,13 @@ const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "..");
const REGISTRY_DIR = join(ROOT, "crates/openhuman-core/src/modules");
/** Test modules the core suite loads, by registry record id. */
-export const TEST_MODULE_IDS = ["tinyjuice", "tinysearch", "tinydocs"];
+export const TEST_MODULE_IDS = [
+ "tinyjuice",
+ "tinysearch",
+ "tinydocs",
+ "tinywallet",
+ "tinychannels",
+];
/** Concatenate registry.rs and its `registry/records_*.rs` fragments. */
export function readRegistrySource(dir = REGISTRY_DIR) {