Skip to content

feat(25): CLI parity surface for devtools MCP - #39

Merged
Chris Anderson (codemonkeychris) merged 4 commits into
mainfrom
feat/25-devtools-cli-parity
Apr 19, 2026
Merged

Chris Anderson (codemonkeychris) merged 4 commits into
mainfrom
feat/25-devtools-cli-parity

Conversation

@codemonkeychris

Copy link
Copy Markdown
Collaborator

Summary

  • Implements spec 025: every MCP devtools tool now has a mur devtools <verb> equivalent plus a generic call passthrough, composable with shell pipes and jq.
  • Adds a lockfile contract under %TEMP%/reactor-devtools/ so the CLI attaches to a running session with zero config (no port, no env vars, no stdout parsing).
  • Adds a new shutdown MCP tool + CLI verb for clean exit (distinct from reload's exit-42 sentinel) so build-output file locks release.

What changed

Server side (src/Reactor/Hosting/Devtools/)

  • LockfileRegistry — writes/reads/liveness-probes session lockfiles. Path is SHA-256 of the canonical csproj path, truncated to 16 hex.
  • DevtoolsMcpServer writes the lockfile on AnnounceReady, removes on Dispose; IsAnotherSessionActive enforces single-instance per project (exit code 3 on collision).
  • New shutdown tool closes the app cleanly with exit 0.

CLI side (src/Reactor.Cli/Devtools/)

  • EndpointDiscovery — resolves --endpoint > lockfile scan (port-scan --auto deferred to Phase 3).
  • McpCliClient — thin JSON-RPC client with error → exit-code mapping.
  • DevtoolsVerbs — one method per MCP tool (version, windows, components, switch, tree, screenshot, state, click, type, focus, invoke, toggle, select, scroll, expand, collapse, wait, fire, reload, shutdown) plus a generic call passthrough.
  • SessionCommands — session list [--pretty] and session clean [--dry-run].
  • DevtoolsSupervisor routes session subverbs and named verbs before the launcher path; forwards --devtools-project to the child.

Skills

  • skills/devtools.md rewritten CLI-first. Attach-first is the recommended flow (plain dotnet run -- --devtools run is the default launch); supervisor mode (mur devtools <project>) is called out as the exception for stable-port reload loops, not the default.
  • SKILL.md sub-skill description points at mur devtools.

Exit code contract (§9)

Code Meaning
0 Success
1 Usage error
2 Transport error
3 Another session active for this project
4 No live session found
5 Tool returned a JSON-RPC error

Test plan

  • Unit tests — LockfileRegistry hash stability / round-trip / liveness, EndpointDiscovery explicit-endpoint bypass, DevtoolsVerbs shared-flag parsing + KnownVerbs coverage, SupervisorArgs updated for --devtools-project.
  • dotnet test Reactor.sln — 4252 unit + 106 app tests pass.
  • Manual E2E against samples/Reactor.TestApp: every named verb + call passthrough verified, shutdown releases the lockfile and app exits 0.

🤖 Generated with Claude Code

Implements spec 025: every MCP devtools tool now has a first-class
`mur devtools <verb>` equivalent that composes with shell pipes and
jq. The CLI attaches to a running session via a lockfile under
%TEMP%/reactor-devtools/; zero config for single-terminal flows.

Server side
- LockfileRegistry writes/reads/liveness-probes session lockfiles
  (SHA-256 of canonical csproj path, truncated to 16 hex).
- DevtoolsMcpServer writes the lockfile on AnnounceReady, removes
  on Dispose; IsAnotherSessionActive enforces single-instance per
  project (exit code 3 on collision).
- New `shutdown` MCP tool closes the app cleanly (exit 0) so the
  supervisor returns without rebuilding and build-output locks
  release. Distinct from reload's exit 42.

CLI side
- EndpointDiscovery resolves --endpoint > lockfile scan (port
  scan deferred to Phase 3 per spec).
- McpCliClient: thin JSON-RPC client with error -> exit code map.
- DevtoolsVerbs: one method per MCP tool plus a generic `call`
  passthrough guaranteeing parity from day one.
- SessionCommands: `session list [--pretty]` and `session clean
  [--dry-run]`.
- DevtoolsSupervisor routes session subverbs and named verbs
  before the launcher path; forwards --devtools-project to the
  child.

Skills
- skills/devtools.md rewritten CLI-first; supervisor mode called
  out as the exception (stable port across reload cycles), not
  the default.
- SKILL.md updated to point at `mur devtools`.

Tests
- LockfileRegistry hash stability + round-trip + liveness.
- EndpointDiscovery explicit-endpoint bypass.
- DevtoolsVerbs shared-flag parsing + KnownVerbs coverage.
- SupervisorArgs updated for the new --devtools-project flag.
- All 204 devtools tests pass; full suite unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

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.

Pull request overview

Implements spec 025 by adding a CLI parity surface for the devtools MCP tools, plus lockfile-based session discovery/single-instance enforcement and a new shutdown tool/verb for clean exits.

Changes:

  • Add a %TEMP%/reactor-devtools/*.json lockfile contract for session discovery and single-instance enforcement.
  • Introduce mur devtools <verb> parity commands (plus call) backed by a thin JSON-RPC HTTP client and endpoint discovery.
  • Add a shutdown MCP tool/CLI verb and update docs + tests to match the new workflow and exit-code contract.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/Reactor.Tests/Devtools/SupervisorArgsTests.cs Updates supervisor child-arg expectations to include --devtools-project.
tests/Reactor.Tests/Devtools/LockfileRegistryTests.cs Adds unit tests for lockfile hashing/canonicalization, round-trip, and liveness behavior.
tests/Reactor.Tests/Devtools/EndpointDiscoveryTests.cs Adds tests for endpoint precedence and well-formed resolution output.
tests/Reactor.Tests/Devtools/DevtoolsVerbsTests.cs Adds tests for shared-flag extraction and known-verb inventory coverage.
tests/Reactor.AppTests.Host/SelfTest/Fixtures/DevtoolsFixtures.cs Extends test harness context to include a no-op shutdown hook.
src/Reactor/Hosting/ReactorApp.cs Wires single-instance check, project identifier derivation, and shutdown path into app hosting.
src/Reactor/Hosting/Devtools/LockfileRegistry.cs Implements server-side lockfile read/write/enumeration + liveness probing.
src/Reactor/Hosting/Devtools/DevtoolsTools.cs Adds shutdown tool registration and exposes RequestShutdown in tool context.
src/Reactor/Hosting/Devtools/DevtoolsMcpServer.cs Writes lockfile on ready, deletes on dispose, and adds IsAnotherSessionActive.
src/Reactor/Hosting/Devtools/DevtoolsCliParser.cs Parses --devtools-project and carries it into devtools options.
src/Reactor.Cli/Devtools/SessionCommands.cs Adds mur devtools session list/clean for lockfile/session management.
src/Reactor.Cli/Devtools/McpCliClient.cs Adds a minimal JSON-RPC HTTP client used by the new verbs.
src/Reactor.Cli/Devtools/LockfileReader.cs Adds CLI-side lockfile reader/liveness probe without WinUI dependencies.
src/Reactor.Cli/Devtools/EndpointDiscovery.cs Adds endpoint resolution via --endpoint or lockfile scanning.
src/Reactor.Cli/Devtools/DevtoolsVerbs.cs Implements the named-verb parity surface and generic call passthrough.
src/Reactor.Cli/Devtools/DevtoolsSupervisor.cs Routes session/named verbs before launcher parsing; forwards --devtools-project.
skills/devtools.md Rewrites devtools skill documentation CLI-first, including attach-first flow.
docs/specs/025-devtools-cli-parity.md Adds the new spec describing CLI parity, lockfiles, and exit codes.
SKILL.md Updates the devtools skill description to refer to mur devtools.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/devtools.md Resolved
Stress_1000_Keys_Mixed_Ops_Terminates_Without_Exceptions flakes on
shared CI runners but runs in <1s locally. The cts cancels workers at
500ms; the outer WaitAsync is the drain budget. Under CI contention
(virtualized cores, shared IO, background noise) flushing all tasks
through their final op plus the OS thread wake can stretch past 10s
even though it's near-instant locally.

Bumping to 60s costs nothing on the happy path and kills the flake.
Unrelated to spec 025 but fixed on this branch so the PR can merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…stream

Critical
- screenshot --out -: writing the PNG bytes to stdout used to be followed
  by EmitResult also printing the JSON envelope to stdout, corrupting
  the binary stream. Now short-circuits after the binary write; metadata
  goes to stderr and the verb returns success.
- LockfileRegistry.Write: the delete-then-rename pattern had a brief
  window where the file was missing. Switched to File.Move(overwrite:true)
  and skip the rewrite entirely when content already matches so reload
  loops don't thrash filesystem watchers. Doc string matches behavior.
- JsonDocument lifetime: EmptyArgs / ArgsFromDict / InvokeTool returned
  JsonElement values tied to undisposed JsonDocuments that the GC could
  reclaim, invalidating the element. All three now Clone before return.
- McpCliClient.Post: parsed body as JSON unconditionally, so a non-200
  / non-JSON server response threw JsonException and bypassed the
  verb's exit-code mapping. Now maps to HttpRequestException which
  the verbs already surface as DevtoolsCliExit.Transport (exit 2).

Robustness
- scroll --by parses with InvariantCulture so `,` as a decimal
  separator (de-DE, fr-FR) doesn't collide with the H,V pair
  separator.

Docs
- skills/devtools.md Gotcha #1 reworded: both legs (build flag +
  launch flag) are required, but the supervisor is explicitly not —
  `dotnet run -- --devtools run` is equally valid.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…eout

Second CI run flaked on a different test in the same file
(Resubscribe_Racing_Against_EvictNow_Retains_Entry, which had a 2-second
WaitAsync inside a 200-iteration loop). The pattern is file-wide: every
async threading test had a tight per-happy-path timeout that worked
locally but couldn't absorb CI scheduling variance.

Replaces all six WaitAsync timeouts in QueryCacheThreadingTests with a
single DrainTimeout constant (60s). The tests are still bounded by their
own CancellationTokenSource windows (250ms-5s of actual work); the drain
timeout only exists to catch a genuine deadlock. Generous ceiling
doesn't weaken any assertion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codemonkeychris
Chris Anderson (codemonkeychris) merged commit 7fffd41 into main Apr 19, 2026
3 checks passed
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 16, 2026
…elpers (#39)

Implements the foundational layers of the property & event API scrub
(spec 039). Phases 0-2 (Phase 3+ to follow in subsequent commits).

Phase 0: Scaffolding
- Added empty partial classes ElementExtensions.Events,
  ElementExtensions.NamedStyles, Factories.NamedStyles.
- Generated event-fluent inventory CSV (68 rows) under
  tests/Reactor.SelfTests/Fixtures/event-fluent-inventory.csv via
  tools/api-scrub/Build-EventFluentInventory.ps1.

Phase 1: Universal event fluents
- Hand-written extensions covering every Action/Action<T> callback on
  every element record across §1–§9, §12 (~63 fluents). Names drop the
  leading "On" to avoid the C# property-vs-extension delegate-invocation
  clash; property names unchanged.
- 63 null-clear unit tests confirm passing null clears handler.

Phase 2: Named-style helpers + Card + type-ramp factories
- .AccentButton(), .SubtleButton() on ButtonElement and its subtypes.
- .TextLink() on Hyperlink/Button.
- InputScope fluents on TextField (Numeric/Email/Url/Phone/Search) +
  generic .InputScope() escape hatch.
- InfoBar severity fluents (Informational/Success/Warning/Error).
- Card(child) factory: corner radius 8, padding 16, theme-aware
  background + stroke via ThemeRef plumbing.
- Type-ramp factories Title/Subtitle/Body/BodyStrong/BodyLarge in
  Factories.NamedStyles.cs (no matching fluents — §17.6 two-ways trap).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 16, 2026
… props, named styles (#314)

* feat(039): land Phase 0-2 — scaffolding, event fluents, named-style helpers (#039)

Implements the foundational layers of the property & event API scrub
(spec 039). Phases 0-2 (Phase 3+ to follow in subsequent commits).

Phase 0: Scaffolding
- Added empty partial classes ElementExtensions.Events,
  ElementExtensions.NamedStyles, Factories.NamedStyles.
- Generated event-fluent inventory CSV (68 rows) under
  tests/Reactor.SelfTests/Fixtures/event-fluent-inventory.csv via
  tools/api-scrub/Build-EventFluentInventory.ps1.

Phase 1: Universal event fluents
- Hand-written extensions covering every Action/Action<T> callback on
  every element record across §1–§9, §12 (~63 fluents). Names drop the
  leading "On" to avoid the C# property-vs-extension delegate-invocation
  clash; property names unchanged.
- 63 null-clear unit tests confirm passing null clears handler.

Phase 2: Named-style helpers + Card + type-ramp factories
- .AccentButton(), .SubtleButton() on ButtonElement and its subtypes.
- .TextLink() on Hyperlink/Button.
- InputScope fluents on TextField (Numeric/Email/Url/Phone/Search) +
  generic .InputScope() escape hatch.
- InfoBar severity fluents (Informational/Success/Warning/Error).
- Card(child) factory: corner radius 8, padding 16, theme-aware
  background + stroke via ThemeRef plumbing.
- Type-ramp factories Title/Subtitle/Body/BodyStrong/BodyLarge in
  Factories.NamedStyles.cs (no matching fluents — §17.6 two-ways trap).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 3.1 — CalendarView SelectedDates + SelectedDatesChanged

Models the missing multi-select event on CalendarView (spec 039 §3 +
Q4). Adds:

- CalendarViewElement.SelectedDates: declarative initial selection
  as IReadOnlyList<DateTimeOffset>?.
- CalendarViewElement.OnSelectedDatesChanged: user-event callback
  receiving a snapshot of the full selection (not added/removed delta —
  easier to bind into component state without diffing).
- Fluents .SelectedDates(...) / .SelectedDatesChanged(handler).

Reconciler wiring:

- Initial selection applied at mount BEFORE subscribing, so the
  declarative seed doesn't fire the user event.
- Subscription is unconditional; the handler reads the latest element
  via the element tag so a later record-with that attaches a handler
  picks up without re-wiring.
- Updates diff current vs desired selection and apply add/remove via
  ChangeEchoSuppressor.BeginSuppress so subsequent declarative writes
  don't echo back as user events.

Tests: null-clear unit test added. Reconciler-level "no-event-on-mount /
event-fires-once-per-user-change" deferred to Phase 11.7 (AppTests
harness — requires a WinUI runtime).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 3.2 — Frame navigation events

Adds the three commonly-needed Frame events to FrameElement (spec 039
§3.2). Modelled as Reactor-shaped substitutes — Action<Type> /
Action<Type,Exception> — matching the rest of the codebase, which
doesn't surface raw WinUI EventArgs in user-facing callbacks. Users
who need NavigationMode, NavigationParameter, or cancellation can wire
the raw event via .Set(...).

- OnNavigated: Action<Type>? — receives the new SourcePageType.
- OnNavigating: Action<Type>? — receives the target SourcePageType
  (cancellation not surfaced; spec accepts this trade for ergonomics).
- OnNavigationFailed: Action<Type, Exception>? — target + failure.

Fluents .Navigated / .Navigating / .NavigationFailed land per Phase 1
conventions. Reconciler subscribes unconditionally; the trampoline reads
the latest element via the element tag so a later record-with picks up
without re-wiring.

Sample (spec §3.2 last bullet, §8.3) deferred — requires XAML
Page-derived types, better authored alongside the rest of the Phase 8
sample sweep.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 3.3 — ScrollView.ViewChanged

Adds OnViewChanged to ScrollViewElement (spec 039 §3.3). Callback is
Action<ScrollViewerViewChangedEventArgs>? — args carry IsIntermediate
for callers who want to debounce until the scroll settles.

ScrollViewer is pooled, so subscription uses the established
PoolableWireFlags.ScrollViewerViewChanged once-per-instance gate; the
trampoline reads the live element via GetElementTag so a later
record-with that attaches the handler doesn't require re-subscription.

Fluent .ViewChanged(handler) + null-clear test. Reconciler-level
"scroll triggers callback" deferred to AppTests harness (Phase 11.7).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 3.4 — Popup.Opened

Adds OnOpened to PopupElement (spec 039 §3.4). PopupElement already
exposed OnClosed; this rounds out the lifecycle. Trampoline mirrors
the existing OnClosed wiring — both resolve the live element via the
wrapper StackPanel's element tag so updates pick up fresh closures.

Fluent .Opened(handler) + null-clear test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 3.5 — WebView2 message + init events

Adds two commonly-needed WebView2 events (spec 039 §3.5):

- OnWebMessageReceived(Action<string>?) — fired on the UI thread when
  the hosted page posts a message via window.chrome.webview.postMessage.
  Handler falls back from TryGetWebMessageAsString() to WebMessageAsJson
  so callers always receive a string payload even when the page sends
  a structured message.
- OnCoreWebView2Initialized(Action?) — fires once on the UI thread when
  the underlying CoreWebView2 is available, the earliest point at which
  features like AddScriptToExecuteOnDocumentCreatedAsync become usable.

Both subscribed unconditionally in MountWebView2 — the trampolines read
the live element via the element tag so later record-with that attaches
a handler picks up without re-subscription. Threading contract
documented in XML doc comments. Fluents and null-clear tests land.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 3.6 — MediaPlayerElement events

Adds MediaOpened, MediaEnded, and MediaFailed callbacks to
MediaPlayerElementElement (spec 039 §3.6). MediaPlayer raises these on
a worker thread, so a new DispatchToElement<TElement> helper marshals
through the element's DispatcherQueue and resolves the live element via
GetElementTag — handler is a no-op if the element has unmounted between
the event firing and the dispatched continuation.

- OnMediaOpened: Action?
- OnMediaEnded: Action?
- OnMediaFailed: Action<string>? — receives args.ErrorMessage ??
  args.Error.ToString() to keep the callback signature simple while
  preserving the most-useful failure detail.

Fluents .MediaOpened / .MediaEnded / .MediaFailed + null-clear tests.
Threading contract documented in XML doc comments. Integration test
that asserts events fire on real media playback deferred to Phase 11.7
(AppTests harness).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 4.1 — Slider init fluents

Adds five frequently-set init properties on SliderElement (spec 039 §3.8)
and the matching fluent extension methods:

- .Orientation(Orientation) — horizontal vs vertical layout
- .TickFrequency(double) — interval between tick marks
- .TickPlacement(TickPlacement) — where ticks render on the track
- .SnapsTo(SliderSnapsTo) — snap to ticks vs step values during drag
- .ThumbToolTip(bool = true) — floating value tooltip during drag

The reconciler wires all five through Mount (initial control creation)
and Update (delta-based property writes guarded by equality checks so a
no-op render doesn't bounce the control state).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 4.2 — NumberBox init fluents

Adds four init properties on NumberBoxElement (spec 039 §3.3) and the
matching fluents:

- .NumberFormatter(INumberFormatter2) — currency / percent / etc.
- .AcceptsExpression(bool = true) — arithmetic expressions like 2*3+1
- .ValidationMode(NumberBoxValidationMode) — overwrite-vs-disabled
- .Description(string) — help text rendered under the box

The reconciler writes NumberFormatter only when the reference actually
changed, so a same-formatter re-render won't reformat the text and
clobber an in-progress edit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 4.3 — ColorPicker init fluents

Adds six fluents over the existing ColorPickerElement init properties
(spec 039 §3.11) — one per visibility toggle:

- .AlphaEnabled(bool = true)
- .MoreButtonVisible(bool = true)
- .ColorSpectrumVisible(bool = true)
- .ColorSliderVisible(bool)
- .ColorChannelTextInputVisible(bool)
- .HexInputVisible(bool)

UpdateColorPicker now reconciles all five visibility flags (previously
only IsAlphaEnabled propagated through update), so flipping a toggle
mid-session takes effect on the next render.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 4.4 — TabView init fluents

Adds seven init properties on TabViewElement (spec 039 §7.4) and the
matching fluents:

- .TabWidthMode(TabViewWidthMode) — Equal / SizeToContent / Compact
- .CloseButtonOverlayMode(TabViewCloseButtonOverlayMode) — Auto / OnPointerOver / Always
- .CanDragTabs(bool = true) — detach to a new window
- .CanReorderTabs(bool = true) — drag within the strip
- .AllowDropTabs(bool = true) — accept tabs from another TabView
- .TabStripHeader(Element) — leading-edge content
- .TabStripFooter(Element) — trailing-edge content

Strip header/footer children are reconciled via the existing
ReconcileChild helper so update-in-place works (no full remount when
their content changes).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 4.5 — NavigationView init fluents

Adds six init properties on NavigationViewElement (spec 039 §7.2) and
the matching fluents:

- .AutoSuggestBox(AutoSuggestBoxElement) — pane-top search box
- .PaneFooter(Element) — pane-bottom slot below menu items
- .PaneCustomContent(Element) — slot between AutoSuggestBox and items
- .OpenPaneLength(double) — pane width when expanded
- .CompactModeThresholdWidth(double) — window width to collapse the pane
- .ExpandedModeThresholdWidth(double) — window width to auto-expand

Threshold/length init properties default to NaN so the WinUI defaults
take effect when unset (Mount/Update only writes when a real value is
provided). Pane children reconcile in place via ReconcileChild.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 4.6 — TitleBar init fluents

Adds fluents over existing TitleBarElement init properties (spec 039
§7.3):

- .BackButtonVisible(bool) / .BackButtonEnabled(bool)
- .PaneToggleButtonVisible(bool)
- .Content(Element) / .RightHeader(Element)
- .Icon(IconData) and convenience .Icon(string imageUri) — the string
  overload wraps the URI in an ImageIconData, matching the spec §7.3
  shorthand. No new init properties needed; reconciler already wires
  every target.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 4.7 — TextField init fluents

Adds five init properties on TextFieldElement (spec 039 §3.1) and the
matching fluents:

- .MaxLength(int) — character limit (0 = unlimited)
- .IsSpellCheckEnabled(bool = true) — toggle built-in spell-check
- .CharacterCasing(CharacterCasing) — Normal / Upper / Lower input
- .TextAlignment(TextAlignment) — horizontal text alignment
- .Description(string) — help text rendered below the box

InputScope is intentionally out of scope here — Phase 2.3 owns it.

The reconciler writes each property only when the WinUI TextBox value
diverges from the element, so a no-op render doesn't cause flicker.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 4.8 — HyperlinkButton .NavigateUri fluent + doc fix

Adds the .NavigateUri(Uri) fluent on HyperlinkButtonElement (spec 039
§14 #5). The init property already existed and the reconciler already
piped it through Mount and Update, so this is a pure extension method —
no record or reconciler changes.

Also updates the XML doc on HyperlinkButton(Command) — it used to send
callers to .Set() with a hand-written NavigateUri assignment. The
promise is now real: HyperlinkButton(cmd).NavigateUri(uri) compiles
and routes through the existing reconciler path. The Button(Command)
doc gets a parallel example to keep the discoverability story tight.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 5.1 — Text family init properties

Adds high-traffic init properties and matching fluents on the three
text records (spec 039 §1.1 / §1.3 / §1.4):

- TextBlockElement: .LineHeight(double), .MaxLines(int),
  .CharacterSpacing(int), .TextDecorations(TextDecorations)
- RichTextBlockElement: .MaxLines(int), .LineHeight(double),
  .TextAlignment(TextAlignment), .TextTrimming(TextTrimming),
  .CharacterSpacing(int)
- RichEditBoxElement: .IsSpellCheckEnabled(bool = true),
  .MaxLength(int), .TextWrapping(TextWrapping = Wrap),
  .AcceptsReturn(bool = true), .SelectionHighlightColor(SolidColorBrush)

The TextBlock bitmask diff (EXP-2) gained four new bits so the fast
path keeps avoiding interop reads for unchanged properties.
RichTextBlock and RichEditBox update paths reconcile all five props.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 5.2 — ToggleButton three-state + CheckedState fluents

Brings ToggleButtonElement to parity with CheckBoxElement / WinUI's
ToggleButton three-state cycle (true → false → null → true). Spec
039 §2.4 — matches the existing CheckBox/ThreeStateCheckBox precedent
(single record, IsThreeState flag), not the alternative split-record
shape.

Adds to ToggleButtonElement:
- IsThreeState (bool)
- CheckedState (bool?)  — active when IsThreeState=true
- OnCheckedStateChanged (Action<bool?>?)

New fluents:
- .IsThreeState(bool = true)
- .CheckedState(bool?) — auto-sets IsThreeState=true
- .CheckedStateChanged(Action<bool?>?) — null clears

New factory:
- ThreeStateToggleButton(label, checkedState = null, onCheckedStateChanged = null)

The reconciler now writes IsThreeState explicitly and clears it when
flipped back to two-state, so toggling .IsThreeState() between renders
works without remounting. The Click trampoline dispatches both
OnIsCheckedChanged and OnCheckedStateChanged; HasCallbacks was widened
to include the new callback.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 5.3 — Input control init props + fluents

Spec 039 §3.2 / §3.4 / §3.7 / §3.10 / §3.11. New init properties on
five input records, with matching value fluents plus event fluents
for the two new ComboBox callbacks.

PasswordBoxElement:
- MaxLength, Header, PasswordRevealMode, PasswordChar

AutoSuggestBoxElement:
- Header, QueryIcon (IconData), IsSuggestionListOpen

ComboBoxElement:
- MaxDropDownHeight, Description
- OnDropDownOpened, OnDropDownClosed (with .DropDownOpened /
  .DropDownClosed fluents per the leading-On rule)

RatingControlElement:
- PlaceholderValue (double), InitialSetValue (int — matches WinUI's
  RatingControl.InitialSetValue signature), .Caption() promoted from
  init-property to a fluent

ColorPickerElement:
- ColorSpectrumShape, Min/MaxHue, Min/MaxSaturation, Min/MaxValue
- .HueRange / .SaturationRange / .ValueRange paired-bound helpers

Reconciler wires every new property; ComboBox's two new events join
the HasCallbacks OR-chain. QueryIcon uses the existing ResolveIcon
helper (AutoSuggestBox.QueryIcon takes an IconElement, not IconSource).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 5.4 — Date/time picker init props + fluents

Spec 039 §4.1. New init properties on the three date/time records,
all with matching fluents.

CalendarDatePickerElement:
- DateFormat (string), IsTodayHighlighted (bool = true),
  IsCalendarOpen (bool), IsGroupLabelVisible (bool = true)

DatePickerElement:
- DayFormat / MonthFormat / YearFormat (string), Orientation
  (default Horizontal)

CalendarViewElement:
- MinDate / MaxDate (DateTimeOffset?), FirstDayOfWeek
  (Windows.Globalization.DayOfWeek?), NumberOfWeeksInView (int = 6),
  DisplayMode (CalendarViewDisplayMode = Month)

The reconciler reconciles every new property in the corresponding
Update* method (CalendarDatePicker, DatePicker, CalendarView).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 5.5 — Progress/layout/navigation init props + fluents

Spec 039 §5 / §6. New init properties on InfoBar, Expander, SplitView,
plus VariableSizedWrapGrid attached-prop fluents.

InfoBarElement:
- IconSource (IconData? — overrides severity icon), Content (Element? —
  rich body below the message). Both reconcile via ReconcileChild so the
  body element updates in place across re-renders.

ExpanderElement:
- HeaderTemplate (Element? — wins over the string Header), ContentTransitions
  (TransitionCollection? — custom expand/collapse motion).

SplitViewElement:
- PaneBackground (Brush?) with a `.PaneBackground(ThemeRef)` overload that
  routes through the existing ThemeBindings pipeline for light/dark-adaptive
  pane backgrounds.
- LightDismissOverlayMode (default Auto).

VariableSizedWrapGrid attached-prop fluents:
- new WrapGridAttached record + `.WrapGridColumnSpan(int)` /
  `.WrapGridRowSpan(int)` extensions. MountWrapGrid applies
  VariableSizedWrapGrid.SetRowSpan/SetColumnSpan at mount time, and
  UpdateWrapGrid re-applies on every render in lockstep with
  ReconcileChildren's null/EmptyElement filtering.

MountInfoBar/UpdateInfoBar now accept `requestRerender` so the child
Element mounts/reconciles correctly. UpdateExpander reconciles
HeaderTemplate via ReconcileChild with a string-header fallback when the
element header is cleared.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 5.6 — Collections + dialogs init props + fluents

Spec 039 §8 / §9. New init properties on ListView, GridView,
ContentDialog, Flyout, TeachingTip.

ListViewElement / GridViewElement:
- ItemContainerStyle (Style?), IncrementalLoadingTrigger (default Edge).
  Both wire at mount and reconcile on update.

ContentDialogElement:
- IsPrimaryButtonEnabled (bool = true), IsSecondaryButtonEnabled (bool = true),
  OnOpened with `.Opened()` event fluent. (WinUI 3 ContentDialog has no
  `Opening` event, so the spec's `OnOpening` is dropped — deferred upstream.)

FlyoutElement:
- ShowMode (FlyoutShowMode = Auto), AreOpenCloseAnimationsEnabled (bool = true),
  OverlayInputPassThroughElement (Element? — mounted as a DependencyObject).
  Both the existing-flyout reuse path and the fresh-flyout creation path in
  UpdateFlyoutElement propagate the new props.

TeachingTipElement:
- IconSource (IconData?), HeroContent (Element?), PlacementMargin (Thickness),
  PreferredPlacement (TeachingTipPlacementMode = Auto). HeroContent rebuilds
  on swap (simple over hot — teaching-tip hero isn't a render hot path).

GroupStyle on ListView/GridView is deferred per the spec — needs a
Reactor-shaped wrapper for the templated header/footer pair and tracked
separately.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 5.7 — Media + shapes init props + fluents

Spec 039 §10 / §11 / §12. New init props on six media/shape records.

ImageElement:
- OnImageOpened (Action?), OnImageFailed (Action<string>?), NineGrid
  (Thickness?). Both events route through the new EnsureImageWiring
  helper + PoolableWireFlags so a pooled Image won't double-subscribe
  across mount/unmount cycles.

WebView2Element:
- Source was already the record's positional parameter and is reconciled
  by UpdateWebView2. No change needed — verified at audit.

PathElement:
- StrokeStartLineCap / StrokeEndLineCap / StrokeDashCap (PenLineCap),
  StrokeLineJoin (PenLineJoin), StrokeMiterLimit (double = 10),
  StrokeDashOffset (double), FillRule (FillRule = EvenOdd).
- FillRule lives on the underlying PathGeometry (not Shapes.Path) so
  the reconciler propagates via `p.Data as PathGeometry`.

PipsPagerElement:
- WrapMode, MaxVisiblePips (default 5), PreviousButtonVisibility,
  NextButtonVisibility (both default Collapsed).

RefreshContainerElement:
- PullDirection (default TopToBottom); HasCallbacks now reflects
  OnRefreshRequested.

ParallaxViewElement:
- Source (UIElement?), VerticalSourceStartOffset, VerticalSourceEndOffset.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 5.8 — Universal multi-select SelectionChanged

Spec 039 §8 / §14 #4 universal gap. Adds snapshot-style
OnSelectionChanged to every collection element so Multiple / Extended
selection modes are reachable without dropping to .Set(...) +
SelectedItems iteration.

- ListViewElement / GridViewElement / ListBoxElement
  → Action<IReadOnlyList<int>>? OnSelectionChanged

- TemplatedListViewElement<T> / TemplatedGridViewElement<T> / ItemsViewElement<T>
  → Action<IReadOnlyList<T>>? OnSelectionChanged
  (typed peers materialize items from the SelectedItems indices via a new
   virtual InvokeMultiSelectionChanged on TemplatedListElementBase)

- TreeViewElement — deferred. WinUI's TreeView selection model is
  hierarchical and needs separate design (SelectionMode.Multiple over a
  tree differs in subtle ways from flat-list multi-select).

Snapshot semantics (not delta-style) match CalendarView's
OnSelectedDatesChanged from Phase 3.1 — the callback receives the FULL
current selection on every change, so component state can be a plain
IReadOnlyList without diffing.

Mount-time wiring is now unconditional for ListView/GridView/ListBox
SelectionChanged (handlers resolve via GetElementTag), so the previous
"lazy-wire on null→non-null" code in UpdateListView/UpdateGridView/
UpdateListBox is removed to avoid double-subscription. Tag refresh on
update keeps newly-attached handlers reachable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 6.1 — rename RichText → RichTextBlock + obsolete alias

The record was already named `RichTextBlockElement`; this aligns the
factory name with the record and with WinUI's
`Microsoft.UI.Xaml.Controls.RichTextBlock`. Both `RichText(string)` and
`RichText(RichTextParagraph[])` overloads are preserved as `[Obsolete]`
forwarding aliases for one release per spec §16.4 (B). Ten sample / doc
/ test call sites migrated to the new name.

New `### Breaking changes (deferred)` section in `CHANGELOG.md` under
`## [Unreleased]` to catalog naming-alignment renames whose
`[Obsolete]` aliases come out in the next minor.

(spec 039 §1.3 / §14 #8)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 6.2 — document divergent Reactor wrappers

Add `<summary>` + `<remarks>` XML doc comments to every factory whose
name diverges from WinUI (no first-party WinUI control of the same
name): `Heading`, `SubHeading`, `Caption`, `VStack`, `HStack` (and the
`(spacing, ...)` overloads), `Flex` / `FlexRow` / `FlexColumn`,
`ListView<T>` / `GridView<T>` / `FlipView<T>` (typed/templated peers
sharing names with untyped factories), and `LazyVStack<T>` /
`LazyHStack<T>`. Each remark explains the SwiftUI / cross-platform
naming influence or the underlying WinUI primitive being wrapped.

(spec 039 §0.3)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 6.3 — document StackElement.Spacing default-8 deviation

Add `<summary>` + `<remarks>` to `StackElement.Spacing` calling out the
deliberate 8-DIP default vs WinUI `StackPanel.Spacing` default of 0.
Doc-only — value unchanged per spec 039 §0.4 / §16. Rationale: Reactor's
`VStack(a, b, c)` call shape almost always wants whitespace between
siblings; the WinUI-zero default produced visually wrong output for the
zero-arg case.

(spec 039 §0.4 / §16)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 6.4 — TextField / MaskedTextField naming rationale

Per spec 039 §16.5 the `TextField` / `MaskedTextField` rename is
explicitly out of scope (option C — keep as-is). Add an XML
`<summary>` + `<remarks>` to each factory pointing readers at the
spec sections that capture the impact analysis and decision. The
`TextField` doc anchors §3.1 / §16; `MaskedTextField` anchors §13 /
§16.3 and notes that the two renames would bundle together if ever
revisited.

(spec 039 §3.1 / §13 / §16)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 6.5 — ScrollViewer obsolete alias + doc comment

Decision: keep `ScrollView`, add `[Obsolete]` `ScrollViewer(Element)`
forwarding alias. Reactor's `ScrollViewElement` reconciles to WinUI's
legacy `Microsoft.UI.Xaml.Controls.ScrollViewer`, but WinUI 3 also
ships the newer `Microsoft.UI.Xaml.Controls.ScrollView` — the shorter,
modern name. Reactor's `ScrollView` is already consistent with that
preferred WinUI name, so the alias direction lets agents reaching for
the WPF / WinUI-legacy `ScrollViewer` spelling discover the modern one.

CHANGELOG entry under `### Breaking changes (deferred)` already in place
from Phase 6.1.

(spec 039 §6 / §16)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 6.6 — ProgressBar obsolete alias + Progress doc comment

Decision: keep `Progress` / `ProgressIndeterminate`, add `[Obsolete]`
`ProgressBar(double)` / `ProgressBar()` forwarding aliases. Reactor's
`ProgressElement` reconciles to WinUI's `ProgressBar`; Reactor names
factories by intent (`Progress`) rather than rendering shape
(`ProgressBar` includes the visual primitive in the name). Aliases let
WinUI muscle-memory callers discover the Reactor spelling without
breaking code.

Also adds `<summary>` + `<remarks>` to the `Progress` and
`ProgressIndeterminate` factories themselves; the rationale doc lives
on the primary (non-obsolete) factory.

CHANGELOG entry under `### Breaking changes (deferred)` already in place
from Phase 6.1.

(spec 039 §5 / §16)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 7.1 — draft spec 040 specialized control scrub

Schedules the follow-up specialized-control audit deferred from spec 039
§13. Draft scaffold only — five controls each get the three audit checks
(event parity, property coverage, naming alignment) as unanswered
checkbox outlines; the audit itself lands in a future change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 7.2 — specialized control event fluents

Re-runs the Phase 0.3 inventory script over src/Reactor/Controls/** and
broadens the delegate-type regex to capture one level of nested generics
(so DataGridElement<T>.OnSelectionChanged — Action<IReadOnlySet<RowKey>>?
— is now picked up). Adds the missing .SelectionChanged(...) fluent on
DataGridElement<T> plus its null-clear test; the other four specialized
controls (AutoSuggest / MaskedTextField / PropertyGrid / VirtualList)
were already covered by Phase 1's hand-written sweep.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 8.1 — ReactorGallery Button/TextField/InfoBar fluent showcases

Demonstrates the new Phase 1–5 fluents in the gallery:

- ButtonPage: .Click + .AccentButton / .SubtleButton / .TextLink
  (also satisfies the Phase 2.2 .TextLink demo deferred from §17.2).
- TextFieldPage: .NumericInput / .EmailInput / .UrlInput alongside
  .Description(...) per spec §17.3 / §5.
- InfoBarPage: all four severity fluents (.Informational / .Success /
  .Warning / .Error) per spec §17.4 — replaces the previous
  'Severity = InfoBarSeverity.X' record-with pattern.

GalleryControls.cs fully-qualifies WinUI's
Microsoft.UI.Xaml.Controls.ScrollViewer attached-property class because
the Phase 6.5 Factories.ScrollViewer() obsolete alias now shadows it
through the file's 'using static Factories' import. Pre-existing
baseline issue surfaced by the gallery build, fixed here so Phase 8
verifications run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 8.1 — Card / type-ramp / CalendarView showcases

Three more gallery pages exercising the new Phase 5 / §17 surface:

- Layout/CardPage (new) — Card(child) preset BorderElement with an
  icon + heading + body composition so the theme-aware brushes are
  visible. Demonstrates that Card returns a BorderElement and chains
  with Padding/CornerRadius overrides (§17.5).
- Text/TypeRampPage (new) — Title / Subtitle / Body / BodyStrong /
  BodyLarge factories rendered standalone and inside a Card "article"
  composition (§17.6).
- DateAndTime/CalendarViewPage — adds a Multiple-selection demo wiring
  the new .SelectedDatesChanged(...) fluent into local state (§3.1).
  The fluent drops the leading "On"; the underlying property remains
  OnSelectedDatesChanged.

Both new pages registered in ControlRegistry + PageRouter so they're
discoverable from the gallery shell.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 8.3 — Frame navigation micro-sample

Adds the Frame.Navigated / .Navigating / .NavigationFailed sample
deferred from Phase 3.2. FrameElement bridges into WinUI by calling
the underlying Frame.Navigate(Type), which requires real Page-derived
classes — so the sample ships three trivial code-only Page subclasses
(Home, Details, Broken) alongside the demo component.

The demo wires all three fluents into a 20-entry rolling log via
UseReducer (functional setter — handlers fire after render so the
plain UseState setter would close over stale state). A "Force failure"
button navigates to the Broken page whose ctor throws, so
NavigationFailed fires with the exception captured in the log.

Re-keying the FrameElement on a tick state forces Reactor to remount
the Frame so identical-target re-navigations still raise
Navigating + Navigated (the underlying WinUI Frame coalesces
identical Navigate calls otherwise).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(039): Phase 8.2 — sample apps fluent sweep (no-op verification)

Grepped each in-scope app for the .Set(c => c.OnX = ...) /
property-init OnX = pattern that the Phase 1–7 fluent surface
supersedes:

  samples/apps/chat
  samples/apps/demo-script-tool
  samples/apps/regedit
  samples/apps/wordpuzzle
  samples/apps/validation-showcase
  samples/apps/a11y-showcase

Zero hits across all six. The Set(...) escape-hatches that exist are
theme-resource templating (Set("ButtonBackground", brush)) or
style-only WinUI knobs (Padding, TextWrapping, AcceptsReturn, etc.),
none of which currently have a fluent. The OnClosed / OnItemInvoked
property-init patterns in regedit already live inside with { ... }
record-construction (not inside Set), where the fluent swap doesn't
buy anything.

Documented as no-op on the task list. No app code changes; this
commit is the task-tracker flip + 8.1 / 8.3 deferred-item
cross-references (Phase 2.2 TextLink sample, Phase 3.2 Frame sample).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 9.1 — guide updates

Add minimum-viable coverage of the spec-039 surface to the existing user
guides:

- forms.md: new "Configuring TextField" section covers
  .NumericInput / .EmailInput / .UrlInput / .PhoneInput / .SearchInput
  alongside .MaxLength / .IsSpellCheckEnabled / .CharacterCasing /
  .TextAlignment / .Description.
- styling.md: new "Named-Style Fluents" section covers .AccentButton /
  .SubtleButton / .TextLink and the four InfoBar severity helpers.
- layout.md: new Card and Type-Ramp sections with worked examples.
- navigation.md: new Frame events section (.Navigated / .Navigating /
  .NavigationFailed) plus NavigationView.SelectedTagChanged fluent.
- collections.md: new Multi-Select section covering the universal
  .SelectionChanged fluent on ListView / GridView / ListBox and the
  typed peers, including the IReadOnlyList<int> vs IReadOnlyList<T>
  signature split and the TreeView deferral note.

getting-started.md already used the post-Phase-1 fluent shapes throughout;
no edits needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 9.2 — xaml-developers cross-reference

Add an "Events: XAML Attributes Become Fluents" section to the
XAML-developers guide so people coming from XAML find the bridge
quickly. Covers the canonical mappings (Click, TextChanged,
SelectionChanged, SelectedIndexChanged, IsCheckedChanged) and the
naming convention — the fluent drops the leading On (because C#
binds delegate-property invocation in preference to extension
methods, per spec 039 §0.1), while the underlying property keeps
On so existing record-construction syntax still compiles.

docs/reference/ has no auto-generated API surface — the only
machine-derived API doc is skills/reactor.api.txt + the mirror at
plugins/reactor/skills/reactor-dsl/references/reactor.api.txt,
both regenerated on every Reactor build. No manual action needed
there.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 9.3 — spec 039 Status: Implemented

Flip the spec's status header from "In Implementation" to
"Implemented", with backlinks to the task list, the implementing
branch, and the per-phase commit history (single line, not enumerated).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 9.4 — CHANGELOG entries

Add a spec-039 block under [Unreleased] / ### Added covering the
four required subheadings:

- New fluent extensions (single bullet referring to the inventory).
- Named-style helpers (.AccentButton / .SubtleButton / .TextLink,
  InfoBar severity helpers, Card factory, type-ramp factories).
- New events exposed (CalendarView, Frame, ScrollView, Popup,
  WebView2, MediaPlayerElement, ContentDialog, Image, ComboBox,
  DataGrid, universal collection multi-select).
- New init properties (single bullet referring to spec 039 §14 #4 —
  Phase 4 / Phase 5 inventory).

Naming aliases (RichText → RichTextBlock, ScrollViewer, ProgressBar)
remain in the existing "Breaking changes (deferred)" block where
Phase 6.1 / 6.5 / 6.6 originally landed them — they're already
described there, no duplication needed.

Also flips the Phase 9 task-file checkboxes to [x] and the tracker
"Docs updated (Phase 9)" line.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 10.1 — reactor-dsl SKILL.md fluent-naming clarification

Adds a "Fluent naming convention (callbacks)" section explaining that
record `OnX` callback properties have matching `.X(...)` fluent
extensions (the leading `On` drops). Calls out the C# instance-property
vs extension-method clash that drove the split, and the null-clear
semantic.

reactor.api.txt is auto-regenerated on every Reactor build; current
copy is up-to-date.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 10.2 — reactor-recipes fluent sweep + new recipes

Updates the four target recipes and adds two new ones in both
`plugins/reactor/skills/reactor-recipes/references/` (current layout)
and `skills/recipes/` (legacy layout — still consumed by Reactor.csproj
NuGet pack at `agentkit/skills/recipes/`).

themed-card.cs:
  - Uses the new Card(child) factory (Phase 2.5) instead of hand-rolling
    Border + Theme.CardBackground + .CornerRadius(8) + .Padding(16).
  - Switches headings to the type-ramp factories (Subtitle/Caption).

form-with-validation.cs:
  - Adds an Age field demonstrating .NumericInput() + .MaxLength(3).
  - Applies .EmailInput() to the existing email field.
  - Header note covers the .Changed(...) fluent and its REPLACE
    semantic (vs. the combined-lambda pattern in the body).

list-add-delete.cs:
  - Converts the manual VStack of rows to the templated
    ListView<T>(items, keySelector, viewBuilder) factory with
    .ItemClick(item => ...) wired to the toggle reducer action.

sidebar-nav.cs:
  - Header note and inline comment document the
    .SelectedTagChanged(...) fluent and note that .WithNavigation
    occupies the same callback slot (mutually exclusive).

New: named-styles.cs:
  - Side-by-side demo of .AccentButton() / .SubtleButton() /
    .TextLink() on Button + HyperlinkButton, plus the four InfoBar
    severity fluents (.Informational / .Success / .Warning / .Error).

New: calendar-multiselect.cs:
  - CalendarViewSelectionMode.Multiple (via `with`) + .SelectedDates
    + .SelectedDatesChanged for two-way binding.

index.md updated in both layouts to reference the new recipes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 10.{3,4,5,6,7} — additional skill fluent sweep

10.3 reactor-design: Typography table extended with the WinUI 3 ramp
factories (Title/Subtitle/Body/BodyStrong/BodyLarge) with a note
disambiguating them from the older Heading/SubHeading Reactor presets.
"Avoid Deep Nesting" example gains a Card(...) one-liner. Mirror update
applied to legacy skills/design.md.

10.4 reactor-getting-started: no-op — zero .Set(c => c.On*) or
with { On* = ... } patterns in SKILL.md.

10.5 reactor-forms: Available-input-types table extended for TextField
(+ .MaxLength(n), .NumericInput(), .EmailInput(), .Changed(handler))
and PasswordBox (+ .MaxLength(n), .PasswordChanged(handler)). New
"Named-input shapes" callout with a worked .EmailInput() chain.

10.6 reactor-commanding / reactor-navigation / reactor-input: no-op —
zero .Set(c => c.On*) or property-init callback patterns in any.

10.7 Top-level mirrors:
  - Root SKILL.md: cheatsheet adds Title/Subtitle/Body/BodyStrong/
    BodyLarge line and Card(child) line; recipe roll-call now includes
    canvas-positioning, named-styles, calendar-multiselect.
  - skills/dsl-reference.md: typography table gains the 5 WinUI ramp
    factories; layout-containers table gains a Card(child) row.
  - skills/forms.md: input-types table mirrors the reactor-forms update.
  - skills/input.md / skills/navigation.md / skills/commanding.md:
    no-op (same grep-clean result as 10.6).

Phase 10 tracker line flipped to [x].

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(039): Phase 11.1 — public-API surface guard test

Adds PublicApiSurfaceGuardTests under tests/Reactor.Tests/Elements/ that
walks every Element record reflectively and asserts each Action/Action<T>
callback property has a matching public extension method with a compatible
delegate-shape signature.

Two intentional property-name exceptions allowlisted with inline rationale:
VirtualListElement.Ref (ref-capture; clashes with generic .Ref<T> modifier)
and XamlHostElement.Updater (constructor-time interop hook). All other
callback properties resolve cleanly to their fluent counterpart.

Failures are collected and reported in a single readable assertion so a
future record gaining several callbacks at once surfaces every missing
fluent in one shot. Guards the spec 039 §14 #1 / §15 Q1 fluent convention.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(039): Phase 11.2 — naming-alignment guard test

Adds NamingAlignmentGuardTests under tests/Reactor.Tests/Elements/ that
loads the Reactor.xml doc-comment output and asserts each spec §0.3
divergent factory (VStack/HStack/Heading/SubHeading/Caption/Flex/FlexRow/
FlexColumn/LazyVStack/LazyHStack/ListView<T>) carries a non-empty <remarks>
explaining the WinUI deviation. Failures collected so a future rename
surfaces every regression in one shot.

ListView only requires the remark on the generic overload (TemplatedListViewElement<T>);
the untyped ListView matches WinUI's spelling and needs no rationale.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(039): Phase 11.3 — null-clear contract audit + missing facts

Audited EventFluentNullClearTests against the CSV inventory of all
callback properties and added the 8 facts missing for fluents landed
in Phases 5/7:

  - ItemsView.ItemInvoked / SelectionChanged
  - TemplatedGridView.ItemClick / SelectedIndexChanged / SelectionChanged
  - TemplatedFlipView.SelectedIndexChanged
  - TemplatedListView.SelectionChanged
  - PropertyGrid.RootChanged

Total null-clear facts now 92 (was 84).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(039): Phase 11.4 — Card + AccentButton theme-ref smoke

Adds CardThemeResolutionSmokeTests asserting Card(child) wires the
CardBackgroundFillColorDefaultBrush + CardStrokeColorDefaultBrush keys
into ThemeBindings (so render-time resolution adapts to theme switches)
and cross-checks the keys against Theme.CardBackground / Theme.CardStroke.

For .AccentButton(): asserts the OnMount action exists and (when the
compiler closure layout cooperates) that the captured style-name string
is "AccentButtonStyle".

Full Light/Dark/HighContrast flip-and-verify test deferred — needs a
theme-flip primitive on Reactor.AppTests which is a separate workstream.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(039): Phase 11.6 — sample-page construction smoke

Adds GallerySampleConstructionSmokeTests with one [Fact] per Phase 8
gallery page (ButtonPage / TextFieldPage / InfoBarPage / TypeRampPage /
CardPage / CalendarViewPage / FrameNavigationPage) asserting the page's
factory + fluent chain constructs without exception and that bound
callbacks reach the expected element property.

The gallery pages are internal types in a WinExe so the full mount-test
under Light/Dark/NightSky needs the Reactor.AppTests harness — deferred
with a tracked checkbox. The fixture-level construction smoke catches
the same defect class (typos, missing factories, wrong receiver type)
without the harness cost.

Phase 11.5 noted as no-op in the task file — source-gen scaffolding was
struck per Phase 0.4 / Q1; the reflective surface guard from 11.1 covers
the equivalent drift detection.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(039): Phase 11.7 — spec-flagged bug regression checks

Adds SpecFlaggedBugRegressionTests with named regression checkpoints for
the three spec-039 §14 bugs:

  - §3.4 AutoSuggestBox.OnSuggestionChosen reachable via record
    constructor (factory path) and via .SuggestionChosen(...) fluent
  - §14 #5 HyperlinkButton.NavigateUri fluent exists and the
    HyperlinkButton(Command) + .NavigateUri(...) doc-promise holds
  - §17.5 Card(child) theme-binding wiring (cross-reference to the
    detailed smoke in CardThemeResolutionSmokeTests)

Flips the Phase 11 checkboxes and the bottom-tracker "Tests landed
(Phase 11)" entry. Two AppTests-harness-blocked deferrals tracked
inline:
  - 11.4 real theme-flip Light/Dark/HighContrast resolution test
  - 11.6 real Phase-8 page mount-and-fire test

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 3.7 — defer niche WinUI events to spec 040

Convert the bundled "defer if too big" line to explicit [deferred]
checkboxes per item with per-control rationale (MenuFlyout cancel-args,
CommandBar lack-of-consumer, SemanticZoom/AnnotatedScrollBar not modelled,
MapControl no SDK dep). Adds §6.1 carry-over section to spec 040 capturing
the ownership transfer. Flips the §14 #3 tracker checkbox now that 3.7
is no longer ambiguous.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* build(039): regenerate reactor.api.txt after rebase onto main

Picks up upstream Viewbox.Stretch / Viewbox.StretchDirection fluents
(#310) that were dropped by the rebase conflict resolution (chose
ours-with-regen-from-build strategy).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): move Phase 9 guide edits into the pipeline source

PR review flagged that Phase 9.{1,2} edited docs/guide/*.md directly, but
those are compiled outputs — the source-of-truth is
docs/_pipeline/templates/<topic>.md.dt + docs/_pipeline/apps/<topic>/App.cs
per the AI-author skill at docs/_pipeline/ai-author-skill.md.

This commit moves each previously-inlined addition into the corresponding
template + doc-app pair and regenerates the compiled guide via
`mur docs compile`:

- forms.md.dt + apps/forms/App.cs: new TextFieldConfigDemo snippet drives
  the "Configuring TextField" section (named-input fluents + MaxLength /
  IsSpellCheckEnabled / CharacterCasing / TextAlignment / Description).
- styling.md.dt + apps/styling/App.cs: NamedStylesExample snippet drives
  the "Named-Style Fluents" section (AccentButton / SubtleButton / TextLink
  + four InfoBar severity helpers).
- layout.md.dt + apps/layout/App.cs: CardDemo + TypeRampDemo snippets drive
  the Card and Type-Ramp sections.
- navigation.md.dt + apps/navigation/App.cs: FrameEventsDemo (with a
  trivial DocsFrameDemoPage Page subclass for Frame.Navigate to target)
  and SelectedTagChangedDemo snippets drive the Frame Events and
  NavigationView.SelectedTagChanged sections.
- collections.md.dt + apps/collections/App.cs: MultiSelectDemo snippet
  drives the "Multi-Select with SelectionChanged" section.
- xaml-developers.md.dt + apps/xaml-developers/App.cs: EventsFluentExample
  snippet drives the "Events: XAML Attributes Become Fluents" section.

Net effect on the compiled output (docs/guide/*.md) vs the prior
direct-edit commits: only three files have material content diffs and
all three are *strict improvements* over the prior fragments — the
original prose code blocks contained either (a) undeclared identifiers
(`MyXamlPage`, `handler`, `bodyElement`, `nav`) or (b) buggy logic
(`indices.Select(i => contacts[i].Id)` against a typed-peer selection
callback that delivers `IReadOnlyList<T>`, not `IReadOnlyList<int>`).
The compiled snippets now come from real, building components in the
doc apps.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(039): Phase 12.{1,2} — check off build + perf neutrality

Records the post-rebase ship-gate results: dotnet build -warnaserror clean
(NU1903 cleared by upstream #311's solution-warning sweep), startup_perf
TTFP 238.1 ms vs 230.2 ms calibrated baseline (~3%, within noise — WinUI3
baseline moved the opposite direction over the same window), stress_perf
reconcile times essentially identical (46.7 ms vs 46.3 ms at 50%,
56.8 ms vs 56.9 ms at 100%).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(039): reconciler — subscribe-before-source + uncontrolled CalendarView selection

Addresses PR #314 review feedback (Copilot inline comments on
Reconciler.Mount.cs:974/1044/3037 and Reconciler.Update.cs:3566).

Three subscribe-before-source ordering bugs — small or cached resources
can fire load/init events synchronously during the Source assignment, so
handlers attached after Source would miss the event:

- MountImage: SetElementTag + EnsureImageWiring move before image.Source
  so cached BitmapImage / SvgImageSource hits don't drop ImageOpened /
  ImageFailed.
- MountWebView2: SetElementTag + all event trampolines (NavigationStarting /
  NavigationCompleted / WebMessageReceived / CoreWebView2Initialized) move
  before webView.Source so a fast CoreWebView2 initialization can't fire
  before subscriptions land.
- MountMediaPlayerElement: SetElementTag + MediaOpened / MediaEnded /
  MediaFailed subscriptions move before player.Source so a cached URI or
  fast-failing source can't drop the initial event.

One uncontrolled-selection bug:

- UpdateCalendarView: SyncSelectedDates was called unconditionally with a
  potentially-null `n.SelectedDates`, and the diff treated null as "desired
  is empty" which cleared every user-picked date on the next render. Now
  only sync when the caller explicitly provided a SelectedDates list —
  null means "uncontrolled, leave the user's selection alone". SyncSelectedDates
  signature tightens to non-null `desired` accordingly.

All 227 element-extension tests (EventFluent / GallerySample / Phase4Init /
SpecFlagged filters) still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(039): PR #314 CR — remove ScrollViewer alias + sweep recipe/skill accuracy

Addresses the remaining Copilot inline review comments from PR #314 (after
the 4 reconciler bug fixes in b8f4d00):

API surface
- Remove the [Obsolete] Factories.ScrollViewer(Element) alias added in
  Phase 6.5. Reviewer flagged that the alias is *not* purely additive —
  under `using static Microsoft.UI.Reactor.Factories;` + `using
  Microsoft.UI.Xaml.Controls;`, the bare name `ScrollViewer` shadows
  Microsoft.UI.Xaml.Controls.ScrollViewer's attached-property type, so
  callers reaching for ScrollViewer.SetVerticalScrollMode(...) etc. have
  to fully-qualify (as samples/ReactorGallery/UserControls/GalleryControls.cs
  was doing). Discoverability win didn't justify the imposed disambiguation
  cost; alias removed. CHANGELOG + Phase 6.5 task-spec entry updated to
  record the reversal. GalleryControls.cs un-fully-qualifies its four
  ScrollViewer.Set*(...) calls.

Tests
- PublicApiSurfaceGuardTests.DelegateShapeMatches now recursively walks
  generic arguments instead of only comparing outer-generic def + arity.
  Prevents Action<IReadOnlySet<RowKey>> from matching Action<IReadOnlyList<int>>.
- ControlCatalogFixtures: catalog entry label `RichText` → `RichTextBlock`
  so the rename guard isn't undermined by the fixture.

Doc / recipe accuracy
- xaml-developers.md.dt: XAML→Reactor table corrected — TextField fluent is
  `.Changed(...)` not `.TextChanged(...)`; ComboBox XAML event is
  `SelectionChanged` (not `SelectedIndexChanged`) with a note that the
  Reactor fluent surfaces the index; CheckBox XAML uses
  `Checked`/`Unchecked` (not `IsCheckedChanged`) with a note that the
  Reactor fluent collapses the three XAML events. Recompiled.
- reactor-dsl SKILL.md: `.Click(_ => Save())` → `.Click(() => Save())`
  (Click takes parameterless Action).
- reactor-forms SKILL.md: §17.4 → §17.3 (named-input scopes live in
  §17.3; §17.4 is InfoBar severity). PasswordBox signature in the
  modifiers table matches the real factory: `(password, setPassword,
  placeholder)` + `.Header(text)` fluent (no fourth positional `header`).
- skills/recipes/named-styles.cs + plugin mirror: `.TextLink()` uses
  `TextBlockButtonStyle` (not `HyperlinkButtonStyle`).
- skills/recipes/list-add-delete.cs + plugin mirror: reverted the
  "no manual .WithKey needed" guidance and restored .WithKey(item.Id)
  on each row. The reconciler reconciles templated-list realized
  containers by index (ItemsSource = 0..N range, RefreshRealizedContainers
  matches by position), so KeySelector on the element record isn't
  consulted for diffing — on reorder/delete-from-middle, focus and
  per-row state stick to the wrong row without an explicit .WithKey.
- skills/recipes/canvas-positioning.cs mirrored from plugin copy; added
  to skills/recipes/index.md so the top-level SKILL.md cheat-sheet
  reference resolves.
- samples/ReactorGallery/.../CardPage.cs: "embedded file remains
  pure-ASCII" comment removed (the file contains a literal Fluent Icons
  glyph — comment was wrong, not the file).

Tooling
- tools/api-scrub/Build-EventFluentInventory.ps1 header comment now
  documents the `File` column added during Phase 7.2.

Spec follow-up
- docs/specs/040-...md: dead link to the not-yet-existing
  tasks/040-specialized-control-scrub-implementation.md replaced with
  prose noting the task list will be created once the audit lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codemonkeychris
Chris Anderson (codemonkeychris) deleted the feat/25-devtools-cli-parity branch May 28, 2026 19:11
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 26, 2026
Reduces redundant WinRT/COM-RCW boundary crossings and per-element
allocations on the diff/reconcile/patch hot path (data-grid stress
workload, StocksGrid). Targets the dominant Reconcile gap.

Reconciler.cs / Update.cs / Mount.cs:
- #16 UnmountRecursive: read ReactorAttached.State once (was 5x GetValue).
- #17 UnmountAndCollect: read element tag once (was 5x GetElementTag).
- #14 Update: coalesce repeated `is FrameworkElement` RCW type-tests to one.
- #15 Cache the component rerender delegate on ComponentNode; recreate
  only when the requestRerender identity changes.
- #18 UpdateDefaultAutomationName: ref/ordinal short-circuit before the
  AutomationProperties.GetName COM read.
- #19 ApplyModifiers accepts null = clear-all (no fresh ElementModifiers).
- #20 PopulateDirtyAncestorPath iterates a tracked self-triggered set
  instead of the whole _componentNodes dict.
- #21 UnmountAndPool reuses a borrowed scratch list (reentrant calls fall
  back to a fresh list).
- #22 RefreshRealizedContainers reuses a cleared field list.
- #23 ApplyStyleToElement ref-equal + ActualTheme guard; ApplyThemeBindings
  gated on the ShallowEquals fast path.
- #24 BuildCacheKey: thread-static StringBuilder + pair buffer, single pass.
- #25 HasConsumedContextChanged compares via Context<T>/EqualityComparer<T>
  (no boxing of value-type context).
- #26 ApplyResourceOverrides: no ToHashSet/ToArray, ref-equal fast path.
- #27 WireReferenceListEdge: static loop, no per-edge List/closures.
- #28 ApplyStaggerDelays: hoisted static animation-key array.
- #29 PushContextDisposable: single-pair push overload, pooled PopOnDispose.

Reconciler.KeyedItemsBinding.cs:
- #39 ref-equality cache; only realloc + SetItemViewSource on change.

Reconciler.Mount.cs:
- #40 LayoutFootgunDetector gated by GridElement pre-filter.

AccessibilityScanner.cs (debug-only scan path):
- #62 compute GetChildren once in Walk, pass into Push.
- #63 cache sibling-text array in ScanContext, invalidate on Push.
- #64 BuildContext single-pass with pooled scratch (no LINQ chains).
- #65 IsLikelyEmoji explicit span loop (no LINQ).
- #66 CheckTabIndexGaps sorts a rented buffer (no OrderBy/ToList).

Behavior preserved exactly: coalesced COM reads observe the same values
at the same times; unmount/cleanup ordering unchanged; scanner emits
identical findings. AOT/trim clean (no new reflection).

Adds tests/Reactor.Tests/ReconcilerInteropPerfTests.cs (11 tests:
rerender-delegate caching, context-change compare, cache-key reuse,
single-pair context push, scanner output parity).

Closes #654

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants