feat(capture): seal native action geometry at capture time - #94
Merged
Conversation
abrichr
marked this pull request as ready for review
August 27, 2026 17:32
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 changed
Window-scoped Capture now writes each frame, window state, and native input event through one ordered source journal. Pixel acquisition stays outside the journal's observation boundary. If input arrives during a grab, the action binds the previous published frame before the new frame can enter the journal. A frame that might contain the action's result can't become that action's before evidence.
The v2 geometry record includes the window and process identity, display-topology digest, bounds, axis scales, fixed output viewport, source viewport, content rectangle, and geometry epoch digest. Capture rejects a recycled window handle, a process change, a display change, mixed frame geometry, and incomplete action bindings.
Recorder shutdown drains every writer before it seals the capture. The verified loader now requires a continuous v2 journal, a later retained frame for every action, one unambiguous video artifact, and exact agreement among MP4 frame indexes, source ordinals, capture times, database rows, and retained PNG hashes.
Linux window capture resolves a viewable EWMH client and reads its XComposite named-window pixmap. Another window can't replace those pixels through root occlusion. Native Wayland and XWayland-only sessions stop before recording because Capture doesn't yet have a portal contract that binds the selected window, pixel stream, and event-time coordinates.
The browser recorder stays Playwright-native. RDP and Citrix remain pixel-based external surfaces. They use the same exact window-frame path without claiming local accessibility identity inside the remote session.
Why
A timestamp alone can't prove which frame or coordinate system an action used. A window can move, resize, switch processes, or cross a display change while the screenshot and input threads run. The compiler needs one sealed source sequence, not a sequence reconstructed from nearby timestamps.
Checks
git diff --checkpassedxcffibLinux-onlyThe exact full suite also exposed an existing macOS browser-bridge timeout in
TestBrowserBridge::test_dom_event_capture. The same test times out atawait ws.recv()on exact base5ed28e6and on this head. This branch doesn't change that browser code or test. Exact-head hosted CI is still required.Three counted deterministic Linux X11 qualification trials remain required before this draft can be ready for merge or release.