Skip to content

Commit a867fb1

Browse files
feat(ci): per-PR agent benchmark (Strands + Bedrock) (#132)
1 parent 314a7f2 commit a867fb1

46 files changed

Lines changed: 8321 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/ci-pr-agent-bench.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
---
3+
4+
ci: per-PR agent bench on Strands + Bedrock
5+
6+
Internal CI tooling — no published-package changes.

.github/workflows/agent-bench.yml

Lines changed: 568 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: PR Agent Bench
2+
3+
# Thin CALLER for the per-PR LLM-agent benchmark. This workflow owns the
4+
# triggers and the same-repo (fork) gate; the bench matrix + summary live in
5+
# the reusable workflow .github/workflows/agent-bench.yml, invoked below so
6+
# GitHub renders a nested check hierarchy: PR Agent Bench / bench / <cell>.
7+
#
8+
# Required configuration (publish environment, consumed inside agent-bench.yml):
9+
# AWS_ROLE_ARN secret OIDC role with bedrock:InvokeModelWithResponseStream
10+
# on the bench model, plus s3:PutObject on bench/* in
11+
# the registry bucket (per-cell archive + the commit-
12+
# keyed baseline aggregate). Reading the baseline back
13+
# for the PR-vs-baseline overview also needs
14+
# s3:GetObject on bench/* — if the role lacks it the
15+
# overview simply degrades to "no baseline" (never an
16+
# error). See agent-bench.yml.
17+
# S3_BUCKET variable Registry bucket (existing).
18+
19+
on:
20+
# Runs unconditionally on same-repo PR open/update AND on every push to main
21+
# (a main run records the merged commit's baseline for later PRs to diff
22+
# against). There is NO label gate: the bench is green-regardless — a failed
23+
# cell / agent-timeout lands in the run summary, not the check status — so it
24+
# is safe to run on every commit. Fork PRs get no secrets/OIDC under
25+
# `pull_request` and are additionally blocked by the same-repo `if` below.
26+
pull_request:
27+
types: [opened, synchronize, reopened]
28+
push:
29+
branches: [main]
30+
workflow_dispatch:
31+
32+
concurrency:
33+
# A new commit cancels the prior in-flight run for the same PR (keyed by PR
34+
# number) or branch (keyed by github.ref, e.g. push to main). github.ref —
35+
# NOT run_id — is what makes cancel-in-progress actually cancel: run_id is
36+
# unique per run, so the old group never collided and nothing was cancelled.
37+
group: agent-bench-${{ github.event.pull_request.number || github.ref }}
38+
cancel-in-progress: true
39+
40+
permissions:
41+
contents: read
42+
43+
jobs:
44+
bench:
45+
# Same-repo gate (and manual dispatch) lives HERE, on the calling job -- a
46+
# `uses:` job may carry `if:`/`permissions`. The OIDC steps and
47+
# `environment: publish` stay inside the reusable workflow (a calling job
48+
# cannot set `environment`). Fork PRs get no secrets/OIDC under
49+
# `pull_request`, but defense-in-depth: also gate on same-repo. Push to main
50+
# is same-repo by definition. Mirrors pr-checks.yml.
51+
if: >-
52+
github.event_name == 'workflow_dispatch' ||
53+
github.event_name == 'push' ||
54+
(github.event_name == 'pull_request' &&
55+
github.event.pull_request.head.repo.full_name == github.repository)
56+
# Union token so the reusable workflow's per-job permissions resolve: both
57+
# bench and summary narrow to id-token:write (OIDC -> Bedrock + S3) +
58+
# contents:read. No pull-requests:write — the bench posts no PR comment
59+
# (the scoreboard is the Actions run summary).
60+
permissions:
61+
id-token: write
62+
contents: read
63+
uses: ./.github/workflows/agent-bench.yml
64+
secrets: inherit

package-lock.json

Lines changed: 126 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
"test-apps/auth-cognito-passkeys",
5454
"test-apps/auth-cognito-passkeys/aws-blocks",
5555
"test-apps/pipeline",
56-
"test-apps/db-pull-typecheck"
56+
"test-apps/db-pull-typecheck",
57+
"scripts/agent-bench"
5758
],
5859
"scripts": {
5960
"prepare": "husky && bash scripts/setup-git-secrets.sh",

0 commit comments

Comments
 (0)