fix(e2e): repair protected managed-image qualification - #8762
Conversation
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 5ee4160 in the TypeScript / code-coverage/cliThe overall coverage in commit 5ee4160 in the Show a code coverage summary of the most impacted files.
Updated |
📝 WalkthroughWalkthroughThe changes use ChangesGateway cleanup hardening
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ManagedImageE2E
participant stopHostGatewayProcesses
participant GatewayRemoval
participant StateDirectory
ManagedImageE2E->>stopHostGatewayProcesses: stop scoped OpenShell gateway
stopHostGatewayProcesses-->>ManagedImageE2E: return stop and ownership status
ManagedImageE2E->>GatewayRemoval: remove gateway
GatewayRemoval-->>ManagedImageE2E: return status 0 or failure
ManagedImageE2E->>StateDirectory: remove state only after successful checks
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
5 terminology differences from the second opinionAdvisory only. These are normalized differences from the primary terminology receipt.
2 additional E2E selections from the second opinionAdvisory only. The primary lane did not select these E2E jobs or targets.
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. 3 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite against this exact revision. Recommended E2E: This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@scripts/checks/run-managed-image-openshell-e2e.ts`:
- Around line 146-175: Make REQUIRED_ONBOARD_OPERATIONS an exported canonical
tuple from resolveManagedImageOnboardModule’s module, and update
test/managed-image-protected-runtime-contract.test.ts to import it and derive
its validation loop rather than duplicating the five keys. Add a namespace-only
fixture to exercise the resolver’s importRecord/default branch, while retaining
coverage for valid imports and missing operations without introducing false
positives.
🪄 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: 58d28cf6-3fcf-4143-9953-9d8060a536a4
📒 Files selected for processing (2)
scripts/checks/run-managed-image-openshell-e2e.tstest/managed-image-protected-runtime-contract.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- test/managed-image-protected-runtime-contract.test.ts
| const REQUIRED_ONBOARD_OPERATIONS = [ | ||
| "openshellArgv", | ||
| "runOpenshell", | ||
| "runCaptureOpenshell", | ||
| "sleepSeconds", | ||
| "startGatewayForRecovery", | ||
| ] as const satisfies readonly (keyof OnboardModule)[]; | ||
|
|
||
| export function resolveManagedImageOnboardModule(onboardImport: unknown): OnboardModule { | ||
| const importRecord = | ||
| typeof onboardImport === "object" && onboardImport !== null | ||
| ? (onboardImport as Record<string, unknown>) | ||
| : null; | ||
| const candidate = | ||
| importRecord && "default" in importRecord ? importRecord.default : onboardImport; | ||
| const candidateRecord = | ||
| typeof candidate === "object" && candidate !== null | ||
| ? (candidate as Record<string, unknown>) | ||
| : null; | ||
| const missing = REQUIRED_ONBOARD_OPERATIONS.filter( | ||
| (operation) => typeof candidateRecord?.[operation] !== "function", | ||
| ); | ||
| if (missing.length > 0) { | ||
| throw new Error( | ||
| `managed-image onboard module is missing required operation(s): ${missing.join(", ")}`, | ||
| ); | ||
| } | ||
| return candidate as OnboardModule; | ||
| } | ||
|
|
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Make the onboarding contract inventory canonical.
REQUIRED_ONBOARD_OPERATIONS duplicates the OnboardModule keys and the five-operation list in test/managed-image-protected-runtime-contract.test.ts. A change to only one list can make the runtime guard and tests disagree. Export the tuple and derive the test loop from it. Add a namespace-only fixture because the current tests cover the real import and a missing operation under default, but not the namespace branch. (raw.githubusercontent.com)
As per path instructions, “Derive inventories and limits from a canonical source where possible; flag duplicated lists that can silently drift” and “Require focused tests for both detection and false-positive behavior.”
🤖 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 `@scripts/checks/run-managed-image-openshell-e2e.ts` around lines 146 - 175,
Make REQUIRED_ONBOARD_OPERATIONS an exported canonical tuple from
resolveManagedImageOnboardModule’s module, and update
test/managed-image-protected-runtime-contract.test.ts to import it and derive
its validation loop rather than duplicating the five keys. Add a namespace-only
fixture to exercise the resolver’s importRecord/default branch, while retaining
coverage for valid imports and missing operations without introducing false
positives.
Source: Path instructions
<!-- markdownlint-disable MD041 --> ## Summary This PR updates the August 10, 2026 v0.0.106 release entry with gateway readiness fixes that merged after PR #8756. PRs #8765, #8767, and #8768 remain outside this entry because they are open and do not carry the `v0.0.106` release label. ## Changes - Document acceptance of OpenShell v0.0.101 `Server:` endpoint output and target-bound process tags when trusted listener evidence matches the configured gateway. - Document preservation of selected-gateway stale state so onboarding can reconcile a registered gateway when a gateway-scoped OpenShell status check cannot connect. - Record evidence-backed exclusions for internal image, startup, qualification, proxy-environment, CI, and test-harness changes in PRs #8754, #8609, #8762, #8432, #8766, and #8581. - Exclude PRs #8765, #8767, and #8768 because their changes are absent from `main` and the PRs do not carry the `v0.0.106` release label. The release entry must be updated after any of those PRs merges for v0.0.106. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [x] Existing tests cover changed behavior — justification: `test/changelog-docs.test.ts` validates dated changelog SPDX placement, version headings, forbidden terms, and link form. - [ ] Tests not applicable — justification: - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] 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: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `docs-updated` - Evidence: `docs/changelog/2026-08-10.mdx`; an independent Codex Desktop subagent reviewed the writing rules and documentation style, terminology, structure, voice, code-sample presentation, links, source and test accuracy, release meaning, product scope, and evidence-backed exclusions at commit `190bf882c`. - Agent: Codex Desktop <!-- docs-review-head-sha: 190bf88 --> <!-- docs-review-agents-blob-sha: c4923a3 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: Not applicable; `scripts/prepare-dgx-station-host.sh` is unchanged. - Station profile/scenario: Not applicable. - Result: Not applicable. - Supporting evidence: Not applicable. ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] 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 - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: `npx vitest run test/changelog-docs.test.ts` passed 6 tests. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Not applicable to a documentation-only release-entry update. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) — result: passed with 0 errors and 2 existing warnings. - [x] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) — no page was added. --- Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved gateway readiness detection for OpenShell v0.0.101 endpoint output. * Process tags are now accepted only when they match trusted listener information for the configured gateway. * Preserved stale gateway status during connection failures to support accurate onboarding reconciliation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Summary
Repairs the trusted protected managed-image qualification after it failed before candidate launch because required onboarding operations were not exported. Cleanup now uses the existing state-scoped gateway ownership boundary, recognizes exited zombie processes, and retains runtime evidence whenever cleanup cannot be proven complete.
Related Issue
Fixes #8759.
Part of #7744.
Changes
Type of Change
Quality Gates
5ee4160e5across all nine repository security categories and returned PASS; scoped ownership, fail-closed status handling, runtime module validation, and evidence retention were explicitly verified.Documentation Writer Review
no-docs-neededDGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpm run typecheck:cli,npm run checks:repository, andnpm run test:e2e-phases:checkpassed.npm run test:changed -- --maxWorkers=1passed 134/137 files and 1,674/1,689 non-skipped tests; the three failing files reproduced on exact current basef817ad609because two uninstall fixtures reached this Mac's ambient Homebrew trust check and one command test timed out only under suite load. The command test passed 7/7 alone, and a detached-base comparison reproduced the uninstall failures unchanged.npm run docsbuilds without warnings (doc changes only)Signed-off-by: Aaron Erickson aerickson@nvidia.com