Skip to content

Add manually triggered skill evaluations - #68832

Merged
PureWeen merged 9 commits into
dotnet:mainfrom
PureWeen:pureween-skill-eval-command
Sep 2, 2026
Merged

PureWeen merged 9 commits into
dotnet:mainfrom
PureWeen:pureween-skill-eval-command

Conversation

@PureWeen

@PureWeen PureWeen commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Model-bearing evaluations never run automatically. PR and push events only perform model-free validation; model runs require an explicit /evaluate <sha> PR comment or a manual Actions dispatch.

  • Add automatic, model-free validation when runtime skills, evaluation assets, or the workflow change, plus manual Validate, Test, Lint, and model-bearing Smoke/Full dispatch.
  • Bind PR evaluations to an exact commit from an open same-repository PR. Requests require write, maintain, or admin; fork-controlled content is rejected.
  • Load executable evaluation control-plane files from the selected host workflow revision while staging only the selected candidate skill, eval specification, and fixtures from the validated PR SHA.
  • Scope COPILOT_PAT_0 to the Vally execution step, serialize the PAT-backed lane, retain raw artifacts for seven days, and publish commit statuses and PR comments.
  • Require complete successful baseline and skilled result sets, while applying the quality threshold only to the skilled variant.

Same-repository write, maintain, or admin access is the authorization boundary for selecting and running a host workflow revision, matching the shared copilot-pat-pool model. Trusted-control-plane staging prevents candidate exact-SHA content from replacing runner, assertion, or central experiment code, but it does not defend against a trusted writer deliberately modifying the selected host workflow itself. The PAT's single Copilot Requests permission, public-repository restriction, and short expiry bound that accepted risk. Environment branch policies or required reviewers remain optional broader hardening to apply consistently across all consumers of the shared environment.

Validation

  • actionlint .github/workflows/skill-evals.yml
  • git diff --check
  • pwsh -NoProfile -File ./eng/skill-evals/run.ps1 Test
  • pwsh -NoProfile -File ./eng/skill-evals/run.ps1 Validate

Hosted fork canary:

  • Trusted exact-SHA evaluation: candidate skill/eval data was consumed while candidate replacements for the runner, assertion script, and central experiment were ignored.

Smoke validates the pipeline and result gates; it is not a substitute for Full quality evidence.

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

Copilot-Session: 778498c0-44d7-45d1-adb9-419eb6319b84
Copilot AI lite review requested due to automatic review settings August 26, 2026 22:15
@PureWeen
PureWeen requested review from a team and wtgodbe as code owners August 26, 2026 22:15

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 a GitHub Actions workflow and supporting scripts to validate and run “skill evaluations”, including a smoke-mode experiment, PR-triggered /evaluate activation, serialized model execution, and a post-run “skilled” quality gate.

Changes:

  • Introduces .github/workflows/skill-evals.yml to validate skill-eval assets on PR/push and to run serialized PR-bound evaluations via /evaluate or workflow dispatch.
  • Adds a smoke experiment spec (skills-smoke.experiment.yaml) and extends the runner (run.ps1) to accept an explicit -Experiment.
  • Adds a results gate (assert_results.ps1) plus self-tests to enforce “skilled variant meets threshold and is complete”.
Show a summary per file
File Description
eng/skill-evals/test_run.ps1 Extends runner self-test to cover -Experiment selection.
eng/skill-evals/test_assert_results.ps1 Adds self-test coverage for the new results-gating script.
eng/skill-evals/skills-smoke.experiment.yaml Defines a 1-run-per-stimulus smoke experiment variant for infra validation.
eng/skill-evals/run.ps1 Adds -Experiment support and wires the new assert-results self-test into Test.
eng/skill-evals/README.md Documents hosted workflow behavior, PR activation flow, and smoke vs full semantics.
eng/skill-evals/assert_results.ps1 Adds a “skilled-only” quality gate over Vally outputs (count, completeness, threshold).
.github/workflows/skill-evals.yml Adds the hosted workflow for validation, PR gating/authorization, serialized execution, and reporting.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 7/7 changed files
  • Comments generated: 4
  • Review effort level: Lite

Comment thread eng/skill-evals/run.ps1 Resolved
Comment thread eng/skill-evals/run.ps1 Resolved
Comment thread .github/workflows/skill-evals.yml Resolved
Comment thread .github/workflows/skill-evals.yml Resolved
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: d1daef07-470c-42a4-a77f-5401116943ec
@PureWeen PureWeen changed the title Add triggered skill evaluation workflow Add manually triggered skill evaluations Aug 27, 2026
@lewing

lewing commented Aug 27, 2026

Copy link
Copy Markdown
Member

Nice work — the security model here is more carefully reasoned than most /command workflows I've seen. Loading YAML from the default branch on issue_comment/pull_request_review, routing all user-controlled strings through env: instead of ${{ }} interpolation, validating the SHA shape and its membership in the PR, rejecting fork heads, and splitting the read-only model job from the write-scoped reporter are all the right calls. Actions pinned to SHAs and timeout-minutes everywhere, too.

Two things I'd like to resolve before this goes in, then one suggestion for later.

1. Is copilot-pat-pool configured with required reviewers today?

The run job checks out the PR commit and executes eng/skill-evals/run.ps1 from that commit with COPILOT_PAT_0 in the environment. On this repo, "has write access" is a large group, and any of them could modify that script in a PR to exfiltrate the PAT.

The README identifies this correctly as the trust boundary, but the mitigation is environment config that lives outside this diff, so merging doesn't establish it. If it's already set up, could we change the README wording from "Use required reviewers on copilot-pat-pool if repository write access alone should not authorize that execution" to stating it as a prerequisite? If it isn't set up yet, I'd want that in place before this lands.

2. A failed or evicted run job strands the commit status at pending

report is gated on needs.run.outputs.claimed == 'true':

    if: >-
      always() &&
      needs.gate.result == 'success' &&
      needs.gate.outputs.should_eval == 'true' &&
      needs.run.outputs.claimed == 'true'

If the claim step itself errors on a gh api call, or the job is cancelled, or the global concurrency group evicts it (GitHub queues only one pending job per group — a third concurrent request is dropped), that output is never written, report skips, and skill-evaluations stays pending on that SHA with no recovery path.

The *) branch in the reporter already handles this case correctly — it's only the job-level if blocking it. 'false' means another run legitimately owns the SHA and we must stay quiet; '' means we died and should clean up after ourselves. So the fix is just the last line:

      needs.run.outputs.claimed != 'false'

Related question: is the plan to make skill-evaluations a required check? If so this goes from "confusing spinner" to "PR is stuck."

3. Non-blocking, for a follow-up: the ownership dance can go away entirely

concurrency: skill-evals-model-run already guarantees at most one model job repo-wide, so the PAT lane is serialized without the status lock — the commit status is really doing duplicate suppression, and it's doing it in gate, which runs outside that mutex. That's the TOCTOU the sleep 20 is patching over.

If the "has this SHA already been evaluated?" check moved into run after it holds the concurrency slot, nothing else would be executing, so the read couldn't race and the claim / re-check / sleep could all go away.

Going further and using check runs instead of commit statuses would make the clobber structurally impossible rather than slept-around: POST /check-runs hands back an id, so a late reporter from an earlier run physically cannot overwrite a later run's record, and external_id gives you a natural place to stash sha:evalset for the dedupe query. The Checks tab UI comes along for free.

Definitely not blocking — the current design does work. Just flagging it as the shape I'd expect this to settle into once it's had some mileage.

Comment thread .github/workflows/skill-evals.yml Resolved
Comment thread .github/workflows/skill-evals.yml Resolved

@JanKrivanek JanKrivanek 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.

Overall looks good!

I have 2 comments from agentic review

Copilot AI added 4 commits September 2, 2026 10:21
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: d1daef07-470c-42a4-a77f-5401116943ec
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: d1daef07-470c-42a4-a77f-5401116943ec
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: d1daef07-470c-42a4-a77f-5401116943ec
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: d1daef07-470c-42a4-a77f-5401116943ec
@PureWeen

PureWeen commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

@lewing thanks, both concrete issues are addressed.

The model job now stages run.ps1, assert_results.ps1, and the central experiments from the selected host workflow revision. The PR SHA supplies only the selected skill, eval spec, and fixtures, and the Copilot token is scoped to the Vally step. We kept same-repository write/maintain/admin access as the authorization boundary, consistent with the existing shared pool and dotnet/skills. Environment reviewers or branch restrictions would be a broader policy change across the pool consumers rather than a prerequisite unique to this workflow.

The reporter condition now uses claimed != false, with focused regression coverage, so a missing claim output reaches the incomplete/error reporting path. I left the check-runs/ownership refactor for later as suggested.

@PureWeen
PureWeen merged commit 3dee3fd into dotnet:main Sep 2, 2026
34 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants