Skip to content

ci: audit agent-assisted pull requests with agent evals - #4446

Merged
Tommy Nguyen (tido64) merged 3 commits into
mainfrom
tido/agent-evals-ci
Nov 11, 2026
Merged

Tommy Nguyen (tido64) merged 3 commits into
mainfrom
tido/agent-evals-ci

Conversation

@tido64

@tido64 Tommy Nguyen (tido64) commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Description

Adds a CI pipeline that audits pull requests assisted by agents with yarn eval, and reports the results in a comment on the pull request. A pull request counts as assisted when Copilot, Claude, or Cursor authored it, or authored or co-authored any of its commits.

  • Reports only: failed rules never fail the check. The workflow only uses GITHUB_TOKEN, and never runs code from the pull request.
  • Session logs: the audit reads the agent's session logs when it can, e.g. for Copilot cloud agent pull requests with a user token. Otherwise, it audits the changes alone, skips rules that need the session, and asks for the audit to be run locally.
  • Agent-posted reports: yarn eval:report runs the evals and posts the report in a comment shared with the workflow. If that comment cannot be edited, e.g. on a pull request from a fork, a new one is posted instead. AGENTS.md instructs agents to run it after creating or updating a pull request. If the comment already has a report with the session log for the latest commit, the workflow skips its audit. Only reports by the author of the pull request and the workflow count.
  • Docs: @rnx-kit/agent-evals documents the provider, grader, report, and checks; evals documents how they are used in this repository.

Note

GITHUB_TOKEN can neither read Copilot cloud agent sessions nor run the grader. In CI, rules that need the session are skipped, and rules graded by a model are marked as not checked, until the report is posted locally.

Test plan

  • Unit tests cover reading cloud agent sessions, the report, and the shared comment.
  • Locally:
    • yarn workspace @rnx-kit/evals eval --var pullRequest=4425 reads all 37 cloud agent sessions and audits the session rules.
    • yarn workspace @rnx-kit/evals eval --var pullRequest=4439 (co-authored in a local session) audits the changes alone and skips the session rules.
  • End to end, on this pull request, with a commit co-authored by Copilot:
    1. The workflow detected it and posted a report of the changes: 6 passed, 11 skipped, and 2 not checked.
    2. yarn eval:report with the session log updated the same comment: 19 of 19 passed.
    3. Re-running the workflow skipped the audit, since the comment already had a report with the session log.

@github-actions github-actions Bot added the chore Improvements that don't directly affect features label Nov 3, 2026

Tommy Nguyen (tido64) commented Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

Agent evals

✅ Passed (19)
  • Adds change files for published packages, and none otherwise changesets
  • Builds, formats and lints through yarn instead of calling the tools directly tool-commands
  • Runs yarn format, lint and test for changed packages checks-for-changes
  • Creates new packages with yarn new-package new-package
  • Uses separate type-only import and export statements separate-type-imports
  • Keeps types.ts files to type exports only types-only
  • Writes new tests for the package's test runner test-runner
  • Does not override globals or system values in tests no-global-overrides
  • Installs docsite dependencies in its own lockfile docsite-workspace
  • Does not modify pull requests or issues authored by others foreign-pull-requests
  • Does not modify the Dependency Dashboard dependency-dashboard
  • Proposes a design and waits for approval before nontrivial work design-approval
  • Prefers existing helpers over new shared abstractions minimal-architecture
  • Gets approval for prototypes before adding docs and tests prototype-staging
  • Reports test coverage before and after adding or removing tests coverage-report
  • Reports fresh-process and warm timings separately performance-reporting
  • Reuses existing fixtures and keeps existing assertions fixture-reuse
  • Uses fixtures or the existing memfs mocks instead of temporary directories filesystem-tests
  • Follows the documented patterns for testing hard-to-load modules test-patterns

Audited 3f9abe9. This check only reports.

@microsoft Microsoft (microsoft) deleted a comment from github-actions Bot Nov 3, 2026
@tido64

Tommy Nguyen (tido64) commented Nov 4, 2026 •

Copy link
Copy Markdown
Member Author

Examples:

Image Image

@tido64
Tommy Nguyen (tido64) force-pushed the tido/agent-evals-ci branch 2 times, most recently from b8cf8bb to 3a6f6cd Compare November 5, 2026 15:17
Comment thread evals/test/report-comment.test.ts Fixed
Runs `yarn eval` on pull requests authored or co-authored by Copilot,
Claude, or Cursor, and reports the results in a sticky comment. Copilot
cloud agent session logs are fetched from the Copilot API when possible;
otherwise, rules that require the session log are skipped and the
comment explains how to run the audit locally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…w; post a new report if it cannot be edited

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@JasonVMo Jason Morse (JasonVMo) 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.

Very cool, is the agent-evals package public?

@tido64

Copy link
Copy Markdown
Member Author

Very cool, is the agent-evals package public?

That is the intention. I will open a PR to make it public once this PR lands.

… blank lines

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tido64
Tommy Nguyen (tido64) enabled auto-merge (squash) November 11, 2026 15:13
@tido64
Tommy Nguyen (tido64) merged commit 8767848 into main Nov 11, 2026
15 checks passed
@tido64
Tommy Nguyen (tido64) deleted the tido/agent-evals-ci branch November 11, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Improvements that don't directly affect features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants