feat(ui-automation): Add rs/1 runtime automation parity #416
3 issues
code-review: Found 3 issues (1 medium, 2 low)
Medium
Smoke tests for `tap` still use removed `x`/`y`/`id`/`label` parameters after schema replacement - `src/mcp/tools/ui-automation/tap.ts:35-54`
The e2e smoke tests in src/smoke-tests/__tests__/e2e-mcp-ui-automation.test.ts call tap with { x: 100, y: 200 }, { id: 'myButton' }, and { label: 'Submit' } — fields that no longer exist in the new elementRef-only schema. Those calls will now return schema-validation errors, but the tests only check content.length > 0, so they silently pass while testing nothing meaningful.
Low
No unit tests for `shouldInvalidateRuntimeSnapshotAfterActionError` business logic - `src/mcp/tools/ui-automation/shared/domain-result.ts:168-170`
The new shouldInvalidateRuntimeSnapshotAfterActionError function (which decides whether stale snapshot state is cleared on error) has no unit tests — only integration/snapshot-suite coverage via a live simulator. Have you considered adding a small unit test to verify that only AxeError triggers invalidation while SystemError and DependencyError do not?
Scroll-area predicate in text renderer diverges from structured envelope filter - `src/utils/renderers/domain-result-text.ts:1287-1289`
isScrollableRuntimeArea in src/utils/renderers/domain-result-text.ts returns element.actions.includes('swipeWithin') && !isLikelyRuntimeTarget(element). Because isLikelyRuntimeTarget short-circuits to false for hidden labels (via isHiddenRuntimeTarget), a hidden-label element (e.g. 'sheet grabber') that carries both swipeWithin and tap/typeText actions will be classified as a scrollable area in the text renderer. The parallel filter in src/utils/structured-output-envelope.ts (lines 229–237) explicitly requires !element.actions.includes('tap') && !element.actions.includes('typeText'), so the same element is excluded from the compact runtime envelope. Agents that compare the text rendering with the structured envelope may see mismatched scroll sections for this edge case. Impact is limited because the divergence only manifests for hidden-label elements that also expose tap/typeText, which should be uncommon.
⏱ 43m 32s · 4.5M in / 190.5k out · $7.86
Annotations
Check warning on line 54 in src/mcp/tools/ui-automation/tap.ts
github-actions / warden: code-review
Smoke tests for `tap` still use removed `x`/`y`/`id`/`label` parameters after schema replacement
The e2e smoke tests in `src/smoke-tests/__tests__/e2e-mcp-ui-automation.test.ts` call `tap` with `{ x: 100, y: 200 }`, `{ id: 'myButton' }`, and `{ label: 'Submit' }` — fields that no longer exist in the new `elementRef`-only schema. Those calls will now return schema-validation errors, but the tests only check `content.length > 0`, so they silently pass while testing nothing meaningful.