Skip to content

[ci-scan] Add evaluation infrastructure for the CI failure agentic workflows - #130087

Merged
kotlarmilos merged 17 commits into
dotnet:mainfrom
kotlarmilos:kotlarmilos/ci-workflow-evals
Jul 13, 2026
Merged

kotlarmilos merged 17 commits into
dotnet:mainfrom
kotlarmilos:kotlarmilos/ci-workflow-evals

Conversation

@kotlarmilos

@kotlarmilos kotlarmilos commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

Description

This PR stands up the infrastructure for evaluating the three CI outer-loop agentic workflows, ci-failure-scan, ci-failure-fix, and ci-failure-scan-feedback, using Vally. It does not change the workflows themselves and does not wire the eval into required CI. It adds a harness a maintainer runs on demand by commenting /ci-scan eval, /ci-fix eval, /ci-feedback eval, or /ci-eval on a PR, at which point ci-eval.yml checks out the PR head, runs the affected Vally spec through the Copilot-SDK executor, and posts a single pass or fail report back.

Each spec runs the real workflow prompt as the agent against a live task, where the agent discovers current data itself. The scanner queries the dnceng-public AzDO REST API for a real failing outer-loop build on main, extracts a signature, and emits a Known Build Error that is graded against the static KBE format and for tool-call evidence that it actually fetched a real build and searched existing KBEs.

The fixer finds a real open Known Build Error, then either emits a fix PR shape with a real diff or hands off to owners, and is checked to never mute a test.

The feedback workflow scans real recent scanner issues and fixer PRs and is judged to produce grounded, quantified, constructive feedback. Grading mixes cheap deterministic format checks with a few binary LLM judges at a 0.7 threshold, so a single grader can miss without failing the run.

These are format and behavior gates, not ground-truth measurements, and the follow-up that compares what the workflows generate against the failures and KBEs that actually exist is deferred to a later iteration.

…rkflows

Stand up an on-demand Vally eval harness for the ci-failure-scan,
ci-failure-fix, and ci-failure-scan-feedback workflows. A maintainer
runs it from a PR comment to check whether a prompt change or model
switch keeps the output good before merging. Each spec runs the prompt
against a staged offline fixture and grades the artifact with static
regex checks plus binary LLM-judge dimensions at a 0.7 threshold.
Comparison against scraped ground truth is left as a follow-up; this
iteration only sets up the harness, spec layout, and fixture slots.

Co-authored-by: Copilot <[email protected]>
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an on-demand GitHub Actions harness plus Vally eval specs to evaluate the three CI outer-loop agent workflows (scan / fix / feedback) against offline fixtures, producing a pass/fail report comment on the triggering PR.

Changes:

  • Adds ci-eval.yml, an issue_comment-triggered workflow that selects eval specs from /ci-* eval commands, runs vally lint + vally eval, and posts/updates a single report comment.
  • Adds three Vally eval specs defining fixture staging, prompts, and graders for scan/fix/feedback.
  • Adds Vally config + ignore rules, and placeholder fixture directories.
Show a summary per file
File Description
.github/workflows/ci-eval.yml New slash-command-driven eval runner workflow that executes Vally and posts a report comment back to the PR.
.github/workflows/evals/ci-failure-scan.eval.yaml Vally eval spec for the scanner workflow prompt + graders (file regex + LLM judges).
.github/workflows/evals/ci-failure-fix.eval.yaml Vally eval spec for the fixer workflow prompt + graders enforcing tier policy and “no muting”.
.github/workflows/evals/ci-failure-scan-feedback.eval.yaml Vally eval spec for the feedback/KPI tracker regeneration prompt + graders for grounding/completeness.
.github/workflows/evals/.vally.yaml Vally configuration pointing at the eval spec directory and filename pattern.
.github/workflows/evals/.gitignore Ignores Vally workspaces/output directories produced by local runs.
.github/workflows/evals/fixtures/scan/.gitkeep Placeholder to ensure the scan fixture directory exists in-repo.
.github/workflows/evals/fixtures/fix/.gitkeep Placeholder to ensure the fix fixture directory exists in-repo.
.github/workflows/evals/fixtures/feedback/.gitkeep Placeholder to ensure the feedback fixture directory exists in-repo.

Copilot's findings

  • Files reviewed: 6/9 changed files
  • Comments generated: 2

Comment thread .github/workflows/ci-eval.yml Resolved
Comment thread .github/workflows/ci-eval.yml Resolved
Milos Kotlar and others added 2 commits July 2, 2026 10:13
…bump

- ci-eval.yml: grant issues:write (needed to post the report comment and
  reaction) and reduce pull-requests to read; paginate listComments so the
  sticky marker comment is found on busy PRs instead of posting duplicates.
- eval specs: move judge_model/model from the discontinued claude-opus-4.6
  to claude-opus-4.8.

Co-authored-by: Copilot <[email protected]>
The ci-failure-* gh-aw workflows already authenticate the Copilot CLI
engine with secrets.COPILOT_GITHUB_TOKEN, which is configured in the
repo. Vally's executor reads the same COPILOT_GITHUB_TOKEN, so drop the
invented COPILOT_EVAL_TOKEN and reuse the existing secret; no new secret
is needed to run the eval.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 2, 2026 08:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 6/9 changed files
  • Comments generated: 4

Comment thread .github/workflows/ci-eval.yml Resolved
Comment thread .github/workflows/ci-eval.yml Resolved
Comment thread .github/workflows/ci-eval.yml Resolved
Milos Kotlar and others added 2 commits July 2, 2026 11:04
Add a pat_pool job that picks a random non-empty COPILOT_PAT_0..9 entry,
and select the token in the eval job via a chained-ternary on the pool
output, falling back to COPILOT_GITHUB_TOKEN. This mirrors the token
rotation the gh-aw ci-failure-* workflows use (their compiled case()
expression), spreading eval runs across the same pooled Copilot PATs.

Co-authored-by: Copilot <[email protected]>
Pin the harness to @microsoft/[email protected] for reproducibility, and
write workspaces/outputs/logs/report under $RUNNER_TEMP instead of the
repo root so eval runs never leave untracked directories behind.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 2, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 6/9 changed files
  • Comments generated: 6

Comment thread .github/workflows/ci-eval.yml Resolved
Comment thread .github/workflows/ci-eval.yml Resolved
Comment thread .github/workflows/ci-eval.yml Resolved
Comment thread .github/workflows/ci-eval.yml Resolved
Comment thread .github/workflows/ci-eval.yml Resolved
Milos Kotlar and others added 2 commits July 2, 2026 15:31
Rewrite the three Vally specs to be self-contained: each runs the real
workflow prompt as the agent against a small inline scenario and grades
the emitted safe-output, with no recorded fixtures or network access.

- ci-failure-scan: check the KBE against the static Known Build Error
  format (title, labels, sections, single json signature, match marker).
- ci-failure-fix: check it created a fix PR or engaged owners.
- ci-failure-scan-feedback: LLM judge that the feedback is constructive.

Drop the empty fixtures directories and add a README describing the
harness. All three verified end-to-end at 100% with a live agent.

Co-authored-by: Copilot <[email protected]>
- Refuse to run on fork-head PRs before checkout: the eval runs untrusted
  PR content with a Copilot token, so restrict it to same-repo branches.
- Always post a report; on a refused/skipped run explain why instead of
  only reacting with an eyes emoji.
- Match the slash commands exactly or when followed by whitespace so
  '/ci-evaluate' no longer triggers the workflow.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 2, 2026 14:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 3

Comment thread .github/workflows/ci-eval.yml Resolved
Milos Kotlar and others added 2 commits July 2, 2026 17:05
Vally averages grader scores, so a mis-scoring LLM judge can let a
malformed output pass. Make the format guards strict:

- ci-failure-scan: anchor the Labels grader to the full line so it
  requires exactly 'Known Build Error' plus exactly one blocking label.
- ci-failure-fix: add a file-not-matches guard rejecting an output that
  declares both 'Type: create-pull-request' and 'Type: add-comment'.

Co-authored-by: Copilot <[email protected]>
Rewrite the three eval specs from static inline scenarios to dynamic,
live runs: the agent discovers a real, currently-failing outer-loop build
(anonymous dnceng-public AzDO REST) or a real open Known Build Error / fixer
PR (via gh), then emits the safe-output it would produce. Graders check the
static safe-output format plus tool-calls evidence that the agent actually
engaged live data, with LLM judges for conformance/behavior/constructiveness.

Export GH_TOKEN (github.token) on the eval step so the agent's gh and AzDO
discovery authenticate, and give the eval job a 120-minute timeout for the
longer live runs. Update the evals README to describe the live approach.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new

Drop the explanatory parentheses, colons, em dashes, and slashes from the prompt
and description text in the three specs and the README, and rephrase into plain
sentences. Leaves the format-bearing punctuation intact, including the Title,
Type, Labels, and Linked KBE output tokens, the gh and curl commands, the URL
paths, and the grader regexes.

Co-authored-by: Copilot <[email protected]>
@kotlarmilos

kotlarmilos commented Jul 3, 2026 •

Copy link
Copy Markdown
Member Author

Local end-to-end results

I ran all three specs end to end on my machine with the copilot-sdk executor and claude-opus-4.8, so the agent discovered live data itself and I graded the safe-output it emitted. All three passed above the 0.7 threshold.

Spec Graders Score What the agent did on the live run
ci-failure-scan 9/9 100% Found the real failing build 1492684 in runtime-extra-platforms on main, read the timeline and Helix logs, deduped against the existing KBE #129045, and emitted a format-conformant Known Build Error for an unfiled FileVersionInfo_CustomManagedAssembly failure seen across five NativeAOT legs.
ci-failure-fix 6/6 100% Found the real open KBE #129981, did read-only root-cause on an R2R-specific BinaryFormatter divergence, and correctly chose a hand-off comment to the crossgen2 and area owners because the real fix is out of bounds, without muting the test.
ci-failure-scan-feedback 5/5 100% Scanned real recent [ci-scan] issues and [ci-fix] PRs across open and closed states and produced grounded, quantified, constructive feedback.

The runs are live, so exact discoveries vary with what is failing at eval time. The fact that all 3 scored 100% indicates that the graders are too simple and need ground-truth scripts to check safe outputs against all failures. For simplicity, I'm introducing the infra now with simple graders, and will follow up with scraper scripts.

@kotlarmilos
kotlarmilos marked this pull request as ready for review July 3, 2026 13:20
@kotlarmilos
kotlarmilos requested review from a team and jeffhandley as code owners July 3, 2026 13:20
Copilot AI review requested due to automatic review settings July 3, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 2

The fix-or-engages-owners and is-constructive judges listed explicit fail
conditions and then ended with "Otherwise fail.", which reads as a catch-all
that fails even when the pass conditions hold. Drop the redundant trailing
sentence so the rubric matches its intent. No grading behavior change.

Co-authored-by: Copilot <[email protected]>

@vitek-karas vitek-karas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great as a starting point. Let's get this in.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 8871f8da-e894-43e2-8c85-214b4df969fd
Copilot AI review requested due to automatic review settings July 13, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

Files not reviewed (1)
  • .github/workflows/evals/package-lock.json: Generated file
  • Files reviewed: 8/9 changed files
  • Comments generated: 0 new

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 8871f8da-e894-43e2-8c85-214b4df969fd
Copilot AI review requested due to automatic review settings July 13, 2026 16:22
@kotlarmilos
kotlarmilos requested a review from vitek-karas July 13, 2026 16:27
@kotlarmilos
kotlarmilos enabled auto-merge (squash) July 13, 2026 16:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

Files not reviewed (1)
  • .github/workflows/evals/package-lock.json: Generated file
  • Files reviewed: 8/9 changed files
  • Comments generated: 4

Comment thread .github/workflows/evals/README.md Resolved
Comment thread .github/workflows/ci-eval.yml Resolved
Comment thread .github/workflows/ci-eval.yml Resolved
Comment thread .github/workflows/ci-eval.yml Resolved

@vitek-karas vitek-karas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just curious - the guard against the PR changing the eval harness. If we require human review for everything, does that really matter? Basically if the PR contains changes to the eval pipeline, then the results of that eval are "suspect" anyway.

@kotlarmilos
kotlarmilos merged commit 9d313f0 into dotnet:main Jul 13, 2026
28 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 14, 2026
@kotlarmilos

Copy link
Copy Markdown
Member Author

I added it assuming that future iterations will use copilot mostly, to prevent it from weakening the evaluator to achieve a better score. You are right that it isn't needed when we have human in the loop.

@vitek-karas

Copy link
Copy Markdown
Member

I'm not against it - in fact I would argue that ideally all actions which run on PRs should have this protection in them (ideally GitHub would have built-in functionality for this).

I did some search on this - but it is apparently pretty complicated to do this (and no really built-in-way).

eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
…rkflows (#130087)

## Description

This PR stands up the infrastructure for evaluating the three CI
outer-loop agentic workflows, `ci-failure-scan`, `ci-failure-fix`, and
`ci-failure-scan-feedback`, using
[Vally](https://microsoft.github.io/vally/). It does not change the
workflows themselves and does not wire the eval into required CI. It
adds a harness a maintainer runs on demand by commenting `/ci-scan
eval`, `/ci-fix eval`, `/ci-feedback eval`, or `/ci-eval` on a PR, at
which point `ci-eval.yml` checks out the PR head, runs the affected
Vally spec through the Copilot-SDK executor, and posts a single pass or
fail report back.

Each spec runs the real workflow prompt as the agent against a live
task, where the agent discovers current data itself. The scanner queries
the dnceng-public AzDO REST API for a real failing outer-loop build on
main, extracts a signature, and emits a Known Build Error that is graded
against the static KBE format and for tool-call evidence that it
actually fetched a real build and searched existing KBEs.

The fixer finds a real open Known Build Error, then either emits a fix
PR shape with a real diff or hands off to owners, and is checked to
never mute a test.

The feedback workflow scans real recent scanner issues and fixer PRs and
is judged to produce grounded, quantified, constructive feedback.
Grading mixes cheap deterministic format checks with a few binary LLM
judges at a 0.7 threshold, so a single grader can miss without failing
the run.

These are format and behavior gates, not ground-truth measurements, and
the follow-up that compares what the workflows generate against the
failures and KBEs that actually exist is deferred to a later iteration.

---------

Co-authored-by: Milos Kotlar <[email protected]>
Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants