Skip to content

fix(identity): keep shallow captures and read the window once per action - #447

Merged
lahfir merged 5 commits into
laf/identity-linux-windowsfrom
laf/identity-capture-fixes
Nov 1, 2026
Merged

lahfir merged 5 commits into
laf/identity-linux-windowsfrom
laf/identity-capture-fixes

Conversation

@roboeve

@roboeve roboeve Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #442. Snapshots keep a finished shallow read when the deep read falls short and now flag it with data.identity_unproven; actions read the window once, and a transient failure under the lease goes back to the wait; Linux hover acts on the handle core resolved.
Capture and resolution now read the same evidence (--force-electron-a11y is recorded on the ref) and keep the same proof (hydrated finds, skeleton anchors, token-rooted drills); macOS tokenless anchors land by position and role and leave identity to core; interval typing reuses the first keystroke's element.
Exact FFI entries refuse with ACTION_NOT_SUPPORTED, the envelope moves to 2.6, and refusal messages, skills and docs match the code.

- A whole-window read that fails or comes back incomplete keeps the finished shallow snapshot instead of replacing it or failing it, and it keeps --force-electron-a11y.
- The pre-lease poll lands a ref at its stored path and confirms it, so an action does one whole-window read instead of two. Dispatch still runs the full rule under the lease.
- A token missing from an incomplete read is reported as unknown, not as a permanent STALE_REF.
- Linux hover confirms the pointer receiver on the handle core resolved instead of re-resolving through the old Linux search.
- Well-formed exact FFI entries refuse with ACTION_NOT_SUPPORTED (exact_entry_unsupported) and no longer run dead resolve and execute paths.
- Refusal messages, skills, docs and probe rows now match the code.

Tested: fmt, clippy -D warnings, core, linux, ffi and binary tests, a Windows cross-check of core and the Windows crate, and live GTK4 runs under Xvfb.

BREAKING CHANGE: the response envelope is 2.6, and ad_resolve_element_exact and ad_execute_ref_action_exact_with_policy return ACTION_NOT_SUPPORTED for a well-formed entry.
@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
agent-desktop Ignored Ignored Preview, v0 Nov 1, 2026 9:56pm UTC

…he same proof

Review follow-up for the capture rule.

- Record --force-electron-a11y on the saved entry so resolution, drills and rooted find read the window the way the capture did.
- Send a retryable, undelivered resolution failure under the lease back to the wait while budget remains, since the wait now only lands the ref provisionally.
- Flag a snapshot whose whole-window proof read failed or was cut short with data.identity_unproven, and trace why.
- Keep the proven predicate on a hydrated find entry; hydrated fields only describe the match.
- Plan skeleton drill anchors from the capture proof, so a unique ancestor anchors a twin boundary.
- Drill a token root from the whole-window read, so its tokenless descendants are proven.
- Land macOS tokenless anchors by position and role only and leave identity to core.
- Reuse the handle the first keystroke landed on for an interval burst instead of resolving again.

Tested: fmt, clippy -D warnings for macOS (cross-checked), Windows and Linux targets, core, binary and FFI tests, the Linux lib suite under dbus-run-session and xvfb-run, the pre-commit hook, and each new test against its reverted fix.
@roboeve
roboeve Bot marked this pull request as ready for review November 1, 2026 21:05

@vercel vercel 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.

Additional findings

  1. crates/core/src/snapshot/snapshot_ref.rs:164-165 — When a whole-window read finds a token root but truncates its descendants, the drill now succeeds with complete: true and replaces previously saved subtree refs with partial results.

    Fix on Vercel

roboeve Bot added 3 commits November 1, 2026 21:38
…l all or nothing

- A drill rooted at a token reads the subtree through that token and moves to the whole-window read only when the subtree holds a tokenless ref, as capture_window does, so a macOS drill of tokened refs no longer reads the whole window.
- A drill whose whole-window read comes back cut short fails with TIMEOUT instead of replacing stored refs with a partial subtree.
- A ref-able twin at a skeleton boundary no longer covers it; the nearest proven ancestor anchors it.
- A snapshot at depth 50 or more that comes back cut short now sets identity_unproven.
- A ref action whose budget runs out after a refusal under the lease reports that refusal in details.cause.
- The skill's identity_unproven wording now covers macOS elements with no address.

Tested: fmt, clippy -D warnings for macOS (cross-checked), Windows and Linux targets, core, binary and FFI tests, the Linux lib suite under dbus-run-session and xvfb-run, the pre-commit hook, and each new test against its reverted fix. The macOS perf baseline was not run: it needs a Mac.
…e a string

- Brings laf/identity-linux-windows (443a316) into this branch, keeping the validate_saved_ref_context call in observe_saved_ref so every rooted read still checks the popup binding.
- Reports the dispatch-time refusal in details.refusal instead of details.cause, which other errors already use as a string, and omits its details when it has none.
@lahfir
lahfir merged commit d29aa1d into laf/identity-linux-windows Nov 1, 2026
37 checks passed
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