Skip to content

fix(e2e): prebuild trusted EXDEV fixture image - #8654

Merged
apurvvkumaria merged 2 commits into
mainfrom
codex/fix-exdev-trusted-prebuild
Aug 9, 2026
Merged

fix(e2e): prebuild trusted EXDEV fixture image#8654
apurvvkumaria merged 2 commits into
mainfrom
codex/fix-exdev-trusted-prebuild

Conversation

@apurvvkumaria

@apurvvkumaria apurvvkumaria commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

The current-checkout OpenClaw EXDEV lifecycle fixture now prebuilds its repository-controlled v1 and v2 images with local BuildKit, then passes only validated fixture-owned tags to the test OpenShell wrapper. This avoids the failing classic gateway build without changing the product's arbitrary custom-Dockerfile trust boundary, and it guarantees partial-build image cleanup.

Related Issue

Related to #8590. This PR does not close the umbrella issue.

Changes

  • Add a test-only trusted-prebuild helper for the current OpenClaw EXDEV lifecycle fixture. It stages only repository-controlled source, resolves the compatible sandbox base, requires local BuildKit, validates the immutable image identity, and hands the selected local tag to OpenShell through an argv-only wrapper.
  • Keep arbitrary user-supplied --from Dockerfiles on the existing origin=custom gateway-builder path. The fixture-only origin=generated bridge is required by the current OpenShell 0.0.99 builder path; changing the product path directly would weaken that trust boundary.
  • Register each regex-validated fixture tag for cleanup before the fail-closed immutable-ID assertion. Focused support coverage proves an identity-assertion failure still removes the image and that cleanup runs sandbox, v2 image, then v1 image in LIFO order.
  • Update the current lifecycle contract, wrapper negative coverage, and internal E2E README for the trusted local-image handoff.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: This changes only the E2E fixture and its internal README; production CLI, configuration, policy, and arbitrary custom-Dockerfile behavior are unchanged.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: An independent Codex Desktop exact-diff review approved stable patch ID 797491a9b65ccc32787c7031b9cf6ceee523d895 with all nine security categories passing and no findings.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: test/e2e/README.md documents the fixture-only BuildKit handoff. No page under docs/ changes because the production user experience and documented product behavior are unchanged.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: 27 focused CLI and E2E-support tests passed; the focused live wrapper contract passed with three unrelated tests skipped by selector.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: Not run; the change is isolated to one live fixture and its focused support contract. Repository checks, CLI type checking, source-shape, test-size, title, project-membership, secret-scan, and diff gates passed.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Apurv Kumaria akumaria@nvidia.com

Summary by CodeRabbit

  • Tests
    • Added end-to-end coverage for trusted plugin image prebuilds during sandbox creation and recreation.
    • Added validation for immutable image identity, image selection, and Dockerfile handling.
    • Added cleanup tests confirming temporary images and artifacts are removed in the correct order.
  • Documentation
    • Clarified that current-checkout fixtures are prebuilt locally, while user-provided Dockerfiles remain gateway-managed.

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria apurvvkumaria self-assigned this Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 94708ef6-3e71-412d-b899-d16c9f361cc5

📥 Commits

Reviewing files that changed from the base of the PR and between f32febc and 615578c.

📒 Files selected for processing (2)
  • test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts
  • test/e2e/support/openclaw-plugin-runtime-exdev-trusted-prebuild.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts

📝 Walkthrough

Walkthrough

Changes

Trusted EXDEV prebuild flow

Layer / File(s) Summary
Trusted OpenShell image wrapper
test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts, test/e2e/live/openclaw-plugin-runtime-exdev.test.ts
Adds trusted image validation, image selection, Dockerfile source replacement, and wrapper contract coverage.
Fixture image build and cleanup
test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts, test/e2e/support/openclaw-plugin-runtime-exdev-trusted-prebuild.test.ts
Builds staged fixture images with local BuildKit, validates immutable image IDs, records artifacts, and removes images in LIFO order.
EXDEV lifecycle integration
test/e2e/live/openclaw-plugin-runtime-exdev.test.ts, test/e2e/README.md
Builds and selects v1 and v2 images for onboarding and recreation. Documents the local prebuild and trust boundary.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LifecycleTest
  participant buildTrustedPluginFixtureImage
  participant LocalSandboxPrebuild
  participant Docker
  participant OpenShell
  LifecycleTest->>buildTrustedPluginFixtureImage: build trusted v1 or v2 fixture image
  buildTrustedPluginFixtureImage->>LocalSandboxPrebuild: submit staged Docker context
  LocalSandboxPrebuild->>Docker: build tagged image
  Docker-->>LocalSandboxPrebuild: return image reference and immutable image ID
  LocalSandboxPrebuild-->>LifecycleTest: return validated trusted image
  LifecycleTest->>OpenShell: create sandbox with selected image
  OpenShell-->>LifecycleTest: use rewritten trusted --from source
Loading

Possibly related PRs

  • NVIDIA/NemoClaw#8477: Both PRs modify E2E workflow selection or documentation and share the same E2E test infrastructure.
  • NVIDIA/NemoClaw#8523: Both PRs modify test/e2e/live/openclaw-plugin-runtime-exdev.test.ts and OpenShell compatibility coverage.

Suggested labels: area: sandbox, bug-fix

Suggested reviewers: cv, jyaunches, senthilr-nv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the E2E fix for prebuilding trusted EXDEV fixture images.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-exdev-trusted-prebuild

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 615578c in the codex/fix-exdev-trus... branch remains at 96%, unchanged from commit 8096cdd in the main branch.


Updated August 09, 2026 21:47 UTC

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/e2e/support/openclaw-plugin-runtime-exdev-trusted-prebuild.test.ts (1)

78-84: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for a failed image removal.

Every mocked docker image rm call returns exit code 0. The cleanup step aborts on the first non-zero exit code, so the remaining images are never removed. This test cannot detect that behavior. Add a case where the first removal returns a non-zero exit code, then assert that the second removal still runs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/e2e/support/openclaw-plugin-runtime-exdev-trusted-prebuild.test.ts`
around lines 78 - 84, Extend the cleanup test around the mocked docker image
removal calls to make the first `docker image rm` return a non-zero exit code,
then assert cleanup continues by verifying the second image removal is invoked.
Preserve the existing call ordering and image arguments while covering the
failed-first-removal path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts`:
- Around line 131-144: The cleanup callback in
test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts:131-144 should
collect failed docker image removals, continue processing every image, and
assert after the loop that no removals failed. In
test/e2e/support/openclaw-plugin-runtime-exdev-trusted-prebuild.test.ts:78-84,
add coverage where the first mocked removal fails, verify the second removal
still runs, and verify the cleanup step reports the failure.

---

Nitpick comments:
In `@test/e2e/support/openclaw-plugin-runtime-exdev-trusted-prebuild.test.ts`:
- Around line 78-84: Extend the cleanup test around the mocked docker image
removal calls to make the first `docker image rm` return a non-zero exit code,
then assert cleanup continues by verifying the second image removal is invoked.
Preserve the existing call ordering and image arguments while covering the
failed-first-removal path.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3417e6b2-d3d0-4dbc-b91d-306194dec1fe

📥 Commits

Reviewing files that changed from the base of the PR and between 8096cdd and f32febc.

📒 Files selected for processing (4)
  • test/e2e/README.md
  • test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts
  • test/e2e/live/openclaw-plugin-runtime-exdev.test.ts
  • test/e2e/support/openclaw-plugin-runtime-exdev-trusted-prebuild.test.ts

Comment thread test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts
Comment thread test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts Fixed
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized terminology decisions differ; normalized E2E selections differ; severity counts match.
3 terminology differences from the second opinion

Advisory only. These are normalized differences from the primary terminology receipt.

  • delegated-capability at test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts:29: selected only by the second-opinion lane as established.
  • repository-controlled at test/e2e/README.md:303: selected only by the second-opinion lane as established.
  • trusted prebuild at test/e2e/live/openclaw-plugin-runtime-exdev.test.ts:50: selected only by the second-opinion lane as justified.
1 additional E2E selection from the second opinion

Advisory only. The primary lane did not select these E2E jobs or targets.

  • rebuild-openclaw: The completed second-opinion lane identified E2E coverage that the primary lane omitted.

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

2 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • justified — trusted EXDEV fixture image at test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts:130: Keep the modifier because it names the fixture ownership and trust distinction.
  • justified — current-checkout fixture at test/e2e/README.md:303: Keep the modifier because it distinguishes the source and build trust boundary from release-baseline coverage.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite against this exact revision.

Recommended E2E: cloud-inference, cloud-onboard, security-posture, openclaw-plugin-runtime-exdev, openclaw-plugin-runtime-exdev-release

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

Comment thread test/e2e/live/openclaw-plugin-runtime-exdev-trusted-prebuild.ts Outdated
@apurvvkumaria
apurvvkumaria enabled auto-merge (squash) August 9, 2026 21:43
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria
apurvvkumaria disabled auto-merge August 9, 2026 21:45
@apurvvkumaria
apurvvkumaria enabled auto-merge (squash) August 9, 2026 21:50
@apurvvkumaria
apurvvkumaria merged commit 1a8e6bd into main Aug 9, 2026
64 checks passed
@apurvvkumaria
apurvvkumaria deleted the codex/fix-exdev-trusted-prebuild branch August 9, 2026 21:51
@github-actions github-actions Bot added the v0.0.106 Release target label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.106 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants