fix: enforce snapshot mutation leases across CLI and MCP #789
<!-- clawsweeper-pr-ack:opened item=789 -->
🦞👀
ClawSweeper picked this up.
Pull request received. I will update this pull request when review starts.
<!-- clawsweeper-review-progress:start -->
ClawSweeper review complete
ClawSweeper finished reviewing this revision. The review result is being finalized.
View the workflow run.
<!-- clawsweeper-review-progress:end -->
PR Summary
<!-- CURSOR_SUMMARY -->
High Risk
Changes core desktop mutation safety across CLI and MCP input paths; incorrect lease handling could block legitimate retries or allow unsafe replay on consumed snapshots.
Overview
Snapshot-backed mutations now acquire and finalize a single mutation lease before any focus or input runs, closing replay on explicit snapshot IDs that were pending or already consumed.
A shared withSnapshotMutation helper on SnapshotManagerProtocol centralizes begin/finish lease handling, canonical outcome projection, and safe behavior when completion is unknown. The CLI SnapshotMutationCoordinator delegates to it; TypeCommand routes ordinary typing through that path. MCP tools click, action, set_value, snapshot-backed scroll, type, and press use the same reservation so stale snapshots return SNAPSHOT_STALE / refused outcomes before dispatch. Historical snapshot reads stay available; modifier-click and pixel-focus typing keep their existing host-owned lease model.
Regression coverage adds lifecycle unit tests, CLI typing snapshot tests, and a broad MCP ordinary-input matrix; test helpers pair in-memory snapshot producers with UI snapshot metadata.
<sup>Reviewed by Cursor Bugbot for commit ca9e5eeca67b448dcc59876eebfdae56cb79b096. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>
<!-- /CURSOR_SUMMARY -->
Codex review: needs maintainer review before merge. _Reviewed September 24, 2026, 12:28 PM ET / 16:28 UTC (Revision 6)._
ClawSweeper review
What this changes
The branch adds snapshot mutation reservations to CLI typing and six MCP input tools, with shared lifecycle handling, regression tests, and documentation.
Merge readiness
✅ Ready for maintainer review
Keep this PR open: current main still lacks the explicit-snapshot mutation guard. The current-head native trace addresses the prior proof request, and the maintainer has accepted the fail-closed upgrade. I found no actionable patch defect.
Priority: P1
Reviewed head: ca9e5eeca67b448dcc59876eebfdae56cb79b096
Review scores
| Measure | Result | What it means |
|---|---|---|
| Overall readiness | 🦞 diamond lobster (5/6) | The patch has focused authorization coverage and convincing current-head native proof, with no actionable defect found. |
| Proof confidence | 🦞 diamond lobster (5/6) | Sufficient (live_output): A signed CLI stamped with the exact PR head exercised public MCP stdio against a native fixture: a waited click dispatched, the identical consumed source was refused before desktop input, and a newly observed source dispatched successfully. Pending-source refusal has focused production-tool coverage. The PR does not change the persisted lease format. |
| Patch quality | 🦞 diamond lobster (5/6) | No actionable review findings were identified. |
Verification
| Check | Result | Evidence |
|---|---|---|
| Real behavior | Verified | Sufficient (live_output): A signed CLI stamped with the exact PR head exercised public MCP stdio against a native fixture: a waited click dispatched, the identical consumed source was refused before desktop input, and a newly observed source dispatched successfully. Pending-source refusal has focused production-tool coverage. The PR does not change the persisted lease format. |
| Evidence reviewed | 10 items | Current-main gap: Current main calls the MCP action provider after resolving an explicit snapshot without first reserving that snapshot in the producer store. The branch therefore retains a distinct fix.<br>Shared authorization boundary: The introduced helper acquires a producer-store lease before running the supplied operation, retains it on unknown completion, and finalizes it from the canonical outcome.<br>Waited-click authority: Ordinary clicks reserve the original caller snapshot before dispatch; waited-query resolution may separately use a fresh match for the input target. |
| Findings | None | None. |
| Security | None | None. |
How this fits together
Peekaboo’s CLI and MCP tools turn UI snapshot references into macOS Accessibility or input actions. The snapshot producer stores those references and determines whether one can authorize another mutation.
flowchart LR
A[CLI or MCP input request] --> B[UI snapshot reference]
B --> C[Producer snapshot store]
C --> D{Mutation allowed?}
D -->|No| E[Stale snapshot refusal]
D -->|Yes| F[Desktop input]
F --> G[Canonical outcome and lease completion]
Before merge
None.
<details>
<summary><strong>Agent review details</strong></summary>
Security
None.
Review metrics
| Metric | Value | Why it matters |
|---|---|---|
| Production and test lines | production +142 net, tests +1608 net | The production growth is concentrated in shared lease handling, with broad multi-verb regression coverage for the authorization change. |
Technical review
Best possible solution:
Use one producer-store lease for each snapshot-backed mutation, preserve historical reads, and require a new observation after uncertain dispatch while retaining the accepted fail-closed upgrade behavior.
Do we have a high-confidence way to reproduce the issue?
Yes. Current-main source allows an explicit snapshot to reach MCP action dispatch without a producer-store reservation, and the supplied native trace and focused fixtures define the replay path. This read-only review did not execute macOS input.
Is this the best way to solve the issue?
Yes. Reserving through the existing producer-store contract before input closes the replay path without removing historical reads, and the current-head trace shows consumed-source refusal followed by fresh-source recovery.
AGENTS.md: found and applied where relevant.
Codex review notes: model internal, reasoning high; reviewed against ce5115a70756.
Labels
Label changes:
No label changes.
Label justifications:
P1: Explicit snapshot replay can reach a second desktop mutation after authority should be spent, affecting active automation workflows.merge-risk: 🚨 compatibility: Existing scripts that reuse an explicit snapshot after dispatch will now be refused; the collaborator explicitly accepted that fail-closed upgrade.merge-risk: 🚨 security-boundary: The patch changes the authorization check immediately before desktop input, and current-head native proof exercises a consumed source at that boundary.rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): A signed CLI stamped with the exact PR head exercised public MCP stdio against a native fixture: a waited click dispatched, the identical consumed source was refused before desktop input, and a newly observed source dispatched successfully. Pending-source refusal has focused production-tool coverage. The PR does not change the persisted lease format.proof: sufficient: Contributor real behavior proof is sufficient. A signed CLI stamped with the exact PR head exercised public MCP stdio against a native fixture: a waited click dispatched, the identical consumed source was refused before desktop input, and a newly observed source dispatched successfully. Pending-source refusal has focused production-tool coverage. The PR does not change the persisted lease format.Evidence
What I checked:
Core/PeekabooCore/Sources/PeekabooAgentRuntime/MCP/Tools/ActionTool.swift:70, ce5115a70756)Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/Support/SnapshotManagerProtocol+Mutation.swift:20, ca9e5eeca67b)Core/PeekabooCore/Sources/PeekabooAgentRuntime/MCP/Tools/ClickTool.swift:140, ca9e5eeca67b)Core/PeekabooCore/Tests/PeekabooTests/MCP/MCPOrdinarySnapshotMutationTests.swift:12, ca9e5eeca67b)Likely related people:
Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/Support/SnapshotStorageActor+MutationLease.swift)Rating scale
| Score | Internal tier | Crab rank | Meaning |
|---:|:---:|---|---|
| 6/6 | S | 🦀 challenger crab | Exceptional readiness |
| 5/6 | A | 🦞 diamond lobster | Very strong readiness |
| 4/6 | B | 🐚 platinum hermit | Good normal PR; ordinary maintainer review |
| 3/6 | C | 🦐 gold shrimp | Useful, but confidence is limited |
| 2/6 | D | 🦪 silver shellfish | Proof or implementation needs work |
| 1/6 | F | 🧂 unranked krab | Not merge-ready |
| N/A | NA | 🌊 off-meta tidepool | Rating does not apply |
Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.
Workflow
@clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.@clawsweeper review to request a fresh review only.@clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.@clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.History
<details>
<summary>Review history (5 earlier review cycles)</summary>
<!-- clawsweeper-review-history v=1 total=5 -->
</details>
</details>
<!-- clawsweeper-verdict:needs-human item=789 sha=ca9e5eeca67b448dcc59876eebfdae56cb79b096 confidence=high updated_at=2026-09-24T16:25:47Z reviewed_at=2026-09-24T16:28:09.677Z lease_owner=github-run-36027212613-1 lease_comment_id=5818008776 source_revision=5618354b80ecab96e68f44d8b8942328ede1111fcad67b6a2adf0d76a6b5876d live_verification=absent -->
<!-- clawsweeper-review-state:ready item=789 sha=ca9e5eeca67b448dcc59876eebfdae56cb79b096 v=1 -->
<!-- clawsweeper-review-version item=789 reviewed_at=2026-09-24T16:28:09.677Z sha=ca9e5eeca67b448dcc59876eebfdae56cb79b096 source_revision=5618354b80ecab96e68f44d8b8942328ede1111fcad67b6a2adf0d76a6b5876d lease_owner=github-run-36027212613-1 lease_comment_id=5818008776 v=1 -->
<!-- clawsweeper-review item=789 -->
Maintainer decision: accept the intentional fail-closed upgrade. A pending or consumed snapshot must not authorize new input. Retained history stays readable; the supported recovery is a new observation followed by an action using its new reference. Keeping the former unsafe explicit-ID replay is not a compatibility requirement.
Final-head native recovery is now verified on ec54f13224c599180d0c659747320c9a1d6894f0, using a signed/source-stamped CLI (SHA-256 6e25f4417affca0032914d53397f45a32247f7911463401cf43e05dd2f050906) and the public persistent stdio MCP interface against a synthetic Playground field. The retained public artifacts passed a source-blind contract assessment and independent second read; signature/source-stamp verification was a separate maintainer check.
One AX-only background click consumed an observed snapshot. Each of click, action, set_value, scroll, and press then refused that exact ID once with the consumed-ID diagnostic and canonical refused / target_unavailable / dispatch_state none / mutation_dispatched false / retry_safe true. A fresh observation after all five retained the original field/submitted values and action count 113. A new reference then permitted confirmed background set_value; another independent AX observation read the exact new marker 789-lease-recovery-20260924-ec54, with submitted text unchanged.
Scope caveats remain explicit in the updated PR body. Recovery's counter became 115 and last action was Window moved, despite identical sampled bounds; attribution of those increments or movement is unestablished. We do not call them two field actions, exactly one event, or zero other activity. The completed observer enclosed the run with no activation notifications, but makes no cursor claim. Cache metadata is absent. This proves the five consumed-ID negative cases and cross-verb value recovery—not literal typing, fresh support for every chosen control/verb, a Safari rerun, internal capture/cache behavior, or broad computer-use parity. Earlier failure evidence is retained.
No source change was made for this evidence. macOS CI and Bugbot are green on this same head; Swift CodeQL remains pending.
@clawsweeper re-review
<!-- clawsweeper-command-ack:5815900688 -->
<!-- clawsweeper-command-status:789:re_review:command-5815900688-mufmb9kg-54a40ec99091586e63fe9d200247ee0738848d72124bfded902577d9d285f93f -->
🦞👀
Exact review queued.
<!-- clawsweeper-command-progress:start -->
Re-review progress:
<!-- clawsweeper-command-progress:end -->
<!-- BUGBOT_REVIEW -->
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
<!-- BUGBOT_FIX_ALL -->
<a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aToxMzFlY2NiYy0yN2EyLTQxYWQtYjMwNy02NTYyMDZlZDgxOTciLCJlbmNyeXB0aW9uS2V5IjoiX2w4QW9zNzkzUFE1ZUJzY2lxU2xEc2NITENwV1RYdE9JQ3pzVkN2SkJRVSIsImJyYW5jaCI6ImNvZGV4L3NuYXBzaG90LW11dGF0aW9uLWxlYXNlLWNvdmVyYWdlIiwicmVwb093bmVyIjoib3BlbmNsYXciLCJyZXBvTmFtZSI6IlBlZWthYm9vIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>
<!-- /BUGBOT_FIX_ALL -->
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN -->
<sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.</sup>
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END -->
<sup>Reviewed by Cursor Bugbot for commit c657731c7803e5c525528545410289b871ec820b. Configure here.</sup>
Type lease consumes proven no-ops
Medium Severity
<!-- DESCRIPTION START -->
Ordinary typing finalizes a snapshot lease from sequenceResolution.outcome only and keeps the default fallback that always requires a fresh observation. press and scroll already pass composed requiresFreshObservation, so a mixed-route confirmed no-op can release. Typing with setup focus plus a no-change leaf often has no single aggregate, so a still-valid snapshot is consumed and later mutations are refused until the caller observes again.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: f92a3edd-05a3-434e-ad82-c63574666372 -->
<!-- LOCATIONS START
Core/PeekabooCore/Sources/PeekabooAgentRuntime/MCP/Tools/TypeTool.swift#L285-L300
Apps/CLI/Sources/PeekabooCLI/Commands/Interaction/TypeCommand.swift#L116-L127
Apps/CLI/Sources/PeekabooCLI/Commands/Shared/SnapshotMutationCoordinator.swift#L6-L20
LOCATIONS END -->
<details>
<summary>Additional Locations (2)</summary>
Apps/CLI/Sources/PeekabooCLI/Commands/Interaction/TypeCommand.swift#L116-L127Apps/CLI/Sources/PeekabooCLI/Commands/Shared/SnapshotMutationCoordinator.swift#L6-L20</details>
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjZkMzUxMTNhLThlNjMtNDI3MS04MzZlLWRiMmVjNzUzMTIwMyIsImVuY3J5cHRpb25LZXkiOiJ5Z28wVEE2STVJSjNJV28ydFBtZGZrVmNYaVFlaGxaT3BCRlBhN2FaeXFVIiwiYnJhbmNoIjoiY29kZXgvc25hcHNob3QtbXV0YXRpb24tbGVhc2UtY292ZXJhZ2UiLCJyZXBvT3duZXIiOiJvcGVuY2xhdyIsInJlcG9OYW1lIjoiUGVla2Fib28iLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjZkMzUxMTNhLThlNjMtNDI3MS04MzZlLWRiMmVjNzUzMTIwMyIsImVuY3J5cHRpb25LZXkiOiJ5Z28wVEE2STVJSjNJV28ydFBtZGZrVmNYaVFlaGxaT3BCRlBhN2FaeXFVIiwiYnJhbmNoIjoiY29kZXgvc25hcHNob3QtbXV0YXRpb24tbGVhc2UtY292ZXJhZ2UiLCJyZXBvT3duZXIiOiJvcGVuY2xhdyIsInJlcG9OYW1lIjoiUGVla2Fib28iLCJwck51bWJlciI6Nzg5LCJjb21taXRTaGEiOiJjNjU3NzMxYzc4MDNlNWM1MjU1Mjg1NDU0MTAyODliODcxZWM4MjBiIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by Cursor Bugbot for commit c657731c7803e5c525528545410289b871ec820b. Configure here.</sup>
Checked against the current head c657731c7803e5c525528545410289b871ec820b: this proposed successful no-op path is unreachable. TypeTool calls TypeActionResultSemantics.requireConfirmed before sequence.successResolution() (call site); that delegates to requireConfirmedChange, whose explicit state guard throws for confirmedNoChange (guard). The helper therefore receives the canonical failure disposition, not a nil successful aggregate.
The CLI has the same confirmed-change guard; its optional exception accepts only dispatchedUnverified, not a no-change leaf (CLI boundary). Existing regression Confirmed no-change typing leaf is not successful even when setup focus changed covers that distinction and passed in the current-head affected runs (132 Core tests and 69 CLI tests).
press intentionally accepts confirmed no-change chords, which is why its composed fallback is necessary. No source change is needed for this typing warning; the fresh ClawSweeper review independently reached the same conclusion.
Current-head combined native authorization proof is PASS for ca9e5eeca67b448dcc59876eebfdae56cb79b096.
The signed CLI contains landed #785 and #788 plus this PR, on base 00f951909. The operator independently verified its source stamp and strict macOS signature before execution. Signed CLI SHA-256: c39e796db1cbbb8b83a17e1dc5d8ba025a62c92d6ae796e32971ff61f7f4d989; adjacent compatibility runtime SHA-256: 779165e75ad1964ece66a0ba05a46576b029fe34a85eb64b4c20fb7a17b96879. A separate source-blind assessor read the prewritten V3 contract before inspecting the retained public request/response artifacts and passed all C1–C7 clauses. Source/signature eligibility is operator-attested separately from that behavioral assessment.
The public original-source chain is explicit:
1. Two bounded, pristine observations established the exact inactive native fixture. The success control was absent after its sole ARM.
2. A waited query with original snapshot ps1_a50c672a3f90d1ff630dfa96d43339af dispatched one background Accessibility action after about 6.09 seconds. Public readback showed Success activation count 1.
3. The deliberately repeated query used that identical original ID, not the count-one readback snapshot. In about 42 ms it returned SNAPSHOT_STALE, state:refused, dispatch_state:none, mutation_dispatched:false, and retry_safe:true.
4. After the prospectively required passive delay of 1,600.61 ms, one new C4 observation still showed count 1, the same exact target, and a distinct fresh source ps1_5ae870c2db2ad208a1a382a9e1fd44db. No cached-tree advertisement appeared; optional cache metadata was absent. This satisfies the public freshness rule, not an internal-cache audit.
5. One recovery query used only that fresh source with zero wait. It dispatched one background Accessibility action, and a separate public readback showed Success activation count 2.
6. A separate absent-control query with a 250-ms wait returned the ordinary no-dispatch timeout refusal in about 289 ms. A read sent more than 6.5 seconds later showed the control had appeared but Timeout activation remained 0, with Success still 2. The contract does not impose a 250-ms end-to-end transport ceiling.
Both dispatched actions remain canonically isError:true / dispatched_unverified, not confirmed_change. Independent public readbacks establish the fixture counter effects; they do not upgrade the action receipts. The consumed-source call was the one preauthorized anti-replay probe, not an automatic retry of an uncertain action.
All mandatory receipts and non-null target metadata preserved the exact PID/window/generation. Per-query inventory endpoints had identical retained-ID lists (366→366, 367→367, 370→370); they do not prove zero internal allocations, files, AX/cache/capture work, or mid-wait lifetimes. The trace contains eight inspect_ui and six click calls plus initialization/discovery, with no foreground flag, screenshot request, or image response. MCP exited 0 without forced shutdown, and the operator separately cleaned up its exact owned fixture. The independent activation observer covered the full run and cleanup from 16:12:57.840 to 16:13:57.852 UTC and recorded no delivered activation notifications. No cursor, z-order, undelivered-event, or general user-interruption claim is made.
This closes the requested current-head valid-original dispatch → nearest forbidden consumed-original refusal → fresh-observation recovery gap. The checklist requests pending or consumed native authority; pending and consumed both retain deterministic production-tool coverage, but no native pending-overlap proof is claimed. This does not qualify later #790 changes, real PID reuse, other consumers, or unrestricted computer-use parity. The PR body now distinguishes this ca9 proof from the earlier ec54 trace. Exact-head macOS CI is green; Swift CodeQL is still a separate pending gate.
@clawsweeper re-review
<!-- clawsweeper-command-ack:5817984364 -->
<!-- clawsweeper-command-status:789:re_review:command-5817984364-mufqs25c-9656a1b15dcde4fa2aac0b16e1bef6bf877febb670facf3287204d4a348753a4 -->
🦞👀
Exact review queued.
<!-- clawsweeper-command-progress:start -->
Re-review progress:
<!-- clawsweeper-command-progress:end -->
Merged as 194cd90dd06860a449a0c371f4c5ac325cb4a59c, using the exact qualified head ca9e5eeca67b448dcc59876eebfdae56cb79b096. The resulting tree matches the verified merge preview on main 23b818fc0; every owned non-changelog file remains byte-identical to the qualified candidate, #790 and #792 are preserved, and the root changelog contains the single intended lease entry.
Qualification passed: 333 affected Core tests, 78 affected CLI tests, scoped lint/format, current-base Autoreview, all macOS CI jobs, all CodeQL analyses, and the cleared current-head reviews. The signed native C1–C7 proof covers waited dispatch, consumed-original refusal before input, fresh-source recovery and ordinary timeout. Its actions remain canonically unverified with separate public readbacks; pending-source refusal has deterministic coverage.
That native execution remains attributed to signed ca9e5eeca on tested base 00f951909, not a whole merged-tree run including later #790/#792 changes. No broader parity, native pending-overlap, or internal cache/capture claim is made.
steipete
Summary
Close the explicit-snapshot replay gap in ordinary CLI typing and MCP input tools. Invalidating implicit
latestdid not revoke mutation authority for an explicitly supplied historical snapshot, so a pending or consumed snapshot could still reach another mutation while its target identity remained valid.Move the existing lifecycle into one
SnapshotManagerProtocolhelper, keep the CLI adapter thin, and use the same producer-store reservation for ordinary MCPclick,action,set_value, snapshot-backedscroll,type, andpress. The reservation covers any setup focus plus input; unknown completion remains blocked, and canonical outcomes determine whether a snapshot can be reused. A proven composed no-op can release its reservation when no single aggregate outcome exists, but cannot override a concrete canonical outcome.Explicit historical reads remain available. Modifier-click and pixel-focus typing retain their single host-owned lease; selector-driven paste and snapshot-free foreground routes are unchanged. Ordinary clicks reserve the original caller snapshot, preserving the separate dispatch snapshot used by waited-query handling.
Regression coverage
Share one linked producer/UI fixture with the typing tests and exercise a 66-case ordinary-input matrix: pending/consumed refusal, cross-verb replay, canonical release, missing/unverified outcomes, finalization failure, cancellation, setup-focus composition, and exact-one leaf ownership. Existing positive fixtures now publish explicit paired in-memory snapshots; their assertions and negative cases remain intact.
The current-main integration also proves that waited query clicks dispatch using the fresh match while reserving the original caller snapshot, clean temporary matches when original authority is pending or consumed, and release an unused reservation when the deadline expires during lease acquisition. Modifier-click keeps its separate host-owned lease.
Documentation and Unreleased notes are updated.
Verification
7ab44d8: 971 tests across 77 suites passed (MCP|UISnapshot|PasteTool|PressTool). All 24 owned non-changelog files are byte-identical after rebasing onto7a10d5460.TypeCommandTruthTests|ActionOutcomeCommandTests|SnapshotMutationCoordinatorTargetTests).BrowserSessionTransportRuntimeTests.35c754e7(c657731c7): 132 affected Core tests across eight suites and 69 affected CLI tests across six suites passed, including scrolling/help and window-visibility integration.ca9e5eecaon tested base00f951909, including the landed query-wait (#785) and dialog-discovery (#788) changes: 333 affected Core tests across 18 suites and 78 affected CLI tests across seven suites passed. The complete current-base P0 Autoreview is scoped-clean; strict scoped lint and formatting pass. Exact-head macOS CI passed all five jobs and CodeQL passed all three analyses. Current-head combined native proof passed C1–C7 below.Current-head combined native proof —
ca9e5eecaA fresh signed CLI at exact published source
ca9e5eeca67b448dcc59876eebfdae56cb79b096completed the prewritten V3 public-MCP wait/source-lease scenario against a directly owned synthetic native fixture. An independent source-blind assessment passed all C1–C7 clauses with no accepted behavioral failure. The operator separately verified the source stamp and strict macOS signatures; the artifact assessor did not infer executable provenance from behavior. Signed CLI SHA-256:c39e796db1cbbb8b83a17e1dc5d8ba025a62c92d6ae796e32971ff61f7f4d989.The original pre-wait source was
ps1_a50c672a3f90d1ff630dfa96d43339af; the deliberate replay used that identical ID, not the newer count-one readback. C4 later supplied the distinct recovery sourceps1_5ae870c2db2ad208a1a382a9e1fd44db.| Public operation | Canonical result | Independent public readback |
| --- | --- | --- |
| Delayed query, original source, 12,000-ms wait | One background Accessibility dispatch after about 6.09 seconds;
dispatched_unverified,mutation_dispatched:true, fresh observation required | Success activation count 1 || Same query, exact consumed original source | About 42 ms;
SNAPSHOT_STALE,state:refused,dispatch_state:none,mutation_dispatched:false,retry_safe:true| C4 still showed count 1 || Recovery with only C4's fresh source, zero wait | One background Accessibility dispatch;
dispatched_unverified| Success activation count 2 || Separate absent control, 250-ms wait | Ordinary no-dispatch timeout refusal in about 289 ms, not stale-source or permission failure | Control appeared later, but Timeout activation remained 0 and Success remained 2 |
Both dispatched actions retain
isError:trueand the unverified canonical classification; the readbacks establish the observed fixture effects, notconfirmed_changereceipts. C4 was one new observation after the prospectively required 1,600.61-ms passive delay; no cached-tree advertisement appeared and optional cache metadata was absent. This satisfies the public freshness rule, not an internal-cache audit. The deliberate consumed-source call was the preauthorized negative probe, not an automatic retry after uncertain dispatch.Exact target receipt/generation stayed consistent. The three per-query retained-snapshot inventories had identical endpoint ID lists (366→366, 367→367, 370→370); this does not establish zero internal allocations, captures, writes, or mid-wait lifetime behavior. The trace contains eight
inspect_uiand sixclickcalls plus initialization/discovery, no foreground flag, no screenshot request, and no image response. The MCP process exited 0 without forced shutdown; the operator separately cleaned up its owned fixture. An independently installed activation observer covered the full run and cleanup from 16:12:57.840 through 16:13:57.852 UTC and recorded no delivered activation notifications. No cursor, z-order, undelivered-event, or unrestricted non-interruption claim is made.This qualifies the exact
ca9e5eecaintegration on tested base00f951909, not later #790/#792 changes or a whole merged-tree native run, and not full cross-app/consumer parity. Pending-source refusal remains deterministic test coverage; this run establishes the nearest forbidden consumed source, not a native pending-overlap experiment.Prior native evidence and limits
Earlier native evidence, attributed by the maintainer to prerequisite candidate
cb90e63ad, used a synthetic Playground field. A background AX-onlyFocus Basic Fieldaction consumed a fresh snapshot;type --clearwith that same ID then returned the specificSNAPSHOT_STALErefusal withmutation_dispatched: false. Fresh field and last-submitted-value readbacks were unchanged. A source-blind assessment of the supplied artifacts passed this narrow consumed-ID check; the assessor did not independently verify executable provenance from those artifacts.That earlier prerequisite trace is distinct from the later
ec54f1322run below. The earlier Safari stale-dispatch failure remains historical evidence and was not replaced by a full Safari rerun. Its earlier observer ended before its final readback; that limitation is not retroactively changed by new evidence.Native public MCP recovery on prior head
ec54f1322A signed candidate with verified source stamp
ec54f13224c599180d0c659747320c9a1d6894f0and CLI SHA-2566e25f4417affca0032914d53397f45a32247f7911463401cf43e05dd2f050906completed a native public-stdio workflow against a synthetic Playground field. Retained public transport artifacts passed an independent source-blind assessment against the prewritten contract, with a second reader. Source/signature verification was performed separately by the maintainer, not inferred by the artifact reviewers.The first rebase onto main
35c754e7reconciled the landed scrollbar, native-window, and visibility work. Atc657731c7, all 22 owned Swift implementation/test files anddocs/MCP.mdwere byte-identical toec54f1322; typing documentation preserved both upstream native-window and lease statements.The current candidate
ca9e5eecais rebased onto actual main00f951909after #785 and #788 landed, and adds their combined waited-click/lease regression coverage. The native run below remains explicitly prior-head evidence. It did not include the query-wait repair; the current combined proof above uses a fresh signed candidate because #788 also changes the shared observation worker's completion ordering.Focus Basic Fieldclick required fresh observation and advanced the fixture counter from 112 to 113. Its dispatched-unverified result establishes consumption, not confirmed focus.click,action,set_value,scroll, andpresseach used that same consumed ID once. All five returned its specific consumed-snapshot diagnostic withstate:refused,refusal_reason:target_unavailable,dispatch_state:none,mutation_dispatched:false, andretry_safe:true. Fresh readback retained counter 113 and the original field/submitted values.set_valuerecovery. The result was confirmed background accessibility-value change; a separate subsequent AX observation showed exactly789-lease-recovery-20260924-ec54in the same field, with submitted text unchanged.Recovery's counter was 115 and latest action text was
Window moved, while sampled bounds were unchanged. The two increments and any movement cause are not established: this is not an exactly-one-event, two-field-action, zero-other-activity, or no-movement claim. Cache metadata was omitted; the new recovery marker is behavioral readback evidence, not an internal cache audit. The negative matrix proves consumed authorization is refused, not fresh native support for each chosen control/verb. This is cross-verb value recovery, not literal typing, a Safari rerun, or complete cross-app/concurrent computer-use parity.Maintainer decision: the fail-closed upgrade is intentional and accepted. Pending/consumed snapshots must not authorize new mutations; retained history remains readable, and scripts must observe again before continuing with new authority. No unsafe compatibility fallback is intended.