Skip to content

perf(ci): shorten main and E2E feedback loops - #7262

Closed
prekshivyas wants to merge 22 commits into
mainfrom
codex/ci-e2e-speedup
Closed

perf(ci): shorten main and E2E feedback loops#7262
prekshivyas wants to merge 22 commits into
mainfrom
codex/ci-e2e-speedup

Conversation

@prekshivyas

@prekshivyas prekshivyas commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Shortens the critical path for main, removes a long-lived PR-gate polling runner, and makes macOS/WSL feedback faster and actionable. It also isolates and caches the Hermes image build, adds bounded state-aware Brev provisioning retries, rejects malformed authoritative Brev inventory entries, and incorporates a strictly authenticated one-time retry for confirmed GitHub-hosted runner loss.

Changes

  • Start sandbox image/E2E validation after static and build/typecheck preflight, overlap it with the remaining main jobs, and retain it in the final checks gate.
  • Shard the full macOS and WSL Vitest suites four ways, with 30-minute macOS budgets and 90-minute WSL budgets, run root-only WSL contracts once, and repair the platform-specific path, Docker-availability, ref-race, and timing assumptions found by those lanes.
  • Build the Hermes production image once with a scoped Buildx GHA cache and bounded 32 GiB export swap, scan the completed image for node-tar, upload it from a 30-minute producer, and run the secret-boundary/root-entrypoint probes in a separate 90-minute consumer.
  • Publish E2E / PR Gate as the exact-diff custom required check directly and delete the 170-minute polling/mirroring job and its observer implementation. Maintainer gate inspection keeps rollout compatibility with the former E2E / PR Gate Coordination name.
  • Retry once only when authenticated job annotations and logs prove that a GitHub-hosted runner disappeared, using fresh exact-revision state, an independently bound replacement check, and a 330-minute coordinator budget.
  • Fail Brev SSH readiness early on authoritative terminal or repeatedly missing instance state, reject malformed entries in authoritative JSON inventory, allow two bounded provisioning attempts for CPU and GPU paths, and add explicit budgets to E2E matrix/report/scorecard jobs.
  • Update internal E2E operator documentation and behavioral workflow contracts for the new execution shape.

Required Repository Configuration

Before merging or enabling this workflow, a repository administrator must:

  1. Create the environment
    approve-credentialed-e2e-for-internal-pr.
  2. Configure one or more required reviewers. Prefer an organization team
    such as nemoclaw-e2e-approvers; members need repository read access
    but do not need merge rights. Individuals may be listed directly instead.
  3. Enable Prevent self-review.
  4. Disable administrator bypass.
  5. Restrict the environment to protected main.
  6. Do not add environment secrets, variables, or custom protection apps.

Only one configured reviewer is required to approve a run. The environment
must be configured before this workflow is merged or enabled, and approval
must cover the exact test plan.

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: no supported product behavior changes; internal E2E operator docs were updated
  • 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: self-review retained exact-diff and GitHub App identity checks, fail-closed workflow validators, secret scoping, local-only image loads, and no registry publication
  • 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 implementation
  • Result: docs-updated
  • Evidence: .agents/skills/nemoclaw-maintainer-day/MERGE-GATE.md, test/e2e/README.md, and test/e2e/docs/README.md document the direct required check, authorization and runner-loss retry paths, 330/140-minute retry budgets, rollout compatibility, platform sharding, Hermes image reuse, and Brev provisioning retries.
  • Agent: Codex Desktop
  • PR: perf(ci): shorten main and E2E feedback loops #7262

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 check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above.
    • Earlier coverage: affected CLI tests 23 passed; E2E workflow/image contracts 50 passed; CI/platform/gate/Brev contracts 233 passed with 2 environment skips; maintainer exact-diff gate evidence 95 passed.
    • Final reconciliation: runner-loss/Brev/gate contracts 74 passed; staging Brev integration 4 passed; selected E2E workflow contracts 50 passed; maintainer/docs/gate contracts 125 passed; Vitest project membership is exact across 1,752 files; npm run check:diff passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: npm test completed with 18,758 passed, 199 skipped, and 21 failures in unchanged macOS-local assumptions (Bash 3, missing GNU timeout, Python 3.14 wheel tooling, locale, and load-sensitive tests). The changed e2e-report-to-pr contract passed in isolation; Linux CI remains required.
  • 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: Prekshi Vyas prekshiv@nvidia.com

Summary by CodeRabbit

  • New Features

    • PR E2E gating now uses the E2E / PR Gate required check, with improved exact-diff verification and fork skip-approval handling.
    • Brev provisioning supports bounded retries, robust inventory parsing, and earlier detection of terminal or missing instances.
    • macOS and WSL Vitest runs are parallelized across four shards.
  • Bug Fixes

    • Sandbox image validation now enforces safer build, reuse, secret, and registry settings.
    • CI now blocks successful completion when sandbox-image E2E checks fail.
  • Documentation

    • Updated E2E gate, retry, approval, and workflow guidance.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas prekshivyas self-assigned this Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR updates exact-diff E2E gate handling, Hermes sandbox image workflows, Brev provisioning retries, CI sharding and timeouts, and related tests and documentation. The former required polling job is removed in favor of direct required-check seeding and validation.

Changes

E2E gate lifecycle

Layer / File(s) Summary
Gate reservation and evidence
.github/workflows/pr-e2e-gate.yaml, tools/e2e/pr-e2e-gate.mts, .agents/.../check-gates.ts
The workflow seeds E2E / PR Gate; evidence selection prefers that check name and records its trusted identifier.
Gate fixtures and rollout contracts
test/skills/*, test/pr-e2e-*, tools/advisors/risk-plan.mts, .agents/.../MERGE-GATE.md
Fixtures, authorization rules, rollout fallback behavior, and exact revision checks are updated for the required check.
Required-check documentation
test/e2e/README.md, test/e2e/docs/README.md
Required-check lifecycle, fork skips, retries, evidence failures, and terminal outcomes are documented.
Gate workflow tests
test/pr-e2e-gate-workflow.test.ts, test/helpers/vitest-watch-triggers.ts
Tests reflect initialization, removal of the polling job, renamed checks, and updated watch coverage.

Hermes sandbox workflow

Layer / File(s) Summary
Buildx build and artifact handoff
.github/workflows/sandbox-images-and-e2e.yaml
Hermes production image creation uses Buildx with local loading, caching, resource snapshots, artifact upload, and revised timeouts.
Workflow boundary validation
.github/workflows/main.yaml, tools/e2e/sandbox-images-workflow-boundary.mts
Main workflow dependency gating and Hermes producer-consumer, secret, registry, action pinning, artifact, and probe rules are enforced.
Boundary tests
test/e2e/support/*hermes*, test/e2e/support/sandbox-images-workflow-boundary.test.ts, test/hermes-runtime-config-guard-topology.test.ts
Tests cover the updated Hermes workflow contract and Docker availability handling.

Brev provisioning

Layer / File(s) Summary
Provisioning state evaluator
tools/e2e/brev-provisioning.mts, test/brev-provisioning-state.test.ts
Inventory parsing, bounded attempts, terminal statuses, authoritative absence, and scheduled inspection behavior are implemented and tested.
SSH retry integration
test/e2e/brev-e2e.test.ts
SSH readiness uses normalized Brev inspection results, consecutive-missing tracking, and the configured attempt bound.
Brev documentation
test/e2e/docs/README.md
Provisioning retry, cleanup, early termination, and live-execution retry rules are documented.

CI execution and reliability

Layer / File(s) Summary
Workflow controls
.github/workflows/e2e.yaml, .github/workflows/platform-vitest-main.yaml
Job timeouts are added and macOS/WSL Vitest runs are split into four shards, with WSL root contracts limited to shard one.
Test reliability updates
src/lib/shields/flow.test.ts, test/e2e/support/e2e-workflow.test.ts, test/hermes-runtime-config-guard-topology.test.ts
Shield takeover ordering and Docker-dependent test execution are updated; inline workflow shapes are reformatted without runtime changes.

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

Possibly related PRs

  • NVIDIA/NemoClaw#6909: Updates the same E2E required-gate evidence plumbing and trusted custom check handling.
  • NVIDIA/NemoClaw#7379: Updates the same Docker availability skip behavior for Hermes topology tests.

Suggested reviewers: dfernandez365-rgb, ericksoa

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.63% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the PR’s main goal of shortening CI and E2E feedback loops.
✨ 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/ci-e2e-speedup

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

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / medium confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: No actionable findings remain in the canonical review ledger.

Model lanes

  • GPT-5.6 Terra (primary): Completed · medium confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Failed after a partial review · low confidence · 4 blockers · 12 warnings · 2 suggestions

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-onboard, credential-sanitization, security-posture

1 optional E2E recommendation
  • staging-brev-launchable

Workflow run details

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

@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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/sandbox-images-and-e2e.yaml (1)

213-266: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Consumer job timeout has zero headroom beyond the two probe budgets.

test-hermes-sandbox-image keeps timeout-minutes: 75 while the two probe steps alone are budgeted at 45 (secret boundary) + 30 (root entrypoint) = 75 minutes. That leaves no headroom for checkout, Set up Node, Install root dependencies, artifact download/load, and both artifact-upload steps. If either probe runs anywhere near its own budget, the job will hit the overall timeout and get killed mid-upload even though the probes themselves stayed within their allotted time — a spurious CI failure that blocks merges.

Since tools/e2e/sandbox-images-workflow-boundary.mts (Lines 676-678, 705-707, 711-712) pins these exact numbers, bumping the job timeout to give real headroom (e.g. 85-90 minutes) requires updating the validator's expected constant in the same PR.

🤖 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 @.github/workflows/sandbox-images-and-e2e.yaml around lines 213 - 266,
Increase the test-hermes-sandbox-image job’s timeout-minutes above the combined
45- and 30-minute probe budgets, providing headroom for setup, image handling,
and artifact uploads. Update the corresponding expected timeout constant in the
sandbox-images-workflow-boundary validator so validation matches the new job
timeout.
🤖 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 @.agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts:
- Line 342: Update the check selection logic around checkNames and the
exactChecks.length guard to prefer the current “E2E / PR Gate” match, falling
back to “E2E / PR Gate Coordination” only when no current match exists. Preserve
exact-diff validation for the selected match, and add a regression test covering
both names with the same external_id.

In `@test/e2e/brev-e2e.test.ts`:
- Around line 569-570: Update the attempt-count normalization near
configuredAttempts and maxAttempts to accept only finite positive integers; fall
back to the default of two attempts for zero, negative, fractional, or otherwise
invalid BRE V_PROVISION_ATTEMPTS values, while preserving valid configured
counts.
- Around line 175-201: Update inspectBrevInstances so JSON is marked
authoritative only when parsed is a recognized instance array or contains a
recognized workspaces array; for unrecognized shapes such as {}, return
authoritative: false or fall back to parseBrevListOutput(brev("ls")). Preserve
authoritative inventories for recognized shapes so Brev branch validation can
safely make early-stop decisions.

---

Outside diff comments:
In @.github/workflows/sandbox-images-and-e2e.yaml:
- Around line 213-266: Increase the test-hermes-sandbox-image job’s
timeout-minutes above the combined 45- and 30-minute probe budgets, providing
headroom for setup, image handling, and artifact uploads. Update the
corresponding expected timeout constant in the sandbox-images-workflow-boundary
validator so validation matches the new job timeout.
🪄 Autofix (Beta)

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: fa68826b-321c-4b42-b6eb-5b22f3311e8c

📥 Commits

Reviewing files that changed from the base of the PR and between ad26c30 and b6892e6.

📒 Files selected for processing (35)
  • .agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts
  • .github/workflows/e2e.yaml
  • .github/workflows/main.yaml
  • .github/workflows/platform-vitest-main.yaml
  • .github/workflows/pr-e2e-gate.yaml
  • .github/workflows/sandbox-images-and-e2e.yaml
  • src/lib/actions/uninstall/hermes-forward-watcher-installer.test.ts
  • src/lib/shields/flow.test.ts
  • test/brev-provisioning-state.test.ts
  • test/e2e/README.md
  • test/e2e/brev-e2e.test.ts
  • test/e2e/docs/README.md
  • test/e2e/support/e2e-workflow.test.ts
  • test/e2e/support/hermes-secret-boundary-workflow.test.ts
  • test/e2e/support/sandbox-images-workflow-boundary.test.ts
  • test/helpers/vitest-watch-triggers.ts
  • test/hermes-runtime-config-guard-topology.test.ts
  • test/platform-vitest-main-workflow.test.ts
  • test/pr-e2e-gate-fork-skip.test.ts
  • test/pr-e2e-gate-lifecycle.test.ts
  • test/pr-e2e-gate-retry-history.test.ts
  • test/pr-e2e-gate-workflow.test.ts
  • test/pr-e2e-gate.test.ts
  • test/pr-e2e-required.test.ts
  • test/pr-risk-plan.test.ts
  • test/pr-workflow-contract.test.ts
  • test/release-latest-tag.test.ts
  • test/skills/check-gates-evidence.test.ts
  • test/skills/check-gates-test-fixtures.ts
  • test/vitest-watch-triggers.test.ts
  • tools/advisors/risk-plan.mts
  • tools/e2e/brev-provisioning.mts
  • tools/e2e/pr-e2e-gate.mts
  • tools/e2e/pr-e2e-required.mts
  • tools/e2e/sandbox-images-workflow-boundary.mts
💤 Files with no reviewable changes (4)
  • test/pr-e2e-required.test.ts
  • tools/advisors/risk-plan.mts
  • test/vitest-watch-triggers.test.ts
  • tools/e2e/pr-e2e-required.mts

Comment thread .agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts
Comment thread test/e2e/brev-e2e.test.ts
Comment thread test/e2e/brev-e2e.test.ts Outdated
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@github-code-quality

github-code-quality Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 423ad38 in the codex/ci-e2e-speedup branch remains at 96%, unchanged from commit d42f736 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 423ad38 in the codex/ci-e2e-speedup branch remains at 80%, unchanged from commit d42f736 in the main branch.

Show a code coverage summary of the most impacted files.
File main d42f736 codex/ci-e2e-speedup 423ad38 +/-
src/lib/onboard...ndbox-create.ts 83% 33% -50%
src/lib/onboard...-create-plan.ts 88% 75% -13%
src/lib/onboard...-desktop-gpu.ts 89% 77% -12%
src/lib/onboard...ndbox-create.ts 91% 83% -8%
src/lib/domain/.../connect-env.ts 97% 89% -8%
src/lib/sandbox...rce-identity.ts 87% 87% 0%
src/lib/state/m...ock-identity.ts 95% 95% 0%
src/lib/state/m...lock-storage.ts 97% 97% 0%
src/lib/shields/index.ts 71% 72% +1%
src/lib/state/m...-acquisition.ts 84% 89% +5%

Updated July 23, 2026 17:13 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

🤖 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/brev-provisioning-state.test.ts`:
- Around line 47-74: Extend the test case for observeBrevProvisioningProgress to
invoke attempt 3 with the same failure state, assert it returns the expected
result, and verify inspect has been called twice. Preserve the existing attempt
1 inspection and attempt 2 skip assertions.
🪄 Autofix (Beta)

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: 414cd60d-44d8-40a3-bf33-9edaed97dea7

📥 Commits

Reviewing files that changed from the base of the PR and between b6892e6 and 908a2bd.

📒 Files selected for processing (4)
  • .github/workflows/e2e.yaml
  • test/brev-provisioning-state.test.ts
  • test/e2e/brev-e2e.test.ts
  • tools/e2e/brev-provisioning.mts
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/e2e.yaml

Comment thread test/brev-provisioning-state.test.ts
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas

Copy link
Copy Markdown
Collaborator Author

Addressed all automated review findings in 3da8b5b and 7766a8e. In addition to the inline fixes, the Hermes consumer timeout is now 90 minutes, leaving 15 minutes of setup/artifact headroom beyond its 45- and 30-minute probes; the workflow validator, tests, and internal E2E docs were updated together. Focused review regressions pass (132 tests), and npm run check:diff is green.

@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: 2

🤖 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/skills/check-gates-rollout.test.ts`:
- Around line 23-26: Update the test assertion around runGate to verify the
selected check identity, not only allPass and the CI pass status. Assert
trustedCustomCheckId equals 8000, or expose and assert the chosen check name/ID
through the fixture, while preserving the existing success assertions.

In `@tools/e2e/brev-provisioning.mts`:
- Around line 38-74: Remove the local parseBrevJsonInventory and
parseBrevProvisioningAttempts declarations from the E2E flow and import the
shared exports from the provisioning helpers. Update evaluator and observer
callers similarly so all paths use the shared implementations and their tested
parsing and retry behavior.
🪄 Autofix (Beta)

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: 1d2ae93c-91b1-450e-89b5-1c79b9e6aa21

📥 Commits

Reviewing files that changed from the base of the PR and between 908a2bd and 3da8b5b.

📒 Files selected for processing (10)
  • .agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts
  • .github/workflows/sandbox-images-and-e2e.yaml
  • test/brev-provisioning-state.test.ts
  • test/e2e/README.md
  • test/e2e/brev-e2e.test.ts
  • test/e2e/docs/README.md
  • test/e2e/support/sandbox-images-workflow-boundary.test.ts
  • test/skills/check-gates-rollout.test.ts
  • tools/e2e/brev-provisioning.mts
  • tools/e2e/sandbox-images-workflow-boundary.mts
🚧 Files skipped from review as they are similar to previous changes (5)
  • test/e2e/README.md
  • test/e2e/brev-e2e.test.ts
  • .agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts
  • test/e2e/support/sandbox-images-workflow-boundary.test.ts
  • tools/e2e/sandbox-images-workflow-boundary.mts

Comment thread test/skills/check-gates-rollout.test.ts
Comment thread tools/e2e/brev-provisioning.mts
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance integration: hermes Hermes integration behavior platform: brev Affects Brev hosted development environments platform: macos Affects macOS, including Apple Silicon platform: wsl Affects Windows Subsystem for Linux labels Jul 20, 2026

@dfernandez365-rgb dfernandez365-rgb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Security review — fail-open test gate.

dockerAvailable maps any Linux docker info failure—missing CLI, daemon outage, permission denial, or timeout—to false, and it.skipIf(!dockerAvailable) then lets this security-annotated rollback contract disappear while the aggregate Linux gate remains green. The required Ubuntu shards have no Docker preflight, and the WSL root-only step plus Hermes root-entrypoint E2E exercise different contracts.

Please scope the exception to WSL without Docker using the existing isWsl() helper (or an explicit WSL-lane marker) and preserve native-Linux fail-closed behavior.

@dfernandez365-rgb

Copy link
Copy Markdown

A verified reference patch for the requested fail-closed narrowing is available at dfernandez365-rgb@94db91d.

Evidence on current main d5fa194:

  • real WSL plus Docker executed and passed the root-container rollback contract;
  • WSL with Docker forced unavailable skipped that Docker-dependent contract;
  • synthetic native-Linux classification with Docker absent failed hard with spawnSync docker ENOENT;
  • focused integration: 22 passed, 1 pre-existing skip;
  • npm run build:cli followed by npm run check:diff passed every pre-commit, commitlint, security, source-shape, repository, and pre-push TypeScript gate.

I have not opened a duplicate PR.

@dfernandez365-rgb

Copy link
Copy Markdown

A separate #7259 correctness gap remains in this PR.

Changing the Shields test timeout from 10 seconds to 20 seconds does not remove its 1200 ms sentinel, 1400 ms wait, or load-dependent wall-clock oracle. The verified issue candidate removes that timer boundary and, at the mocked policy-restore call, proves the captured child PID/start identity is gone or zombie while preserving owner-stop-before-enumeration, transition cleanup, and policy-set assertions:

dfernandez365-rgb@2041fbe

Native macOS evidence for that exact head: https://github.com/dfernandez365-rgb/NemoClaw/actions/runs/29774224429/job/88459619040 — 22/22 Shields tests, 1/1 watcher test, and 18,811 tests across 1,605 files passed. This PR's green macos-e2e job runs three unrelated integration tests and does not execute either #7259 file.

Please adopt the exact child-lifecycle assertion/removal of the timer oracle. The watcher test should also retain the explicit absolute-path assertion rather than relying only on equality with realpathSync.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>

@dfernandez365-rgb dfernandez365-rgb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Exact-head review: cc900d695a38b5a6ae5417c7bc2dd7b27370ff8b.

Two blockers remain on this head:

  1. The Hermes root-topology security contract still fails open when Docker is unavailable. test/hermes-runtime-config-guard-topology.test.ts:73-75 maps every Linux docker info failure (missing CLI, daemon outage, permission denial, or timeout) to dockerAvailable=false, and line 513 then skips the root repair/rollback test. That is only a legitimate skip for the explicitly Docker-less WSL lane. On native required Linux, loss of Docker must fail setup/the test rather than make this security contract disappear behind a green shard. Scope the skip to WSL (using the existing platform helper or an explicit lane marker) and preserve fail-closed native-Linux behavior.

  2. The current head deterministically fails its own maintainer policy suite. The merge-gate prose changed both safety statements from coordination identity to required-check identity, but test/maintainer-skills-policy.test.ts:271-275 still requires two matches of the old sentence. Upstream CI job 88506901242 fails there, and I reproduced it locally on this exact head: 14 passed, 1 failed. Update the assertion to the new direct-check identity contract and rerun the focused integration test plus the affected CLI shard.

The known reviewed-npm audit failure is separate; these two findings are specific to this PR's diff and current head.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas
prekshivyas requested review from cv and jyaunches July 22, 2026 21:25
cv pushed a commit that referenced this pull request Jul 22, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Internal PRs that change credential-bearing E2E trust boundaries now
request an exact-SHA protected-environment review automatically after
ordinary CI. Repository-configured E2E reviewers can approve that
environment without merge rights, while fork PR code still never
receives repository secrets.

## Required Repository Configuration

Before merging or enabling this workflow, a repository administrator
must:

1. Create the environment `approve-credentialed-e2e-for-internal-pr`.
2. Configure one or more required reviewers. Prefer an organization team
such as `nemoclaw-e2e-approvers`; members need repository read access
but do not need merge rights. Individuals can also be listed directly.
3. Enable **Prevent self-review**.
4. Disable administrator bypass.
5. Restrict the environment to protected `main`.
6. Do not add environment secrets, variables, or custom protection apps.

Only one configured reviewer is required to approve a run. The approval
must cover the exact test plan. Complete this configuration before
merging or enabling the workflow.

## Changes

- Add `approve-credentialed-e2e-for-internal-pr` as a protected,
non-deployment environment gate before internal credentialed E2E
dispatch.
- Bind approval to the first trusted controller attempt, exact workflow
SHA, PR head SHA, base SHA, deterministic plan, and one approval naming
only the expected environment.
- Treat protected-environment reviewer configuration as the delegated
authority for both internal execution approval and fork skip approval;
retain `maintain` or `admin` checks on both manual fallback operations.
- Fail closed without dispatch when approval history, environment
configuration, run identity, PR identity, or the live revision does not
match.
- Document rollout requirements: required reviewer allowlists, **Prevent
self-review**, protected `main`, no environment secrets, variables, or
custom protection apps, and exact plan review.
- Keep the existing manual `run-control-plane` and
`approve-fork-e2e-skip` operations as maintainer fallbacks.

This intentionally excludes the feedback-loop and observer-removal
changes in #7262. Both PRs touch the gate lifecycle, so whichever merges
second will require security-sensitive conflict resolution rather than
an automatic merge.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [x] 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: this is a maintainer-only
repository E2E authorization operation; `test/e2e/README.md` documents
the operational change and no shipped user surface changes.
- [x] 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: pending maintainer
security review.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit: not applicable
- 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 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 — `npx vitest run
test/pr-e2e-gate-command.test.ts test/pr-e2e-gate-workflow.test.ts
test/pr-e2e-gate-fork-skip.test.ts
test/pr-e2e-gate-internal-approval.test.ts
test/pr-e2e-gate-retry-history.test.ts test/pr-e2e-required.test.ts` (94
passed); `npm run typecheck:cli`; `npm run test-size:check`.
- [ ] Applicable broad gate passed — `npm test` completed with 18,865
passed, 201 skipped, and 20 failures in untouched local
macOS/tooling-dependent tests. Failures include `/private/var` path
normalization, missing GNU `timeout` and `stat -c`, Bash-version
assumptions, Docker timing/memory, Python build tooling, and unrelated
timeouts. Approval-specific tests are green; CI must provide the
authoritative Linux broad 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)

---
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>

---------

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
cv added 2 commits July 22, 2026 15:04
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

@dfernandez365-rgb The two blockers from your exact-head review are addressed on the current head: native Linux now fails closed when Docker is unavailable, and the maintainer policy assertion follows the direct required-check identity. I also refreshed onto current main and reconciled the merged delegated-approval work by preserving protected environment authorization while moving it to the direct E2E / PR Gate check. Please re-review when the new GitHub checks settle.

@cv
cv dismissed dfernandez365-rgb’s stale review July 22, 2026 22:16

Stale exact-head review at cc900d6. Both blockers are resolved on current head 2348422: ab3c76d scopes Docker-less skipping to WSL while native Linux fails closed, and updates the maintainer policy assertion to the direct required-check contract. Current GitHub CI is validating the refreshed head.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved on exact head 2348422 against base 7e8945a. Product-scope gate passes: this is internal CI/E2E maintenance and creates no supported product integration or recipe. Nine-category security review found no findings; protected authorization, exact-diff/GitHub-App validation, least-privilege permissions, secret scoping, local-only image loading, fail-closed native-Linux coverage, and bounded/authoritative Brev parsing are preserved. The stale human blockers and all CodeRabbit requests are addressed. Approval remains contingent on the current GitHub checks and exact-SHA E2E gate completing successfully.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-approved on refreshed exact head 916b824 against base 7e8945a after the documentation-writer follow-up. The sole new commit is Verified/DCO and brings the maintainer merge gate in line with the already-reviewed workflow: protected approve-credentialed-e2e-for-internal-pr authorization and the current E2E reviewer authorization required to run E2E title first, with the existing exact-head/base manual run-control-plane fallback. It does not change executable behavior or the prior product-scope/security conclusions. Approval remains contingent on fresh GitHub CI and exact-SHA E2E evidence.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-approved on refreshed exact head a625749 against base 02cf73d. The merge from current main was conflict-free and adds only the already-merged Quickstart documentation/test ownership changes; the PR-specific diff, protected-authorization runbook correction, and prior product-scope/security conclusions are unchanged. Fresh hosted CI and new exact-SHA E2E evidence remain required.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-approved on refreshed exact head 6d56aeb against base 1bb15a0. The #7343 merge was conflict-free; its documentation-receipt workflow/package/test changes are inherited from main and disappear from the three-dot PR diff. The PR-specific file set, runbook fix, product scope, and nine-category security assessment remain unchanged. Fresh hosted CI and new exact-SHA E2E evidence are required.

@cv

cv commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Pre-merge repository-configuration audit: the required environment approve-credentialed-e2e-for-internal-pr currently exists, but the GitHub API reports protection_rules: [] and deployment_branch_policy: null. That does not satisfy this PR description's required-reviewer, prevent-self-review, no-admin-bypass, or protected-main restrictions.

Please keep this PR unmerged until a repository administrator applies and validates those settings. No repository environment policy was changed during this review.

@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Coordination note for the runner-stability work in #7146: recent hosted-runner shutdowns (including runs 29964501381 and 29965049603) use a Jobs API shape that the current classifier misses: a completed/failed hosted job, one completed/cancelled live step, skipped cleanup, and a final successful Complete job step.

A focused classifier fix plus a strictly authorized one-time whole-plan retry is being developed separately; #7262 does not duplicate that behavior. I am keeping the core controller work independent from the current observer so it can rebase cleanly if this PR lands first.

Integration points for #7262:

  • keep the direct E2E / PR Gate check name and observer deletion;
  • create a fresh second check/state/correlation only after exact attempt-1 run, job, PR/base, workflow, and check-history revalidation;
  • never retry assertions, OOM/disk classifications, user/concurrency cancellation, mixed failures, incomplete Jobs API results, or attempt 2;
  • revise the 120-minute coordinator budget before enabling a two-attempt path, because it cannot contain two bounded E2E attempts plus evidence handling.

This is a convergence note only. No repository configuration or code on #7262 was changed.

@apurvvkumaria

apurvvkumaria commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Current E2E failure diagnosis: run 29964960386, Hermes security-posture job 89074421115, lost standard hosted runner GitHub Actions 1021277138 during phase 2/8.

The last semantic-progress sample reported phase install and onboard Hermes sandbox, os.freemem() at 0.1 GiB of 15.6 GiB, load 4.86, and 83.2 GiB disk free. Important qualification: this is raw free memory, not Linux reclaimable MemAvailable, so the sample is a pressure signal but does not by itself prove an OOM. Five minutes later the log recorded The runner has received a shutdown signal, followed by The operation was canceled. There was no failed assertion; upload and cleanup were skipped.

The Jobs API terminalized the live step as cancelled and the job as failed, which is exactly the current shape being added to #7146 classification and one-time retry coverage. #7391 already routes this Hermes lane to a larger runner when enabled, but repository variable E2E_LARGER_RUNNER_LABEL is currently unset, so this run remained on ubuntu-latest. A standard-versus-larger comparison with the richer #7399 telemetry is still required to attribute the shutdown specifically to memory pressure.

cv added a commit that referenced this pull request Jul 22, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Final-main E2E previously fanned out even when the newest applicable
base-image publication was missing, partial, or failed. This change adds
a trusted, fail-closed preflight that proves all required publishers
succeeded before matrix generation, while preserving the
controller-selected PR path without checking out PR code.

## Related Issue

Fixes #7372

## Changes

- Add a dependency-free publication verifier that derives publisher
inputs from the checked-in workflow, resolves the applicable
first-parent commit, bounded-polls paginated GitHub evidence, validates
workflow/run/job provenance across rerun attempts, and reconfirms the
selected run.
- Add a least-privilege `base-image-publication` job before
`generate-matrix`; trusted main schedule/manual runs perform the check,
controller-selected PR dispatches bypass it before checkout, and invalid
invocation modes fail closed.
- Add focused behavioral and workflow-boundary coverage for pagination,
retries, batched pushes, merge history, partial/failed evidence,
diagnostic context, controller bypass, and trust-boundary mutations.
- Keep this change independent of #7100's progress artifacts and #7262's
matrix timeout; preserve those adjacent lines if either PR lands first.
- Scope this fix to publication sequencing. Strict digest pinning and
removal of downstream mutable `latest` fallback remain follow-up work.

## 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: This changes internal GitHub
Actions sequencing and provenance validation only; CLI, configuration,
runtime, installation, and user-facing image behavior are 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: A final fail-closed
trust-boundary review found one diagnostic-context gap, which was fixed
and regression-tested; no other blocking 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
implementation
- Result: `no-docs-needed`
- Evidence: The change adds an automatic internal E2E
publication-provenance gate without changing CLI, configuration,
runtime, installation, or user-facing image behavior.
- Agent: Codex Desktop
- PR: #7373
<!-- docs-review-head-sha: 10a2123 -->
<!-- docs-review-agents-blob-sha: 73549ba -->

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit:
- Station profile/scenario:
- Result:
- 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 — command/result or justification: `npx
vitest run --project e2e-support
test/e2e/support/base-image-publication.test.ts
test/e2e/support/base-image-publication-workflow-boundary.test.ts
test/e2e/support/e2e-workflow.test.ts` — 95 passed.
- [x] Applicable broad gate passed — `npm run checks`, `npm run
typecheck:cli`, and `npx prek run --from-ref origin/main --to-ref HEAD`
passed.
- [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)

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


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a base-image publication verification gate that determines
whether publication evidence is required before running E2E workflows.
* Updated E2E matrix generation and PR E2E reporting to wait for this
gate’s result.
* Strengthened the E2E workflow boundary validation and approval
authorization checks to rely on stable, trusted attributes.
* **Tests**
* Added end-to-end boundary coverage for the base-image publication
policy, including classifier behavior and drift detection.
* Added evidence validation tests for workflow/run selection, publisher
job evidence rules, pagination safety, and deterministic polling/timeout
behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
prekshivyas and others added 5 commits July 23, 2026 09:43
Preserve the direct PR gate while integrating the authenticated
hosted-runner-loss retry and rejecting malformed Brev inventory entries.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas
prekshivyas requested a review from cv July 23, 2026 17:26
@cv

cv commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Closing this PR as superseded by #7451.

The issue records the focused PR boundaries, merge dependencies, validation requirements, and repository-configuration blocker. Rebuild each change from fresh origin/main; do not cherry-pick this mixed commit series. The hosted-runner-loss retry already landed in #7423 and must not be duplicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance integration: hermes Hermes integration behavior platform: brev Affects Brev hosted development environments platform: macos Affects macOS, including Apple Silicon platform: wsl Affects Windows Subsystem for Linux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants