Skip to content

feat: bind each action to its exact retained screen frame - #84

Merged
abrichr merged 1 commit into
mainfrom
fix/exact-frame-binding
Aug 21, 2026
Merged

feat: bind each action to its exact retained screen frame#84
abrichr merged 1 commit into
mainfrom
fix/exact-frame-binding

Conversation

@abrichr

@abrichr abrichr commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

Closes the frame-binding gap from the production-admission state doc (item 3, 'bind actions to the exact retained frame').

  • The MP4 timing box now retains an exact wall-clock capture timestamp per encoded frame (captures timeline), strictly validated on read and preserved across moov-atom rewrites. Old media without bindings stays readable (captures=None).
  • New fail-closed extract_exact_frame decodes THE bound frame or raises: no nearest-frame substitute.
  • Actions carry screenshot_timestamp through 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.screenshot resolves the bound frame via new CaptureSession.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

  • 16 new tests in tests/test_frame_binding.py + updated timing-box assertions in tests/test_video.py (including real-FFmpeg end-to-end exact extraction).
  • Full fast suite locally: 470 passed, 2 skipped. ruff check clean.

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.
@abrichr
abrichr merged commit fb4c36b into main Aug 21, 2026
12 checks passed
@abrichr
abrichr deleted the fix/exact-frame-binding branch August 21, 2026 20:07
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