Skip to content

Compare Workshop evals on pull requests - #476

Draft
AshishKumar4 wants to merge 1 commit into
mainfrom
evals/github-pr-report
Draft

Compare Workshop evals on pull requests#476
AshishKumar4 wants to merge 1 commit into
mainfrom
evals/github-pr-report

Conversation

@AshishKumar4

@AshishKumar4 AshishKumar4 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Run the existing Workshop trajectory suite when agent-relevant code changes. Relevant pushes to main refresh the stored baseline artifact; pull requests reuse the latest unexpired main artifact and run the exact base revision only when no baseline is available. Candidate runs use the same pinned Workers AI model and retain three raw trajectories per task.

A deterministic reducer compares matching task/model cohorts and publishes one neutral Check. Harness errors, incomplete runs, changed eval definitions, and partially observed costs are reported as non-comparable. The existing manual eval workflow remains unchanged. This adds no gating or eval tasks.

One-time repository setup is required before this is ready: WORKSHOP_EVAL_CLOUDFLARE_API_TOKEN, WORKSHOP_EVAL_ACCOUNT_ID, and WORKSHOP_EVAL_AI_GATEWAY must point to a dedicated same-account Gateway without a wildcard Access policy. The current preview/staging policy intercepts Wrangler's remote binding endpoint.

@github-actions github-actions Bot added the delivery Changes to CI or release delivery label Sep 10, 2026
@github-actions

Copy link
Copy Markdown

Preview: pr476-evals-github-pr-report

https://pr476-evals-github-pr-report-router.cloudflare-os-previews.workers.dev

Dashboard · deleted when this PR closes

observedCumulativeChatCostUsd: z.number().nonnegative().optional(),
}).loose(),
}).loose(),
output: z.object({ metrics: MetricsSchema }).loose(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Reject infrastructure-failed trajectories before comparing

The schema ignores run.errors, so harness exceptions are counted as ordinary failed task trials. This happened in this PR's own workflow run: all 18 trajectories contain AgentError/EvalRunError: Connection error, but every row was marked comparable: true and the neutral check reported 0% vs 0% plus apparent duration improvements. That turns a total eval outage into a normal no-regression result. Parse the harness errors (or another explicit infrastructure outcome) and mark affected cohorts/report as non-comparable instead of calculating pass-rate and performance deltas.

@ask-bonk

ask-bonk Bot commented Sep 10, 2026

Copy link
Copy Markdown

Posted 1 actionable inline finding.

github run

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 2 potential issues.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

let reason: string | null = null;
if (base === undefined) reason = "missing baseline";
else if (next === undefined) reason = "missing candidate";
else if (base.taskVersion !== next.taskVersion) reason = "task version changed";

@devin-ai-integration devin-ai-integration Bot Sep 10, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Evaluator changes remain comparable

Changes to EVAL_AGENT_BUDGET_MS, resolveEvalModel, openLocalEvalTarget, or measureHistory leave definitionsChanged false. The report then attributes evaluator-induced result deltas to product behavior.

Learn more

The baseline and candidate each execute the evaluator code from their own revision. Several evaluator modules omitted from this path list control time budgets, model resolution, target setup, and reported metrics. A change to any of them can alter pass rates or measurements without changing the product behavior under evaluation. The comparison still marks matching cohorts as comparable because the workflow emits changed=false.

Example: A pull request changes the budget constants from 60 seconds to 30 seconds. Candidate trials time out more often, while baseline trials retain 60 seconds. The check reports a pass-rate regression instead of eval definition changed.

Recommended fix: Treat every evaluator implementation file that can affect outcomes as a definition change. At minimum include budgets.ts, config.ts, target.ts, and transcript.ts; preferably maintain one inclusive evaluator path and explicitly exclude only reducer and test files.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread packages/workshop-evals/src/comparison.ts Outdated

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment on lines +172 to +175
else if (base.assertions.some(assertion =>
assertion.meta.harness.run.errors.length > 0)) reason = "baseline run errors";
else if (next.assertions.some(assertion =>
assertion.meta.harness.run.errors.length > 0)) reason = "candidate run errors";

@devin-ai-integration devin-ai-integration Bot Sep 10, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Agent failures suppress pass-rate regressions

When a trial records AgentError or AgentTimeout, errors marks its entire cohort incomparable. createEvalHarness stores agent outcomes beside harness failures. Candidate failures then disappear from the pass-rate delta.

Learn more

The harness uses one errors array for two different categories. EvalRunError and EvalCleanupError describe infrastructure failures that invalidate a trial. AgentError and AgentTimeout describe how the evaluated agent ended and already make that trial fail. Rejecting every nonempty array therefore removes genuine agent failures from comparison.

Example: The baseline passes three trials. The candidate passes two trials and times out once. The candidate cohort becomes “candidate run errors” instead of reporting a -33.3 pp pass-rate delta.

Recommended fix: Mark a cohort incomparable only when an error name denotes a harness or cleanup failure. Keep AgentError and AgentTimeout in the comparison as failed model trials.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread .github/workflows/workshop-evals.yml Outdated
permissions:
contents: read
checks: write
pull_request:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Preserve the manual eval entry point

This replaces workflow_dispatch outright, so merging the PR removes the existing way to run Workshop evals on demand and removes its models, trials, and reportOnly controls. Those manual runs are actively used (there are recent workflow_dispatch runs on this workflow), and adding PR comparisons does not require dropping them. Keep the existing dispatch/manual job, or put the PR-only flow in a separate workflow.

@ask-bonk

ask-bonk Bot commented Sep 10, 2026

Copy link
Copy Markdown

Posted 1 actionable inline finding.

github run

@AshishKumar4
AshishKumar4 marked this pull request as draft September 10, 2026 23:52
Comment thread .github/workflows/workshop-evals.yml Outdated
- revision: baseline
sha: ${{ github.event.pull_request.base.sha }}
- revision: candidate
sha: ${{ github.event.pull_request.head.sha }}

@ask-bonk ask-bonk Bot Sep 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Compare revisions that isolate the PR

base.sha is the current tip of the target branch, but head.sha can be based on an older commit. After main advances, the baseline therefore contains base-only product changes that the candidate does not, and this report attributes their effect to the PR (often as a false regression). The three-dot definition check has the same asymmetry: it ignores base-only evaluator changes even though the baseline executes them. Evaluate the current base against the PR merge revision, or the merge base against the raw head, and run the definition check as a two-revision diff between those exact evaluated revisions.

@ask-bonk

ask-bonk Bot commented Sep 11, 2026

Copy link
Copy Markdown

Posted 1 actionable inline finding.

github run

@ask-bonk

ask-bonk Bot commented Sep 11, 2026

Copy link
Copy Markdown

[P2] .github/workflows/workshop-evals.yml:107: Validation failures skip artifact upload, causing compare to fail before publishing a neutral non-comparable check. This occurred in run 34544382186. Upload results with if: always() and handle empty/missing reports, or publish a fallback neutral check.

github run


on:
pull_request:
types: [opened, synchronize, reopened, edited]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Keep irrelevant edits out of the eval concurrency group

A title/body edit still triggers this workflow (the PR's changed files satisfy paths) and enters the same concurrency group, even though trust then skips every job. Setting cancel-in-progress to false only preserves a running run: GitHub's default concurrency queue permits one pending run and replaces it with the newest. Thus, if a synchronize/base-change eval is pending while a prior run is being canceled, a subsequent title/body edit can evict that eval and leave no comparison for the latest code. Give non-base edits a distinct/unique concurrency group or otherwise prevent them from entering this workflow.

@ask-bonk

ask-bonk Bot commented Sep 11, 2026

Copy link
Copy Markdown

Posted 1 actionable inline finding.

github run

@AshishKumar4
AshishKumar4 force-pushed the evals/github-pr-report branch 2 times, most recently from 52f4704 to 31fd93b Compare September 11, 2026 00:25
jobs:
trust:
name: Verify pull request
if: >-

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Keep the secret authorization gate outside PR-controlled YAML

This condition is loaded from the pull request revision, so a same-repository bot PR can remove or relax it and then run candidate-controlled pnpm evals with WORKSHOP_EVAL_CLOUDFLARE_API_TOKEN. That defeats the explicit bot exclusion and grants a compromised automation account a Cloudflare credential it otherwise cannot read. Run the authorization/secret-bearing flow from the protected default-branch workflow (for example, a carefully gated pull_request_target or workflow_run flow) before checking out and executing the approved candidate SHA.

@ask-bonk

ask-bonk Bot commented Sep 11, 2026

Copy link
Copy Markdown

Posted 1 actionable inline finding.

github run

EXPECTED_TRIALS: ${{ env.EVAL_TRIALS }}
EVAL_MODELS: ${{ env.EVAL_MODEL }}
run: |
tasks=(packages/workshop-evals/evals/*.eval.ts)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Count the same eval files that Vitest runs

This glob only counts top-level evals/*.eval.ts, while vitest.eval.config.ts runs evals/**/*.eval.ts. As soon as a valid eval is organized in a subdirectory, pnpm evals includes it but expected_cases does not, so every main baseline refresh fails the reusable-baseline check and no new baseline artifact is published. Derive the expected cohorts from the report or use a recursive file count matching Vitest.

@ask-bonk

ask-bonk Bot commented Sep 11, 2026

Copy link
Copy Markdown

Posted 1 actionable inline finding.

github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delivery Changes to CI or release delivery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant