Skip to content

Add a /review workflow for pull requests - #68867

Merged
PureWeen merged 6 commits into
dotnet:mainfrom
PureWeen:pureween-manual-pr-reviewer
Sep 22, 2026
Merged

PureWeen merged 6 commits into
dotnet:mainfrom
PureWeen:pureween-manual-pr-reviewer

Conversation

@PureWeen

@PureWeen PureWeen commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a maintainer-invoked /review workflow using the review-pull-request skill merged in #69146. It posts advisory inline findings and a COMMENT review directly to the pull request. It never approves or requests changes.

The PR targets main and adds only the workflow source and compiler-generated lock. The current candidate uses unmodified stable gh-aw v0.88.7 with an explicit Copilot CLI 1.0.80 pin. No patched compiler or hand-edited lock is required.

Behavior

  • Accept /review in PR conversation comments from users with admin, maintainer, or write access. Inline review-comment invocation is intentionally excluded because that event's bootstrap uses the PR merge ref instead of trusted default-branch configuration.
  • Derive the PR number from event metadata and freeze its open head SHA in a trusted read-only job.
  • Natively invoke the merged review skill, freeze GitHub-authoritative files/diff/feedback and immutable target-base guidance, and dispatch one fresh general-purpose gpt-5.6-sol worker per routed topic.
  • Require complete worker accounting and source/primary-contract validation before adapting findings to safe outputs. The caller contract requires noop for missing evidence, incomplete coverage, no findings, or a moved/unreadable live head.
  • Publish at most five inline findings and exactly one COMMENT review for a nonempty validated result. Trusted handler configuration fixes the target PR and commit attribution and rejects APPROVE and REQUEST_CHANGES.

Actual posting validation

Run 35268213203 tested the same live-output configuration with only the exact host/scope changed for the PureWeen fork.

On disposable PureWeen#73, it:

  • Installed actual CLI 1.0.80, confirmed in process logs, with stock gateway v0.4.18.
  • Invoked the native skill and launched/retrieved all 14 cross-cutting topic workers using only gpt-5.6-sol.
  • Detected an intentionally false-passing assertion and posted one inline comment at RangeItemHeaderValueTest.cs:138.
  • Submitted one real COMMENT review as github-actions[bot], bound to the reviewed commit 0d07bdbd593117ee161a97e4777fcd5c33827543.
  • Completed all jobs successfully. Before/after target and repository-wide issue/conversation snapshots showed only the authorized trigger, review, and inline comment, with no unrelated issue, PR-content, label, or conversation-comment changes.

Example: the finding actually posted

The test deliberately replaced a meaningful assertion with a self-comparison in src/Http/Headers/test/RangeItemHeaderValueTest.cs:

-        Assert.Equal(expectedFrom, range.From);
+        Assert.Equal(range.From, range.From);

The workflow posted this exact finding on line 138, as github-actions[bot]:

Assert.Equal(range.From, range.From) is tautological, so these single-range cases no longer validate the parsed start value. A regression that returns the wrong From while preserving parse success, count, and To would now false-pass for inputs such as 1-2, 0-0, and -2. Please restore Assert.Equal(expectedFrom, range.From);.

View the posted inline finding · View the accompanying review

This was a real posted review, not a preview. It establishes that the workflow can identify this test defect and publish it on the correct changed line and commit; it is not a claim of broad review accuracy.

All related jobs were terminal before cleanup. The fork default branch and original environment policies/protections were restored exactly; Actions permission settings were unchanged. The disposable PR was closed without merging, and its head branch was deleted with an expected-SHA lease. The posted review remains available as evidence.

Earlier stock-stable runs verified the no-findings/noop path and preview-mode finding output. The new run verifies real GitHub review POST acceptance, not just a preview.

Stable toolchain and temporary CLI pin

engine:
  id: copilot
  version: "1.0.80"

An earlier gh-aw v0.88.2 run dynamically installed actual CLI 1.0.83, despite compiler metadata reporting 1.0.80. Tool discovery failed with its stateful gateway v0.4.15. The protocol defect is tracked in github/gh-aw-mcpg#13196 and fixed by github/gh-aw-mcpg#13221.

The source pin bypasses automatic CLI selection. Stock gh-aw v0.88.7 generates explicit CLI 1.0.80 installation in both reviewer and detector jobs and uses its normal gateway v0.4.18. Repeat compilation produces the same workflow lock.

The source comment explains why the pin exists. On a future gh-aw upgrade, retry without it once the bundled gateway includes the fix, and remove it only after verifying the actual CLI, tool discovery, native skill/full topic panel, noop, and frozen-SHA COMMENT publication. Do not patch the compiler or generated lock.

Permissions, rollback, and boundaries

  • The agent remains read-only for contents, issues, and pull requests, with no PR checkout or bash/CLI-proxy/edit grant. Worker shell attempts in the trial were denied; no execution permission was added.
  • Existing copilot-pat-pool credentials are used only for inference. Evidence reads and safe outputs explicitly use GITHUB_TOKEN.
  • With live output enabled, the stock compiler grants pull-requests: write to both safe_outputs and conclusion. It grants no contents-write or issue-write permission. Generated-job permission overrides are not supported, so the source documents the actual boundary rather than claiming only one job has posting capability.
  • Configurable activation, failure, incomplete, noop-issue, and missing-tool issue reporting remain disabled. The platform's detector-tracking helper still has a warning/failure path that can attempt issue writes; it has no independent opt-out. The successful posting canary does not prove every failure path makes no such attempt.
  • The workflow requests lowercase dotnet/aspnetcore scope, but MCPG broadens reads to public repositories when the workflow repository is public. This is not exact-repository read isolation.
  • Built-in handlers enforce output caps, target, allowed review events, and commit attribution. Full panel accounting, RIGHT-side added-line validation, and live-head rechecking are agent-contract obligations, not independent infrastructure gates.
  • To stop posting and return to previews, set safe-outputs.staged: true in the source and recompile normally.

The trials establish the stated small-fixture paths, including one real post. They do not establish broad review accuracy, all contributor-fork/multi-guide cases, or all timeout, moved-head, detector-rejection, and incomplete-worker cases. The review remains advisory and maintainer-invoked.

Local checks

Strict stock compilation, repeat-output comparison, 76 live source/lock assertions, 20 isolated cases of the exact generated frozen-head script, YAML parsing, and git diff --check passed. Shared PAT-pool files, product code, skills, and package manifests are unchanged.

The source scanner reports the known LOW substring false positive matching create-pull-request inside create-pull-request-review-comment; no code-push output is declared. Native actionlint, with the documented concurrency.queue exception and external shell linters disabled, still reports the unchanged shared PAT-pool github.aw.import-inputs.random_seed expression. That result is not represented as a clean actionlint run.

@PureWeen
PureWeen marked this pull request as ready for review September 2, 2026 14:03
Copilot AI lite review requested due to automatic review settings September 2, 2026 14:03
@PureWeen
PureWeen requested review from a team and wtgodbe as code owners September 2, 2026 14:03

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 workflow’s safety/documentation comments are currently inconsistent with the generated workflow behavior, which can mislead future audits and maintenance.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity .github/​workflows/​pull-request-review.md — The comment claims the activation job sparse-checks out only .github, but the compiled workflow…
What changed in this PR

Adds a staged, maintainer-invoked /review slash-command workflow for ASP.NET Core pull requests, plus a locally runnable review-pull-request skill and domain reference corpus to keep hosted and local review criteria consistent.

Changes:

  • Introduces a new read-only (staged) Agentic Workflow that listens for the review slash command and renders review output to the workflow summary.
  • Adds the review-pull-request skill contract that freezes PR evidence, routes to at most two domain references plus cross-cutting, validates findings, and outputs a structured result.
  • Adds domain reference documents (cross-cutting + area-specific) used by the workflow’s inline reviewer agents and by local runs of the skill.
File Description
.github/​workflows/​pull-request-review.md New staged /review command workflow definition, including routing logic and inline reviewer agent blocks.
.github/​workflows/​pull-request-review.lock.yml Generated workflow YAML produced by gh aw compile for the staged /review workflow.
.github/​skills/​review-pull-request/​SKILL.md New local skill contract describing evidence freezing, routing, validation gates, and output format.
.github/​skills/​review-pull-request/​references/​auth-security-reviewer.md Auth/security domain review checklist and constraints used when routing security-related changes.
.github/​skills/​review-pull-request/​references/​blazor-components-reviewer.md Blazor/Components domain review checklist and constraints used when routing Components changes.
.github/​skills/​review-pull-request/​references/​cross-cutting-reviewer.md Cross-cutting review checklist applied to every routed review.
.github/​skills/​review-pull-request/​references/​grpc-reviewer.md gRPC integration domain review checklist and constraints.
.github/​skills/​review-pull-request/​references/​hosting-di-reviewer.md Hosting/DI domain review checklist and constraints.
.github/​skills/​review-pull-request/​references/​minimal-api-openapi-reviewer.md Minimal API/OpenAPI domain review checklist and constraints.
.github/​skills/​review-pull-request/​references/​mvc-razor-routing-reviewer.md MVC/Razor/routing domain review checklist and constraints.
.github/​skills/​review-pull-request/​references/​native-interop-reviewer.md Native IIS interop domain review checklist and constraints.
.github/​skills/​review-pull-request/​references/​servers-networking-reviewer.md Servers/networking domain review checklist and constraints.
.github/​skills/​review-pull-request/​references/​signalr-reviewer.md SignalR domain review checklist and constraints.
Suppressed comments (1)

.github/workflows/pull-request-review.md:118

  • This comment says the workspace is empty because checkout: false, but the generated workflow restores .github/ skills/agents from the activation artifact into the workspace. The key safety property is “no pull request head checkout + no credentials”, so the wording should avoid asserting an empty workspace.
  # To be precise rather than reassuring: the compiler still grants the agent a `write` tool inside
  # the sandbox container. That is not a path back to this repository — the workspace is empty
  # because `checkout: false`, credentials are excluded from the container, and no safe output can
  # commit or push. It does mean "read-only" describes this workflow's effect on GitHub, not an
  # absence of any filesystem capability in the sandbox.

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

@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from 58c6ff5 to 7c3f6be Compare September 2, 2026 18:41
@PureWeen
PureWeen marked this pull request as draft September 2, 2026 18:50
@PureWeen PureWeen changed the title Add a read-only /review command for pull requests (staged) Add a staged expert /review command for pull requests Sep 2, 2026
@PureWeen
PureWeen marked this pull request as ready for review September 2, 2026 20:05
@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from 6027a27 to c8ae4e2 Compare September 3, 2026 04:19
@PureWeen
PureWeen changed the base branch from main to pureween-review-pull-request-skill September 3, 2026 04:19
@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from c8ae4e2 to 1271b07 Compare September 3, 2026 04:22
@PureWeen
PureWeen changed the base branch from pureween-review-pull-request-skill to main September 3, 2026 04:24
@PureWeen
PureWeen changed the base branch from main to pureween-review-pull-request-skill September 3, 2026 04:24
maraf
maraf previously approved these changes Sep 3, 2026

@maraf maraf 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 to me 👍

@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from 1271b07 to cac83bb Compare September 3, 2026 12:46
@PureWeen
PureWeen changed the base branch from pureween-review-pull-request-skill to main September 3, 2026 12:46
@PureWeen
PureWeen dismissed maraf’s stale review September 3, 2026 12:46

The base branch was changed.

@PureWeen
PureWeen changed the base branch from main to pureween-review-pull-request-skill September 3, 2026 12:46
@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from cac83bb to 8dd5161 Compare September 3, 2026 12:58
@PureWeen
PureWeen changed the base branch from pureween-review-pull-request-skill to main September 3, 2026 12:58
@PureWeen
PureWeen changed the base branch from main to pureween-review-pull-request-skill September 3, 2026 12:58
@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from c6bd729 to 25eb49d Compare September 3, 2026 16:42
@PureWeen
PureWeen marked this pull request as draft September 3, 2026 16:49
@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from 25eb49d to 50fd8c8 Compare September 3, 2026 17:31
@PureWeen
PureWeen marked this pull request as ready for review September 3, 2026 19:47
@PureWeen
PureWeen marked this pull request as draft September 3, 2026 20:43
@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from a314b99 to e8395ce Compare September 3, 2026 20:51
@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from e8395ce to 60f7087 Compare September 3, 2026 22:02
@PureWeen
PureWeen marked this pull request as ready for review September 3, 2026 22:04
@PureWeen
PureWeen marked this pull request as draft September 3, 2026 22:18
@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from 60f7087 to fe7679c Compare September 3, 2026 22:31
@PureWeen
PureWeen marked this pull request as ready for review September 3, 2026 22:34
maraf
maraf previously approved these changes Sep 4, 2026
@PureWeen
PureWeen marked this pull request as draft September 8, 2026 16:39
Copilot AI added 4 commits September 17, 2026 10:30
Use the upstream topic-by-topic review skill with direct trusted slash commands, read-only GitHub evidence, frozen-head COMMENT previews, and explicit built-in reporting tokens.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 23284af6-fe88-4424-a958-1cd6ea24c056
Remove inline review-comment activation because its PR merge-ref bootstrap cannot preserve trusted default-branch skill and workflow provenance. Keep compiler-owned conversation command matching and all read-only, staged output restrictions.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 23284af6-fe88-4424-a958-1cd6ea24c056
The initial fork validation stopped at gateway startup because dynamic repository casing was invalid. Use a strict static lowercase upstream scope; fork test branches must declare their own exact lowercase fork scope.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 23284af6-fe88-4424-a958-1cd6ea24c056
Compile the staged reviewer against released gh-aw-mcpg v0.4.24, which contains the stateful HTTP protocol negotiation fix required by the Copilot CLI.

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

Copilot-Session: 23284af6-fe88-4424-a958-1cd6ea24c056
@PureWeen
PureWeen force-pushed the pureween-manual-pr-reviewer branch from fe7679c to 4a6b98e Compare September 17, 2026 16:20
@PureWeen
PureWeen changed the base branch from pureween-review-pull-request-skill to main September 17, 2026 16:20
@PureWeen
PureWeen dismissed maraf’s stale review September 17, 2026 16:20

The base branch was changed.

@PureWeen PureWeen changed the title Add a staged expert /review command for pull requests Add a staged /review workflow for pull requests Sep 17, 2026
Copilot AI added 2 commits September 17, 2026 12:53
Use stock gh-aw v0.88.7 and explicitly pin Copilot CLI 1.0.80 instead of dynamically selecting an incompatible discovery client. Document the removal test and correct the public-repository scope limitation. No compiler or generated lock patches.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 23284af6-fe88-4424-a958-1cd6ea24c056
Publish capped COMMENT reviews through gh-aw safe outputs instead of preview-only output. Keep the agent read-only, reporting opt-outs, frozen commit attribution, and the stable CLI pin. Document preview rollback and compiler-managed conclusion permissions.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 23284af6-fe88-4424-a958-1cd6ea24c056
@PureWeen PureWeen changed the title Add a staged /review workflow for pull requests Add a /review workflow for pull requests Sep 17, 2026
@PureWeen
PureWeen marked this pull request as ready for review September 21, 2026 14:05
@PureWeen
PureWeen merged commit b4be275 into dotnet:main Sep 22, 2026
12 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 23, 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.

4 participants