Skip to content

Harden maui-copilot reviewer and skill validation with GPT-only models - #38040

Merged
kubaflo merged 234 commits into
mainfrom
improved-reviewer
Sep 17, 2026
Merged

kubaflo merged 234 commits into
mainfrom
improved-reviewer

Conversation

@kubaflo

@kubaflo kubaflo commented Aug 31, 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!

Description of Change

Improves the reliability and security of the maui-copilot AzDO review pipeline (definition 27723), its GitHub trigger/recovery path, and its skill-evaluation gates, while enforcing a GPT-only model policy across reviewer automation.

Supersedes #36473, which superseded #36399.

Issues Fixed

This is infrastructure hardening accumulated from production reviewer failures rather than a fix for one product issue. The real-run examples below identify the PRs whose failures supplied the regression evidence.

Gate reliability fixes

The gate ("test before and after fix") had several classes of false verdicts. Each is addressed:

Problem Old behavior New behavior
Failure-only mode (test-only PRs) wrote no report PASSED plus "exited before writing report" warning writes a proper report on every exit path
Test-less PRs (fix files, no tests) forced INCONCLUSIVE after 3 wasted retries SKIPPED (add tests), no retry
Flaky pass/fail on a single run verdict flipped on one flaky run re-runs unexpected outcomes and credits the confirmed result
Baseline and fix both fail to build mislabeled "Fix does not compile" "Pre-existing build failure (not the fix)" to INCONCLUSIVE
New VerifyScreenshot test, no baseline yet FAILED ("fix does not pass") INCONCLUSIVE ("new snapshot - no baseline")
Helper file (no test methods) detected as a test dragged the gate to FAILED excluded from detection
Deleted C# test file detected as runnable filtered a class that no longer exists and matched zero tests excluded because no runnable source remains
Mixed PR (one test reproduces, another always green) FAILED PASSED - at least one test must reproduce the bug (FAIL to PASS) and none may regress
Gate reason unclear on environment/build failure terse "could not complete" exit-code/log-aware fallback lead-ins classify environment errors as INCONCLUSIVE

The gate now always runs: the temporary SkipUITests fast-mode toggle, which passed -SkipGate and skipped the gate on every production review, is removed. The gate self-selects its verdict, so a PR with no runnable tests exits SKIPPED without emulator work.

This also removes the spurious CopilotFailed: command not found noise in the "Check Review Result" step, where undefined $(var) macros were evaluated as Bash command substitutions.

Deep-stage and always-finish reliability

  • Build-hang watchdog - an in-script wall-clock watchdog ([Process]::Start plus Kill($true)) bounds the buildtasks/cake child-process tree because AzDO's step timeoutInMinutes does not kill a hung child tree.
  • Always finish the PR - the deferred Post phase posts a standalone deep-results review and collapses the "review incomplete" notice when the normal review path produced nothing.
  • Deep per-category loop - hard-stop, per-category ceiling, and idle-kill bounds keep the deep stage under its task timeout instead of failing on an infrastructure timeout.
  • Pre-workload disk cleanup - Android hosted agents reclaim large SDK/tool caches immediately after Android provisioning and before workload installation, avoiding deterministic ENOSPC retries on an already-full agent.
  • Artifact isolation - cross-stage imports are restricted to the canonical PRState/<PR>/PRAgent tree. Candidate discovery uses bounded iterative traversal, skips reparse-point directories, validates containment, caps the directory count, and stops as soon as a second candidate proves ambiguity.
  • Bounded diagnostics - generated logs, patches, and diffs are capped before posting while review-critical Markdown and JSON remain fail-closed.
  • Release-branch validation - every pipeline and immutable-snapshot validator accepts safe dotted and numeric inflight/* names such as inflight/10.0.101 while rejecting hidden, uppercase, nested, and traversal-like shapes.

Skill-evaluation and trigger hardening

  • Trusted preparation/runtime scripts are read from the protected base revision; pull-request fixture data is treated as untrusted input.
  • Fixture overlays are constrained to approved skill roots and cannot target repository metadata, persistent identities, hooks, profiles, or paths outside the evaluation workspace.
  • YAML aliases, malformed or ambiguous JUnit/XML signals, missing invocations, missing aggregate verdicts, and incomplete run counts fail closed.
  • Vally subprocesses receive isolated credentials and temporary homes; persistent Git identity and credential mutations are rejected.
  • Review-trigger recovery revalidates comment identity and current write permission, serializes by PR, and leaves transient failures unacknowledged for a later retry.
  • PowerShell regression tests pin branch parsing, recovery behavior, artifact limits, model policy, and the evaluation security contract.

GPT-only model policy

  • The primary reviewer is pinned to gpt-5.6-sol; COPILOT_REVIEW_MODEL can no longer redirect it to an arbitrary provider.
  • Try-fix runs exactly two approved GPT candidates in order: gpt-5.3-codex, then gpt-5.6-sol.
  • The independent MAUI expert reviewer uses gpt-5.3-codex.
  • The local test-failure reviewer is hard-pinned to gpt-5.6-sol; COPILOT_REVIEW_TESTS_MODEL can no longer redirect it.
  • UI-test failure analysis only accepts gpt-5.6-sol or gpt-5.3-codex.
  • Vally judges and model-token probes use gpt-5.3-codex.
  • Regression coverage scans repository automation and fails if an Anthropic model identifier is introduced.

Files changed

  • .github/workflows/review-trigger.yml - /review comment parsing for platform and branch arguments.
  • eng/pipelines/ci-copilot.yml - gate/provisioning behavior, watchdogs, deferred posting, snapshot handling, artifact isolation, and base validation.
  • .github/scripts/Review-PR.ps1 - gate classification, bounded review artifacts, pinned primary reviewer, and GPT-only try-fix candidates.
  • .github/scripts/shared/Detect-TestsInDiff.ps1 - skips C# files with no test-method attributes.
  • .github/scripts/shared/Import-ExpectedPRAgentArtifact.ps1 - bounded, reparse-safe canonical artifact discovery.
  • .github/scripts/shared/Analyze-UITestFailures.ps1 - approved GPT model allowlist.
  • .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 - deterministic re-runs and complete report/classification behavior.
  • .github/skills/pr-review/SKILL.md and .github/skills/code-review/SKILL.md - GPT-only try-fix and expert-review selection.
  • .github/scripts/PrepareVallyEvaluation.rb, .github/scripts/SetupVallyRuntime.sh, and .github/workflows/skill-validation.yml - hermetic fixture preparation, runtime isolation, and fail-closed evaluation gates.
  • .github/skills/**/tests/*.vally.yaml and model-probe workflows - GPT-only evaluation judges and probes.
  • .github/scripts/CopilotPipeline.Tests.ps1 - synchronized branch-validation and forbidden-model regression coverage.
  • .github/scripts/post-ai-summary-comment.ps1 - AI Review Summary rendering.

What NOT to do

  • Do not restore a free-form reviewer model environment override; direct, try-fix, expert, judge, and probe selectors must stay on the approved GPT models.
  • Do not acknowledge a recovered /review comment in the scheduled scanner before the serialized trigger workflow runs. The durable marker is the trigger workflow's completion/dedupe signal; pre-marking would make that dispatched run skip itself.
  • Do not let an optional UI-failure classifier hard-fail or silently disappear. It remains best effort, emits an Azure warning on failure, and runs without posting credentials.
  • Do not copy prompt-influenced artifacts directly into the posting job. Use the bounded regular-file importer and fail closed for review-critical files.

Testing

Validated with full-gate runs (SkipUITests=false) on real PRs:

Local model-policy validation:

  • The exact pushed-head PowerShell workflow suite passed 2,165/2,165 tests.
  • The focused reviewer suites passed 93/93 tests locally.
  • Mutation proof confirms the old Setup validator fails on inflight/10.0.101, while the corrected validator passes.
  • The previously date-sensitive CI-scan fixtures now use a fixed test clock; all 333 reconciler tests pass.
  • 99 focused reviewer/model-policy PowerShell tests passed on commit c34f9c8ee90.
  • 72 Ruby runs and 219 assertions for Vally preparation passed.
  • All 18 changed YAML files parsed successfully.

Live Azure evidence:

  • Exact-head Android build 15156195 succeeded on 1e0a636d594127b6fbba81e85f16c28c93952201.
  • Pre-workload cleanup reclaimed the hosted agent from approximately 4.4 GB to 20 GB free, after which workload installation succeeded.
  • The first build-tasks attempt exposed an incomplete local SDK (System.IO.Pipes missing); the existing retry wiped ./.dotnet, reinstalled cleanly, and both build-tasks builds succeeded.
  • The trusted Gate result was SKIPPED because this infrastructure-only change exposed no runnable product test.
  • All structured model records were GPT-only: gpt-5.6-sol and gpt-5.3-codex. The persisted try-fix candidates were exactly gpt-5.3-codex, then gpt-5.6-sol; the raw Task 3 log contained no claude or anthropic text.
  • The expert pass found no actionable current-head defect, inline-findings.json was empty, and the submitted PR won the candidate comparison.
  • Deep Android UI validation passed 360 tests, failed 0, and skipped 7 across Button, Label, and Layout.
  • Canonical PRAgent import, deep-result import, deferred AI Summary publication against 1e0a636, stale artifact cleanup, and review-lock removal all succeeded.

Vally Fixture and others added 30 commits January 1, 2000 00:00
Squash-rebased onto latest main. Consolidates the improved-reviewer work for
the maui-copilot AzDO PR-review pipeline (definition 27723) into a single
change on top of main:

- Gate/build-tasks reliability: build-tasks failures are non-blocking and
  produce an INCONCLUSIVE gate (not a misleading FAILED); a gate TIMEOUT is
  non-blocking; INCONCLUSIVE reasons are clear and actionable.
- Inflight PRs are reviewed against the LATEST base (base merged into PR head)
  and built from the PR head, not the stale base tip.
- AI Summary posting: COMMENT verdicts update one issue comment in place
  instead of stacking; reused summary comments are un-hidden so the fresh
  summary is visible.
- "No UI test results" guidance is gate-aware: a FAILED (or unknown) gate
  points at the build/gate; an explicit PASSED/SKIPPED/INCONCLUSIVE points at
  infrastructure, so authors are not sent down the wrong path.
- Device-test runner and detection improvements supporting the deep UI stage.

Shared gh-aw review-test-failures layer (visual publishing, gather context,
workflow lock files, pat_pool docs) is kept at main's newer versions; the
gate-aware AI-summary refinements are preserved on top.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
Two reliability fixes for the maui-copilot PR reviewer:

1. Gate-log excerpt bloat (PR #36109 rendered a 75 KB summary). Format-GateLogExcerpt
   treated benign iOS/mac simulator teardown spam as "error-relevant" because every
   `dbug: ... process: Error Domain=...` line contains the substring ": Error ". Now the
   excerpt strips ANSI/VT color escapes, drops simulator runtime noise (Error Domain=,
   Failed to terminate process, Client not entitled, RBS*ErrorDomain, No such process
   found, NSUnderlyingError, runningboard, dbug/trce logging), and caps the line count.
   The raw-tail fallback is likewise ANSI-stripped and noise-filtered.

2. Previous AI Summary not marked outdated (PR #36676). The reuse+PATCH-in-place path
   relied on unminimizeComment, which MauiBot's token cannot execute (FORBIDDEN in-
   pipeline), so a summary that a prior sweep had collapsed could never be un-hidden.
   Restore the expected behavior: collapse EVERY prior AI-Summary issue comment (and
   stale reviews) as outdated using minimizeComment — which MauiBot CAN do — then post a
   brand-new comment. One visible summary above a stack of collapsed "outdated" ones.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
For a PR that adds new API AND a test referencing it in the same project, reverting
the fix un-compiles the test, so the gate can never establish a "fails without the
fix" baseline — it previously reported INCONCLUSIVE even when the fix built and every
test passed. That's an unhelpful non-verdict for legitimate new-feature PRs.

Now, when the without-fix baseline build error is in the PR's OWN detected test
(compile-coupling), the fix itself compiles, and every test runs and PASSES cleanly
WITH the fix (no env/build/filter error, no genuine failure), the gate reports a real
✅ PASSED — "Verified (new API / feature)" — with a note that the without-fix baseline
was compile-coupled. A with-fix crash/env error (e.g. #36572's SIGABRT) still keeps it
INCONCLUSIVE, so the credit only applies to a genuinely clean with-fix run.

Adds Write-MarkdownReport regression tests for both the credited PASS and the
uncredited INCONCLUSIVE paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
When the only with-fix env-class result is a brand-new VerifyScreenshot with no
committed baseline, the report already prints a dedicated, accurate snapshot note
("no baseline yet — inconclusive, not a fix failure; commit the baseline PNG"). It
ALSO printed the generic "Could not verify — environment/infrastructure error …
comment /review to retry" classification, which is wrong for this case (retrying
never creates the baseline) and makes an expected, non-failing INCONCLUSIVE look
like an infra failure. (PR #35491: new Shell.SetBackground API + a brand-new snapshot
test → compile-coupled baseline + no-baseline snapshot.)

Guard the generic env-error classification with $nonSnapshotEnvError so it fires only
when there is a real infra error (app crash / Appium flake / empty result), not a
pure snapshot-baseline case. Adds a regression test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…code build error

When the MSBuild build-server daemon is unavailable the build falls back to an
in-process build and the in-repo Maui.InTree.targets up-to-date check misfires,
reporting "required MSBuild tasks are not yet built or they are out of date" even
though the Build MSBuild Tasks step succeeded. The gate previously classified this as
a code BUILD ERROR (→ INCONCLUSIVE, but framed as if the PR's code failed to compile).
It's a gate-agent infrastructure flake — the PR's code was never actually compiled.

Detect "required MSBuild tasks are not yet built or they are out of date" / "MSBuild
server unavailable" BEFORE the generic build-error branch and classify as EnvError
(INCONCLUSIVE, retryable) with an honest "gate infrastructure, not a code build error"
message. Adds a regression test. (build 14821162, PR #36572.)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…he commenter

A /review with a non-existent pipeline branch (e.g. an old/renamed branch like
feature/enhanced-reviewer, now improved-reviewer) made the AzDO trigger step fail with
only an opaque log error — the commenter got NO feedback on the PR and assumed the
command "did nothing". (PR #34903: mattleibow's /review -b feature/enhanced-reviewer.)

- Validate the --branch exists in the repo BEFORE queuing the pipeline; on a missing
  branch, fail fast with a specific reason.
- New "Report /review trigger failure to the PR" step posts a clear WARNING comment on
  any trigger failure (bad branch → name the right branch + valid platforms; otherwise
  a transient-error retry hint), so a /review never fails silently again.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
… build error

When the gate agent's `dotnet workload restore` did not take effect, the test project
fails to build with NETSDK1147 ("the following workloads must be installed: android ...
run dotnet workload restore") for EVERY project, on BOTH the without-fix and with-fix
legs. This is a gate-agent infrastructure flake — never the PR author's code — but the
gate classified it as a code BUILD ERROR (INCONCLUSIVE framed as if the PR failed to
compile). (build 14824785, PR #36572: both legs failed with 16x NETSDK1147 each and
zero CS-errors — the android workload was simply absent.)

Detect NETSDK1147 / "the following workloads must be installed" BEFORE the generic
build-error branch and classify as EnvError (INCONCLUSIVE, retryable) with an honest
"a required .NET workload was not installed on the gate agent" message. Guarded so a
genuine CS####/MAUIX#### compile error co-occurring with NETSDK1147 still wins (real
failure never masked). Adds regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…dict exists

In the deferred Stage-3 deep-results post, the PRAgent phase content (gate/content.md,
code-review/content.md, …) can be absent even though the pipeline ran and handed us a
real trusted gate verdict — the content dir wasn't carried into the Stage-3 job, or the
earlier review phase produced no files. post-ai-summary-comment.ps1 then hard-threw
("No gate or phase content found", exit 1), which FAILED the Post stage AND posted
nothing: the Task-4 fallback notice never fires because Task-4 already deferred
(aiSummaryReviewId='DEFERRED', not empty). So the PR got no summary at all. (build
14829982, PR #36657: TRX deep results present, gate verdict INCONCLUSIVE, every phase
file "not found".)

When there is no phase content but the pipeline supplied a real trusted gate verdict,
synthesize a minimal gate section from that verdict so the PR ALWAYS gets a summary
(deep results still fold in below). Hard-throw only when there is genuinely nothing —
no phase content AND no trusted verdict (a local/manual misconfiguration).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…drops a /review

The trigger-review job did a FULL clone of the large dotnet/maui repo with only the
job's 10-min timeout to stop it. A transient network stall on that clone made the
"Checkout repository scripts" step hang until the JOB timeout CANCELLED the whole job —
silently, because a cancellation skips the downstream steps (no pipeline queued, no
notice). Observed repeatedly: #35640, and #36828 (trigger run 30647459829 cancelled at
"Checkout repository scripts").

- Shallow the checkout (fetch-depth: 1) — this job only needs .github/scripts, so it now
  completes in seconds instead of cloning full history.
- Add a per-step timeout-minutes: 4 (< the job's 10) so a rare stall becomes a proper
  step FAILURE that runs the cleanup/notice steps, instead of a job-level cancellation.
- Add a cancelled()/failure() notice step that posts a "transient infra — re-comment
  /review" warning using gh + the event payload directly (no repo scripts, which may be
  exactly what failed to check out), so a checkout hang is never silent again.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…eview

The AnalyzeCopilotTokenUsage stage is pure telemetry, but it could mark the whole
build failed when a run produced no token-usage data: on a SKIPPED-gate run the
Copilot agent consumed no tokens, so no copilot-token-usage directory was created,
and PublishPipelineArtifact failed with "Path does not exist" — reddening a build
whose review had already posted its summary fine. (build 14834473, PR #36984.)

- Always create the output dir up front so the publish never hits a missing path.
- Mark both the Aggregate step and the Publish task continueOnError:true so a missing
  artifact or transient publish error can't fail the build. The review stages
  (ReviewPR / RunDeepUITests / UpdateAISummaryComment) remain the real signal.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…(ARG_MAX)

At high deep-test failure counts the UI-failure triage prompt was passed to
copilot as a single -p argument that exceeded the OS per-argument limit
(Linux MAX_ARG_STRLEN 128KB; macOS argv+env). Build 14842388 (#36821, 311
catalyst failures) hit 'Argument list too long' -> analysis silently omitted
-> summary fell back to a raw ~1800-line TRX dump with no grouped ✗/●/ℹ triage.

- Analyze-UITestFailures.ps1: hard-cap the untrusted analysis input ($maxInputChars
  = 80000) before building the prompt, with a truncation notice. Guarantees the
  -p argument stays under the per-arg limit regardless of failure count; the
  grouped counts still reflect the full run (prep step states true totals).
- Prepare-UITestFailureAnalysis.ps1: bound the bulky failures section (per-category
  sample 25->8, error 12->6, stack 8->4 lines) so the changed-files list and diff
  always survive within the cap. A representative sample is sufficient for the
  root-cause grouping the prompt requests.
- Add Analyze-UITestFailures.Tests.ps1 pinning the cap invariant.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…o space left on device'

Build 14843877 (#36767 android) red-failed the ReviewPR/gate stage at 'Build
MSBuild Tasks' with 'No space left on device' — pure agent infrastructure, not
the PR. The existing 'Free Disk Space for Emulator' cleanup reclaims the same
hosted-tool caches but runs LATER (after this build, right before the emulator),
so it could not prevent the build from exhausting the disk.

Add an android-only pre-build cleanup step (mirrors the proven emulator cleanup)
right after 'Verify .dotnet' and before 'Build MSBuild Tasks', reclaiming the
unused Linux hosted-image caches (/usr/share/dotnet, hostedtoolcache CodeQL/go/
Python, swift, powershell, chromium) up front. Best-effort + non-blocking so
cleanup can never itself fail the review. The build uses ./.dotnet, never the
system /usr/share/dotnet (already proven safe by the later cleanup).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…stop hitting NETSDK1147

Root-caused the systemic android NETSDK1147 gate-infra flake (build 14843829 /
#36572, and many prior). Sequence: 'Install .NET and workloads' installs the
android/ios/maccatalyst workload into ./.dotnet; then 'Build MSBuild Tasks' hits
the corrupt-SDK failure (unloadable System.IO.Pipes.dll, exit 134) and, on its
retry, WIPES ./.dotnet to reinstall a clean SDK. That wipe also removes the
platform WORKLOAD, and the buildtasks reinstall (dotnet-buildtasks) restores only
the SDK — so the gate's later test build fails with NETSDK1147 ('the following
workloads must be installed: android'). That is pure GATE INFRASTRUCTURE, not the
PR, but it surfaced as an ENV/INCONCLUSIVE gate.

Fix (targeted, band-correct, idempotent):
- When the buildtasks step wipes ./.dotnet, drop a PERSISTENT marker
  (dotnet-wiped-needs-workloads) that — unlike $wipeMarker — is not cleared on
  success.
- Add a 'Restore .NET workloads if .dotnet was wiped' step right after Build
  MSBuild Tasks that, ONLY when the marker is present, re-runs the same proven
  './build.ps1 --target=dotnet' workload install (repo's pinned manifest, never a
  mismatched band) and clears the marker. The common no-wipe path pays nothing.

Also commit 9cd0ebe: free disk space BEFORE the build (android) so the gate
build stops hitting 'No space left on device' (#36767) — the other our-infra ENV
gate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…timeout as ENV, not a FAILED

Build 14844563 (#35640 android) produced a FALSE FAILED: all 17
Material3CarouselViewFeatureTests failed identically with
'OneTimeSetUp: System.TimeoutException : Timed out waiting for Go To Test button
to appear (the app did not recover after crash-recovery attempts)'. The app under
test crashed on launch and never recovered, so EVERY test failed at fixture setup
before a single assertion ran — no test actually verified anything. The agent had
also just flaked the emulator boot (240s x2), confirming infra. The gate read
'without fix=FAIL, with fix=FAIL' and concluded 'fix does not pass the tests →
FAILED', when the honest verdict is INCONCLUSIVE (the app never launched).

The existing OneTimeSetUp env-patterns (OpenQA.Selenium, 'Call InitialSetup',
'app could not be found') did not cover the crash-recovery-timeout phrasing, so
the failure fell through to a plain FAIL.

Fix: add an env-pattern matching 'the app did not recover after crash-recovery
attempts' to $envErrorPatterns. This loop is only reached when Passed=0 (the whole
fixture failed), so it can never mask a partial real failure — if any test had
launched+passed the counts are trusted instead. +2 Pester tests (the false-FAILED
case and the partial-pass guard); 33 pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…-flake 'just retry' wording

When the gate reaches INCONCLUSIVE with an APP_CRASH (the app under test SIGABRT'd/
exited mid-run), the summary told the author it is 'infrastructure, not a problem
with your PR — comment /review to retry on a fresh agent'. That is misleading for a
DETERMINISTIC crash: the gate already retries env errors up to 3x (rebooting the
device each time), so an APP_CRASH that still reaches INCONCLUSIVE has persisted
across every attempt, and a plain retry is unlikely to change it. Proven on #36572
build 14846070: the with-fix MediaPicker ProcessImage test SIGABRT'd on a FRESH
agent on all 3 attempts (non-stale logcat 12:35/12:46), while other android runs
this session ran fine — a real, reproducible native crash, not a flake.

Split the env-error classification: an APP_CRASH excerpt now gets a distinct,
non-accusatory message ('the app crashed and it persisted across every attempt; a
plain /review retry is unlikely to help; the crash is in the runtime/native libs
the test exercises OR the code under test; download the adb-logcat/bugreport to see
the native stack'). Non-crash env errors (emulator/sim boot, Appium, empty result
file) keep the transient-flake 'retry on a fresh agent' wording. Verdict is
UNCHANGED (still INCONCLUSIVE) — this only makes the explanation honest.
+1 Pester test (34 pass).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
Brand-new VerifyScreenshot tests fail with 'Baseline snapshot not yet
created' because no baseline is committed yet. These are deterministic
new-baseline results, not emulator flake. The Android per-test retry was
re-running them anyway — they can never pass without a committed baseline,
so each wasted a full re-run and could exhaust the deep category time
budget on snapshot-heavy test PRs (e.g. #36939, 322 new-baseline 'failures').
It also logged them as 'real failures'.

Exclude baseline-not-created failures from the flaky-retry set; if only
new-baseline failures remain, skip the Android retry entirely. Downstream
ci-copilot.yml already reclassifies them as 'new baseline'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
The Stage 3 deferred inline-review post was gated on the presence of
inline-findings.post.ok. That sentinel is written by the Review stage's
'Task 4: Post' step, which runs AFTER the CopilotLogs artifact is published
and is NOT included in CopilotPostLogs' PRAgent payload — so it never lands
in any artifact Stage 3 restores. The gate was therefore always false and
ALL inline comments were skipped ('No inline sentinel/findings — skipping'),
even though inline-findings.json was produced and round-tripped fine.

Derive the 'PR fix is the winner' signal from winner.json (isPRFix), which
round-trips reliably via CopilotLogs into $targetDir alongside
inline-findings.json — mirroring Review-PR.ps1's own
$isPRWinner = (-not $winner) -or ($winner.isPRFix -eq $true). The legacy
sentinel is still honored as a fast path when present, but its absence no
longer blocks. A non-PR try-fix winner (isPRFix=false) still correctly
suppresses the PR's inline findings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
A VerifyScreenshot failure 'Snapshot different than baseline: X.png (size
differs - baseline is WxH pixels, actual is WxH pixels)' means the committed
baseline PNG has different DIMENSIONS than the gate simulator's screenshot —
the baseline was captured on a different-sized device than the gate boots
(e.g. an iPhone 16 Pro 1206x2472 baseline vs the pinned iPhone 11 Pro
1124x2286). A PR *code* fix can never change screenshot dimensions, so the
same mismatch appears in BOTH the without-fix and with-fix runs and the gate
cannot A/B verify the test — it must report INCONCLUSIVE, never FAILED.

The existing guards only covered 'Baseline snapshot not yet created' and
'N% difference' residuals; a size mismatch has no percentage, so it fell
through to a genuine FAILED (build 14850018, PR #37032 iOS Issue36422).

Classify it as env/INCONCLUSIVE in both Get-TestResultFromOutput paths (the
device-test Passed:/Failed: count path and the UITest NUnit fall-through),
guarded so it only fires when every remaining failure is a size mismatch
(or size + new-baseline) — a real 'N% difference' pixel diff against a
same-size baseline is still counted as a genuine visual regression. +3 Pester
tests (37 pass).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…the other leg

A missing native shared library (libSkiaSharp/libHarfBuzzSharp .so) on the gate
agent crashes the test host before the fixed code runs, so the fix is
unverifiable via that test. The existing guard only excluded native-lib
failures present in BOTH the without-fix AND with-fix runs ($bothNativeLib). It
missed the case where the without-fix leg failed for a DIFFERENT reason — most
commonly a compile-coupled build error (new API + test in the same project, so
the reverted baseline never reached the native-lib load) — leaving the with-fix
libSkiaSharp DllNotFound counted as a genuine FAILED.

Reclassify any with-fix NativeLibLoadFailure as env/INCONCLUSIVE in the
aggregation loop (mark $w.EnvError), independent of the without-fix leg. A
genuine assertion regression never presents as a DllNotFoundException, so this
cannot mask a real failure. (build 14850956, PR #35710: GenerateSplash*
libSkiaSharp DllNotFound on the Linux android gate, without-fix compile-coupled
Passed=False/Failed=0 → wrongly FAILED.) +1 Pester test (38 pass).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
The Post AI Summary stage failed with HTTP 422 'Body is too long
(maximum is 65536 characters)' when the review body exceeded GitHub's
limit (observed on build 14857215, PR #36884). Both the issue-comment
and PR-review POST paths hit the same cap, so both the initial
REQUEST_CHANGES and the COMMENT retry were rejected and the whole
stage threw.

Cap $commentBody at 65500 chars right after it is built (the single
chokepoint feeding both POST paths): close any dangling fenced code
block so the markdown stays valid, then append a clear truncation
notice pointing to the full deep-test detail in the build artifacts.
The leading marker (used for stale-comment detection) is preserved
because only the tail is trimmed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
… for try-fix

Bump the reviewer/judge model from gpt-5.5 to gpt-5.6-sol and run it at
the longest context tier with maximum reasoning effort by passing the
copilot CLI's --context long_context and --effort max flags. Both the
main review (Review-PR.ps1's Invoke-CopilotStep) and the deep UI-failure
analysis (Analyze-UITestFailures.ps1) share the new defaults, all
env-overridable via COPILOT_REVIEW_MODEL / COPILOT_REVIEW_CONTEXT /
COPILOT_REVIEW_EFFORT.

Give Invoke-CopilotStep an optional -Model override and use it to run
the try-fix candidate-generation step (STEP 5a) on a different model
family — claude-opus-4.6 — so the alternative fixes bring genuine model
diversity instead of echoing the gpt-5.6-sol reviewer's own reasoning.
Overridable via COPILOT_TRYFIX_MODEL.

Parse-checked; Review-PR (24) and token-usage (2) Pester suites pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
Ports the review-process half of the model-policy refresh into the
reviewer branch (the gh-aw workflow model updates are intentionally NOT
included here — they live in the separate CI-workflow PR):

- Main PR reviewer + local test-fail reviewer (Review-PR.ps1,
  Review-Tests.ps1, Analyze-UITestFailures.ps1): GPT-5.6 Sol, invoked
  with --context long_context --effort max.
- Try-fix panel (pr-review skill): Claude Opus 5, Claude Sonnet 5,
  GPT-5.3-Codex, GPT-5.6 Sol — Opus 5 is one of four attempts, selected
  per-attempt by the skill (replaces the earlier single -Model override).
- MAUI expert reviewer (code-review skill): Claude Opus 5, kept on a
  different family from the Sol orchestrator to reduce correlated misses.
- Vally eval specs: GPT-5.6 Sol executors judged cross-vendor by Opus 5.

GPT-5.6 Sol is the majority working model; Opus 5 appears only as the
expert reviewer, one try-fix attempt, and cross-vendor eval judge.

Reviewer Pester suite: 26 passed. Scripts parse-check clean.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
MauiBot

This comment was marked as outdated.

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

Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0

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.

🔵 Needs a closer look

It makes broad, security- and reliability-critical changes across CI workflows, scripts, and evaluation infrastructure that warrant final human validation.

Review details
  • Files reviewed: 75/94 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Publish only the fixed review inputs and bounded diagnostics needed by downstream posting jobs so try-fix workspaces cannot inflate or poison CopilotLogs.

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

Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0

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.

🔵 Needs a closer look

It changes multiple security- and reliability-critical pipeline/script paths across AzDO and GitHub Actions, so it warrants careful human validation despite no specific issues found in the reviewed hunks.

Review details
  • Files reviewed: 76/96 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Select the Android SDK query from the checked-out branch's local tool manifest so reviewer runs work on both current and release branches without masking command failures.

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

Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0

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.

🔵 Needs a closer look

Resolve-RerunEligibility’s new PR fetch retry block still has a correctness gap (exit-code/schema validation) that can produce misleading rerun eligibility failures under transient gh api errors.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

.github/scripts/Resolve-RerunEligibility.ps1:746

  • The PR fetch retry loop ignores gh api's exit code and only checks whether the raw output starts with {. If gh returns a non-PR JSON payload (or partial output) this can still parse and later fail with misleading messages (e.g., PR is not open (state: )). Capture the exit code and validate that the parsed object has the expected PR fields before accepting it.
  • Files reviewed: 76/96 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Temporarily disable the unrelated Chrome apt source while release branches install the Microsoft JDK, then restore it even when provisioning fails. This prevents external mirror hash mismatches from aborting Android review runs.

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

Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0

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.

🔵 Needs a closer look

It touches many security- and reliability-critical pipeline/workflow paths (review triggers, artifact import/export, token hygiene, and test infrastructure) where small regressions can have outsized impact and merits a final human review.

Review details
  • Files reviewed: 76/96 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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

Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0

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 wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@kubaflo

This comment has been minimized.

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 1 findings

See inline comments for details.

New-Item -ItemType Directory -Force -Path $d | Out-Null
$d
}
if ($baseRefName -notmatch '^(main|net[0-9]+\.0|inflight/[a-z0-9][a-z0-9._-]*|release/[0-9]+\.[0-9]+\.[0-9]+xx(-[a-z0-9.]+)?)$' -or

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔍 AI-Generated Review (multi-model)

[major] Logic and Correctness — The new immutable-snapshot guard hard-rejects any valid PR target branch outside ^(main|net[0-9]+\.0|inflight/...|release/...xx...)$. Concrete failure: a PR targeting existing branches like net10.0_xcode26 or release/8.0.1 now exits Setup with Setup could not persist a validated immutable review snapshot, so /review stops before Gate/CopilotReview. If this restriction is intentional, it needs an explicit allowlist policy; otherwise broaden normalization/validation (the same restrictive pattern is mirrored in eng/pipelines/ci-copilot.yml).

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI Review Summary

@kubaflo — new AI review results are available based on commit 46a6c3d.

Gate No Tests Confidence Low Platform Android


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ⚠️ SKIPPED

No tests were detected in this PR.

Recommendation: Add tests to verify the fix using the write-tests-agent.


📋 Pre-Flight — Context & Validation

Pre-Flight: PR #38040

Context

  • Materialized review snapshot: 9bdc574703698f8da0a3a66fb0a1559cfde7b039
  • Base snapshot: 699f16e4c239cae5486c63ed472039aa5c4e6cf2
  • Feature-branch intent: Improve maui-copilot reviewer: gate & deep-stage reliability fixes
  • Metadata limitation: gh is unauthenticated and the public REST quota is exhausted, so the title/body above are taken from the original pull-ref history rather than the GitHub API.

The pull-ref history describes a long-running reviewer-infrastructure change with these core goals:

  1. Classify build-task failures and timeouts as actionable INCONCLUSIVE gate outcomes rather than misleading code failures.
  2. Review inflight PRs against the latest validated base and build from the PR head.
  3. Make AI-summary posting idempotent and gate-aware.
  4. Improve device-test detection, Android runner recovery, and bounded diagnostic handling.
  5. Keep untrusted PR code, artifacts, and credentials separated across trusted pipeline stages.

Direct Diff Inspection

The materialized patch contains 96 files (29 added, 67 modified) with approximately 24,635 additions and 1,411 deletions. The primary surfaces are:

  • eng/pipelines/ci-copilot.yml
  • .github/scripts/Review-PR.ps1
  • .github/scripts/BuildAndRunHostApp.ps1
  • .github/scripts/shared/Detect-TestsInDiff.ps1
  • .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1
  • .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1
  • Associated focused Pester tests and reviewer workflow documentation

The existing implementation uses trusted pre-merge script copies, explicit base/head resolution, bounded cross-job artifacts, token stripping around PR-controlled processes, and retry/result classification helpers. Because the PR combines many reliability mechanisms, STEP 5a will use a single coherent comparison focus: inflight/base-resolution and reviewer orchestration reliability, while requiring each model to choose a genuinely different root-cause mechanism from both the PR and earlier attempts.

Test Boundary

  • Gate: SKIPPED because no primary tests were detected. The existing gate/content.md is authoritative and must not be changed or regenerated.
  • Detected UI categories artifact: Button,Label,Layout.
  • Platform: Android.
  • Single targeted primary command for candidates: pwsh -NoProfile -Command "Invoke-Pester -Path '.github/scripts/Review-PR.Tests.ps1' -CI"
  • Mandatory regression commands supplied by the request: none.
  • Full repository, UI-category, device, and integration suites are out of scope.

Try-Fix Safety Boundary

The patch adds production/support files as well as modifying existing files. Each try-fix invocation must honor .github/.baseline-state.json: if NewFiles is non-empty, or the selected implementation needs a file outside RevertedFiles, the attempt must record Blocked, create all required artifacts, run the exact restore script, and continue without editing tracked code.


🔬 Code Review — Deep Analysis

Code Review — PR #38040

Independent Assessment

What this changes: The submitted PR substantially hardens the MAUI Copilot review pipeline: it pins trusted review infrastructure, carries immutable base/head/tree identities across phases, bounds process and artifact handling, improves gate and deep-stage failure classification, and adds focused Pester coverage for the orchestration paths.

Inferred motivation: The implementation addresses observed reviewer failures caused by mutable refs, hung child processes, incomplete phase output, unsafe cross-job artifact transfer, and ambiguous test/build results.

Expert Finding

❌ Error — Supported repository target branches are rejected

.github/scripts/Review-PR.ps1:672 and the mirrored checks in eng/pipelines/ci-copilot.yml accept only main, plain netN.0, selected inflight/*, and release/N.N.Nxx-* names. Two ordinary protected branches present on origin do not match: net10.0_xcode26 and release/8.0.1. A PR targeting either branch fails before Gate or CopilotReview, despite the rest of Setup resolving workloads and the merge base from the checked-out target tree.

The restriction is deliberate and tested, but the rationale does not establish why these safe, existing branch shapes cannot be reviewed. The correction should remain a strict syntax allowlist, update every mirrored guard, and add positive/negative tests rather than accepting arbitrary refs.

Prior Review Reconciliation

Prior top-level reviews, inline review comments, and issue comments could not be retrieved: gh is unauthenticated and the anonymous GitHub API quota is exhausted. No prior finding is silently treated as resolved.

Blast Radius Assessment

  • Runs for all instances: Yes. Target-branch validation runs before trusted Setup and blocks the entire review.
  • Startup impact: Yes. A rejected target exits before workloads, Gate, and CopilotReview.
  • Static/shared state: No application static state, but the regex is duplicated across trusted pipeline phases and must stay consistent.

CI Status

  • Required-check result: Undetermined; gh pr checks --required could not authenticate.
  • Gate result supplied by the trusted workflow: SKIPPED because no tests were detected; it was not rerun.
  • Classification: Coverage and required-check state are undetermined.
  • Action taken: Confidence is capped at low.

Failure-Mode Probing

  • Existing protected suffix branch: net10.0_xcode26 misses the plain netN.0 alternative and is rejected before Setup can persist review-snapshot.json.
  • Existing legacy release branch: release/8.0.1 misses the N.N.Nxx servicing pattern and is rejected on the same path.
  • Malicious or malformed ref: A correction must continue rejecting traversal, nested paths, uppercase/non-policy names, and refs/heads/*; accepting arbitrary Git ref text would weaken the trusted checkout boundary.
  • Mirrored-state drift: Updating only Review-PR.ps1 would still fail in the pipeline's fast-fail, base-resolution, snapshot-import, Gate, or CopilotReview guards.

External Output Contract

No external-output classifier mismatch is associated with this finding. The expert pass did not report an additional actionable producer/consumer contract defect.

Verdict: NEEDS_CHANGES

Confidence: low

Summary: The hardening approach is coherent, but the target-branch allowlist prevents reviews for safe branch families that already exist in dotnet/maui. A focused, consistently mirrored allowlist expansion with regression tests can address the issue without relaxing the trusted branch boundary; overall confidence remains low because required CI and prior reviews were unavailable and the supplied Gate was skipped.


🛠️ Try-Fix — Analysis & Comparison

STEP 5a Try-Fix Aggregate: PR #38040

Status: Complete — 2 of at most 2 candidates attempted.

Candidate 1 — Snapshot-Pinned Commit Pair

Model: gpt-5.3-codex

Approach: Capture immutable baseSha and headSha during trusted Setup, then make later phases evaluate that fixed pair without a runtime inflight merge.

Prior approach avoided: The PR's existing strategy combines trusted script copies, explicit base/head fetch and validation, an inflight merge into the review worktree, bounded artifact validators, and retry classification.

Mechanism-level difference: Pinning commit identities once would remove branch-tip drift and merge-time variability from later stages; Gate and CopilotReview would consume the same immutable pair rather than independently resolving mutable refs.

Files changed: None.

Result: Blocked

Baseline blocker: .github/.baseline-state.json contained these NewFiles, so the skill's restoration contract prohibited tracked edits:

  • eng/scripts/dismiss-apple-account-dialog.sh
  • eng/scripts/dismiss-maccatalyst-app-recovery-dialog.sh
  • eng/scripts/run-as-console-user.sh

Test command: pwsh -NoProfile -Command "Invoke-Pester -Path '.github/scripts/Review-PR.Tests.ps1' -CI"

Test result: Exit code 1; Invoke-Pester was unavailable in the environment, so no Pester summary was produced.

Failure analysis: The candidate is a design-only alternative. It cannot be classified as passing because the baseline was not safely restorable and the one permitted test command could not execute. No dependency was installed and no substitute or broader test was run.

Self-review: 0 findings; reviewer-findings.json is [].

Captured diff: Empty.

Artifacts: CustomAgentLogsTmp/PRState/38040/PRAgent/try-fix/attempt-1

Restoration: The exact command pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore completed with Restored True.

Candidate narrative: CustomAgentLogsTmp/PRState/38040/PRAgent/try-fix-1/content.md

Candidate 2 — Fail-Closed Monotonic Phase State

Model: gpt-5.6-sol

Approach: Replace independent sentinel/output inference with one trusted orchestration record whose valid transitions are INITIAL -> SETUP_READY -> GATE_COMPLETE -> REVIEW_COMPLETE. A downstream phase would accept only its exact predecessor; missing, partial, duplicated, or out-of-order state would stop as INCONCLUSIVE.

Prior approaches avoided: The design avoids both the PR's fetch/merge/retry mechanisms and Candidate 1's immutable commit-pair capture. It does not pin SHAs, relocate ref resolution, or vary the snapshot-pinning mechanism.

Mechanism-level difference: This candidate targets orchestration-state ambiguity rather than snapshot identity. Independent sentinels and output variables can expose an impossible phase combination after interruption. An exact monotonic predecessor contract makes completed preparation the admission criterion, preventing Gate or CopilotReview from evaluating a half-prepared worktree.

Planned file: eng/pipelines/ci-copilot.yml

Files changed: None.

Result: Blocked

Baseline blocker: .github/.baseline-state.json again contained the same non-empty NewFiles array:

  • eng/scripts/dismiss-apple-account-dialog.sh
  • eng/scripts/dismiss-maccatalyst-app-recovery-dialog.sh
  • eng/scripts/run-as-console-user.sh

Test command: pwsh -NoProfile -Command "Invoke-Pester -Path '.github/scripts/Review-PR.Tests.ps1' -CI"

Test result: Exit code 1; Invoke-Pester was unavailable. No Pester tests ran, no dependency was installed, and no correction/retest was attempted.

Failure analysis: The proposal remains design-only because tracked edits were prohibited by the restoration boundary and the sole allowed test command could not execute. It therefore cannot be classified as passing.

Self-review: 0 findings; reviewer-findings.json is [].

Captured diff: Empty.

Artifacts: CustomAgentLogsTmp/PRState/38040/PRAgent/try-fix/attempt-2

Restoration: The exact command pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore completed with Restored True.

Candidate narrative: CustomAgentLogsTmp/PRState/38040/PRAgent/try-fix-2/content.md

Candidate Comparison

Candidate Model Root-Cause Hypothesis Result Empirical Evidence
Snapshot-pinned commit pair gpt-5.3-codex Mutable ref resolution and runtime merge timing can change the evaluated code pair Blocked No diff; Pester unavailable
Monotonic phase state gpt-5.6-sol Interrupted independent outputs can expose incomplete or impossible orchestration state Blocked No diff; Pester unavailable

Selected Fix: None. Both alternatives are mechanism-level distinct, but neither was safely implementable or testable under the required baseline and test-command contracts. STEP 5b must compare them as unvalidated design candidates only.

Aggregate Failure Analysis

The blocker is deterministic rather than candidate-specific: the materialized PR contains added production/support files that EstablishBrokenBaseline.ps1 cannot safely restore, and the only permitted Pester command is unavailable in this environment. Both attempts honored the fail-safe boundary, produced empty diffs and clean no-diff self-reviews, and restored the baseline with Restored True. No gate, broad suite, substitute test, package installation, cross-pollination, or extra agent pass was run.


🏁 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Winner

pr-plus-reviewer is the strongest candidate. It preserves the submitted PR's comprehensive reliability and security hardening while correcting the expert-confirmed target-branch allowlist gap with a narrow, consistently mirrored change and focused positive/negative tests.

Comparative Ranking

Rank Candidate Implementation Regression evidence Assessment
1 pr-plus-reviewer Concrete 4-file patch on the submitted PR Required Pester command was blocked because Invoke-Pester is unavailable; no tests ran Resolves the expert finding while preserving strict ref validation; best available candidate, with validation uncertainty recorded
2 pr Complete submitted 96-file change Trusted Gate was SKIPPED; required-check state could not be retrieved Broad hardening is coherent, but existing protected targets net10.0_xcode26 and release/8.0.1 are rejected before review
3 try-fix-1 No diff; design-only immutable commit-pair proposal Blocked by baseline restoration rules and unavailable Pester Distinct idea, but it cannot beat an implemented candidate without code or empirical evidence
4 try-fix-2 No diff; design-only monotonic phase-state proposal Blocked by baseline restoration rules and unavailable Pester Also distinct, but more invasive conceptually and unsupported by an implementation or test result

No candidate obtained a passing regression run. The exit-code-1 results for pr-plus-reviewer and both try-fix attempts are environment/tooling blocks, not observed regression-test failures, because Pester never started test discovery. Accordingly, no candidate is credited with a pass and none is demoted as having failed an executed regression test.

Why the Submitted PR Needs the Winning Change

The submitted allowlist is duplicated in the trusted Setup script and five pipeline admission/consumer guards. It intentionally rejects arbitrary refs, but it also excludes two safe branch families that exist on origin. The winner expands only those syntactic families:

  • netN.0_<lowercase-safe-suffix>
  • release/N.N.N

Traversal, nested paths, uppercase suffixes, empty suffixes, refs/heads/*, and non-versioned release names remain rejected. Tests exercise both the newly accepted examples and unsafe near-misses.

Evidence and Uncertainty

  • The single expert-review path produced one major correctness finding in .github/scripts/Review-PR.ps1:672; it is also present in mirrored pipeline guards.
  • Candidate git diff --check passed.
  • The exact required targeted validation command was run once from the prescribed sandbox and could not execute because Pester is absent.
  • The trusted Gate was SKIPPED, and GitHub required checks plus prior review surfaces were unavailable through both unauthenticated gh and the exhausted anonymous API quota.

The submitted PR should incorporate pr-plus-reviewer/reviewer.patch and obtain a real Pester/CI run before approval.


📱 UI Tests — Button,Label,Layout

Detected UI test categories: Button,Label,Layout

✅ Deep UI tests — 362 passed, 0 failed, 7 skipped across 3 categories on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Button 72/74 (2 skipped) ✓ —
Label 97/99 (2 skipped) ✓ —
Layout 193/196 (3 skipped) ✓ —
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)

🧭 Next Steps — reviewer changes required

The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.

Why: The reviewer-enhanced PR preserves the submitted hardening while narrowly admitting two safe target-branch families already present in the repository. It resolves the expert finding with synchronized guards and focused tests, although Pester was unavailable for the required validation run.

Address the actionable findings in this review before merging.

@kubaflo

kubaflo commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

@dalexsoto stamp

@dalexsoto dalexsoto 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.

Stamping as requested by @kubaflo; no code review performed.

This branch had an error being deployed

1 failed deployment
copilot-pat-pool — 46a6c3dd Deployed Sep 9, 2026 by kubaflo via evaluate (try-fix) #22581
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 s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants