Skip to content

Wait for capture action targets within the reserved deadline - #865

Merged
coneilen merged 1 commit into
scgopi:mainfrom
coneilen:coneilen-action-selector-polling
Oct 18, 2026
Merged

coneilen merged 1 commit into
scgopi:mainfrom
coneilen:coneilen-action-selector-polling

Conversation

@coneilen

Copy link
Copy Markdown
Collaborator

Summary

Wait for capture scene-action targets using the existing deadline-bounded zero-match poll, and retain the existing terminal refusal evidence when resolution fails. Exact selectors, ownership checks, and the reserved worker deadline remain unchanged.

Refs #848 #850

Changes

  • Extract the existing 100 ms found=0 loop into one shared module helper; the original worker wait delegates to it, and scene actions forward the same lease deadline and deadline guard.
  • Preserve the resolver, selector specifications, optional refusal-reference forwarding, no-sink behavior, and observer/error semantics. Action callers without a deadline retain the original immediate lookup.
  • Add two real hidden-own-HWND/UIA action-path contracts for late target availability and terminal candidate retention. The focused group is 16 cases and the registered default suite is 132; the real-seed source count is 135.

Test plan

RED: pwsh -NoProfile -File Tools\windows\Tests\UiCaptureDriver.Tests.ps1 -SelectorRefusalContractOnly -ScratchRoot D:\gcs\action848-polling\red3 -> 16 executed / 14 passed / 2 intended behavioral failures on unchanged 29ae94e production: the real action path made one lookup in 0.456 s (terminal case 0.478 s), refused "Expected exactly one visible UIA element Name='Alpha' id='' prefix='open-project-'; found=0.", and retained 0 terminal snapshots.
GREEN: pwsh -NoProfile -File Tools\windows\Tests\UiCaptureDriver.Tests.ps1 -SelectorRefusalContractOnly -ScratchRoot D:\gcs\action848-polling\green -> 16/16 passed; the late native UIA target succeeded in 1.637 s after 3 resolver queries and 1 invocation, and the terminal case retained the existing typed last-poll candidate snapshot; both hidden HWNDs and fixture threads closed.
REGRESSION: & 'C:\Program Files\PowerShell\7\pwsh.exe' '-NoProfile' '-File' 'D:\depot\copilot-worktrees\GraphCode\coneilen-super-goggles\Tools\windows\Tests\UiCaptureDriver.Tests.ps1' '-ScratchRoot' 'D:\gcs\action848-polling\default' '-PrebuiltFixtureManifest' 'D:\gcs\a848fx\fixtures.json' '-PrebuiltFixtureManifestSha256' '79E475A26F37F2F1864088C20A31459D8412B28A1C58FEEF085D4A80DA73BBFF'; pwsh -NoProfile -File D:\gcs\action848-polling\full2-controller.ps1 -> default 132/132 passed before the registrar changed to 132; the separately authorized job-owned full2 ran the official ValidationRunner body with its exact parent PASS line, held-generation exit 0, and complete registered 132/132 report, manifest, and source bindings.

The separate focused regression also passed 16/16:
pwsh -NoProfile -File Tools\windows\Tests\UiCaptureDriver.Tests.ps1 -SelectorRefusalContractOnly -ScratchRoot D:\gcs\action848-polling\focused.

Evidence limits and retained failures:

  • The first two new-fixture attempts failed compiler setup with CS0246 for IRawElementProviderFragmentRoot and then ManualResetEvent. They are retained separately as red and red2; neither is behavioral RED. Only red3, after the reference corrections and before production changes, is the behavioral failure evidence.
  • The first full-run attempt exited, exit code/result UNKNOWN; possibly a failure; NOT COUNTED. Its retained controller output was readiness only. The subsequent exact-generation acquisition did not obtain a native handle or exit code; the operator explicitly accepted the negative PID lookup for non-overlap and authorized one fresh job-owned full run. No timeout cause or benign result is inferred for the original attempt.
  • Full2's actual parent PASS and held exit 0 are distinct from cleanup. The controller unconditionally called its owned job's Terminate, then measured typed Active=0 after Terminate and before Close, and observed actual stdout/stderr EOF. The pre-termination member count is unknown; this is not a claim of zero-before-termination or zero harness safety termination. Raw stderr is nonempty and retained.
  • The retained private setup/verification history includes the corrected AST-array and JSON-date probes, the rejected self-authored literal-timeout guard and its explicitly admitted correction, and the failed own-log-prefix lookup that traversed shared Temp and returned access-denied errors. No unrelated file contents were read or denied paths retried. These are not runtime RED or passing-test evidence, and no repository assertion was relaxed.
  • The immutable command addendum corrects a display-only missing separator in an evidence packet; the actually executed default argv was correct. The full2 tool output also included two System.Threading.Tasks.VoidTaskResult lines; they are retained and are not counted as parent PASS.
  • Real-seed 135 was not run. These results cover the existing Windows contracts and real hidden test-owned UIA paths, not a product-app walkthrough, foreground input, C4 capture, macOS validation, or visual/parity qualification. The underlying cause of the retained C3 Alpha refusal remains unproved.

Checklist

  • I have read the Contributing Guidelines
  • I have signed off my commits (git commit -s) per the DCO
  • Tests pass locally (make test)
  • Code follows the existing style (make check)
  • I added the test/contract before the implementation and observed the intended RED failure

Reuse the worker's bounded zero-match poll for scene-action resolution and
retain its existing terminal candidate evidence on refusal. Preserve exact
selectors, ownership checks, and the reserved worker deadline.

Add real hidden-UIA action-path coverage for late target availability and
terminal refusal, with the default suite registered at 132 cases.

Refs scgopi#848 scgopi#850

Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 87739019-4c73-4846-aa7f-1fb0e10b812c
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