Skip to content

fix(recording): omit markers with unknown reference dimensions - #4719

Merged
thymikee merged 2 commits into
mainfrom
t3/recording-overlay-coordinates
Nov 19, 2026
Merged

thymikee merged 2 commits into
mainfrom
t3/recording-overlay-coordinates

Conversation

@thymikee

@thymikee thymikee commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Omit gesture markers when either reference dimension is missing or invalid. Preserve gesture telemetry, the raw video, and marker placement for gestures with valid reference dimensions.

Three files change. Refs #4448. Passing verified native gesture coordinates into the recording pipeline remains open.

Validation

Base 6e18ea3349685f3cf6cec4c2e6d1104980ab2738; tested head e6d1b8b0b82487b52f7469c917f4b6df854acbd1.

  • Exact affected gate passed with exactCommit=true and eight successful checks. Five runner/replay lanes were skipped and retain their hosted or manual ownership.
  • 27 focused tests passed. The prior renderer drew a marker for a missing-reference fixture. The candidate preserves a byte-identical capture for that case and still renders referenced gestures in mixed input.
  • On iPhone Duo (iOS 27.1), a live no-snapshot Settings swipe produced three gesture events without reference dimensions. Running the candidate renderer over that capture preserved the video byte-for-byte and omitted all three misplaced markers. The device was released.
  • Independent review found no findings.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

…oven (#4448)

Before the first snapshot a gesture event can carry coordinates with no
referenceWidth/referenceHeight, and the Swift overlay silently treated the
missing pair as scale 1.0, rendering point-space input as video pixels
(#4448). The renderer now requires a finite, positive, paired reference per
event; events without one keep their telemetry event and the raw video but
draw no marker layers. All marker paths (tap, longpress, swipe, scroll,
back-swipe, pinch) refuse the old fallback, and a fully unreferenced envelope
keeps the raw capture byte-for-byte. Canvas geometry is still read from the
captured track itself, never from a planning viewport.

The positive producer-basis propagation (native display point geometry
through the gesture response into recording telemetry) remains unproven and
is named as a residual; unknown geometry omits the marker.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.39 MB 6.39 MB +624 B
Package (unpacked) 6.39 MB 6.39 MB +624 B
Package (download) 1.94 MB 1.94 MB +228 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 22.2 ms 22.6 ms +0.4 ms
CLI --help 46.9 ms 48.7 ms +1.8 ms

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The code at e6d1b8b needs live recording evidence before merge. All 18 reported checks passed at that commit, with no failed job to attribute. There are no conflicts.

The reported live run covers only gestures without a reference, invokes the candidate renderer separately, and provides no recorded outputs. Could you record gestures through start, action, and stop on this commit both before a snapshot and with a valid snapshot-backed or explicit reference? Please retain the commands, telemetry, and rendered frames to show that the invalid marker is absent, the valid marker is correctly placed, and the video is preserved. A production routing or reference propagation failure could otherwise omit valid markers despite the renderer fixture passing. Renderer admission

Could the renderer convert each event at admission into a renderer-local validated event carrying its reference pair, then pass that pair to the drawing functions and projection without a second check or downstream optional guards, while leaving raw telemetry untouched?

Not blocking: The daemon tests inspect telemetry from unchanged construction code and pass with the old renderer; you can take or leave keeping them as producer controls and adding a regression that observes rendered output through the complete production route. Tests

The broader issue’s native coordinate-basis propagation and positive no-snapshot proof remain open outside this change. Before merge, please provide the exact-head live evidence for both reference states through the production stop path and observable outputs.

…ence pair

Each gesture event is converted at admission into a renderer-local
RenderableGestureEvent that carries a proven ReferenceSize. Drawing and
projection take that pair directly, with no second check and no optional
guards. Raw telemetry (GestureEvent) is unchanged.
@thymikee

Copy link
Copy Markdown
Member Author

Review follow-up. Head: 9f63ef72b2e3e3d079ead48caabcc60c1ac5cc59.

1. Admission refactor (done).

  • recording-overlay.swift now converts each event at admission: envelope.events.compactMap(RenderableGestureEvent.init(admitting:)).
  • RenderableGestureEvent holds the raw GestureEvent and a validated ReferenceSize (present, finite, positive pair). This is the only check.
  • overlayPoint(reference:x:y:renderSize:) takes the pair and returns a non-optional CGPoint. The tap, long-press, trail and pinch functions take RenderableGestureEvent. They have no optional point guards and no second reference check.
  • GestureEvent (raw telemetry) is unchanged. The telemetry file is unchanged.
  • swift-cache-recording-scripts.test.ts: 8/8 pass on this head, including the Preserve recording overlay coordinate references before the first snapshot #4448 omission and mixed cases.

2. Daemon tests (kept as producer controls).

  • I kept the three daemon tests. They lock the telemetry the producer writes.
  • I did not add a unit regression through the full production route. It needs a live recording backend, the Swift compile, and an export inside one daemon session. The live run below covers that route at this head instead.

3. Live evidence at this head.
Setup: pnpm install --frozen-lockfile && pnpm build, then node bin/agent-device.mjs --platform ios --udid 6832D598-6CC2-49DF-9623-64CBF79ACB35 (e2e-apex, iPhone 16, iOS 26.2). Settings app. Each run: open com.apple.Preferences --relaunch, record start <path>, action, record stop. The default stop path ran the overlay (showTouches: true).

(a) Before any snapshot (fresh session pr4719-noref, no snapshot call):

  • Action: press 200 400. The runner response has referenceWidth: 393, referenceHeight: 852.
  • Telemetry: {"kind":"tap","x":200,"y":400,"referenceWidth":393,"referenceHeight":852}.
  • Output: H.264, 1178x2556, 10.97 s, 329 frames.
  • Frame at 1.35 s: one marker. Its centroid is (599, 1200) px. Expected: (200·1178/393, 400·2556/852) = (599.5, 1200). The frame at 1.10 s (before the tap) has no marker.

(b) With a snapshot-backed reference (snapshot -i, @e8 "Accessibility" rect x16 y342.33 w361 h52):

  • Action: press @e8. Response: Tapped @e8 (197, 368), referenceWidth: 393, referenceHeight: 852.
  • Telemetry: {"kind":"tap","x":197,"y":368,"referenceWidth":393,"referenceHeight":852}.
  • Output: H.264, 1178x2556, 2.17 s, 65 frames.
  • Frame at 0.70 s: one marker on the Accessibility row. Its centroid is (590, 1104) px. Expected: (590.5, 1104). The frame at 0.45 s has no marker.

Invalid marker: on this simulator, the stop path did not get an event without a reference. Before any snapshot, the runner reports a reference for every gesture that I tried: press, longpress, gesture pan, gesture pinch, gesture fling, gesture swipe left-edge, gesture tap (2 points), scroll, gesture rotate. All 10 telemetry events have a 393x852 pair. So the live route cannot show the omission here. The renderer fixture shows it (missing, unpaired, and zero reference: raw video kept byte-for-byte, 0 marker pixels; mixed: only the referenced marker draws). In both live runs there is no extra marker: each frame has exactly one blue changed region, at the expected point.

Video preserved: both outputs decode fully with ffprobe. Each keeps the 1178x2556 capture size and the full duration.

Centroid method: pixels that changed from the pre-tap frame and have blue − red > 40, sampled every 2 px.

Artifacts (local, in the PR worktree .tmp/live-4719/): a-noref.{mp4,gesture-telemetry.json,commands.log}, b-ref.{mp4,gesture-telemetry.json,commands.log}, b-snapshot.json, probe*.{mp4,gesture-telemetry.json,commands.log}, frames/*.png, key-frames.png (frames (a) and (b) side by side, scaled to points), marker.mjs.

There were no inline review threads to resolve.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready: 9f63ef7 fixes the earlier concern, and I found no code problems.

Not blocking, and fine to take or leave: exerciseOverlayReferenceOmission at swift-cache-recording-scripts.test.ts:304 repeats the export and frame-inspection steps of exerciseOverlayExports at :179-227, so those steps could be shared while each loop keeps its own inputs and assertions.

The only failing check is Smoke Tests (Android, run 44499963610). It fails at live-automation-scenario.ts:101, the automation title visibility step, which runs before any recording step and never reaches the overlay. This diff does not touch Android snapshot or visibility code, so the failure looks unrelated. Smoke Tests (ios) and (macos) passed at this head. The Android job has been re-run, and the PR can merge once it is green. The PR body still names e6d1b8b as the tested head, so add the 9f63ef7 live run there if you have it.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 19, 2026
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 9f63ef7

Since the review of e6d1b8b: 0 new · 0 still open · 0 no longer raised

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (c3a3316a5893).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee
thymikee merged commit a815a42 into main Nov 19, 2026
17 of 19 checks passed
@thymikee
thymikee deleted the t3/recording-overlay-coordinates branch November 19, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant