Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
5825a18
fix(macOS): external trackpad handle
ajpinedam Feb 11, 2026
00febe2
fix(macOS): external trackpad events
ajpinedam Feb 13, 2026
a960a5a
test: manual test for trackpad events when using webview2
ajpinedam Feb 13, 2026
7f12c9c
chore: apply code suggestion
ajpinedam Feb 13, 2026
1384233
chore: remove reset method
ajpinedam Feb 13, 2026
d42a73a
chore: apply suggestions from code review
ajpinedam Feb 13, 2026
59bfc59
chore: remove un needed validation
ajpinedam Feb 13, 2026
364bf63
fix: include ThemeResource reason in Hot Reload resource binding updates
vatsashah45 Feb 11, 2026
17864a3
Initial plan
Copilot Feb 19, 2026
b05e637
fix: Use OpenPlayground() method to load Playground sample correctly
Copilot Feb 19, 2026
8c05e29
fix: Use correct category name without closing menu pane
Copilot Feb 19, 2026
f150689
chore: accept pr suggestion
ajpinedam Feb 19, 2026
e5f4427
chore: improve ImageAssert.AreSimilarAsync perf
Xiaoy312 Feb 19, 2026
1b3c574
feat: implement discovery functionality for Uno SDK and DevServer
carldebilly Feb 4, 2026
ece8925
docs: Added spec for fast devserver startup work - first draft of the…
carldebilly Feb 13, 2026
2a65f2e
docs: v2 of the specs for devserver launch discovery
carldebilly Feb 14, 2026
620b8cb
docs: Final adjustments
carldebilly Feb 14, 2026
2e93c19
docs: final specs for devserver discovery
carldebilly Feb 14, 2026
2b4d2a2
feat: convention-based add-in discovery for DevServer startup
carldebilly Feb 14, 2026
4310d02
feat: add dotnet version cache, EntryPoint regression tests, and doc …
carldebilly Feb 14, 2026
47318c1
feat: instant MCP start with tool cache, bounded timeouts, and health…
carldebilly Feb 14, 2026
4c83c9a
test: add Phase 0 unit tests and integration tests for devserver disc…
carldebilly Feb 14, 2026
949e3dc
ci: Fix build
carldebilly Feb 14, 2026
2c15267
feat: upgrade MCP SDK to 0.8.0, add health resource and cache metadata
carldebilly Feb 14, 2026
e25d686
feat: bypass controller for direct server launch in MCP mode (Phase 1b)
carldebilly Feb 14, 2026
b435e15
fix: resolve 4 prerequisite bugs for hot reconnection (Phase 1c-1)
carldebilly Feb 14, 2026
42d25d2
refactor: extract HealthService from McpProxy
carldebilly Feb 14, 2026
3527dff
refactor: extract ToolListManager from McpProxy
carldebilly Feb 14, 2026
258413c
refactor: rename McpClientProxy to McpUpstreamClient
carldebilly Feb 14, 2026
8176acb
refactor: extract McpStdioServer from McpProxy
carldebilly Feb 14, 2026
bc4dbc7
refactor: rename McpProxy to ProxyLifecycleManager
carldebilly Feb 14, 2026
86a303e
refactor: split test class, add XML docs, clean up legacy naming
carldebilly Feb 14, 2026
79a1008
feat: add ConnectionState enum and HealthReport integration
carldebilly Feb 14, 2026
3d7aa48
feat: wire ServerCrashed for hot reconnection
carldebilly Feb 14, 2026
ad10b2a
test: add reconnection and state transition tests
carldebilly Feb 15, 2026
e6c8caa
docs: add state machine documentation to ConnectionState
carldebilly Feb 15, 2026
36d08bb
feat: wire Launching and Shutdown state transitions
carldebilly Feb 16, 2026
7623677
feat: declare MCP ServerInfo for protocol compliance
carldebilly Feb 16, 2026
a30d7b2
fix: replace hardcoded client names with capability detection
carldebilly Feb 16, 2026
d6a0b57
refactor: use InformationalVersion for assembly version
carldebilly Feb 16, 2026
8538d72
test: add missing state transition and ServerInfo tests
carldebilly Feb 17, 2026
e12eb85
feat: expose DiscoveryInfo from DevServerMonitor
carldebilly Feb 18, 2026
13a667e
feat: add DiscoveryIssueMapper and wire into HealthService
carldebilly Feb 18, 2026
575be98
feat: add ManifestAddInResolver for devserver-addin.json
carldebilly Feb 18, 2026
95c0523
feat: integrate manifest-first discovery into add-in resolution
carldebilly Feb 18, 2026
4995bd1
feat: map add-in discovery errors to health IssueCode values
carldebilly Feb 18, 2026
2b88a46
docs: add code-level documentation for Phase 3 features
carldebilly Feb 18, 2026
be9a8b0
fix: prevent phantom crash on AmbientRegistry reuse and inject hostVe…
carldebilly Feb 18, 2026
3122259
fix: harden DevServer monitor with race fixes, health polling and han…
carldebilly Feb 18, 2026
4b7ddcb
fix: resettable startup guard, stale connection disposal and readines…
carldebilly Feb 18, 2026
d1ec0f1
feat: parse project.assets.json for third-party add-in discovery
carldebilly Feb 18, 2026
de71a00
fix: make DiscoveryInfo and ResolvedAddIn public to match DevServerMo…
carldebilly Feb 20, 2026
240b030
test: add backward-compatibility tests for DevServer CLI discovery
carldebilly Feb 20, 2026
2ba0972
fix: report cached tool count in health regardless of upstream state
carldebilly Feb 20, 2026
1752f0f
fix: validate roots argument in force-roots-fallback path
carldebilly Feb 20, 2026
65c4871
test: use cross-platform process in MonitorDecisions tests
carldebilly Feb 20, 2026
c35977a
fix: propagate package list errors to trigger MSBuild fallback
carldebilly Feb 20, 2026
69a8bcc
docs: clarify null vs empty-string semantics in add-in resolution
carldebilly Feb 20, 2026
203ee95
docs: update agent doc to reflect capability-based client detection
carldebilly Feb 20, 2026
ec16987
test: expect exception from invalid packages.json after error propaga…
carldebilly Feb 20, 2026
5cb3f57
fix: ensure implemented toc.yml is valid for DocFX when no views are …
carldebilly Feb 20, 2026
1d218cc
docs: add disco command documentation
carldebilly Feb 20, 2026
1d6fa80
fix: use JsonException instead of JsonReaderException in test
carldebilly Feb 20, 2026
ea19519
docs: add prerequisites section to disco page
carldebilly Feb 20, 2026
4261383
docs: add disco ball to disco page
carldebilly Feb 20, 2026
d87599c
fix: spelling and markdown lint in disco page
carldebilly Feb 20, 2026
3b7656d
fix: reuse discovery.AddIns in ResolveAddInsForCommand
carldebilly Feb 20, 2026
192bde9
fix: trigger tool cache lazy-load in health report
carldebilly Feb 20, 2026
7f34e7b
test: use cross-platform process in MonitorDecisionsTests
carldebilly Feb 20, 2026
041d70c
feat: Make Runtime tests console log more reliable
MartinZikmund Feb 21, 2026
ae455c6
chore: Increase retryCountOnTaskFailure to 10 for native Android & iO…
MartinZikmund Feb 21, 2026
a635736
Merge pull request #22705 from unoplatform/dev/mazi/runtime-tests-jum…
morning4coffe-dev Feb 22, 2026
a60a9a2
Merge pull request #22706 from unoplatform/dev/mazi/ios-retries
MartinZikmund Feb 22, 2026
2f2b2b6
fix(test): launch Host exe/dll correctly per platform in CLI tests
carldebilly Feb 23, 2026
5ea26fb
fix(test): avoid port collision in McpModeWithRootsFallback test
carldebilly Feb 23, 2026
f891a43
Merge pull request #22629 from ajpinedam/fix/macOS.external.trackpad.…
ajpinedam Feb 23, 2026
08a0d10
feat(Skia): Implement PlaneProjection and Matrix3DProjection
MartinZikmund Jan 22, 2026
6bf914c
test: Add runtime tests and SamplesApp samples for Projection
MartinZikmund Jan 22, 2026
c8694ba
test: Add tests to projitems
MartinZikmund Jan 22, 2026
d24128d
fix: Build issues
MartinZikmund Jan 22, 2026
9297a3f
fix: Adjust `PlaneProjection` logic
MartinZikmund Jan 22, 2026
5529a0b
fix: RotationX direction
MartinZikmund Jan 22, 2026
35a9f02
chore: Show numeric values
MartinZikmund Feb 6, 2026
1650bff
chore: Address comments
MartinZikmund Feb 17, 2026
3e06a14
chore: Avoid breaking change
MartinZikmund Feb 18, 2026
9fb6b4f
chore: Adjust test
MartinZikmund Feb 18, 2026
e7d79b0
chore: Avoid API diff
MartinZikmund Feb 20, 2026
4ac11f7
fix(test): harden Codex integration test against LLM flakiness
carldebilly Feb 23, 2026
a10e9b0
Merge pull request #22634 from unoplatform/fix/hot-reload-theme-resou…
vatsashah45 Feb 23, 2026
ad0fda2
fix: don't use grapheme clusters after they have removed from a line …
ramezgerges Feb 23, 2026
3f21f5f
test: Adjust all tests to pass on WinUI
MartinZikmund Feb 23, 2026
b0a7bcc
chore: fix assignment timing mistake
ramezgerges Feb 23, 2026
d7c3dee
test: add tests
ramezgerges Feb 23, 2026
1315216
fix: Adjust `Matrix3D` logic
MartinZikmund Feb 23, 2026
4827381
fix: address review comments (quick fixes)
carldebilly Feb 23, 2026
051d48d
docs: remove Business tier section and MSBuild mention
carldebilly Feb 23, 2026
97e97e5
docs: spec cleanup and IDE compat move to agent
carldebilly Feb 23, 2026
26840a0
fix: include rollForward/allowPrerelease in dotnet version cache key
carldebilly Feb 23, 2026
87607c8
feat: support globalPackagesFolder from nuget.config
carldebilly Feb 23, 2026
eb93358
fix(test): install CLI as local tool in compat tests
carldebilly Feb 23, 2026
2a7be3f
fix: Address default rendering behavior
MartinZikmund Feb 23, 2026
280cfef
test: Empty `Matrix3DProjection`
MartinZikmund Feb 23, 2026
55129e3
chore: Address comments
MartinZikmund Feb 23, 2026
c073ad8
Merge pull request #22695 from unoplatform/dev/xygu/20260219/image-as…
Xiaoy312 Feb 23, 2026
16b382a
fix: normalize 2-part NuGet versions when resolving cache paths
carldebilly Feb 23, 2026
5b35a7f
docs: strengthen root-cause guidance for agents
agneszitte Feb 23, 2026
afa3154
feat: expose uno_health tool and resource in Host HTTP MCP
carldebilly Feb 23, 2026
2fc3adf
Merge pull request #22714 from ramezgerges/text_trimming_crash
ramezgerges Feb 23, 2026
dd983f4
fix(win32): avoid flickering when attaching windows
ramezgerges Feb 23, 2026
0aa418f
chore: ensure arranging after attaching
ramezgerges Feb 23, 2026
6c9f8d3
chore: Address comment
MartinZikmund Feb 23, 2026
8453f3b
chore: Add missing using
MartinZikmund Feb 23, 2026
2903860
Merge pull request #22449 from unoplatform/dev/mazi/planeprojection
MartinZikmund Feb 24, 2026
50e4d57
Merge pull request #22681 from unoplatform/copilot/fix-playground-def…
MartinZikmund Feb 24, 2026
23f7f9d
feat: expose active server info in disco command
carldebilly Feb 24, 2026
17a3d79
feat: forward ideChannel through start command and expose in disco
carldebilly Feb 24, 2026
26d1f99
fix: add check before enumerating trim point candidates
ramezgerges Feb 24, 2026
acf8bce
chore: remove DotNetVersionCache
carldebilly Feb 24, 2026
a77c0c2
feat: support multiple active servers, prefix disco fields, reorder H…
carldebilly Feb 24, 2026
83d8da6
Merge pull request #22716 from ramezgerges/webview_win32_flicker
clairernovotny Feb 24, 2026
197bebe
Merge pull request #22715 from unoplatform/dev/agzi/agents-root-cause…
agneszitte Feb 24, 2026
d29da14
Merge pull request #22704 from unoplatform/dev/cdb/devserver-discovery
carldebilly Feb 24, 2026
66171b4
Merge pull request #22724 from ramezgerges/text_trimming_enumeration_…
agneszitte Feb 24, 2026
37c9b16
test: A11y on WASM
MartinZikmund Feb 11, 2026
15522b8
docs: A11y on WASM spec
MartinZikmund Feb 11, 2026
365117e
feat: A11y on WASM
MartinZikmund Feb 11, 2026
6874390
chore: A11y
MartinZikmund Feb 15, 2026
2fe1e78
chore: Adjustments to a11y Wasm skia implementation
morning4coffe-dev Feb 26, 2026
8ad3b52
fix: Remove duplicate AutomationPeer member definitions and activate …
morning4coffe-dev Feb 26, 2026
759d2a4
chore: Clean up a11y branch issues
morning4coffe-dev Feb 26, 2026
6e56802
chore: Adjust using directive for Uno.UI.Runtime.Skia based on HAS_UNO
morning4coffe-dev Feb 27, 2026
89906ea
chore: Replace GetOrCreateAutomationPeer with CreatePeerForElement
morning4coffe-dev Feb 27, 2026
d27aa21
chore: Replace GetOrCreateAutomationPeer with CreatePeerForElement in…
morning4coffe-dev Feb 27, 2026
042454a
chore: Enhance accessibility by calculating visual offsets relative t…
morning4coffe-dev Feb 28, 2026
a5e34c1
chore: Temporarily disable accessibility tests for validation
morning4coffe-dev Feb 28, 2026
c03393e
chore: Replace CV with logging
morning4coffe-dev Feb 28, 2026
4ede85b
chore: Adjust formatting
morning4coffe-dev Feb 28, 2026
a70faa4
chore: Temporarly Increase timeout for Skia Browser Runtime Tests
morning4coffe-dev Feb 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 258 additions & 0 deletions .github/agents/devserver-agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
---
name: DevServer Agent
description: Helps with DevServer CLI/Host build, test, MCP proxy, and add-in discovery
---

# DevServer Agent

You are an assistant that helps maintain and extend the Uno DevServer infrastructure. This covers the CLI tool, the Host process, MCP proxy integration, and add-in discovery.

---

## 1. Architecture Overview

The DevServer uses a **3-process chain**:

1. **CLI** (`Uno.UI.DevServer.Cli`) – Entry point, user-facing commands, MCP STDIO proxy
2. **Controller** (optional, launched by CLI `start` command) – Manages the Host lifecycle
3. **Host** (`Uno.UI.RemoteControl.Host`) – ASP.NET Core server for Hot Reload, IDE channel, processors

The CLI can also run in **MCP mode** (`--mcp-app`), acting as a Model Context Protocol proxy between AI agents and the running DevServer Host.

### Key Packages

| NuGet Package | Contents |
|---------------|----------|
| `Uno.DevServer` | CLI tool (installed via `dotnet tool`) |
| `Uno.WinUI.DevServer` | Host binaries, processors, BuildTransitive targets |

---

## 2. Key Source Directories

| Directory | Purpose |
|-----------|---------|
| `src/Uno.UI.DevServer.Cli/` | CLI tool: commands, helpers, MCP proxy |
| `src/Uno.UI.DevServer.Cli/Helpers/` | Discovery, caching, process helpers |
| `src/Uno.UI.DevServer.Cli/Mcp/` | MCP server, client proxy, tool caching |
| `src/Uno.UI.RemoteControl.Host/` | Host process: server, extensibility, IDE channel |
| `src/Uno.UI.RemoteControl.Host/Extensibility/` | Add-in loading and discovery |
| `src/Uno.UI.RemoteControl.DevServer.Tests/` | Unit and integration tests |
| `build/test-scripts/` | PowerShell integration test harness |
| `build/nuget/Uno.WinUI.DevServer.nuspec` | NuGet package definition |

### Key Files

| File | Role |
|------|------|
| `CliManager.cs` | CLI command router (start, stop, list, disco, login, MCP) |
| `UnoToolsLocator.cs` | SDK and package discovery from global.json, NuGet cache, and AmbientRegistry |
| `TargetsAddInResolver.cs` | Fast add-in discovery by parsing `.targets` XML files |
| `ManifestAddInResolver.cs` | Manifest-first add-in discovery from `devserver-addin.json` |
| `DotNetVersionCache.cs` | Caches `dotnet --version` result on disk |
| `McpStdioServer.cs` | MCP STDIO server entry point |
| `ProxyLifecycleManager.cs` | MCP proxy lifecycle orchestration |
| `McpUpstreamClient.cs` | HTTP client to upstream DevServer MCP endpoint |
| `ToolListManager.cs` | Tool list management and caching |
| `DevServerMonitor.cs` | DevServer process health monitoring and crash recovery |
| `MonitorDecisions.cs` | Pure decision logic extracted from DevServerMonitor for testability |
| `RemoteControlServer.cs` | Host: WebSocket server, processor management |
| `AddIns.cs` | Host: add-in discovery and assembly loading |

---

## 3. Build

The DevServer projects are **independent of the UI framework** and do not require `crosstargeting_override.props`.

```bash
# CLI
dotnet build src/Uno.UI.DevServer.Cli/Uno.UI.DevServer.Cli.csproj

# Host
dotnet build src/Uno.UI.RemoteControl.Host/Uno.UI.RemoteControl.Host.csproj

# Unit tests
dotnet build src/Uno.UI.RemoteControl.DevServer.Tests/Uno.UI.RemoteControl.DevServer.Tests.csproj
```

---

## 4. Testing

### Unit Tests

```bash
dotnet test src/Uno.UI.RemoteControl.DevServer.Tests/Uno.UI.RemoteControl.DevServer.Tests.csproj
```

The test project **links source files** from CLI/Host projects (rather than referencing project outputs) to avoid circular dependencies. When adding new source files for testing, add a `<Compile Include>` link in the `.csproj`.

### Integration Tests

The PowerShell script `build/test-scripts/run-devserver-cli-tests.ps1` provides integration testing with `-DevServerCliDllPath` to point to a local build.

### Test Patterns

- **Framework**: MSTest with AwesomeAssertions
- **Naming**: `Test_WhenCondition_ShouldExpectation`
- **Execution**: Sequential (`[assembly: Parallelize(Workers = 1)]`)
- **Isolation**: Tests use temp directories for file I/O, injectable delegates for subprocess mocking

---

## 5. CLI Commands

| Command | Description |
|---------|-------------|
| `start` | Start the DevServer for the current folder |
| `stop` | Stop the DevServer for the current folder |
| `list` | List active DevServer instances |
| `disco` | Discover environment, SDK details, and active server instance |
| `login` | Open the Uno Platform settings application |
| `--mcp-app` | Start in MCP STDIO proxy mode |

### Key Flags

| Flag | Description |
|------|-------------|
| `-l trace` | Enable trace-level logging (useful for debugging) |
| `-fl <path>` | File logging with `{Date}` token support |
| `--json` | JSON output for disco command |
| `--addins-only` | Output only resolved add-in paths |
| `--mcp-wait-tools-list` | Wait for upstream tools before responding to `list_tools` |
| `--force-roots-fallback` | Expose `uno_app_set_roots` for clients without roots support |
| `--force-generate-tool-cache` | Force tool cache generation on startup |
| `--solution-dir <path>` | Explicit solution root |

---

## 6. Add-in Discovery

### Manifest-First Path (`devserver-addin.json`)

`ManifestAddInResolver` looks for a `devserver-addin.json` manifest in each NuGet package root. When present, it resolves add-in entry points directly from the manifest, supporting `minHostVersion` gating to filter incompatible add-ins.

### Fast Path (`.targets` parsing, ~200ms)

`TargetsAddInResolver` parses `packages.json` from the Uno SDK and `buildTransitive/*.targets` files from NuGet packages to extract `<UnoRemoteControlAddIns>` items without invoking MSBuild. Used as fallback when no manifest is found.

### MSBuild Fallback (10-30s)

When both fast paths fail, the Host falls back to `dotnet build` evaluation. The `--addins` flag on the Host bypasses this when paths are pre-resolved by the CLI.

### Key Files

- `ManifestAddInResolver.cs` – Manifest-first discovery
- `TargetsAddInResolver.cs` – `.targets` parsing fallback
- `AddIns.cs` (Host) – Assembly loading and MSBuild fallback

---

## 7. NuGet Packaging

The `Uno.WinUI.DevServer` package (`build/nuget/Uno.WinUI.DevServer.nuspec`) ships:

- Host binaries for `net9.0` and `net10.0`
- Processor DLLs
- BuildTransitive targets for MCP and Settings add-ins

To test with a local build, use `UnoNugetOverrideVersion` or set `-DevServerCliDllPath` in integration tests.

---

## 8. MCP Proxy

The MCP proxy (`McpStdioServer.cs` / `ProxyLifecycleManager.cs`) runs in STDIO mode and bridges AI agents to the DevServer Host.

### Key Behavior

- Returns cached tool definitions instantly while Host launches in background
- Tool cache persisted to `%LOCALAPPDATA%/Uno Platform/uno.devserver/tools-cache.json`
- Sends `tools/list_changed` notification when tools become available
- Detects client capabilities (roots support) via `ClientCapabilities.Roots` to adapt behavior

### Key Files

| File | Role |
|------|------|
| `McpStdioServer.cs` | MCP STDIO server entry point |
| `ProxyLifecycleManager.cs` | MCP proxy lifecycle orchestration |
| `McpUpstreamClient.cs` | HTTP proxy to Host MCP endpoint |
| `ToolListManager.cs` | Tool list management and caching |
| `DevServerMonitor.cs` | Process health monitoring and crash recovery |
| `MonitorDecisions.cs` | Pure decision logic (post-startup action, roots detection, start guard) |
| `ToolCacheFile.cs` | Persistent tool cache serialization |

---

## 9. Common Maintenance Tasks

### Adding a CLI Command

1. Add command handling in `CliManager.cs` (follow existing `start`/`stop`/`disco` pattern)
2. Add help text in `Program.cs`
3. Add integration test in `build/test-scripts/run-devserver-cli-tests.ps1`

### Modifying Host Startup

1. Edit `src/Uno.UI.RemoteControl.Host/Program.cs` for command routing
2. Edit `Startup.cs` for ASP.NET Core configuration
3. Test with `dotnet run` from the Host project directory

### Modifying Add-in Discovery

1. Edit `TargetsAddInResolver.cs` for fast path changes
2. Add unit tests in `TargetsAddInResolverTests.cs`
3. Verify with `uno-devserver disco --json` in a real project

### Modifying MCP Proxy

1. Edit `McpStdioServer.cs` / `ProxyLifecycleManager.cs` / `ToolListManager.cs` for tool list or protocol changes
2. Test with `--mcp-app` flag and an MCP client (Claude Code, etc.)
3. Check `--mcp-wait-tools-list` behavior for clients without `tools/list_changed`

---

## 10. IDE Compatibility Constraints

**All three IDE extensions launch the Host directly** β€” none use `--command start` (the controller path). The controller is only used by CLI `start`. This means:
- AmbientRegistry duplicate protection **does not exist** for IDE-launched instances
- Each IDE manages its own DevServer lifecycle independently
- **Multiple instances for the same solution** are possible today (IDE + CLI, or IDE + MCP)
- The `--addins` flag MUST be opt-in: absence = MSBuild discovery unchanged

### Active Server Discovery

`disco --json` returns an `activeServer` field (null or object with `processId`, `port`, `mcpEndpoint`, `parentProcessId`, `startTime`) by querying the AmbientRegistry. This is the recommended way for extensions to detect a running DevServer without reading registry files directly.

### Visual Studio (`uno.studio`)

The VS extension (`DevServerLauncher.cs`, `EntryPoint.cs`) uses **reflection** to probe:
- `Uno.UI.RemoteControl.VS.EntryPoint` (namespace + class name)
- Constructor signatures v2 and v3

**Never rename or change constructor signatures** without coordinating with the VS extension team. Regression tests in `EntryPointRegressionTests.cs` verify these contracts.

Launch flow: finds `uno.winui.devserver` package in project references β†’ resolves `tools/rc/host/net{major}.0/Uno.UI.RemoteControl.Host.dll` β†’ launches Host directly with `--httpPort {port} --ppid {pid} --solution {sln}`.

### Rider (`uno.rider`)

Fast path: inspect project references, find `uno.winui.devserver` NuGet package, derive host path from `dotnet --version`. Fallback: `dotnet build /t:GetRemoteControlHostPath`. Launches Host directly (no `--command start`). Port managed via `CsprojUserGenerator`.

### VS Code (`uno.vscode`)

Always uses MSBuild: `dotnet build /t:GetRemoteControlHostPath`. Launches Host directly with `--httpPort {port}`. Supports external-host debug mode via `.uno.vscode.remote-control` marker file.

### Host Command-Line Contract

The Host accepts arguments via `ConfigurationBuilder.AddCommandLine()`. The `--addins` flag is opt-in to maintain backward compatibility with older CLI versions.

---

## 11. References

- [Dev Server documentation](../../doc/articles/dev-server.md)
- [Specs](../../specs/001-fast-devserver-startup/)
- [Integration test script](../../build/test-scripts/run-devserver-cli-tests.ps1)
- [NuGet spec](../../build/nuget/Uno.WinUI.DevServer.nuspec)
83 changes: 83 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Uno Platform is an open-source .NET UI cross-platform framework for building .NE
| Source Generators | `.github/agents/source-generators-agent.md` | XAML/DependencyObject generator work |
| Runtime Tests | `.github/agents/runtime-tests-agent.md` | Creating and running runtime tests |
| WinUI Porting | `.github/agents/winui-porting-agent.md` | Porting WinUI C++ code to C# |
| DevServer CLI | `.github/agents/devserver-agent.md` | DevServer CLI/Host build, test, MCP proxy |

---

Expand Down Expand Up @@ -50,6 +51,8 @@ Uno Platform is an open-source .NET UI cross-platform framework for building .NE
- `src/SourceGenerators/` - XAML parser, DependencyProperty generator
- `src/SamplesApp/` - Sample app for validation and tests
- `src/Uno.UI.RuntimeTests/` - Platform runtime tests
- `src/Uno.UI.DevServer.Cli/` - DevServer CLI tool
- `src/Uno.UI.RemoteControl.Host/` - DevServer Host process

### Build Setup (Required)

Expand Down Expand Up @@ -138,6 +141,85 @@ Auto-generated stubs marked with `[Uno.NotImplemented]` allow compilation but wa

## Development Workflow

### Root-Cause First Debugging Protocol (MANDATORY)

When fixing crashes, rendering issues, or selection/indexing bugs,
agents must follow this order:

1. **Reproduce first**
- Capture exact repro steps and expected vs actual behavior.
- Keep one known-good repro path and rerun it after each meaningful change.

2. **Identify the broken invariant**
- Prefer state/lifecycle invariants over symptom-level checks.
- For pipelines that derive secondary state, verify those derived
structures (for example: maps, indices, caches, or metadata)
are rebuilt from final post-mutation state.

3. **Fix root cause before adding guards**
- Do not lead with null/index guards as the primary fix if
ownership/lifecycle is incorrect.
- Defensive guards are allowed only after root-cause correction,
and only as secondary hardening.

4. **Prove correctness with targeted tests**
- Add/extend tests that fail before and pass after the root fix.
- Cover both the triggering scenario and one adjacent regression scenario.

5. **Validate with runtime behavior, not compile only**
- Run the closest runtime or integration path available for the changed area.
- If full runtime execution is not possible in the environment,
state that explicitly and provide the exact command(s) for
maintainers to run.

6. **Communicate confidence accurately**
- Separate: (a) code review assessment,
(b) compile validation, (c) runtime validation.
- Never present guard-only mitigation as a complete root-cause fix.

**Anti-pattern to avoid:**

- Symptom-driven patching that accumulates bounds checks while
stale or invalid intermediate state remains possible.

### Validation Evidence Protocol (MANDATORY)

For bug fixes and PR reviews, agents must report validation evidence
with explicit labels:

- **Code review assessment**: What logic appears correct by inspection.
- **Compile validation**: Which project/solution was built, and result.
- **Runtime validation**: Which app/test path was executed, and result.

Rules:

1. Do not present compile-only checks as runtime validation.
2. If runtime execution is skipped or blocked, state that explicitly
and provide exact commands to run.
3. When reviewing another PR, distinguish between confidence from
diff inspection vs. confidence from local execution.

### Diagnosis Bias Checks (MANDATORY)

Before proposing a crash fix, agents must run these checks to avoid
choosing symptom-level guards over the real fix:

1. **Invariant checkpoint before patching**
- Name the invariant likely broken (ownership, lifecycle,
index/map coherence, post-mutation consistency).
- If no invariant is identified, do not claim a root-cause fix.

2. **Mutation-point review**
- Inspect where state is created/trimmed/reordered and verify all
dependent structures are refreshed there.
- Prefer correcting the mutation point over adding protections in
downstream consumers.

3. **Guard classification**
- Explicitly label each proposed change as either
`root-cause fix` or `defensive hardening`.
- Guard-only changes must not be presented as complete resolution.

### Validation Checklist

Run these after making changes:
Expand Down Expand Up @@ -312,6 +394,7 @@ Guidelines:
- `.github/agents/source-generators-agent.md` - XAML/DependencyObject generators
- `.github/agents/runtime-tests-agent.md` - Runtime test execution
- `.github/agents/winui-porting-agent.md` - WinUI C++ to C# porting
- `.github/agents/devserver-agent.md` - DevServer CLI/Host maintenance

### Community
- [Discord](https://platform.uno/discord)
Expand Down
11 changes: 11 additions & 0 deletions build/Uno.UI.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@
BuildInParallel="true" />

<Exec Command="..\src\Uno.UWPSyncGenerator\Bin\Release\Uno.UWPSyncGenerator.exe &quot;doc&quot;" />

<!-- Ensure implemented/toc.yml is valid for DocFX (DocGenerator may produce an empty file when no views are analyzed) -->
<PropertyGroup Condition="Exists('..\doc\articles\implemented\toc.yml')">
<_TocLength>$([System.IO.File]::ReadAllText('..\doc\articles\implemented\toc.yml').Trim().Length)</_TocLength>
</PropertyGroup>
<WriteLinesToFile
File="..\doc\articles\implemented\toc.yml"
Lines="# Generated by Uno.UWPSyncGenerator (DocGenerator.cs);- name: Placeholder"
Condition="!Exists('..\doc\articles\implemented\toc.yml') Or '$(_TocLength)' == '' Or '$(_TocLength)' == '0'"
Overwrite="true" />

<Exec Command="powershell .\import_external_docs.ps1" WorkingDirectory="..\doc" />
<Exec Command="powershell .\generate-llms-full.ps1 -InputFolder &quot;articles&quot; -LlmsTxtOutput &quot;articles/llms/llms.txt&quot; -LlmsFullTxtOutput &quot;articles/llms/llms-full.txt&quot; -BaseContentFile &quot;articles/llms/llms.txt&quot; -TocYmlPath &quot;articles/toc.yml&quot;" WorkingDirectory="..\doc" />
<Exec Command="dotnet tool install --tool-path $(MSBuildThisFileDirectory)\tools docfx --version $(DocfxVersion)" Condition="!exists('$(MSBuildThisFileDirectory)\tools\docfx.exe')" />
Expand Down
1 change: 1 addition & 0 deletions build/cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"datagrid",
"decompile",
"devs",
"devserver",
"dbus",
"Dismissable",
"dmgbuild",
Expand Down
Loading
Loading