feat(extension): experimental target readiness for Jev acts - #2994
Draft
miguelg719 wants to merge 9 commits into
Draft
miguelg719 wants to merge 9 commits into
miguelg719 wants to merge 9 commits into
Conversation
🦋 Changeset detectedLatest commit: 4298bb4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
miguelg719
force-pushed
the
jev/7-overlap
branch
from
September 21, 2026 21:14
577eb9f to
2b7f9f8
Compare
miguelg719
force-pushed
the
jev/8-target-readiness
branch
from
September 21, 2026 21:18
30a71d5 to
28f17c5
Compare
miguelg719
force-pushed
the
jev/7-overlap
branch
from
September 21, 2026 21:25
2b7f9f8 to
8e75cf8
Compare
miguelg719
force-pushed
the
jev/8-target-readiness
branch
from
September 21, 2026 21:25
28f17c5 to
bbd4393
Compare
miguelg719
force-pushed
the
jev/7-overlap
branch
from
September 21, 2026 21:35
8e75cf8 to
052098b
Compare
miguelg719
force-pushed
the
jev/8-target-readiness
branch
from
September 21, 2026 21:36
bbd4393 to
00e84d7
Compare
miguelg719
force-pushed
the
jev/7-overlap
branch
from
September 21, 2026 21:46
052098b to
4c8f238
Compare
…drop the pageSettled gate
…se; regenerate artefacts
miguelg719
force-pushed
the
jev/8-target-readiness
branch
from
September 21, 2026 21:46
00e84d7 to
4298bb4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack
Stack: #2951 → #2952 → #2953 → #2954 → #2955 → #2988 WebMCP tools → #2993 settle overlap → this PR. Base:
jev/7-overlap.Objective
The least caller-visible wait at reasonable accuracy. After #2993 the DOM-settle wait (network quiet ≥ 500 ms, capped at 5 s) is more than half of a Jev act. This PR lets an act go ahead as soon as its target is there and hittable, and keeps the settle wait only as the upper bound.
Can Jev tell whether a page is loaded? (measured first, so it is not the design)
30 → 40 sites recorded every 200 ms from navigation start (1,569 samples); completeness = share of the page's final content already present.
Content alone carries no "loadedness": a half-loaded page reads as a smaller finished one. With loading cues (in-flight requests, pending images, aria-busy, progress bars, spinner-like elements, interactive-element count) Jev does separate settled from loading pages (0.85–0.94 accuracy vs a 0.81–0.90 majority baseline); "cues quiet twice + Jev settled ≥ 0.6" let 15 of 40 pages go early with 2 premature exits, against 7 premature for the network-quiet heuristic itself. Wired live as a gate, it refused ("page busy") on exactly the pages readiness would have sped up and bought no accuracy, so it was removed (commit history has it). The objective is speed at reasonable accuracy; a page-level verdict trades the former for safety the evals did not show was needed.
What this PR does
Opt-in
experimentalJevAct.targetReadiness(default off):elementFromPoint; off-screen targets skip this). Refusals are traced with the reason and, when covered, what covers it.px-captcha-modaliframe). The click is held while covered or moving, up to 1.5 s, then proceeds; the trace names the cover.The guard and "wait for the effect, not the page" are borrowed from browser-use/jev-ultrafast.
Results (Browserbase, gemini-3.8-flash fallback)
Ordinary suites, 1 trial, caller-side time (settle included):
* breadth median moved 889 → 1231 → 1379 ms across three runs of near-identical code on the same day; that spread is Browserbase/network variance, not the change. Earlier same-day run of this design: 785 ms for the acts that went early.
Load race, 15 tasks × 3 trials, act issued right after
domcontentloadedon late-loading sites (not in the stack):Six tasks fail in every arm for the same reasons: Airbnb, Target, Zillow put a modal or a PerimeterX captcha over the target (the guard reports
covered: iframe: px-captcha-modal, waits its cap, then clicks — into the wall); CNN never gets past a "Loading…" placeholder within the 5 s cap; Spotify's sidebar button is present and hittable but the SPA has not attached handlers, so the click does nothing in the settle arm too; IKEA's "Products" opens a menu (task design). These are correctness gaps in reporting (a click that did nothing is returned as success), not readiness regressions;retryNoEffectis the existing opt-in that would catch them and is worth measuring on this suite.What the floor is now. On heavy pages the first accessibility-tree capture is 3–6 s while the page is still churning (readiness "ready at attempt 1" ends at 2.5–8 s with intent ~150 ms and pick ~150 ms). The settle wait is no longer the binding constraint on those pages; snapshot capture is. That is the next lever (cheaper first snapshot, or an in-page DOM reader for the pointer view as jev-ultrafast does), and it is outside this PR.
Caveats: single trials on the ordinary suites; the load suite is small and noisy; eval pages rarely exercise a target that appears before it is usable, which is why this stays opt-in.
Testing
Pipeline tests: acts while
settlednever resolves once the guard says ok; keeps looking and acts when a late target lands, without a Jev request per unchanged snapshot; waits for settle while the guard reports moving / covered or another node; pre-act guard holds a covered click until it clears and clicks anyway past the cap; the settle-overlap ordering test from #2993. Full extension/protocol/sdk-ts/root suites, typecheck, lint, fmt,extensionpack --checkpass locally; CI green.