Skip to content

fix(maintainer): authenticate fork Advisor runs - #8587

Merged
cv merged 3 commits into
mainfrom
codex/advisor-fork-associationless-run
Aug 8, 2026
Merged

fix(maintainer): authenticate fork Advisor runs#8587
cv merged 3 commits into
mainfrom
codex/advisor-fork-associationless-run

Conversation

@apurvvkumaria

@apurvvkumaria apurvvkumaria commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

The maintainer merge gate currently rejects a successful PR Review Advisor run for a fork pull request when GitHub Actions omits the run's pull-request association, even though the run otherwise identifies the current fork branch revision. This change accepts that narrow GitHub payload shape only after validating the current revision, branch, source repository, trusted workflow identity, event, job URL, latest attempt, status, and conclusion.

Changes

  • Permit association-less Advisor evidence only for cross-repository pull requests whose current revision, branch, and source repository all match the workflow run.
  • Keep same-repository runs and any mismatched, stale, untrusted, incomplete, or failed evidence blocked.
  • Add positive coverage for the current fork payload shape and negative coverage for mismatched revision, branch, source repository, and incomplete workflow-run data.

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 evidence authentication and does not change user-facing commands, configuration, or workflows.
  • 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 review receipt; all nine categories passed with no findings.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: the change is confined to internal maintainer gate authentication, with no user-facing behavior or documentation contract change.
  • Agent: Codex Desktop

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal commit and push hooks passed
  • Targeted tests pass for changed behavior — all 83 maintainer gate tests pass, including hostile and latest-attempt cases
  • Full npm test passes (broad runtime changes only)
  • 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)

Additional verification: CLI build and type checking pass; whitespace and diff checks pass.


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

Summary by CodeRabbit

  • Bug Fixes

    • Improved validation of pull request workflow runs without an associated pull request.
    • Correctly recognizes matching fork runs using commit, branch, and repository details.
    • Prevents runs with mismatched status, conclusion, commit, branch, or repository metadata from being treated as advisory.
  • Tests

    • Added coverage for matching and mismatching association-less fork workflow runs.

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

coderabbitai Bot commented Aug 7, 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: 087a8ebd-1d3d-4119-ab4e-e13ddf236da4

📥 Commits

Reviewing files that changed from the base of the PR and between 34b2714 and 7a04b67.

📒 Files selected for processing (2)
  • .agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts
  • test/skills/check-gates-actions-evidence.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • .agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts
  • test/skills/check-gates-actions-evidence.test.ts

📝 Walkthrough

Walkthrough

The gate validates association-less fork runs using head SHA, branch, and repository metadata. Tests cover matching metadata as advisory and mismatched or incomplete runs as merge-relevant.

Changes

Advisor authentication

Layer / File(s) Summary
Head binding and advisory authentication
.agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts
The gate classifies association-less runs by head metadata. Advisory authentication accepts exact pull request identity or a matching completed association-less fork run.
Fork metadata validation
test/skills/check-gates-actions-evidence.test.ts
Fixtures support head metadata. Tests cover matching metadata, incomplete runs, and mismatches in the SHA, branch, or repository.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#8563: Extends advisor-check authentication with association-less fork-run matching.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: authenticating fork Advisor runs in the maintainer gate.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/advisor-fork-associationless-run

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

@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

Independent correctness, documentation, and nine-category security review is complete for the current branch revision.

Result: PASS with no actionable findings.

The review covered input and trust-boundary validation, authentication and authorization, command execution, credential and data exposure, network behavior, filesystem behavior, race and concurrency handling, dependency and supply-chain impact, and fail-closed error handling. The association-less path is limited to cross-repository pull requests and still requires the run to match the current branch revision, branch name, source repository, trusted workflow and event, GitHub-hosted job URL, latest attempt, completed status, and successful conclusion. Negative tests keep mismatched revision, branch, repository, same-repository payloads, stale attempts, and untrusted evidence blocked.

Documentation review concluded that no user-facing update is needed because this changes only internal maintainer evidence authentication. Verification passed: all 81 maintainer gate tests, CLI build, CLI type checking, commit and push hooks, and diff checks.

@github-code-quality

github-code-quality Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 7a04b67 in the codex/advisor-fork-a... branch remains at 96%, unchanged from commit cdaefe8 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 7a04b67 in the codex/advisor-fork-a... branch remains at 81%, unchanged from commit fbc7a9d in the main branch.

Show a code coverage summary of the most impacted files.
File main fbc7a9d codex/advisor-fork-a... 7a04b67 +/-
src/lib/actions...ssions/paths.ts 87% 83% -4%
src/lib/actions...or-inference.ts 98% 98% 0%
src/lib/inferen...anaged-state.ts 75% 75% 0%
src/lib/sandbox...rce-identity.ts 83% 83% 0%
src/lib/onboard...ed-lifecycle.ts 76% 79% +3%
src/lib/onboard...oute-handoff.ts 92% 95% +3%
src/lib/inferen...naged-status.ts 80% 88% +8%
src/lib/onboard...test-support.ts 0% 100% +100%

Updated August 07, 2026 22:14 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 @.agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts:
- Around line 1906-1920: Require run.status === "COMPLETED" and run.conclusion
!== null in the authenticated result condition around currentPrBinding in
check-gates.ts. In test/skills/check-gates-actions-evidence.test.ts lines
171-227, add an association-less fork case with an in-progress run and null
conclusion, asserting that the CI gate fails.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ae39583d-b1a6-4041-b048-35db289a2203

📥 Commits

Reviewing files that changed from the base of the PR and between cdaefe8 and 34b2714.

📒 Files selected for processing (2)
  • .agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts
  • test/skills/check-gates-actions-evidence.test.ts

Comment thread .agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / low confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: Same-session synthesis validation failed; the advisor result is incomplete.

Model lanes

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

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

1 semantic terminology decision

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • justified — association-less at test/skills/check-gates-actions-evidence.test.ts:207: Keep `association-less`; the modifier identifies the fallback evidence-validation path.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite against this exact revision.

Recommended E2E: None

Workflow run details

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

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

Copy link
Copy Markdown
Collaborator Author

Addressed the workflow-run terminal-state finding in the current branch revision.

The association-less fork fallback now requires the workflow run itself to be completed with a non-null conclusion before its Advisor result can remain advisory. The ordinary PR-associated path is intentionally unchanged, so authenticated pending or failed Advisor runs retain the repository’s advisory semantics.

Added independent negative cases for an in-progress run with a terminal job and a completed run without a conclusion. All 83 maintainer gate tests pass; commit/push hooks pass; the new commit is GitHub Verified. Independent review found no issues and passed all nine security categories. Documentation remains unchanged because this is internal evidence-authentication hardening.

@cv
cv merged commit c6fb802 into main Aug 8, 2026
81 of 82 checks passed
@cv
cv deleted the codex/advisor-fork-associationless-run branch August 8, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants