Skip to content

[automated] Merge branch 'main' => 'net11.0' - #38648

Closed
github-actions[bot] wants to merge 10 commits into
net11.0from
merge/main-to-net11.0
Closed

github-actions[bot] wants to merge 10 commits into
net11.0from
merge/main-to-net11.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

I detected changes in the main branch which have not been merged yet to net11.0. I'm a robot and am configured to help you automatically keep net11.0 up to date, so I've opened this PR.

This PR merges commits made on main by the following committers:

  • kubaflo
  • HarishKumarSF4517
  • albyrock87
  • praveenkumarkarunanithi
  • PureWeen
  • Vignesh-SF3580
  • TamilarasanSF4853
  • dotnet-maestro[bot]

Instructions for merging from UI

This PR will not be auto-merged. When pull request checks pass, complete this PR by creating a merge commit, not a squash or rebase commit.

merge button instructions

If this repo does not allow creating merge commits from the GitHub UI, use command line instructions.

Instructions for merging via command line

Run these commands to merge this pull request from the command line.

git fetch
git checkout main
git pull --ff-only
git checkout net11.0
git pull --ff-only
git merge --no-ff main

# If there are merge conflicts, resolve them and then run git merge --continue to complete the merge
# Pushing the changes to the PR branch will re-trigger PR validation.
git push https://github.com/dotnet/maui HEAD:merge/main-to-net11.0
or if you are using SSH
git push git@github.com:dotnet/maui HEAD:merge/main-to-net11.0

After PR checks are complete push the branch

git push

Instructions for resolving conflicts

⚠️ If there are merge conflicts, you will need to resolve them manually before merging. You can do this using GitHub or using the command line.

Instructions for updating this pull request

Contributors to this repo have permission update this pull request by pushing to the branch 'merge/main-to-net11.0'. This can be done to resolve conflicts or make other changes to this pull request before it is merged.
The provided examples assume that the remote is named 'origin'. If you have a different remote name, please replace 'origin' with the name of your remote.

git fetch
git checkout -b merge/main-to-net11.0 origin/net11.0
git pull https://github.com/dotnet/maui merge/main-to-net11.0
(make changes)
git commit -m "Updated PR with my changes"
git push https://github.com/dotnet/maui HEAD:merge/main-to-net11.0
or if you are using SSH
git fetch
git checkout -b merge/main-to-net11.0 origin/net11.0
git pull git@github.com:dotnet/maui merge/main-to-net11.0
(make changes)
git commit -m "Updated PR with my changes"
git push git@github.com:dotnet/maui HEAD:merge/main-to-net11.0

Contact .NET Core Engineering (dotnet/dnceng) if you have questions or issues.
Also, if this PR was generated incorrectly, help us fix it. See https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.

dotnet-maestro Bot and others added 10 commits September 14, 2026 14:18
This pull request updates the following dependencies

[marker]: <> (Begin:a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95)
## From https://github.com/dotnet/xharness
- **Subscription**:
[a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95](https://maestro.dot.net/subscriptions?search=a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95)
- **Build**:
[20260911.1](https://dev.azure.com/dnceng/internal/_build/results?buildId=3072980)
([331573](https://maestro.dot.net/channel/2/github:dotnet:xharness/build/331573))
- **Date Produced**: September 11, 2026 11:35:21 AM UTC
- **Commit**:
[cf433ea2eff13305b60c8871a03115b1dbb600f8](dotnet/xharness@cf433ea)
- **Branch**: [main](https://github.com/dotnet/xharness/tree/main)

[DependencyUpdate]: <> (Begin)

- **Dependency Updates**:
  - From [11.0.0-prerelease.26451.1 to 11.0.0-prerelease.26461.1][1]
     - Microsoft.DotNet.XHarness.CLI
     - Microsoft.DotNet.XHarness.TestRunners.Common
     - Microsoft.DotNet.XHarness.TestRunners.Xunit

[1]: dotnet/xharness@1fc9369...cf433ea

[DependencyUpdate]: <> (End)


[marker]: <> (End:a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95)

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…ests failure (#38564)

This PR addresses UI test failures in the main branch caused by this PR
#38381. It also includes updates to
improve rendering and test stability across platforms.
<img width="733" height="257" alt="image"
src="https://github.com/user-attachments/assets/51c50316-b906-42fd-b4ee-9117c18ce47b"
/>


**Test reliability and feedback improvements:**

* Added a `Label` (`statusLabel`) to `Issue33287MainPage` to display
status updates about the alert request, making it easier to observe the
test's progress and results.
* Updated navigation and alert logic so that when navigating to
`Issue33287SecondPage`, a callback updates the status label as the alert
request is created and returned, improving visibility into the test
flow.

**Code simplification and modernization:**

* Refactored `Issue33287SecondPage` to remove the internal button field
and use a constructor parameter for status updates, and replaced the
delayed alert logic with a property change handler that triggers the
alert when the page is detached.
* Removed unnecessary `using System.Threading.Tasks;` and added `using
System.ComponentModel;` for property change handling.

**Test assertion enhancements:**

* Updated the test in `Issue33287.cs` to assert that the status label
reflects the alert request and that the app remains responsive,
providing more robust and meaningful test coverage.

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…dapterPositions (#38598)

<!-- 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!

### Issue Details
The GroupedCollectionViewRemovalsUseCurrentAdapterPositions test is
failing on iOS when running with CollectionView1 (CV1). The test was
checked locally, and the crash can be reproduced with CV1. The same test
scenario works properly with CollectionView2 (CV2). The PR changes are
related to Android, while this test failure occurs only with iOS CV1.

This test was added in #38486

### Root Cause
The test scenario causes an existing crash with CollectionView1 (CV1) on
iOS. During the investigation, it was also found that the
GroupFooterTemplate used in the sample contributes to the CV1 crash. The
same scenario works correctly with CV2. The same behavior was reproduced
with MAUI 10.0.0 without the PR changes, confirming that the failure is
not related to this PR.

### Description of Change
Updated the test to run only with CollectionView2 (CV2). This avoids the
existing CV1-specific failure on iOS while continuing to validate the
intended grouped CollectionView item removal scenario.

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- 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!

### Description of Change

Limits skill evaluation specs to the workflow-owned executor and
supported model configuration. The preparer now rejects alternate
executor shapes, provider and plugin mapping keys at any depth, and
combined `defaults` plus legacy `config`, while allowing the same words
in prompt and rubric text.

Adds focused preparer coverage for accepted and rejected configuration
shapes and workflow structure coverage confirming validation completes
before token selection and evaluation steps.

### Validation

- Preparer test suite: 80 runs, 462 assertions
- Preparer validation across all current evaluation spec directories
- Strict Vally 0.14.0 lint across all 16 evaluation specs

### Issues Fixed

N/A

Co-authored-by: PureWeen <223556219+Copilot@users.noreply.github.com>
…and Project Details (#38595)

> [!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!

### Issue Details
VoiceOver on macOS does not announce the ComboBox control type or its
initial "Collapsed" state when initially navigating to the Project and
Category pickers in the .NET MAUI mobile project template
(DeveloperBalance).
Unknown
On initial linear navigation (`Control + Option + Right Arrow`),
VoiceOver reads only the control's descriptive label without indicating
that it is an expandable ComboBox or that its current state is
collapsed.

### Root Cause
In earlier versions, static semantic properties
(`SemanticProperties.Description` and `SemanticProperties.Hint="State
Collapsed"`) were assigned to the parent `SfTextInputLayout` container.
The regression was introduced in PR #32286 , which attempted to make
state announcements dynamic by removing the static `"State Collapsed"`
hint and relying exclusively on `SemanticScreenReader.Announce`
triggered via `Picker.IsOpen` property changes.
Because synthetic announcements only fire on value changes, no state
announcement was produced when the control initially received focus.

### Description of Change

Appended State Collapsed directly to the `SemanticProperties.Hint` of
each native Picker on both the Project Details and Task Details pages.
Kept `SfTextInputLayout` responsible solely for visual presentation and
floating labels.
Preserved existing bindings, commands, and dynamic expansion
announcements from PR #32286 while ensuring the initial resting state is
exposed to platform accessibility APIs.

### Why Tests Were Not Added

This issue requires manual accessibility validation using platform
screen readers (macOS VoiceOver and Android TalkBack) to verify focus
traversal and spoken announcements. Because these accessibility
announcements cannot be reliably validated via automated UI/unit tests,
manual verification was performed across macOS, Android, and Windows.

### Issues Fixed
Fixes #36471 

### Screenshots

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/8ab47eea-6061-4fcb-9780-e8eea0c4e785">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/b5d23234-2423-43fc-b3cb-915b14e73cd7">
|
…ized by its parent layout (#38599)

### Description of Change

On iOS, a `ScrollView` whose frame is resized by its parent layout in
the same pass in which its content becomes taller than the viewport ends
up **scrolled by half the resize delta**, so the page appears with the
first item partially hidden. The common shape is a bound page: a `Grid`
(`Auto,*,Auto`) with the `ScrollView` in the star row, whose content
*and* an Auto-row footer arrive from the ViewModel after the page is
already on screen — the footer grows, the star row shrinks, the content
grows, and the ScrollView lands at e.g. offset 18 instead of 0 (content
`Padding` 8 + item `Margin` 8 + stroke 2 scrolled away).

**Cause.** `ViewHandlerExtensions.PlatformArrangeHandler` arranges views
by setting `Center` and then `Bounds` (rather than `Frame`, so
non-identity transforms keep working). On a `UIScrollView`,
`Bounds.Origin` *is* the content offset, and UIKit re-derives it inside
`setBounds:` when the size changes — it keeps the content under the
view's center stable, i.e. it scrolls by half the delta. A KVO observer
on `contentOffset` captured the move exactly there:

```
offset->17.0 bounds=(0.0,17.0,691.0) contentSize=725.0
  at UIKit.UIView.set_Bounds(CGRect)
  at Microsoft.Maui.ViewHandlerExtensions.PlatformArrangeHandler(IViewHandler, Rect)   ViewHandlerExtensions.iOS.cs:158
  at Microsoft.Maui.Handlers.ViewHandler`2.PlatformArrange(Rect)
  at Microsoft.Maui.Controls.ScrollView.ArrangeOverride(Rect)
  at Microsoft.Maui.Layouts.GridLayoutManager.ArrangeChildren(Rect)
  at Microsoft.Maui.Platform.MauiView.LayoutSubviews()
```

The arrange defect itself is old: the fixture fails identically on the
`10.0.90` (SR9), `10.0.100` and `10.0.101` sources, so it is not a
regression of the recent ScrollView changes. What changed in SR10 is
*reachability*: #32267 made
`MauiScrollView.InvalidateMeasure(isPropagating: true)` return `true`,
so a content change inside a ScrollView now propagates measure
invalidation to its ancestors (needed so a content-sized ScrollView
shrinks when children are removed). Before SR10 the ScrollView was a
propagation barrier and a bound page's content arrival never re-laid-out
the page; since SR10 it does — and a page host that applies insets or
chrome on every layout pass (a custom scaffold, say) can then resize the
ScrollView in the very pass its content grows. That is why an app can be
clean on SR9 and hit this on SR10/SR11 with no code change of its own;
the fixture forces the resize explicitly (a bound footer growing with
the content) so it reproduces on every version.

**Fix.** Arranging a scroll view must never scroll it.
`ScrollViewHandler.PlatformArrange` (iOS) — the call through which a
parent layout resizes the scroll view — now remembers the content offset
before the base arrange and puts it back if UIKit moved it, clamped to
the range the new size currently allows. The clamp is the same
inset-aware range `ScrollToAsync` already uses
(`ClampToScrollableRange`, shared with `GetTargetContentOffset`: rest is
`-AdjustedContentInset`, the maximum extends past the arranged extent by
the trailing inset). Kept in the ScrollView handler rather than the
generic arrange helper or a `Bounds` override on `MauiScrollView`: it is
scroll-view-specific, only the arrange path is affected, and UIKit
implements `contentOffset` through `setBounds:` so an override there
would sit on every scroll frame. A view the user had scrolled keeps its
position across a resize, exactly as UIKit's own `setFrame:` semantics
would. Side effect worth knowing: in the affected pass `Scrolled` is
raised twice (UIKit's spurious move, then the restore) — the final state
is correct, whereas before the fix the spurious one was raised and
*kept*.

No public API change beyond the `PlatformArrange` override itself.

### Workaround for affected versions

The override is public, so an app (or a library hosting pages) can apply
the same correction without waiting for the fix, by registering a
handler subclass on iOS/MacCatalyst:

```csharp
#if IOS || MACCATALYST
using CoreGraphics;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;

public class OffsetPreservingScrollViewHandler : ScrollViewHandler
{
    public override void PlatformArrange(Rect rect)
    {
        var scrollView = PlatformView;
        var offset = scrollView.ContentOffset;

        base.PlatformArrange(rect);

        if (scrollView.ContentOffset == offset)
            return;

        // Restore the offset the arrange found, kept inside the range the new size allows
        var inset = scrollView.AdjustedContentInset;
        var bounds = scrollView.Bounds;
        var contentSize = scrollView.ContentSize;
        var minX = -(double)inset.Left;
        var minY = -(double)inset.Top;
        var maxX = Math.Max(minX, contentSize.Width + inset.Right - bounds.Width);
        var maxY = Math.Max(minY, contentSize.Height + inset.Bottom - bounds.Height);
        scrollView.ContentOffset = new CGPoint(
            Math.Clamp((double)offset.X, minX, maxX),
            Math.Clamp((double)offset.Y, minY, maxY));
    }
}
#endif
```

```csharp
// MauiProgram.cs
builder.ConfigureMauiHandlers(handlers =>
{
#if IOS || MACCATALYST
    handlers.AddHandler<ScrollView, OffsetPreservingScrollViewHandler>();
#endif
});
```

Notes: it clamps against `ContentSize` rather than the internal arranged
extent, which is equivalent for this purpose; it replaces the ScrollView
handler globally, so combine it with any custom ScrollView handler the
app already registers; and once on a fixed version it becomes a harmless
no-op that can be removed. Merely deferring the content population to a
later tick than other layout changes also avoids the coincidence in
plain layouts, but is not reliable under hosts that re-apply insets on
every layout pass.

### Note on #32267 — the enabler, and why it deserves a different
approach

#32267 is what made this reachable from SR10 on, and we think its
approach should be revisited on `main`, independently of this fix.

**What it set out to do is legitimate.** A ScrollView *sized by its
content* — a `StackLayout` child, an `Auto` row, `VerticalOptions=Start`
— must make its parent re-measure when its content shrinks, or it keeps
blank space at the bottom (#32221, #20586, #34536).

**How it did it is the problem.** `MauiScrollView` was deliberately a
measure-invalidation *barrier* (`InvalidateMeasure(isPropagating: true)`
returned `false`; the surrounding code still says "Invalidation stops at
`UIScrollView`s for performance reasons"), and it already had the
targeted escape hatch for the content-sized case: `LayoutSubviews` calls
`InvalidateAncestorsMeasures()` when `ContentSize` changes. #32267's
diff is a single line that flips the barrier off unconditionally
(`return true`), so **every** invalidation raised anywhere inside a
ScrollView now walks up and re-measures the entire page, regardless of
whether the ScrollView's size can even change.

**Performance cost.** A ScrollView in a star row, in `Fill`, or with an
explicit size is fully constrained by its parent: its ancestors can
learn nothing from its content changing, yet since SR10 each such change
— a bound list populating, a `Label` text update, every keystroke in an
`Entry` or `Editor` inside the scroll view — invalidates and re-measures
the page above it. The scroll view is the single most common container
for content-heavy pages, so this is paid constantly, on the main thread,
for no layout result. The old barrier existed precisely to avoid that.

**Correctness cost.** Turning arbitrary content changes into page
re-layouts is what creates the coincidence this PR fixes: a page host
that applies insets or chrome on each layout pass now resizes the
ScrollView in the very pass its content grows. The arrange defect
predates SR10, but SR10 is what makes ordinary bound pages hit it.

**What the fix should have been.** The reported root cause was that, on
the first pass after removing children, `CrossPlatformMeasure` returned
the ScrollView's current size, so `ContentSize` did not change and the
existing `InvalidateAncestorsMeasures()` never fired. The proportionate
fix addresses *that*: propagate only when the ScrollView's own measured
size can actually change — i.e. when it is not size-constrained by its
parent — and/or when its measured size differs from what the parent last
measured. That keeps the content-sized case correct while leaving the
barrier in place for every constrained ScrollView, which is the
overwhelmingly common one. We would suggest reverting the unconditional
`return true` in favour of such a condition as a follow-up on `main`; it
is out of scope for a servicing fix, and this PR is deliberately
independent of it — it fixes the arrange defect regardless of what
triggers the resize.

Separately, the XML doc on
`IPlatformMeasureInvalidationController.InvalidateMeasure` in
`MauiScrollView` says the return value means "stop propagating", while
the walk in `ViewExtensions.InvalidateAncestorsMeasures` treats `true`
as "keep propagating". The doc is inverted and worth a one-line
correction — it makes changes like #32267 easy to misjudge.

### Issues Fixed

Reported against 10.0.101 (page hosted in a custom scaffold with bound
content). Reproduces with plain `NavigationPage` + `Grid`.

### Tests

`ScrollViewInitialOffsetInGridRow` (iOS + MacCatalyst): a pushed,
edge-to-edge page with a `Grid Auto,*,Auto`, the `ScrollView` in the
star row, content `VerticalStackLayout Padding=0,8` whose first child is
a `Border Margin=16,8`, in five cases — static vs. async content
(content and a footer banner arriving together after appearing) × with
vs. without a header row (the latter puts the ScrollView under the
status bar, so the top inset is non-zero), plus a guard where the
content is tall and laid out from the start and only the footer grows
later: an ordinary resize of a laid-out scroll view does not scroll it
(verified without the fix), and the restore must keep it that way. The
page instruments the native `UIScrollView` (offset,
adjusted/content/safe insets, content size, bounds, content frame,
`ScrollY`) and, via KVO, the managed stack of the first offset move, so
a failure names its cause. Oracles: native offset `==
-AdjustedContentInset.Top` and `ScrollY == 0` once the content is laid
out; and, Appium-side, the first item's top exactly 16 below the
ScrollView's visible top.

Results on this commit (iOS simulator, iPhone 11 Pro):

- with the fix: **5/5**; `Issue36801` + `Issue36801DeferredElement` +
`ShellFlyoutHeaderScrollViewContent` suites **12/12**
- with the fix reverted (pristine sr11): `AsyncContentWithHeader`
**fails** at `offset=18` (36pt footer growth, halved); the same case
fails identically against the `10.0.90`, `10.0.100` and `10.0.101`
sources for `src/Core/src` + `src/Controls/src/Core`
- with the fix reverted and `ScrollEventProxy` + `NotifyInsetsChanged`
disabled: still fails with the same `set_Bounds` stack, `ScrollY` left
at 0 while the native offset is 18 — those paths only report the offset
- `StaticContentResizedLater` passes with and without the fix (the
guard)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------
Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
…38621)

This PR addresses UI test failures in the main branch caused in this PR
#38599. And it updates the
`AssertRestsAtTop` test method to improve platform-specific handling for
iOS devices. The main change is that the calculation and assertion logic
for verifying the top position of the first item in the `ScrollView` is
now only applied when running on iOS, ensuring more accurate and
relevant test behavior for that platform.

**Platform-specific test logic:**

* In `ScrollViewInitialOffsetInGridRow.cs`, the calculation and
assertion for the first item's top position relative to the `ScrollView`
are now executed only for iOS devices, with updated comments clarifying
the logic and rationale for this conditional handling.

**Cause:** On Mac Catalyst, Appium element rectangles use desktop screen
coordinates, which cannot be reliably combined with UIKit’s
AdjustedContentInset. This caused false failures in the visual geometry
assertion.
**Fix:** Restrict the geometry assertion to iOS. Mac Catalyst continues
to validate the behavior using the native ContentOffset and managed
ScrollY checks reported by the HostApp.

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
#38575)

<!-- 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!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

Fixes confirmed test-isolation and integration-harness defects found
while investigating recent `maui-pr` failures on `main`:

- Restore `MainThreadStaticStateCollection` with `DisableParallelization
= true`. Its deletion left the existing collection attributes without
cross-collection isolation, allowing MainThread bridge tests to race
other tests that create a `MauiApp`.
- Update `MSBuild.StructuredLogger` from `2.2.158` to `2.3.246` to fix
the property-reassignment reader crash that masked the original Android
build timeout.
- Report incomplete binlogs without replacing the original build
failure. Use `Replay` with its actual truncation status and explicitly
propagate reader exceptions; retain errors read before the truncation.
Authoritative warning validation rejects incomplete logs, including
truncation after `BuildFinished` during the embedded import archive or
before the final end marker.
- Initialize StructuredLogger message resources explicitly before
`Replay`, which otherwise fails on property reassignment in a fresh
process. `ReadRecords` initializes them but does not populate
`HasEncounteredTruncation`, so merely checking that flag after
`ReadRecords` is insufficient.
- Terminate timed-out command process trees, preserve the emulator's
intentional startup-capture keep-alive behavior, and bound output
draining so inherited pipes cannot hang cleanup. Timeout and drain
diagnostics fall back to the console when no test output helper is
supplied.
- Add eleven harness regression cases and document the timeout/binlog
behavior and workload-free test command. Tests that capture the
process-wide console run in a nonparallel collection.

### Issues Fixed

- [Main build
1595566](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1595566):
intermittent `InvokeOnMainThreadAsync_Action_WorksThroughBridge` failure
with `NotImplementedInReferenceAssemblyException`.
- [Main build
1597559](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1597559):
the .NET 9 Debug Android template hit its 1,800-second build timeout,
after which binlog parsing threw `ArgumentNullException` and obscured
the underlying failure.

**Scope limitation:** this PR does not establish or fix the cause of the
underlying Android SDK `BuildApk` packaging hang. It fixes the proven
isolation, process-cleanup, and diagnostic defects; it does not claim
that all main-branch CI failures are resolved. The invalid Android tools
ZIP in build 1595566 was a separate provisioning failure and is not
changed here.

### Validation

- Current integration-harness regressions: **11 passed** in both Debug
and Release, .NET SDK 10.0.100 on macOS ARM64.
- Before the review fixes, the two late-truncation cases and no-helper
timeout diagnostic case failed against the previous PR head; all now
pass. The late-truncation fixtures retain `BuildFinished` from a real
MSBuild binlog and cut either inside its embedded archive or immediately
before its end marker.
- Verified property-reassignment parsing separately in a fresh test
process to rule out resource initialization by another test.
- Committed inherited-pipe regression verifies the parent exits
normally, the child remains alive, and output draining returns within
the bound and emits a diagnostic. Existing cases cover timeout
process-tree cleanup and explicit keep-alive behavior.
- MainThread bridge tests: **13 passed**. Coupled Core test slice: **112
passed**, with **20/20 repeated runs clean** (unchanged since initial
validation).
- Initial revision: replayed the actual failing CI binlog to reproduce
the old reader's `ArgumentNullException` and confirm incomplete-log
diagnostics and strict warning rejection after the fix.
- Previous PR revision passed [maui-pr build
1598385](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1598385).
CI for the review revision is being rerun; no result is claimed yet.
- The full Core suite has not been rerun locally, and the underlying
Android packaging hang has not been reproduced end-to-end.

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

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

<!-- 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!

### 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:

- #36293 - `SKIPPED` (was false `INCONCLUSIVE`)
- #36114 - `PASSED` with a report written (was `PASSED` plus a warning)
- #35892 - `INCONCLUSIVE` with "Pre-existing build failure" headline
(was mislabeled "Fix does not compile")
- #27477 - helper excluded, two real tests detected, and relaxed-verdict
re-validation
- #37949 and #37960 - numeric `inflight/10.0.101` base accepted and
resolved to the expected base SHA

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.

---------
Reset patterns:
- global.json
- NuGet.config
- eng/Version.Details.xml
- eng/Versions.props
- eng/common/*

@dotnet-policy-service dotnet-policy-service Bot 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.

Auto-approved automated inter-branch merge.

@kubaflo kubaflo closed this Sep 18, 2026
auto-merge was automatically disabled September 18, 2026 22:51

Pull request was closed

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants