Skip to content

Use committed local criteria and concise output for PR reviews - #69422

Closed
PureWeen wants to merge 7 commits into
dotnet:mainfrom
PureWeen:pureween-fix-reviewer-guidance-source
Closed

PureWeen wants to merge 7 commits into
dotnet:mainfrom
PureWeen:pureween-fix-reviewer-guidance-source

Conversation

@PureWeen

@PureWeen PureWeen commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Use committed local criteria and concise output for PR reviews

Description

Address two reported usability problems: a servicing PR can target a branch that lacks the reviewer guides (as encountered with #69401), and ordinary interactive results should not dump the full review state.

  1. Use committed local guidance. Freeze the current repository's HEAD once as LOCAL_SHA, at invocation start before GitHub retrieval. Read guides, delegated policies, and optional API design criteria from that commit. Guidance edits must be committed but need not be pushed; uncommitted edits are ignored. Missing required committed inputs produce an explicit block, not a fallback or successful no-findings result.
  2. Return concise results by default. Show actionable findings and material limitations. Retain detailed structured diagnostics when explicitly requested.
  3. Adapt the hosted /review caller. Prepare the immutable default-branch event revision with an explicit checkout step while keeping gh-aw's automatic PR-head checkout disabled. Allow the required Git reads and pass the frozen local criteria identity to workers. Use git show from the verified repository root; this equivalent read form works with the pinned CLI's scoped permission grant. Replace the obsolete target-base/bundle instructions. Preserve source-only review, topic accounting, deduplication, and the existing frozen-SHA COMMENT-only output adapter.
  4. Double the main reviewer turn limit from 200 to 400. Run 35755119618 failed with Maximum LLM invocations exceeded (206 / 200). The separate detection limit remains 20; other budgets are unchanged.

The GitHub PR still defines the reviewed code. Product source uses HEAD_SHA; authoritative target documents use BASE_SHA. Local criteria do not themselves establish that older target code violates a binding contract. Topic coverage, one independent worker per topic, dispatch/retry/fallback accounting, and candidate-validation gates remain intact. The reviewer agent does not prepare or modify the workspace; the hosted caller prepares it before invocation. Local-diff review and execution of PR builds/tests are not added. No product changes are included.

Validation

  • The focused five-case native suite passed all 44 graders: main/API criteria, historical release criteria, missing committed guidance despite a working-tree copy, concise findings, and incomplete results. Native evaluation executor/judge were pinned to gpt-5.6-sol.
  • All 37 deterministic guidance-source tests pass, including portable fixture preparation, actual Vally workspace-preservation checks, literal-SHA/path read assertions, and contradictory blocked-output controls. The relevant negative controls rejected the earlier implementation before correction.
  • All six hosted-caller policy tests pass; five compatibility/turn-limit checks reject the previous caller, while the unchanged source-only/publication boundaries remain green. Run with python3 .github/workflows/pull-request-review/test_workflow_policy.py.
  • Strict compilation with the deployed gh-aw v0.88.7 succeeded. Generated configuration has exactly one reviewer-revision checkout in the agent job, no automatic PR-head checkout, scoped Git-read grants, and a 400-turn main reviewer limit. The source and generated lock file are both included.
  • A bounded actual Copilot CLI 1.0.80 smoke using gpt-5.6-sol successfully resolved root/HEAD once and read both guides and optional API criteria at that literal SHA with the final command grants. Earlier git -C grant probes were denied; the final git show form succeeded. This was a command-access smoke, not native skill or full-panel validation.
  • Earlier live native preflight and full source-only review of the now-merged [release/11.0] Update Blazor WASM service defaults to OpenTelemetry 1.19 #69401 completed. The full review recovered an initial briefing handoff failure with bounded retries; it does not establish hosted compatibility or review-quality equivalence.

Validation boundary: the updated hosted action has not been dispatched. Compilation, generated configuration, local regression tests, and the pinned CLI command-access smoke do not prove end-to-end hosted execution or positive-finding publication. No claim is made that 400 turns guarantees completion. The local-freeze source-order check does not simulate a real review interrupted by a concurrent edit. No PR product code, builds, or tests were executed.

Copilot AI lite review requested due to automatic review settings September 21, 2026 20:41
@PureWeen
PureWeen requested review from a team, SamMonoRT and wtgodbe as code owners September 21, 2026 20:41
@github-actions github-actions Bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Sep 21, 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.

@PureWeen
PureWeen marked this pull request as draft September 21, 2026 20:42

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

🟡 Changes recommended

The new eval fixture’s unreadable-guide scenario is non-deterministic across execution environments and can fail the suite during setup rather than exercising the intended behavior.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR updates the review-pull-request skill to load review criteria (guides + delegated policy excerpts) from the current local workspace rather than the PR’s target/base snapshot, and to default to concise interactive output with structured output only on explicit request. It also adds a dedicated local Vally evaluation suite + fixtures to validate local-criteria capture/routing, invalid-input blocking, and the concise/structured presentation contract.

Changes:

  • Add a specialized Vally suite and offline fixtures to validate local criteria capture (including uncommitted edits), routing, and output contracts.
  • Update review-pull-request skill guidance to remove guidance-source modes and formalize “local workspace criteria + concise by default”.
  • Update contributor documentation to describe the skill’s local-criteria behavior and output modes.
File Description
eng/​skill-evals/​review-pull-request/​guidance-source.vally.yaml New specialized eval suite covering local criteria capture, invalid inputs, and concise/structured output behavior.
eng/​skill-evals/​review-pull-request/​fixtures/​prepare.py Fixture repo preparation/verification script for deterministic local-criteria scenarios.
eng/​skill-evals/​review-pull-request/​fixtures/​pr69401.json Historical changed-path projection fixture used for servicing-branch guide-loading regression scenarios.
eng/​skill-evals/​review-pull-request/​fixtures/​Policy.md Delegated-policy fixture content used for anchor/heading clause capture tests.
eng/​skill-evals/​review-pull-request/​fixtures/​gh Offline gh api transport shim to reproduce historical “guide 404” behavior without network access.
eng/​skill-evals/​review-pull-request/​fixtures/​CrossCuttingGuidance.md Minimal cross-cutting guidance fixture with delegated policy links and topic structure.
eng/​skill-evals/​review-pull-request/​fixtures/​BlazorComponentsGuidance.md Minimal Components/JSInterop guidance fixture with scoped delegated rules link.
eng/​skill-evals/​review-pull-request/​fixtures/​analysis.json Controlled “completed analysis” record used to test Step 6 rendering without rerunning review logic.
eng/​skill-evals/​README.md Documentation for running and interpreting the new specialized local reviewer suite.
docs/​README.md Contributor docs update describing local-workspace criteria and concise-by-default output.
.github/​skills/​review-pull-request/​SKILL.md Skill contract updated to require local criteria capture and concise default output, removing prior guidance-source modes.

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

Comment on lines +88 to +91
elif scenario == "unreadable-guide":
CROSS.chmod(0)
if os.access(CROSS, os.R_OK):
raise RuntimeError("This user can still read mode-000 files; unreadable fixture is unavailable.")
@PureWeen PureWeen changed the title Use local criteria and concise output for PR reviews Use committed local criteria and concise output for PR reviews Sep 21, 2026
Copilot AI added 4 commits September 22, 2026 11:28
Freeze local criteria before GitHub retrieval and add portable fixtures with regressions for pinned reads, blocked outcomes, and workspace preservation.

Co-authored-by: Copilot App <[email protected]>
Prepare the immutable reviewer revision without automatic PR checkout, permit committed guidance reads, and align the hosted prompt with LOCAL_SHA. Raise the main reviewer turn limit from 200 to 400 and add caller policy regressions.

Co-authored-by: Copilot App <[email protected]>
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.

3 participants