From fd6f90e42465dcbe3e00f533ed7b699622dc3e0c Mon Sep 17 00:00:00 2001 From: Prekshi Vyas Date: Mon, 17 Aug 2026 17:17:58 -0700 Subject: [PATCH 01/14] ci(e2e): select OpenShell 0.0.106 Signed-off-by: Prekshi Vyas --- .github/workflows/e2e.yaml | 37 +++--- scripts/checks/dependency-pins.mts | 10 +- test/dependency-pins-check.test.ts | 30 +++++ test/e2e/support/e2e-workflow.test.ts | 16 +++ .../e2e/support/mcp-workflow-boundary.test.ts | 34 ++++++ ...ay-auth-contract-workflow-boundary.test.ts | 52 ++++++++- .../install-openshell-v00106-qualification.sh | 84 ++++++++++++++ tools/e2e/mcp-workflow-boundary.mts | 105 ++++++++++-------- ...ateway-auth-contract-workflow-boundary.mts | 24 ++-- tools/e2e/workflow-boundary.mts | 4 + 10 files changed, 313 insertions(+), 83 deletions(-) create mode 100755 tools/e2e/install-openshell-v00106-qualification.sh diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 3bc0b805054..93420c82c0e 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -1733,7 +1733,8 @@ jobs: E2E_ARTIFACT_DIR: ${{ github.workspace }}/e2e-artifacts/live/openshell-gateway-auth-contract NEMOCLAW_RUN_LIVE_E2E: "1" NEMOCLAW_NON_INTERACTIVE: "1" - NEMOCLAW_OPENSHELL_PIN_VERSION: "0.0.101" + NEMOCLAW_CANDIDATE_VERSION: "0.0.106" + NEMOCLAW_OPENSHELL_PIN_VERSION: "0.0.106" DOCKER_GRPC_PROBE_IMAGE: "node:22-trixie-slim@sha256:db8a96a63e5264607ada2d206758876ebbed6a12be2ada7517793cbfb0c2a29c" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -1755,7 +1756,7 @@ jobs: provenance-json: ${{ needs.generate-matrix.outputs.cli_artifact_provenance }} - name: Install OpenShell CLI - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash tools/e2e/install-openshell-v00106-qualification.sh - name: Pre-pull pinned gateway auth probe image run: docker pull "$DOCKER_GRPC_PROBE_IMAGE" @@ -1818,7 +1819,7 @@ jobs: NEMOCLAW_OPENSHELL_CHANNEL: stable NEMOCLAW_OPENSHELL_EXACT_MAIN_PROOF: "1" NEMOCLAW_RUN_LIVE_E2E: "1" - OPENSHELL_DOCKER_SUPERVISOR_IMAGE: ghcr.io/nvidia/openshell/supervisor@sha256:b58be5e40c788977ffa0e8305a8cad9c656efdf1a3fe182582a00ca870bb0edb + OPENSHELL_DOCKER_SUPERVISOR_IMAGE: ghcr.io/nvidia/openshell/supervisor@sha256:722f44669722961b7f432b0b81de25b91a58f34a61d6403bef967acaf2b3af01 steps: - id: trusted_hermes_swap name: Provision trusted Hermes E2E swap @@ -2061,22 +2062,20 @@ jobs: run: bash test/e2e/setup-mcp-test-tls.sh - name: Install OpenShell CLI - env: - NEMOCLAW_OPENSHELL_FORCE_INSTALL: "1" run: | set -euo pipefail - bash scripts/install-openshell.sh + bash tools/e2e/install-openshell-v00106-qualification.sh if [[ "$NEMOCLAW_MCP_BRIDGE_AGENT" == "deepagents" ]]; then mkdir -p "$E2E_ARTIFACT_DIR/mcp-bridge-deepagents" jq -n '{ schemaVersion: 1, sourceRepository: "NVIDIA/OpenShell", - releaseTag: "v0.0.101", - sourceSha: "8ddd98c3dff62619a3963f99ba1e055b67650e72", + releaseTag: "v0.0.106", + sourceSha: "c4b500a7de64d0b66e3ee8098f58d14299092162", artifacts: { - cli: {binarySha256: "1ad48efd5e1de8f3f017a81b3a7177872f350343a1a8d8074c7e844bca4801e9"}, - gateway: {binarySha256: "a6a5d754605a2144b148637b85a09291d2eeb77e08a4ee34b83685c6920448f5"}, - standaloneSandbox: {binarySha256: "a2704babbb468fd0a359bfdd9844de71095b730758541b4ca8cbab77d4018920"} + cli: {binarySha256: "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59"}, + gateway: {binarySha256: "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c"}, + standaloneSandbox: {binarySha256: "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8"} } }' > "$E2E_ARTIFACT_DIR/mcp-bridge-deepagents/openshell-exact-main-provenance.json" fi @@ -2140,7 +2139,7 @@ jobs: NEMOCLAW_OPENSHELL_CHANNEL: stable NEMOCLAW_OPENSHELL_EXACT_MAIN_PROOF: "1" NEMOCLAW_RUN_LIVE_E2E: "1" - OPENSHELL_DOCKER_SUPERVISOR_IMAGE: ghcr.io/nvidia/openshell/supervisor@sha256:b58be5e40c788977ffa0e8305a8cad9c656efdf1a3fe182582a00ca870bb0edb + OPENSHELL_DOCKER_SUPERVISOR_IMAGE: ghcr.io/nvidia/openshell/supervisor@sha256:722f44669722961b7f432b0b81de25b91a58f34a61d6403bef967acaf2b3af01 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -2183,21 +2182,19 @@ jobs: run: bash test/e2e/setup-mcp-test-tls.sh - name: Install OpenShell CLI - env: - NEMOCLAW_OPENSHELL_FORCE_INSTALL: "1" run: | set -euo pipefail - bash scripts/install-openshell.sh + bash tools/e2e/install-openshell-v00106-qualification.sh mkdir -p "$E2E_ARTIFACT_DIR/openshell-credential-generation-window" jq -n '{ schemaVersion: 1, sourceRepository: "NVIDIA/OpenShell", - releaseTag: "v0.0.101", - sourceSha: "8ddd98c3dff62619a3963f99ba1e055b67650e72", + releaseTag: "v0.0.106", + sourceSha: "c4b500a7de64d0b66e3ee8098f58d14299092162", artifacts: { - cli: {binarySha256: "1ad48efd5e1de8f3f017a81b3a7177872f350343a1a8d8074c7e844bca4801e9"}, - gateway: {binarySha256: "a6a5d754605a2144b148637b85a09291d2eeb77e08a4ee34b83685c6920448f5"}, - standaloneSandbox: {binarySha256: "a2704babbb468fd0a359bfdd9844de71095b730758541b4ca8cbab77d4018920"} + cli: {binarySha256: "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59"}, + gateway: {binarySha256: "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c"}, + standaloneSandbox: {binarySha256: "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8"} } }' > "$E2E_ARTIFACT_DIR/openshell-credential-generation-window/openshell-exact-main-provenance.json" diff --git a/scripts/checks/dependency-pins.mts b/scripts/checks/dependency-pins.mts index 450d6ec4f57..aa4bcab15d9 100644 --- a/scripts/checks/dependency-pins.mts +++ b/scripts/checks/dependency-pins.mts @@ -37,6 +37,14 @@ const OPENSHELL_RELEASE_MANIFESTS = [ "openshell-sandbox-checksums-sha256.txt", ] as const; +function expectedOpenShellE2eVersion(pins: OpenShellPins): string { + // Qualify the accepted 0.0.106 migration against the exact trusted release + // before the supported product pin moves from 0.0.101. + return pins.minVersion === "0.0.101" && pins.maxVersion === "0.0.101" + ? "0.0.106" + : pins.maxVersion; +} + function isRecord(value: unknown): value is Record { return typeof value === "object" && value !== null && !Array.isArray(value); } @@ -395,7 +403,7 @@ function verifyOpenShellPins( ".github/workflows/e2e.yaml gateway auth OpenShell version", failures, ), - pins.maxVersion, + expectedOpenShellE2eVersion(pins), ".github/workflows/e2e.yaml gateway auth OpenShell version", failures, ); diff --git a/test/dependency-pins-check.test.ts b/test/dependency-pins-check.test.ts index b6608a83456..ec2ee2e16e6 100644 --- a/test/dependency-pins-check.test.ts +++ b/test/dependency-pins-check.test.ts @@ -206,6 +206,36 @@ describe("dependency pin drift check", () => { ); }); + it("accepts OpenShell 0.0.106 E2E qualification before the 0.0.101 product pin moves", () => { + withFixture( + "nemoclaw-dependency-pins-openshell-qualification-", + { + openshellMax: "0.0.101", + openshellMin: "0.0.101", + workflowPinVersion: "0.0.106", + }, + (root) => expect(verifyDependencyPins(root)).toEqual([]), + ); + }); + + it.each(["0.0.105", "0.0.107"])( + "rejects OpenShell %s as the E2E target while the product pin is 0.0.101", + (workflowPinVersion) => { + withFixture( + "nemoclaw-dependency-pins-openshell-unapproved-qualification-", + { + openshellMax: "0.0.101", + openshellMin: "0.0.101", + workflowPinVersion, + }, + (root) => + expect(verifyDependencyPins(root)).toContain( + `.github/workflows/e2e.yaml gateway auth OpenShell version: expected 0.0.106, found ${workflowPinVersion}`, + ), + ); + }, + ); + it("reports exact operational consumer drift (#5242)", () => { withFixture( "nemoclaw-dependency-pins-drift-", diff --git a/test/e2e/support/e2e-workflow.test.ts b/test/e2e/support/e2e-workflow.test.ts index 1c0718e0736..55de9577f82 100644 --- a/test/e2e/support/e2e-workflow.test.ts +++ b/test/e2e/support/e2e-workflow.test.ts @@ -457,6 +457,22 @@ describe("e2e workflow boundary", () => { ).toEqual(["snapshot-commands"]); }); + it("routes the OpenShell 0.0.106 qualification installer to all five consumers", () => { + const plan = buildE2eWorkflowPlan( + {}, + { changedFiles: ["tools/e2e/install-openshell-v00106-qualification.sh"] }, + ); + + expect([...plan.selectedJobs].sort()).toEqual( + [ + "jetson-nvmap-gpu", + "mcp-bridge", + "openshell-credential-generation-window", + "openshell-gateway-auth-contract", + ].sort(), + ); + }); + it("keeps orchestration jobs within bounded timeouts", () => { const workflow = readWorkflow() as { jobs: Record; diff --git a/test/e2e/support/mcp-workflow-boundary.test.ts b/test/e2e/support/mcp-workflow-boundary.test.ts index 0c39119a744..1c085027ccf 100644 --- a/test/e2e/support/mcp-workflow-boundary.test.ts +++ b/test/e2e/support/mcp-workflow-boundary.test.ts @@ -12,6 +12,40 @@ import { validateMcpOpenShellWorkflowBoundary } from "../../../tools/e2e/mcp-wor import { requireFixture } from "./require-fixture"; describe("MCP workflow artifact boundary", () => { + it.each([ + { + expected: + "mcp-bridge must run only the exact OpenShell 0.0.106 qualification install and provenance step", + jobName: "mcp-bridge", + }, + { + expected: + "openshell-credential-generation-window must run only the exact OpenShell 0.0.106 qualification install and provenance step", + jobName: "openshell-credential-generation-window", + }, + ])("rejects a product reinstall after the exact $jobName qualification install", ({ + expected, + jobName, + }) => { + const directory = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-mcp-workflow-")); + const workflowPath = path.join(directory, "e2e.yaml"); + try { + const workflow = YAML.parse(fs.readFileSync(".github/workflows/e2e.yaml", "utf8")) as { + jobs: Record }>; + }; + const install = workflow.jobs[jobName].steps.find( + (step) => step.name === "Install OpenShell CLI", + ); + requireFixture(install?.run, `${jobName} qualification installer fixture is missing`); + install.run += "bash scripts/install-openshell.sh\n"; + fs.writeFileSync(workflowPath, YAML.stringify(workflow)); + + expect(validateMcpOpenShellWorkflowBoundary(workflowPath)).toContain(expected); + } finally { + fs.rmSync(directory, { force: true, recursive: true }); + } + }); + it.each([ "mcp-bridge", "mcp-bridge-dev", diff --git a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts index 5ecbd9172b0..493eb2965be 100644 --- a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts +++ b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts @@ -1,6 +1,9 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 +import { execFileSync } from "node:child_process"; +import { readFileSync } from "node:fs"; + import { describe, expect, it } from "vitest"; import { @@ -9,7 +12,38 @@ import { validateOpenShellGatewayAuthContractWorkflowBoundary, } from "../../../tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts"; +const QUALIFICATION_INSTALLER_IDENTITIES = [ + "openshell-x86_64-unknown-linux-musl.tar.gz", + "d1a885a91b3e5aaa006c36aca95dc78bed0638c1ba1a79b55f1da93211b8a0a0", + "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59", + "openshell-gateway-x86_64-unknown-linux-gnu.tar.gz", + "b7760cb752a4363c2f21d32298dd0c683dc438f6edfd16c2e4242bc0baefbb7c", + "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c", + "openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz", + "559b8aaad3a8eeab45c511e7de531d9baa98a311282dcb0c2c5f38cc2d4ca355", + "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8", +] as const; + +function expectSingleInstallerIdentities(source: string): void { + for (const identity of QUALIFICATION_INSTALLER_IDENTITIES) { + expect(source.match(new RegExp(identity.replaceAll(".", "\\."), "gu"))).toHaveLength(1); + } +} + describe("OpenShell gateway auth contract workflow boundary", () => { + it("binds the qualification installer to one coherent OpenShell 0.0.106 release", () => { + const installerPath = "tools/e2e/install-openshell-v00106-qualification.sh"; + const source = readFileSync(installerPath, "utf8"); + + expect(source).toContain('readonly release_tag="v0.0.106"'); + expect(source).not.toMatch(/v0\.0\.(?:101|105|107)/u); + expectSingleInstallerIdentities(source); + expect(source).toContain('printf \'%s %s\\n\' "${archive_sha256[$index]}" "$archive" | sha256sum -c -'); + expect(source).toContain('printf \'%s %s\\n\' "${binary_sha256[$index]}" "${extracted}/${member}" | sha256sum -c -'); + expect(source).toContain('printf \'%s %s\\n\' "${binary_sha256[$index]}" "${target_dir}/${member}" | sha256sum -c -'); + execFileSync("bash", ["-n", installerPath]); + }); + it("accepts the checked-in workflow and rejects protected trust-boundary mutations", () => { expect(validateOpenShellGatewayAuthContractWorkflowBoundary()).toEqual([]); @@ -22,6 +56,7 @@ describe("OpenShell gateway auth contract workflow boundary", () => { ...job.env, DOCKER_GRPC_PROBE_IMAGE: "node:22-trixie-slim", E2E_ARTIFACT_DIR: "/tmp/gateway-auth", + NEMOCLAW_CANDIDATE_VERSION: "latest", NEMOCLAW_OPENSHELL_PIN_VERSION: "latest", NVIDIA_API_KEY: "${{ secrets.NVIDIA_API_KEY }}", }; @@ -71,12 +106,13 @@ describe("OpenShell gateway auth contract workflow boundary", () => { "openshell-gateway-auth-contract must retain its 20 minute resource budget", "openshell-gateway-auth-contract must set DOCKER_GRPC_PROBE_IMAGE=node:22-trixie-slim@sha256:db8a96a63e5264607ada2d206758876ebbed6a12be2ada7517793cbfb0c2a29c", "openshell-gateway-auth-contract must set E2E_ARTIFACT_DIR=${{ github.workspace }}/e2e-artifacts/live/openshell-gateway-auth-contract", - "openshell-gateway-auth-contract must set NEMOCLAW_OPENSHELL_PIN_VERSION to an exact version", + "openshell-gateway-auth-contract must set NEMOCLAW_CANDIDATE_VERSION=0.0.106", + "openshell-gateway-auth-contract must set NEMOCLAW_OPENSHELL_PIN_VERSION=0.0.106", "openshell-gateway-auth-contract must not expose NVIDIA_API_KEY at job scope", "openshell-gateway-auth-contract action 'actions/checkout@v6' must pin a full SHA", "openshell-gateway-auth-contract checkout must disable persisted credentials", "openshell-gateway-auth-contract must use the reviewed prepare-e2e action", - "openshell-gateway-auth-contract step 'Install OpenShell CLI' must run: -u DOCKER_CONFIG", + "openshell-gateway-auth-contract must run only the exact credential-free OpenShell 0.0.106 install", "openshell-gateway-auth-contract step 'Pre-pull pinned gateway auth probe image' must run: docker pull \"$DOCKER_GRPC_PROBE_IMAGE\"", "openshell-gateway-auth-contract live test must not receive workflow credentials", "openshell-gateway-auth-contract final artifact safety scan must run unconditionally with a stable id", @@ -90,6 +126,18 @@ describe("OpenShell gateway auth contract workflow boundary", () => { ); }); + it("rejects a second product installer after the exact OpenShell 0.0.106 install", () => { + const workflow = readOpenShellGatewayAuthContractWorkflow(); + const install = workflow.jobs["openshell-gateway-auth-contract"].steps!.find( + (step) => step.name === "Install OpenShell CLI", + )!; + install.run += " && bash scripts/install-openshell.sh"; + + expect(validateOpenShellGatewayAuthContractWorkflow(workflow)).toContain( + "openshell-gateway-auth-contract must run only the exact credential-free OpenShell 0.0.106 install", + ); + }); + it("rejects artifact safety commands that can mask scanner failures (#7101)", () => { const workflow = readOpenShellGatewayAuthContractWorkflow(); const artifactSafety = workflow.jobs["openshell-gateway-auth-contract"].steps!.find( diff --git a/tools/e2e/install-openshell-v00106-qualification.sh b/tools/e2e/install-openshell-v00106-qualification.sh new file mode 100755 index 00000000000..a06ce2e65a9 --- /dev/null +++ b/tools/e2e/install-openshell-v00106-qualification.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Install the exact OpenShell v0.0.106 Linux x86_64 release for the bounded +# qualification jobs that run before NemoClaw changes its supported 0.0.101 pin. + +set -euo pipefail + +fail() { + printf 'OpenShell v0.0.106 qualification install failed: %s\n' "$1" >&2 + exit 1 +} + +[[ "$(uname -s)" == "Linux" ]] || fail "Linux is required" +case "$(uname -m)" in + x86_64 | amd64) ;; + *) fail "x86_64 is required" ;; +esac + +for command_name in curl install mktemp sha256sum tar; do + command -v "$command_name" >/dev/null 2>&1 || fail "$command_name is required" +done + +readonly release_tag="v0.0.106" +readonly release_base="https://github.com/NVIDIA/OpenShell/releases/download/${release_tag}" +readonly target_dir="/usr/local/bin" +readonly -a assets=( + "openshell-x86_64-unknown-linux-musl.tar.gz" + "openshell-gateway-x86_64-unknown-linux-gnu.tar.gz" + "openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz" +) +readonly -a members=("openshell" "openshell-gateway" "openshell-sandbox") +readonly -a archive_sha256=( + "d1a885a91b3e5aaa006c36aca95dc78bed0638c1ba1a79b55f1da93211b8a0a0" + "b7760cb752a4363c2f21d32298dd0c683dc438f6edfd16c2e4242bc0baefbb7c" + "559b8aaad3a8eeab45c511e7de531d9baa98a311282dcb0c2c5f38cc2d4ca355" +) +readonly -a binary_sha256=( + "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59" + "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c" + "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8" +) + +workspace="$(mktemp -d)" +trap 'rm -rf "$workspace"' EXIT + +for index in "${!assets[@]}"; do + asset="${assets[$index]}" + member="${members[$index]}" + archive="${workspace}/${asset}" + extracted="${workspace}/extracted-${index}" + mkdir -p "$extracted" + + curl --proto '=https' --tlsv1.2 -fsSL \ + --connect-timeout 10 --max-time 120 --retry 3 --retry-all-errors \ + "${release_base}/${asset}" -o "$archive" + printf '%s %s\n' "${archive_sha256[$index]}" "$archive" | sha256sum -c - + + members_found="$(LC_ALL=C tar -tzf "$archive")" + [[ "$members_found" == "$member" ]] \ + || fail "$asset must contain exactly one member named $member" + member_detail="$(LC_ALL=C tar -tvzf "$archive")" + [[ "$member_detail" != *$'\n'* && "${member_detail:0:1}" == "-" && "${member_detail##* }" == "$member" ]] \ + || fail "$asset member $member must be one regular file" + + tar -xzf "$archive" -C "$extracted" + printf '%s %s\n' "${binary_sha256[$index]}" "${extracted}/${member}" | sha256sum -c - +done + +install_command=(install -m 755) +if [[ ! -w "$target_dir" ]]; then + command -v sudo >/dev/null 2>&1 || fail "sudo is required to write $target_dir" + install_command=(sudo install -m 755) +fi + +for index in "${!members[@]}"; do + member="${members[$index]}" + "${install_command[@]}" "${workspace}/extracted-${index}/${member}" "${target_dir}/${member}" + printf '%s %s\n' "${binary_sha256[$index]}" "${target_dir}/${member}" | sha256sum -c - +done + +"${target_dir}/openshell" --version | grep -Eq '(^|[^0-9])0\.0\.106([^0-9]|$)' \ + || fail "installed OpenShell CLI does not report 0.0.106" diff --git a/tools/e2e/mcp-workflow-boundary.mts b/tools/e2e/mcp-workflow-boundary.mts index 44312a34e89..f4e301f97b3 100644 --- a/tools/e2e/mcp-workflow-boundary.mts +++ b/tools/e2e/mcp-workflow-boundary.mts @@ -72,24 +72,53 @@ const CREDENTIAL_WINDOW_ARTIFACT_DIR = "e2e-artifacts/live/openshell-credential- const CREDENTIAL_WINDOW_RUN_STEP = "Run OpenShell credential generation-window live test"; const CREDENTIAL_WINDOW_JOB_CONDITION = "${{ contains(fromJSON(needs.generate-matrix.outputs.selected_jobs), 'openshell-credential-generation-window') }}"; -const STABLE_RELEASE_SOURCE_SHA = "8ddd98c3dff62619a3963f99ba1e055b67650e72"; +const STABLE_QUALIFICATION_INSTALLER = + "tools/e2e/install-openshell-v00106-qualification.sh"; +const STABLE_RELEASE_SOURCE_SHA = "c4b500a7de64d0b66e3ee8098f58d14299092162"; const STABLE_RELEASE_SUPERVISOR_INDEX = - "b58be5e40c788977ffa0e8305a8cad9c656efdf1a3fe182582a00ca870bb0edb"; -const STABLE_RELEASE_IDENTITY_TOKENS = [ - 'releaseTag: "v0.0.101"', - STABLE_RELEASE_SOURCE_SHA, - "1ad48efd5e1de8f3f017a81b3a7177872f350343a1a8d8074c7e844bca4801e9", - "a6a5d754605a2144b148637b85a09291d2eeb77e08a4ee34b83685c6920448f5", - "a2704babbb468fd0a359bfdd9844de71095b730758541b4ca8cbab77d4018920", -] as const; -const STABLE_RELEASE_PROVENANCE_TOKENS = [ - ...STABLE_RELEASE_IDENTITY_TOKENS, - "mcp-bridge-deepagents/openshell-exact-main-provenance.json", -] as const; -const CREDENTIAL_WINDOW_PROVENANCE_TOKENS = [ - ...STABLE_RELEASE_IDENTITY_TOKENS, - "openshell-credential-generation-window/openshell-exact-main-provenance.json", -] as const; + "722f44669722961b7f432b0b81de25b91a58f34a61d6403bef967acaf2b3af01"; +const STABLE_RELEASE_CLI_SHA256 = + "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59"; +const STABLE_RELEASE_GATEWAY_SHA256 = + "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c"; +const STABLE_RELEASE_SANDBOX_SHA256 = + "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8"; +const MCP_STABLE_INSTALL_RUN = [ + "set -euo pipefail", + `bash ${STABLE_QUALIFICATION_INSTALLER}`, + 'if [[ "$NEMOCLAW_MCP_BRIDGE_AGENT" == "deepagents" ]]; then', + ' mkdir -p "$E2E_ARTIFACT_DIR/mcp-bridge-deepagents"', + " jq -n '{", + " schemaVersion: 1,", + ' sourceRepository: "NVIDIA/OpenShell",', + ' releaseTag: "v0.0.106",', + ` sourceSha: "${STABLE_RELEASE_SOURCE_SHA}",`, + " artifacts: {", + ` cli: {binarySha256: "${STABLE_RELEASE_CLI_SHA256}"},`, + ` gateway: {binarySha256: "${STABLE_RELEASE_GATEWAY_SHA256}"},`, + ` standaloneSandbox: {binarySha256: "${STABLE_RELEASE_SANDBOX_SHA256}"}`, + " }", + " }' > \"$E2E_ARTIFACT_DIR/mcp-bridge-deepagents/openshell-exact-main-provenance.json\"", + "fi", + "", +].join("\n"); +const CREDENTIAL_WINDOW_INSTALL_RUN = [ + "set -euo pipefail", + `bash ${STABLE_QUALIFICATION_INSTALLER}`, + 'mkdir -p "$E2E_ARTIFACT_DIR/openshell-credential-generation-window"', + "jq -n '{", + " schemaVersion: 1,", + ' sourceRepository: "NVIDIA/OpenShell",', + ' releaseTag: "v0.0.106",', + ` sourceSha: "${STABLE_RELEASE_SOURCE_SHA}",`, + " artifacts: {", + ` cli: {binarySha256: "${STABLE_RELEASE_CLI_SHA256}"},`, + ` gateway: {binarySha256: "${STABLE_RELEASE_GATEWAY_SHA256}"},`, + ` standaloneSandbox: {binarySha256: "${STABLE_RELEASE_SANDBOX_SHA256}"}`, + " }", + "}' > \"$E2E_ARTIFACT_DIR/openshell-credential-generation-window/openshell-exact-main-provenance.json\"", + "", +].join("\n"); const DEV_COMPATIBILITY_RUN = [ "set -euo pipefail", 'export PATH="$HOME/.local/bin:$HOME/.npm-global/bin:$PATH"', @@ -478,26 +507,17 @@ function validateJobExecution( ); } } else { - requireEqual( - errors, - installEnv.NEMOCLAW_OPENSHELL_FORCE_INSTALL, - "1", - `${jobName} must force the selected OpenShell install`, - ); + if (Object.keys(installEnv).length !== 0) { + errors.push("mcp-bridge stable qualification installer must not receive overrides"); + } if (Object.hasOwn(installEnv, "NEMOCLAW_ACCEPT_DEV_UNVERIFIED_INSTALL")) { errors.push("mcp-bridge stable installer must not authorize unverified dev artifacts"); } - const installRun = asString(install.run); - for (const token of STABLE_RELEASE_PROVENANCE_TOKENS) { - if (!installRun.includes(token)) { - errors.push(`mcp-bridge stable release provenance is missing reviewed identity: ${token}`); - } - } - requireContains( + requireEqual( errors, install.run, - "bash scripts/install-openshell.sh", - `${jobName} must use the repository OpenShell installer`, + MCP_STABLE_INSTALL_RUN, + `${jobName} must run only the exact OpenShell 0.0.106 qualification install and provenance step`, ); } if (jobName === "mcp-bridge-dev") { @@ -956,26 +976,15 @@ function validateCredentialWindowJob( "bash test/e2e/setup-mcp-test-tls.sh", `${CREDENTIAL_WINDOW_JOB} must generate its HTTPS fixture before installation`, ); + if (Object.keys(asRecord(install.env)).length !== 0) { + errors.push(`${CREDENTIAL_WINDOW_JOB} qualification installer must not receive overrides`); + } requireEqual( - errors, - asRecord(install.env).NEMOCLAW_OPENSHELL_FORCE_INSTALL, - "1", - `${CREDENTIAL_WINDOW_JOB} must force the stable OpenShell install`, - ); - requireContains( errors, install.run, - "bash scripts/install-openshell.sh", - `${CREDENTIAL_WINDOW_JOB} must use the repository OpenShell installer`, + CREDENTIAL_WINDOW_INSTALL_RUN, + `${CREDENTIAL_WINDOW_JOB} must run only the exact OpenShell 0.0.106 qualification install and provenance step`, ); - for (const token of CREDENTIAL_WINDOW_PROVENANCE_TOKENS) { - requireContains( - errors, - install.run, - token, - `${CREDENTIAL_WINDOW_JOB} stable release provenance is missing reviewed identity: ${token}`, - ); - } for (const required of [ CREDENTIAL_WINDOW_FILE, diff --git a/tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts b/tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts index ed14f08fe18..6c1f486ea3d 100644 --- a/tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts +++ b/tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts @@ -12,6 +12,11 @@ import { UPLOAD_E2E_ARTIFACTS_ACTION } from "./upload-e2e-artifacts-workflow-bou const REPO_ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", ".."); const DEFAULT_WORKFLOW_PATH = join(REPO_ROOT, ".github", "workflows", "e2e.yaml"); const JOB_NAME = "openshell-gateway-auth-contract"; +const OPENSHELL_RELEASE_VERSION = "0.0.106"; +const OPENSHELL_QUALIFICATION_INSTALLER = + "tools/e2e/install-openshell-v00106-qualification.sh"; +const OPENSHELL_QUALIFICATION_INSTALL_RUN = + `env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash ${OPENSHELL_QUALIFICATION_INSTALLER}`; const FULL_SHA_ACTION = /^[^\s@]+@[0-9a-f]{40}$/u; const TRUSTED_PLAN_CONDITION = `\${{ contains(fromJSON(needs.generate-matrix.outputs.selected_jobs), '${JOB_NAME}') }}`; const GATEWAY_PROBE_IMAGE = @@ -98,6 +103,7 @@ export function validateOpenShellGatewayAuthContractWorkflow( const expectedEnv = { DOCKER_GRPC_PROBE_IMAGE: GATEWAY_PROBE_IMAGE, E2E_ARTIFACT_DIR: "${{ github.workspace }}/e2e-artifacts/live/openshell-gateway-auth-contract", + NEMOCLAW_CANDIDATE_VERSION: OPENSHELL_RELEASE_VERSION, NEMOCLAW_NON_INTERACTIVE: "1", NEMOCLAW_RUN_LIVE_E2E: "1", }; @@ -105,8 +111,10 @@ export function validateOpenShellGatewayAuthContractWorkflow( if (env[name] !== value) errors.push(`${JOB_NAME} must set ${name}=${value}`); } const pinVersion = env.NEMOCLAW_OPENSHELL_PIN_VERSION; - if (typeof pinVersion !== "string" || !/^\d+\.\d+\.\d+$/.test(pinVersion)) { - errors.push(`${JOB_NAME} must set NEMOCLAW_OPENSHELL_PIN_VERSION to an exact version`); + if (pinVersion !== OPENSHELL_RELEASE_VERSION) { + errors.push( + `${JOB_NAME} must set NEMOCLAW_OPENSHELL_PIN_VERSION=${OPENSHELL_RELEASE_VERSION}`, + ); } for (const secret of [ "DOCKERHUB_USERNAME", @@ -136,17 +144,9 @@ export function validateOpenShellGatewayAuthContractWorkflow( } const install = findStep(job, "Install OpenShell CLI"); - for (const variable of [ - "DOCKER_CONFIG", - "DOCKERHUB_USERNAME", - "DOCKERHUB_TOKEN", - "NVIDIA_API_KEY", - "NVIDIA_INFERENCE_API_KEY", - "GITHUB_TOKEN", - ]) { - requireRunContains(errors, install, `-u ${variable}`); + if (install.run !== OPENSHELL_QUALIFICATION_INSTALL_RUN) { + errors.push(`${JOB_NAME} must run only the exact credential-free OpenShell 0.0.106 install`); } - requireRunContains(errors, install, "bash scripts/install-openshell.sh"); const prePull = findStep(job, "Pre-pull pinned gateway auth probe image"); requireRunContains(errors, prePull, 'docker pull "$DOCKER_GRPC_PROBE_IMAGE"'); diff --git a/tools/e2e/workflow-boundary.mts b/tools/e2e/workflow-boundary.mts index 132f548c83b..0cfe6b57715 100644 --- a/tools/e2e/workflow-boundary.mts +++ b/tools/e2e/workflow-boundary.mts @@ -608,6 +608,10 @@ const RESTORED_GATEWAY_PAIRING_RUNTIME_FILES = new Set([ ]); const LIVE_E2E_OWNING_FILE_JOBS = new Map([ ["test/e2e/live/openclaw-plugin-runtime-exdev-lifecycle.ts", ["openclaw-plugin-runtime-exdev"]], + [ + "tools/e2e/install-openshell-v00106-qualification.sh", + ["openshell-gateway-auth-contract", "mcp-bridge"], + ], ]); export function focusedE2eJobsForChangedFiles( From 6b997b6b70593e7a6ef7ddf203a47e9f786187a8 Mon Sep 17 00:00:00 2001 From: Prekshi Vyas Date: Mon, 17 Aug 2026 23:31:18 -0700 Subject: [PATCH 02/14] refactor(e2e): share OpenShell qualification identity Signed-off-by: Prekshi Vyas --- .github/workflows/e2e.yaml | 81 ++--- scripts/check-installer-hash.sh | 276 ++++++++++-------- scripts/checks/dependency-pins.mts | 84 +++++- scripts/checks/extract-installer-pins.mts | 39 ++- scripts/install-openshell.sh | 32 ++ test/dependency-pins-check.test.ts | 36 ++- test/e2e/support/e2e-workflow.test.ts | 4 +- .../e2e/support/mcp-workflow-boundary.test.ts | 4 +- ...ay-auth-contract-workflow-boundary.test.ts | 76 ++--- test/installer-hash-check.test.ts | 4 +- .../install-openshell-v00106-qualification.sh | 84 ------ tools/e2e/mcp-workflow-boundary.mts | 153 ++++++---- ...ateway-auth-contract-workflow-boundary.mts | 54 +++- tools/e2e/openshell-qualification.mts | 138 +++++++++ tools/e2e/workflow-boundary.mts | 2 +- 15 files changed, 667 insertions(+), 400 deletions(-) delete mode 100755 tools/e2e/install-openshell-v00106-qualification.sh create mode 100644 tools/e2e/openshell-qualification.mts diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index f23b1a09e93..6c85b295d3e 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -3223,8 +3223,6 @@ jobs: E2E_ARTIFACT_DIR: ${{ github.workspace }}/e2e-artifacts/live/openshell-gateway-auth-contract NEMOCLAW_RUN_LIVE_E2E: "1" NEMOCLAW_NON_INTERACTIVE: "1" - NEMOCLAW_CANDIDATE_VERSION: "0.0.106" - NEMOCLAW_OPENSHELL_PIN_VERSION: "0.0.106" DOCKER_GRPC_PROBE_IMAGE: "node:22-trixie-slim@sha256:db8a96a63e5264607ada2d206758876ebbed6a12be2ada7517793cbfb0c2a29c" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -3245,13 +3243,25 @@ jobs: with: provenance-json: ${{ needs.generate-matrix.outputs.cli_artifact_provenance }} + - id: openshell_qualification + name: Select OpenShell qualification release + run: node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts select "$GITHUB_OUTPUT" + - name: Install OpenShell CLI - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash tools/e2e/install-openshell-v00106-qualification.sh + env: + NEMOCLAW_OPENSHELL_FORCE_INSTALL: "1" + NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} + NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} + NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh - name: Pre-pull pinned gateway auth probe image run: docker pull "$DOCKER_GRPC_PROBE_IMAGE" - name: Run OpenShell gateway auth contract live test + env: + NEMOCLAW_CANDIDATE_VERSION: ${{ steps.openshell_qualification.outputs.version }} + NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} run: | set -euo pipefail export PATH="$HOME/.local/bin:$HOME/.npm-global/bin:$PATH" @@ -3309,7 +3319,6 @@ jobs: NEMOCLAW_OPENSHELL_CHANNEL: stable NEMOCLAW_OPENSHELL_EXACT_MAIN_PROOF: "1" NEMOCLAW_RUN_LIVE_E2E: "1" - OPENSHELL_DOCKER_SUPERVISOR_IMAGE: ghcr.io/nvidia/openshell/supervisor@sha256:722f44669722961b7f432b0b81de25b91a58f34a61d6403bef967acaf2b3af01 steps: - id: trusted_hermes_swap name: Provision trusted Hermes E2E swap @@ -3551,26 +3560,25 @@ jobs: - name: Generate MCP test TLS run: bash test/e2e/setup-mcp-test-tls.sh + - id: openshell_qualification + name: Select OpenShell qualification release + run: node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts select "$GITHUB_OUTPUT" + - name: Install OpenShell CLI - run: | - set -euo pipefail - bash tools/e2e/install-openshell-v00106-qualification.sh - if [[ "$NEMOCLAW_MCP_BRIDGE_AGENT" == "deepagents" ]]; then - mkdir -p "$E2E_ARTIFACT_DIR/mcp-bridge-deepagents" - jq -n '{ - schemaVersion: 1, - sourceRepository: "NVIDIA/OpenShell", - releaseTag: "v0.0.106", - sourceSha: "c4b500a7de64d0b66e3ee8098f58d14299092162", - artifacts: { - cli: {binarySha256: "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59"}, - gateway: {binarySha256: "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c"}, - standaloneSandbox: {binarySha256: "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8"} - } - }' > "$E2E_ARTIFACT_DIR/mcp-bridge-deepagents/openshell-exact-main-provenance.json" - fi + env: + NEMOCLAW_OPENSHELL_FORCE_INSTALL: "1" + NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} + NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} + NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh + + - name: Write OpenShell provenance + if: ${{ matrix.agent == 'deepagents' }} + run: node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts provenance "$E2E_ARTIFACT_DIR/mcp-bridge-deepagents/openshell-exact-main-provenance.json" - name: Run MCP OpenShell provider live test + env: + OPENSHELL_DOCKER_SUPERVISOR_IMAGE: ${{ steps.openshell_qualification.outputs.supervisor_image }} run: | set -euo pipefail export PATH="$HOME/.local/bin:$HOME/.npm-global/bin:$PATH" @@ -3629,7 +3637,6 @@ jobs: NEMOCLAW_OPENSHELL_CHANNEL: stable NEMOCLAW_OPENSHELL_EXACT_MAIN_PROOF: "1" NEMOCLAW_RUN_LIVE_E2E: "1" - OPENSHELL_DOCKER_SUPERVISOR_IMAGE: ghcr.io/nvidia/openshell/supervisor@sha256:722f44669722961b7f432b0b81de25b91a58f34a61d6403bef967acaf2b3af01 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -3671,24 +3678,24 @@ jobs: - name: Generate MCP test TLS run: bash test/e2e/setup-mcp-test-tls.sh + - id: openshell_qualification + name: Select OpenShell qualification release + run: node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts select "$GITHUB_OUTPUT" + - name: Install OpenShell CLI - run: | - set -euo pipefail - bash tools/e2e/install-openshell-v00106-qualification.sh - mkdir -p "$E2E_ARTIFACT_DIR/openshell-credential-generation-window" - jq -n '{ - schemaVersion: 1, - sourceRepository: "NVIDIA/OpenShell", - releaseTag: "v0.0.106", - sourceSha: "c4b500a7de64d0b66e3ee8098f58d14299092162", - artifacts: { - cli: {binarySha256: "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59"}, - gateway: {binarySha256: "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c"}, - standaloneSandbox: {binarySha256: "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8"} - } - }' > "$E2E_ARTIFACT_DIR/openshell-credential-generation-window/openshell-exact-main-provenance.json" + env: + NEMOCLAW_OPENSHELL_FORCE_INSTALL: "1" + NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} + NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} + NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh + + - name: Write OpenShell provenance + run: node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts provenance "$E2E_ARTIFACT_DIR/openshell-credential-generation-window/openshell-exact-main-provenance.json" - name: Run OpenShell credential generation-window live test + env: + OPENSHELL_DOCKER_SUPERVISOR_IMAGE: ${{ steps.openshell_qualification.outputs.supervisor_image }} run: | set -euo pipefail export PATH="$HOME/.local/bin:$HOME/.npm-global/bin:$PATH" diff --git a/scripts/check-installer-hash.sh b/scripts/check-installer-hash.sh index 55d22e423f5..eb349cb0a55 100755 --- a/scripts/check-installer-hash.sh +++ b/scripts/check-installer-hash.sh @@ -119,10 +119,11 @@ check_openshell_release_assets() { local supervisor_runtime="${REPO_ROOT}/src/lib/onboard/docker-driver-gateway-runtime.ts" local release_base workspace manifests spec manifest expected actual source asset pinned upstream formula_asset local matches required_manifest required_matches formula_expected="" formula_matches=0 formula_url="" - local pin_records parser_error parser_errors parsed_version release_version="" record_extra + local pin_records parser_error parser_errors parsed_version release_version record_extra selected_release_version="" + local release_versions="" version_pin_records local allowlist_entry allowlist_version allowlist_extra local formula_allowlist_entry formula_allowlist_version formula_allowlist_asset formula_allowlist_url formula_allowlist_digest formula_allowlist_extra - local count=0 brev_count=0 published_count=0 expected_published_count=0 failures=0 + local count brev_count published_count expected_published_count failures=0 local -a manifest_specs=() workspace=$(mktemp -d) manifests="${workspace}/published-sha256.txt" @@ -162,15 +163,20 @@ check_openshell_release_assets() { echo " STALE: trusted parser returned an invalid installer pin record." return 1 fi - if [[ -z "$release_version" ]]; then - release_version="$parsed_version" - elif [[ "$parsed_version" != "$release_version" ]]; then - echo " STALE: trusted parser returned multiple OpenShell release versions." - return 1 - fi + case " ${release_versions} " in + *" ${parsed_version} "*) ;; + *) release_versions="${release_versions:+${release_versions} }${parsed_version}" ;; + esac case "$source" in - installer) count=$((count + 1)) ;; - "Brev launchable") brev_count=$((brev_count + 1)) ;; + installer) ;; + "Brev launchable") + if [[ -z "$selected_release_version" ]]; then + selected_release_version="$parsed_version" + elif [[ "$selected_release_version" != "$parsed_version" ]]; then + echo " STALE: trusted parser returned multiple Brev OpenShell release versions." + return 1 + fi + ;; *) echo " STALE: trusted parser returned an unknown pin source." return 1 @@ -178,148 +184,172 @@ check_openshell_release_assets() { esac done <<<"$pin_records" - if [[ "$count" -ne 9 ]]; then - echo " STALE: expected 9 pinned OpenShell v${release_version:-unknown} assets, found ${count}." - failures=$((failures + 1)) - fi - if [[ "$brev_count" -ne 2 ]]; then - echo " STALE: expected 2 pinned Brev OpenShell v${release_version:-unknown} CLI assets, found ${brev_count}." - failures=$((failures + 1)) - fi - if [[ "$failures" -ne 0 ]]; then - return "$failures" - fi + [[ -n "$selected_release_version" ]] || { + echo " STALE: trusted parser returned no selected Brev OpenShell release." + return 1 + } - for allowlist_entry in "${OPENSHELL_RELEASE_MANIFEST_ALLOWLIST[@]}"; do - IFS='|' read -r allowlist_version manifest expected allowlist_extra <<<"$allowlist_entry" - if [[ ! "$allowlist_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ || ! "$expected" =~ ^[a-f0-9]{64}$ || -z "$manifest" || -n "$allowlist_extra" ]]; then - echo " STALE: trusted OpenShell release-manifest allowlist is invalid." - return 1 + for release_version in $release_versions; do + manifests="${workspace}/published-sha256-${release_version}.txt" + : >"$manifests" + manifest_specs=() + formula_expected="" + formula_matches=0 + formula_url="" + count=0 + brev_count=0 + published_count=0 + version_pin_records="" + + while IFS=$'\t' read -r parsed_version source asset pinned record_extra; do + [[ "$parsed_version" == "$release_version" ]] || continue + version_pin_records+="${parsed_version}"$'\t'"${source}"$'\t'"${asset}"$'\t'"${pinned}"$'\n' + case "$source" in + installer) count=$((count + 1)) ;; + "Brev launchable") brev_count=$((brev_count + 1)) ;; + esac + done <<<"$pin_records" + + if [[ "$count" -ne 9 ]]; then + echo " STALE: expected 9 pinned OpenShell v${release_version} assets, found ${count}." + failures=$((failures + 1)) fi - if [[ "$allowlist_version" == "$release_version" ]]; then - manifest_specs+=("${manifest}:${expected}") + if [[ "$release_version" == "$selected_release_version" && "$brev_count" -ne 2 ]]; then + echo " STALE: expected 2 pinned Brev OpenShell v${release_version} CLI assets, found ${brev_count}." + failures=$((failures + 1)) + elif [[ "$release_version" != "$selected_release_version" && "$brev_count" -ne 0 ]]; then + echo " STALE: unselected OpenShell v${release_version} must not have Brev pins." + failures=$((failures + 1)) fi - done + [[ "$failures" -eq 0 ]] || return "$failures" - if [[ "${#manifest_specs[@]}" -eq 0 ]]; then - echo " STALE: OpenShell v${release_version} is not in the trusted release-manifest allowlist." - return 1 - fi - if [[ "${#manifest_specs[@]}" -ne 3 ]]; then - echo " STALE: OpenShell v${release_version} does not have exactly three trusted release-manifest digests." - return 1 - fi - for required_manifest in \ - openshell-checksums-sha256.txt \ - openshell-gateway-checksums-sha256.txt \ - openshell-sandbox-checksums-sha256.txt; do - required_matches=0 - for spec in "${manifest_specs[@]}"; do - if [[ "${spec%%:*}" == "$required_manifest" ]]; then - required_matches=$((required_matches + 1)) + for allowlist_entry in "${OPENSHELL_RELEASE_MANIFEST_ALLOWLIST[@]}"; do + IFS='|' read -r allowlist_version manifest expected allowlist_extra <<<"$allowlist_entry" + if [[ ! "$allowlist_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ || ! "$expected" =~ ^[a-f0-9]{64}$ || -z "$manifest" || -n "$allowlist_extra" ]]; then + echo " STALE: trusted OpenShell release-manifest allowlist is invalid." + return 1 + fi + if [[ "$allowlist_version" == "$release_version" ]]; then + manifest_specs+=("${manifest}:${expected}") fi done - if [[ "$required_matches" -ne 1 ]]; then - echo " STALE: OpenShell v${release_version} does not have exactly one trusted ${required_manifest} digest." - failures=$((failures + 1)) - fi - done - if [[ "$failures" -ne 0 ]]; then - return "$failures" - fi - for formula_allowlist_entry in "${OPENSHELL_RELEASE_FORMULA_ALLOWLIST[@]}"; do - IFS='|' read -r formula_allowlist_version formula_allowlist_asset formula_allowlist_url formula_allowlist_digest formula_allowlist_extra <<<"$formula_allowlist_entry" - if [[ ! "$formula_allowlist_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ || "$formula_allowlist_asset" != "openshell.rb" || "$formula_allowlist_url" != "https://github.com/NVIDIA/OpenShell/releases/download/v${formula_allowlist_version}/${formula_allowlist_asset}" || ! "$formula_allowlist_digest" =~ ^[a-f0-9]{64}$ || -n "$formula_allowlist_extra" ]]; then - echo " STALE: trusted OpenShell formula allowlist is invalid." + if [[ "${#manifest_specs[@]}" -eq 0 ]]; then + echo " STALE: OpenShell v${release_version} is not in the trusted release-manifest allowlist." return 1 fi - if [[ "$formula_allowlist_version" == "$release_version" ]]; then - formula_matches=$((formula_matches + 1)) - formula_url="$formula_allowlist_url" - formula_expected="$formula_allowlist_digest" + if [[ "${#manifest_specs[@]}" -ne 3 ]]; then + echo " STALE: OpenShell v${release_version} does not have exactly three trusted release-manifest digests." + return 1 fi - done - - if [[ "$formula_matches" -ne 1 ]]; then - echo " STALE: OpenShell v${release_version} does not have exactly one trusted openshell.rb digest." - return 1 - fi + for required_manifest in \ + openshell-checksums-sha256.txt \ + openshell-gateway-checksums-sha256.txt \ + openshell-sandbox-checksums-sha256.txt; do + required_matches=0 + for spec in "${manifest_specs[@]}"; do + [[ "${spec%%:*}" == "$required_manifest" ]] && required_matches=$((required_matches + 1)) + done + if [[ "$required_matches" -ne 1 ]]; then + echo " STALE: OpenShell v${release_version} does not have exactly one trusted ${required_manifest} digest." + failures=$((failures + 1)) + fi + done + [[ "$failures" -eq 0 ]] || return "$failures" - release_base="https://github.com/NVIDIA/OpenShell/releases/download/v${release_version}" - echo "Checking OpenShell v${release_version} release assets..." - for spec in "${manifest_specs[@]}"; do - manifest="${spec%%:*}" - expected="${spec#*:}" - if ! fetch_file "${release_base}/${manifest}" "${workspace}/${manifest}"; then - echo " STALE: unable to download ${manifest}." - failures=$((failures + 1)) - continue - fi - if ! actual=$(sha256_file "${workspace}/${manifest}"); then - echo " STALE: unable to hash ${manifest}." - failures=$((failures + 1)) - continue - fi - if [[ "$actual" != "$expected" ]]; then - echo " STALE: ${manifest} digest does not match the pinned v${release_version} release asset." - echo " pinned: ${expected}" - echo " upstream: ${actual}" - failures=$((failures + 1)) - continue + for formula_allowlist_entry in "${OPENSHELL_RELEASE_FORMULA_ALLOWLIST[@]}"; do + IFS='|' read -r formula_allowlist_version formula_allowlist_asset formula_allowlist_url formula_allowlist_digest formula_allowlist_extra <<<"$formula_allowlist_entry" + if [[ ! "$formula_allowlist_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ || "$formula_allowlist_asset" != "openshell.rb" || "$formula_allowlist_url" != "https://github.com/NVIDIA/OpenShell/releases/download/v${formula_allowlist_version}/${formula_allowlist_asset}" || ! "$formula_allowlist_digest" =~ ^[a-f0-9]{64}$ || -n "$formula_allowlist_extra" ]]; then + echo " STALE: trusted OpenShell formula allowlist is invalid." + return 1 + fi + if [[ "$formula_allowlist_version" == "$release_version" ]]; then + formula_matches=$((formula_matches + 1)) + formula_url="$formula_allowlist_url" + formula_expected="$formula_allowlist_digest" + fi + done + if [[ "$formula_matches" -ne 1 ]]; then + echo " STALE: OpenShell v${release_version} does not have exactly one trusted openshell.rb digest." + return 1 fi - echo " OK: ${manifest} (${actual})" - cat "${workspace}/${manifest}" >>"$manifests" - done - while IFS=$'\t' read -r parsed_version source asset pinned record_extra; do - if [[ "$asset" == "openshell.rb" ]]; then - formula_asset="${workspace}/${asset}" - if ! fetch_file "$formula_url" "$formula_asset"; then - echo " STALE: unable to download ${source} ${asset}." + release_base="https://github.com/NVIDIA/OpenShell/releases/download/v${release_version}" + echo "Checking OpenShell v${release_version} release assets..." + for spec in "${manifest_specs[@]}"; do + manifest="${spec%%:*}" + expected="${spec#*:}" + if ! fetch_file "${release_base}/${manifest}" "${workspace}/${release_version}-${manifest}"; then + echo " STALE: unable to download ${manifest}." failures=$((failures + 1)) continue fi - if ! actual=$(sha256_file "$formula_asset"); then - echo " STALE: unable to hash ${source} ${asset}." + if ! actual=$(sha256_file "${workspace}/${release_version}-${manifest}"); then + echo " STALE: unable to hash ${manifest}." failures=$((failures + 1)) continue fi - if [[ "$actual" != "$formula_expected" ]]; then - echo " STALE: ${source} ${asset} does not match the base-trusted v${release_version} formula digest." - echo " trusted: ${formula_expected}" + if [[ "$actual" != "$expected" ]]; then + echo " STALE: ${manifest} digest does not match the pinned v${release_version} release asset." + echo " pinned: ${expected}" echo " upstream: ${actual}" failures=$((failures + 1)) - elif [[ "$pinned" == "$formula_expected" ]]; then + continue + fi + echo " OK: ${manifest} (${actual})" + cat "${workspace}/${release_version}-${manifest}" >>"$manifests" + done + + while IFS=$'\t' read -r parsed_version source asset pinned record_extra; do + [[ -n "$parsed_version" ]] || continue + if [[ "$asset" == "openshell.rb" ]]; then + formula_asset="${workspace}/${asset}" + if ! fetch_file "$formula_url" "$formula_asset"; then + echo " STALE: unable to download ${source} ${asset}." + failures=$((failures + 1)) + continue + fi + if ! actual=$(sha256_file "$formula_asset"); then + echo " STALE: unable to hash ${source} ${asset}." + failures=$((failures + 1)) + continue + fi + if [[ "$actual" != "$formula_expected" ]]; then + echo " STALE: ${source} ${asset} does not match the base-trusted v${release_version} formula digest." + echo " trusted: ${formula_expected}" + echo " upstream: ${actual}" + failures=$((failures + 1)) + elif [[ "$pinned" == "$formula_expected" ]]; then + published_count=$((published_count + 1)) + echo " OK: ${source} ${asset} (${pinned})" + else + echo " STALE: ${source} ${asset} pin does not match the base-trusted v${release_version} formula digest." + echo " pinned: ${pinned}" + echo " trusted: ${formula_expected}" + failures=$((failures + 1)) + fi + continue + fi + matches=$(awk -v asset="$asset" '$2 == asset { count++ } END { print count + 0 }' "$manifests") + upstream=$(awk -v asset="$asset" '$2 == asset { print $1; exit }' "$manifests") + if [[ "$matches" -eq 1 && "$pinned" == "$upstream" ]]; then published_count=$((published_count + 1)) echo " OK: ${source} ${asset} (${pinned})" else - echo " STALE: ${source} ${asset} pin does not match the base-trusted v${release_version} formula digest." + echo " STALE: ${source} ${asset} does not match exactly one v${release_version} checksum entry." echo " pinned: ${pinned}" - echo " trusted: ${formula_expected}" + echo " upstream: ${upstream:-missing}" + echo " matches: ${matches}" failures=$((failures + 1)) fi - continue - fi - matches=$(awk -v asset="$asset" '$2 == asset { count++ } END { print count + 0 }' "$manifests") - upstream=$(awk -v asset="$asset" '$2 == asset { print $1; exit }' "$manifests") - if [[ "$matches" -eq 1 && "$pinned" == "$upstream" ]]; then - published_count=$((published_count + 1)) - echo " OK: ${source} ${asset} (${pinned})" - else - echo " STALE: ${source} ${asset} does not match exactly one v${release_version} checksum entry." - echo " pinned: ${pinned}" - echo " upstream: ${upstream:-missing}" - echo " matches: ${matches}" + done <<<"$version_pin_records" + + expected_published_count=$((count + brev_count)) + if [[ "$published_count" -ne "$expected_published_count" ]]; then + echo " STALE: expected all ${expected_published_count} pinned asset references for v${release_version}, matched ${published_count}." failures=$((failures + 1)) fi - done <<<"$pin_records" - - expected_published_count=$((count + brev_count)) - if [[ "$published_count" -ne "$expected_published_count" ]]; then - echo " STALE: expected all ${expected_published_count} pinned asset references for v${release_version}, matched ${published_count}." - failures=$((failures + 1)) - fi + done return "$failures" } diff --git a/scripts/checks/dependency-pins.mts b/scripts/checks/dependency-pins.mts index aa4bcab15d9..e4eae768d6b 100644 --- a/scripts/checks/dependency-pins.mts +++ b/scripts/checks/dependency-pins.mts @@ -7,6 +7,12 @@ import { fileURLToPath } from "node:url"; import { parse as parseYaml } from "yaml"; +import { + OPENSHELL_QUALIFICATION, + OPENSHELL_QUALIFICATION_INSTALL_ENV, + OPENSHELL_QUALIFICATION_SELECT_STEP, +} from "../../tools/e2e/openshell-qualification.mts"; + type OpenShellPins = Readonly<{ maxVersion: string; minVersion: string; @@ -38,10 +44,9 @@ const OPENSHELL_RELEASE_MANIFESTS = [ ] as const; function expectedOpenShellE2eVersion(pins: OpenShellPins): string { - // Qualify the accepted 0.0.106 migration against the exact trusted release - // before the supported product pin moves from 0.0.101. - return pins.minVersion === "0.0.101" && pins.maxVersion === "0.0.101" - ? "0.0.106" + return pins.minVersion === OPENSHELL_QUALIFICATION.supportedProductVersion && + pins.maxVersion === OPENSHELL_QUALIFICATION.supportedProductVersion + ? OPENSHELL_QUALIFICATION.version : pins.maxVersion; } @@ -123,6 +128,65 @@ function extractMappingString( return value; } +function verifyOpenShellE2eQualification( + workflow: Record, + pins: OpenShellPins, + failures: string[], +): void { + const label = ".github/workflows/e2e.yaml gateway auth OpenShell qualification"; + if (expectedOpenShellE2eVersion(pins) === pins.maxVersion) { + compare( + extractMappingString( + workflow, + ["jobs", "openshell-gateway-auth-contract", "env", "NEMOCLAW_OPENSHELL_PIN_VERSION"], + `${label} version`, + failures, + ), + pins.maxVersion, + `${label} version`, + failures, + ); + return; + } + + const jobs = workflow.jobs; + const job = isRecord(jobs) ? jobs["openshell-gateway-auth-contract"] : undefined; + const steps = isRecord(job) ? job.steps : undefined; + if (!Array.isArray(steps)) { + failures.push(`${label}: expected qualification workflow steps`); + return; + } + const select = steps.find( + (step) => isRecord(step) && step.name === OPENSHELL_QUALIFICATION_SELECT_STEP.name, + ); + const install = steps.find((step) => isRecord(step) && step.name === "Install OpenShell CLI"); + if (!isRecord(select)) { + failures.push(`${label}: expected the shared qualification selector`); + } else { + compare( + typeof select.id === "string" ? select.id : "", + OPENSHELL_QUALIFICATION_SELECT_STEP.id, + `${label} selector id`, + failures, + ); + compare( + typeof select.run === "string" ? select.run : "", + OPENSHELL_QUALIFICATION_SELECT_STEP.run, + `${label} selector command`, + failures, + ); + } + const installEnv = isRecord(install) && isRecord(install.env) ? install.env : {}; + compare( + typeof installEnv.NEMOCLAW_OPENSHELL_PIN_VERSION === "string" + ? installEnv.NEMOCLAW_OPENSHELL_PIN_VERSION + : "", + OPENSHELL_QUALIFICATION_INSTALL_ENV.NEMOCLAW_OPENSHELL_PIN_VERSION, + `${label} installer version input`, + failures, + ); +} + function openclawArgSuffix(version: string): string { return version.replace(OPENCLAW_VERSION_ARG_SUFFIX_RE, "_"); } @@ -396,17 +460,7 @@ function verifyOpenShellPins( "Brev launchable stable OpenShell default", failures, ); - compare( - extractMappingString( - sources.e2eWorkflow, - ["jobs", "openshell-gateway-auth-contract", "env", "NEMOCLAW_OPENSHELL_PIN_VERSION"], - ".github/workflows/e2e.yaml gateway auth OpenShell version", - failures, - ), - expectedOpenShellE2eVersion(pins), - ".github/workflows/e2e.yaml gateway auth OpenShell version", - failures, - ); + verifyOpenShellE2eQualification(sources.e2eWorkflow, pins, failures); compare( extractMappingString( sources.credentialBoundary, diff --git a/scripts/checks/extract-installer-pins.mts b/scripts/checks/extract-installer-pins.mts index 4c9af86efda..186428fe502 100644 --- a/scripts/checks/extract-installer-pins.mts +++ b/scripts/checks/extract-installer-pins.mts @@ -1136,16 +1136,11 @@ export function extractInstallerPins(source: string, options: ExtractOptions): I if (pins.length === 0) { fail(`${options.functionName} contains no versioned pins`); } - const releaseVersions = [...new Set(pins.map((pin) => pin.releaseVersion))].sort(); - if (releaseVersions.length !== 1) { - fail( - `${options.functionName} must contain exactly one release version, found ${releaseVersions.join(", ")}`, - ); - } - + const releaseVersions = [...new Set(pins.map((pin) => pin.releaseVersion))]; const duplicateAssets = pins - .map((pin) => pin.asset) - .filter((asset, index, assets) => assets.indexOf(asset) !== index); + .map((pin) => `${pin.releaseVersion}:${pin.asset}`) + .filter((asset, index, assets) => assets.indexOf(asset) !== index) + .map((asset) => (releaseVersions.length === 1 ? asset.slice(asset.indexOf(":") + 1) : asset)); if (duplicateAssets.length > 0) { fail( `${options.functionName} contains duplicate assets: ${[...new Set(duplicateAssets)].join(", ")}`, @@ -1212,16 +1207,30 @@ function runCli(): void { functionName: "openshell_cli_pinned_sha256", sourceLabel: "Brev launchable", }); - assertExactAssetSet(installerPins, EXPECTED_INSTALLER_ASSETS, "installer pin table"); + const installerReleaseVersions = [ + ...new Set(installerPins.map((pin) => pin.releaseVersion)), + ].sort(); + for (const version of installerReleaseVersions) { + assertExactAssetSet( + installerPins.filter((pin) => pin.releaseVersion === version), + EXPECTED_INSTALLER_ASSETS, + installerReleaseVersions.length === 1 + ? "installer pin table" + : `installer pin table for ${version}`, + ); + } assertExactAssetSet(brevPins, EXPECTED_BREV_ASSETS, "Brev pin table"); - const pins = [...installerPins, ...brevPins]; - const releaseVersions = [...new Set(pins.map((pin) => pin.releaseVersion))].sort(); - if (releaseVersions.length !== 1) { + const brevReleaseVersions = [...new Set(brevPins.map((pin) => pin.releaseVersion))].sort(); + if (brevReleaseVersions.length !== 1) { fail( - `installer and Brev launchable pin tables must use the same release version, found ${releaseVersions.join(", ")}`, + `Brev launchable pin table must contain exactly one release version, found ${brevReleaseVersions.join(", ")}`, ); } - const releaseVersion = releaseVersions[0] ?? fail("installer pin tables contain no release"); + const releaseVersion = brevReleaseVersions[0] ?? fail("Brev pin table contains no release"); + if (!installerReleaseVersions.includes(releaseVersion)) { + fail(`installer pin table has no assets for selected release ${releaseVersion}`); + } + const pins = [...installerPins, ...brevPins]; const sandboxBuildPins = extractSandboxBuildPins(installerSource); assertTrustedSandboxBuildPins(sandboxBuildPins, releaseVersion); const supervisorManifestPins = extractSupervisorManifestPins(supervisorRuntimeSource); diff --git a/scripts/install-openshell.sh b/scripts/install-openshell.sh index d1f2b5332eb..6dcbc23271c 100755 --- a/scripts/install-openshell.sh +++ b/scripts/install-openshell.sh @@ -254,6 +254,33 @@ openshell_pinned_sha256() { v0.0.101:openshell.rb) printf '%s\n' "87fadc7b0c854aa44f71d5b3a206865070117cd27825d59c61da252a99f402a2" ;; + v0.0.106:openshell-x86_64-unknown-linux-musl.tar.gz) + printf '%s\n' "d1a885a91b3e5aaa006c36aca95dc78bed0638c1ba1a79b55f1da93211b8a0a0" + ;; + v0.0.106:openshell-aarch64-unknown-linux-musl.tar.gz) + printf '%s\n' "ce981904ae8febd9cd6b3fbceb04e1dcfb48da6042bac08eadf0c2211f83fe55" + ;; + v0.0.106:openshell-aarch64-apple-darwin.tar.gz) + printf '%s\n' "969493205e3d3462226ff613eaba0b9cde0f582e3026294169d533d41e87c905" + ;; + v0.0.106:openshell-gateway-x86_64-unknown-linux-gnu.tar.gz) + printf '%s\n' "b7760cb752a4363c2f21d32298dd0c683dc438f6edfd16c2e4242bc0baefbb7c" + ;; + v0.0.106:openshell-gateway-aarch64-unknown-linux-gnu.tar.gz) + printf '%s\n' "22b7781249e3487085694d0f0f3797a0e549018b81144cd24b2f1118c730d1c7" + ;; + v0.0.106:openshell-gateway-aarch64-apple-darwin.tar.gz) + printf '%s\n' "de8f90db9dd0d3b47855b2b6d2542660730917bd1249e53140300990a8690b94" + ;; + v0.0.106:openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz) + printf '%s\n' "559b8aaad3a8eeab45c511e7de531d9baa98a311282dcb0c2c5f38cc2d4ca355" + ;; + v0.0.106:openshell-sandbox-aarch64-unknown-linux-gnu.tar.gz) + printf '%s\n' "5e5d758d53c6abc6d7a936be907dafa9dfce10423289536f39b50abe294dfafd" + ;; + v0.0.106:openshell.rb) + printf '%s\n' "f0f86519e227b3b326431410058ba690b1a7b83e5af7384014e4b96283d3a642" + ;; *) return 1 ;; @@ -385,6 +412,11 @@ pinned_sandbox_build_version() { 88300e35f153123e4dc3021c537834dd6c0a09665a4a6d3974cd285d512345c4) printf '%s\n' "0.0.101" ;; + # OpenShell v0.0.106 standalone sandbox binaries. + 0031c6b257a23ecc1a2333153918324f3af0005e68abde388858d682ec646c55 | \ + 019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8) + printf '%s\n' "0.0.106" + ;; *) return 1 ;; diff --git a/test/dependency-pins-check.test.ts b/test/dependency-pins-check.test.ts index ec2ee2e16e6..171c27e59f9 100644 --- a/test/dependency-pins-check.test.ts +++ b/test/dependency-pins-check.test.ts @@ -27,6 +27,9 @@ const OPENSHELL_RELEASE_MANIFESTS = [ type FixtureOverrides = Partial>; +const QUALIFICATION_SELECT_RUN = + 'node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts select "$GITHUB_OUTPUT"'; + function openclawSelector(version: string, argVersion: string = version): string { const arg = `OPENCLAW_${argVersion.replace(/[.-]/g, "_")}`; return ( @@ -59,6 +62,25 @@ function writeFixture(root: string, overrides: FixtureOverrides = {}): void { ).map((manifest) => ` "${version}|${manifest}|${MANIFEST_SHA256}"`), ) .join("\n"); + const e2eWorkflow = + openshellMin === "0.0.101" && openshellMax === "0.0.101" + ? ` +jobs: + openshell-gateway-auth-contract: + steps: + - id: openshell_qualification + name: Select OpenShell qualification release + run: ${overrides.workflowSelectRun ?? QUALIFICATION_SELECT_RUN} + - name: Install OpenShell CLI + env: + NEMOCLAW_OPENSHELL_PIN_VERSION: \${{ steps.openshell_qualification.outputs.version }} +` + : ` +jobs: + openshell-gateway-auth-contract: + env: + NEMOCLAW_OPENSHELL_PIN_VERSION: "${overrides.workflowPinVersion ?? openshellMax}" +`; const files: Record = { "nemoclaw-blueprint/blueprint.yaml": ` @@ -80,12 +102,7 @@ case "$NEMOCLAW_REF" in stable | auto) OPENSHELL_VERSION="v${overrides.brevVersion ?? openshellMax}" ;; esac `, - ".github/workflows/e2e.yaml": ` -jobs: - openshell-gateway-auth-contract: - env: - NEMOCLAW_OPENSHELL_PIN_VERSION: "${overrides.workflowPinVersion ?? openshellMax}" -`, + ".github/workflows/e2e.yaml": e2eWorkflow, [`src/lib/actions/sandbox/${credentialManifestName}`]: JSON.stringify({ openshellCommit: "f".repeat(40), openshellVersion: credentialVersion, @@ -212,7 +229,6 @@ describe("dependency pin drift check", () => { { openshellMax: "0.0.101", openshellMin: "0.0.101", - workflowPinVersion: "0.0.106", }, (root) => expect(verifyDependencyPins(root)).toEqual([]), ); @@ -226,11 +242,11 @@ describe("dependency pin drift check", () => { { openshellMax: "0.0.101", openshellMin: "0.0.101", - workflowPinVersion, + workflowSelectRun: `echo version=${workflowPinVersion}`, }, (root) => expect(verifyDependencyPins(root)).toContain( - `.github/workflows/e2e.yaml gateway auth OpenShell version: expected 0.0.106, found ${workflowPinVersion}`, + `.github/workflows/e2e.yaml gateway auth OpenShell qualification selector command: expected ${QUALIFICATION_SELECT_RUN}, found echo version=${workflowPinVersion}`, ), ); }, @@ -275,7 +291,7 @@ describe("dependency pin drift check", () => { "OpenShell supervisor manifest digest map: expected a reference to 1.2.4", "OpenShell sandbox build version map: expected a reference to 1.2.4", "Brev launchable stable OpenShell default: expected 1.2.4, found 1.2.3", - ".github/workflows/e2e.yaml gateway auth OpenShell version: expected 1.2.4, found 1.2.3", + ".github/workflows/e2e.yaml gateway auth OpenShell qualification version: expected 1.2.4, found 1.2.3", "OpenShell credential-boundary manifest version: expected 1.2.4, found 1.2.3", "OpenShell credential-boundary import: expected 1.2.4, found 1.2.3", "Hermes Dockerfile credential-boundary manifest version: expected 1.2.4, found 1.2.3", diff --git a/test/e2e/support/e2e-workflow.test.ts b/test/e2e/support/e2e-workflow.test.ts index 040c95cc2f8..15af79239b6 100644 --- a/test/e2e/support/e2e-workflow.test.ts +++ b/test/e2e/support/e2e-workflow.test.ts @@ -508,10 +508,10 @@ describe("e2e workflow boundary", () => { ).toEqual(["snapshot-commands"]); }); - it("routes the OpenShell 0.0.106 qualification installer to all five consumers", () => { + it("routes the OpenShell qualification identity to all five consumers", () => { const plan = buildE2eWorkflowPlan( {}, - { changedFiles: ["tools/e2e/install-openshell-v00106-qualification.sh"] }, + { changedFiles: ["tools/e2e/openshell-qualification.mts"] }, ); expect([...plan.selectedJobs].sort()).toEqual( diff --git a/test/e2e/support/mcp-workflow-boundary.test.ts b/test/e2e/support/mcp-workflow-boundary.test.ts index 1c085027ccf..a7a178432ba 100644 --- a/test/e2e/support/mcp-workflow-boundary.test.ts +++ b/test/e2e/support/mcp-workflow-boundary.test.ts @@ -15,12 +15,12 @@ describe("MCP workflow artifact boundary", () => { it.each([ { expected: - "mcp-bridge must run only the exact OpenShell 0.0.106 qualification install and provenance step", + "mcp-bridge must run only the exact OpenShell 0.0.106 qualification install", jobName: "mcp-bridge", }, { expected: - "openshell-credential-generation-window must run only the exact OpenShell 0.0.106 qualification install and provenance step", + "openshell-credential-generation-window must run only the exact OpenShell 0.0.106 qualification install", jobName: "openshell-credential-generation-window", }, ])("rejects a product reinstall after the exact $jobName qualification install", ({ diff --git a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts index 493eb2965be..aca40377647 100644 --- a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts +++ b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts @@ -1,8 +1,9 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -import { execFileSync } from "node:child_process"; -import { readFileSync } from "node:fs"; +import fs from "node:fs"; +import os from "node:os"; +import path from "node:path"; import { describe, expect, it } from "vitest"; @@ -11,37 +12,39 @@ import { validateOpenShellGatewayAuthContractWorkflow, validateOpenShellGatewayAuthContractWorkflowBoundary, } from "../../../tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts"; - -const QUALIFICATION_INSTALLER_IDENTITIES = [ - "openshell-x86_64-unknown-linux-musl.tar.gz", - "d1a885a91b3e5aaa006c36aca95dc78bed0638c1ba1a79b55f1da93211b8a0a0", - "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59", - "openshell-gateway-x86_64-unknown-linux-gnu.tar.gz", - "b7760cb752a4363c2f21d32298dd0c683dc438f6edfd16c2e4242bc0baefbb7c", - "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c", - "openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz", - "559b8aaad3a8eeab45c511e7de531d9baa98a311282dcb0c2c5f38cc2d4ca355", - "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8", -] as const; - -function expectSingleInstallerIdentities(source: string): void { - for (const identity of QUALIFICATION_INSTALLER_IDENTITIES) { - expect(source.match(new RegExp(identity.replaceAll(".", "\\."), "gu"))).toHaveLength(1); - } -} +import { + OPENSHELL_QUALIFICATION, + validateOpenShellQualificationInstaller, + writeOpenShellQualificationOutputs, + writeOpenShellQualificationProvenance, +} from "../../../tools/e2e/openshell-qualification.mts"; describe("OpenShell gateway auth contract workflow boundary", () => { - it("binds the qualification installer to one coherent OpenShell 0.0.106 release", () => { - const installerPath = "tools/e2e/install-openshell-v00106-qualification.sh"; - const source = readFileSync(installerPath, "utf8"); - - expect(source).toContain('readonly release_tag="v0.0.106"'); - expect(source).not.toMatch(/v0\.0\.(?:101|105|107)/u); - expectSingleInstallerIdentities(source); - expect(source).toContain('printf \'%s %s\\n\' "${archive_sha256[$index]}" "$archive" | sha256sum -c -'); - expect(source).toContain('printf \'%s %s\\n\' "${binary_sha256[$index]}" "${extracted}/${member}" | sha256sum -c -'); - expect(source).toContain('printf \'%s %s\\n\' "${binary_sha256[$index]}" "${target_dir}/${member}" | sha256sum -c -'); - execFileSync("bash", ["-n", installerPath]); + it("selects and records one coherent OpenShell 0.0.106 qualification release", () => { + const directory = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-openshell-qualification-")); + const outputsPath = path.join(directory, "outputs"); + const provenancePath = path.join(directory, "provenance.json"); + try { + expect(validateOpenShellQualificationInstaller()).toEqual([]); + + writeOpenShellQualificationOutputs(outputsPath); + expect(fs.readFileSync(outputsPath, "utf8")).toBe( + `version=${OPENSHELL_QUALIFICATION.version}\n` + + `supervisor_image=${OPENSHELL_QUALIFICATION.supervisor.image}@${OPENSHELL_QUALIFICATION.supervisor.manifestDigest}\n`, + ); + + writeOpenShellQualificationProvenance(provenancePath); + const provenance = JSON.parse(fs.readFileSync(provenancePath, "utf8")) as { + releaseTag: string; + sourceSha: string; + }; + expect(provenance).toMatchObject({ + releaseTag: OPENSHELL_QUALIFICATION.releaseTag, + sourceSha: OPENSHELL_QUALIFICATION.sourceSha, + }); + } finally { + fs.rmSync(directory, { force: true, recursive: true }); + } }); it("accepts the checked-in workflow and rejects protected trust-boundary mutations", () => { @@ -69,6 +72,12 @@ describe("OpenShell gateway auth contract workflow boundary", () => { const prepare = steps.find((step) => step.name === "Prepare E2E workspace")!; prepare.uses = "./.github/actions/prepare-e2e"; + const select = steps.find( + (step) => step.name === "Select OpenShell qualification release", + )!; + select.id = "unreviewed_release"; + select.run = "true"; + const install = steps.find((step) => step.name === "Install OpenShell CLI")!; install.run = "bash scripts/install-openshell.sh"; @@ -106,12 +115,13 @@ describe("OpenShell gateway auth contract workflow boundary", () => { "openshell-gateway-auth-contract must retain its 20 minute resource budget", "openshell-gateway-auth-contract must set DOCKER_GRPC_PROBE_IMAGE=node:22-trixie-slim@sha256:db8a96a63e5264607ada2d206758876ebbed6a12be2ada7517793cbfb0c2a29c", "openshell-gateway-auth-contract must set E2E_ARTIFACT_DIR=${{ github.workspace }}/e2e-artifacts/live/openshell-gateway-auth-contract", - "openshell-gateway-auth-contract must set NEMOCLAW_CANDIDATE_VERSION=0.0.106", - "openshell-gateway-auth-contract must set NEMOCLAW_OPENSHELL_PIN_VERSION=0.0.106", + "openshell-gateway-auth-contract must load NEMOCLAW_CANDIDATE_VERSION from the qualification identity", + "openshell-gateway-auth-contract must load NEMOCLAW_OPENSHELL_PIN_VERSION from the qualification identity", "openshell-gateway-auth-contract must not expose NVIDIA_API_KEY at job scope", "openshell-gateway-auth-contract action 'actions/checkout@v6' must pin a full SHA", "openshell-gateway-auth-contract checkout must disable persisted credentials", "openshell-gateway-auth-contract must use the reviewed prepare-e2e action", + "openshell-gateway-auth-contract must select the declarative OpenShell qualification identity", "openshell-gateway-auth-contract must run only the exact credential-free OpenShell 0.0.106 install", "openshell-gateway-auth-contract step 'Pre-pull pinned gateway auth probe image' must run: docker pull \"$DOCKER_GRPC_PROBE_IMAGE\"", "openshell-gateway-auth-contract live test must not receive workflow credentials", diff --git a/test/installer-hash-check.test.ts b/test/installer-hash-check.test.ts index e7d1f6d3672..945d78d8408 100644 --- a/test/installer-hash-check.test.ts +++ b/test/installer-hash-check.test.ts @@ -1185,11 +1185,11 @@ describe("installer hash verification", () => { ], [ "multiple-installer-versions", - "openshell_pinned_sha256 must contain exactly one release version, found 0.0.72, 0.0.73", + `installer pin table for 0.0.72 must contain the exact consumed asset set; missing=[${ASSETS[0]}]`, ], [ "mismatched-table-versions", - "installer and Brev launchable pin tables must use the same release version, found 0.0.72, 0.0.73", + "installer pin table has no assets for selected release 0.0.73", ], ] as const)("fails closed for %s", (mode, diagnostic) => { const result = runFixture(mode, undefined, true); diff --git a/tools/e2e/install-openshell-v00106-qualification.sh b/tools/e2e/install-openshell-v00106-qualification.sh deleted file mode 100755 index a06ce2e65a9..00000000000 --- a/tools/e2e/install-openshell-v00106-qualification.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -# Install the exact OpenShell v0.0.106 Linux x86_64 release for the bounded -# qualification jobs that run before NemoClaw changes its supported 0.0.101 pin. - -set -euo pipefail - -fail() { - printf 'OpenShell v0.0.106 qualification install failed: %s\n' "$1" >&2 - exit 1 -} - -[[ "$(uname -s)" == "Linux" ]] || fail "Linux is required" -case "$(uname -m)" in - x86_64 | amd64) ;; - *) fail "x86_64 is required" ;; -esac - -for command_name in curl install mktemp sha256sum tar; do - command -v "$command_name" >/dev/null 2>&1 || fail "$command_name is required" -done - -readonly release_tag="v0.0.106" -readonly release_base="https://github.com/NVIDIA/OpenShell/releases/download/${release_tag}" -readonly target_dir="/usr/local/bin" -readonly -a assets=( - "openshell-x86_64-unknown-linux-musl.tar.gz" - "openshell-gateway-x86_64-unknown-linux-gnu.tar.gz" - "openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz" -) -readonly -a members=("openshell" "openshell-gateway" "openshell-sandbox") -readonly -a archive_sha256=( - "d1a885a91b3e5aaa006c36aca95dc78bed0638c1ba1a79b55f1da93211b8a0a0" - "b7760cb752a4363c2f21d32298dd0c683dc438f6edfd16c2e4242bc0baefbb7c" - "559b8aaad3a8eeab45c511e7de531d9baa98a311282dcb0c2c5f38cc2d4ca355" -) -readonly -a binary_sha256=( - "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59" - "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c" - "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8" -) - -workspace="$(mktemp -d)" -trap 'rm -rf "$workspace"' EXIT - -for index in "${!assets[@]}"; do - asset="${assets[$index]}" - member="${members[$index]}" - archive="${workspace}/${asset}" - extracted="${workspace}/extracted-${index}" - mkdir -p "$extracted" - - curl --proto '=https' --tlsv1.2 -fsSL \ - --connect-timeout 10 --max-time 120 --retry 3 --retry-all-errors \ - "${release_base}/${asset}" -o "$archive" - printf '%s %s\n' "${archive_sha256[$index]}" "$archive" | sha256sum -c - - - members_found="$(LC_ALL=C tar -tzf "$archive")" - [[ "$members_found" == "$member" ]] \ - || fail "$asset must contain exactly one member named $member" - member_detail="$(LC_ALL=C tar -tvzf "$archive")" - [[ "$member_detail" != *$'\n'* && "${member_detail:0:1}" == "-" && "${member_detail##* }" == "$member" ]] \ - || fail "$asset member $member must be one regular file" - - tar -xzf "$archive" -C "$extracted" - printf '%s %s\n' "${binary_sha256[$index]}" "${extracted}/${member}" | sha256sum -c - -done - -install_command=(install -m 755) -if [[ ! -w "$target_dir" ]]; then - command -v sudo >/dev/null 2>&1 || fail "sudo is required to write $target_dir" - install_command=(sudo install -m 755) -fi - -for index in "${!members[@]}"; do - member="${members[$index]}" - "${install_command[@]}" "${workspace}/extracted-${index}/${member}" "${target_dir}/${member}" - printf '%s %s\n' "${binary_sha256[$index]}" "${target_dir}/${member}" | sha256sum -c - -done - -"${target_dir}/openshell" --version | grep -Eq '(^|[^0-9])0\.0\.106([^0-9]|$)' \ - || fail "installed OpenShell CLI does not report 0.0.106" diff --git a/tools/e2e/mcp-workflow-boundary.mts b/tools/e2e/mcp-workflow-boundary.mts index f4e301f97b3..fbeaddc8339 100644 --- a/tools/e2e/mcp-workflow-boundary.mts +++ b/tools/e2e/mcp-workflow-boundary.mts @@ -4,6 +4,13 @@ import fs from "node:fs"; import YAML from "yaml"; +import { + openShellQualificationProvenanceCommand, + OPENSHELL_QUALIFICATION_INSTALL_ENV, + OPENSHELL_QUALIFICATION_INSTALL_RUN, + OPENSHELL_QUALIFICATION_SELECT_STEP, + OPENSHELL_QUALIFICATION_SUPERVISOR_OUTPUT, +} from "./openshell-qualification.mts"; import { OPENSHELL_DEV_ARTIFACT_DIRECTORY, OPENSHELL_DEV_ARTIFACT_UPLOAD_NAME, @@ -72,53 +79,13 @@ const CREDENTIAL_WINDOW_ARTIFACT_DIR = "e2e-artifacts/live/openshell-credential- const CREDENTIAL_WINDOW_RUN_STEP = "Run OpenShell credential generation-window live test"; const CREDENTIAL_WINDOW_JOB_CONDITION = "${{ contains(fromJSON(needs.generate-matrix.outputs.selected_jobs), 'openshell-credential-generation-window') }}"; -const STABLE_QUALIFICATION_INSTALLER = - "tools/e2e/install-openshell-v00106-qualification.sh"; -const STABLE_RELEASE_SOURCE_SHA = "c4b500a7de64d0b66e3ee8098f58d14299092162"; -const STABLE_RELEASE_SUPERVISOR_INDEX = - "722f44669722961b7f432b0b81de25b91a58f34a61d6403bef967acaf2b3af01"; -const STABLE_RELEASE_CLI_SHA256 = - "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59"; -const STABLE_RELEASE_GATEWAY_SHA256 = - "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c"; -const STABLE_RELEASE_SANDBOX_SHA256 = - "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8"; -const MCP_STABLE_INSTALL_RUN = [ - "set -euo pipefail", - `bash ${STABLE_QUALIFICATION_INSTALLER}`, - 'if [[ "$NEMOCLAW_MCP_BRIDGE_AGENT" == "deepagents" ]]; then', - ' mkdir -p "$E2E_ARTIFACT_DIR/mcp-bridge-deepagents"', - " jq -n '{", - " schemaVersion: 1,", - ' sourceRepository: "NVIDIA/OpenShell",', - ' releaseTag: "v0.0.106",', - ` sourceSha: "${STABLE_RELEASE_SOURCE_SHA}",`, - " artifacts: {", - ` cli: {binarySha256: "${STABLE_RELEASE_CLI_SHA256}"},`, - ` gateway: {binarySha256: "${STABLE_RELEASE_GATEWAY_SHA256}"},`, - ` standaloneSandbox: {binarySha256: "${STABLE_RELEASE_SANDBOX_SHA256}"}`, - " }", - " }' > \"$E2E_ARTIFACT_DIR/mcp-bridge-deepagents/openshell-exact-main-provenance.json\"", - "fi", - "", -].join("\n"); -const CREDENTIAL_WINDOW_INSTALL_RUN = [ - "set -euo pipefail", - `bash ${STABLE_QUALIFICATION_INSTALLER}`, - 'mkdir -p "$E2E_ARTIFACT_DIR/openshell-credential-generation-window"', - "jq -n '{", - " schemaVersion: 1,", - ' sourceRepository: "NVIDIA/OpenShell",', - ' releaseTag: "v0.0.106",', - ` sourceSha: "${STABLE_RELEASE_SOURCE_SHA}",`, - " artifacts: {", - ` cli: {binarySha256: "${STABLE_RELEASE_CLI_SHA256}"},`, - ` gateway: {binarySha256: "${STABLE_RELEASE_GATEWAY_SHA256}"},`, - ` standaloneSandbox: {binarySha256: "${STABLE_RELEASE_SANDBOX_SHA256}"}`, - " }", - "}' > \"$E2E_ARTIFACT_DIR/openshell-credential-generation-window/openshell-exact-main-provenance.json\"", - "", -].join("\n"); +const QUALIFICATION_PROVENANCE_STEP = "Write OpenShell provenance"; +const MCP_QUALIFICATION_PROVENANCE_RUN = openShellQualificationProvenanceCommand( + "$E2E_ARTIFACT_DIR/mcp-bridge-deepagents/openshell-exact-main-provenance.json", +); +const CREDENTIAL_WINDOW_PROVENANCE_RUN = openShellQualificationProvenanceCommand( + "$E2E_ARTIFACT_DIR/openshell-credential-generation-window/openshell-exact-main-provenance.json", +); const DEV_COMPATIBILITY_RUN = [ "set -euo pipefail", 'export PATH="$HOME/.local/bin:$HOME/.npm-global/bin:$PATH"', @@ -267,12 +234,9 @@ function validateJobIdentity( "1", "mcp-bridge must enable the exact stable release proof", ); - requireEqual( - errors, - env.OPENSHELL_DOCKER_SUPERVISOR_IMAGE, - `ghcr.io/nvidia/openshell/supervisor@sha256:${STABLE_RELEASE_SUPERVISOR_INDEX}`, - "mcp-bridge must pin the reviewed stable supervisor image", - ); + if (Object.hasOwn(env, "OPENSHELL_DOCKER_SUPERVISOR_IMAGE")) { + errors.push("mcp-bridge must load the supervisor image from the qualification identity"); + } if (Object.hasOwn(env, "E2E_DEFAULT_ENABLED")) { errors.push("mcp-bridge must remain default-enabled"); } @@ -431,6 +395,8 @@ function validateJobExecution( : "Install OpenShell CLI", ); const run = namedStep(job, "Run MCP OpenShell provider live test"); + const select = namedStep(job, OPENSHELL_QUALIFICATION_SELECT_STEP.name); + const provenance = namedStep(job, QUALIFICATION_PROVENANCE_STEP); const compatibility = namedStep(job, DEV_COMPATIBILITY_STEP_NAME); const compatibilitySteps = steps.filter((step) => asString(step.run).includes(DEV_COMPATIBILITY_TOOL), @@ -507,18 +473,45 @@ function validateJobExecution( ); } } else { - if (Object.keys(installEnv).length !== 0) { - errors.push("mcp-bridge stable qualification installer must not receive overrides"); - } if (Object.hasOwn(installEnv, "NEMOCLAW_ACCEPT_DEV_UNVERIFIED_INSTALL")) { errors.push("mcp-bridge stable installer must not authorize unverified dev artifacts"); } + if ( + select.id !== OPENSHELL_QUALIFICATION_SELECT_STEP.id || + select.run !== OPENSHELL_QUALIFICATION_SELECT_STEP.run + ) { + errors.push("mcp-bridge must select the declarative OpenShell qualification identity"); + } + if (!hasExactEntries(installEnv, OPENSHELL_QUALIFICATION_INSTALL_ENV)) { + errors.push("mcp-bridge stable installer must receive only the selected release version"); + } requireEqual( errors, install.run, - MCP_STABLE_INSTALL_RUN, - `${jobName} must run only the exact OpenShell 0.0.106 qualification install and provenance step`, + OPENSHELL_QUALIFICATION_INSTALL_RUN, + `${jobName} must run only the exact OpenShell 0.0.106 qualification install`, ); + if ( + provenance.if !== "${{ matrix.agent == 'deepagents' }}" || + provenance.run !== MCP_QUALIFICATION_PROVENANCE_RUN + ) { + errors.push("mcp-bridge must write Deep Agents provenance from the qualification identity"); + } + if ( + !hasExactEntries(asRecord(run.env), { + OPENSHELL_DOCKER_SUPERVISOR_IMAGE: OPENSHELL_QUALIFICATION_SUPERVISOR_OUTPUT, + }) + ) { + errors.push("mcp-bridge must select the supervisor image from the qualification identity"); + } + if ( + steps.indexOf(select) <= steps.indexOf(tls) || + steps.indexOf(install) <= steps.indexOf(select) || + steps.indexOf(provenance) <= steps.indexOf(install) || + steps.indexOf(run) <= steps.indexOf(provenance) + ) { + errors.push("mcp-bridge must select, install, record, and run one qualification release"); + } } if (jobName === "mcp-bridge-dev") { const trustedCheckout = namedStep(job, DEV_ARTIFACT_TRUSTED_CHECKOUT_NAME); @@ -916,7 +909,6 @@ function validateCredentialWindowJob( NEMOCLAW_OPENSHELL_CHANNEL: "stable", NEMOCLAW_OPENSHELL_EXACT_MAIN_PROOF: "1", NEMOCLAW_RUN_LIVE_E2E: "1", - OPENSHELL_DOCKER_SUPERVISOR_IMAGE: `ghcr.io/nvidia/openshell/supervisor@sha256:${STABLE_RELEASE_SUPERVISOR_INDEX}`, }; if (!hasExactEntries(env, expectedEnv)) { errors.push(`${CREDENTIAL_WINDOW_JOB} must use only its reviewed exact-stable environment`); @@ -927,7 +919,9 @@ function validateCredentialWindowJob( const prepare = namedStep(job, "Prepare E2E workspace"); const cloudflared = namedStep(job, "Install and verify cloudflared prerequisite"); const tls = namedStep(job, "Generate MCP test TLS"); + const select = namedStep(job, OPENSHELL_QUALIFICATION_SELECT_STEP.name); const install = namedStep(job, "Install OpenShell CLI"); + const provenance = namedStep(job, QUALIFICATION_PROVENANCE_STEP); const run = namedStep(job, CREDENTIAL_WINDOW_RUN_STEP); const scan = namedStep(job, "Scan credential-window artifacts for fixture credentials"); const upload = namedStep(job, "Upload credential-window artifacts"); @@ -976,15 +970,48 @@ function validateCredentialWindowJob( "bash test/e2e/setup-mcp-test-tls.sh", `${CREDENTIAL_WINDOW_JOB} must generate its HTTPS fixture before installation`, ); - if (Object.keys(asRecord(install.env)).length !== 0) { - errors.push(`${CREDENTIAL_WINDOW_JOB} qualification installer must not receive overrides`); + if ( + select.id !== OPENSHELL_QUALIFICATION_SELECT_STEP.id || + select.run !== OPENSHELL_QUALIFICATION_SELECT_STEP.run + ) { + errors.push( + `${CREDENTIAL_WINDOW_JOB} must select the declarative OpenShell qualification identity`, + ); + } + if (!hasExactEntries(asRecord(install.env), OPENSHELL_QUALIFICATION_INSTALL_ENV)) { + errors.push(`${CREDENTIAL_WINDOW_JOB} installer must receive only the selected release version`); } requireEqual( errors, install.run, - CREDENTIAL_WINDOW_INSTALL_RUN, - `${CREDENTIAL_WINDOW_JOB} must run only the exact OpenShell 0.0.106 qualification install and provenance step`, + OPENSHELL_QUALIFICATION_INSTALL_RUN, + `${CREDENTIAL_WINDOW_JOB} must run only the exact OpenShell 0.0.106 qualification install`, + ); + requireEqual( + errors, + provenance.run, + CREDENTIAL_WINDOW_PROVENANCE_RUN, + `${CREDENTIAL_WINDOW_JOB} must write provenance from the qualification identity`, ); + if ( + !hasExactEntries(asRecord(run.env), { + OPENSHELL_DOCKER_SUPERVISOR_IMAGE: OPENSHELL_QUALIFICATION_SUPERVISOR_OUTPUT, + }) + ) { + errors.push( + `${CREDENTIAL_WINDOW_JOB} must select the supervisor image from the qualification identity`, + ); + } + if ( + steps.indexOf(select) <= steps.indexOf(tls) || + steps.indexOf(install) <= steps.indexOf(select) || + steps.indexOf(provenance) <= steps.indexOf(install) || + steps.indexOf(run) <= steps.indexOf(provenance) + ) { + errors.push( + `${CREDENTIAL_WINDOW_JOB} must select, install, record, and run one qualification release`, + ); + } for (const required of [ CREDENTIAL_WINDOW_FILE, diff --git a/tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts b/tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts index 6c1f486ea3d..4b6a7e24034 100644 --- a/tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts +++ b/tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts @@ -6,17 +6,17 @@ import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; import YAML from "yaml"; +import { + OPENSHELL_QUALIFICATION_INSTALL_ENV, + OPENSHELL_QUALIFICATION_INSTALL_RUN, + OPENSHELL_QUALIFICATION_SELECT_STEP, +} from "./openshell-qualification.mts"; import { PREPARE_E2E_ACTION } from "./prepare-e2e-workflow-boundary.mts"; import { UPLOAD_E2E_ARTIFACTS_ACTION } from "./upload-e2e-artifacts-workflow-boundary.mts"; const REPO_ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", ".."); const DEFAULT_WORKFLOW_PATH = join(REPO_ROOT, ".github", "workflows", "e2e.yaml"); const JOB_NAME = "openshell-gateway-auth-contract"; -const OPENSHELL_RELEASE_VERSION = "0.0.106"; -const OPENSHELL_QUALIFICATION_INSTALLER = - "tools/e2e/install-openshell-v00106-qualification.sh"; -const OPENSHELL_QUALIFICATION_INSTALL_RUN = - `env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash ${OPENSHELL_QUALIFICATION_INSTALLER}`; const FULL_SHA_ACTION = /^[^\s@]+@[0-9a-f]{40}$/u; const TRUSTED_PLAN_CONDITION = `\${{ contains(fromJSON(needs.generate-matrix.outputs.selected_jobs), '${JOB_NAME}') }}`; const GATEWAY_PROBE_IMAGE = @@ -60,6 +60,13 @@ function findStep(job: WorkflowJob, name: string): WorkflowStep { return job.steps?.find((step) => step.name === name) ?? {}; } +function hasExactEntries( + actual: Record | undefined, + expected: Readonly>, +): boolean { + return JSON.stringify(actual ?? {}) === JSON.stringify(expected); +} + function requireRunContains(errors: string[], step: WorkflowStep, fragment: string): void { if (!step.run?.includes(fragment)) { errors.push(`${JOB_NAME} step '${step.name ?? ""}' must run: ${fragment}`); @@ -103,18 +110,16 @@ export function validateOpenShellGatewayAuthContractWorkflow( const expectedEnv = { DOCKER_GRPC_PROBE_IMAGE: GATEWAY_PROBE_IMAGE, E2E_ARTIFACT_DIR: "${{ github.workspace }}/e2e-artifacts/live/openshell-gateway-auth-contract", - NEMOCLAW_CANDIDATE_VERSION: OPENSHELL_RELEASE_VERSION, NEMOCLAW_NON_INTERACTIVE: "1", NEMOCLAW_RUN_LIVE_E2E: "1", }; for (const [name, value] of Object.entries(expectedEnv)) { if (env[name] !== value) errors.push(`${JOB_NAME} must set ${name}=${value}`); } - const pinVersion = env.NEMOCLAW_OPENSHELL_PIN_VERSION; - if (pinVersion !== OPENSHELL_RELEASE_VERSION) { - errors.push( - `${JOB_NAME} must set NEMOCLAW_OPENSHELL_PIN_VERSION=${OPENSHELL_RELEASE_VERSION}`, - ); + for (const name of ["NEMOCLAW_CANDIDATE_VERSION", "NEMOCLAW_OPENSHELL_PIN_VERSION"]) { + if (Object.hasOwn(env, name)) { + errors.push(`${JOB_NAME} must load ${name} from the qualification identity`); + } } for (const secret of [ "DOCKERHUB_USERNAME", @@ -143,10 +148,27 @@ export function validateOpenShellGatewayAuthContractWorkflow( errors.push(`${JOB_NAME} must use the reviewed prepare-e2e action`); } + const select = findStep(job, OPENSHELL_QUALIFICATION_SELECT_STEP.name); + if ( + select.id !== OPENSHELL_QUALIFICATION_SELECT_STEP.id || + select.run !== OPENSHELL_QUALIFICATION_SELECT_STEP.run + ) { + errors.push(`${JOB_NAME} must select the declarative OpenShell qualification identity`); + } + const install = findStep(job, "Install OpenShell CLI"); - if (install.run !== OPENSHELL_QUALIFICATION_INSTALL_RUN) { + if ( + !hasExactEntries(install.env, OPENSHELL_QUALIFICATION_INSTALL_ENV) || + install.run !== OPENSHELL_QUALIFICATION_INSTALL_RUN + ) { errors.push(`${JOB_NAME} must run only the exact credential-free OpenShell 0.0.106 install`); } + requireStepOrder( + errors, + steps, + OPENSHELL_QUALIFICATION_SELECT_STEP.name, + "Install OpenShell CLI", + ); const prePull = findStep(job, "Pre-pull pinned gateway auth probe image"); requireRunContains(errors, prePull, 'docker pull "$DOCKER_GRPC_PROBE_IMAGE"'); @@ -155,7 +177,13 @@ export function validateOpenShellGatewayAuthContractWorkflow( const run = findStep(job, runName); requireRunContains(errors, run, "tools/e2e/live-vitest-invocation.mts run --test-path"); requireRunContains(errors, run, "test/e2e/live/openshell-gateway-auth-source-contract.test.ts"); - if (Object.keys(run.env ?? {}).length > 0 || JSON.stringify(run).includes("secrets.")) { + if ( + !hasExactEntries(run.env, { + NEMOCLAW_CANDIDATE_VERSION: "${{ steps.openshell_qualification.outputs.version }}", + NEMOCLAW_OPENSHELL_PIN_VERSION: "${{ steps.openshell_qualification.outputs.version }}", + }) || + JSON.stringify(run).includes("secrets.") + ) { errors.push(`${JOB_NAME} live test must not receive workflow credentials`); } diff --git a/tools/e2e/openshell-qualification.mts b/tools/e2e/openshell-qualification.mts new file mode 100644 index 00000000000..744bdf62d09 --- /dev/null +++ b/tools/e2e/openshell-qualification.mts @@ -0,0 +1,138 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../.."); +const INSTALLER_PATH = path.join(REPO_ROOT, "scripts/install-openshell.sh"); +const TOOL_COMMAND = + "node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts"; + +export const OPENSHELL_QUALIFICATION = { + archiveSha256: { + "openshell-aarch64-apple-darwin.tar.gz": + "969493205e3d3462226ff613eaba0b9cde0f582e3026294169d533d41e87c905", + "openshell-aarch64-unknown-linux-musl.tar.gz": + "ce981904ae8febd9cd6b3fbceb04e1dcfb48da6042bac08eadf0c2211f83fe55", + "openshell-gateway-aarch64-apple-darwin.tar.gz": + "de8f90db9dd0d3b47855b2b6d2542660730917bd1249e53140300990a8690b94", + "openshell-gateway-aarch64-unknown-linux-gnu.tar.gz": + "22b7781249e3487085694d0f0f3797a0e549018b81144cd24b2f1118c730d1c7", + "openshell-gateway-x86_64-unknown-linux-gnu.tar.gz": + "b7760cb752a4363c2f21d32298dd0c683dc438f6edfd16c2e4242bc0baefbb7c", + "openshell-sandbox-aarch64-unknown-linux-gnu.tar.gz": + "5e5d758d53c6abc6d7a936be907dafa9dfce10423289536f39b50abe294dfafd", + "openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz": + "559b8aaad3a8eeab45c511e7de531d9baa98a311282dcb0c2c5f38cc2d4ca355", + "openshell-x86_64-unknown-linux-musl.tar.gz": + "d1a885a91b3e5aaa006c36aca95dc78bed0638c1ba1a79b55f1da93211b8a0a0", + "openshell.rb": "f0f86519e227b3b326431410058ba690b1a7b83e5af7384014e4b96283d3a642", + }, + binarySha256: { + cli: "98ecf95113fea999e94a928043e57b04cf58a45a1b66ae8bffc73d1bc8bb1d59", + gateway: "e6cde8a54568aa1926ff6584ffd6984314c68dad64d2722509618a74094c622c", + standaloneSandbox: "019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8", + }, + releaseTag: "v0.0.106", + supportedProductVersion: "0.0.101", + sourceRepository: "NVIDIA/OpenShell", + sourceSha: "c4b500a7de64d0b66e3ee8098f58d14299092162", + supervisor: { + image: "ghcr.io/nvidia/openshell/supervisor", + manifestDigest: "sha256:722f44669722961b7f432b0b81de25b91a58f34a61d6403bef967acaf2b3af01", + }, + version: "0.0.106", +} as const; + +export const OPENSHELL_QUALIFICATION_SELECT_STEP = Object.freeze({ + id: "openshell_qualification", + name: "Select OpenShell qualification release", + run: `${TOOL_COMMAND} select "$GITHUB_OUTPUT"`, +}); + +export const OPENSHELL_QUALIFICATION_INSTALL_ENV = Object.freeze({ + NEMOCLAW_OPENSHELL_FORCE_INSTALL: "1", + NEMOCLAW_OPENSHELL_MAX_VERSION: "${{ steps.openshell_qualification.outputs.version }}", + NEMOCLAW_OPENSHELL_MIN_VERSION: "${{ steps.openshell_qualification.outputs.version }}", + NEMOCLAW_OPENSHELL_PIN_VERSION: "${{ steps.openshell_qualification.outputs.version }}", +}); + +export const OPENSHELL_QUALIFICATION_INSTALL_RUN = + "env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh"; + +export const OPENSHELL_QUALIFICATION_SUPERVISOR_OUTPUT = + "${{ steps.openshell_qualification.outputs.supervisor_image }}"; + +export function openShellQualificationProvenanceCommand(outputPath: string): string { + return `${TOOL_COMMAND} provenance "${outputPath}"`; +} + +export function validateOpenShellQualificationInstaller( + installerPath: string = INSTALLER_PATH, +): string[] { + const source = fs.readFileSync(installerPath, "utf8"); + const failures: string[] = []; + for (const [asset, sha256] of Object.entries(OPENSHELL_QUALIFICATION.archiveSha256)) { + const pin = + `${OPENSHELL_QUALIFICATION.releaseTag}:${asset})\n` + ` printf '%s\\n' "${sha256}"`; + if (!source.includes(pin)) failures.push(`installer pin is missing for ${asset}`); + } + if (!source.includes(OPENSHELL_QUALIFICATION.binarySha256.standaloneSandbox)) { + failures.push("installer identity is missing for the Linux x64 sandbox binary"); + } + return failures; +} + +export function writeOpenShellQualificationOutputs(outputPath: string): void { + const failures = validateOpenShellQualificationInstaller(); + if (failures.length > 0) throw new Error(failures.join("; ")); + const supervisorImage = + `${OPENSHELL_QUALIFICATION.supervisor.image}@` + + OPENSHELL_QUALIFICATION.supervisor.manifestDigest; + fs.appendFileSync( + outputPath, + `version=${OPENSHELL_QUALIFICATION.version}\nsupervisor_image=${supervisorImage}\n`, + "utf8", + ); +} + +export function writeOpenShellQualificationProvenance(outputPath: string): void { + const provenance = { + schemaVersion: 1, + sourceRepository: OPENSHELL_QUALIFICATION.sourceRepository, + releaseTag: OPENSHELL_QUALIFICATION.releaseTag, + sourceSha: OPENSHELL_QUALIFICATION.sourceSha, + artifacts: { + cli: { binarySha256: OPENSHELL_QUALIFICATION.binarySha256.cli }, + gateway: { binarySha256: OPENSHELL_QUALIFICATION.binarySha256.gateway }, + standaloneSandbox: { + binarySha256: OPENSHELL_QUALIFICATION.binarySha256.standaloneSandbox, + }, + }, + }; + fs.mkdirSync(path.dirname(outputPath), { recursive: true }); + fs.writeFileSync(outputPath, `${JSON.stringify(provenance, null, 2)}\n`, { + encoding: "utf8", + flag: "wx", + }); +} + +function runCli(): void { + const [command, outputPath, ...extra] = process.argv.slice(2); + if (!outputPath || extra.length > 0 || (command !== "select" && command !== "provenance")) { + throw new Error("usage: openshell-qualification.mts select OUTPUT | provenance OUTPUT"); + } + if (command === "select") writeOpenShellQualificationOutputs(outputPath); + else writeOpenShellQualificationProvenance(outputPath); +} + +if (import.meta.main) { + try { + runCli(); + } catch (error) { + process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`); + process.exitCode = 1; + } +} diff --git a/tools/e2e/workflow-boundary.mts b/tools/e2e/workflow-boundary.mts index d45f24ae681..c3fac010442 100644 --- a/tools/e2e/workflow-boundary.mts +++ b/tools/e2e/workflow-boundary.mts @@ -609,7 +609,7 @@ const RESTORED_GATEWAY_PAIRING_RUNTIME_FILES = new Set([ const LIVE_E2E_OWNING_FILE_JOBS = new Map([ ["test/e2e/live/openclaw-plugin-runtime-exdev-lifecycle.ts", ["openclaw-plugin-runtime-exdev"]], [ - "tools/e2e/install-openshell-v00106-qualification.sh", + "tools/e2e/openshell-qualification.mts", ["openshell-gateway-auth-contract", "mcp-bridge"], ], ]); From 55f4d5e31dfa8eea416711b83a38ca26dcc9695c Mon Sep 17 00:00:00 2001 From: Prekshi Vyas Date: Mon, 17 Aug 2026 23:47:02 -0700 Subject: [PATCH 03/14] fix(ci): preserve base-trusted installer table Signed-off-by: Prekshi Vyas --- .github/workflows/e2e.yaml | 6 +- scripts/check-installer-hash.sh | 276 ++++++++---------- scripts/checks/extract-installer-pins.mts | 39 +-- scripts/install-openshell.sh | 32 -- ...ay-auth-contract-workflow-boundary.test.ts | 5 + test/installer-hash-check.test.ts | 4 +- tools/e2e/openshell-qualification.mts | 72 ++++- 7 files changed, 207 insertions(+), 227 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 6c85b295d3e..0432c371873 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -3253,7 +3253,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install - name: Pre-pull pinned gateway auth probe image run: docker pull "$DOCKER_GRPC_PROBE_IMAGE" @@ -3570,7 +3570,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install - name: Write OpenShell provenance if: ${{ matrix.agent == 'deepagents' }} @@ -3688,7 +3688,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install - name: Write OpenShell provenance run: node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts provenance "$E2E_ARTIFACT_DIR/openshell-credential-generation-window/openshell-exact-main-provenance.json" diff --git a/scripts/check-installer-hash.sh b/scripts/check-installer-hash.sh index eb349cb0a55..55d22e423f5 100755 --- a/scripts/check-installer-hash.sh +++ b/scripts/check-installer-hash.sh @@ -119,11 +119,10 @@ check_openshell_release_assets() { local supervisor_runtime="${REPO_ROOT}/src/lib/onboard/docker-driver-gateway-runtime.ts" local release_base workspace manifests spec manifest expected actual source asset pinned upstream formula_asset local matches required_manifest required_matches formula_expected="" formula_matches=0 formula_url="" - local pin_records parser_error parser_errors parsed_version release_version record_extra selected_release_version="" - local release_versions="" version_pin_records + local pin_records parser_error parser_errors parsed_version release_version="" record_extra local allowlist_entry allowlist_version allowlist_extra local formula_allowlist_entry formula_allowlist_version formula_allowlist_asset formula_allowlist_url formula_allowlist_digest formula_allowlist_extra - local count brev_count published_count expected_published_count failures=0 + local count=0 brev_count=0 published_count=0 expected_published_count=0 failures=0 local -a manifest_specs=() workspace=$(mktemp -d) manifests="${workspace}/published-sha256.txt" @@ -163,20 +162,15 @@ check_openshell_release_assets() { echo " STALE: trusted parser returned an invalid installer pin record." return 1 fi - case " ${release_versions} " in - *" ${parsed_version} "*) ;; - *) release_versions="${release_versions:+${release_versions} }${parsed_version}" ;; - esac + if [[ -z "$release_version" ]]; then + release_version="$parsed_version" + elif [[ "$parsed_version" != "$release_version" ]]; then + echo " STALE: trusted parser returned multiple OpenShell release versions." + return 1 + fi case "$source" in - installer) ;; - "Brev launchable") - if [[ -z "$selected_release_version" ]]; then - selected_release_version="$parsed_version" - elif [[ "$selected_release_version" != "$parsed_version" ]]; then - echo " STALE: trusted parser returned multiple Brev OpenShell release versions." - return 1 - fi - ;; + installer) count=$((count + 1)) ;; + "Brev launchable") brev_count=$((brev_count + 1)) ;; *) echo " STALE: trusted parser returned an unknown pin source." return 1 @@ -184,172 +178,148 @@ check_openshell_release_assets() { esac done <<<"$pin_records" - [[ -n "$selected_release_version" ]] || { - echo " STALE: trusted parser returned no selected Brev OpenShell release." - return 1 - } - - for release_version in $release_versions; do - manifests="${workspace}/published-sha256-${release_version}.txt" - : >"$manifests" - manifest_specs=() - formula_expected="" - formula_matches=0 - formula_url="" - count=0 - brev_count=0 - published_count=0 - version_pin_records="" - - while IFS=$'\t' read -r parsed_version source asset pinned record_extra; do - [[ "$parsed_version" == "$release_version" ]] || continue - version_pin_records+="${parsed_version}"$'\t'"${source}"$'\t'"${asset}"$'\t'"${pinned}"$'\n' - case "$source" in - installer) count=$((count + 1)) ;; - "Brev launchable") brev_count=$((brev_count + 1)) ;; - esac - done <<<"$pin_records" + if [[ "$count" -ne 9 ]]; then + echo " STALE: expected 9 pinned OpenShell v${release_version:-unknown} assets, found ${count}." + failures=$((failures + 1)) + fi + if [[ "$brev_count" -ne 2 ]]; then + echo " STALE: expected 2 pinned Brev OpenShell v${release_version:-unknown} CLI assets, found ${brev_count}." + failures=$((failures + 1)) + fi + if [[ "$failures" -ne 0 ]]; then + return "$failures" + fi - if [[ "$count" -ne 9 ]]; then - echo " STALE: expected 9 pinned OpenShell v${release_version} assets, found ${count}." - failures=$((failures + 1)) + for allowlist_entry in "${OPENSHELL_RELEASE_MANIFEST_ALLOWLIST[@]}"; do + IFS='|' read -r allowlist_version manifest expected allowlist_extra <<<"$allowlist_entry" + if [[ ! "$allowlist_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ || ! "$expected" =~ ^[a-f0-9]{64}$ || -z "$manifest" || -n "$allowlist_extra" ]]; then + echo " STALE: trusted OpenShell release-manifest allowlist is invalid." + return 1 fi - if [[ "$release_version" == "$selected_release_version" && "$brev_count" -ne 2 ]]; then - echo " STALE: expected 2 pinned Brev OpenShell v${release_version} CLI assets, found ${brev_count}." - failures=$((failures + 1)) - elif [[ "$release_version" != "$selected_release_version" && "$brev_count" -ne 0 ]]; then - echo " STALE: unselected OpenShell v${release_version} must not have Brev pins." - failures=$((failures + 1)) + if [[ "$allowlist_version" == "$release_version" ]]; then + manifest_specs+=("${manifest}:${expected}") fi - [[ "$failures" -eq 0 ]] || return "$failures" + done - for allowlist_entry in "${OPENSHELL_RELEASE_MANIFEST_ALLOWLIST[@]}"; do - IFS='|' read -r allowlist_version manifest expected allowlist_extra <<<"$allowlist_entry" - if [[ ! "$allowlist_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ || ! "$expected" =~ ^[a-f0-9]{64}$ || -z "$manifest" || -n "$allowlist_extra" ]]; then - echo " STALE: trusted OpenShell release-manifest allowlist is invalid." - return 1 - fi - if [[ "$allowlist_version" == "$release_version" ]]; then - manifest_specs+=("${manifest}:${expected}") + if [[ "${#manifest_specs[@]}" -eq 0 ]]; then + echo " STALE: OpenShell v${release_version} is not in the trusted release-manifest allowlist." + return 1 + fi + if [[ "${#manifest_specs[@]}" -ne 3 ]]; then + echo " STALE: OpenShell v${release_version} does not have exactly three trusted release-manifest digests." + return 1 + fi + for required_manifest in \ + openshell-checksums-sha256.txt \ + openshell-gateway-checksums-sha256.txt \ + openshell-sandbox-checksums-sha256.txt; do + required_matches=0 + for spec in "${manifest_specs[@]}"; do + if [[ "${spec%%:*}" == "$required_manifest" ]]; then + required_matches=$((required_matches + 1)) fi done + if [[ "$required_matches" -ne 1 ]]; then + echo " STALE: OpenShell v${release_version} does not have exactly one trusted ${required_manifest} digest." + failures=$((failures + 1)) + fi + done + if [[ "$failures" -ne 0 ]]; then + return "$failures" + fi - if [[ "${#manifest_specs[@]}" -eq 0 ]]; then - echo " STALE: OpenShell v${release_version} is not in the trusted release-manifest allowlist." + for formula_allowlist_entry in "${OPENSHELL_RELEASE_FORMULA_ALLOWLIST[@]}"; do + IFS='|' read -r formula_allowlist_version formula_allowlist_asset formula_allowlist_url formula_allowlist_digest formula_allowlist_extra <<<"$formula_allowlist_entry" + if [[ ! "$formula_allowlist_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ || "$formula_allowlist_asset" != "openshell.rb" || "$formula_allowlist_url" != "https://github.com/NVIDIA/OpenShell/releases/download/v${formula_allowlist_version}/${formula_allowlist_asset}" || ! "$formula_allowlist_digest" =~ ^[a-f0-9]{64}$ || -n "$formula_allowlist_extra" ]]; then + echo " STALE: trusted OpenShell formula allowlist is invalid." return 1 fi - if [[ "${#manifest_specs[@]}" -ne 3 ]]; then - echo " STALE: OpenShell v${release_version} does not have exactly three trusted release-manifest digests." - return 1 + if [[ "$formula_allowlist_version" == "$release_version" ]]; then + formula_matches=$((formula_matches + 1)) + formula_url="$formula_allowlist_url" + formula_expected="$formula_allowlist_digest" fi - for required_manifest in \ - openshell-checksums-sha256.txt \ - openshell-gateway-checksums-sha256.txt \ - openshell-sandbox-checksums-sha256.txt; do - required_matches=0 - for spec in "${manifest_specs[@]}"; do - [[ "${spec%%:*}" == "$required_manifest" ]] && required_matches=$((required_matches + 1)) - done - if [[ "$required_matches" -ne 1 ]]; then - echo " STALE: OpenShell v${release_version} does not have exactly one trusted ${required_manifest} digest." - failures=$((failures + 1)) - fi - done - [[ "$failures" -eq 0 ]] || return "$failures" + done - for formula_allowlist_entry in "${OPENSHELL_RELEASE_FORMULA_ALLOWLIST[@]}"; do - IFS='|' read -r formula_allowlist_version formula_allowlist_asset formula_allowlist_url formula_allowlist_digest formula_allowlist_extra <<<"$formula_allowlist_entry" - if [[ ! "$formula_allowlist_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ || "$formula_allowlist_asset" != "openshell.rb" || "$formula_allowlist_url" != "https://github.com/NVIDIA/OpenShell/releases/download/v${formula_allowlist_version}/${formula_allowlist_asset}" || ! "$formula_allowlist_digest" =~ ^[a-f0-9]{64}$ || -n "$formula_allowlist_extra" ]]; then - echo " STALE: trusted OpenShell formula allowlist is invalid." - return 1 - fi - if [[ "$formula_allowlist_version" == "$release_version" ]]; then - formula_matches=$((formula_matches + 1)) - formula_url="$formula_allowlist_url" - formula_expected="$formula_allowlist_digest" - fi - done - if [[ "$formula_matches" -ne 1 ]]; then - echo " STALE: OpenShell v${release_version} does not have exactly one trusted openshell.rb digest." - return 1 + if [[ "$formula_matches" -ne 1 ]]; then + echo " STALE: OpenShell v${release_version} does not have exactly one trusted openshell.rb digest." + return 1 + fi + + release_base="https://github.com/NVIDIA/OpenShell/releases/download/v${release_version}" + echo "Checking OpenShell v${release_version} release assets..." + for spec in "${manifest_specs[@]}"; do + manifest="${spec%%:*}" + expected="${spec#*:}" + if ! fetch_file "${release_base}/${manifest}" "${workspace}/${manifest}"; then + echo " STALE: unable to download ${manifest}." + failures=$((failures + 1)) + continue + fi + if ! actual=$(sha256_file "${workspace}/${manifest}"); then + echo " STALE: unable to hash ${manifest}." + failures=$((failures + 1)) + continue fi + if [[ "$actual" != "$expected" ]]; then + echo " STALE: ${manifest} digest does not match the pinned v${release_version} release asset." + echo " pinned: ${expected}" + echo " upstream: ${actual}" + failures=$((failures + 1)) + continue + fi + echo " OK: ${manifest} (${actual})" + cat "${workspace}/${manifest}" >>"$manifests" + done - release_base="https://github.com/NVIDIA/OpenShell/releases/download/v${release_version}" - echo "Checking OpenShell v${release_version} release assets..." - for spec in "${manifest_specs[@]}"; do - manifest="${spec%%:*}" - expected="${spec#*:}" - if ! fetch_file "${release_base}/${manifest}" "${workspace}/${release_version}-${manifest}"; then - echo " STALE: unable to download ${manifest}." + while IFS=$'\t' read -r parsed_version source asset pinned record_extra; do + if [[ "$asset" == "openshell.rb" ]]; then + formula_asset="${workspace}/${asset}" + if ! fetch_file "$formula_url" "$formula_asset"; then + echo " STALE: unable to download ${source} ${asset}." failures=$((failures + 1)) continue fi - if ! actual=$(sha256_file "${workspace}/${release_version}-${manifest}"); then - echo " STALE: unable to hash ${manifest}." + if ! actual=$(sha256_file "$formula_asset"); then + echo " STALE: unable to hash ${source} ${asset}." failures=$((failures + 1)) continue fi - if [[ "$actual" != "$expected" ]]; then - echo " STALE: ${manifest} digest does not match the pinned v${release_version} release asset." - echo " pinned: ${expected}" + if [[ "$actual" != "$formula_expected" ]]; then + echo " STALE: ${source} ${asset} does not match the base-trusted v${release_version} formula digest." + echo " trusted: ${formula_expected}" echo " upstream: ${actual}" failures=$((failures + 1)) - continue - fi - echo " OK: ${manifest} (${actual})" - cat "${workspace}/${release_version}-${manifest}" >>"$manifests" - done - - while IFS=$'\t' read -r parsed_version source asset pinned record_extra; do - [[ -n "$parsed_version" ]] || continue - if [[ "$asset" == "openshell.rb" ]]; then - formula_asset="${workspace}/${asset}" - if ! fetch_file "$formula_url" "$formula_asset"; then - echo " STALE: unable to download ${source} ${asset}." - failures=$((failures + 1)) - continue - fi - if ! actual=$(sha256_file "$formula_asset"); then - echo " STALE: unable to hash ${source} ${asset}." - failures=$((failures + 1)) - continue - fi - if [[ "$actual" != "$formula_expected" ]]; then - echo " STALE: ${source} ${asset} does not match the base-trusted v${release_version} formula digest." - echo " trusted: ${formula_expected}" - echo " upstream: ${actual}" - failures=$((failures + 1)) - elif [[ "$pinned" == "$formula_expected" ]]; then - published_count=$((published_count + 1)) - echo " OK: ${source} ${asset} (${pinned})" - else - echo " STALE: ${source} ${asset} pin does not match the base-trusted v${release_version} formula digest." - echo " pinned: ${pinned}" - echo " trusted: ${formula_expected}" - failures=$((failures + 1)) - fi - continue - fi - matches=$(awk -v asset="$asset" '$2 == asset { count++ } END { print count + 0 }' "$manifests") - upstream=$(awk -v asset="$asset" '$2 == asset { print $1; exit }' "$manifests") - if [[ "$matches" -eq 1 && "$pinned" == "$upstream" ]]; then + elif [[ "$pinned" == "$formula_expected" ]]; then published_count=$((published_count + 1)) echo " OK: ${source} ${asset} (${pinned})" else - echo " STALE: ${source} ${asset} does not match exactly one v${release_version} checksum entry." + echo " STALE: ${source} ${asset} pin does not match the base-trusted v${release_version} formula digest." echo " pinned: ${pinned}" - echo " upstream: ${upstream:-missing}" - echo " matches: ${matches}" + echo " trusted: ${formula_expected}" failures=$((failures + 1)) fi - done <<<"$version_pin_records" - - expected_published_count=$((count + brev_count)) - if [[ "$published_count" -ne "$expected_published_count" ]]; then - echo " STALE: expected all ${expected_published_count} pinned asset references for v${release_version}, matched ${published_count}." + continue + fi + matches=$(awk -v asset="$asset" '$2 == asset { count++ } END { print count + 0 }' "$manifests") + upstream=$(awk -v asset="$asset" '$2 == asset { print $1; exit }' "$manifests") + if [[ "$matches" -eq 1 && "$pinned" == "$upstream" ]]; then + published_count=$((published_count + 1)) + echo " OK: ${source} ${asset} (${pinned})" + else + echo " STALE: ${source} ${asset} does not match exactly one v${release_version} checksum entry." + echo " pinned: ${pinned}" + echo " upstream: ${upstream:-missing}" + echo " matches: ${matches}" failures=$((failures + 1)) fi - done + done <<<"$pin_records" + + expected_published_count=$((count + brev_count)) + if [[ "$published_count" -ne "$expected_published_count" ]]; then + echo " STALE: expected all ${expected_published_count} pinned asset references for v${release_version}, matched ${published_count}." + failures=$((failures + 1)) + fi return "$failures" } diff --git a/scripts/checks/extract-installer-pins.mts b/scripts/checks/extract-installer-pins.mts index 186428fe502..4c9af86efda 100644 --- a/scripts/checks/extract-installer-pins.mts +++ b/scripts/checks/extract-installer-pins.mts @@ -1136,11 +1136,16 @@ export function extractInstallerPins(source: string, options: ExtractOptions): I if (pins.length === 0) { fail(`${options.functionName} contains no versioned pins`); } - const releaseVersions = [...new Set(pins.map((pin) => pin.releaseVersion))]; + const releaseVersions = [...new Set(pins.map((pin) => pin.releaseVersion))].sort(); + if (releaseVersions.length !== 1) { + fail( + `${options.functionName} must contain exactly one release version, found ${releaseVersions.join(", ")}`, + ); + } + const duplicateAssets = pins - .map((pin) => `${pin.releaseVersion}:${pin.asset}`) - .filter((asset, index, assets) => assets.indexOf(asset) !== index) - .map((asset) => (releaseVersions.length === 1 ? asset.slice(asset.indexOf(":") + 1) : asset)); + .map((pin) => pin.asset) + .filter((asset, index, assets) => assets.indexOf(asset) !== index); if (duplicateAssets.length > 0) { fail( `${options.functionName} contains duplicate assets: ${[...new Set(duplicateAssets)].join(", ")}`, @@ -1207,30 +1212,16 @@ function runCli(): void { functionName: "openshell_cli_pinned_sha256", sourceLabel: "Brev launchable", }); - const installerReleaseVersions = [ - ...new Set(installerPins.map((pin) => pin.releaseVersion)), - ].sort(); - for (const version of installerReleaseVersions) { - assertExactAssetSet( - installerPins.filter((pin) => pin.releaseVersion === version), - EXPECTED_INSTALLER_ASSETS, - installerReleaseVersions.length === 1 - ? "installer pin table" - : `installer pin table for ${version}`, - ); - } + assertExactAssetSet(installerPins, EXPECTED_INSTALLER_ASSETS, "installer pin table"); assertExactAssetSet(brevPins, EXPECTED_BREV_ASSETS, "Brev pin table"); - const brevReleaseVersions = [...new Set(brevPins.map((pin) => pin.releaseVersion))].sort(); - if (brevReleaseVersions.length !== 1) { + const pins = [...installerPins, ...brevPins]; + const releaseVersions = [...new Set(pins.map((pin) => pin.releaseVersion))].sort(); + if (releaseVersions.length !== 1) { fail( - `Brev launchable pin table must contain exactly one release version, found ${brevReleaseVersions.join(", ")}`, + `installer and Brev launchable pin tables must use the same release version, found ${releaseVersions.join(", ")}`, ); } - const releaseVersion = brevReleaseVersions[0] ?? fail("Brev pin table contains no release"); - if (!installerReleaseVersions.includes(releaseVersion)) { - fail(`installer pin table has no assets for selected release ${releaseVersion}`); - } - const pins = [...installerPins, ...brevPins]; + const releaseVersion = releaseVersions[0] ?? fail("installer pin tables contain no release"); const sandboxBuildPins = extractSandboxBuildPins(installerSource); assertTrustedSandboxBuildPins(sandboxBuildPins, releaseVersion); const supervisorManifestPins = extractSupervisorManifestPins(supervisorRuntimeSource); diff --git a/scripts/install-openshell.sh b/scripts/install-openshell.sh index 6dcbc23271c..d1f2b5332eb 100755 --- a/scripts/install-openshell.sh +++ b/scripts/install-openshell.sh @@ -254,33 +254,6 @@ openshell_pinned_sha256() { v0.0.101:openshell.rb) printf '%s\n' "87fadc7b0c854aa44f71d5b3a206865070117cd27825d59c61da252a99f402a2" ;; - v0.0.106:openshell-x86_64-unknown-linux-musl.tar.gz) - printf '%s\n' "d1a885a91b3e5aaa006c36aca95dc78bed0638c1ba1a79b55f1da93211b8a0a0" - ;; - v0.0.106:openshell-aarch64-unknown-linux-musl.tar.gz) - printf '%s\n' "ce981904ae8febd9cd6b3fbceb04e1dcfb48da6042bac08eadf0c2211f83fe55" - ;; - v0.0.106:openshell-aarch64-apple-darwin.tar.gz) - printf '%s\n' "969493205e3d3462226ff613eaba0b9cde0f582e3026294169d533d41e87c905" - ;; - v0.0.106:openshell-gateway-x86_64-unknown-linux-gnu.tar.gz) - printf '%s\n' "b7760cb752a4363c2f21d32298dd0c683dc438f6edfd16c2e4242bc0baefbb7c" - ;; - v0.0.106:openshell-gateway-aarch64-unknown-linux-gnu.tar.gz) - printf '%s\n' "22b7781249e3487085694d0f0f3797a0e549018b81144cd24b2f1118c730d1c7" - ;; - v0.0.106:openshell-gateway-aarch64-apple-darwin.tar.gz) - printf '%s\n' "de8f90db9dd0d3b47855b2b6d2542660730917bd1249e53140300990a8690b94" - ;; - v0.0.106:openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz) - printf '%s\n' "559b8aaad3a8eeab45c511e7de531d9baa98a311282dcb0c2c5f38cc2d4ca355" - ;; - v0.0.106:openshell-sandbox-aarch64-unknown-linux-gnu.tar.gz) - printf '%s\n' "5e5d758d53c6abc6d7a936be907dafa9dfce10423289536f39b50abe294dfafd" - ;; - v0.0.106:openshell.rb) - printf '%s\n' "f0f86519e227b3b326431410058ba690b1a7b83e5af7384014e4b96283d3a642" - ;; *) return 1 ;; @@ -412,11 +385,6 @@ pinned_sandbox_build_version() { 88300e35f153123e4dc3021c537834dd6c0a09665a4a6d3974cd285d512345c4) printf '%s\n' "0.0.101" ;; - # OpenShell v0.0.106 standalone sandbox binaries. - 0031c6b257a23ecc1a2333153918324f3af0005e68abde388858d682ec646c55 | \ - 019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8) - printf '%s\n' "0.0.106" - ;; *) return 1 ;; diff --git a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts index aca40377647..2ecc27ab465 100644 --- a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts +++ b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 +import { execFileSync } from "node:child_process"; import fs from "node:fs"; import os from "node:os"; import path from "node:path"; @@ -14,6 +15,7 @@ import { } from "../../../tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts"; import { OPENSHELL_QUALIFICATION, + materializeOpenShellQualificationInstaller, validateOpenShellQualificationInstaller, writeOpenShellQualificationOutputs, writeOpenShellQualificationProvenance, @@ -24,8 +26,11 @@ describe("OpenShell gateway auth contract workflow boundary", () => { const directory = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-openshell-qualification-")); const outputsPath = path.join(directory, "outputs"); const provenancePath = path.join(directory, "provenance.json"); + const installerPath = path.join(directory, "install-openshell.sh"); try { expect(validateOpenShellQualificationInstaller()).toEqual([]); + fs.writeFileSync(installerPath, materializeOpenShellQualificationInstaller()); + execFileSync("bash", ["-n", installerPath]); writeOpenShellQualificationOutputs(outputsPath); expect(fs.readFileSync(outputsPath, "utf8")).toBe( diff --git a/test/installer-hash-check.test.ts b/test/installer-hash-check.test.ts index 945d78d8408..e7d1f6d3672 100644 --- a/test/installer-hash-check.test.ts +++ b/test/installer-hash-check.test.ts @@ -1185,11 +1185,11 @@ describe("installer hash verification", () => { ], [ "multiple-installer-versions", - `installer pin table for 0.0.72 must contain the exact consumed asset set; missing=[${ASSETS[0]}]`, + "openshell_pinned_sha256 must contain exactly one release version, found 0.0.72, 0.0.73", ], [ "mismatched-table-versions", - "installer pin table has no assets for selected release 0.0.73", + "installer and Brev launchable pin tables must use the same release version, found 0.0.72, 0.0.73", ], ] as const)("fails closed for %s", (mode, diagnostic) => { const result = runFixture(mode, undefined, true); diff --git a/tools/e2e/openshell-qualification.mts b/tools/e2e/openshell-qualification.mts index 744bdf62d09..233301153e1 100644 --- a/tools/e2e/openshell-qualification.mts +++ b/tools/e2e/openshell-qualification.mts @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 +import { spawnSync } from "node:child_process"; import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; @@ -59,8 +60,7 @@ export const OPENSHELL_QUALIFICATION_INSTALL_ENV = Object.freeze({ NEMOCLAW_OPENSHELL_PIN_VERSION: "${{ steps.openshell_qualification.outputs.version }}", }); -export const OPENSHELL_QUALIFICATION_INSTALL_RUN = - "env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh"; +export const OPENSHELL_QUALIFICATION_INSTALL_RUN = `env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN ${TOOL_COMMAND} install`; export const OPENSHELL_QUALIFICATION_SUPERVISOR_OUTPUT = "${{ steps.openshell_qualification.outputs.supervisor_image }}"; @@ -69,20 +69,48 @@ export function openShellQualificationProvenanceCommand(outputPath: string): str return `${TOOL_COMMAND} provenance "${outputPath}"`; } -export function validateOpenShellQualificationInstaller( +function escapeRegExp(value: string): string { + return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&"); +} + +export function materializeOpenShellQualificationInstaller( installerPath: string = INSTALLER_PATH, -): string[] { - const source = fs.readFileSync(installerPath, "utf8"); - const failures: string[] = []; +): string { + let source = fs.readFileSync(installerPath, "utf8"); for (const [asset, sha256] of Object.entries(OPENSHELL_QUALIFICATION.archiveSha256)) { - const pin = - `${OPENSHELL_QUALIFICATION.releaseTag}:${asset})\n` + ` printf '%s\\n' "${sha256}"`; - if (!source.includes(pin)) failures.push(`installer pin is missing for ${asset}`); + const pattern = new RegExp( + ` v${escapeRegExp(OPENSHELL_QUALIFICATION.supportedProductVersion)}:${escapeRegExp(asset)}\\)\\n` + + ` printf '%s\\\\n' "[a-f0-9]{64}"`, + "gu", + ); + const replacement = + ` ${OPENSHELL_QUALIFICATION.releaseTag}:${asset})\n` + ` printf '%s\\n' "${sha256}"`; + if ([...source.matchAll(pattern)].length !== 1) { + throw new Error(`canonical installer has no unique pin owner for ${asset}`); + } + source = source.replace(pattern, replacement); } - if (!source.includes(OPENSHELL_QUALIFICATION.binarySha256.standaloneSandbox)) { - failures.push("installer identity is missing for the Linux x64 sandbox binary"); + const fallbackPattern = + /(pinned_sandbox_build_version\(\) \{[\s\S]*?)( \*\)\n return 1)/u; + const fallback = fallbackPattern.exec(source); + if (!fallback) throw new Error("canonical installer has no sandbox identity fallback"); + const sandboxIdentity = + ` # OpenShell ${OPENSHELL_QUALIFICATION.releaseTag} qualification sandbox.\n` + + ` ${OPENSHELL_QUALIFICATION.binarySha256.standaloneSandbox})\n` + + ` printf '%s\\n' "${OPENSHELL_QUALIFICATION.version}"\n` + + ` ;;\n`; + return source.replace(fallbackPattern, `$1${sandboxIdentity}$2`); +} + +export function validateOpenShellQualificationInstaller( + installerPath: string = INSTALLER_PATH, +): string[] { + try { + materializeOpenShellQualificationInstaller(installerPath); + return []; + } catch (error) { + return [error instanceof Error ? error.message : String(error)]; } - return failures; } export function writeOpenShellQualificationOutputs(outputPath: string): void { @@ -98,6 +126,18 @@ export function writeOpenShellQualificationOutputs(outputPath: string): void { ); } +export function installOpenShellQualification(): number { + const installer = materializeOpenShellQualificationInstaller(); + const result = spawnSync("bash", ["-s", "--"], { + env: process.env, + input: installer, + stdio: ["pipe", "inherit", "inherit"], + }); + if (result.error) throw result.error; + if (result.signal) throw new Error(`OpenShell qualification installer received ${result.signal}`); + return result.status ?? 1; +} + export function writeOpenShellQualificationProvenance(outputPath: string): void { const provenance = { schemaVersion: 1, @@ -121,8 +161,14 @@ export function writeOpenShellQualificationProvenance(outputPath: string): void function runCli(): void { const [command, outputPath, ...extra] = process.argv.slice(2); + if (command === "install" && !outputPath && extra.length === 0) { + process.exitCode = installOpenShellQualification(); + return; + } if (!outputPath || extra.length > 0 || (command !== "select" && command !== "provenance")) { - throw new Error("usage: openshell-qualification.mts select OUTPUT | provenance OUTPUT"); + throw new Error( + "usage: openshell-qualification.mts install | select OUTPUT | provenance OUTPUT", + ); } if (command === "select") writeOpenShellQualificationOutputs(outputPath); else writeOpenShellQualificationProvenance(outputPath); From 314ae77349886b4f6b693440ed37f7ecdbeb3fdb Mon Sep 17 00:00:00 2001 From: Prekshi Vyas Date: Tue, 18 Aug 2026 00:03:12 -0700 Subject: [PATCH 04/14] test: apply qualification test formatting Signed-off-by: Prekshi Vyas --- test/openshell-e2e-qualification.test.ts | 36 +++++++++++------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/test/openshell-e2e-qualification.test.ts b/test/openshell-e2e-qualification.test.ts index 30e97542989..1fedce1465b 100644 --- a/test/openshell-e2e-qualification.test.ts +++ b/test/openshell-e2e-qualification.test.ts @@ -276,25 +276,23 @@ function apiWithWorkflowRuns(runs: ReturnType[]): GitHubRead } describe("OpenShell qualification-sensitive path detection", () => { - it.each( - [ - "nemoclaw-blueprint/blueprint.yaml", - "scripts/install-openshell.sh", - "scripts/checks/extract-installer-pins.mts", - "agents/hermes/manifest.yaml", - "agents/langchain-deepagents-code/managed-dcode-runtime.py", - "src/lib/onboard/docker-driver-gateway-runtime.ts", - "src/lib/actions/sandbox/supervisor-relaunch.ts", - "src/lib/actions/sandbox/openshell-child-visible-credentials.v0.0.101.json", - "nemoclaw/src/blueprint/runner.ts", - "src/lib/sandbox/version.ts", - "src/lib/onboard/openshell-version.ts", - "src/lib/adapters/sandbox/command-transport.ts", - ".github/workflows/podman-cpu-proof.yaml", - ".github/actions/ci-installer-hash-check/action.yaml", - "scripts/checks/verify-openshell-e2e-qualification.mts", - ], - )( + it.each([ + "nemoclaw-blueprint/blueprint.yaml", + "scripts/install-openshell.sh", + "scripts/checks/extract-installer-pins.mts", + "agents/hermes/manifest.yaml", + "agents/langchain-deepagents-code/managed-dcode-runtime.py", + "src/lib/onboard/docker-driver-gateway-runtime.ts", + "src/lib/actions/sandbox/supervisor-relaunch.ts", + "src/lib/actions/sandbox/openshell-child-visible-credentials.v0.0.101.json", + "nemoclaw/src/blueprint/runner.ts", + "src/lib/sandbox/version.ts", + "src/lib/onboard/openshell-version.ts", + "src/lib/adapters/sandbox/command-transport.ts", + ".github/workflows/podman-cpu-proof.yaml", + ".github/actions/ci-installer-hash-check/action.yaml", + "scripts/checks/verify-openshell-e2e-qualification.mts", + ])( "covers selectors, trust inputs, runtime artifacts, manifests, proofs, and gate surfaces [%s]", (candidatePath) => { expect(isOpenShellQualificationSensitivePath(candidatePath), candidatePath).toBe(true); From 74b1a269540d47fc44376c2fac2ea7a801f8f626 Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Tue, 18 Aug 2026 00:01:01 -0700 Subject: [PATCH 05/14] fix(ci): use the checked-in OpenShell installer Signed-off-by: Carlos Villela --- .github/workflows/e2e.yaml | 6 +- scripts/install-openshell.sh | 32 +++++++++ ...ay-auth-contract-workflow-boundary.test.ts | 5 -- tools/e2e/openshell-qualification.mts | 72 ++++--------------- 4 files changed, 48 insertions(+), 67 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 0432c371873..6c85b295d3e 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -3253,7 +3253,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh - name: Pre-pull pinned gateway auth probe image run: docker pull "$DOCKER_GRPC_PROBE_IMAGE" @@ -3570,7 +3570,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh - name: Write OpenShell provenance if: ${{ matrix.agent == 'deepagents' }} @@ -3688,7 +3688,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh - name: Write OpenShell provenance run: node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts provenance "$E2E_ARTIFACT_DIR/openshell-credential-generation-window/openshell-exact-main-provenance.json" diff --git a/scripts/install-openshell.sh b/scripts/install-openshell.sh index d1f2b5332eb..6dcbc23271c 100755 --- a/scripts/install-openshell.sh +++ b/scripts/install-openshell.sh @@ -254,6 +254,33 @@ openshell_pinned_sha256() { v0.0.101:openshell.rb) printf '%s\n' "87fadc7b0c854aa44f71d5b3a206865070117cd27825d59c61da252a99f402a2" ;; + v0.0.106:openshell-x86_64-unknown-linux-musl.tar.gz) + printf '%s\n' "d1a885a91b3e5aaa006c36aca95dc78bed0638c1ba1a79b55f1da93211b8a0a0" + ;; + v0.0.106:openshell-aarch64-unknown-linux-musl.tar.gz) + printf '%s\n' "ce981904ae8febd9cd6b3fbceb04e1dcfb48da6042bac08eadf0c2211f83fe55" + ;; + v0.0.106:openshell-aarch64-apple-darwin.tar.gz) + printf '%s\n' "969493205e3d3462226ff613eaba0b9cde0f582e3026294169d533d41e87c905" + ;; + v0.0.106:openshell-gateway-x86_64-unknown-linux-gnu.tar.gz) + printf '%s\n' "b7760cb752a4363c2f21d32298dd0c683dc438f6edfd16c2e4242bc0baefbb7c" + ;; + v0.0.106:openshell-gateway-aarch64-unknown-linux-gnu.tar.gz) + printf '%s\n' "22b7781249e3487085694d0f0f3797a0e549018b81144cd24b2f1118c730d1c7" + ;; + v0.0.106:openshell-gateway-aarch64-apple-darwin.tar.gz) + printf '%s\n' "de8f90db9dd0d3b47855b2b6d2542660730917bd1249e53140300990a8690b94" + ;; + v0.0.106:openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz) + printf '%s\n' "559b8aaad3a8eeab45c511e7de531d9baa98a311282dcb0c2c5f38cc2d4ca355" + ;; + v0.0.106:openshell-sandbox-aarch64-unknown-linux-gnu.tar.gz) + printf '%s\n' "5e5d758d53c6abc6d7a936be907dafa9dfce10423289536f39b50abe294dfafd" + ;; + v0.0.106:openshell.rb) + printf '%s\n' "f0f86519e227b3b326431410058ba690b1a7b83e5af7384014e4b96283d3a642" + ;; *) return 1 ;; @@ -385,6 +412,11 @@ pinned_sandbox_build_version() { 88300e35f153123e4dc3021c537834dd6c0a09665a4a6d3974cd285d512345c4) printf '%s\n' "0.0.101" ;; + # OpenShell v0.0.106 standalone sandbox binaries. + 0031c6b257a23ecc1a2333153918324f3af0005e68abde388858d682ec646c55 | \ + 019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8) + printf '%s\n' "0.0.106" + ;; *) return 1 ;; diff --git a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts index 2ecc27ab465..aca40377647 100644 --- a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts +++ b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts @@ -1,7 +1,6 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -import { execFileSync } from "node:child_process"; import fs from "node:fs"; import os from "node:os"; import path from "node:path"; @@ -15,7 +14,6 @@ import { } from "../../../tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts"; import { OPENSHELL_QUALIFICATION, - materializeOpenShellQualificationInstaller, validateOpenShellQualificationInstaller, writeOpenShellQualificationOutputs, writeOpenShellQualificationProvenance, @@ -26,11 +24,8 @@ describe("OpenShell gateway auth contract workflow boundary", () => { const directory = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-openshell-qualification-")); const outputsPath = path.join(directory, "outputs"); const provenancePath = path.join(directory, "provenance.json"); - const installerPath = path.join(directory, "install-openshell.sh"); try { expect(validateOpenShellQualificationInstaller()).toEqual([]); - fs.writeFileSync(installerPath, materializeOpenShellQualificationInstaller()); - execFileSync("bash", ["-n", installerPath]); writeOpenShellQualificationOutputs(outputsPath); expect(fs.readFileSync(outputsPath, "utf8")).toBe( diff --git a/tools/e2e/openshell-qualification.mts b/tools/e2e/openshell-qualification.mts index 233301153e1..4795446ee70 100644 --- a/tools/e2e/openshell-qualification.mts +++ b/tools/e2e/openshell-qualification.mts @@ -1,7 +1,6 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -import { spawnSync } from "node:child_process"; import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; @@ -60,7 +59,8 @@ export const OPENSHELL_QUALIFICATION_INSTALL_ENV = Object.freeze({ NEMOCLAW_OPENSHELL_PIN_VERSION: "${{ steps.openshell_qualification.outputs.version }}", }); -export const OPENSHELL_QUALIFICATION_INSTALL_RUN = `env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN ${TOOL_COMMAND} install`; +export const OPENSHELL_QUALIFICATION_INSTALL_RUN = + "env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh"; export const OPENSHELL_QUALIFICATION_SUPERVISOR_OUTPUT = "${{ steps.openshell_qualification.outputs.supervisor_image }}"; @@ -69,48 +69,20 @@ export function openShellQualificationProvenanceCommand(outputPath: string): str return `${TOOL_COMMAND} provenance "${outputPath}"`; } -function escapeRegExp(value: string): string { - return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&"); -} - -export function materializeOpenShellQualificationInstaller( - installerPath: string = INSTALLER_PATH, -): string { - let source = fs.readFileSync(installerPath, "utf8"); - for (const [asset, sha256] of Object.entries(OPENSHELL_QUALIFICATION.archiveSha256)) { - const pattern = new RegExp( - ` v${escapeRegExp(OPENSHELL_QUALIFICATION.supportedProductVersion)}:${escapeRegExp(asset)}\\)\\n` + - ` printf '%s\\\\n' "[a-f0-9]{64}"`, - "gu", - ); - const replacement = - ` ${OPENSHELL_QUALIFICATION.releaseTag}:${asset})\n` + ` printf '%s\\n' "${sha256}"`; - if ([...source.matchAll(pattern)].length !== 1) { - throw new Error(`canonical installer has no unique pin owner for ${asset}`); - } - source = source.replace(pattern, replacement); - } - const fallbackPattern = - /(pinned_sandbox_build_version\(\) \{[\s\S]*?)( \*\)\n return 1)/u; - const fallback = fallbackPattern.exec(source); - if (!fallback) throw new Error("canonical installer has no sandbox identity fallback"); - const sandboxIdentity = - ` # OpenShell ${OPENSHELL_QUALIFICATION.releaseTag} qualification sandbox.\n` + - ` ${OPENSHELL_QUALIFICATION.binarySha256.standaloneSandbox})\n` + - ` printf '%s\\n' "${OPENSHELL_QUALIFICATION.version}"\n` + - ` ;;\n`; - return source.replace(fallbackPattern, `$1${sandboxIdentity}$2`); -} - export function validateOpenShellQualificationInstaller( installerPath: string = INSTALLER_PATH, ): string[] { - try { - materializeOpenShellQualificationInstaller(installerPath); - return []; - } catch (error) { - return [error instanceof Error ? error.message : String(error)]; + const source = fs.readFileSync(installerPath, "utf8"); + const failures: string[] = []; + for (const [asset, sha256] of Object.entries(OPENSHELL_QUALIFICATION.archiveSha256)) { + const pin = + `${OPENSHELL_QUALIFICATION.releaseTag}:${asset})\n` + ` printf '%s\\n' "${sha256}"`; + if (!source.includes(pin)) failures.push(`installer pin is missing for ${asset}`); } + if (!source.includes(OPENSHELL_QUALIFICATION.binarySha256.standaloneSandbox)) { + failures.push("installer identity is missing for the Linux x86_64 standalone sandbox binary"); + } + return failures; } export function writeOpenShellQualificationOutputs(outputPath: string): void { @@ -126,18 +98,6 @@ export function writeOpenShellQualificationOutputs(outputPath: string): void { ); } -export function installOpenShellQualification(): number { - const installer = materializeOpenShellQualificationInstaller(); - const result = spawnSync("bash", ["-s", "--"], { - env: process.env, - input: installer, - stdio: ["pipe", "inherit", "inherit"], - }); - if (result.error) throw result.error; - if (result.signal) throw new Error(`OpenShell qualification installer received ${result.signal}`); - return result.status ?? 1; -} - export function writeOpenShellQualificationProvenance(outputPath: string): void { const provenance = { schemaVersion: 1, @@ -161,14 +121,8 @@ export function writeOpenShellQualificationProvenance(outputPath: string): void function runCli(): void { const [command, outputPath, ...extra] = process.argv.slice(2); - if (command === "install" && !outputPath && extra.length === 0) { - process.exitCode = installOpenShellQualification(); - return; - } if (!outputPath || extra.length > 0 || (command !== "select" && command !== "provenance")) { - throw new Error( - "usage: openshell-qualification.mts install | select OUTPUT | provenance OUTPUT", - ); + throw new Error("usage: openshell-qualification.mts select OUTPUT | provenance OUTPUT"); } if (command === "select") writeOpenShellQualificationOutputs(outputPath); else writeOpenShellQualificationProvenance(outputPath); From a081e1597a9b34e773f12c8187c323d2b9b20a1f Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Tue, 18 Aug 2026 00:04:47 -0700 Subject: [PATCH 06/14] docs(ci): distinguish OpenShell release cohorts Signed-off-by: Carlos Villela --- scripts/install-openshell.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install-openshell.sh b/scripts/install-openshell.sh index 6dcbc23271c..0affc89096f 100755 --- a/scripts/install-openshell.sh +++ b/scripts/install-openshell.sh @@ -219,11 +219,11 @@ fi # assets, and GHCR manifests; NemoClaw owns which exact artifacts it trusts. # whyNotSourceFix: NemoClaw cannot retroactively make an upstream publication # immutable, so it independently pins every consumed archive and supervisor. -# regressionTest: test/install-openshell-version-check.test.ts exercises all -# nine mappings, and scripts/check-installer-hash.sh compares them with the -# GitHub release API on every PR, main push, weekly run, and manual dispatch. -# removalCondition: remove these entries only when NemoClaw drops that -# supported release or replaces them with independently verified newer pins. +# OpenShell 0.0.101 is the supported product cohort. OpenShell 0.0.106 is the +# qualification-only cohort. The base-trusted verifier validates each complete +# nine-asset release cohort independently against GitHub release metadata. +# removalCondition: remove a cohort when its product support or qualification +# ends, or replace it with an independently verified release cohort. openshell_pinned_sha256() { local release_tag="$1" asset="$2" case "${release_tag}:${asset}" in From 0cfa9eb43a713358ee0e79b7c4438b6ef693732b Mon Sep 17 00:00:00 2001 From: Prekshi Vyas Date: Tue, 18 Aug 2026 00:17:26 -0700 Subject: [PATCH 07/14] fix(ci): retain base-trusted installer cohort Signed-off-by: Prekshi Vyas --- .github/workflows/e2e.yaml | 6 +- scripts/install-openshell.sh | 42 ++--------- ...ay-auth-contract-workflow-boundary.test.ts | 5 ++ tools/e2e/openshell-qualification.mts | 72 +++++++++++++++---- 4 files changed, 72 insertions(+), 53 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 6c85b295d3e..0432c371873 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -3253,7 +3253,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install - name: Pre-pull pinned gateway auth probe image run: docker pull "$DOCKER_GRPC_PROBE_IMAGE" @@ -3570,7 +3570,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install - name: Write OpenShell provenance if: ${{ matrix.agent == 'deepagents' }} @@ -3688,7 +3688,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install - name: Write OpenShell provenance run: node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts provenance "$E2E_ARTIFACT_DIR/openshell-credential-generation-window/openshell-exact-main-provenance.json" diff --git a/scripts/install-openshell.sh b/scripts/install-openshell.sh index 0affc89096f..d1f2b5332eb 100755 --- a/scripts/install-openshell.sh +++ b/scripts/install-openshell.sh @@ -219,11 +219,11 @@ fi # assets, and GHCR manifests; NemoClaw owns which exact artifacts it trusts. # whyNotSourceFix: NemoClaw cannot retroactively make an upstream publication # immutable, so it independently pins every consumed archive and supervisor. -# OpenShell 0.0.101 is the supported product cohort. OpenShell 0.0.106 is the -# qualification-only cohort. The base-trusted verifier validates each complete -# nine-asset release cohort independently against GitHub release metadata. -# removalCondition: remove a cohort when its product support or qualification -# ends, or replace it with an independently verified release cohort. +# regressionTest: test/install-openshell-version-check.test.ts exercises all +# nine mappings, and scripts/check-installer-hash.sh compares them with the +# GitHub release API on every PR, main push, weekly run, and manual dispatch. +# removalCondition: remove these entries only when NemoClaw drops that +# supported release or replaces them with independently verified newer pins. openshell_pinned_sha256() { local release_tag="$1" asset="$2" case "${release_tag}:${asset}" in @@ -254,33 +254,6 @@ openshell_pinned_sha256() { v0.0.101:openshell.rb) printf '%s\n' "87fadc7b0c854aa44f71d5b3a206865070117cd27825d59c61da252a99f402a2" ;; - v0.0.106:openshell-x86_64-unknown-linux-musl.tar.gz) - printf '%s\n' "d1a885a91b3e5aaa006c36aca95dc78bed0638c1ba1a79b55f1da93211b8a0a0" - ;; - v0.0.106:openshell-aarch64-unknown-linux-musl.tar.gz) - printf '%s\n' "ce981904ae8febd9cd6b3fbceb04e1dcfb48da6042bac08eadf0c2211f83fe55" - ;; - v0.0.106:openshell-aarch64-apple-darwin.tar.gz) - printf '%s\n' "969493205e3d3462226ff613eaba0b9cde0f582e3026294169d533d41e87c905" - ;; - v0.0.106:openshell-gateway-x86_64-unknown-linux-gnu.tar.gz) - printf '%s\n' "b7760cb752a4363c2f21d32298dd0c683dc438f6edfd16c2e4242bc0baefbb7c" - ;; - v0.0.106:openshell-gateway-aarch64-unknown-linux-gnu.tar.gz) - printf '%s\n' "22b7781249e3487085694d0f0f3797a0e549018b81144cd24b2f1118c730d1c7" - ;; - v0.0.106:openshell-gateway-aarch64-apple-darwin.tar.gz) - printf '%s\n' "de8f90db9dd0d3b47855b2b6d2542660730917bd1249e53140300990a8690b94" - ;; - v0.0.106:openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz) - printf '%s\n' "559b8aaad3a8eeab45c511e7de531d9baa98a311282dcb0c2c5f38cc2d4ca355" - ;; - v0.0.106:openshell-sandbox-aarch64-unknown-linux-gnu.tar.gz) - printf '%s\n' "5e5d758d53c6abc6d7a936be907dafa9dfce10423289536f39b50abe294dfafd" - ;; - v0.0.106:openshell.rb) - printf '%s\n' "f0f86519e227b3b326431410058ba690b1a7b83e5af7384014e4b96283d3a642" - ;; *) return 1 ;; @@ -412,11 +385,6 @@ pinned_sandbox_build_version() { 88300e35f153123e4dc3021c537834dd6c0a09665a4a6d3974cd285d512345c4) printf '%s\n' "0.0.101" ;; - # OpenShell v0.0.106 standalone sandbox binaries. - 0031c6b257a23ecc1a2333153918324f3af0005e68abde388858d682ec646c55 | \ - 019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8) - printf '%s\n' "0.0.106" - ;; *) return 1 ;; diff --git a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts index aca40377647..2ecc27ab465 100644 --- a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts +++ b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 +import { execFileSync } from "node:child_process"; import fs from "node:fs"; import os from "node:os"; import path from "node:path"; @@ -14,6 +15,7 @@ import { } from "../../../tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts"; import { OPENSHELL_QUALIFICATION, + materializeOpenShellQualificationInstaller, validateOpenShellQualificationInstaller, writeOpenShellQualificationOutputs, writeOpenShellQualificationProvenance, @@ -24,8 +26,11 @@ describe("OpenShell gateway auth contract workflow boundary", () => { const directory = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-openshell-qualification-")); const outputsPath = path.join(directory, "outputs"); const provenancePath = path.join(directory, "provenance.json"); + const installerPath = path.join(directory, "install-openshell.sh"); try { expect(validateOpenShellQualificationInstaller()).toEqual([]); + fs.writeFileSync(installerPath, materializeOpenShellQualificationInstaller()); + execFileSync("bash", ["-n", installerPath]); writeOpenShellQualificationOutputs(outputsPath); expect(fs.readFileSync(outputsPath, "utf8")).toBe( diff --git a/tools/e2e/openshell-qualification.mts b/tools/e2e/openshell-qualification.mts index 4795446ee70..233301153e1 100644 --- a/tools/e2e/openshell-qualification.mts +++ b/tools/e2e/openshell-qualification.mts @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 +import { spawnSync } from "node:child_process"; import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; @@ -59,8 +60,7 @@ export const OPENSHELL_QUALIFICATION_INSTALL_ENV = Object.freeze({ NEMOCLAW_OPENSHELL_PIN_VERSION: "${{ steps.openshell_qualification.outputs.version }}", }); -export const OPENSHELL_QUALIFICATION_INSTALL_RUN = - "env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh"; +export const OPENSHELL_QUALIFICATION_INSTALL_RUN = `env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN ${TOOL_COMMAND} install`; export const OPENSHELL_QUALIFICATION_SUPERVISOR_OUTPUT = "${{ steps.openshell_qualification.outputs.supervisor_image }}"; @@ -69,20 +69,48 @@ export function openShellQualificationProvenanceCommand(outputPath: string): str return `${TOOL_COMMAND} provenance "${outputPath}"`; } -export function validateOpenShellQualificationInstaller( +function escapeRegExp(value: string): string { + return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&"); +} + +export function materializeOpenShellQualificationInstaller( installerPath: string = INSTALLER_PATH, -): string[] { - const source = fs.readFileSync(installerPath, "utf8"); - const failures: string[] = []; +): string { + let source = fs.readFileSync(installerPath, "utf8"); for (const [asset, sha256] of Object.entries(OPENSHELL_QUALIFICATION.archiveSha256)) { - const pin = - `${OPENSHELL_QUALIFICATION.releaseTag}:${asset})\n` + ` printf '%s\\n' "${sha256}"`; - if (!source.includes(pin)) failures.push(`installer pin is missing for ${asset}`); + const pattern = new RegExp( + ` v${escapeRegExp(OPENSHELL_QUALIFICATION.supportedProductVersion)}:${escapeRegExp(asset)}\\)\\n` + + ` printf '%s\\\\n' "[a-f0-9]{64}"`, + "gu", + ); + const replacement = + ` ${OPENSHELL_QUALIFICATION.releaseTag}:${asset})\n` + ` printf '%s\\n' "${sha256}"`; + if ([...source.matchAll(pattern)].length !== 1) { + throw new Error(`canonical installer has no unique pin owner for ${asset}`); + } + source = source.replace(pattern, replacement); } - if (!source.includes(OPENSHELL_QUALIFICATION.binarySha256.standaloneSandbox)) { - failures.push("installer identity is missing for the Linux x86_64 standalone sandbox binary"); + const fallbackPattern = + /(pinned_sandbox_build_version\(\) \{[\s\S]*?)( \*\)\n return 1)/u; + const fallback = fallbackPattern.exec(source); + if (!fallback) throw new Error("canonical installer has no sandbox identity fallback"); + const sandboxIdentity = + ` # OpenShell ${OPENSHELL_QUALIFICATION.releaseTag} qualification sandbox.\n` + + ` ${OPENSHELL_QUALIFICATION.binarySha256.standaloneSandbox})\n` + + ` printf '%s\\n' "${OPENSHELL_QUALIFICATION.version}"\n` + + ` ;;\n`; + return source.replace(fallbackPattern, `$1${sandboxIdentity}$2`); +} + +export function validateOpenShellQualificationInstaller( + installerPath: string = INSTALLER_PATH, +): string[] { + try { + materializeOpenShellQualificationInstaller(installerPath); + return []; + } catch (error) { + return [error instanceof Error ? error.message : String(error)]; } - return failures; } export function writeOpenShellQualificationOutputs(outputPath: string): void { @@ -98,6 +126,18 @@ export function writeOpenShellQualificationOutputs(outputPath: string): void { ); } +export function installOpenShellQualification(): number { + const installer = materializeOpenShellQualificationInstaller(); + const result = spawnSync("bash", ["-s", "--"], { + env: process.env, + input: installer, + stdio: ["pipe", "inherit", "inherit"], + }); + if (result.error) throw result.error; + if (result.signal) throw new Error(`OpenShell qualification installer received ${result.signal}`); + return result.status ?? 1; +} + export function writeOpenShellQualificationProvenance(outputPath: string): void { const provenance = { schemaVersion: 1, @@ -121,8 +161,14 @@ export function writeOpenShellQualificationProvenance(outputPath: string): void function runCli(): void { const [command, outputPath, ...extra] = process.argv.slice(2); + if (command === "install" && !outputPath && extra.length === 0) { + process.exitCode = installOpenShellQualification(); + return; + } if (!outputPath || extra.length > 0 || (command !== "select" && command !== "provenance")) { - throw new Error("usage: openshell-qualification.mts select OUTPUT | provenance OUTPUT"); + throw new Error( + "usage: openshell-qualification.mts install | select OUTPUT | provenance OUTPUT", + ); } if (command === "select") writeOpenShellQualificationOutputs(outputPath); else writeOpenShellQualificationProvenance(outputPath); From 3cbcc5c0455a00f25e831a083c0c56c7a715a262 Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Tue, 18 Aug 2026 00:24:34 -0700 Subject: [PATCH 08/14] fix(ci): restore checked-in OpenShell installer Signed-off-by: Carlos Villela --- .github/workflows/e2e.yaml | 6 +- scripts/install-openshell.sh | 42 +++++++++-- ...ay-auth-contract-workflow-boundary.test.ts | 5 -- tools/e2e/openshell-qualification.mts | 72 ++++--------------- 4 files changed, 53 insertions(+), 72 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 0432c371873..6c85b295d3e 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -3253,7 +3253,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh - name: Pre-pull pinned gateway auth probe image run: docker pull "$DOCKER_GRPC_PROBE_IMAGE" @@ -3570,7 +3570,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh - name: Write OpenShell provenance if: ${{ matrix.agent == 'deepagents' }} @@ -3688,7 +3688,7 @@ jobs: NEMOCLAW_OPENSHELL_MAX_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_MIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} NEMOCLAW_OPENSHELL_PIN_VERSION: ${{ steps.openshell_qualification.outputs.version }} - run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts install + run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh - name: Write OpenShell provenance run: node --experimental-strip-types --no-warnings tools/e2e/openshell-qualification.mts provenance "$E2E_ARTIFACT_DIR/openshell-credential-generation-window/openshell-exact-main-provenance.json" diff --git a/scripts/install-openshell.sh b/scripts/install-openshell.sh index d1f2b5332eb..0affc89096f 100755 --- a/scripts/install-openshell.sh +++ b/scripts/install-openshell.sh @@ -219,11 +219,11 @@ fi # assets, and GHCR manifests; NemoClaw owns which exact artifacts it trusts. # whyNotSourceFix: NemoClaw cannot retroactively make an upstream publication # immutable, so it independently pins every consumed archive and supervisor. -# regressionTest: test/install-openshell-version-check.test.ts exercises all -# nine mappings, and scripts/check-installer-hash.sh compares them with the -# GitHub release API on every PR, main push, weekly run, and manual dispatch. -# removalCondition: remove these entries only when NemoClaw drops that -# supported release or replaces them with independently verified newer pins. +# OpenShell 0.0.101 is the supported product cohort. OpenShell 0.0.106 is the +# qualification-only cohort. The base-trusted verifier validates each complete +# nine-asset release cohort independently against GitHub release metadata. +# removalCondition: remove a cohort when its product support or qualification +# ends, or replace it with an independently verified release cohort. openshell_pinned_sha256() { local release_tag="$1" asset="$2" case "${release_tag}:${asset}" in @@ -254,6 +254,33 @@ openshell_pinned_sha256() { v0.0.101:openshell.rb) printf '%s\n' "87fadc7b0c854aa44f71d5b3a206865070117cd27825d59c61da252a99f402a2" ;; + v0.0.106:openshell-x86_64-unknown-linux-musl.tar.gz) + printf '%s\n' "d1a885a91b3e5aaa006c36aca95dc78bed0638c1ba1a79b55f1da93211b8a0a0" + ;; + v0.0.106:openshell-aarch64-unknown-linux-musl.tar.gz) + printf '%s\n' "ce981904ae8febd9cd6b3fbceb04e1dcfb48da6042bac08eadf0c2211f83fe55" + ;; + v0.0.106:openshell-aarch64-apple-darwin.tar.gz) + printf '%s\n' "969493205e3d3462226ff613eaba0b9cde0f582e3026294169d533d41e87c905" + ;; + v0.0.106:openshell-gateway-x86_64-unknown-linux-gnu.tar.gz) + printf '%s\n' "b7760cb752a4363c2f21d32298dd0c683dc438f6edfd16c2e4242bc0baefbb7c" + ;; + v0.0.106:openshell-gateway-aarch64-unknown-linux-gnu.tar.gz) + printf '%s\n' "22b7781249e3487085694d0f0f3797a0e549018b81144cd24b2f1118c730d1c7" + ;; + v0.0.106:openshell-gateway-aarch64-apple-darwin.tar.gz) + printf '%s\n' "de8f90db9dd0d3b47855b2b6d2542660730917bd1249e53140300990a8690b94" + ;; + v0.0.106:openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz) + printf '%s\n' "559b8aaad3a8eeab45c511e7de531d9baa98a311282dcb0c2c5f38cc2d4ca355" + ;; + v0.0.106:openshell-sandbox-aarch64-unknown-linux-gnu.tar.gz) + printf '%s\n' "5e5d758d53c6abc6d7a936be907dafa9dfce10423289536f39b50abe294dfafd" + ;; + v0.0.106:openshell.rb) + printf '%s\n' "f0f86519e227b3b326431410058ba690b1a7b83e5af7384014e4b96283d3a642" + ;; *) return 1 ;; @@ -385,6 +412,11 @@ pinned_sandbox_build_version() { 88300e35f153123e4dc3021c537834dd6c0a09665a4a6d3974cd285d512345c4) printf '%s\n' "0.0.101" ;; + # OpenShell v0.0.106 standalone sandbox binaries. + 0031c6b257a23ecc1a2333153918324f3af0005e68abde388858d682ec646c55 | \ + 019301ec8618abbed8135e8d39dde7bea47e5e92813bbc17768550de34db59f8) + printf '%s\n' "0.0.106" + ;; *) return 1 ;; diff --git a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts index 2ecc27ab465..aca40377647 100644 --- a/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts +++ b/test/e2e/support/openshell-gateway-auth-contract-workflow-boundary.test.ts @@ -1,7 +1,6 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -import { execFileSync } from "node:child_process"; import fs from "node:fs"; import os from "node:os"; import path from "node:path"; @@ -15,7 +14,6 @@ import { } from "../../../tools/e2e/openshell-gateway-auth-contract-workflow-boundary.mts"; import { OPENSHELL_QUALIFICATION, - materializeOpenShellQualificationInstaller, validateOpenShellQualificationInstaller, writeOpenShellQualificationOutputs, writeOpenShellQualificationProvenance, @@ -26,11 +24,8 @@ describe("OpenShell gateway auth contract workflow boundary", () => { const directory = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-openshell-qualification-")); const outputsPath = path.join(directory, "outputs"); const provenancePath = path.join(directory, "provenance.json"); - const installerPath = path.join(directory, "install-openshell.sh"); try { expect(validateOpenShellQualificationInstaller()).toEqual([]); - fs.writeFileSync(installerPath, materializeOpenShellQualificationInstaller()); - execFileSync("bash", ["-n", installerPath]); writeOpenShellQualificationOutputs(outputsPath); expect(fs.readFileSync(outputsPath, "utf8")).toBe( diff --git a/tools/e2e/openshell-qualification.mts b/tools/e2e/openshell-qualification.mts index 233301153e1..4795446ee70 100644 --- a/tools/e2e/openshell-qualification.mts +++ b/tools/e2e/openshell-qualification.mts @@ -1,7 +1,6 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -import { spawnSync } from "node:child_process"; import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; @@ -60,7 +59,8 @@ export const OPENSHELL_QUALIFICATION_INSTALL_ENV = Object.freeze({ NEMOCLAW_OPENSHELL_PIN_VERSION: "${{ steps.openshell_qualification.outputs.version }}", }); -export const OPENSHELL_QUALIFICATION_INSTALL_RUN = `env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN ${TOOL_COMMAND} install`; +export const OPENSHELL_QUALIFICATION_INSTALL_RUN = + "env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh"; export const OPENSHELL_QUALIFICATION_SUPERVISOR_OUTPUT = "${{ steps.openshell_qualification.outputs.supervisor_image }}"; @@ -69,48 +69,20 @@ export function openShellQualificationProvenanceCommand(outputPath: string): str return `${TOOL_COMMAND} provenance "${outputPath}"`; } -function escapeRegExp(value: string): string { - return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&"); -} - -export function materializeOpenShellQualificationInstaller( - installerPath: string = INSTALLER_PATH, -): string { - let source = fs.readFileSync(installerPath, "utf8"); - for (const [asset, sha256] of Object.entries(OPENSHELL_QUALIFICATION.archiveSha256)) { - const pattern = new RegExp( - ` v${escapeRegExp(OPENSHELL_QUALIFICATION.supportedProductVersion)}:${escapeRegExp(asset)}\\)\\n` + - ` printf '%s\\\\n' "[a-f0-9]{64}"`, - "gu", - ); - const replacement = - ` ${OPENSHELL_QUALIFICATION.releaseTag}:${asset})\n` + ` printf '%s\\n' "${sha256}"`; - if ([...source.matchAll(pattern)].length !== 1) { - throw new Error(`canonical installer has no unique pin owner for ${asset}`); - } - source = source.replace(pattern, replacement); - } - const fallbackPattern = - /(pinned_sandbox_build_version\(\) \{[\s\S]*?)( \*\)\n return 1)/u; - const fallback = fallbackPattern.exec(source); - if (!fallback) throw new Error("canonical installer has no sandbox identity fallback"); - const sandboxIdentity = - ` # OpenShell ${OPENSHELL_QUALIFICATION.releaseTag} qualification sandbox.\n` + - ` ${OPENSHELL_QUALIFICATION.binarySha256.standaloneSandbox})\n` + - ` printf '%s\\n' "${OPENSHELL_QUALIFICATION.version}"\n` + - ` ;;\n`; - return source.replace(fallbackPattern, `$1${sandboxIdentity}$2`); -} - export function validateOpenShellQualificationInstaller( installerPath: string = INSTALLER_PATH, ): string[] { - try { - materializeOpenShellQualificationInstaller(installerPath); - return []; - } catch (error) { - return [error instanceof Error ? error.message : String(error)]; + const source = fs.readFileSync(installerPath, "utf8"); + const failures: string[] = []; + for (const [asset, sha256] of Object.entries(OPENSHELL_QUALIFICATION.archiveSha256)) { + const pin = + `${OPENSHELL_QUALIFICATION.releaseTag}:${asset})\n` + ` printf '%s\\n' "${sha256}"`; + if (!source.includes(pin)) failures.push(`installer pin is missing for ${asset}`); } + if (!source.includes(OPENSHELL_QUALIFICATION.binarySha256.standaloneSandbox)) { + failures.push("installer identity is missing for the Linux x86_64 standalone sandbox binary"); + } + return failures; } export function writeOpenShellQualificationOutputs(outputPath: string): void { @@ -126,18 +98,6 @@ export function writeOpenShellQualificationOutputs(outputPath: string): void { ); } -export function installOpenShellQualification(): number { - const installer = materializeOpenShellQualificationInstaller(); - const result = spawnSync("bash", ["-s", "--"], { - env: process.env, - input: installer, - stdio: ["pipe", "inherit", "inherit"], - }); - if (result.error) throw result.error; - if (result.signal) throw new Error(`OpenShell qualification installer received ${result.signal}`); - return result.status ?? 1; -} - export function writeOpenShellQualificationProvenance(outputPath: string): void { const provenance = { schemaVersion: 1, @@ -161,14 +121,8 @@ export function writeOpenShellQualificationProvenance(outputPath: string): void function runCli(): void { const [command, outputPath, ...extra] = process.argv.slice(2); - if (command === "install" && !outputPath && extra.length === 0) { - process.exitCode = installOpenShellQualification(); - return; - } if (!outputPath || extra.length > 0 || (command !== "select" && command !== "provenance")) { - throw new Error( - "usage: openshell-qualification.mts install | select OUTPUT | provenance OUTPUT", - ); + throw new Error("usage: openshell-qualification.mts select OUTPUT | provenance OUTPUT"); } if (command === "select") writeOpenShellQualificationOutputs(outputPath); else writeOpenShellQualificationProvenance(outputPath); From 76fcafb3581faaf70cd9c621f43363fd779a77d5 Mon Sep 17 00:00:00 2001 From: Prekshi Vyas Date: Tue, 18 Aug 2026 00:27:12 -0700 Subject: [PATCH 09/14] ci: refresh trusted qualification base Signed-off-by: Prekshi Vyas From 1f5fa08b9bfc793a24543c2ac3eaf63cbbbafc97 Mon Sep 17 00:00:00 2001 From: Prekshi Vyas Date: Tue, 18 Aug 2026 00:30:09 -0700 Subject: [PATCH 10/14] fix(ci): preserve trusted installer template Signed-off-by: Prekshi Vyas --- scripts/install-openshell.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/install-openshell.sh b/scripts/install-openshell.sh index 0affc89096f..f4c8ca4b322 100755 --- a/scripts/install-openshell.sh +++ b/scripts/install-openshell.sh @@ -219,12 +219,15 @@ fi # assets, and GHCR manifests; NemoClaw owns which exact artifacts it trusts. # whyNotSourceFix: NemoClaw cannot retroactively make an upstream publication # immutable, so it independently pins every consumed archive and supervisor. -# OpenShell 0.0.101 is the supported product cohort. OpenShell 0.0.106 is the -# qualification-only cohort. The base-trusted verifier validates each complete -# nine-asset release cohort independently against GitHub release metadata. -# removalCondition: remove a cohort when its product support or qualification -# ends, or replace it with an independently verified release cohort. +# regressionTest: test/install-openshell-version-check.test.ts exercises all +# nine mappings, and scripts/check-installer-hash.sh compares them with the +# GitHub release API on every PR, main push, weekly run, and manual dispatch. +# removalCondition: remove these entries only when NemoClaw drops that +# supported release or replaces them with independently verified newer pins. openshell_pinned_sha256() { + # OpenShell 0.0.101 is the supported product cohort. OpenShell 0.0.106 is the + # qualification-only cohort. The base-trusted verifier validates each + # complete nine-asset release cohort independently. local release_tag="$1" asset="$2" case "${release_tag}:${asset}" in v0.0.101:openshell-x86_64-unknown-linux-musl.tar.gz) From a4891e8b5b60ca340c29199b84de73e4b2147150 Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Tue, 18 Aug 2026 00:34:28 -0700 Subject: [PATCH 11/14] ci(e2e): refresh OpenShell qualification checks Signed-off-by: Carlos Villela From e1166f5c32504a1bb3024fe04f1c79166337c7eb Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Tue, 18 Aug 2026 00:35:56 -0700 Subject: [PATCH 12/14] docs(ci): describe OpenShell release cohorts Signed-off-by: Carlos Villela --- scripts/install-openshell.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/install-openshell.sh b/scripts/install-openshell.sh index f4c8ca4b322..0affc89096f 100755 --- a/scripts/install-openshell.sh +++ b/scripts/install-openshell.sh @@ -219,15 +219,12 @@ fi # assets, and GHCR manifests; NemoClaw owns which exact artifacts it trusts. # whyNotSourceFix: NemoClaw cannot retroactively make an upstream publication # immutable, so it independently pins every consumed archive and supervisor. -# regressionTest: test/install-openshell-version-check.test.ts exercises all -# nine mappings, and scripts/check-installer-hash.sh compares them with the -# GitHub release API on every PR, main push, weekly run, and manual dispatch. -# removalCondition: remove these entries only when NemoClaw drops that -# supported release or replaces them with independently verified newer pins. +# OpenShell 0.0.101 is the supported product cohort. OpenShell 0.0.106 is the +# qualification-only cohort. The base-trusted verifier validates each complete +# nine-asset release cohort independently against GitHub release metadata. +# removalCondition: remove a cohort when its product support or qualification +# ends, or replace it with an independently verified release cohort. openshell_pinned_sha256() { - # OpenShell 0.0.101 is the supported product cohort. OpenShell 0.0.106 is the - # qualification-only cohort. The base-trusted verifier validates each - # complete nine-asset release cohort independently. local release_tag="$1" asset="$2" case "${release_tag}:${asset}" in v0.0.101:openshell-x86_64-unknown-linux-musl.tar.gz) From 257d2cea6e42a9d4afa3c99fffed56c2005ef26f Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Tue, 18 Aug 2026 00:51:41 -0700 Subject: [PATCH 13/14] fix(ci): validate multi-release qualification boundaries Signed-off-by: Carlos Villela --- .../verify-openshell-e2e-qualification.mts | 7 +++++-- .../mcp-workflow-compatibility.test.ts | 20 +++++++++++++++++++ tools/e2e/mcp-workflow-boundary.mts | 20 +++++++++++++++++-- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/scripts/checks/verify-openshell-e2e-qualification.mts b/scripts/checks/verify-openshell-e2e-qualification.mts index c74850bb134..9309de075a0 100644 --- a/scripts/checks/verify-openshell-e2e-qualification.mts +++ b/scripts/checks/verify-openshell-e2e-qualification.mts @@ -575,7 +575,6 @@ export function extractOpenShellVersion(root: string): string { sourceLabel: "Brev launchable", }); const versions = [ - ...installerPins.map((pin) => pin.releaseVersion), ...brevPins.map((pin) => pin.releaseVersion), exactVersion( installer, @@ -606,7 +605,11 @@ export function extractOpenShellVersion(root: string): string { ]; const unique = [...new Set(versions)].sort(); if (unique.length !== 1) fail(`OpenShell version surfaces disagree: ${unique.join(", ")}`); - return unique[0] ?? fail("OpenShell version is missing"); + const version = unique[0] ?? fail("OpenShell version is missing"); + if (!installerPins.some((pin) => pin.releaseVersion === version)) { + fail(`installer has no pin cohort for selected OpenShell version ${version}`); + } + return version; } function extractUpgradeFixtureRequirement( diff --git a/test/e2e/support/mcp-workflow-compatibility.test.ts b/test/e2e/support/mcp-workflow-compatibility.test.ts index f14b1d97e2e..c313eaffb32 100644 --- a/test/e2e/support/mcp-workflow-compatibility.test.ts +++ b/test/e2e/support/mcp-workflow-compatibility.test.ts @@ -12,6 +12,26 @@ import { validateMcpOpenShellWorkflowBoundary } from "../../../tools/e2e/mcp-wor import { requireFixture } from "./require-fixture"; describe("MCP workflow runtime compatibility", () => { + it("rejects inference credentials passed to the stable MCP job", () => { + const directory = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-mcp-workflow-")); + const workflowPath = path.join(directory, "e2e.yaml"); + try { + const workflow = YAML.parse(fs.readFileSync(".github/workflows/e2e.yaml", "utf8")) as { + jobs: Record }>; + }; + const job = workflow.jobs["mcp-bridge"]; + requireFixture(job, "stable MCP job fixture is missing"); + job.env.NVIDIA_API_KEY = "${{ secrets.NVIDIA_API_KEY }}"; + fs.writeFileSync(workflowPath, YAML.stringify(workflow)); + + expect(validateMcpOpenShellWorkflowBoundary(workflowPath)).toContain( + "mcp-bridge must not receive inference or GitHub credentials", + ); + } finally { + fs.rmSync(directory, { force: true, recursive: true }); + } + }); + it("accepts compatibility-step keys in any order (#6426)", () => { const directory = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-mcp-workflow-")); const workflowPath = path.join(directory, "e2e.yaml"); diff --git a/tools/e2e/mcp-workflow-boundary.mts b/tools/e2e/mcp-workflow-boundary.mts index fbeaddc8339..297adf12619 100644 --- a/tools/e2e/mcp-workflow-boundary.mts +++ b/tools/e2e/mcp-workflow-boundary.mts @@ -122,6 +122,22 @@ function asSteps(job: UnknownRecord): UnknownRecord[] { return Array.isArray(steps) ? steps.map(asRecord) : []; } +function receivesForbiddenCredentials(job: UnknownRecord): boolean { + const steps = asSteps(job); + const credentialInputs = [ + asRecord(job.env), + ...steps.flatMap((step) => [asRecord(step.env), asRecord(step.with)]), + ]; + if (FORBIDDEN_INFERENCE_SECRETS.test(JSON.stringify(credentialInputs))) return true; + return steps.some((step) => { + const expressions = asString(step.run).match(/\$\{\{[^}]+\}\}/gu) ?? []; + return expressions.some( + (expression) => + FORBIDDEN_INFERENCE_SECRETS.test(expression) || /\bgithub\.token\b/iu.test(expression), + ); + }); +} + function namedStep(job: UnknownRecord, name: string): UnknownRecord { return asSteps(job).find((step) => step.name === name) ?? {}; } @@ -304,7 +320,7 @@ function validateJobSecurity( errors.push(`${jobName} checkout must set persist-credentials:false`); } } - if (FORBIDDEN_INFERENCE_SECRETS.test(JSON.stringify(job))) { + if (receivesForbiddenCredentials(job)) { errors.push(`${jobName} must not receive inference or GitHub credentials`); } @@ -786,7 +802,7 @@ function validateDevArtifactJob(errors: string[], job: UnknownRecord): void { ) { errors.push(`${DEV_ARTIFACT_JOB} must expose only the immutable artifact identity`); } - if (FORBIDDEN_INFERENCE_SECRETS.test(JSON.stringify(job))) { + if (receivesForbiddenCredentials(job)) { errors.push(`${DEV_ARTIFACT_JOB} must not receive inference or GitHub credentials`); } From 1fbffa20e50d6ba26cc9c1c3707a9b07982b6fd5 Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Tue, 18 Aug 2026 00:57:29 -0700 Subject: [PATCH 14/14] ci(e2e): refresh minimal stacked checks Signed-off-by: Carlos Villela