Skip to content

Add gh-aw rerun review scanner - #35685

Merged
PureWeen merged 50 commits into
mainfrom
feature/rerun-review-scanner
Jun 8, 2026
Merged

PureWeen merged 50 commits into
mainfrom
feature/rerun-review-scanner

Conversation

@kubaflo

@kubaflo kubaflo commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Summary

  • Moves the actual /review rerun command implementation out of Enhance MauiBot AI summary review output + support net11-targeting PRs #35677 and into this follow-up PR.
  • Adds deterministic /review rerun eligibility checks for new comments or commits and applies s/agent-ready-for-rerun when another review is justified.
  • Adds deterministic rerun context for pre-flight so the next review can focus on activity since the prior AI Summary / rerun checkpoint.
  • Adds an hourly gh-aw workflow (rerun-review-scanner.md + compiled .lock.yml) that scans queued PRs, asks AI for a trigger / skip decision, and uses a custom safe-output job for reactions, queue-label cleanup, and AzDO triggering.
  • Adds helper scripts for querying queued PRs and processing scanner decisions.

Validation

  • gh aw compile .github/workflows/rerun-review-scanner.md
  • Parsed changed PowerShell scripts with System.Management.Automation.Language.Parser.
  • Parsed .github/workflows/rerun-review-scanner.lock.yml and .github/workflows/review-trigger.yml as YAML.
  • Invoke-Pester .github/scripts/Resolve-RerunEligibility.Tests.ps1,.github/scripts/Post-AISummaryComment.Tests.ps1,.github/scripts/Remove-StaleMauiBotComments.Tests.ps1 -CI
  • Read-only query helper run: Query-RerunReadyPRs.ps1 -MaxPRs 1 -OutputPath /tmp/rerun-candidates.json

Depends on

Copilot AI and others added 30 commits May 22, 2026 20:48
Split the monolithic 'Run PR Reviewer Agent' bash task into 4 sequential
tasks, each with exactly the env vars it needs:

  Task 1 (Setup):         GH_TOKEN only — branch checkout, PR merge
  Task 2 (Gate):          NO tokens — dotnet build/test, gate verification
  Task 3 (CopilotReview): COPILOT_GITHUB_TOKEN — expert review + try-fix
  Task 4 (Post):          GH_TOKEN only — comments, labels, summary

Review-PR.ps1 gains -Phase (Setup|Gate|CopilotReview|Post) and
-TrustedScriptsDir parameters so each pipeline task invokes a single
phase. Backward-compatible: omitting -Phase runs all steps sequentially.

Security improvements:
- persistCredentials: false (credentials no longer available to all tasks)
- Removed gh auth login step (GH_TOKEN used directly as env var)
- --secret-env-vars strips tokens from copilot subprocess environments
- Trusted scripts copied once in Setup, reused by all phases
- PRNumber type changed to 'number' for AzDO parameter validation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Persist regression risks, tests, and platform to files in Gate phase
- Restore regression data + detect script path in CopilotReview phase
- Fix stale RunReview references in comments (now RunGate/RunPost)
- Fix misleading RunPost step name comment in ci-copilot.yml

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Tier 3 AI refresh in CopilotReview phase emits detectedCategories
under step RunReview, but downstream RunDeepUITests was only reading
RunGate. Use coalesce() so AI-refreshed categories are preferred when
available, falling back to Gate-detected categories otherwise.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add TrustedScriptsDir null guard with local fallback in both
  CopilotReview and Post phase restoration blocks (prevents
  ParameterBindingException when running locally with -Phase)
- Add setup-complete sentinel verification before Gate/CopilotReview/Post
  phases to fail fast with clear error if Setup didn't complete

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The detection script (Detect-TestsInDiff.ps1) fetches PR metadata and labels
from the GitHub API. Without GH_TOKEN, these calls are unauthenticated and
subject to low rate limits. This adds the token for reliable API access.

The token is GH_COMMENT_TOKEN (same as Setup/Post phases). The security
boundary is preserved — only CopilotReview (Task 3) lacks GH_TOKEN to
prevent the Copilot agent from posting directly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Three small hardening changes uncovered while auditing PR #35324:

1. RunDeepUITests checkout: add persistCredentials: false. This stage merges the PR head and runs PR-modified scripts (BuildAndRunHostApp.ps1, Invoke-UITestWithRetry.ps1) — without this, malicious PR code could read the GitHub App auth header from .git/config.

2. UpdateAISummaryComment checkout: add persistCredentials: false. Defense-in-depth — this stage runs with GH_COMMENT_TOKEN in env.

3. Setup task: chmod -R a-w on the trusted-github dir after copy, so the Copilot agent in Task 3 cannot tamper with the scripts that Task 4 will execute with GH_TOKEN.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addresses two [critical] security findings from MauiBot's 2026-05-24 review of
PR #35324 (#35324):

1. eng/scripts/detect-ui-test-categories.ps1 was being invoked from the
   PR-merged worktree ($RepoRoot/eng/scripts/...) during the Gate task,
   which has GH_TOKEN=$(GH_COMMENT_TOKEN) in env. A PR could replace that
   one file to exfiltrate the maui-bot posting token. Fix: copy eng/scripts
   into the trusted directory alongside .github/scripts and .github/skills,
   add $EngScriptsDir resolution in Review-PR.ps1, and route the two
   $detectScript invocations through it. Same root cause also applied to
   $uiTestRunner / $deviceTestRunner (now use $ScriptsDir and
   $SkillsDir instead of $RepoRoot/.github/...).

2. dotnet test, BuildAndRunHostApp.ps1, Run-DeviceTests.ps1, and
   verify-tests-fail.ps1 all execute PR-controlled code (MSBuild targets,
   source generators, analyzers, test code, host-app builds). Any of these
   could read $env:GH_TOKEN via <Exec EnvironmentVariables=...> in a
   .csproj or Directory.Build.targets and POST it. Fix: introduce
   Invoke-WithoutGhTokens helper that clears GH_TOKEN / GITHUB_TOKEN /
   COPILOT_GITHUB_TOKEN for the duration of a scriptblock, then restores
   them. Wrap every Gate-phase invocation of PR-controlled code.

Trusted metadata-fetch scripts (Detect-TestsInDiff, Find-RegressionRisks,
detect-ui-test-categories) still see GH_TOKEN -- they need it for `gh` CLI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Distills the threat model + 8 prevention rules from PR #35324 (and the
MauiBot findings + T-Gro audit that surfaced them) into a single
.github/instructions file that auto-applies whenever anyone edits any
script/yaml/markdown belonging to the Copilot PR-review pipeline.

Rules covered:
  1. Per-task token scoping (AzDO env: block)
  2. persistCredentials: false on every checkout: self
  3. Trusted-script copy + chmod -R a-w before PR merge
  4. Strip GH_TOKEN/GITHUB_TOKEN/COPILOT_GITHUB_TOKEN from env before
     invoking PR-controlled code (dotnet test, MSBuild, host-app, etc.)
  5. Cross-phase signal files in Agent.TempDirectory, never working tree
  6. Strip ##vso[...] from PR-controlled stdout (with CR handling)
  7. gh-aw version pinning, .lock.yml regeneration, trusted .github/
     restore on workflow_dispatch
  8. No tokens via pipeline variables / log lines

Includes a code-review checklist and grep anti-pattern scans so future
contributors (human or agent) editing any of ~25 files in this surface
get the security context automatically via VS Code Copilot applyTo.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Trim 242 -> ~60 lines: drop redundant good/bad code pairs (the rule
itself is the lesson), drop threat-model table (merged into intro),
drop references section. Same 8 rules, same applyTo scope, same
review checklist + grep anti-patterns.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Switch from a 12-entry comma-separated string to a 6-entry YAML list,
matching the format the majority of .github/instructions files already
use. Uses minimatch brace expansion ({pr-review,verify-tests-fail-...})
and extension wildcards (workflows/*.{md,yml,lock.yml}) to drop 6
hardcoded paths. Validated to match 70 files across the surface
(ci-copilot.yml + 41 scripts + 19 skill files + 4 phase docs + 4
workflows + 1 detector).

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

1. Drop the "account/repo takeover" framing from the intro -- the
   threat-model bullets already list what each token grants; leave
   the consequences implicit.

2. Switch applyTo from YAML list + brace expansion to the single
   comma-separated string format documented by GitHub:

     https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions

   The official docs explicitly support multiple patterns via a
   comma-separated string (example: applyTo: "**/*.ts,**/*.tsx").
   YAML list form and {a,b,c} brace expansion are NOT documented.
   The web-side parser (Copilot coding agent + code review on
   github.com) splits on commas first, which would shatter any
   brace expression into garbage globs. Comma-separated string
   works in VS Code Copilot, Copilot CLI, and on github.com.

   Kept the .* extension wildcard for copilot-evaluate-tests.*
   (standard glob, covers .md + .lock.yml). Validated 70 files
   matched across 11 patterns with brace expansion disabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous commit wrapped the WHOLE verify-tests-fail.ps1 invocation
in Invoke-WithoutGhTokens at the Review-PR.ps1 level. That broke the
Gate because verify-tests-fail.ps1 itself needs GH_TOKEN to call
Detect-TestsInDiff.ps1, which uses `gh api repos/.../pulls/N/files`
to enumerate PR files for test-type detection.

Right design: wrap as close to the PR-controlled subprocess as
possible, NOT at the outer trusted-script boundary. A trusted script
may need `gh` itself for metadata.

Changes:
- verify-tests-fail.ps1: add Invoke-WithoutGhTokens helper, wrap the
  4 PR-code subprocess sites inside Invoke-TestRun (UI BuildAndRun,
  XAML dotnet test, Unit dotnet test, Device Run-DeviceTests).
- Review-PR.ps1: unwrap the outer pwsh -File $verifyScript call.
  Add comment explaining why this one is intentionally not wrapped.
- ci-copilot-pipeline-security.instructions.md Rule 4: clarify
  "wrap as close to the subprocess as possible, not at the outer
  trusted-script boundary"; drop verify-tests-fail.ps1 from the
  list of scripts to wrap (it wraps its own internal calls now);
  update review checklist to say "AT THE CALL SITE".

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Step 3 (Run Detected UI Tests) was running BuildAndRunHostApp.ps1 per
detected category inside the ReviewPR stage, duplicating the same work
that RunDeepUITests (Stage 2) does. This caused UI tests to run twice.

Now the ReviewPR stage only runs targeted PR-specific tests via the Gate
(verify-tests-fail.ps1), and full-category runs happen exclusively in
the RunDeepUITests stage.

Renumbered steps: old 4→3, 5→4, 6→5, 7→6, 8→7.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Detect category-wide fixture setup failures in deep UI TRX aggregation and render them as setup failures instead of duplicated failed tests. Keep the deep UI task successful so the summary comment stage can publish the artifact-backed result.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Skip rendering UI test and regression cross-reference sections when their content only reports no actionable work.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Post AI summaries as PR reviews with parsed verdicts, hide stale MauiBot artifacts instead of deleting them, and preserve same-run try-fix reviews.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the unified AI Review Summary layout with segmented status chips, collapsed review sessions, and a Future Action section for alternative fix guidance. Avoid posting a separate try-fix review so the AI summary is the single source of truth.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep AI Summary as the single current MauiBot review artifact, ensure non-PR try-fix winners request changes through that review, and prevent stale try-fix cleanup from hiding the merged summary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the built Windows device-test app directly for gate validation so the runner avoids testhost dependency crashes and matches the canonical windows.cake path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Teach /review rerun to run a deterministic activity check for new comments or commits and apply s/agent-ready-for-rerun when another AI review is justified. Also add rerun guidance to generated AI Summary comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Treat label application as successful when the ready-for-rerun label is present after the GitHub API call, avoiding false failures from brittle gh exit-code handling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Post label additions with the GitHub Issues API JSON payload shape so /review rerun can reliably apply s/agent-ready-for-rerun from GitHub Actions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Grant pull-requests: write to the /review rerun labeling job so it can apply s/agent-ready-for-rerun to pull requests after deterministic eligibility passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Stop preserving PR finalization sections in MauiBot AI Summary updates and update docs so pr-finalize is no longer described as part of the automated Review-PR process.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Generate a deterministic rerun context artifact listing new comments and commits since the latest AI Summary or previous /review rerun checkpoint, and instruct pre-flight to read it before reviewing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the /review rerun instruction in the AI Summary text, but remove the command implementation, rerun context generation, ready-for-rerun label changes, and related tests from this PR so they can live in the dedicated scanner PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Teach /review rerun to run a deterministic activity check for new comments or commits and apply s/agent-ready-for-rerun when another AI review is justified. Also add rerun guidance to generated AI Summary comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI and others added 3 commits June 4, 2026 21:34
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sanitize agent-provided log text, verify safe-output decisions against the deterministic candidate set, and only honor /review options from users with write permissions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Source pipeline_ref / platform / rerun_comment_id from the candidate
  record instead of the agent's emission. The candidates.json file is
  the deterministic source of truth for everything the handler acts on;
  the agent's matching fields are now advisory only.
- Validate pr_number shape against ^[1-9]\d*$ before the [int] cast so
  malformed values produce a tidy error message instead of a .NET
  conversion exception that echoes the raw input.
- Drop raw $item values from the validation throw messages and route
  the outer-catch $_ plus the inline ::warning:: paths through
  ConvertTo-SafeLogValue so error output is shaped consistently.
- When the rate limiter blocks a trigger, leave the
  s/agent-ready-for-rerun label in place (and skip the -1 reaction) so
  the next hourly scan can retry instead of permanently dropping the
  request.
- In Query-RerunReadyPRs.ps1, gate /review option authority on the
  comment's author_association field directly (matches the downstream
  fallback in Test-ReviewCommandOptionsAllowed). The previous
  /collaborators/.../permission lookup needed push scope that the
  read-only scanner token does not have, so it always returned false
  and silently discarded every /review option.
- Tighten Get-LatestAISummaryComment so the AI Summary author must
  match the maui-bot / github-actions login regex; any `type == 'Bot'`
  app no longer counts.
- Extend Pester tests in Invoke-RerunReviewTrigger.Tests.ps1 and
  Resolve-RerunEligibility.Tests.ps1 to cover the new bindings,
  pipeline_ref normalization edge cases, error-path sanitization, and
  the narrower AI-Summary bot allowlist.

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

kubaflo commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Code Review — recent Shane delta on PR #35685

Reviewed commit range 606c4e3a6b..29f62fb011, specifically:

  • 80da010fda — Harden rerun review scanner handler
  • 29f62fb011 — Refine rerun handler input handling and edge cases

Independent assessment

What this changes: The recent commits harden the rerun scanner handoff between AI output and deterministic safe-output execution. The safe-output handler now cross-checks AI-emitted decisions against the deterministic candidate artifact, sources operational values like platform/ref/comment id from that artifact instead of the AI payload, sanitizes log values, tightens PR-number/head validation, filters trusted /review option authors, and narrows AI Summary detection to MauiBot/GitHub Actions generated summaries.

Inferred motivation: The changes reduce prompt-injection and confused-deputy risk: the AI can still decide trigger/skip, but it can no longer smuggle arbitrary platform/ref/comment-id values outside the precomputed candidate set.

Findings

⚠️ Warning — Rate-limited PRs can keep occupying the bounded scanner queue

Invoke-RerunReviewTrigger.ps1 now preserves s/agent-ready-for-rerun when a trigger decision is blocked by the deterministic cooldown/quota ($preserveReadyLabel = $true at lines 343-349, then skip removal at lines 391-392). That makes sense if the intent is to retry automatically after the cooldown expires.

The edge case is that candidate discovery is bounded before safe-output processing (rerun-review-scanner.md defaults MAX_PRS to 5 and passes that limit to Query-RerunReadyPRs.ps1 at lines 112-125). If several PRs are rate-limited and keep the ready label, they can be rediscovered every hourly run and occupy the limited candidate slots, starving later queued PRs and increasing scanner/safe-output churn.

Suggested mitigation: either remove/move the ready label on deterministic rate-limit blocks, or have the candidate query skip rate-limited PRs before applying the MaxPRs cap (possibly by fetching more than MaxPRs and post-filtering). If automatic retry after cooldown is important, a separate delayed/backoff label/state would avoid blocking the normal ready queue.

What looks good

  • Safe-output now requires each AI decision to correspond to a deterministic candidate (Get-MatchingCandidate) and verifies the candidate head SHA matches the AI-emitted expected SHA before any side effects.
  • Pipeline ref, platform, and rerun comment id are sourced from the candidate set rather than trusted from the AI payload.
  • Log output is sanitized to avoid accidental workflow-command emission from malformed AI values/errors.
  • AI Summary checkpoint detection now ignores forged user-authored summaries and non-allowlisted bots.
  • Focused Pester coverage for these hardening helpers passes locally (Invoke-RerunReviewTrigger.Tests.ps1, Resolve-RerunEligibility.Tests.ps1).

Devil's advocate

The queue-starvation concern only matters when there are enough simultaneously queued/rate-limited PRs to hit the scanner cap; in low queue volume the current behavior is probably fine and preserves convenient automatic retry. I’m flagging it because this feature explicitly accepts contributor-originated rerun requests, so deterministic DoS/backoff behavior is part of the security boundary.

Verdict: NEEDS_DISCUSSION

Confidence: medium

No correctness blocker found in the hardening itself. The remaining question is whether rate-limited reruns should stay in the normal ready queue, or move to a separate backoff path so abusive/noisy requests cannot occupy the hourly scanner’s bounded candidate set.

@kubaflo

kubaflo commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on my prior review note about rate-limited reruns staying queued: after discussing the intended workflow, this behavior is acceptable and intentional.

If the safe-output job blocks a trigger because of cooldown/quota, keeping s/agent-ready-for-rerun lets a later scanner batch reconsider the PR automatically. Successful actual rerun triggers still remove s/agent-ready-for-rerun after AzDO starts, so the duplicate-trigger path is still covered.

No change requested for this point.

…onsAllowed

When AllowedAuthorLogins was supplied (the Query-RerunReadyPRs path), the
helper trusted any comment whose login appeared in the allowlist and skipped
the per-comment author_association check. That meant a login which had posted
one valid /review comment while OWNER/MEMBER/COLLABORATOR could later post
another /review comment after losing access and still have its --branch /
--platform options honored.

Make the per-comment author_association check unconditional so the
AllowedAuthorLogins filter only further restricts the set rather than
replacing the trust check. Add two regression tests covering the
post-access-loss case (one mixed-history, one allowlisted login that no
longer qualifies on any current comment).

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

kubaflo commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Code Review — latest commit on PR #35685

Reviewed latest commit 3484700d32 — Always check per-comment author_association in Test-ReviewCommandOptionsAllowed.

Independent assessment

What this changes: Tightens /review option extraction for rerun candidates so an allowlisted login is not enough by itself; each individual comment must also have a trusted author_association (OWNER, MEMBER, or COLLABORATOR) before its platform/branch options can influence a later rerun.

Inferred motivation: Prevent a previously trusted login from carrying trust forward to a later comment after access changed, or from having stale author state in the precomputed allowed-login set override the current comment's own association.

Findings

No issues found in this commit.

What looks good

  • The change keeps the explicit AllowedAuthorLogins filter, but now treats it as an additional constraint instead of a replacement for per-comment trust.
  • The fallback path remains straightforward: when no explicit allowlist is provided, trusted author associations are still accepted and untrusted associations are rejected.
  • Added tests cover both mixed old/new comments for the same former collaborator and the all-untrusted case.

Devil's advocate

The only subtle point is that author_association is event/comment metadata, not a live permissions check. In this code path that is acceptable because Query-RerunReadyPRs.ps1 separately computes AllowedAuthorLogins from trusted comments and this function now requires both the per-comment association and the optional explicit allowlist to pass.

Verdict: LGTM

Confidence: high

This is a small hardening commit with focused tests and no negative interaction found with the existing rerun candidate selection path.

@dotnet dotnet deleted a comment from MauiBot Jun 8, 2026
@PureWeen
PureWeen merged commit e02d6b6 into main Jun 8, 2026
38 of 39 checks passed
@PureWeen
PureWeen deleted the feature/rerun-review-scanner branch June 8, 2026 21:10
@github-actions github-actions Bot added this to the .NET 10.0 SR8 milestone Jun 8, 2026
PureWeen pushed a commit that referenced this pull request Jun 9, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Summary

- Recognizes the `MauiBot` account as the AI Summary author for `/review
rerun` eligibility.
- Replaces duplicated author regex checks with one allowlist helper used
by AI Summary detection and bot-comment rejection.
- Adds regression coverage based on #34426 comments
4239128463 and 4658057491.

## Validation

- `Invoke-Pester
.github/scripts/Resolve-RerunEligibility.Tests.ps1,.github/scripts/Invoke-RerunReviewTrigger.Tests.ps1
-CI`
- `Resolve-RerunEligibility.ps1 -PRNumber 34426 -CurrentCommentId
4658995396` returned `Rerun eligibility: True (new-head-commit)`
- Verified the patched helper selects AI Summary comment `4239128463`
authored by `MauiBot`.

## Fixes

- Follow-up to #35685

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen pushed a commit that referenced this pull request Jun 9, 2026
…ix blast-radius rubric ground truth

Two changes addressing kubaflo's review request that the skill's new
safety-critical behaviors (prior-review reconciliation and the CI hard
gate) have no eval coverage, plus a one-line factual correction to the
blast-radius rubric.

1. New scenario: "Prior review reconciliation - skill surfaces prior
   findings before verdict"
   - Anchor: PR #35685 (gh-aw rerun review scanner, merged)
   - Has substantive review history across all three surfaces: 4 human
     reviewers (PureWeen, JanKrivanek, T-Gro, kubaflo), top-level
     reviews with ❌ findings, inline review comments with ❌ markers
     at specific files, AND MauiBot AI Summary in issue comments with
     17 ❌ markers
   - Assertions verify the section heading exists, that at least one
     real reviewer is named (defeats "no prior findings" boilerplate),
     and that a verdict is delivered
   - Rubric verifies all three review surfaces are queried, prior ❌
     findings are reconciled against current code state, and no
     finding is silently dropped

2. New scenario: "CI hard gate - skill refuses LGTM when required
   checks are skipping"
   - Anchor: PR #35820 (Fix /review tests trigger, merged)
   - Has license/cla=pass and maui-pr=skipping — `gh pr checks
     --required` exits 0 with "All checks were successful" plus
     "1 skipped". This is precisely the exit-0-with-skipping trap the
     skill's Step 5 calls out as NOT a clean pass.
   - Assertions verify the CI Status section exists, evidence of
     required-check inspection (named check or skipping/undetermined
     classification), and that the verdict is NEEDS_DISCUSSION rather
     than LGTM (per Rule #6: no LGTM on pending/skipping/undetermined
     CI).
   - Rubric verifies the agent ran gh pr checks --required, classified
     per the skill's exit-code semantics, and did not interpret the
     "All checks were successful" gh summary line as license to LGTM
     when a required check actually skipped.

3. Rubric fix: blast-radius scenario line 121
   - The previous rubric stated "the PR makes the registration
     conditional, so the post-PR claim is false". This is factually
     incorrect about MAUI PR #35223: AddCallback registration remains
     unconditional (Activity.cs:3372); only the callback's Enabled
     state is conditional (lines 3405/3408).
   - The judge had been penalizing the more-precise nuanced answer
     ("registration unconditional, Enabled conditional") at 3.3/5
     because it didn't match the rubric's binary "refute".
   - New rubric awards credit for the correct technical distinction
     and removes the false expectation that the hypothesis must be
     binary-refuted.

The eval scenarios anchor on PRs not used elsewhere in eval.yaml,
addressing PureWeen's anchor-reuse concern in a different direction.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Jun 11, 2026
…xx-sr8 (#35810)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Cut-then-merge step 2 of 2

SR8 was cut from `main` at
[`e02d6b6dc2`](e02d6b6)
(commit "Add gh-aw rerun review scanner (#35685)"). This PR pulls the
SR7 stabilization work into SR8 so SR8 contains everything that's in
SR7.

- **Base:** `release/10.0.1xx-sr8` @
[`e02d6b6dc2`](e02d6b6)
- **Merging in:** `release/10.0.1xx-sr7` @
[`9da598b4a1`](9da598b)
(PatchVersion bump to 71)
- **Merge base:**
[`f8cb875e`](f8cb875eee)
("[Testing] The Windows WebView category is removed from CI…" #35335)
- **Strategy:** non-fast-forward merge commit (preserves both branches'
history)

## Conflict resolution

Two trivial conflicts, both resolved by taking the SR8 (`HEAD`) side:

| File | Why it conflicted | Resolution |
| --- | --- | --- |
|
[`eng/Versions.props`](https://github.com/dotnet/maui/blob/release/10.0.1xx-sr8/eng/Versions.props)
| SR7 bumped `PatchVersion` 70→71 (#35786); SR8 starts at 80 | Keep
`PatchVersion=80` (SR8 is the higher patch band) |
|
`src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs`
| Whitespace-only difference (`false; //` vs `false; //`) in two
comments | Keep SR8's whitespace |

No semantic conflicts.

## Inherited from SR7

26 SR7-only commits land in SR8 via this merge. The source PRs are:

<details>
<summary>Source PRs (43, deduped by commit)</summary>

#35020, #35072, #35092, #35150, #35223, #35299, #35305, #35347, #35356,
#35359, #35360, #35421, #35423, #35424, #35425, #35426, #35427, #35428,
#35430, #35434, #35441, #35447, #35461, #35480, #35503, #35520, #35521,
#35559, #35566, #35585, #35625, #35642, #35664, #35689, #35690, #35691,
#35692, #35693, #35694, #35703, #35744, #35768, #35786

Includes the SR7 revert chain:
- #35689 — Revert PR #30068 (FontImageSource centering on Windows)
- #35694 — Revert TalkBack RadioButton fix
- #35703 — Revert Shell.NavBarIsVisible fix
- #35744 — Revert HybridWebView WebView fix
- #35461, #35503 — additional Android reverts
</details>

After this lands, the release-readiness tracker can survey
`release/10.0.1xx-sr8` directly instead of using `-Candidate
-InheritFromPriorSr` mode against SR7.
Dhivya-SF4094 pushed a commit to Dhivya-SF4094/maui that referenced this pull request Jun 15, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Summary

- Moves the actual `/review rerun` command implementation out of dotnet#35677
and into this follow-up PR.
- Adds deterministic `/review rerun` eligibility checks for new comments
or commits and applies `s/agent-ready-for-rerun` when another review is
justified.
- Adds deterministic rerun context for pre-flight so the next review can
focus on activity since the prior AI Summary / rerun checkpoint.
- Adds an hourly gh-aw workflow (`rerun-review-scanner.md` + compiled
`.lock.yml`) that scans queued PRs, asks AI for a `trigger` / `skip`
decision, and uses a custom safe-output job for reactions, queue-label
cleanup, and AzDO triggering.
- Adds helper scripts for querying queued PRs and processing scanner
decisions.

## Validation

- `gh aw compile .github/workflows/rerun-review-scanner.md`
- Parsed changed PowerShell scripts with
`System.Management.Automation.Language.Parser`.
- Parsed `.github/workflows/rerun-review-scanner.lock.yml` and
`.github/workflows/review-trigger.yml` as YAML.
- `Invoke-Pester
.github/scripts/Resolve-RerunEligibility.Tests.ps1,.github/scripts/Post-AISummaryComment.Tests.ps1,.github/scripts/Remove-StaleMauiBotComments.Tests.ps1
-CI`
- Read-only query helper run: `Query-RerunReadyPRs.ps1 -MaxPRs 1
-OutputPath /tmp/rerun-candidates.json`

## Depends on

- dotnet#35677 for the AI Summary layout and visible `/review rerun`
instruction text.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>
Co-authored-by: Shane Neuville <shane94@hotmail.com>
Dhivya-SF4094 pushed a commit to Dhivya-SF4094/maui that referenced this pull request Jun 15, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Summary

- Recognizes the `MauiBot` account as the AI Summary author for `/review
rerun` eligibility.
- Replaces duplicated author regex checks with one allowlist helper used
by AI Summary detection and bot-comment rejection.
- Adds regression coverage based on dotnet#34426 comments
4239128463 and 4658057491.

## Validation

- `Invoke-Pester
.github/scripts/Resolve-RerunEligibility.Tests.ps1,.github/scripts/Invoke-RerunReviewTrigger.Tests.ps1
-CI`
- `Resolve-RerunEligibility.ps1 -PRNumber 34426 -CurrentCommentId
4658995396` returned `Rerun eligibility: True (new-head-commit)`
- Verified the patched helper selects AI Summary comment `4239128463`
authored by `MauiBot`.

## Fixes

- Follow-up to dotnet#35685

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kubaflo pushed a commit to kubaflo/maui that referenced this pull request Jun 19, 2026
Document recent workflow improvements:
- Command comments are now minimized (collapsed as Resolved) after authorization (dotnet#35895, dotnet#36021)
- /review rerun eligibility now requires PR author activity only (dotnet#35874)
- Automated hourly rerun scanner processes queued reruns (dotnet#35685)
- Add troubleshooting entries for rerun eligibility and command visibility

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai-agents Copilot CLI agents, agent skills, AI-assisted development area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants