Skip to content

fix(ci): isolate credential-backed E2E smokes - #6687

Merged
cv merged 5 commits into
mainfrom
codex/fix-e2e-optional-evidence
Jul 11, 2026
Merged

fix(ci): isolate credential-backed E2E smokes#6687
cv merged 5 commits into
mainfrom
codex/fix-e2e-optional-evidence

Conversation

@cv

@cv cv commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

The PR E2E gate currently rejects inference-routing after its four required checks pass because three credential-backed smokes are collected and deliberately skip. This keeps the gate strict, moves those smokes behind a trusted file boundary that the PR workflow does not select, and makes failed coordinator annotations include the concrete evidence summary.

Changes

  • Keep the PR-required inference-routing.test.ts lane fully discoverable with four ordinary, always-on tests and no skipped evidence.
  • Move the NVIDIA credential-isolation, OpenAI, and Anthropic smokes into inference-routing-provider-smoke.test.ts; all three remain ordinary registered Vitest tests, but no PR workflow supplies provider secrets or selects that file.
  • Extract shared onboarding, cleanup, command, and protocol helpers so the file split does not duplicate the substantial live-test machinery.
  • Pin the trusted workflow boundary with a support test, and record the new credential-backed file as live-only under the existing mock-parity policy. Any future secret-bearing lane must run it from trusted main.
  • Keep every reported skip fail-closed, including evidence carrying a spoofed optionalSkipped property.
  • Include the verdict summary in failed coordinator annotations so missing or unfinished shards are visible directly in the job log.

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 an internal CI/test boundary; audits confirmed the existing E2E contributor docs already describe strict evidence, opt-in live tests, and live-only mock-parity decisions.
  • 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: Independent final review passed all nine categories: provider smokes remain registered, the trusted PR workflow selects only the credential-free file, no PR job receives provider secrets, and every reported skip remains fail-closed.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes the DCO sign-off declaration 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 — E2E-support 115 files / 927 tests; gate and mock-parity integration 26 tests; Vitest collection proves a 4-test required file and 3-test provider-smoke file; provider-smoke without opt-ins reports 3 skips; CLI typecheck, project-overlap, test-size, conditional scan, Biome, and mock-parity checks pass.
  • Applicable broad gate passed — final-head GitHub CI passed the aggregate checks, all CLI shards, E2E-support, both sandbox image builds and downstream smokes, CodeQL, and the trusted cloud-onboard PR E2E gate with no skipped or pending evidence.
  • 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: Carlos Villela cvillela@nvidia.com

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv self-assigned this Jul 11, 2026
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR extracts shared live inference-routing helpers, adds credential-backed OpenAI, Anthropic, and isolation smoke tests, separates provider smoke execution from the required workflow lane, and strengthens PR gate evidence and failure-message assertions.

Changes

Live inference routing

Layer / File(s) Summary
Shared live inference harness
test/e2e/live/inference-routing-helpers.ts
Adds reusable command execution, redaction, sandbox lifecycle, onboarding, response parsing, inference verification, provider gating, and credential-isolation helpers.
Provider smoke coverage
test/e2e/live/inference-routing-provider-smoke.test.ts
Adds credential isolation and OpenAI/Anthropic routing tests using live sandbox onboarding and provider credentials.
Live lane wiring and coverage boundaries
.github/workflows/e2e.yaml, test/e2e/live/inference-routing.test.ts, test/e2e/mock-parity.json, test/e2e/support/e2e-workflow.test.ts
Moves shared setup into helpers, maps the provider smoke suite as live-only, and verifies workflow separation between required and credential-backed tests.

PR gate validation

Layer / File(s) Summary
Gate failure reporting and assertions
tools/e2e/pr-e2e-gate.mts, test/pr-e2e-gate.test.ts
Includes verdict summaries in failure errors and tightens assertions for optional skipped evidence, completion summaries, and expected failure messages.

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

Sequence Diagram(s)

sequenceDiagram
  participant providerSmokeTest
  participant nemoclaw
  participant inferenceLocal
  participant providerAPI
  providerSmokeTest->>nemoclaw: onboard sandbox with provider credentials
  nemoclaw->>inferenceLocal: expose local inference endpoint
  providerSmokeTest->>inferenceLocal: send chat or messages request
  inferenceLocal->>providerAPI: route request to configured provider
  providerAPI-->>inferenceLocal: return provider response
  inferenceLocal-->>providerSmokeTest: return response for PONG assertion
Loading

Suggested labels: security, refactor, area: ci, area: e2e

Suggested reviewers: jyaunches, brandonpelfrey

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 clearly matches the main change: isolating credential-backed E2E smokes from the CI lane.
✨ 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-e2e-optional-evidence

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

@github-code-quality

github-code-quality Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage remains at 96%, unchanged from the main branch.

TypeScript / code-coverage/cli

The overall coverage in the codex/fix-e2e-option... branch remains at 78%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main dfee116 codex/fix-e2e-option... 94e34bb +/-
src/lib/adapter...shell/client.ts 85% 83% -2%
src/lib/actions...lution-probe.ts 94% 93% -1%
src/lib/state/m...ock-identity.ts 98% 100% +2%
src/lib/state/m...lock-storage.ts 86% 88% +2%

Updated July 11, 2026 18:13 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: cloud-onboard, inference-routing
Optional E2E: cloud-inference

Dispatch hint: cloud-onboard,inference-routing

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • cloud-onboard (high): Required by the deterministic risk plan for platform-install coverage from .github/workflows/e2e.yaml; installer and platform changes must work on a clean supported host with pinned runtime dependencies.
  • inference-routing (medium): Runs the directly modified PR-safe inference-routing live lane and validates sandbox onboarding, inference.local routing, invalid credential/unreachable endpoint classification, fail-closed endpoint handling, and compatible endpoint behavior.

Optional E2E

  • cloud-inference (medium): Useful adjacent confidence for hosted NVIDIA inference through inference.local after credential-backed provider smokes were split out, but not merge-blocking because the PR does not change runtime inference source code.

New E2E recommendations

  • credential-backed provider inference routing (high): The new inference-routing-provider-smoke.test.ts is intentionally excluded from the PR-safe inference-routing job and requires real provider secrets. Add a trusted-main or manually gated secret-bearing E2E lane so NVIDIA credential isolation and OpenAI/Anthropic provider smokes are periodically enforced.
    • Suggested test: Add a trusted workflow job that runs test/e2e/live/inference-routing-provider-smoke.test.ts with NEMOCLAW_INFERENCE_ROUTING_PROVIDER_SMOKE=all and the required provider secrets.

Dispatch hint

  • Workflow: .github/workflows/e2e.yaml
  • jobs input: cloud-onboard,inference-routing

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: No advisor follow-up required beyond maintainer review.
Findings: 0 required · 0 warnings · 0 optional suggestions
Since last review: 0 prior items resolved · 0 still apply · 0 new items found

Workflow run details

This is an automated review. Required findings need action before merge. Warnings and optional suggestions do not require a response or follow-up. A human maintainer makes the final merge decision.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv changed the title fix(ci): distinguish optional E2E skips fix(ci): isolate credential-backed E2E smokes Jul 11, 2026
@cv

cv commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the required review finding in 663adc6e9 without introducing a trusted allowlist or per-test execution catalog:

  • removed optionalSkipped from production evidence and removed PR-authored optional metadata;
  • kept the controller strict: every reported skip remains Evidence is incomplete;
  • moved TC-INF-05/02/03 into a separate provider-smoke file as ordinary registered Vitest tests;
  • kept the trusted PR workflow on the four-test required file only, with a workflow-boundary regression pinning that selection;
  • added a regression proving a spoofed optionalSkipped: 1 property cannot authorize a reported skip;
  • documented that any future secret-bearing provider lane must run from trusted main.

Independent final review found the revised trust boundary clean, and every PR commit is GitHub Verified.

Comment thread test/e2e/live/inference-routing-helpers.ts Fixed
Signed-off-by: Carlos Villela <cvillela@nvidia.com>

@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/live/inference-routing-provider-smoke.test.ts (1)

97-110: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Trim the filesystem scan to stay within the 90s budget. Hashing every character offset across up to 200 files under /sandbox, /home, and /tmp is expensive, and this helper runs twice in the test. Capping the scanned bytes per file or narrowing the find scope would keep the leak check while reducing timeout risk.

🤖 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/inference-routing-provider-smoke.test.ts` around lines 97 -
110, Reduce the workload in the scanScript filesystem search by narrowing the
find scope or limiting the number of bytes processed per file, while preserving
detection of the target hash. Update the file iteration around execFileSync and
the content scanning loop so the helper remains within the 90-second budget when
invoked twice.
🤖 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/inference-routing-provider-smoke.test.ts`:
- Around line 107-141: Update the scanScript file enumeration to scan `/tmp`
before applying the `head -200` cap, ensuring `/tmp` entries are included even
when `/sandbox` or `/home` contain many files. Preserve the existing hashing and
canary detection logic.

---

Nitpick comments:
In `@test/e2e/live/inference-routing-provider-smoke.test.ts`:
- Around line 97-110: Reduce the workload in the scanScript filesystem search by
narrowing the find scope or limiting the number of bytes processed per file,
while preserving detection of the target hash. Update the file iteration around
execFileSync and the content scanning loop so the helper remains within the
90-second budget when invoked twice.
🪄 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: fb547e1f-7a82-4f1d-aa3f-6d9956ccf855

📥 Commits

Reviewing files that changed from the base of the PR and between e67c3f2 and 663adc6.

📒 Files selected for processing (8)
  • .github/workflows/e2e.yaml
  • test/e2e/live/inference-routing-helpers.ts
  • test/e2e/live/inference-routing-provider-smoke.test.ts
  • test/e2e/live/inference-routing.test.ts
  • test/e2e/mock-parity.json
  • test/e2e/support/e2e-workflow.test.ts
  • test/pr-e2e-gate.test.ts
  • tools/e2e/pr-e2e-gate.mts
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/e2e.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/e2e/pr-e2e-gate.mts

Comment thread test/e2e/live/inference-routing-provider-smoke.test.ts Outdated
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed CodeRabbit's non-inline performance nitpick about the character-by-character filesystem hash scan. I am not changing that algorithm in this PR: it is pre-existing behavior moved unchanged into the optional credential-smoke file, it is not selected by the PR-safe lane, and improving its worst-case runtime would require a separate sampling/hash design change rather than an evidence-boundary fix. The actionable /tmp ordering issue was fixed in 94e34bba0, preserving the existing cap and timeout while making the canary deterministic.

@cv
cv merged commit 26f6988 into main Jul 11, 2026
57 checks passed
@cv
cv deleted the codex/fix-e2e-optional-evidence branch July 11, 2026 18:23
@cv

cv commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator Author

Post-merge verification passed on current main:

No risk-signal.json is expected for this direct main dispatch because the PR-controller SHA/plan/correlation inputs are intentionally empty. The workflow scorecard confirms one selected E2E job passed.

Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary

The PR E2E gate currently rejects `inference-routing` after its four
required checks pass because three credential-backed smokes are
collected and deliberately skip. This keeps the gate strict, moves those
smokes behind a trusted file boundary that the PR workflow does not
select, and makes failed coordinator annotations include the concrete
evidence summary.

## Changes

- Keep the PR-required `inference-routing.test.ts` lane fully
discoverable with four ordinary, always-on tests and no skipped
evidence.
- Move the NVIDIA credential-isolation, OpenAI, and Anthropic smokes
into `inference-routing-provider-smoke.test.ts`; all three remain
ordinary registered Vitest tests, but no PR workflow supplies provider
secrets or selects that file.
- Extract shared onboarding, cleanup, command, and protocol helpers so
the file split does not duplicate the substantial live-test machinery.
- Pin the trusted workflow boundary with a support test, and record the
new credential-backed file as live-only under the existing mock-parity
policy. Any future secret-bearing lane must run it from trusted `main`.
- Keep every reported skip fail-closed, including evidence carrying a
spoofed `optionalSkipped` property.
- Include the verdict summary in failed coordinator annotations so
missing or unfinished shards are visible directly in the job log.

## 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 exactly 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 an internal
CI/test boundary; audits confirmed the existing E2E contributor docs
already describe strict evidence, opt-in live tests, and live-only
mock-parity decisions.
- [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 final
review passed all nine categories: provider smokes remain registered,
the trusted PR workflow selects only the credential-free file, no PR job
receives provider secrets, and every reported skip remains fail-closed.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## 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 the DCO sign-off declaration 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 — E2E-support 115 files / 927 tests;
gate and mock-parity integration 26 tests; Vitest collection proves a
4-test required file and 3-test provider-smoke file; provider-smoke
without opt-ins reports 3 skips; CLI typecheck, project-overlap,
test-size, conditional scan, Biome, and mock-parity checks pass.
- [x] Applicable broad gate passed — final-head GitHub CI passed the
aggregate checks, all CLI shards, E2E-support, both sandbox image builds
and downstream smokes, CodeQL, and the trusted `cloud-onboard` PR E2E
gate with no skipped or pending evidence.
- [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: Carlos Villela <cvillela@nvidia.com>

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@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 labels Jul 30, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants