Skip to content

feat: extract WinGuiMcp.Core and add declarative scenario runner - #5

Merged
synthet merged 1 commit into
mainfrom
feat/core-and-scenarios
Nov 8, 2026
Merged

synthet merged 1 commit into
mainfrom
feat/core-and-scenarios

Conversation

@synthet

@synthet synthet commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • WinGuiMcp.Core. The UIA, input, capture, session and catalog layers move into a class library, so sibling domain servers can reference them instead of vendoring the code. The first consumer is lightroom-mcp, a Lightroom Desktop server (LIGHTROOM_BOUNDARIES_CONSTITUTION). Namespaces are unchanged, and the host calls AddWinGuiCore().
  • Scenario runner. Playwright-style *.scenario.yaml / .json step files, run by run_scenario, resume_scenario, validate_scenario and list_scenarios, or by the WinGuiMcp scenario ... CLI. Features:
    • typed params, plus save, expect, retry, when and guard;
    • wait_until, sub-scenarios via call, and checkpoint with single-use resume tokens;
    • an allowWrites gate, a target-process guard with a built-in restricted-app denylist, and a foreground guard;
    • dry runs, and receipts with secret redaction.
      Language reference: docs/scenarios.md.
  • Proposal accepted with changes. docs/proposals/scenario-runner.md is accepted with changes (ADR-0001). The record-and-replay export stays deferred.
  • Fix. wait_for window-active / window-closed failed with "Unknown condition" instead of polling until timeout. The first live scenario run found it.

Compatibility

  • Tool surface. ToolSurfaceSnapshotTests locks every [McpServerTool] attribute and catalog schema against a golden file generated before the move. The only difference is the four new scenario tools; the existing 27 tools and the catalog are identical.
  • Compact mode now lists the scenario tools next to search_tools, describe_tool and execute_tool (documented in tools.md).
  • CI. CI uses global.json (.NET 10.0.402) instead of 9.0.x, and the gate filter is narrowed to *GateTests. The old !~Phase1 filter also hid a registration test.

Testing

  • dotnet test WinGuiMcp.sln --filter "FullyQualifiedName!~GateTests": 74/74 pass locally. The run had 40 tests before this change, and adds a surface lock, 31 scenario tests and 2 wait_for regressions. The regression tests fail without the fix and pass with it.
  • scenario validate and scenario run --dry-run on samples/scenarios/notepad-roundtrip.scenario.yaml pass.
  • A live run against Notepad got to its checkpoint. That run led to the sample now opening a named scratch file and guarding on its title, because Windows 11 Notepad restores previous tabs.
  • Desktop gate tests were not run.

🤖 Generated with Claude Code

Split the UIA, input, capture, session and catalog layers into a
WinGuiMcp.Core class library so sibling domain servers (lightroom-mcp)
can reference them instead of vendoring. Namespaces are unchanged and a
golden tool-surface test proves the existing 27 tools and catalog
schemas are byte-identical to before the move.

Add a Playwright-style scenario engine in Core (YAML/JSON step files,
typed params, save/expect/retry/when/guard modifiers, wait_until,
checkpoint + single-use resume tokens, sub-scenarios, receipts with
secret redaction, dry runs, allowWrites gate, target guard with a
restricted-app denylist, foreground guard). Exposed as run_scenario,
resume_scenario, validate_scenario, list_scenarios and a `scenario`
CLI subcommand. Accepts docs/proposals/scenario-runner.md with changes
(ADR-0001).

Fix wait_for window-active/window-closed failing with "Unknown
condition" instead of polling until timeout (found by the first live
scenario run; WaitForRegressionTests).

Also: WindowCapture.CaptureToFile, ForegroundInfo, AddWinGuiCore DI
entry point, global.json (.NET 10), CI on global.json with the gate
filter narrowed to *GateTests, Lightroom boundaries constitution.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@synthet
synthet merged commit e1727d7 into main Nov 8, 2026
1 check passed
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.

1 participant