Skip to content

fix(ci): report advisor health and close stale E2E checks#6807

Merged
cv merged 3 commits into
mainfrom
codex/fix-advisor-followups
Jul 13, 2026
Merged

fix(ci): report advisor health and close stale E2E checks#6807
cv merged 3 commits into
mainfrom
codex/fix-advisor-followups

Conversation

@cv

@cv cv commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

This follow-up to #6745 and #6788 makes the combined PR Review Advisor disclose both model lanes without giving Nemotron authority over GPT's assessment, fixes contradictory confidence and E2E guidance, and ensures stale CI events close only the seeded in-progress E2E check. Missing or malformed Nemotron artifacts now degrade to an unavailable second opinion while a valid GPT review still publishes.

Changes

  • Download the exact same-run Nemotron artifact in the write-capable publisher, validate its raw status, final result, summary, size, path, and head SHA, and pass it to the comment renderer only through a trusted validation output. GPT remains fail-closed and authoritative; the nonblocking Nemotron lane reports only allowlisted status, confidence, severity counts, and opaque structural agreement or disagreement.
  • Render the actual normalized confidence for informational reviews, reconcile trusted E2E coverage and selector tiers through the existing target normalizer, and avoid “Why no…” text when optional guidance exists.
  • Delete only github-actions[bot] comments whose first line is one of the two retired E2E Advisor markers, after the combined sticky comment publishes. The bot-owner and exact-marker restrictions are covered by the security-boundary tests.
  • Recover an existing exact-diff check ID before stale workflow-run validation only when the check is still in_progress, allowing the existing cleanup step to terminalize abandoned checks without rewriting completed historical results.
  • Extend workflow-boundary, comment, normalization, GitHub API, and gate regression tests for complete, partial, failed, skipped, malformed, stale, and completed-check cases.

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 internal maintainer automation and GitHub workflow behavior only; the required documentation-writer pass found no user-facing CLI, configuration, API, policy, or product documentation change.
  • 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 reviews found no remaining findings after checking pull_request_target privilege separation, same-run artifact provenance, primary fail-closed behavior, nonblocking secondary validation, prose isolation, exact bot-owned legacy comment deletion, E2E selector trust, and stale/completed check races. The nine-category security checklist also found no secret, injection, authorization, dependency, logging, cryptography, configuration, test, or holistic posture regression.
  • 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 — final advisor suites passed 120/120 tests, the compacted advisor regression passed 44/44, and all four PR E2E gate suites passed 69/69; CLI type-check passed in the normal pre-push hook.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • 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

Summary by CodeRabbit

  • New Features
    • PR review comments now support an optional second-opinion analysis, including model-lane status and comparison details when compatible.
    • Comments show clearer confidence-aware model-lane information, with improved E2E “no coverage” messaging.
    • Legacy advisor sticky comments are cleaned up automatically during updates.
  • Bug Fixes
    • E2E recommendations/coverage handling is corrected when only optional coverage is selected.
    • E2E coverage/target reconciliation is more accurately aligned with available trusted capabilities.
    • PR gate handling is improved for stale, duplicate, and superseded checks—avoiding unnecessary check reopens and recording recovered check IDs.

@cv cv added the area: security Security controls, permissions, secrets, or hardening label Jul 13, 2026
@cv cv self-assigned this Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 690af2da-e997-4f96-b067-9a8957a946b1

📥 Commits

Reviewing files that changed from the base of the PR and between 1cae4fd and 0fcf764.

📒 Files selected for processing (1)
  • tools/pr-review-advisor/workflow-boundary.mts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/pr-review-advisor/workflow-boundary.mts

📝 Walkthrough

Walkthrough

The PR adds optional second-opinion artifact validation and publication, lane-aware review comments, E2E coverage reconciliation, sticky-comment cleanup, and idempotent PR-gate recovery behavior with expanded tests.

Changes

Advisor publication and E2E behavior

Layer / File(s) Summary
Dual advisor artifact publication
.github/workflows/pr-review-advisor.yaml, tools/pr-review-advisor/workflow-boundary.mts, test/pr-review-advisor-workflow-boundary.test.ts
The workflow validates primary and optional secondary artifacts, forwards validated second-opinion results, and tests accepted, rejected, omitted, and malformed artifact scenarios.
Second-opinion lane comments and cleanup
tools/pr-review-advisor/comment.mts, tools/advisors/github.mts, test/pr-review-advisor-comment-cli.test.ts, test/pr-review-advisor-security-boundaries.test.ts
Advisor lane reports gain normalized statuses, deterministic fingerprints, sanitized comparisons, and legacy bot-owned sticky-comment cleanup.
E2E coverage reconciliation
tools/pr-review-advisor/analyze.mts, tools/advisors/e2e-recommendations.mts, test/pr-review-advisor.test.ts, test/e2e-recommendations.test.ts
E2E coverage is reconciled with trusted inventory selectors, optional-only coverage clears the no-coverage reason, and confidence and tier assertions are updated.
PR gate recovery and idempotency
tools/e2e/pr-e2e-gate.mts, test/pr-e2e-gate.test.ts
Existing exact-diff checks are detected and reused without duplicate reopening or patching, with recovered check identifiers recorded in workflow output.

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

Sequence Diagram(s)

sequenceDiagram
  participant PublishWorkflow
  participant ArtifactValidator
  participant CommentCLI
  participant GitHub
  PublishWorkflow->>ArtifactValidator: validate primary and secondary artifacts
  ArtifactValidator-->>PublishWorkflow: return secondary validation status
  PublishWorkflow->>CommentCLI: publish primary and validated second-opinion results
  CommentCLI->>GitHub: update review comment and delete legacy sticky comments
Loading

Possibly related issues

Possibly related PRs

  • NVIDIA/NemoClaw#5873 — Adds the Nemotron Ultra lane that this PR extends with artifact validation and conditional publication.

Suggested labels: area: ci, area: e2e, bug-fix

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main changes: advisor health reporting plus stale E2E check cleanup.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-advisor-followups

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

@github-code-quality

github-code-quality Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

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

TypeScript / code-coverage/cli

The overall coverage in the branch remains at 79%, unchanged from the branch.

Show a code coverage summary of the most impacted files.
File 462b789 0fcf764 +/-
src/lib/messagi...ate-resolver.ts 78% 56% -22%
src/lib/messagi...parser-utils.ts 95% 86% -9%
src/lib/messagi...onfig-parser.ts 90% 83% -7%
src/lib/adapter.../docker/pull.ts 83% 79% -4%
src/lib/messagi...onfig-parser.ts 97% 93% -4%
src/lib/shields/index.ts 62% 62% 0%
src/lib/messagi...ink-base-url.ts 90% 100% +10%
src/lib/messagi...onfig-parser.ts 57% 71% +14%
src/lib/adapter...ocker/volume.ts 70% 85% +15%
src/lib/messagi...onfig-parser.ts 62% 77% +15%

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

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / low confidence
Primary next action: No advisor follow-up required beyond maintainer review.
Findings: 0 blockers · 0 warnings · 0 optional suggestions
Status: No actionable findings remain in the canonical review ledger.

E2E guidance

Advisory only: coverage and selector recommendations are non-authoritative. E2E / PR Gate independently computes and dispatches trusted jobs without consuming this output.

Recommended coverage: cloud-onboard, credential-sanitization, security-posture
Recommended selectors: cloud-onboard, credential-sanitization, security-posture

  • cloud-onboard — Selected from the trusted checked-in E2E coverage inventory.

  • credential-sanitization — Selected from the trusted checked-in E2E coverage inventory.

  • security-posture — Selected from the trusted checked-in E2E coverage inventory.

  • cloud-onboard — Selected as a trusted checked-in E2E job.

  • credential-sanitization — Selected as a trusted checked-in E2E job.

  • security-posture — Selected as a trusted checked-in E2E job.

Workflow run details

This is an automated, non-authoritative review. Findings are inputs to maintainer adjudication. Warnings and optional suggestions do not require a response or follow-up. A human maintainer makes the final merge decision.

@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.

🧹 Nitpick comments (1)
tools/pr-review-advisor/workflow-boundary.mts (1)

531-557: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the duplicated forbidden-with key list into one canonical constant.

The same list ["run-id", "github-token", "repository", "pattern", "merge-multiple"] is inlined for both the primary (Line 531) and secondary (Line 553) download checks. Since this is a security guardrail, an addition to one list that misses the other silently weakens the check for the other download step.

As per path instructions: "Derive inventories and limits from a canonical source where possible; flag duplicated lists that can silently drift."

♻️ Suggested shared constant (define once at module scope)
const FORBIDDEN_DOWNLOAD_WITH_KEYS = [
  "run-id",
  "github-token",
  "repository",
  "pattern",
  "merge-multiple",
] as const;
-  for (const forbidden of ["run-id", "github-token", "repository", "pattern", "merge-multiple"]) {
+  for (const forbidden of FORBIDDEN_DOWNLOAD_WITH_KEYS) {
     if (Object.hasOwn(asRecord(download?.with), forbidden)) {
       errors.push(`Download primary advisor artifact must not set with.${forbidden}`);
     }
   }

Apply the same substitution at Line 553 for the secondary download loop.

🤖 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 `@tools/pr-review-advisor/workflow-boundary.mts` around lines 531 - 557, Define
a module-scope canonical constant for the forbidden download `with` keys, using
the existing five-key list, then update both primary and secondary download
validation loops to iterate over that constant instead of separate inline
arrays. Keep the existing error messages and validation behavior unchanged.

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 `@tools/pr-review-advisor/workflow-boundary.mts`:
- Around line 531-557: Define a module-scope canonical constant for the
forbidden download `with` keys, using the existing five-key list, then update
both primary and secondary download validation loops to iterate over that
constant instead of separate inline arrays. Keep the existing error messages and
validation behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4e438f9b-4946-4d3e-b999-a32293d81494

📥 Commits

Reviewing files that changed from the base of the PR and between f62c278 and 1cae4fd.

📒 Files selected for processing (13)
  • .github/workflows/pr-review-advisor.yaml
  • test/e2e-recommendations.test.ts
  • test/pr-e2e-gate.test.ts
  • test/pr-review-advisor-comment-cli.test.ts
  • test/pr-review-advisor-security-boundaries.test.ts
  • test/pr-review-advisor-workflow-boundary.test.ts
  • test/pr-review-advisor.test.ts
  • tools/advisors/e2e-recommendations.mts
  • tools/advisors/github.mts
  • tools/e2e/pr-e2e-gate.mts
  • tools/pr-review-advisor/analyze.mts
  • tools/pr-review-advisor/comment.mts
  • tools/pr-review-advisor/workflow-boundary.mts

@cv
cv merged commit 9168c60 into main Jul 13, 2026
82 of 83 checks passed
@cv
cv deleted the codex/fix-advisor-followups branch July 13, 2026 23:58
@github-actions github-actions Bot added the v0.0.82 Release target label Jul 13, 2026
@cv cv mentioned this pull request Jul 14, 2026
21 tasks
cv added a commit that referenced this pull request Jul 14, 2026
## Summary

Separate trusted controller health from the exact-diff merge verdict so
handled PR CI/E2E failures and superseded or closed revisions no longer
masquerade as controller failures. Add self-explanatory diagnostics and
exception links while preserving red controller status for real
controller, correlation, and evidence-download faults. This follows the
actual-run review of #6807 and #6810.

## Changes

- Rename the workflow to `E2E / PR Gate Controller` while preserving the
required custom check name `E2E / PR Gate`, and document which outcome
controls merge authority.
- Complete prerequisite-CI and selected-E2E failures as handled red PR
verdicts with direct run, job, and failed-step links; paginate bounded
workflow-job results and keep diagnostic lookup failures fail-closed at
the PR check.
- Cancel exact checks for superseded revisions and closed PRs, including
deleted fork repositories, only after validating the trusted check
identity. Bracket evidence parsing with live exact-diff reads so stale
evidence cannot become a current result.
- Keep infrastructure failures distinct: a successful child whose
evidence download fails leaves both controller and custom check red,
while classified missing, duplicate, skipped, pending, or
reported-failing signals remain handled PR verdicts.
- Make no-secret exceptions explicitly say that credentialed E2E did not
run, embed the controller-run link needed for **Review deployments**,
and clarify the exact manual evidence URL format.
- Add lifecycle, pagination, workflow, command, exception, and race
regression coverage; update the E2E reference and maintainer merge-gate
guidance.

## 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: No end-user product behavior
changed; the internal E2E reference and maintainer merge-gate guidance
were updated.
- [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: Adversarial fail-closed
review covered GitHub App/external-ID correlation, stale and
deleted-fork revisions, bounded diagnostics, evidence trust boundaries,
download failures, and pre/post-parse race validation; no remaining
blockers.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [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 — `npx vitest run --project integration
test/pr-e2e-gate-command.test.ts test/pr-e2e-gate.test.ts
test/pr-e2e-gate-lifecycle.test.ts test/pr-e2e-gate-exceptions.test.ts
test/pr-e2e-gate-workflow.test.ts` (5 files, 107 tests passed)
- [x] Applicable broad gate passed — `GIT_CONFIG_GLOBAL=/dev/null
SSH_AUTH_SOCK=/tmp/ssh-qmH9wX3sr5/agent.4170011 npm test` (1,502 files
and 17,062 tests passed; 3 files and 40 tests skipped)
- [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: Carlos Villela <cvillela@nvidia.com>


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

* **Improvements**
* Renamed the E2E gate workflow to **E2E / PR Gate Controller** with
stronger handling for superseded, closed, cancelled, and timeout
scenarios.
* Improved evidence verification and finalization reporting, including
evidence outcome propagation and clearer fail-closed behavior.
* Updated wait/completion behavior so terminal failures/timeouts are
reported consistently without unexpected non-zero exits, and improved
check conclusion/link messaging (including **cancelled**).

* **Documentation**
* Refined controller/manual dispatch guidance, evidence handling rules,
and “no-secret exception” workflow instructions.

* **Tests**
* Updated and expanded E2E lifecycle, workflow contract, and CLI
parsing/evidence outcome coverage to match the new behavior and
messages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: security Security controls, permissions, secrets, or hardening v0.0.82 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants