V0.9.2/one prompt eval - #41
Conversation
Adds guidance for optional one-shot external handoff when user explicitly requests evaluation with yolo/auto modifier. Clarifies the boundary between preparation (deterministic) and execution (external handoff). Updates roles for preparer and executor, specifying when explicit eval requests authorize automatic handoff versus manual handoff. Normalizes harness naming and improves model discovery guidance.
Introduces eval-request.ps1 helper script that provides deterministic, model-free eval request workflow for agents. Handles decision logic between manual handoff (preparation-only) and external handoff (with explicit yolo/auto authorization). Includes comprehensive test coverage exercising all runner/model normalization paths and handoff state transitions. Adds PassThru parameter to prepare-skill-evals.ps1 for returning prepared prompt paths. Adds runner normalization to handle user-facing names (GitHub Copilot, Copilot CLI). Integrates validator coverage for eval request workflow in validate-skill-templates.ps1.
Updates repository README to document the eval request workflow and optional one-shot external handoff feature. Clarifies when and how explicit yolo/auto modifiers authorize automatic delegation to external Eval Orchestrators. Reflects the deterministic preparation model and handoff boundaries for agents preparing skill evaluation packages.
Greptile SummaryThis PR introduces an explicitly authorized, one-shot external evaluation handoff and expands the associated preparation, runner, authentication, validation, and documentation flow.
Confidence Score: 3/5The PR is not yet safe to merge because Copilot evaluation can silently authenticate with a different GitHub CLI account than the explicitly selected configuration. The new credential-candidate loop continues after an explicit Files Needing Attention: scripts/eval-runners/github-copilot/runner.ps1
|
| Filename | Overview |
|---|---|
| scripts/eval-request.ps1 | Renames the delegation capability parameter while retaining its compatibility alias and preserving one-shot handoff behavior. |
| scripts/prepare-skill-evals.ps1 | Prevents forced package regeneration after handoff reservation or execution has started. |
| scripts/eval-runners/github-copilot/runner.ps1 | Adds fail-closed noninteractive authentication checks, but credential fallback can cross an explicitly selected GitHub CLI configuration boundary. |
| scripts/eval-runners/tests/test-runner-conformance.ps1 | Expands authentication fallback and fail-closed conformance coverage but does not prevent fallback from an explicitly selected configuration to another account. |
| AGENTS.md | Documents the scoped one-shot external orchestrator authorization and revised runner/model-selection rules. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Explicit eval request with yolo/auto] --> B[Prepare evaluation package]
B --> C{Preparation succeeds?}
C -- No --> D[No handoff]
C -- Yes --> E{Existing reservation or execution state?}
E -- Yes --> F[Return already_started]
E -- No --> G{Fresh orchestrator available?}
G -- No --> H[Return manual_handoff]
G -- Yes --> I[Create one-shot reservation]
I --> J[Return external_handoff]
J --> K[Fresh Eval Orchestrator]
K --> L[Runner preflight and paired execution]
L --> M[Grade and finalize report]
Prompt To Fix All With AI
### Issue 1
scripts/eval-runners/github-copilot/runner.ps1:306-312
**Credential Selection Crosses Configurations**
If `GH_CONFIG_DIR` explicitly selects a GitHub CLI configuration but `gh auth token` fails there, this loop continues through XDG/home candidates and an ambient attempt. It can then resolve a different account’s token and inject it as `GH_TOKEN` into a permissive `copilot --allow-all` evaluation, causing the eval to run under unintended credentials. Respect the explicitly selected configuration instead of silently crossing into other credential stores.
**How this was verified:** The token lookup continues after failure of the explicit configuration, and the first later token found is passed to the Copilot process as `GH_TOKEN`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (3): Last reviewed commit: "📝 document copilot authentication incom..." | Re-trigger Greptile
| if ($Preparation.ContainsKey('CollectResults')) { throw 'An eval request prepares packages; CollectResults is a separate forensic workflow.' } | ||
| $arguments = $Preparation.Clone() | ||
| $arguments.PassThru = $true | ||
| $paths = @(& (Join-Path $PSScriptRoot 'prepare-skill-evals.ps1') @arguments) |
There was a problem hiding this comment.
Forced Retry Erases Reservation
When Invoke-EvalRequest is retried with the same Iteration and Force preparation options, it reruns preparation before checking the handoff reservation. Because Force deletes and recreates the iteration directory containing .external-handoff-started, Get-EvalHandoff returns external_handoff again for the same path. After a timeout or interrupted launch, this can delete active execution state and dispatch a second model-backed evaluation despite the one-shot guarantee.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/eval-request.ps1
Line: 68
Comment:
**Forced Retry Erases Reservation**
When `Invoke-EvalRequest` is retried with the same `Iteration` and `Force` preparation options, it reruns preparation before checking the handoff reservation. Because `Force` deletes and recreates the iteration directory containing `.external-handoff-started`, `Get-EvalHandoff` returns `external_handoff` again for the same path. After a timeout or interrupted launch, this can delete active execution state and dispatch a second model-backed evaluation despite the one-shot guarantee.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Add safeguards to prevent -Force from replacing eval packages that have already started handoff or execution. This protects the one-shot eval workflow from accidental data loss. New tests validate that the guard works correctly and that packages remain unchanged when Force is rejected.
Rename ExternalOrchestratorAvailable to CanDelegateFreshOrchestrator for semantic clarity about what capability is being tested. Add compatibility alias to preserve existing call sites. Formally document GitHub Copilot CLI task + general-purpose agent delegation as a valid external-orchestrator capability. Add guard to prevent Copilot from replacing the repository-defined default model with a subjective stronger choice. Update all tests and validators to match the new naming and expectations.
Add comprehensive authentication validation and fail-closed behavior to the GitHub Copilot runner. The runner now detects when supported non-interactive authentication sources are unavailable (explicit tokens or trusted GitHub CLI fallback) and terminates evaluation preemptively rather than attempting execution without required auth. New test scenarios cover fresh-context environments and missing auth states. Updated handoff prompt generation documents that authentication incompatibility is terminal for the package iteration, preventing suggestions for runner switching or Phase 1 retries.
Update eval-runners README to explain Copilot authentication requirements and fail-closed behavior. Documents the fresh-context authentication testing strategy, the GitHub CLI token fallback mechanism, and the fail-closed incompatibility policy that prevents evaluation execution when required non-interactive authentication sources are unavailable.
| $process = Invoke-RunnerProcess -FileName $gh.FileName -ArgumentList (@($gh.Prefix) + @('auth', 'token')) -WorkingDirectory $probeDirectory -Environment $environment -TimeoutSeconds 30 | ||
| if ($process.TimedOut -or $process.ExitCode -ne 0) { | ||
| continue | ||
| } | ||
| $token = ([string]$process.Stdout).Trim() | ||
| if ([string]::IsNullOrWhiteSpace($token)) { | ||
| continue |
There was a problem hiding this comment.
Credential Selection Crosses Configurations
If GH_CONFIG_DIR explicitly selects a GitHub CLI configuration but gh auth token fails there, this loop continues through XDG/home candidates and an ambient attempt. It can then resolve a different account’s token and inject it as GH_TOKEN into a permissive copilot --allow-all evaluation, causing the eval to run under unintended credentials. Respect the explicitly selected configuration instead of silently crossing into other credential stores.
How this was verified: The token lookup continues after failure of the explicit configuration, and the first later token found is passed to the Copilot process as GH_TOKEN.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/eval-runners/github-copilot/runner.ps1
Line: 306-312
Comment:
**Credential Selection Crosses Configurations**
If `GH_CONFIG_DIR` explicitly selects a GitHub CLI configuration but `gh auth token` fails there, this loop continues through XDG/home candidates and an ambient attempt. It can then resolve a different account’s token and inject it as `GH_TOKEN` into a permissive `copilot --allow-all` evaluation, causing the eval to run under unintended credentials. Respect the explicitly selected configuration instead of silently crossing into other credential stores.
**How this was verified:** The token lookup continues after failure of the explicit configuration, and the first later token found is passed to the Copilot process as `GH_TOKEN`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This pull request updates the
AGENTS.mddocumentation to clarify and refine the rules around evaluation package execution, especially regarding explicit user-directed evals using theyoloorautomodifiers. The changes introduce a narrowly-scoped, one-shot external Eval Orchestrator handoff flow, and tighten the requirements for model/harness selection and agent roles during eval preparation and execution. The documentation now more clearly distinguishes between routine/manual and explicitly authorized automated eval handoffs, and details the technical and policy boundaries for each.Explicit Eval Handoff Flow:
yoloorauto, detailing when and how this handoff is allowed, and the technical steps for invoking it usingscripts/eval-request.ps1andInvoke-EvalRequest.Eval Preparation and Execution Rules:
yolo/autorequests authorize the one-shot external handoff. Updated the preparation and execution sections to reflect this distinction and to specify that only the explicit modifier can trigger automatic handoff. [1] [2] [3]Model/Harness Selection and Discovery:
Skill-Creator Integration:
skill-creatorsection to reflect the new explicit handoff flow, clarifying that repository-side validation remains deterministic, and only the explicitly user-directed external executor performs model-backed evaluation and reporting.