Skip to content

fix(advisor): validate hosted specialist artifacts - #10727

Closed
cv wants to merge 1 commit into
mainfrom
fix/advisor-hosted-artifact-contract
Closed

fix(advisor): validate hosted specialist artifacts#10727
cv wants to merge 1 commit into
mainfrom
fix/advisor-hosted-artifact-contract

Conversation

@cv

@cv cv commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Outcome

Hosted PR Advisor jobs now reject incomplete specialist artifacts before publishing their job summary.

Reason

The final review of #10701 found that a Markdown-only artifact could appear complete without its required native JSONL session trace.

Changes

  • Share the existing Markdown-and-JSONL artifact validator between local and hosted review paths.
  • Validate downloaded hosted artifacts before summary publication.
  • Remove unused dependency-version workflow variables; the committed lockfile remains authoritative.
  • Add hosted lifecycle coverage for complete and incomplete artifact sets.

Verification

  • npx vitest run --project integration test/automation/pull-requests/pr-review-advisor-openshell.test.ts test/automation/pull-requests/pr-review-advisor-local.test.ts test/automation/pull-requests/growth-guardrails.test.ts — 95 passed.
  • npm run typecheck:cli — passed.
  • npm run validate:pr — passed.
  • No secrets added.

DCO Sign-Off

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

Summary by CodeRabbit

  • Bug Fixes

    • Improved review advisor reliability by validating specialist analysis artifacts before publishing results.
    • Incomplete, unexpected, non-regular, or symbolic-link artifacts are now rejected.
    • Prevented job summaries from being updated when specialist output is invalid.
  • Tests

    • Added coverage for incomplete artifact handling and confirmed failed analyses leave existing job summaries unchanged.
    • Updated hosted specialist lifecycle checks to reflect the required summary and session outputs.

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

coderabbitai Bot commented Sep 1, 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: b71e564d-401d-4f72-bef0-74dd780a748b

📥 Commits

Reviewing files that changed from the base of the PR and between 94019cf and ccd6eaa.

📒 Files selected for processing (4)
  • .github/workflows/pr-review-advisor.yaml
  • test/automation/pull-requests/pr-review-advisor-openshell.test.ts
  • tools/pr-review-advisor/local-review-implementation.mts
  • tools/pr-review-advisor/specialist-lifecycle.mts
💤 Files with no reviewable changes (1)
  • .github/workflows/pr-review-advisor.yaml

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The PR review advisor now validates specialist artifact sets for local and hosted workflows. Hosted summary publication requires valid configuration and complete regular artifacts. Tests cover the expected session artifact and incomplete-artifact rejection.

Changes

PR review advisor

Layer / File(s) Summary
Shared specialist artifact validation
tools/pr-review-advisor/specialist-lifecycle.mts, tools/pr-review-advisor/local-review-implementation.mts
The lifecycle module exports artifact validation. Local review uses this shared validator with the artifact directory prefix and specialist interest.
Hosted publication guard
tools/pr-review-advisor/specialist-lifecycle.mts, .github/workflows/pr-review-advisor.yaml
Hosted analysis checks workspace, artifact-directory, and interest configuration, validates artifacts, and then publishes the job summary. The workflow no longer pins the listed SDK, TypeBox, YAML, and Undici versions through job environment variables.
Incomplete artifact test coverage
test/automation/pull-requests/pr-review-advisor-openshell.test.ts
The fixture creates the session JSONL artifact. The test verifies that incomplete artifacts reject without changing the existing job summary.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to ccd6e

The PR adds fail-closed validation before hosted summaries are published and shares that validation with the local path. No actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant runAdvisorSpecialistCommand
  participant validateSpecialistArtifacts
  participant publishSpecialistJobSummary
  runAdvisorSpecialistCommand->>validateSpecialistArtifacts: Validate generated artifacts
  validateSpecialistArtifacts-->>runAdvisorSpecialistCommand: Return validation result
  runAdvisorSpecialistCommand->>publishSpecialistJobSummary: Publish validated summary
Loading

Suggested reviewers: apurvvkumaria, aasthajh

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. 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 clearly and concisely describes the main change: validating hosted specialist artifacts in the PR Advisor.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/advisor-hosted-artifact-contract

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

@github-code-quality

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit ccd6eaa in the fix/advisor-hosted-a... branch remains at 96%, unchanged from commit 94019cf in the main branch.

@cv

cv commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

Not likely to happen all that ofte

@cv cv closed this Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant