Skip to content

test(scenarios): Drive possession live on macOS - #2133

Merged
omesser merged 2 commits into
mainfrom
test/1927-manual-drive-macos
Nov 5, 2026
Merged

omesser merged 2 commits into
mainfrom
test/1927-manual-drive-macos

Conversation

@omesser

@omesser omesser commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

The macOS leaf of possession-live now passes live. Three bugs in the scenario helpers kept every macOS possession leaf from passing:

 possession-input key <code> down|up
   post the key edge
+  wait 50 ms             # exiting at once dropped the key, so no key ever arrived
 possession-input possess <pid> <x> <y>
-  find the menu in the window list (Fidget, layer >= 100)   # missing on macOS 27
-  AXPress the Possess row                                  # overlay never took the keyboard
+  find the Possess row beside the click, again on each AX notification from Fidget
+  right-drag onto the row and release there
 scripts/scenarios/
 ├── helpers/
 │   ├── possession-input.swift      # fixes above, plus `move`
-│   ├── possession-live-mac.swift   # same two menu bugs; replaced
+│   └── type-target.swift           # a window that logs the keys it receives
 └── manual-only/
     └── possession-live.sh          # macOS leaf, asserts each step live

The macOS leaf keeps the shared fixture mode (FIDGET_SCENARIO_TRACE, FIDGET_SCENARIO_LETTER). After the card click, it also checks that Right walks again. src-tauri/src/main.rs traces possession: key <window> <key> down|up under FIDGET_TRACE_FRAMES. That trace is how the dropped keys showed up.

Part of #1927. X11 landed in #2132. Windows is still open.

Evidence

  • Before: with Fidget frontmost and its overlay AXWebArea focused, a posted Right logged no possession: key line. On a plain window, possession-input key 3 typed nothing, while ax type g landed.
    After: fidget-verify scenario possession-live --go, three runs in a row at a1a29c03, on macOS 27 with one display:
ok: possessed
ok: Right walks the sprite, and Space is held
ok: focus left, the sprite paused without a jump, and k reached the other window
ok: the card click resumed, and Right walks again
ok: Escape ended possession
PASS (6826ms) / PASS (6170ms) / PASS (6101ms)
  • possession-keyup --go at a1a29c03: PASS (6218ms). The held arrow walks the sprite, the keyup stops it, and the keyup goes to Finder with no stuck key.

  • cargo test -p fidget-verify --lib -- possession_live: 2 passed, including possession_live_macos_fails_on_each_broken_assertion.

The overlay often logs no window focus line after Possess, but keys still arrive. Both leaves check focus through the keys, and possession-live records a missing line in notes.txt.

The row wait has no timer, but it is not truly event driven yet. In every run the helper logged heard []: Fidget's menu posts no AX notification to the observer. The first check, right after the right-press, finds the row. A miss there would wait out the 3 s.

Merge Danger

Door: two-way

Blast Radius: scenarios

Only scenario scripts and one debug trace line change. possession-keyup.sh shares the helper and passed live at the new tip.

🤖 Generated with Claude Code

— Claude Code agent, on @omesser's behalf.

possession-input dropped every key: it exited as soon as it posted, so
no synthetic key reached any app and the macOS possession leaves could
never pass. It now waits 50 ms after a post, as ax-settings does.

On macOS 27 the pop-up menu is missing from the window list as a Fidget
window, and an AXPress on Possess leaves the overlay without the
keyboard. Possess is now a right-drag onto the row, found through
Accessibility. The macOS possession-live leaf asserts each step live.

Part of #1927.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omesser

This comment was marked as outdated.

The row wait re-read every 100 ms. Each AX notification from Fidget now
wakes the check instead, and the scan covers both sides of the click.
possession-keyup moves onto the sprite before its right-click and drops
its focus-line gate, which the overlay often never logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@omesser omesser left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Soft Open

Tip: a1a29c03

What changed

  • Event driven row wait: the Possess row check now runs once per AX notification from Fidget through waitUntil, with no 100 ms re-read. This fixes the polling item from my last review.
  • Both sides of the click: possessRowNearClick scans 16 points left of the click too, so a menu near the right edge is found.
  • possession-keyup.sh: it moves the cursor onto the sprite and waits for a frame before the right-drag, and drops the overlay focus-line gate, since the walk proves the keyboard.
  • README: the keyup paragraph now says right-drag onto the Possess row.

What is wrong

  • No live run at this tip: the PR evidence is from 0bfe7387. The new wait only re-checks when Fidget posts an AX notification, so if the menu fills in without one, the wait times out. Only a run on a Mac shows whether it still finds the row.
  • possession-keyup.sh still not run live: this commit changes its input and drops a gate, and the PR still says it has not been re-run.

Soft-FIX

  • Run possession-live live on a Mac at a1a29c03 and update the evidence, including the heard line the helper now prints.
  • Run possession-keyup.sh live once on a Mac at the same tip.

Verified: read the diff from 0bfe7387 to a1a29c03 and the waitUntil and observer code at the tip. The Swift helpers were not built here, since this box is not a Mac.

— Cursor agent (Architect), on @omesser's behalf.

@omesser

omesser commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner Author

Live run at a1a29c03

macOS 27, one display. The worktree was clean and matched the PR head.

Scenario Runs Result
possession-live 3 in a row PASS (6826 ms, 6170 ms, 6101 ms)
possession-keyup 1 PASS (6218 ms)
possession-live, repeat check 1 PASS (6219 ms)

Output from the repeat check:

ok: possessed
ok: Right walks the sprite, and Space is held
ok: focus left, the sprite paused without a jump, and k reached the other window
ok: the card click resumed, and Right walks again
ok: Escape ended possession
PASS (6219ms)
  • Row wait: in all five runs, the helper logged heard [] and found the Possess row without any notification from Fidget. A missed first check would wait out the 3 s.
  • Not covered: main is one commit ahead (fix(windows): Hit-test a press where the button went down #2107, a Windows hit-test fix), and this branch is not rebased onto it. X11 and Windows were not run here.

— Claude Code agent, on @omesser's behalf.

@omesser
omesser merged commit 47e21f2 into main Nov 5, 2026
10 checks passed
@omesser
omesser deleted the test/1927-manual-drive-macos branch November 5, 2026 15:04
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