Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/agent-evals-publish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rnx-kit/agent-evals": minor
---

Audit coding agent sessions against repository conventions with promptfoo
39 changes: 36 additions & 3 deletions incubator/agent-evals/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# @rnx-kit/agent-evals

[![Build](https://github.com/microsoft/rnx-kit/actions/workflows/build.yml/badge.svg)](https://github.com/microsoft/rnx-kit/actions/workflows/build.yml)
[![npm version](https://img.shields.io/npm/v/@rnx-kit/agent-evals)](https://www.npmjs.com/package/@rnx-kit/agent-evals)

🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧

Expand All @@ -13,10 +14,28 @@ conventions with [promptfoo](https://promptfoo.dev). It provides a promptfoo
provider that replays a Copilot session, a Copilot grader for `llm-rubric`
assertions, and checks that assertions can reference.

This package is not published yet. See [`evals`](../../evals) for how it is
used in this repository.
See [`evals`](https://github.com/microsoft/rnx-kit/tree/main/evals) for how it
is used in this repository.

## Setup
## Installation

```sh
yarn add @rnx-kit/agent-evals --dev
```

or if you're using npm

```sh
npm add --save-dev @rnx-kit/agent-evals
```

The [grader](#grader) also requires `@github/copilot-sdk`:

```sh
yarn add @github/copilot-sdk --dev
```

## Usage

promptfoo loads providers and assertions from files, so re-export them from
your eval project, e.g. in `src/provider.ts`, `src/grader.ts` and `src/index.ts`:
Expand Down Expand Up @@ -57,6 +76,20 @@ extensions:
- file://src/index.ts:afterAll
```

Finally, run the evals with promptfoo:

```sh
npx promptfoo eval
```

To audit a specific session or pull request, set the corresponding
[var](#provider):

```sh
npx promptfoo eval --var copilotSession=<session id>
npx promptfoo eval --var pullRequest=<number>
```

## Provider

`@rnx-kit/agent-evals/provider` replays a Copilot session and returns an
Expand Down
5 changes: 2 additions & 3 deletions incubator/agent-evals/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@rnx-kit/agent-evals",
"version": "0.0.1",
"private": true,
"description": "EXPERIMENTAL - USE WITH CAUTION - Audit coding agent sessions against repository conventions with promptfoo",
"homepage": "https://github.com/microsoft/rnx-kit/tree/main/incubator/agent-evals#readme",
"license": "MIT",
Expand Down Expand Up @@ -51,8 +50,8 @@
},
"dependencies": {
"@changesets/parse": "^1.0.0",
"@rnx-kit/tools-filesystem": "workspace:*",
"@rnx-kit/tools-shell": "workspace:*",
"@rnx-kit/tools-filesystem": "workspace:^",
"@rnx-kit/tools-shell": "workspace:^",
"parse-diff": "catalog:",
"shell-quote": "^1.8.4"
},
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5177,8 +5177,8 @@ __metadata:
"@changesets/parse": "npm:^1.0.0"
"@github/copilot-sdk": "catalog:"
"@rnx-kit/scripts": "workspace:*"
"@rnx-kit/tools-filesystem": "workspace:*"
"@rnx-kit/tools-shell": "workspace:*"
"@rnx-kit/tools-filesystem": "workspace:^"
"@rnx-kit/tools-shell": "workspace:^"
"@rnx-kit/tsconfig": "workspace:*"
"@types/node": "npm:^24.0.0"
parse-diff: "catalog:"
Expand Down
Loading