Skip to content

PR #416

PR #416 #1388

Triggered via dynamic May 23, 2026 11:57
Status Success
Total duration 1m 32s
Artifacts

codeql

on: dynamic
Matrix: analyze
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
Target ordering logic tested through CLI handler wrapper instead of direct logic function: src/cli/__tests__/register-tool-commands.test.ts#L1007
The two ordering tests (destructive controls after useful targets, unselected segmented controls before selected) exercise `getRuntimeTargetDisplayPriority` / `isLowPriorityRuntimeTarget` / `isAlreadySelectedRuntimeTarget` sorting logic in `structured-output-envelope.ts` via the full CLI pipeline; move them to `src/utils/__tests__/structured-output-envelope.test.ts` and call `toStructuredEnvelope` directly, as done for all other compact-capture tests in that file.
UI_SNAPSHOT_TIME_TEXT_ROW_REGEX silently absorbs element ID changes alongside time values: src/snapshot-tests/normalize.ts#L75
The replacement `e<TIME>|text|text|<TIME>||` normalizes the element ID (`e\d+`) using the same `<TIME>` placeholder as the time content, so any accessibility tree reordering that shifts a clock-displaying element's ID (e.g. `e42` → `e55`) is silently absorbed and never surfaces as a snapshot contract change.
[5VE-DB4] UI_SNAPSHOT_TIME_TEXT_ROW_REGEX silently absorbs element ID changes alongside time values (additional location): src/snapshot-tests/normalize.ts#L245
The replacement `e<TIME>|text|text|<TIME>||` normalizes the element ID (`e\d+`) using the same `<TIME>` placeholder as the time content, so any accessibility tree reordering that shifts a clock-displaying element's ID (e.g. `e42` → `e55`) is silently absorbed and never surfaces as a snapshot contract change.
Hardcoded `elementRef: 'e3'` after `refreshRuntimeSnapshot()` is fake e2e state: src/snapshot-tests/suites/ui-automation-suite.ts#L135
The touch and long-press success tests call `refreshRuntimeSnapshot()` (which captures a real snapshot) but then pass the hardcoded `elementRef: 'e3'` rather than deriving the ref from the captured output — making the snapshot call meaningless as a ref source and coupling test validity to a brittle positional assumption about Calculator's element tree.
`snapshotCaptured = false` mutated inside `swipe > success` test body breaks test isolation: src/snapshot-tests/suites/ui-automation-suite.ts#L215
Resetting the `snapshotCaptured` flag at the end of the `swipe > success` test body (not in `afterEach`) creates an ordering dependency: if the success test is skipped, fails early, or runs out of order, `refreshRuntimeSnapshot()` in the subsequent `swipe--error-not-actionable` test will no-op, leaving the Preferences app in the foreground and making `e3` refer to a Preferences element rather than a Calculator element.
`includeNextSteps: false` only suppresses the finalize-time block, not streamed `next-steps` events: src/utils/renderers/cli-text-renderer.ts#L477
When `includeNextSteps` is `false` (e.g. `outputStyle === 'minimal'`), streamed `next-steps` fragments processed via `processItem`'s `case 'next-steps'` are still rendered unconditionally; only the finalize-time `createNextStepsBlock` call is guarded by the new flag.
O(n²) scan in findActiveForegroundRoot on every UI action response: src/mcp/tools/ui-automation/shared/runtime-next-steps.ts#L388
For each scrollable candidate, `records.filter(isForegroundCandidateForRoot)` iterates all records again, and `findSheetGrabberDescendant` does the same — giving O(n²) total work per UI action in trees with many scrollable elements. Consider pre-grouping records by path prefix so descendant lookups become O(1) amortized.
[WCG-SQ3] O(n²) scan in findActiveForegroundRoot on every UI action response (additional location): src/mcp/tools/ui-automation/shared/domain-result.ts#L299
For each scrollable candidate, `records.filter(isForegroundCandidateForRoot)` iterates all records again, and `findSheetGrabberDescendant` does the same — giving O(n²) total work per UI action in trees with many scrollable elements. Consider pre-grouping records by path prefix so descendant lookups become O(1) amortized.
`switchBatchElements` does not exclude the repeated no-op action ref: src/mcp/tools/ui-automation/shared/runtime-next-steps.ts#L627
When ≥2 switches are visible and `batchElements` is replaced with `switchBatchElements`, the `repeatedNoOpAction` exclusion is not applied, so a switch the agent just tapped with no effect can be included in the batch suggestion, directing the model to repeat a known no-op.
Import declarations placed mid-file after type definitions: src/types/domain-results.ts#L52
Move the `import type` statements to the top of the file — imports placed after type declarations violate ES module conventions and the project's import-sorting standard.