You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add deterministic UI evidence measurements for pull requests - #38533
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
Adds manual, local, deterministic PR UI-evidence measurements for Android and Windows. Explicitly invoke the check-pr-ui-evidence Copilot skill with a repository/PR, pinned base/head/trusted-harness revisions, selected scenario and owned local target.
The skill orchestrates trusted scripts; no model decides the measurement results. The optional manual interpretation skill is isolated in stacked draft #38534. Neither UI-evidence PR depends on the performance-analyzer implementation.
No UI-evidence Azure pipeline, GitHub workflow, slash-command trigger, PAT pool, OIDC configuration, automatic comment, or automatic merge decision is included. The earlier hosted implementation was removed by the manual-local refactor; no pipeline needs to be registered.
Local measurement flow
Pinned identities and trusted scenario selection -> separate base/head builds using the same opt-in HostApp harness -> complete app-directory inventories -> base-1, head-1, head-2, base-2 captures on one explicit target -> separate trusted comparison -> sealed local evidence bundle.
The default-off HostApp fixtures cover layout-controls-smoke and collectionview-smoke. Appium supplies native assertions/screenshots; pinned DevFlow supplies supporting tree/layout evidence. Normal HostApp behavior is unchanged unless UI evidence is enabled. No shipping framework API is added.
The implementation includes .github/skills/check-pr-ui-evidence, its local workflow reference, docs/ui-evidence.md, eng/scripts/*UiEvidence*, the trusted scenario/DevFlow configuration, opt-in HostApp fixtures, and the runner/comparison regression tests.
Review fixes
Redirected stdout and stderr are drained concurrently under one deadline that also covers pipe completion. Timeouts/cancellation and non-cancellation read faults clean up the still-running owned process tree. Read faults propagate promptly rather than waiting for a timeout; infrastructure and cleanup failures remain explicit.
App, bundle and DevFlow source inventories include hidden files/directories. Traversal, rooted paths and reparse points are rejected; packaging/capture/comparison preserve existing sessions instead of recursively deleting their output paths.
Registry bytes must match the request hash before packaging, capture and comparison. Filename-only comparison outputs are normalized and regression-covered.
Android requires an explicit serial used consistently by adb and Appium's udid capability. Shared options send udid only for Android/iOS, never Windows or Mac Catalyst. DevFlow forwarding uses --no-rebind and only removes a forward created by this run.
Windows refuses a pre-existing same-name app rather than terminating it. The Appium helper refuses occupied ports, binds localhost, and records PID plus start time; cleanup refuses stale/mismatched ownership records. Failed-startup cleanup always attempts disposal and reports secondary failures without replacing the primary startup error.
Canonical main was merged without rewriting published history. The fork-validation infrastructure prerequisite is separate: #38745. It is not copied into this measurement PR.
Validation
37 runner/comparison tests passed with dotnet test src\Controls\tests\UiEvidence.Runner.Tests\Controls.UiEvidence.Runner.Tests.csproj --no-restore. The platform matrix reproduced the unsupported-platform capability regression before the fix; a real decoder fault verifies prompt non-cancellation child cleanup.
4 Pester startup fault-injection cases passed, including termination failure, wait failure, disposal failure, and successful cleanup while the caller treats warnings as errors.
A real, isolated, repository-pinned Appium 2.17.1 server passed start/readiness, occupied-port refusal, PID/start-time-checked shutdown, and released-port verification. No native app was launched.
Changed C# files were formatted with the UI-evidence solution; git diff --check passed.
These tests use synthetic evidence and owned local child processes/listeners. They do not establish a live Appium/DevFlow device comparison, red-to-green product evidence, or cloud deployment.
Interpretation and limits
This is advisory smoke evidence, not a merge gate or whole-PR regression assurance. The scenarios cover initial state, not navigation, gestures, grouped-item mutations, FlexLayout-specific behavior, iOS or Mac Catalyst. Missing, sampled, unstable or incompatible evidence remains explicit/inconclusive. Windows absence-of-change remains inconclusive because app and driver share an identity.
A consistent seal detects integrity/identity mismatches but does not authenticate third-party artifacts or prove isolated execution. PR-controlled builds/apps require an appropriately isolated local environment; removing environment tokens is not a workstation sandbox.
CI prerequisite
The existing fork pull_request_target checkout refusal requires the independently reviewed base-workflow fix in #38745 to land before a fresh validation can use it. Green local tests do not claim that this base-branch blocker is resolved.
Issues Fixed
No product issue is closed. Historical PR #38341 was a selection/request-generation input, not proof that these smoke scenarios reproduce or fix its product issue.
The comparison metric above uses Channels.All, but MagickNetVisualDiffGenerator creates the attached diff with Channels.Red (src/TestUtils/src/VisualTestUtils.MagickNet/MagickNetVisualDiffGenerator.cs:25). A change confined to green/blue channels can therefore produce change-detected while the sealed *-diff.png is blank, making the evidence artifact inconsistent with the reported result. Generate the diff with the same all-channel metric or use a matching comparison metric. src/Controls/tests/UiEvidence.Runner/UiEvidenceCompareCommand.cs:272
The Coverage value is persisted in SafeLayoutEvidence but is not checked here. The stable comparison fixture writes "partial" coverage and is still accepted as complete, while the documentation says sampled/insufficient coverage cannot produce an absence-of-change conclusion. A partial layout can therefore contribute findings or allow Android no-difference-observed; require the DevFlow coverage value that denotes complete coverage and add a regression case for partial coverage.
App, bundle, and DevFlow source inventories now use the shared hidden-aware, link-rejecting traversal. Sealing includes hidden entries, and validation rejects hidden additions or modifications. The expanded PowerShell contracts exercise these cases.
The Appium helper now refuses an occupied port using an exclusive reservation check instead of adopting a responding service. It binds localhost and records PID plus start time; cleanup rejects mismatched ownership. Contracts verify occupied-port refusal and preservation of an unrelated process identity.
Comparison now hashes the supplied registry before deserialization and rejects a mismatch with request.RegistrySha256. Packaging and capture enforce the same binding. The runner test mutates registry bytes and verifies rejection before a summary is written.
The inner assertion catch now handles only TimeoutException. Other driver/session failures reach the harness-failure handler. Environment collection is also inside that boundary, and cleanup failures are recorded instead of swallowed. The comparison regression suite retains inconclusive classification for infrastructure failures.
The reason will be displayed to describe this comment to others. Learn more.
🔍 AI-Generated Review (multi-model)
⚠️compare can crash when --output has no directory component: Path.GetDirectoryName(options.Required("output")) returns null for values like comparison-summary.json, and the null is then passed to Path.Combine(...) on the change-detected path. Concrete failure: a valid compare invocation with a filename-only output succeeds until a visual diff is needed, then throws before writing results.
For an ordinary filename, Path.GetDirectoryName returns an empty string rather than null, so that particular crash explanation is not established. I normalized the output to an absolute path and added an exact filename-only, change-detected regression that verifies the generated visual diff is written beside the summary.
@morning4coffe-dev — new skill validation results are available based on this last commit: 9607d22.
To request a fresh validation after new comments or commits, comment /evaluate-skills.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Final review comments include unresolved critical and moderate findings covering path safety, device binding, process ownership, validation, and scope consistency.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (5)
eng/scripts/Prepare-UiEvidencePayload.ps1:47
The metadata validation checks request and variant fields but never checks that base and head were built with the same devFlowCommit and devFlowPackageVersion; the payload then records only the base values while copying one feed. If the head artifact used a different adapter, layout/tree differences can be caused by the harness rather than the PR while the comparison still treats them as comparable. Reject mismatched DevFlow metadata and verify the copied feed manifest matches both variants before creating the payload.
foreach ($item in @(
@{ Name = "base"; Metadata = $baseMetadata; Commit = [string]$request.baseCommitSha },
@{ Name = "head"; Metadata = $headMetadata; Commit = [string]$request.headCommitSha }
)) {
if ([string]$item.Metadata.requestKey -ne [string]$request.requestKey -or
[string]$item.Metadata.variant -ne [string]$item.Name -or
[string]$item.Metadata.commitSha -ne [string]$item.Commit -or
[string]$item.Metadata.harnessSha -ne [string]$request.harnessSha -or
[string]$item.Metadata.scenarioId -ne [string]$request.scenarioId -or
[string]$item.Metadata.platform -ne [string]$request.platform) {
throw "$($item.Name) build metadata does not match the request."
}
}
eng/scripts/Start-UiEvidenceAppium.ps1:27
When an Appium server is already listening, this path records started=false and proceeds without verifying its process ownership, target device, or capabilities. A stale or unrelated server can therefore receive the four captures, defeating the documented dedicated-server/explicit-target requirement while still producing apparently valid evidence. Treat an existing listener as a conflict or validate that it is the server owned by this experiment.
This contract test requires eng/pipelines/ci-ui-evidence.yml and its build/run templates to be absent, and the checkout contains no such pipeline. That contradicts the PR description's claim that this PR supplies a manually queueable Azure DevOps measurement pipeline; as written, the advertised hosted/manual queue path does not exist. Either add the claimed pipeline/templates or update the scope and documentation to say this is skills-only.
foreach ($path in @(
(Join-Path $repoRoot "eng\pipelines\ci-ui-evidence.yml"),
(Join-Path $repoRoot "eng\pipelines\common\ui-evidence-build-job.yml"),
(Join-Path $repoRoot "eng\pipelines\common\ui-evidence-run-job.yml"),
(Join-Path $repoRoot ".github\workflows\ui-evidence.md"),
(Join-Path $repoRoot ".github\workflows\ui-evidence.lock.yml")
)) {
Assert-True (-not (Test-Path -LiteralPath $path)) "Manual UI evidence must not introduce a pipeline or workflow: $path"
The request identity includes registrySha256, but this path only parses the supplied registry and never verifies its hash. A modified scenarios.json can therefore change checkpoints or thresholds while the request key still matches, allowing a comparison to be sealed against a different registry. Verify the registry file hash before using it. src/Controls/tests/UiEvidence.Runner/UiEvidenceCompareCommand.cs:93
A bare filename is valid for the documented --output <path> option, but Path.GetDirectoryName returns null for it. Any change-detected comparison then throws while constructing the diff path instead of producing the summary; the existing tests only use an output path with a directory. Resolve the output path before taking its directory.
Both metadata paths must now be safe relative paths contained in the artifact root; the app must additionally be contained in its declared app root. Shared traversal rejects junctions/reparse points before copying or hashing. Contracts reject parent/rooted escapes, an app outside its app root, and a junction, while preserving existing output sessions.
Android now requires an explicit serial and uses the same value for adb and Appium udid. Shared Appium options retain the existing iOS UDID behavior. Runner tests verify both binding and missing/implicit-target rejection. DevFlow forwarding also uses --no-rebind and only cleans up a successfully created forward.
The Windows preflight now refuses a pre-existing same-name app; it no longer kills processes by name. A runner regression invokes that guard against the test process and verifies it remains alive. Appium cleanup separately verifies an owned PID and exact start time.
The PR description now matches the manual-local implementation and explicitly removes the stale Azure pipeline/GitHub orchestration/credential-setup claims. The local workflow documentation now also describes the implemented target binding, ownership checks, and fresh-output preservation.
Keep Windows and Mac Catalyst capability sets free of udid. Preserve startup exceptions while always disposing the process, and fail fast on non-cancellation pipe faults before cleaning up owned children. Cover platform capability serialization and injected cleanup/read faults.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The s/agent-review-in-progress label stays on this PR while the run is active. The final recommendation and outcome labels are posted only after Gate, expert review, and Deep UI tests finish.
On Android, CreateAndroidApp creates the Appium driver/session and then calls ActivateApp; if activation or later factory initialization throws, this assignment never completes and app remains null. The finally block consequently skips CloseApp and Dispose, leaving the failed session alive while the run is recorded as a harness failure and the next run can start. Make app creation transactional so a partially constructed Appium app is disposed before the failure is returned.
Clarify evidence directories must be fresh and are never replaced
docs/ui-evidence.md:160
These directories are not replaced: New-UiEvidenceOutputDirectory rejects an existing path and the capture script fails rather than deleting or overwriting an existing session. Please describe them as required fresh directories that are never replaced, otherwise a user following this step may expect a rerun to overwrite prior evidence.
🗂️ 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
Issue: None linked; this PR introduces a new manual local UI-evidence workflow. PR:#38533 - Add deterministic UI evidence measurements for pull requests Base / Materialized Head:3d7ff41c8e9ee0e23c48df72b346218cb0071dd7 / 294f6cba6f509c36a463d7549c4d9533f7396413 Remote Head:9607d22730355259c5ae852cc43a001cd329fe3a Platforms Affected: Android and Windows; STEP 5a validation target is Android. Files Changed: 48 total (43 added, 5 modified), 5,963 insertions and 9 deletions. The change includes 7 dedicated test/project files plus HostApp fixtures; the prior gate nevertheless reported that no tests were detected.
Change Summary
Adds a manually invoked check-pr-ui-evidence skill and documentation. It intentionally does not add hosted pipelines, workflow dispatch, automatic comments, or merge decisions.
Adds a C# runner that performs an Android/Windows base-1, head-1, head-2, base-2 sequence, validates provenance, compares screenshots, and emits advisory or inconclusive verdicts.
Adds default-off HostApp fixtures for layout-controls and CollectionView smoke scenarios.
Adds focused xUnit runner/comparison tests and PowerShell contract tests. The PR description reports 37 runner tests and the PowerShell contracts passing, but STEP 5a must independently record only tests actually run by each candidate.
Existing Fix Mechanism
The PR solves the evidence problem by adding a complete local measurement subsystem: separate pinned builds, explicit Android device identity, a locally owned Appium endpoint, deterministic four-run ordering, hash-bound request/registry/app metadata, fresh output directories, and sealed evidence. Previous review fixes already addressed hidden-file inventories, registry pinning, unsafe artifact paths, Android Appium/adb target mismatch, unowned Windows process termination, occupied Appium ports, broad exception conversion, and redirected process deadlocks.
Current Review Context
No separate expert-review agent was launched because STEP 5a explicitly defers that pass to STEP 5b. Public inline feedback still visible on the current PR identifies four unresolved areas for later review/candidate consideration:
src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj: the DevFlow compile constant can be enabled for unsupported iOS/Mac Catalyst TFMs while its project reference is Android/Windows-only.
eng/scripts/Prepare-UiEvidencePayload.ps1: base/head metadata are request-bound individually but their DevFlow commit/package identities are not compared.
src/Controls/tests/UiEvidence.Runner/UiEvidenceRunCommand.cs: --appium-url is accepted without enforcing the documented local loopback boundary.
eng/scripts/Invoke-UiEvidenceBuild.ps1: PR-controlled builds inherit caller credential environment variables instead of clearing the documented token set at process launch.
Gate and Regression Context
Gate: SKIPPED - no tests detected in the PR. The existing gate/content.md was not changed and gate verification was not rerun.
Regression cross-reference: no recent labeled bug-fix overlap was detected.
Bounded candidate regression surface: dotnet test src/Controls/tests/UiEvidence.Runner.Tests/Controls.UiEvidence.Runner.Tests.csproj --no-restore and pwsh -NoProfile -File eng/scripts/UiEvidence.Tests.ps1. These are the focused test assets described by the PR, not a repository-wide suite.
Try-Fix Restoration Constraint
The materialized PR contains 43 newly added tracked files. The try-fix skill requires EstablishBrokenBaseline.ps1 and mandates a Blocked result without editing whenever .github/.baseline-state.json has a non-empty NewFiles array, because the restore script cannot safely restore added production files. Each child invocation must enforce that boundary independently and still capture/restore all required artifacts.
What this changes: Adds an opt-in, local UI-evidence workflow for Android and Windows. Trusted PowerShell scripts pin request, scenario, source, app, and DevFlow identities; build isolated base/head apps; execute the fixed base-1, head-1, head-2, base-2 capture order; and produce hash-checked comparison and sealed evidence artifacts. The HostApp fixtures are compile-time opt-in, and the runner keeps measurement results advisory rather than making an automatic merge decision.
Inferred motivation: Provide reproducible visual and layout evidence for pull requests without introducing a credentialed hosted pipeline or changing normal HostApp/framework behavior.
Reconciliation with PR Narrative
Author claims: The description presents a manual, deterministic, pinned local flow with explicit Android/Windows targeting, Appium and DevFlow evidence, strict path/provenance checks, process ownership, and focused regression tests.
Agreement/disagreement: The submitted diff supports those claims. The implementation remains default-off, uses explicit identities and content hashes throughout the handoff chain, treats Windows no-difference evidence as inconclusive, and contains the described runner/comparison and PowerShell tests.
Prior Review Reconciliation
Prior ❌ Error Finding
Source
Status
Evidence
An already-occupied Appium port could silently reuse an unrelated server.
Copilot inline review
✅ Fixed
Start-UiEvidenceAppium.ps1 now probes the requested port with exclusive binding and throws when it is unavailable before starting an owned localhost-only Appium process.
Redirected process output was not drained, allowing full pipes to deadlock.
MauiBot review on eb1d9ee
✅ Fixed
UiEvidenceProcess.RunAsync starts stdout, stderr, and exit tasks together and awaits all three under one deadline.
Captured stdout and stderr were drained sequentially, allowing the unread pipe to deadlock.
MauiBot review on eb1d9ee
✅ Fixed
The same shared concurrent runner now serves both process helpers; UiEvidenceProcessTests covers two full pipes, timeout, cancellation, a retained child pipe, and a decoder fault.
Blast Radius Assessment
Runs for all instances: No. HostApp registration and fixtures are guarded by the default-off MauiUiEvidenceEnabled build property, and the workflow is manually invoked.
Startup impact: Only for explicitly built UI-evidence HostApp variants.
Static/shared state: No new shipping framework state. The runner and scripts use per-request files, per-run directories, explicit process ownership records, and bounded local ports.
CI Status
Required-check result: Undetermined. gh pr checks --required was unavailable because the CLI is unauthenticated.
Classification: The supplied trusted Gate is SKIPPED — no tests detected in this PR; it must not be treated as a passing gate even though the submitted diff includes focused test projects/scripts.
Action taken: No gate re-run, as instructed; confidence is capped at low.
Findings
No actionable added-line findings. The sole maui-expert-reviewer pass wrote a valid empty findings array to inline-findings.json.
Failure-Mode Probing
Unrelated/default HostApp use: The new pages and DevFlow registration are excluded unless UI evidence is explicitly enabled, preserving ordinary HostApp startup.
Child process fills one or both redirected pipes, exits while a child retains pipes, times out, is cancelled, or faults during decoding: the concurrent runner observes all tasks under one deadline, terminates the owned process tree on any failure, and preserves cleanup failures without replacing the primary error.
Stale or unrelated local process: Appium startup rejects occupied ports; stop logic validates PID plus start time; Windows refuses to terminate a pre-existing same-name app.
Reused, traversing, rooted, or reparse-point evidence paths: common path guards reject unsafe paths and existing output roots are preserved rather than recursively replaced.
Mismatched scenario, app, registry, run order, or evidence bytes: request keys, commit identities, registry/app hashes, per-run provenance, and evidence hashes are checked before comparison/sealing.
External Output Contract
Not applicable. Changed code uses process exit codes and structured JSON/HTTP responses rather than classifying external console output by a semantic token or regex.
Verdict: NEEDS_DISCUSSION
Confidence: low
Summary: The code review found no blocking implementation defect, and current HEAD fixes the prior process and Appium ownership findings. Human approval is still not warranted from this run because the trusted Gate was skipped and required-check status could not be established.
Bound: At most two sequential candidates. Platform: Android Gate: Skipped previously because no tests were detected; not rerun. Focused validation surface:Controls.UiEvidence.Runner.Tests and eng/scripts/UiEvidence.Tests.ps1 only.
Run PR-controlled build steps from Invoke-UiEvidenceBuild.ps1 with a curated/minimal environment so ambient NuGet, Azure, and GitHub credentials cannot be inherited.
Prior Approach Avoided
The current PR emphasizes deterministic provenance, sealing, and run ordering but still permits inherited process environment. That mechanism can cross local ownership boundaries even when evidence hashes and manifests are valid.
Mechanism-Level Difference
The candidate would block secret propagation at child-process launch rather than detect problems after execution. Sensitive variables would never enter untrusted build process scope, removing those exfiltration paths before evidence generation starts.
Files Changed and Diff
None. The captured candidate diff is empty.
Test Results
No tests ran. pwsh .github/scripts/EstablishBrokenBaseline.ps1 rejected the pre-existing tracked deletions before creating .github/.baseline-state.json, so no safe modification allow-list existed. Per the skill contract, neither the targeted xUnit project nor the PowerShell regression contracts were run.
Failure Analysis
The safe-baseline guard blocked implementation before edits. The required restore command, pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore, then reported the authorized no-state outcome: Restored False with No baseline state found. Inline self-review recorded zero findings because there was no candidate diff.
Status
Done as a blocked attempt; do not reopen or rerun. Candidate 2 must avoid this credential-scrubbing approach.
Validate the effective --appium-url once in the trusted runner before adb or app side effects. Accept only absolute HTTP loopback endpoints (127.0.0.1, localhost, or ::1), reject credentials and non-loopback hosts, and use the same canonical URI for both the Appium connection and recorded evidence metadata. Focused runner tests would cover accepted local and rejected remote endpoints.
Prior Approaches Avoided
The PR starts its helper Appium server on 127.0.0.1 and documents localhost ownership, but Invoke-UiEvidenceRuns.ps1 forwards arbitrary -AppiumUrl values and UiEvidenceRunCommand.CreateApp constructs the URI without enforcing locality. Candidate 1 instead targeted ambient credential inheritance in child builds. Candidate 2 avoids both the PR's unenforced default and candidate 1's credential-scrubbing mechanism.
Mechanism-Level Difference
Candidate 1 addressed implicit secret propagation into build processes. Candidate 2 addresses explicit endpoint substitution at the final trusted consumer. A runner-side locality check would constrain every orchestration caller, preventing normal-looking evidence from being generated through a remote or unowned Appium service and ensuring that the connected and recorded endpoint identities cannot diverge.
Independent Evidence
The candidate inspected the full local HEAD^..HEAD diff and recorded it as try-fix/attempt-2/pr.diff. It confirmed:
eng/scripts/Invoke-UiEvidenceRuns.ps1 exposes and forwards AppiumUrl.
src/Controls/tests/UiEvidence.Runner/UiEvidenceRunCommand.cs passes the supplied value to new Uri(...) without a loopback/ownership check.
UiEvidenceRunCommandTests.cs has no local-versus-remote endpoint contract.
Files Changed and Diff
None. The captured candidate diff is empty.
Test Results
No tests ran. The same mandatory baseline command rejected the 20 pre-existing tracked deletions before creating .github/.baseline-state.json; without a RevertedFiles allow-list, source edits and validation were forbidden. Neither the targeted xUnit project nor the PowerShell regression contracts were run.
Failure Analysis
The candidate design was not disproven; empirical implementation was blocked by safe-restoration policy. The required restore command, pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore, reported the authorized no-state outcome: Restored False with No baseline state found. Inline self-review recorded zero findings because there was no candidate diff.
Status
Done as a blocked attempt. The two-candidate limit is exhausted; neither candidate may be reopened or rerun.
Aggregate Outcome
#
Model
Alternative mechanism
Result
Tests
1
gpt-5.3-codex
Strip ambient credentials at PR-controlled build process launch
BLOCKED
Not run
2
gpt-5.6-sol
Enforce a loopback-only Appium endpoint in the trusted runner
BLOCKED
Not run
Both alternatives are bounded, mechanism-level candidates, but neither produced an implementation diff or empirical pass/fail signal because the pre-existing tracked deletions prevented the mandatory baseline from establishing a safe modification and restoration boundary.
📝 PR Finalize — Recommended Title & Description
Assessment: ✏️ Recommend updating — the description is accurate and unusually complete, but the title omits the Android/Windows scope and the component-style title format.
Recommended title
[Android/Windows] UI evidence: Add deterministic local PR measurements
Recommended description
### Description of Change
Adds **manual, local, deterministic PR UI-evidence measurements** for Android and Windows. Explicitly invoke the `check-pr-ui-evidence` Copilot skill with a repository/PR, pinned base/head/trusted-harness revisions, selected scenario and owned local target.
The skill orchestrates trusted scripts; no model decides the measurement results. The optional manual interpretation skill is isolated in stacked draft #38534. Neither UI-evidence PR depends on the performance-analyzer implementation.
**No UI-evidence Azure pipeline, GitHub workflow, slash-command trigger, PAT pool, OIDC configuration, automatic comment, or automatic merge decision is included.** The earlier hosted implementation was removed by the manual-local refactor; no pipeline needs to be registered.
### Local measurement flow
Pinned identities and trusted scenario selection -> separate base/head builds using the same opt-in HostApp harness -> complete app-directory inventories -> `base-1, head-1, head-2, base-2` captures on one explicit target -> separate trusted comparison -> sealed local evidence bundle.
The default-off HostApp fixtures cover `layout-controls-smoke` and `collectionview-smoke`. Appium supplies native assertions/screenshots; pinned DevFlow supplies supporting tree/layout evidence. Normal HostApp behavior is unchanged unless UI evidence is enabled. No shipping framework API is added.
The implementation includes `.github/skills/check-pr-ui-evidence`, its local workflow reference, `docs/ui-evidence.md`, `eng/scripts/*UiEvidence*`, the trusted scenario/DevFlow configuration, opt-in HostApp fixtures, and the runner/comparison regression tests.
### Review fixes
- Redirected stdout and stderr are drained concurrently under one deadline that also covers pipe completion. Timeouts/cancellation and non-cancellation read faults clean up the still-running owned process tree. Read faults propagate promptly rather than waiting for a timeout; infrastructure and cleanup failures remain explicit.
- App, bundle and DevFlow source inventories include hidden files/directories. Traversal, rooted paths and reparse points are rejected; packaging/capture/comparison preserve existing sessions instead of recursively deleting their output paths.
- Registry bytes must match the request hash before packaging, capture and comparison. Filename-only comparison outputs are normalized and regression-covered.
- Android requires an explicit serial used consistently by adb and Appium's `udid` capability. Shared options send `udid` only for Android/iOS, never Windows or Mac Catalyst. DevFlow forwarding uses `--no-rebind` and only removes a forward created by this run.
- Windows refuses a pre-existing same-name app rather than terminating it. The Appium helper refuses occupied ports, binds localhost, and records PID plus start time; cleanup refuses stale/mismatched ownership records. Failed-startup cleanup always attempts disposal and reports secondary failures without replacing the primary startup error.
Canonical `main` was merged without rewriting published history. The fork-validation infrastructure prerequisite is separate: #38745. It is not copied into this measurement PR.
### Validation
- **37 runner/comparison tests passed** with `dotnet test src\Controls\tests\UiEvidence.Runner.Tests\Controls.UiEvidence.Runner.Tests.csproj --no-restore`. The platform matrix reproduced the unsupported-platform capability regression before the fix; a real decoder fault verifies prompt non-cancellation child cleanup.
- **4 Pester startup fault-injection cases passed**, including termination failure, wait failure, disposal failure, and successful cleanup while the caller treats warnings as errors.
- A real, isolated, repository-pinned **Appium 2.17.1** server passed start/readiness, occupied-port refusal, PID/start-time-checked shutdown, and released-port verification. No native app was launched.
- `pwsh -NoProfile -File eng\scripts\UiEvidence.Tests.ps1` passed, including hidden-file inventories/seals, tampering, metadata/payload escapes, junction rejection, fresh-output preservation, registry pinning, explicit targets, occupied ports and PID/start-time ownership.
- Changed C# files were formatted with the UI-evidence solution; `git diff --check` passed.
These tests use synthetic evidence and owned local child processes/listeners. **They do not establish a live Appium/DevFlow device comparison, red-to-green product evidence, or cloud deployment.**
### Interpretation and limits
This is advisory smoke evidence, not a merge gate or whole-PR regression assurance. The scenarios cover initial state, not navigation, gestures, grouped-item mutations, FlexLayout-specific behavior, iOS or Mac Catalyst. Missing, sampled, unstable or incompatible evidence remains explicit/inconclusive. Windows absence-of-change remains inconclusive because app and driver share an identity.
A consistent seal detects integrity/identity mismatches but does not authenticate third-party artifacts or prove isolated execution. PR-controlled builds/apps require an appropriately isolated local environment; removing environment tokens is not a workstation sandbox.
### CI prerequisite
The existing fork `pull_request_target` checkout refusal requires the independently reviewed base-workflow fix in #38745 to land before a fresh validation can use it. Green local tests do not claim that this base-branch blocker is resolved.
### Issues Fixed
No product issue is closed. Historical PR #38341 was a selection/request-generation input, not proof that these smoke scenarios reproduce or fix its product issue.
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Winner: pr
The raw submitted PR is the single winning candidate. It is the only complete implementation, the sole expert-review pass produced no actionable findings, and current HEAD demonstrably resolves the prior Appium ownership and redirected-pipe deadlock findings. Approval is nevertheless unavailable because the trusted Gate was skipped and required-check status could not be established; the focused runner and PowerShell validations need trusted execution/recognition before merge.
Comparative Ranking
Rank
Candidate
Implementation
Regression evidence
Assessment
1
pr
Complete 48-file submitted implementation
Trusted Gate skipped; PR description reports focused local passes, but this review did not re-run or independently count them
Winner. No expert inline findings; prior error-level findings are fixed; complete and internally coherent.
2
pr-plus-reviewer
Empty reviewer patch; semantically identical to pr
Not run because there was no reviewer change to validate
Cannot improve on pr. Its exact sandbox contains a trusted validation overlay that removes 21 submitted skill/script files, so the sandbox tree is not a shippable replacement diff.
3
try-fix-2
No patch; proposed loopback-only Appium URL enforcement
BLOCKED; no tests ran
A focused trust-boundary hypothesis, but it remains unimplemented and unvalidated. The submitted workflow already defaults to an owned localhost Appium helper and records the endpoint; the candidate supplied no evidence that rejecting every explicit non-loopback endpoint is required rather than an intentional local-runner constraint.
4
try-fix-1
No patch; proposed credential-scrubbed build environment
BLOCKED; no tests ran
A broader hardening hypothesis with compatibility risk for authenticated restores/builds. The PR explicitly requires an appropriately isolated local environment and does not claim token removal is a workstation sandbox. With no implementation or validation, this cannot outrank the submitted fix.
No candidate failed a regression test: both try-fix-* candidates were blocked before edits/tests, and pr-plus-reviewer had no distinct patch requiring validation. Consequently there is no passing alternative to rank above a failing candidate; instead, the complete raw PR outranks all patchless/untested alternatives.
Expert Review
inline-findings.json: valid empty JSON array.
Prior occupied-port finding: fixed by exclusive port probing and refusal to reuse an unrelated Appium service.
Prior stdout/stderr deadlock findings: fixed by concurrent reads and exit waiting under one deadline, with focused process regression tests in submitted HEAD.
Blast radius: default-off HostApp fixtures and manually invoked local infrastructure; no shipping framework API or normal HostApp behavior change.
Confidence: low, solely because trusted validation is undetermined/skipped rather than because of a known code defect.
Required Before Approval
Obtain a trusted run that recognizes and executes the focused UI-evidence runner/PowerShell regression surface (or otherwise supplies equivalent trusted check evidence). Do not treat the supplied skipped Gate as a passing result.
📱 UI Tests — Button,Label,Layout
Detected UI test categories:Button,Label,Layout
✅ Deep UI tests — 422 passed, 0 failed, 7 skipped across 3 categories on platform-pool agent (replaces in-process counts above).
🟡 Needs human investigation — iOS HybridWebView handler leak and incomplete work item: the work item crashed after 611 passed / 1 failed / 6 skipped, and the bounded five-run device history cannot verify a comparable clean result.
Insufficient data — Windows DeviceTestsIOS task: only the PowerShell exit-code wrapper was captured, without the underlying diagnostic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Adds manual, local, deterministic PR UI-evidence measurements for Android and Windows. Explicitly invoke the
check-pr-ui-evidenceCopilot skill with a repository/PR, pinned base/head/trusted-harness revisions, selected scenario and owned local target.The skill orchestrates trusted scripts; no model decides the measurement results. The optional manual interpretation skill is isolated in stacked draft #38534. Neither UI-evidence PR depends on the performance-analyzer implementation.
No UI-evidence Azure pipeline, GitHub workflow, slash-command trigger, PAT pool, OIDC configuration, automatic comment, or automatic merge decision is included. The earlier hosted implementation was removed by the manual-local refactor; no pipeline needs to be registered.
Local measurement flow
Pinned identities and trusted scenario selection -> separate base/head builds using the same opt-in HostApp harness -> complete app-directory inventories ->
base-1, head-1, head-2, base-2captures on one explicit target -> separate trusted comparison -> sealed local evidence bundle.The default-off HostApp fixtures cover
layout-controls-smokeandcollectionview-smoke. Appium supplies native assertions/screenshots; pinned DevFlow supplies supporting tree/layout evidence. Normal HostApp behavior is unchanged unless UI evidence is enabled. No shipping framework API is added.The implementation includes
.github/skills/check-pr-ui-evidence, its local workflow reference,docs/ui-evidence.md,eng/scripts/*UiEvidence*, the trusted scenario/DevFlow configuration, opt-in HostApp fixtures, and the runner/comparison regression tests.Review fixes
udidcapability. Shared options sendudidonly for Android/iOS, never Windows or Mac Catalyst. DevFlow forwarding uses--no-rebindand only removes a forward created by this run.Canonical
mainwas merged without rewriting published history. The fork-validation infrastructure prerequisite is separate: #38745. It is not copied into this measurement PR.Validation
dotnet test src\Controls\tests\UiEvidence.Runner.Tests\Controls.UiEvidence.Runner.Tests.csproj --no-restore. The platform matrix reproduced the unsupported-platform capability regression before the fix; a real decoder fault verifies prompt non-cancellation child cleanup.pwsh -NoProfile -File eng\scripts\UiEvidence.Tests.ps1passed, including hidden-file inventories/seals, tampering, metadata/payload escapes, junction rejection, fresh-output preservation, registry pinning, explicit targets, occupied ports and PID/start-time ownership.git diff --checkpassed.These tests use synthetic evidence and owned local child processes/listeners. They do not establish a live Appium/DevFlow device comparison, red-to-green product evidence, or cloud deployment.
Interpretation and limits
This is advisory smoke evidence, not a merge gate or whole-PR regression assurance. The scenarios cover initial state, not navigation, gestures, grouped-item mutations, FlexLayout-specific behavior, iOS or Mac Catalyst. Missing, sampled, unstable or incompatible evidence remains explicit/inconclusive. Windows absence-of-change remains inconclusive because app and driver share an identity.
A consistent seal detects integrity/identity mismatches but does not authenticate third-party artifacts or prove isolated execution. PR-controlled builds/apps require an appropriately isolated local environment; removing environment tokens is not a workstation sandbox.
CI prerequisite
The existing fork
pull_request_targetcheckout refusal requires the independently reviewed base-workflow fix in #38745 to land before a fresh validation can use it. Green local tests do not claim that this base-branch blocker is resolved.Issues Fixed
No product issue is closed. Historical PR #38341 was a selection/request-generation input, not proof that these smoke scenarios reproduce or fix its product issue.