Skip to content

Use MAUI DevFlow for local AI-assisted development - #38687

Closed
kubaflo wants to merge 1 commit into
mainfrom
kubaflo-maui-devflow-adoption
Closed

kubaflo wants to merge 1 commit into
mainfrom
kubaflo-maui-devflow-adoption

Conversation

@kubaflo

@kubaflo kubaflo commented Sep 19, 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

Make the repository-pinned MAUI DevFlow CLI the default for local, interactive emulator/simulator work by Copilot, with a working in-tree Sandbox integration rather than documentation alone.

  • Add a shared maui-devflow skill and on-demand Sandbox reference. Update the relevant Copilot instructions, agents, and skills to reuse explicit device/app connections, prefer targeted queries and bounded logs, and request screenshots only when useful. Consolidate the Sandbox instructions from 819 to 221 lines; this is a guidance-size reduction, not a measured token-savings claim.
  • Add EnableMauiDevFlow, disabled by default, for Android/iOS Debug Sandbox builds. Align the Agent with the existing CLI pin, disable optional network capture/profiling, and preserve the in-tree MAUI implementation references. Reject unsupported configurations and stale restore state. Track optional iOS bundle outputs so switching the opt-in off removes the Agent DLLs during normal incremental cleanup.
  • Add Start-DevFlowSandbox.ps1 for one explicitly selected, already-running virtual device and an existing foreground broker. Preserve native failures, strip GitHub/Copilot credentials from child processes, bound execution/readiness, and verify a fresh build session plus app identity before writing ready.json. Readiness explicitly does not mean tests passed.

Appium/NUnit, XHarness, integration tests, CI, and fail-without-fix verification remain authoritative and unchanged. Document the distinction between DevFlow's semantic activation and native-input regression evidence. Do not instrument HostApp or all test apps, upgrade workloads, install global tools, or perform broad device recovery.

Issues Fixed

N/A — local development tooling and AI workflow improvement; no framework bug or public API change.

Validation

  • All 22 focused Pester checks pass, including argument/target preservation, process failure and timeout handling, credential isolation, fresh Agent selection, readiness reporting, and real-MSBuild optional bundle-output tracking.
  • Instrumented Android and iOS Debug builds and real launcher runs succeeded against in-tree MAUI assemblies. On each selected virtual device, queried a temporary counter, activated it, and asserted the observable Count: 0 to Count: 1 transition; also collected bounded logs and screenshots. The temporary UI was removed.
  • Ordinary Android/iOS Debug and Release builds succeed without DevFlow package references, assembly references, generated assembly metadata, or packaged Agent remnants. Verified incremental opt-in to opt-out cleanup and explicit rejection of unsupported settings/stale restore state.
  • Skill metadata, local reference links, scoped C# formatting, and whitespace checks pass. Session-owned test devices and broker were stopped; evidence remains outside the repository.

Real-issue DevFlow validation: #38649

Scope: On 2026-09-19, the DevFlow workflow in this PR was exercised against the CollectionView header/footer regression in #38649. This is evidence for the tooling adoption, not a claim that this PR contains or closes that framework fix. The framework experiments and 24 new device-test cases remain local, uncommitted, and unpushed. The published PR head is e7d6b44d0522560d4bec72bf1a7f919bbc765820; its diff does not include the CollectionView fix/tests.

Environment and method

Item Observed value
Device Copilot_API_35, serial emulator-5554, Pixel 6 Google Play emulator
Android Android 15 / API 35; not physical Android 9 hardware
App In-tree Sandbox, com.microsoft.maui.sandbox, Debug, net10.0-android
App runtime .NET 10.0.9
Host SDK 11.0.100-preview.6.26359.118
DevFlow CLI/Agent pin 0.1.0-preview.10.26274.3
Reported Agent version 0.1.0-preview.10.26274.3+40fa9a00211aa034ebf299232df3df190c38089d
Connections Baseline port 9223; first candidate 10223; last Sandbox candidate 10225, always with the explicit Android serial

The temporary Sandbox fixture used 120 unchanged items and counted item-template construction. Header/footer replacements used reference-unequal class instances with the same displayed text, so property-change notifications actually ran; equal-valued records can suppress the change. Queries also recorded ItemsSource identity/count, adapter identity, attached holder identities, displayed text, and whether the footer was attached.

Each Sandbox build/launch completed through Start-DevFlowSandbox.ps1 and produced its own ready.json before inspection. After that readiness boundary, the recorded interactions were DevFlow semantic taps, targeted ui query calls, and a finite log fetch. DevFlow was not substituted for XHarness, and device-test apps were not instrumented with the Agent.

Observed before/after behavior

Scenario Unfixed baseline First candidate: preserve adapter and notify one row Direct-rebind candidate
Same-content Header replacement 9 additional item views; adapter replaced 2 additional item views; adapter preserved 0 additional item views; adapter preserved
Same-content offscreen Footer replacement 9 additional visible item views; adapter replaced 0 additional item views; adapter preserved 0 additional item views; adapter and exact attached-holder signature preserved
Changed Header text Not used as a baseline measurement Not used as a candidate measurement Queried text changed to Header text changed 5; 0 additional item views
Change to a tall nested template Control scenario New Border/Grid template displayed; adapter rebuilt New Border/Grid template displayed; adapter rebuilt, as expected

The first candidate was not accepted as complete: DevFlow reproduced the remaining +2 Header constructions in the actual attached Sandbox app, matching the long-list device-test failures. Merely adding a non-null RecyclerView change payload also left those two device-test failures. Directly rebinding the attached templated header/footer, with targeted invalidation for offscreen content, removed the extra constructions in the observed scenarios. These are construction-count measurements, not FPS, latency, or memory benchmarks.

Baseline evidence, including an offscreen Footer

Header replacement, with unchanged ItemsSource:

Before: Constructed=9; Baseline=9; Delta=0
After:  Constructed=18; Baseline=9; Delta=9
Adapter: ReorderableItemsViewAdapter`2@62675730 -> ReorderableItemsViewAdapter`2@183217970
AdapterChanged=True; HoldersChanged=True
ItemsSourceHash=-637934726; ItemsCount=120  (unchanged before/after)

For the explicit offscreen Footer check, ui query --automationId "Issue38649FooterTextLabel" returned [] both before and after the replacement, while the Header was queryable:

Before: Constructed=27; Baseline=27; Delta=0
After:  Constructed=36; Baseline=27; Delta=9
Adapter: ReorderableItemsViewAdapter`2@207836597 -> ReorderableItemsViewAdapter`2@267731443
AdapterChanged=True; HoldersChanged=True

The first candidate preserved the adapter but still produced this Header result:

Constructed=11; Baseline=9; Delta=2
AdapterBaseline=ReorderableItemsViewAdapter`2@62675730
AdapterNow=ReorderableItemsViewAdapter`2@62675730
AdapterChanged=False; HoldersChanged=True
Recorded DevFlow commands and actual responses from the direct-rebind Sandbox run

The original tool-call transcript records the following command at 2026-09-19 17:52:31.048 UTC (19:52:31 CEST). Line wrapping below is only for readability.

dotnet tool run maui -- devflow ui tap \
  --automationId "Issue38649ReplaceHeaderButton" \
  --agent-port 10225 --platform android --device emulator-5554

Actual response, exit code 0:

{"success":true,"action":"Tapped","elementId":"Issue38649ReplaceHeaderButton"}

At 17:52:36.650 UTC, the following recorded query ran:

sleep 1; dotnet tool run maui -- devflow ui query \
  --automationId "Issue38649CounterLabel" \
  --fields id,type,automationId,text --format compact \
  --agent-port 10225 --platform android --device emulator-5554

Actual response, exit code 0:

[
  {
    "id": "Issue38649CounterLabel",
    "type": "Label",
    "automationId": "Issue38649CounterLabel",
    "text": "Constructed=9; Baseline=9; Delta=0; VisibleAttached=10; LaidOut=True"
  }
]

The companion adapter query at the same timestamp was:

sleep 1; dotnet tool run maui -- devflow ui query \
  --automationId "Issue38649AdapterLabel" \
  --fields id,type,automationId,text --format compact \
  --agent-port 10225 --platform android --device emulator-5554

Its returned text field was:

AdapterBaseline=ReorderableItemsViewAdapter`2@101059649; AdapterNow=ReorderableItemsViewAdapter`2@101059649; AdapterChanged=False; HoldersChanged=False; Holders=0:235302680,1:79886511,2:133001581,3:120843946,4:246109699,5:4519880,6:22526985,7:122564502,8:58486015,9:113455508

Repeated Header replacements continued to report Delta=0 and the same adapter. In some subsequent queries the edge holder at position 9 attached/detached as the viewport settled; positions 0-8 kept their identities. Therefore the evidence is no new item-template constructions, not a claim that the attached-holder list never changes with viewport settling.

The offscreen Footer query remained [] before/after replacement. Its counter stayed Constructed=9; Baseline=9; Delta=0, with the same adapter and exact attached-holder signature.

Changing Header data updated the queried text to Header text changed 5 without additional item-template construction. Changing the templates displayed Issue38649TallHeaderRoot as a Border and Issue38649HeaderNestedLayout as a Grid; the adapter changed from 101059649 to 159586203, with Constructed=17; Baseline=9; Delta=8 for that intentional structural change.

Agent readiness, health, and bounded-log evidence

Relevant fields from ready.json (host paths omitted):

{
  "status": "ready",
  "testsRun": false,
  "platform": "Android",
  "deviceId": "emulator-5554",
  "applicationId": "com.microsoft.maui.sandbox",
  "agent": {
    "id": "34eddb19a7f4",
    "tfm": "net10.0-android",
    "platform": "Android",
    "appName": "Sandbox",
    "port": 10225,
    "version": "0.1.0-preview.10.26274.3+40fa9a00211aa034ebf299232df3df190c38089d",
    "connectedAt": "2026-09-19T17:52:05.602752Z"
  },
  "connectionArguments": ["--agent-port", "10225", "--platform", "android", "--device", "emulator-5554"]
}

Relevant fields from the actual health response:

{
  "agent": {
    "name": "Microsoft.Maui.DevFlow.Agent",
    "version": "0.1.0-preview.10.26274.3+40fa9a00211aa034ebf299232df3df190c38089d",
    "framework": ".NET MAUI",
    "frameworkVersion": "10.0.9"
  },
  "device": { "platform": "Android", "deviceType": "Virtual" },
  "app": { "name": "Sandbox", "packageId": "com.microsoft.maui.sandbox" },
  "timestamp": "2026-09-19T17:52:06.9075218+00:00",
  "running": true
}

The finite DevFlow log fetch included:

2026-09-19T17:52:05.5702342Z [Microsoft.Maui.DevFlow] Agent started on port 10225
2026-09-19T17:52:05.5954358Z [Microsoft.Maui.DevFlow.Agent] HTTP server started on port 10225

Readiness and an Agent health response only establish the connection. The subsequent state queries and separate test results establish the observed behavior.

Independent on-device regression evidence

The Controls CollectionView category was built in Release and executed on emulator-5554 through XHarness. These numbers come from the actual xUnit XML, not the DevFlow ready marker or inferred test attributes.

Phase Total Passed Failed Skipped Interpretation
No framework fix 77 60 16 1 All 16 new item-preservation cases failed on adapter preservation
Preserve adapter + targeted change notification 77 74 2 1 Long-list Header cases, grouped and ungrouped, still constructed two extra items
Non-null payload + selector coverage 79 76 2 1 Same two performance failures remained
Direct attached-holder rebind 79 78 0 1 Initial preservation and selector coverage passed
Expanded null/sizing/logical-child coverage 81 78 2 1 Two test-helper failures: helper required holder 0 after scrolling to a long-list Footer
Corrected footer-position test helper; final local source 81 80 0 1 All 24 new regression cases passed; zero XML errors

The existing skip is CellSizeAccountsForMargin. Final xUnit XML reports total="81" passed="80" failed="0" skipped="1" errors="0", and XHarness exited 0. The final build succeeded with zero errors and an existing unrelated xUnit2031 warning in SwipeView tests.

The 24 new local cases cover Header/Footer updates with 0, 1, 8, and 40 items, grouped/ungrouped sources, stable item-construction and logical-child counts, updated binding contexts/text, offscreen Footer data becoming visible after scrolling, null data with an existing template, grow/shrink measurement, DataTemplateSelector replacement/cleanup, template changes, direct views, removal/restoration, and EmptyView behavior.

Additional issue found by inspection: the last Sandbox pass exposed duplicate logical Header nodes after repeated same-template rebinds and stale compact nodes after a template change. This was not dismissed as successful cleanup: a parent guard was then added to the local holder binding path, and the final on-device suite verified stable logical-child counts and selected-template cleanup. That final guard was verified by XHarness; the full Sandbox sequence was not rerun after it.

Test invocation and runner limitations

Build through the existing repository runner:

pwsh -NoProfile .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform android -Configuration Release -BuildOnly

Actual execution used a session-local XHarness executable with the following arguments:

xharness android test
  --app artifacts/bin/Controls.DeviceTests/Release/net10.0-android/com.microsoft.maui.controls.devicetests-Signed.apk
  --package-name com.microsoft.maui.controls.devicetests
  --instrumentation com.microsoft.maui.controls.devicetests.TestInstrumentation
  --device-id emulator-5554
  --output-directory <session-artifacts>/issue38649-device-tests-verified2
  --timeout 00:15:00
  --arg TestFilter=Category=CollectionView

The repository verification wrapper ended with ERROR PARSING TEST RESULTS, so its result is Blocked, not VERIFICATION PASSED. The pinned XHarness required an unavailable .NET 11 RC runtime; a compatible session-local Microsoft.DotNet.XHarness.CLI version 10.0.0-prerelease.26464.2 was used instead, without changing repository manifests or system workloads. The emulator's default instrumentation lookup also failed with Invalid userId -2; explicitly naming the existing instrumentation class resolved that execution problem.

The before/after evidence above therefore comes from completed direct XHarness runs and their xUnit XML, not from claiming the blocked wrapper succeeded. No PR CI/Helix result is implied by these local runs.

Evidence provenance, limits, and cleanup

Relevant output is inlined above so readers do not need access to a developer's absolute filesystem paths. Full original artifacts remain local, outside the repository; they have not been uploaded as publicly downloadable artifacts:

Local artifact set Contents
issue38649-baseline-20260919-1920 Baseline build/launch binlogs and stdout/stderr, readiness, health, baseline/offscreen-footer observations
issue38649-fixed-sandbox-20260919-1936 First candidate's real attached-app +2 Header construction result, Footer and template-change observations
issue38649-final-sandbox-20260919-1952 Direct-rebind build/launch evidence, readiness/health, recorded interaction summary, finite DevFlow logs
issue38649-device-tests-{baseline,fixed,final,rebind,verified,verified2} Actual xUnit XML and device logs for every test phase listed above; the directory named final is an intermediate failing run, not the final success
issue38649-device-verified2-build.log, issue38649-xharness-verified2.log Final local build and successful XHarness execution
Original session tool-call transcript Exact DevFlow commands, timestamps, exit codes, and returned query/action output

For the recorded tap/counter/adapter sequence, the original transcript event IDs are 08eb6be7-8cd0-4c64-a7a4-838d6188fbff, 8527602d-20ac-44e6-9a8c-712c327da650, and fab78257-ebc0-42cd-90e6-331b2ed72f5f respectively. Unrelated historical app log entries and absolute host paths are intentionally not published.

This validates DevFlow semantic interaction and inspection on an Android API 35 emulator, not physical taps, native hit-testing, accessibility, or behavior on the reporter's physical Android 9 device. The temporary Sandbox fixture was restored; the session-owned broker was stopped, while the emulator was left running without disrupting other sessions. Only local framework/test changes for #38649 remain; none were committed or pushed into this PR.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 19, 2026 16:41
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38687

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38687"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown
Contributor

Skill Validation Results

@kubaflo — new skill validation results are available based on this last commit: e7d6b44.
To request a fresh validation after new comments or commits, comment /evaluate-skills.

Overall Failed Static Failed LLM Needs attention Skills 26 Agents 6

❌ Skill Validation Results — e7d6b44 · Use MAUI DevFlow for local AI-assisted development · 2026-09-19T16:45:48Z

❌ Static Checks Failed

Skills: 26 | Eval specs linted:

⚠️ LLM Evaluation Incomplete

No valid JUnit suite results were found for: try-fix, verify-tests-fail-without-fix.

🔍 Full results and investigation steps

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Unresolved critical credential-exposure and moderate configuration-validation issues remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

Adds an opt-in, repository-pinned MAUI DevFlow workflow for local Sandbox development and updates Copilot guidance while preserving existing test runners.

Changes:

  • Adds conditional DevFlow Agent integration and package pinning.
  • Adds launcher, readiness checks, credential isolation, and Pester tests.
  • Updates Sandbox, testing, and Copilot documentation and agent routing.
File Summary
src/​Controls/​samples/​Controls.Sample.Sandbox/​MauiProgram.cs Adds conditional Agent bootstrap.
src/​Controls/​samples/​Controls.Sample.Sandbox/​Maui.Controls.Sample.Sandbox.csproj Adds opt-in configuration, references, validation, and cleanup tracking. Moderate (1 vote): UseWorkload is not explicitly validated.
eng/​Versions.props Pins DevFlow package versions.
eng/​NuGetVersions.targets Applies package version wiring.
.github/​skills/​write-ui-tests/​SKILL.md Updates UI test guidance and DevFlow boundaries.
.github/​skills/​verify-tests-fail-without-fix/​SKILL.md Preserves fail-without-fix verification guidance.
.github/​skills/​try-fix/​SKILL.md Updates fix workflow boundaries.
.github/​skills/​run-integration-tests/​SKILL.md Clarifies integration-test routing.
.github/​skills/​run-device-tests/​SKILL.md Clarifies device-test boundaries.
.github/​skills/​maui-devflow/​SKILL.md Defines the DevFlow workflow.
.github/​skills/​maui-devflow/​scripts/​Start-DevFlowSandbox.Tests.ps1 Adds launcher and cleanup tests.
.github/​skills/​maui-devflow/​scripts/​Start-DevFlowSandbox.ps1 Implements Sandbox orchestration. Critical (1 vote): trusted credentials remain available while dot-sourcing repository-controlled helper code.
.github/​skills/​maui-devflow/​references/​sandbox.md Documents setup and evidence boundaries. Nit (1 vote): the PrivateAssets=all bundle-behavior statement is inaccurate.
.github/​README-AI.md Documents DevFlow-first AI workflows.
.github/​instructions/​uitests.instructions.md Updates UI testing guidance.
.github/​instructions/​sandbox.instructions.md Replaces legacy Sandbox guidance with DevFlow-first instructions.
.github/​instructions/​integration-tests.instructions.md Updates integration-test guidance.
.github/​instructions/​helix-device-tests.instructions.md Preserves Helix device-test boundaries.
.github/​copilot-instructions.md Registers the new workflow. Nit (2 votes): references an incorrect Sandbox project path.
.github/​agents/​write-tests-agent.agent.md Updates test-agent routing.
.github/​agents/​sandbox-agent.agent.md Routes Sandbox work through DevFlow first.

$manifest = Get-Content -LiteralPath $manifestPath -Raw | ConvertFrom-Json -AsHashtable
$version = $manifest.tools['microsoft.maui.cli'].version
if (-not $version) { throw 'The repository tool manifest does not pin Microsoft.Maui.Cli.' }
. (Join-Path $RepoRoot '.github/scripts/shared/shared-utils.ps1')

- `src/Controls/samples/Maui.Controls.Sample` - Full gallery sample with all controls and features
- `src/Controls/samples/Maui.Controls.Sample.Sandbox` - Empty project for testing/reproduction
- `src/Controls/samples/Maui.Controls.Sample.Sandbox` - Sandbox sample for testing/reproduction; preferred local app for DevFlow-guided manual inspection once the branch includes the Sandbox DevFlow Agent integration
if ($Platform -eq 'Android') {
$connectionSetup += @('--device', $DeviceId)
# Establish only this serial's forwarding before the app first registers.
$null = Invoke-DevFlowJson -Arguments (@('devflow', 'list') + $connectionSetup) -RepoRoot $RepoRoot `

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.

❌ Race Condition — devflow list --device repairs Android forwarding for every Agent registered with the shared broker, not only the selected session. If session A is using an Agent port on emulator A, starting this launcher for emulator B can rebind that same host port to B before the new build succeeds, breaking session A. Use read-only broker discovery and forward only the verified fresh-session Agent port; add a two-emulator test that proves existing mappings remain unchanged.

Flagged by: 2/3 reviewers


Assert-DevFlowBroker -RepoRoot $RepoRoot -LogPrefix (Join-Path $ArtifactDirectory 'broker-before-wait')
$clock = [Diagnostics.Stopwatch]::StartNew()
$waitArguments = @('devflow', 'wait', '--project', $project, '--wait-platform', $Platform, '--timeout', "$TimeoutSeconds") + $connectionSetup

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.

❌ Resource Leak — The preceding broker health check cannot enforce the documented “foreground broker only” guarantee: the pinned devflow wait and devflow list commands call EnsureBrokerRunningAsync(), which starts a detached replacement if the foreground broker exits in the gap. The launcher can therefore leave an unowned broker running and continue against it. Use a no-auto-start broker/list/wait path or query the already-verified broker directly.

Flagged by: 3/3 reviewers after dispute

if (-not $agent) { throw [TimeoutException]::new("No Agent matched this build's session '$sessionId'. See $ArtifactDirectory.") }

$connection = @('--agent-port', [string]$agent.port) + $connectionSetup
$health = Invoke-DevFlowJson -Arguments (@('devflow', 'agent', 'status') + $connection) -RepoRoot $RepoRoot `

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.

❌ Logic — This loop stops at broker registration, then probes Agent health only once. The pinned Agent registers before its HTTP service is ready, and the client has no transient retry by default, so a connection refusal or running=false during normal startup aborts immediately even when TimeoutSeconds remains. Keep connection failures and not-yet-running status inside the bounded readiness loop, while still rejecting identity mismatches; cover refusal-then-success and running=false-then-success.

Flagged by: 3/3 reviewers after dispute

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

Adversarial review verdict

Found 3 must-fix correctness issues:

  • ❌ Android Agent discovery can rebind forwarding owned by another emulator/session. 2/3 reviewers.
  • ❌ A broker that exits after the health check can be silently replaced by an unowned detached broker. 3/3 after dispute.
  • ❌ Broker registration is accepted before Agent HTTP readiness, and the one-shot health probe can fail during normal startup. 3/3 after dispute.

Test coverage: The focused Pester tests cover argument boundaries, process failures/timeouts, Agent selection, and permanently unhealthy status, but they do not cover two-emulator forwarding isolation, broker disappearance between commands, or transient Agent-health startup states.

Prior review status: One earlier COMMENT review has two open findings (credential exposure while dot-sourcing the helper and an outdated Sandbox path). Those were not duplicated here.

PR metadata: The title and detailed description accurately describe the implementation and its opt-in/fallback boundaries.

Methodology: 3 independent reviewers with adversarial consensus and repository-native MAUI review rules. CI/build status was intentionally out of scope.

@kubaflo

kubaflo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

I compared the workflows to answer whether this change makes local development better, faster, or cheaper for an AI agent. My conclusion is that the measured benefits do not justify adopting and maintaining this integration as the repository's default interactive workflow, and I recommend closing this PR.

What I measured

The comparison used the same instrumented in-tree Sandbox app on an isolated iOS 18.5 simulator, with targeted DevFlow queries versus targeted Appium/native operations. Each path had one excluded warmup and five measured repetitions. The tasks asserted observable state, not just successful requests. These are warm interaction timings, excluding build, deployment, and connection setup.

Task, including state checks Appium median DevFlow median
Reset and verify 0.69 s 1.20 s
Increment and verify 0.51 s 0.59 s
Enter text and verify 1.85 s 0.88 s
Navigate, return, and verify 1.67 s 1.24 s
Complete sequence 4.77 s 3.90 s

DevFlow reduced elapsed task time by about 18% for this sequence, but was slower for reset and a single increment. Both paths completed 5/5 final measured repetitions. DevFlow's first attempt encountered a preview CLI ui fill argument-parsing problem that required a syntax workaround.

For the matched sequence, raw response text was 969 -> 206 o200k_base tokens, about 79% smaller, excluding tree dumps, setup, and warmup. The documented Sandbox entry-instruction set was 8,126 -> 6,422 tokens, about 21% smaller, including the new skill and setup reference. These are text-size measurements, not billed agent-session savings: an Appium wrapper can keep element handles and intermediate responses out of the model context, and reasoning, tool envelopes, and caching were not measured. Across all changed guidance files, the aggregate text-token reduction was only about 0.22%.

Why I would close this

  • The speed benefit is modest and task-dependent. This was one small scripted scenario on one simulator, not an end-to-end agent debugging benchmark, a cold-start comparison, or an uninstrumented base-versus-PR comparison.
  • We did not demonstrate improved determinism or lower flakiness. Both paths succeeded in the final run, and five repetitions cannot establish a reliability advantage.
  • DevFlow's semantic activation is useful for inspecting managed state, but it is not equivalent to native input. We still need Appium/native coverage for hit-testing, occlusion, gestures, and accessibility, so this adds another workflow rather than replacing the existing one.
  • The new launcher, broker/session handling, preview Agent dependency, restore/bundle-cleanup rules, and cross-platform guidance create an ongoing maintenance obligation. Instrumentation being opt-in limits its impact on ordinary builds, but does not remove that cost.

DevFlow has useful capabilities, and the inspection examples in this PR show that. I just do not see enough demonstrated incremental value over the existing workflow to justify this repository-wide adoption. I would keep the current workflow and reconsider a narrower integration if real debugging tasks show repeatable end-to-end time savings, fewer failed attempts, or lower actual agent usage.

if (-not (Test-Path -LiteralPath $bundle -PathType Container)) { throw "Built app bundle not found: $bundle" }
$null = Invoke-DevFlowProcess -Program 'xcrun' -Arguments @('simctl', 'install', $DeviceId, $bundle) `
-WorkingDirectory $RepoRoot -LogPrefix (Join-Path $ArtifactDirectory 'install') -TimeoutSeconds 120
$null = Invoke-DevFlowProcess -Program 'xcrun' `

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.

❌ Race Condition — A second iOS launch of this project/TFM on another simulator leaves the first app running, but the pinned broker keys Agents only by project + TFM, not by MauiDevFlowSessionId. The registrations therefore replace each other; reconnect and disconnect cleanup can make devflow list flap or lose the live registration, so this launcher's session filter/readiness becomes nondeterministic. Reject an existing live project/TFM instance before launching another device, or make broker registration/removal session-aware, and cover two simulators running the same build.

Flagged by: 3/3 reviewers after dispute

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

Second adversarial pass found one additional issue:

  • ❌ Race Condition — Concurrent iOS Sandbox instances for the same project/TFM collide in the shared broker because session ID is not part of registration identity. 3/3 reviewers after dispute.

The PR head is unchanged, so the previously posted findings remain applicable; they are not duplicated here. The launcher tests do not cover registration ownership across two iOS simulators.

Methodology: 3 independent reviewers with adversarial consensus. Per request, no MAUI build, test run, or CI assessment was performed.

This branch had an error being deployed

1 failed and 1 inactive deployments
copilot-pat-pool — e7d6b44d Deployed Sep 19, 2026 by kubaflo via conclusion #1974
skill-evaluation-pat-pool — e7d6b44d Deployed Sep 19, 2026 by kubaflo via evaluate (try-fix) #23771
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants