feat: bind each action to its exact retained screen frame - #84
Merged
Conversation
The recorder now retains an exact wall-clock capture timestamp for every encoded frame in the MP4 timing box (captures timeline), validates it strictly on read, and preserves it across moov-atom rewrites. A new fail-closed extract_exact_frame decodes THE bound frame or raises: no nearest-frame substitute, no silent tolerance guess. Actions carry their bound screenshot_timestamp through conversion and every client-side merge (click, double-click, drag, type, shortcut, scroll, move), and Action.screenshot resolves that exact frame through CaptureSession.get_exact_frame. Image-only captures resolve the retained PNG row with the exact timestamp. Actions recorded before binding existed keep the legacy nearest-frame lookup. This closes the frame-binding gap for release evidence: a consumer can prove which pixels an action pointed at instead of trusting a 0.5s nearest-frame window.
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.
Summary
Closes the frame-binding gap from the production-admission state doc (item 3, 'bind actions to the exact retained frame').
capturestimeline), strictly validated on read and preserved across moov-atom rewrites. Old media without bindings stays readable (captures=None).extract_exact_framedecodes THE bound frame or raises: no nearest-frame substitute.screenshot_timestampthrough DB conversion and every client-side merge (click, double-click, drag, type, shortcut, scroll, move); merged events keep the LAST child's binding, matching recording-side semantics (a click binds at button-up).Action.screenshotresolves the bound frame via newCaptureSession.get_exact_frame(video binding first; image-only captures use the retained PNG row with the exact timestamp). Legacy actions without a binding keep the lenient nearest-frame lookup.Test evidence
tests/test_frame_binding.py+ updated timing-box assertions intests/test_video.py(including real-FFmpeg end-to-end exact extraction).