Skip to content

fix: discard retired capture and settle observations - #3148

Closed
thymikee wants to merge 2 commits into
fix/open-session-lifetimesfrom
fix/capture-lifetime-review
Closed

thymikee wants to merge 2 commits into
fix/open-session-lifetimesfrom
fix/capture-lifetime-review

Conversation

@thymikee

@thymikee thymikee commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Capture attempts now read the latest record of their admitted session lifetime, including recovery attempts. Publishing a snapshot creates a new record, preserving previously captured record identity.

Optional settle observations are discarded after retirement, including point-touch responses that await a recording frame probe. Tap corroboration compares the latest pre-probe baseline. Cached snapshots cannot authorize a retired lifetime.

Thirteen files changed. Part of #3116, stacked on #3145; addresses capture and settle findings on #3141.

Validation

Validated 0b76607bc7: 85 focused tests, quick and Fallow checks. Eight planted regressions fail; a ninth pre-fix control reproduces stale point-touch settle refs (1 failed | 10 passed), then all 11 response tests pass. The strengthened diff control also fails when snapshot assignment is omitted; the old control passed that regression.

pnpm check:affected --base fix/open-session-lifetimes --run passes all selected runnable gates and 1,636 related tests across 265 files. Independent review found no remaining findings. CI and live-provider evidence remain pending on the published head.

Review in cubic

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.96 MB 4.96 MB +279 B
Package (unpacked) 4.96 MB 4.96 MB +279 B
Package (download) 1.49 MB 1.49 MB +115 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 25.1 ms 25.1 ms +0.0 ms
CLI --help 75.0 ms 75.5 ms +0.5 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 13 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/daemon/interaction/internal/interaction-touch-response.ts
@thymikee

thymikee commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

Thanks for the fix. The retirement logic in 0b76607 looks right, but I need a live run of the two device routes it changes before this can merge.

snapshot-command-runtime.ts:149 now publishes every snapshot and diff on an existing session through sessionStore.update(ref, {}). Settle-carrying touches now issue refs through resolveCurrent instead of requireCurrent. Every real session takes both routes, and only unit fixtures cover them so far. The PR body says live-provider evidence is still pending, and the PR guidelines ask for a live run of the changed path. Please run one session on an iOS simulator or Android device at 0b76607. Run open <app>, then snapshot -i, then press @eN --settle, which must return settle.refsGeneration. Then press a settle-issued ref with press @eM, which must resolve with no stale-ref error. Then run record start, click <x> <y> --settle, which must return settle.refsGeneration, and record stop. Please paste the JSON responses. The unit tests already cover the retirement race, and a live run cannot reliably reproduce it.

Not blocking, and you can take or leave these: SelectorCaptureRuntimeParams.session in selector-capture-runtime.ts is now unread, yet find-target-capture.ts and selector-runtime-backend.ts still pass it, so it could go with both caller arguments. The snapshot transition at snapshot-command-runtime.ts:149 mutates the record after commit, so update(ref, (current) => ({...})) would be safer. interaction-touch-reference-frame.ts:75 re-resolves a device platform that cannot change within a lifetime. The diagnostic churn could also be reverted.

On the open threads, the cubic-dev-ai P2 on the non-point touch outcome still applies. No stale settle is published on either path. Still, press @ref and press x y end differently for the same retired state, so please answer which outcome you want.

Smoke Tests is still in progress. Its device route goes through the snapshot publication and settle ref issuance this diff changes, so a failure there needs attributing before anyone dismisses it. I did not rerun the tests or check retirement races in the swipe, scroll or fill routes. Separately, finalizeTouchInteraction still records the action on the retired session object. That is outside this diff and fits the later #3116 slice. Before merge, I need the live evidence above and an answer on the thread.

@thymikee

thymikee commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

Completed the live control at exact head 0b76607bc7 on the owned emulator-5580, after rebuilding the checkout and both Android helpers.

The fresh interactive snapshot reported android-helper, version 0.21.18, generation 547198. Pressing its Network & internet ref with --settle returned a settled partial frame at generation 547202, including Navigate up. The next request pressed @e2~s547202 directly and succeeded, returning home at generation 547205, without another snapshot. The bare @e2 negative control was correctly refused before dispatch with plain_ref_requires_complete_frame and the exact pinned-ref hint.

Then started touch-enabled recording, clicked the previously observed Settings row coordinates (540, 739) with --settle, and stopped recording. Key actual responses:

{
  "refPress": {"success": true, "ref": "e11", "refLabel": "Network & internet", "settled": true, "refsGeneration": 547202},
  "nextPress": {"success": true, "ref": "e2", "refLabel": "Navigate up", "settled": true, "refsGeneration": 547205},
  "recordStart": {"recording": "started", "recordingBackend": "adb screenrecord", "showTouches": true},
  "pointClick": {"success": true, "targetKind": "point", "x": 540, "y": 739, "settled": true, "refsGeneration": 547210},
  "recordStop": {"recording": "stopped", "recorder": "confirmed", "nativePathDisposition": "retired", "showTouches": true}
}

The exported video is playable H.264, 1080×2400, 84.58 seconds. The attached screenshot shows the Network & internet page reached by the recorded point action. The owned session and isolated daemon were cleaned afterward.

Network and internet reached by the recorded point action at 0b76607bc7

@thymikee

thymikee commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

Thanks for the live run at 0b76607. It covers both changed routes: press @eN --settle returned a settle generation, the settle-issued ref then resolved with no stale-ref error, and the recorded click x y --settle returned its generation before record stop confirmed the video. The open question on the non-point touch outcome is answered by #3151. The code verdict is clean and there are no conflicts, so this is ready for human review.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 3, 2026
@thymikee
thymikee added this pull request to stack #3146 October 3, 2026 13:46
@thymikee
thymikee force-pushed the fix/open-session-lifetimes branch from 52ec7eb to 9842be3 Compare October 3, 2026 14:41
@thymikee
thymikee force-pushed the fix/capture-lifetime-review branch 2 times, most recently from 31f90bf to f2f3683 Compare October 3, 2026 15:16
@thymikee
thymikee force-pushed the fix/open-session-lifetimes branch 2 times, most recently from adb93d3 to 838f115 Compare October 3, 2026 16:41
@thymikee
thymikee force-pushed the fix/capture-lifetime-review branch from f2f3683 to 46c0f6e Compare October 3, 2026 16:41
@thymikee
thymikee force-pushed the fix/open-session-lifetimes branch from 838f115 to 55f0ce9 Compare October 3, 2026 16:56
@thymikee
thymikee force-pushed the fix/capture-lifetime-review branch 2 times, most recently from 0f8056d to f1e62db Compare October 3, 2026 17:49
@thymikee
thymikee removed this pull request from stack #3146 October 3, 2026 19:38
@thymikee
thymikee force-pushed the fix/capture-lifetime-review branch from f1e62db to 9403b97 Compare October 3, 2026 19:39
@thymikee
thymikee added this pull request to stack #3187 October 3, 2026 19:45
@thymikee
thymikee removed this pull request from stack #3187 October 3, 2026 20:59
@thymikee

thymikee commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

Consolidated into #3144 as part of reducing #3116 to seven PRs. The composition preserves the complete pre-consolidation source tree, including tests and later review corrections. This PR is superseded; its review discussion and native evidence remain available. Outstanding findings transfer to the owning keeper in the implementation record.

@thymikee thymikee closed this Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-03 21:13 UTC

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