Skip to content

Add bounded WPF inspection workflows - #70

Merged
mkajander merged 3 commits into
mainfrom
t3code/bounded-wpf-inspection
Aug 26, 2026
Merged

mkajander merged 3 commits into
mainfrom
t3code/bounded-wpf-inspection

Conversation

@mkajander

Copy link
Copy Markdown
Contributor

What changed

  • Let the core find_elements tool accept a bounded subtree root.
  • Add get_computed_properties_batch for named properties across a bounded list of WPF element IDs.
  • Add dotted propertyPaths projections to get_data_context.
  • Capability-gate the new agent protocol and validate batch counts, ordering, limits, and public ID mapping.
  • Document the one-call inspection workflow and its limits.

Scope decision

This change uses batch inspection instead of computed-property predicates in find_elements. Predicate equality needs a separate contract for WPF-only routing, unset values, converters, brushes, and application-defined objects. The batch tool removes the N+1 MCP calls without introducing unclear comparison rules.

Verification

  • Focused tool-list and schema checks.
  • Focused subtree and batch integration tests, including truncation before element resolution.
  • Focused DataContext path integration and WPF tests, including shared getter caching and request limits.
  • Capability-gate contract tests.

The full test suite is left to CI as requested.

Closes #69

Expose subtree-scoped search, targeted DataContext paths, and batch computed-property inspection with explicit limits and capability gates.

Closes #69
Copilot AI lite review requested due to automatic review settings August 26, 2026 22:20
@mkajander
mkajander enabled auto-merge (squash) August 26, 2026 22:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the WPF inspection surface to support bounded, auditable workflows that avoid N+1 calls: subtree-scoped find_elements, batched computed-property inspection across multiple WPF element IDs, and targeted get_data_context projections via dotted propertyPaths. It also introduces agent capability gating for the new protocol features and updates tests/docs to reflect the new one-call workflow.

Changes:

  • Add optional root locator support to find_elements for subtree-limited scanning.
  • Introduce get_computed_properties_batch end-to-end (contracts, server tools, agent protocol, controller, and agent implementation) with enforced bounds and ordering/ID mapping checks.
  • Add propertyPaths support to get_data_context to project selected nested values without full graph serialization, plus capability gating and new coverage.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/WpfToolsMcp.SnapshotTests/ToolProfileTests.cs Updates tool profile expectations and adds integration tests covering subtree search, batch computed properties, and propertyPaths.
tests/WpfToolsMcp.SnapshotTests/InspectionResponseMetadataWpfTests.cs Adds unit coverage for propertyPaths getter caching behavior and unresolved path warnings/limits.
tests/WpfToolsMcp.SnapshotTests/InspectionResponseContractTests.cs Validates capability-gating behavior for the newly added bounded inspection features.
src/WpfToolsMcp.TestApp/MainWindow.xaml Adds an AutomationId to enable deterministic subtree-root selection in tests.
src/WpfToolsMcp.McpServer/Tools/CoreTools.cs Adds root to find_elements, adds propertyPaths to get_data_context, and exposes get_computed_properties_batch.
src/WpfToolsMcp.McpServer/Tools/AgentTools.cs Mirrors CoreTools changes for agent-backed tool surface (including batch + propertyPaths).
src/WpfToolsMcp.Contracts/Contracts.cs Extends contracts with GetComputedPropertiesBatch* types and shared limits (ComputedPropertiesBatchLimits, DataContextPropertyPathLimits).
src/WpfToolsMcp.Automation/AutomationController.Agent.cs Implements batch property inspection orchestration, capability gating, ordering checks, and public ID remapping.
src/WpfToolsMcp.AgentProtocol/ProtocolMessages.cs Adds new agent protocol capability names for batch computed properties and DataContext property paths.
src/WpfToolsMcp.Agent/WpfVisualTreeInspector.cs Implements propertyPaths normalization/projection and agent-side batch computed properties execution.
src/WpfToolsMcp.Agent/AgentServer.cs Routes the new batch protocol method to the inspector.
README.md Documents the new batch inspection capability and propertyPaths option at a high level.
docs/tool-guide.md Expands the inspection workflow guidance to include subtree roots, batch computed properties, and targeted DataContext paths.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/WpfToolsMcp.Agent/WpfVisualTreeInspector.cs
Use an existing element as the subtree root so the new test does not alter unrelated visual-tree snapshots.
A dotted path needs at least one readable segment, so reject propertyPaths when maxDepth is zero.
@mkajander mkajander closed this Aug 26, 2026
auto-merge was automatically disabled August 26, 2026 22:49

Pull request was closed

@mkajander mkajander reopened this Aug 26, 2026
@mkajander
mkajander enabled auto-merge (squash) August 26, 2026 22:49
@mkajander
mkajander merged commit a8fc089 into main Aug 26, 2026
1 of 4 checks passed
@mkajander
mkajander deleted the t3code/bounded-wpf-inspection branch August 26, 2026 23:18
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.

Add subtree search, property filtering, and targeted DataContext inspection

2 participants