Skip to content

Fix skill evaluation authentication and runtime - #69030

Merged
PureWeen merged 5 commits into
mainfrom
pureween-fix-skill-eval-token-selection
Sep 4, 2026
Merged

PureWeen merged 5 commits into
mainfrom
pureween-fix-skill-eval-token-selection

Conversation

@PureWeen

@PureWeen PureWeen commented Sep 3, 2026

Copy link
Copy Markdown
Member

Fixes the authentication and runtime failures seen while evaluating #69028 in https://github.com/dotnet/aspnetcore/actions/runs/33777017172.

Two independent issues prevented the model evaluation from completing:

  1. The workflow assumed COPILOT_PAT_0 was populated even though the shared copilot-pat-pool environment can expose any populated slot.
  2. The transient Vally/Copilot installation could resolve an incompatible Copilot platform package whose SDK entry point was unavailable.

This change follows the trusted PAT-pool and pinned-toolchain design used by the existing ASP.NET Core agentic workflows and dotnet/skills:

  • A dedicated trusted job receives COPILOT_PAT_0 through COPILOT_PAT_9, finds the populated slots, and randomly selects one.
  • The selector emits only the selected numeric slot, never a secret value.
  • The model step resolves that slot through the repository's canonical static case(...) secret mapping, with COPILOT_GITHUB_TOKEN as the empty-pool fallback.
  • The selected credential remains scoped only to the trusted Vally execution step.
  • Vally and Copilot are installed from a checked-in manifest and lockfile before credentials enter scope.
  • The Copilot dependency graph is constrained to SDK-compatible version 1.0.80, and the workflow verifies Linux platform SDK resolution from the consuming SDK package's module path before running a model.
  • Workflow tests execute the real selector against empty, one-slot, and multi-slot synthetic pools and reject credential disclosure or conflicting nested Copilot packages.

The existing authorization, same-repository restriction, exact-commit binding, trusted default-branch workflow, and trusted-file staging boundaries are unchanged.

Validated locally with:

  • pwsh ./eng/skill-evals/run.ps1 Test
  • pwsh ./eng/skill-evals/run.ps1 Validate
  • an isolated npm ci from the checked-in lockfile and SDK-relative platform-resolution probe
  • git diff --check

End-to-end validation used PureWeen/aspnetcore, whose copilot-pat-pool environment contained only COPILOT_PAT_2: https://github.com/PureWeen/aspnetcore/actions/runs/33795737099

  • The selector reported pool size 1 and selected slot 2.
  • The model step received a non-empty masked credential.
  • Vally 0.14.0, Copilot CLI 1.0.80, and the Linux x64 SDK platform entry point resolved successfully.
  • All five baseline and five skilled executions completed successfully.
  • The skilled variant scored 0.79 against the 0.6 threshold; baseline scored 0.555.
  • The uploaded artifact contained provenance, report, summaries, results, metadata, and event logs for both variants.

The temporary fork commits were restored with a normal revert after the run.

Select the first configured Copilot PAT pool entry instead of assuming slot zero, and retain the repository token fallback.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 3, 2026 16:46
@PureWeen
PureWeen requested review from a team and wtgodbe as code owners September 3, 2026 16:46
@github-actions github-actions Bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Sep 3, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

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 review overview

🟢 Approval recommended

The workflow change is narrowly scoped, includes an explicit regression test for the credential selection expression, and the documentation is updated to match the new behavior.

Review tier: Lite
Findings: None

What changed in this PR

Updates the skill-evaluation GitHub Actions workflow to reliably select a usable Copilot credential when the copilot-pat-pool environment doesn’t provide COPILOT_PAT_0, preventing authentication failures during Vally execution.

Changes:

  • Update .github/workflows/skill-evals.yml to select the first available COPILOT_PAT_0..COPILOT_PAT_9, falling back to COPILOT_GITHUB_TOKEN, and improve the failure message when none are configured.
  • Add a regression guard in eng/skill-evals/test_workflow.ps1 to ensure the ordered PAT-pool selection + fallback expression remains present exactly once.
  • Update eng/skill-evals/README.md to document the PAT pool selection and fallback behavior.
File Description
eng/​skill-evals/​test_workflow.ps1 Adds a workflow self-test to assert the ordered PAT-pool selection and repository fallback are present.
eng/​skill-evals/​README.md Updates hosted-evaluation docs to reflect PAT pool selection across COPILOT_PAT_0..9 with repo fallback.
.github/​workflows/​skill-evals.yml Selects the first configured PAT from the pool with fallback, scoped to the Vally execution step, and improves the configuration error message.

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

Randomly select a populated Copilot PAT slot in a trusted job and expose only the selected credential to the Vally worker.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@PureWeen PureWeen left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Adversarial review

No correctness or security defect survived consensus. The trusted selector matches ASP.NET Core’s existing .github/workflows/shared/pat_pool.md design: it receives the pool only in an isolated trusted job, emits only a numeric slot, and keeps candidate-controlled execution away from the pool.

One testing gap remains: the regression test verifies YAML text but does not execute the empty-pool, slot-2-only, multi-slot, or repository-fallback paths. This is especially relevant because the pull-request event skips the credential-bearing jobs.

The selected-secret expression is valid GitHub Actions syntax because steps.env supports both needs and secrets, and expression index syntax accepts a formatted key. However, it is not the exact consumer expression used by the repository’s existing PAT-pool workflows, which use a static case(...) mapping. That is a consistency difference, not a demonstrated runtime bug.

Methodology: 3 independent reviewers with adversarial consensus. The dynamic-lookup, fallback-provisioning, and selector-exposure concerns were independently disputed and discarded. Existing Copilot feedback reviewed the prior commit and did not cover the current random-selector implementation.

Test coverage assessment: structural coverage is present; the model-bearing authentication path lacks execution coverage in this PR.

Comment thread eng/skill-evals/test_workflow.ps1
Copilot AI added 3 commits September 3, 2026 12:43
Resolve the selected PAT slot with the same static case expression used by ASP.NET Core's existing agentic workflows while retaining the repository token fallback.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Extract and run the workflow's selector script against empty, single-slot, and multi-slot synthetic pools, and assert that credentials never appear in its outputs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Install the Vally and Copilot toolchain from a checked-in lockfile before credentials enter scope, and verify platform SDK resolution from the consuming package's module path.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
PureWeen pushed a commit to PureWeen/aspnetcore that referenced this pull request Sep 3, 2026
Restore fork-panel-validation after validating dotnet#69030 against the COPILOT_PAT_2-only environment.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen changed the title Fix skill evaluation token selection Fix skill evaluation authentication and runtime Sep 3, 2026
@PureWeen

PureWeen commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

@PureWeen
PureWeen merged commit efe9bf6 into main Sep 4, 2026
34 of 35 checks passed
@PureWeen
PureWeen deleted the pureween-fix-skill-eval-token-selection branch September 4, 2026 10:09
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants