Repository navigation
Conversation
…e selector engine's world (cua 0.31.5) After a locator action fails, cua's client reads the matches for its "Locator diagnostics" line with an evaluateAll marked `diagnostic: true`, held by the service to a hard 1 s (#623). The service ran it on the user-facing route, which hands every match from the engine's world to the page's main world by its own CDP round trips: a DOM.describeNode and a DOM.resolveNode per match, about 507 commands for the parity cell's 251. The vendor's read-only path sends one evaluate. On Chrome for Testing 158 a new hidden tab is in the background band from its first command (#610), so the read ran out its 1 s and the line was left out: parity-browser's locator-contract-diagnostics-sampling failed on cua's lane in 1 of 3 runs on the 158 pin (#608). 157's loading-voter grace had hidden it. The handler now runs the diagnostic through the selector engine's one-call evaluateOnSelectorAll. The bound, the absence of a late answer and #623's arithmetic are unchanged. The engine's world may run it because cua's own client sends this script and it reads only DOM properties. User-facing evaluate and evaluateAll keep the main world, as the owner ruled. Tests (test/browser-service/locator-diagnostic.test.mjs, cua's real client through the service's command wrapper): - 251 matches: the diagnostic sends no per-match describeNode or resolveNode, and its line deep-equals what the cell expects. - User-facing evaluateAll still resolves every match into the main world and dispatches there once. - In a real headless Chrome, on a page that redefines tagName, textContent, disabled, getAttribute and getClientRects, the diagnostic reads the DOM's own values and calls none of the page's getters, while evaluateAll reads the page's. The real-Chrome helper's bounds now clear their timers, so a test file no longer stays open for 20 s after its last test. The per-match cost of user-facing evaluateAll is logged in tech-debt-tracker.md. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…s it in the page; a caller's script keeps the main world Review of 670968d (ruling: fix all three). P1: a caller could route its own script into the engine's world. Public locator.evaluateAll forwarded a caller's `diagnostic` option, and the handler ran any flagged script there, polled (a throwing script ran four times). Now: - The service holds the read (evaluate.mjs locatorDiagnostic) and never runs a request's script in the engine's world. - The diagnostic is asked for only as `diagnostic: true` with an empty script, which no caller's evaluateAll sends (isLocatorDiagnostic, also what index.mjs bounds hard). - A flagged request that carries a script of its own is an ordinary evaluate in the main world, run once. - cua's client asks through a private #locatorDiagnostic, and evaluateAll no longer forwards the option. - The parity cell's expected line is unchanged. P2: the read's result crossed CDP unbounded (role, type and aria-label in full). It now cuts every string to 120 characters in the page; boundResult stays as a backstop. P3: the real-Chrome helper's cleanup waited forever for a Chrome killed by a signal (exitCode null, signalCode set, 'exit' already fired). The new waitForExit checks both fields, SIGKILLs after 5 s and gives up after 10 s. Tests, each red first: - locator-diagnostic.test.mjs: a caller's flagged evaluateAll, and a raw flagged command with its own script, run in the main world once; a 300,000-character attribute crosses CDP cut to 120. - real-chrome-support.test.mjs: waitForExit returns for a signal-killed child and is bounded for one that never exits. The client's diagnostics scenario now names its vendor difference (vendorDiffers), which #623's flag already made. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…ends and the service recognises (parity's contract kept) 1d2fc3a asked for the diagnostic with an empty script. Parity's locator-boundary-action-diagnostics contract attests that the diagnostic command carries nonempty code (scriptPresent), so cua's lane failed api/browser-playwrightapi/elementinfo (run 46405042320). The read now lives in src/cua-api/locator-diagnostic.mjs, shared by the client and the service: - locatorDiagnostic: the in-page read, every string cut to 120. - LOCATOR_DIAGNOSTIC_SCRIPT: its script as evaluateAll would send it. The client sends that script marked `diagnostic: true`. The service recognises exactly that request (isLocatorDiagnostic) and runs the locatorDiagnostic it imports, in the engine's world. A flagged request whose script is any other runs in the main world, once. Run as an ordinary evaluate, the shared script gives the same answer. Tests: - locator-contracts.test.mjs: cua's own diagnostic request (the shared script, marked) is the observation the contract expects. - The bounds test and the client scenario send and expect the shared script. - The P1, P2 and P3 tests of 1d2fc3a are unchanged and pass. Gate parity-browser now also watches src/cua-api/locator-diagnostic.mjs. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…ic (it loads only from its trusted paths) dc6a29a had the browser service import src/cua-api/locator-diagnostic.mjs. The service loads only from the launch's trusted code paths, which src/cua-api is not, so: - node_repl refused the import ("Trusted RPC dependency must resolve within a configured trusted code path"), and services-sky-trust.test.mjs failed on test-2; - repl-parity prepare failed in parity-browser and sandbox-denials (run 46409683424). The service now holds its own copy of the read and its script, in evaluate.mjs. The client keeps src/cua-api/locator-diagnostic.mjs, which the kernel reads. A new test holds the two scripts equal, so the client sends exactly the script the service recognises. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
SSFSKIM
enabled auto-merge (squash)
November 30, 2026 13:00
SSFSKIM
added a commit
that referenced
this pull request
Nov 30, 2026
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
This was referenced Nov 30, 2026
SSFSKIM
added a commit
that referenced
this pull request
Nov 30, 2026
…he windows they mean, not after a sleep (test-only) (#640) * linux-engine 0.4.9 (#638): a paste's refused window ends no earlier than the server's time at its cleanup The cleanup estimates the server's time as the ownership timestamp plus the engine's elapsed time since an anchor taken before that timestamp was read, plus 1 ms. That holds only if the server's clock never runs ahead of the engine's over the interval. The X server reads CLOCK_MONOTONIC_COARSE (GetTimeInMillis, os/utils.c, when its resolution is 1 ms or finer), which stands still between ticks: when it lags at the ownership read and has caught up by the cleanup, it has run further than the engine's CLOCK_MONOTONIC by that lag. 1 ms covers one tick on time; a late tick (1.3 ms measured on this KVM guest under stress-ng) left the window's last millisecond unrefused, so a conversion stamped then was served the restored snapshot. That is a_pause_before_taking_clipboard_does_not_shorten_the_refused_window's failure on PR #637's run 46423943167 (1 in 300 runs here under load). The estimate moves into serving::cleaned_at and adds SERVER_CLOCK_LAG (10 ms): a tick of 1 ms delivered up to 9 ms late. The window refuses 10 ms more after the cleanup, far less than any next paste's distance. The new unit test sweeps the anchor, the read's delay, the lag and the hold across the clock's wrap; it failed on the old estimate at a lag of 1.3 ms. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #638: the clipboard tests stamp their requests after the windows they mean, not after a sleep Two live tests read a server timestamp right after a take or a cleanup and assumed it fell on the far side of a millisecond boundary: - an_unconfirmed_paste_s_current_time_refusal_covers_the_next_paste_too read the next paste's Ctrl+V time right after the first paste's cleanup, inside the first paste's window, whose end is estimated late on purpose; the Ctrl+V's conversion was refused (PR #637's run 46423943167, attempt 3; 25 of 47 suite runs here under stress-ng). - a_late_conversion_never_receives_the_restored_snapshot_as_the_paste took ctrl_v - 1 as a time "from ownership on", which it is not when the take and the Ctrl+V share a millisecond, and waited 50 ms for a request stamped after the window (10 of 47). They now wait for the server's clock to pass the time they mean (server_time_after): the first paste's cleanup estimate, read from the owner's last closed refusal (Clipboard::last_closed, tests only), or the ownership timestamp, which the late-conversion test now reads itself through take_from. What each asserts is unchanged. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #638: the clipboard suite's two remaining wall-clock ceilings become exact checks - a_silent_owner_ends_the_snapshot_at_its_bound_and_the_locks_are_released checked that both locks were free again by timing a 100 ms lock wait under 50 ms; it now takes them with no wait at all (lock_within(ZERO): one try each), which passes only when they are free at once. - only_an_unconfirmed_paste_that_was_sent_opens_the_current_time_refusal held the refusal's remaining time under 10.1 s, which the take's scheduling delay under load can pass; the ceiling is now what the code guarantees, the refusal past the cleanup's estimate, read from the closed paste's window. The engine's own bounds (500 ms for TARGETS, 2 s per INCR chunk, the lock's wait, the 10 s refusal's floor) stay checked against the wall clock with their existing slack: they are what those tests measure. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #638: drop the 10 ms allowance (back to linux-engine 0.4.8); the branch is test-only Reverts da1d383. Review (ruling 1365) found that padding the cleanup's estimate is the wrong fix for the race it named. A coarse clock that lags by more than the padding still ends the window early. The padding refuses genuine conversions made just after a cleanup. And it can push the display's quarantine record past the 11 s that peer engines accept. The right fix bounds the window with a timestamp the server issues at the cleanup, and it needs its own release, tracked by a follow-up ticket. a_pause_before_taking_clipboard_does_not_shorten_the_refused_window stays as it is: it is that race's evidence. What remains of the branch is in the tests. The tests wait on the endpoint the code computes now, Closed::cleaned_at, which they read through the test-only last_closed accessors. Production code matches main. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM
added a commit
that referenced
this pull request
Dec 1, 2026
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM
added a commit
that referenced
this pull request
Dec 1, 2026
…uling 1351) Conflicts: plugin.json and marketplace.json keep 626's 0.31.6; tech-debt-tracker.md keeps both new entries. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM
added a commit
that referenced
this pull request
Dec 1, 2026
… cua's own (normal size, placed by Chrome; extension 0.4.0; cua 0.31.6) (#645) * #626: on macOS the tabs a session creates open in a Chrome window of cua's own (ruling 1314); extension 0.4.0 adds tabs.activate The host opens the window unfocused at the session's first created tab, which replaces its New Tab page; the created tab in it that last took attach or executeCdp is made its active tab (tabs.activate, once per change). It closes with its last tab unless it is the profile's last window; a tab of the person's keeps it open. Linux, an extension before 0.4.0 and a MAWS peer keep today's placement. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626: plugin 0.31.3; README links the Chrome Web Store listing; the own-extension design records tabs.activate and the window of cua's own; a claimed tab in cua's window is never activated (test) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 evidence: the hosted macOS probe of cua's own window (probe.mjs, hosted-macos.sh, the window tools, #610's pin) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 README: on macOS each session's tabs open in a window of its own, closed with its last tab; the New Tab page rule and 'never opens a window' say so Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 evidence: the probe raises the person's window over cua's for the strip, reads floating windows (the cover), keeps cua's window minimized before the close, and checks whether cua's window opens behind the one in front Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626: plugin 0.31.5 (placeholder; #623 takes 0.31.4) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 evidence: the strip is another application's window over all but cua's window's last 60 points (Target.activateTarget does not reorder Chrome's windows on the hosted runner) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 evidence: three hosted macOS runs (46335722684, 46338754848, 46344543495): their rows, the probe's lines, and the README's tables Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 tests: extension-host's placement tests pin an extension before 0.4.0 (the real host is the machine's, and test-2 runs on a Mac); a macOS-only test drives cua's own window through the real host and extension ci-gate run 46362733420 failed test-2 on these three: on the hosted Mac the spawned host saw the checkout's extension at 0.4.0 and opened a window of its own. Checked here with the host forced to darwin: 14/14. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 fix wave 1: the review's two P1 and six P2, each with the interleaving that showed it P1 placeholder removal: windows.create {url} opens cua's window on the session's first tab and answers its id (extension), so no New Tab page is made, read or removed, and no tab is judged cua's by a later look at the window. P1 activation: tabs.activate selects by window and index (chrome.tabs.highlight) and answers whether the tab is active after it; a drag landing between the read and the selection can only select another tab of cua's window (Chromium 158 tabs_api.cc, TabListBridge::HighlightTabs: no window activation). P2 close exemption: given up when the session's client goes, after its closes. P2 reuse vs teardown: the reuse runs where the window checks run (windowsExclusive); a tab that still lands in a window just handed to the person is closed (cua's own) and made again in a fresh window of cua's; a window that closed meanwhile gets a fresh one. P2 stale cache: Chrome's tabs.onActivated is relayed (tabs.activated); only Chrome's answer or that event marks a tab active; an activation in flight is joined. P2 unbounded first activation: none any more (a window's only tab is its active one). P2 failed first create: one primitive makes the window and its tab, nothing to undo. P2 MAWS dispatch: a request with nothing to activate is dispatched synchronously, as on main (needsDrive). Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 fix wave 1: the design's protocol table and Decision Log name windows.create {url} and the confined tabs.activate Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 evidence: the fix wave's code on the hosted Mac (46391323237: 30/31, the front-ordering check only) and where cua's window lands while another app is frontmost (46388949499: over that app's window, unfocused); front.mjs and mac-app.swift Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 WIP (not for 626): fix wave 2's red tests (handover, exemption after disconnect, reply vs newer selection, selection before creation answers, no-replacement fallback) and the pinned P1-1 limit test; fixes not built (ruling 1338 hold) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 fix wave 2 and the corner panel (rulings 1339, 1340) Race fixes: - a window being handed to the person is given up before its protective New Tab page is asked for: no reuse of it, no activation in it while that request is on its way; - a window whose creation answers after the session's client left is given up after its own tab closes; - Chrome's tabs.activated reports are counted per window, and an activation's reply is believed only if no report came after its request; a new window's active tab is unknown until Chrome says, never assumed; - the replace-in-a-fresh-window path is gone: a tab that lands in a window just handed to the person stays there, the session's, inactive and never activated; - only the session's current window is cua's (an old one is retired). The P1-1 limit (a tab the person placed in cua's window can inherit the dragged tab's index) is pinned by a test and named in the extension. The panel: windows.create {left, top, width, height}: 500x375, half off the primary display at its top edge, on the side away from the Dock (chrome.system.display's work area: the new system.display permission, which carries no install warning), or the other side when a display adjoins; placed once, never moved back. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626: the window of cua's own opens where and at the size Chrome places it; the corner panel withdrawn (ruling 1345) The panel's half-off-screen bounds are not achievable (Chrome keeps the window it creates on screen), its 500x375 size broke parity-browser's drag cells, and asked bounds did not decide the stacking order (hosted runs 46399440730, 46402846688, 46410016977). windows.create goes back to {focused: false, url, group, guard}; displays.query and the system.display permission go. The race fixes of ruling 1339 stay. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626: the real-Mac look's result in the evidence, README and design (ruling 1349) On the owner's MacBook, a window opened unfocused and with no bounds by a Chrome that was not the front application opened behind all of the person's windows, at normal size, and the screenshots agree with the window list. Chrome reported it visible though fully covered; its speed was not measured there. With the person's own Chrome as the front app, where the window opens is unmeasured. The README's own-window lines say so, and a leftover "panel" from the withdrawn corner panel becomes "window". Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626: plugin 0.31.6 (ruling 1351: #637 takes 0.31.5) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626 fix wave 3: a handback stops an activation already on its way; the report count only grows P1: removing the window from cua's stopped new activations but not one the extension was already running. Its tabs.highlight could land after the session left and change the person's selection in the window now theirs. The host now sends windows.release before a handback completes (the session leaving, a late create after it, and before the protective New Tab page) and waits for the answer at most ACTIVATE_WAIT_MS. The extension records the release, and tabs.activate checks it in the same step that selects, with no await between. So a highlight was either issued while the window was cua's, or it is declined. An unanswered release hands back after the bound and is logged. P2: a window's report sequence restarted at 1 on every tabs.activated (read after the entry's delete), so with a populated cache a late reply was believed over a newer selection. It is now a count over all reports. Extension 0.4.0 gains windows.release (unreleased, so no bump). Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * Tech debt: #626's final-check P2 (release wait against the keep-open deadline) and P3 (the released set never shrinks), shipped under ruling 1350 Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #626: the release no longer spends the keep-open deadline when cua's window is the profile's last (final check P2, ruling 1354) checkWindow awaited windows.release (up to 1 s) before asking for the protective New Tab page, all inside keepWindow's 2 s bound. A slow tab query plus a slow release reply let the last tab close first, and the window and profile went with it. The release is now sent first and the New Tab page asked for right after it, without waiting for the reply. The extension handles messages in order, so the release is still recorded first, and checkWindow still waits for the release, bounded, before it returns. The tracker drops the P2; the P3 stays logged. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM
added a commit
that referenced
this pull request
Dec 1, 2026
…#608, #610) CI-opt kept the hosted gates' pin at 157.0.8103.78. The pin file is back to main's; the 158.0.8127.88 move this branch tried is gone. hosted.sh now says beside the pin why it stays: - 157's new-tab grace is Chrome for Testing's field-trial testing config (the loading voter), which a branded Chrome lacks. - On 158 the vendor host's lane, whose waits cua cannot change, stalls on backgrounded tabs. With cua's lane fixed (#623, #637), waitforurl's url cell still ran out its own 2.5 s, at 2533 ms, in 1 of 4 runs (ci-gate 46583607499). - So the pin protects the gate, not people. - It is to be revisited when the vendor's pinned runtime changes or when Chromium answers the request to keep a debugged tab's priority. ci-kit.yml's parity-browser comment says the same in brief. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM
added a commit
that referenced
this pull request
Dec 1, 2026
…n beside it (Chrome 158 stalls the vendor lane's own waits) (#647) * parity-browser: move the harness Chrome for Testing pin to 158.0.8127.88 (#608, #610) The hosted gates' Chrome for Testing pin moves from 157.0.8103.78 to the current Stable, 158.0.8127.88 (revision 1727472), the archive #610's hosted runs placed (size 200337306, SHA-256 6caf16b0...). #623 sized cua's own browser-service limits for 158's stall; the vendor host keeps its own. hosted.sh now says beside the pin what the 157 grace was: Chromium's loading voter, which a Chrome for Testing has on through the field-trial testing config and a branded Chrome has only by field trial. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * parity-browser: the Chrome for Testing pin stays at 157, and says why (#608, #610) CI-opt kept the hosted gates' pin at 157.0.8103.78. The pin file is back to main's; the 158.0.8127.88 move this branch tried is gone. hosted.sh now says beside the pin why it stays: - 157's new-tab grace is Chrome for Testing's field-trial testing config (the loading voter), which a branded Chrome lacks. - On 158 the vendor host's lane, whose waits cua cannot change, stalls on backgrounded tabs. With cua's lane fixed (#623, #637), waitforurl's url cell still ran out its own 2.5 s, at 2533 ms, in 1 of 4 runs (ci-gate 46583607499). - So the pin protects the gate, not people. - It is to be revisited when the vendor's pinned runtime changes or when Chromium answers the request to keep a debugged tab's priority. ci-kit.yml's parity-browser comment says the same in brief. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
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.
Refs #623
Refs #608
What changes for a user: when a locator action fails, the error's "Locator diagnostics" line (how many elements matched, how many were visible, the first five) now arrives on a busy Mac's hidden tab too. Until now it could be dropped there, leaving only the bare failure.
The cause, in numbers
After a locator action fails, cua's client reads the matches for that line with an
evaluateAllmarkeddiagnostic: true. Since #623 the service holds that read to a hard 1 s. The service ran it on the user-facing route. That route hands every match from the selector engine's world to the page's main world by its own CDP round trips: oneDOM.describeNodeand oneDOM.resolveNodeper match. For the parity cell's 251 matches that is about 507 commands inside the bound (measured on the test's fake Chrome: 509 in all, 252DOM.describeNodeand 252DOM.resolveNodeamong them, plus 2 releases after it). The vendor's read-only path (prepareReadonlyLocatorAllin the pinned runtime) sends 1 to 3: one evaluate that queries and reads in the page.On Chrome for Testing 158 a new hidden tab is in the background band from its first command, where commands are answered at about 0.12 s median (#610). So the 507 commands ran past the 1 s, and the client left the line out. That is what failed
locator-contract-diagnostics-samplingon cua's lane in 1 of 3 parity-browser runs on the 158 pin (#608, run 46391333831), while the vendor's lane held 3 of 3. On 157, Chrome for Testing's loading-voter grace kept a new tab at normal priority for its first seconds, and that hid the cost.The change
The locator diagnostic is one in-page read (
locatorDiagnostic) and its script as an evaluateAll would send it (LOCATOR_DIAGNOSTIC_SCRIPT). The client holds them insrc/cua-api/locator-diagnostic.mjs. The service keeps its own copy inevaluate.mjs, because it loads only from its trusted paths, whichsrc/cua-apiis not; a test holds the two scripts equal. The client'sactionErrorsends that script markeddiagnostic: true, through a private method. The service recognises exactly that request (isLocatorDiagnostic, which also decides whatindex.mjsbounds hard). It then runs its ownlocatorDiagnosticthrough the selector engine's existing one-callevaluateOnSelectorAll: oneRuntime.evaluatein the engine's world, as the service's count and allTextContents already do.The read cuts every string to 120 characters in the page, so a page's huge attribute doesn't cross CDP. The service-side result bound stays as a backstop. The diagnostic's hard 1 s, its lack of a late answer and #623's arithmetic stay as they are. Parity's contract for the diagnostic command still holds: the command carries nonempty code, and its fields other than cua's marker are the vendor's.
No caller can get its own script into the engine's world:
evaluateAllno longer forwards adiagnosticoption;diagnostic: truewhose script is anything but the shared one is an ordinary evaluate, run once in the main world.The main-world ruling is untouched. The owner's ruling that a caller's script runs in the page's main world covers user-facing evaluate.
evaluateandevaluateAllcalled from the REPL still run in the main world, by the same route as before, whatever options or flags they carry. The diagnostic is not a caller's script: cua holds its code, and the service runs only that code, which reads only DOM properties (tag name, a few attributes, text, client rects, disabled). In the engine's world those read the same, and they read past any getter or override the page defined. So a read-only diagnostic in the engine's world doesn't touch that ruling.Tests
test/browser-service/locator-diagnostic.test.mjsdrives cua's real client through the service's own command wrapper:DOM.describeNodeorDOM.resolveNode, and at most 3 commands in all (1Runtime.evaluateon a tab already attached). Its line deep-equals what the parity cell expects:multiple_matches, 251 matched, 251 visible, the five samples, truncated. Before the change it sent 504 per-match commands.DOM.resolveNode) and dispatches the script there once.evaluateAllpassed{diagnostic: true}, and a raw command flaggeddiagnostic: truewith a script of its own, both run that script in the main world, once. A throwing script throws once. Before the fix wave, the flagged script ran in the engine's world, and a throwing one ran 4 times as the selector polled (the review's probe).aria-label,roleandtypecomes back with each cut to 120, and every CDP answer of the read stays under 10,000 bytes. Before the fix wave the attribute crossed in full and was cut only after transport.tagName,textContent,disabled,getAttributeandgetClientRectsto count every call. The diagnostic reads the DOM's own values and the page's counter stays at 0. The same script through user-facingevaluateAllreads the page's redefinitions, so that route is still the main world. Before the change the diagnostic read the page's values ("tag":"trap", nothing visible).The real-Chrome test helper's bounds now clear their timers, so a test file no longer stays open up to 20 s after its last test. Its cleanup no longer waits forever for a Chrome killed by a signal:
waitForExitreads both the exit code and the signal, and is bounded (test/browser-service/real-chrome-support.test.mjs).test/repl-parity/locator-contracts.test.mjsadds a check that cua's own diagnostic request (the shared script, marked) is the observation parity's contract expects. A first version of this fix wave asked for the diagnostic with an empty script, and the contract rejected it on hosted parity-browser (run 46405042320). A second had the service import the client's module, which node_repl refuses outside the service's trusted paths (run 46409683424). Gateparity-browsernow also watchessrc/cua-api/locator-diagnostic.mjs.The client's diagnostics scenario now names its difference from the vendor's client (
vendorDiffers). #623's flag had already made one, which the vendor comparison catches when it runs against the vendor's client.Also:
tech-debt-tracker.mdgets the related debt. User-facinglocator.evaluateAllstill makes two round trips per match, so on a starved tab with many matches it is slow. Fixing that has to keep the main world.Plugin 0.31.4 → 0.31.5. #626 also holds 0.31.5; whichever merges first keeps it, and the other moves to 0.31.6.
After this merges, #608's pin lift (branch
608-lift) merges main and reruns its three parity-browser runs on top.Validation Evidence
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)