Align v2 focus and targeted keyboard with Codex helper - #4
Draft
cm2435-hcomp wants to merge 3 commits into
Draft
Conversation
Linux visual regression artifactsMatrix jobs now run independently. Download visual artifacts from this workflow run.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Aligns the v2 Rust/macOS background driver with the recovered signed Codex
helper in two related areas: target-contained focus semantics and generic
targeted-keyboard delivery.
foreground/key-window/HID witness
user activity as external QA evidence
concrete cleanup failures
MacKeyboardEventTargetwith separate application and effectivedispatch PIDs
SwiftKeyboardtarget-belief recipekey down, key up, and restored combined-session flags
CGEventPostToPidwhile leaving legacy v1 tools unchanged
press_keyfor exact visible/occluded current-Space targets,including
Framework::Unknownis followed by exact requested-state readback
Why
The previous posture contract failed correct background actions when the user
moved the hardware cursor or used another application. Binary inspection
showed that the Codex helper coordinates current target focus but does not
return an action-wide containment verdict, callback-drain proof, focus poison
result, or launch activation journal.
The previous
press_keyrefusal was also our porting gap, not a TextEdit ormacOS limitation. The signed helper selects a generic route from exact
target/focus facts, uses an effective PID for out-of-process AX targets, builds
four aggregate-flags/key events, and posts them directly to that PID. It does
not gate the generic route on an AppKit/Chromium classifier or use SkyLight.
Validation
Automated gates:
cargo test -p platform-macos --lib: 187 passedcargo test -p cua-driver-core --lib: 120 passedcargo test -p cua-driver --bins: 69 passedcargo check -p platform-macos --all-targets: passedrustfmt --checkapplication/effective PID evidence, stale-focus refusal, exact four-event
order, direct one-post-per-event transport, and exact AX enablement readback
Live-host evidence at
2082500ed6890f15546d9e80c7fabb38dc4d4bfc:effects
targeted_keyboard, four attempted/posted events,core_graphics_pid, no clipboard, and truthfuldispatch_unverifiedsampled positions; no keyboard action attempted a cursor warp
Exact support boundary
Proven: visible/current-Space TextEdit/Unknown and Chromium targets where
application PID equals dispatch PID.
Refused before dispatch: minimized, off-Space, unknown-state, stale-focus,
missing-effective-PID, and unproved exception states.
Still unproved: a live out-of-process focus owner where application and dispatch
PID differ, Catalyst-specific preparation, targeted Unicode-event text
fallback, and the remaining Chromium scroll/drag/menu cells.
Workspace-wide
cargo fmt --all -- --checkand strictcargo clippy ... -D warningsremain red on the unchanged 0.7.1 base becauseof broad pre-existing formatting drift and legacy warnings in core,
cursor-overlay, and older macOS modules. The changed keyboard files are
formatted and add no new clippy diagnostic.