perf(e2e): skip disposable Hermes rebuild sandbox - #7590
Conversation
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
📝 WalkthroughWalkthroughThe PR adds Hermes current-base resolution and gateway bootstrap helpers, integrates them into the live rebuild workflow, parameterizes OpenShell execution, tracks dashboard forwards, validates hosted inference, and adds support tests and phase-contract updates. ChangesHermes rebuild workflow
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant LiveTest
participant CurrentBaseResolver
participant HostCliClient
participant NemoclawGateway
LiveTest->>HostCliClient: Probe selected OpenShell binary
LiveTest->>CurrentBaseResolver: Resolve published current base
CurrentBaseResolver->>HostCliClient: Inspect resolved image
LiveTest->>NemoclawGateway: Configure compatible-endpoint inference
LiveTest->>HostCliClient: Verify route and dashboard forward
Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit c067fb6 in the TypeScript / code-coverage/cliThe overall coverage in commit c067fb6 in the Show a code coverage summary of the most impacted files.
Updated |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
…rmes-bootstrap-review Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
## Summary GitHub may canonicalize a PR gate check details URL to the check own /runs/<check-id> URL even when the exact child-bound summary is persisted. The controller introduced by #7594 rejected that valid response, revoked authorization, and prevented the selected #7590 Hermes lanes from starting. This change accepts only the exact child URL or the exact canonical check URL while preserving every authorization identity check. ## Related Issue Part of #7140. Follow-up to #7593 and #7594; aligns the parent controller with the canonicalization behavior already protected by #7515. ## Changes - Accept the selected child Actions URL or the exact canonical /runs/<check-id> URL after the check ID, GitHub Actions app, PR head/base identity, status, title, and child-bound summary all validate. - Continue rejecting foreign repositories, wrong check IDs, alternate schemes, query or fragment variants, and unrelated URLs. - Cover both allowed URL forms after a lost PATCH response and prove a foreign canonical URL still revokes authorization before child cancellation. ## Type of Change - [x] 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 - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: existing E2E operational documentation already states that GitHub may canonicalize details_url to /runs/<check-id>; no user-facing command or workflow changes. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: independent Codex Desktop code and security reviews verified the exact URL allowlist and the retained check ID, app, PR/head/base, status, plan, jobs, targets, and child-run summary binding; no findings remained. - [ ] 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: `no-docs-needed` - Evidence: Exact head `d4f53a19618b4d810494e2094c6aff6b9f6602cc` changes only the E2E controller’s canonical check-URL validation and focused tests. `test/e2e/README.md` already documents direct-read recovery, exact persisted child binding, and GitHub canonicalization to `/runs/<check-id>`. Changed test text is behavior-oriented and introduces no issue references. No docs build was needed because no documentation source changed. - Agent: Codex Desktop <!-- docs-review-head-sha: d4f53a1 --> <!-- docs-review-agents-blob-sha: be20a09 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: not applicable - Station profile/scenario: not applicable - Result: not applicable; scripts/prepare-dgx-station-host.sh is unchanged. - Supporting evidence: ## 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 check:diff passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — 19 PR-E2E files, 313 tests passed; the E2E workflow boundary added 39 passing tests. - [x] Applicable broad gate passed — CLI typecheck, source-shape, test-size, title-style, project isolation, Biome, and the complete changed-file hook set passed. Post-rebase focused validation passed 41 tests. - [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) - [ ] Doc pages follow the style guide (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new doc pages only) Failure evidence: controller run 30221481816 and child run 30221620499. The parent published the exact child-bound summary but GitHub returned the canonical check URL, so the old strict URL comparison revoked the otherwise valid authorization. Self-hosting evidence: #7599 controller run 30224207359 checked out trusted base `2f66902b`, rejected the canonical URL for check 89851619986, and could not cancel child run 30224558462 after GitHub returned HTTP 500. The orphan child then failed closed because trusted controller authorization had not been published. A same-revision retry is not supported after dispatch; the exact fix requires the repository's approved controller-bootstrap governance path. --- Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved pull request gate recovery when an authorization update response is lost, ensuring check details URLs are set correctly after retry behavior. * Updated gate check validation to accept both dispatched child run URLs and canonical controller check URLs. * **Tests** * Expanded end-to-end coverage with parameterized published-details URL variants and scenarios where lost updates result in a foreign check URL. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
test/e2e/live/rebuild-hermes-bootstrap.ts (1)
403-419: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winCleanup aborts remaining forwards on the first failure.
The
forloop rethrows immediately, so a failure on one tracked port (e.g. a transientforward listerror) leaves the other tracked forwards running and leaks host ports across lanes. Collect per-port outcomes and throw once at the end so every tracked port gets a stop attempt.♻️ Suggested failure isolation
const rejectedPort = trackRebuildHermesCleanupPort(ports, recordedDashboardPort); + const failures: unknown[] = []; try { for (const port of ports) { - await cleanupForward(port); + try { + await cleanupForward(port); + } catch (error) { + failures.push(error); + } } } finally { await writeEvidence({ rejectedPort }); } + if (failures.length > 0) { + throw new AggregateError(failures, "Hermes tracked forward cleanup failed"); + } }🤖 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/live/rebuild-hermes-bootstrap.ts` around lines 403 - 419, The cleanupRebuildHermesTrackedForwards function must attempt cleanupForward for every tracked port even when one attempt fails. Capture each per-port failure while continuing the loop, then after all stop attempts and writeEvidence completes, propagate the collected failure(s) once; preserve rejectedPort evidence writing in the finally path.test/e2e/support/rebuild-hermes-bootstrap.test.ts (1)
412-443: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSource-text and
indexOfordering assertions lock in the live test's implementation.The negative assertions (Lines 415-419) reasonably prove the disposable-sandbox path is gone, but the positive
toContainchecks and theindexOfordering comparisons (Lines 422-443) will break on any harmless refactor (renamed local, reordered artifact write, extracted helper) without indicating a real regression. Consider narrowing this test to the removal-proof assertions and expressing phase ordering through the phase contract (REBUILD_HERMES_PHASES/meta.e2ePhases) instead of the file's byte offsets.As per path instructions, "Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions" and "Migration tests must prove the superseded path is unreachable or removed, not merely prove that the new path also works."
🤖 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/rebuild-hermes-bootstrap.test.ts` around lines 412 - 443, Refactor the assertions in the live rebuild test to retain only checks proving the superseded disposable-sandbox and direct openshell paths are absent. Remove brittle positive source-text checks and byte-offset comparisons based on local names or statement order, and validate rebuild phase ordering through the public phase contract using REBUILD_HERMES_PHASES or meta.e2ePhases instead.Source: Path instructions
🤖 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.
Nitpick comments:
In `@test/e2e/live/rebuild-hermes-bootstrap.ts`:
- Around line 403-419: The cleanupRebuildHermesTrackedForwards function must
attempt cleanupForward for every tracked port even when one attempt fails.
Capture each per-port failure while continuing the loop, then after all stop
attempts and writeEvidence completes, propagate the collected failure(s) once;
preserve rejectedPort evidence writing in the finally path.
In `@test/e2e/support/rebuild-hermes-bootstrap.test.ts`:
- Around line 412-443: Refactor the assertions in the live rebuild test to
retain only checks proving the superseded disposable-sandbox and direct
openshell paths are absent. Remove brittle positive source-text checks and
byte-offset comparisons based on local names or statement order, and validate
rebuild phase ordering through the public phase contract using
REBUILD_HERMES_PHASES or meta.e2ePhases instead.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: e34604d9-7b50-4afe-8ba7-55c95b2bb597
📒 Files selected for processing (5)
test/e2e/live/rebuild-hermes-base-identity.tstest/e2e/live/rebuild-hermes-bootstrap.tstest/e2e/live/rebuild-hermes-phases.tstest/e2e/live/rebuild-hermes.test.tstest/e2e/support/rebuild-hermes-bootstrap.test.ts
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/e2e/support/rebuild-hermes-bootstrap.test.ts (1)
453-466: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy liftReplace source-text checks with behavior-level migration coverage.
These literal-fragment assertions can pass if a superseded onboarding or disposable-sandbox path is reintroduced under different names. Capture the live workflow’s executed probes/artifacts and prove those operations are unreachable while the rebuild completes its declared phases. As per path instructions, “Migration tests must prove the superseded path is unreachable or removed, not merely prove that the new path also works.”
🤖 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/rebuild-hermes-bootstrap.test.ts` around lines 453 - 466, Replace the literal source-text assertions in the test “keeps superseded live rebuild paths unreachable (`#7144`)” with behavior-level migration coverage: capture executed probes or artifacts from the live rebuild workflow, assert the superseded onboarding, disposable-sandbox cleanup, image-removal, forwarding, and openshell operations are never executed, and verify the rebuild still completes its declared phases.Source: Path instructions
🤖 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.
Nitpick comments:
In `@test/e2e/support/rebuild-hermes-bootstrap.test.ts`:
- Around line 453-466: Replace the literal source-text assertions in the test
“keeps superseded live rebuild paths unreachable (`#7144`)” with behavior-level
migration coverage: capture executed probes or artifacts from the live rebuild
workflow, assert the superseded onboarding, disposable-sandbox cleanup,
image-removal, forwarding, and openshell operations are never executed, and
verify the rebuild still completes its declared phases.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4f2ca71f-cdc1-4a5e-a38a-472c945627a4
📒 Files selected for processing (2)
test/e2e/live/rebuild-hermes-bootstrap.tstest/e2e/support/rebuild-hermes-bootstrap.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- test/e2e/live/rebuild-hermes-bootstrap.ts
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary <!-- 1-3 plain sentences: what changes and why. Describe before-and-after behavior when it applies. Follow the NemoClaw Writing Guide: https://github.com/NVIDIA/NemoClaw/blob/main/WRITING.md. Do not add unrelated prose cleanup. --> Replace the mutable NodeSource bootstrap in both WSL workflows with checksum-verified official Node.js 22.23.1 archives. This removes the shared installer failure affecting current PR lanes while keeping the runtime on the supported, security-current Node 22 LTS line. ## Changes <!-- List concrete changes. If this adds an abstraction, configuration, fallback, migration, or compatibility path, name its current requirement and consumer, explain why a direct change is insufficient, and identify the test that protects it. --> - Install official Node.js 22.23.1 archives for `x64` and `arm64`, with exact SHA-256 pins, HTTPS-only bounded downloads, temporary-directory cleanup, and fail-closed architecture handling. - Verify each archive before extraction and assert the installed runtime version. - Protect both workflow consumers with `test/platform-vitest-main-workflow.test.ts`, including architecture-to-digest bindings and the repository's approved security source-shape contract. - Address the same WSL bootstrap failure observed on [#7590](https://github.com/NVIDIA/NemoClaw/actions/runs/30312091098/job/90131121904), [#7629](https://github.com/NVIDIA/NemoClaw/actions/runs/30311922489/job/90131122471), [#7603](https://github.com/NVIDIA/NemoClaw/actions/runs/30311696352/job/90131123359), and [#7626](https://github.com/NVIDIA/NemoClaw/actions/runs/30312801807/job/90132378380). ## Type of Change - [x] 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 <!-- Check one tests line and one docs line. Check other lines when applicable. Add every requested justification or approval reference. --> - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: This changes internal CI bootstrap behavior only; public installation requirements remain unchanged. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Codex security review PASS across all nine categories on exact diff fingerprint `2981cff1a79a0c0acfaf5b0a8e55353809ec472c0565fa1f168996f92107b7ae`. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review <!-- Required for code and documentation changes after the changes and applicable validation are complete. Keep one review checkbox and one instance of each visible or hidden field. For Evidence, list changed documentation paths. For documentation-only changes, also state that the writing rules and documentation style were reviewed. For other results, explain why no documentation change is needed or why the review is blocked. For Agent, use a consistent product and surface name, such as Codex Desktop, Codex CLI, Claude Code, or Cursor. After committing all review changes, put `git rev-parse --short HEAD` and `git rev-parse --short HEAD:AGENTS.md` in the hidden metadata below. Rerun the review and refresh that metadata after any new commit. This receipt is advisory during the data-collection pilot. --> - [x] Documentation writer subagent reviewed the completed changes - Result: `no-docs-needed` - Evidence: Exact-head review confirmed the change is limited to CI bootstrap workflows and their executable contract; public Node.js requirements do not change. - Agent: Codex Desktop <!-- docs-review-head-sha: 062779c --> <!-- docs-review-agents-blob-sha: be20a09 --> ## DGX Station Hardware Evidence <!-- Required only when scripts/prepare-dgx-station-host.sh changes. Maintainers must review the linked evidence before approving or merging. This is human-reviewed evidence, not authenticated hardware provenance. Exceptional bypasses use existing repository governance and must be documented on the PR. --> - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification <!-- Check each applicable item only when supported by the requested evidence. Run targeted tests once per relevant change set and rerun after later edits or hook autofixes that can affect the tested behavior. Do not rerun hook-covered checks. --> - [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 check:diff` passed 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 --project integration test/platform-vitest-main-workflow.test.ts` (3 passed); both embedded WSL installers pass `bash -n`. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: - [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) - [ ] 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) --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **CI Improvements** * Standardized Node.js 22 installation across WSL workflows with a pinned version and architecture-specific downloads. * Added archive checksum verification, version validation, cleanup, and explicit failure handling. * **Tests** * Added coverage to verify secure, deterministic Node.js installation behavior in both WSL workflows. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Summary
The rebuild-Hermes lanes now prepare the published current base, trusted gateway, hosted inference route, and dashboard port directly instead of onboarding and deleting a disposable current-Hermes sandbox. This removes one generated image build and its high-memory export while preserving the real historical-to-current rebuild and state-migration assertions.
The branch is refreshed onto exact
mainSHAc4c020ca5after benchmark prerequisites #7571, #7580, #7582, #7586, and #7589 merged. Their changes collapse out of the PR diff; the remaining five changed files are limited totest/e2e/**.Related Issue
Part of #7144
Parent epic: #7140
Changes
ensureAgentBaseImage, require the published immutable metadata, and fail if the lane constructs or overrides a base.nemoclawgateway through the production recovery path, configure the exact compatible-endpoint route, and allocate the dashboard port through the production allocator.Type of Change
Quality Gates
c067fb6cefor credentials, gateway authority, immutable base identity, cleanup ownership, dashboard allocation, deterministic failure aggregation, evidence preservation, child-process failure propagation, and retained real rebuild/state/token/inference assertions. Final verdict: PASS with no findings.Documentation Writer Review
no-docs-neededc4c020ca5..c067fb6cechanges onlytest/e2e/**test infrastructure. No documentation paths or user-facing behavior changed.git diff --checkpassed.DGX Station Hardware Evidence
scripts/prepare-dgx-station-host.shis unchanged.Verification
Signed-off-by:line and every pushed commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpm run docsbuilds without warnings (doc changes only)Additional validation on the refreshed head:
npm run test:e2e-phases:checknpm run typecheck:clinpm run source-shape:checknpm run test-size:checknpm run test:titles:checknpm run test:projects:checknpm run test-conditionals:scan -- --top 25npx prek run --from-ref origin/main --to-ref HEAD --stage pre-commitnpx prek run --from-ref origin/main --to-ref HEAD --stage pre-pushFive-run benchmark baseline:
0b185498155a0a51a3f682a3e2b57f80c95eeaaaE2E_LARGER_RUNNER_LABELunset; standardubuntu-latest, Linux/x64, 4 CPU, about 16 GB memorye2e.yamldispatches; attempt 1 only; both lanes required to pass; zero Docker build cache at scenario startMedian phase evidence:
Resource evidence:
Remaining acceptance evidence:
mainand confirm at least 25% median wall-time improvement independently for both lanes, as required by perf(e2e): reduce rebuild-hermes runtime with pinned fixtures and reusable build cache #7144.Signed-off-by: Apurv Kumaria akumaria@nvidia.com
Summary by CodeRabbit