Repository navigation
#244: a fresh Electron app's first observation holds its page (write-once enablement + the app role read) - #247
Merged
Conversation
… app's role before enabling A. Once the engine has set and owns a process's enablement attribute, later observations neither read nor write it until the release writes it back (or the process ends). Electron's getter is computed and always reads false, so the per-observation re-read wrote at every observation, restarting Electron's 2 s countdown to complete mode and firing accessibility-support-changed each time. The first step, the 2026-10-22 re-enable after a write-back, and the release are unchanged; a true or unreadable value is still not owned and is re-read (an unreadable one still written) at every observation. An owned observation reports enablementPrior "owned". B. On eligible apps, every observation first reads the application element's AXRole, AXSubrole and AXRoleDescription in one request (never cached), which gives Chromium/Electron Basic mode and the page's tree at once, as the vendor's eager ApplicationUIElement.init does. The step is WebAccessibility .observeEnablement on the EnablementAccess seam (readRole), timed as appRoleRead; the service passes appRoleReadMs through cua/observation so the live run can report its warm cost. Sminos-Session: cursor235#b93055dd (cua on macbook)
…d; F §1.3 corrected Two dated entries (2026-11-01): the write-once rule, reversing A3's withdrawal of the once-per-process memory, and the role read with its declared difference (Basic mode lasts the app's lifetime, including in the person's own Chrome). The Observation paragraph, A3 and M2a.4's enablement item are amended to match, and F §1.3 now records FUN_1007542cc as the eager construction-time fetch outside a transaction, not only the prefetch fallback. Sminos-Session: cursor235#b93055dd (cua on macbook)
…s since the settles The review of 5986286 (P2): with write-once enablement, connection A's enablement step finds the attribute owned by connection B, which enabled the process and saw its web area after A's settle, so A was not enabledNow, skipped the wait, and adopted a settled tree read before the page existed. The per-observation write had hidden this. WebAccessibility now counts the engine's writes of each process's attribute (true or false, any connection, kept past the entry's retirement), and getAppState reads the count before its settles and after its enablement step; adoptsSettledTree takes the two counts in place of enabledNow and adopts only when they match. Interleaved regression test and the rule's unit test added; the Decision Log entry records the rule. Sminos-Session: cursor235#b93055dd (cua on macbook)
`up electron --electron-arg <switch>` (repeatable) launches the fixture with those Chromium switches after its own and keeps them in the scene's record as `extraArgs`; a non-switch argument, or the flag on another scene, is refused before anything launches. The live check's sonoma variant uses it to turn on SonomaAccessibilityActivationRefinements. Sminos-Session: cursor235#b93055dd (cua on macbook)
…servation) Per variant (plain; sonoma, the fixture launched with SonomaAccessibilityActivationRefinements on), on cua's or the vendor's engine: the Electron fixture relaunched fresh (#200's fixture-relaunch, now taking the variant's switch, which `ps` must show on the new process), a session opened with the fixture as its scene but not bound (binding observes twice), its first cell the session's first engine observation (one cua.computer.get_app_state, its text inspected in the cell: the button by index, line and character counts, the page), five warm observations, a hold for complete mode, the close, and the fixture's accessibility record read past the release. The judge slices the record to this launch and counts write events before the open, in the session and after the close. Pass, for cua on plain: the button in the first observation, one write, complete mode on before the close, off within 2.5 s of it; sonoma and the vendor are recorded. Replies now keep cua/observation, and openDriven takes bind: false. Runbook: "Item 244". Sminos-Session: cursor235#b93055dd (cua on macbook)
…e record's final mode Two false-pass paths (review of c786dc9..603e490): - The warm observations were not judged, so five failed ones still passed and write-once went unexercised. Now every warm observation must have answered, and on cua's engine carried appRoleReadMs, or the run is INCOMPLETE; each one's enablementPrior is reported in order. - The off check took the first false poll after the close even when a later poll turned complete mode on again. Now a poll on after the off, or more than one write after the close (the release's own), fails the verdict, named; the live release poll waits for the record's latest mode to be off (offSince). Sminos-Session: cursor235#b93055dd (cua on macbook)
The live slot's plain cua run judged FAIL on "complete mode did not go off" although it had: the release's write cleared complete mode at once, so its own event line says enabled false, and the fixture's poll, which writes only a change from the last line, never wrote a poll line after it. The mode at any time is now the enabled of the record's latest line of any source: complete mode on, the off after the close (a line turning on to off) and its time, the mode the record ends in, the re-enable rule and the live hold and release polls all read it so. Writes are still event lines. Tests: the live record passes; an off by a poll line after an event still works; a true line of either source after the off fails, also as the last line past 2.5 s. The report says appRoleReadMs was recorded under ordinary load (no timing bar) and cites #246 for the fallback sonoma's row informs. Sminos-Session: cursor235#b93055dd (cua on macbook)
…nd vendor recorded The first observation of a fresh Electron fixture holds the page; one enablement write per session, released on close. The sonoma row (role read gives native APIs only) is #246's evidence. appRoleReadMs recorded under ordinary load. Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
Codex Review SummaryThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Nov 1, 2026
SSFSKIM
added a commit
that referenced
this pull request
Nov 1, 2026
Brings main's #235 (cua's own macOS agent cursor, #240), #236's fix (#241), #200 (#243) and #244 (#247) under M3, so M3's gate judges the tree that ships. A merge, not a rebase: the spec and the evidence cite this branch's commit SHAs. The overlapping files and how each was resolved: - src/runtime/launch.mjs (conflict): both sides kept. M3's Linux branch (cua's own service: CUA_SKY_SERVICE, CUA_ENGINE_BIN and CUA_DESKTOP_MODE for the cua selection, the vendor service and helper otherwise) beside #240's macOS branch, which adds the agent cursor's environment (cursorEnv) to cua's engine. The env header comment merged cleanly with both sides' entries. - src/runtime/doctor-engine.mjs (auto-merged): #240's macOS row (the cursor switch in factsReport, cursorWords, settingsOf's cursor check) and M3's Linux row (service cua, capabilities, the IsEnabled row) touch separate functions; kept as merged. - src/cua-api/sky.mjs and test/cua-api/sky.test.mjs (auto-merged): #241's fix for #236 (setupError exported, then/toJSON/symbols read undefined after a failed setup, the declared vendor difference and its settle test) beside M3.2's truncated-field scenario. Compatible by design: cua's Linux service's setup always resolves with the 20 methods and keeps a failure for each method to refuse with, so the facade's setupError stays unset there; a setup that does throw now fails the bootstrap with its own error instead of hanging. - tech-debt-tracker.md (conflict): every row from both sides kept, main's five newer rows first (74 at the base, +2 M3, +6 main = 82). - .claude-plugin/plugin.json, marketplace.json (conflict): main's 0.20.3 here; M3's own bump follows in its own commit. Focused suites (services, facade, doctor, selection, harness, accept, cursor) on the merged tree: 1948 pass, 8 fail; the same 8 fail on both parents in this VM (umask 077 modes, macOS-only and env tests). 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.
Summary
On cua's own macOS engine, the first observation of a freshly launched Electron app was missing the page: the window and its frame came back, the web content did not. The vendor's first observation had it. This PR makes cua's first observation contain the page, as the vendor's does. It also stops an accessibility event that cua fired inside Electron apps on every observation.
Cause. The cause analysis is in the Decision Log entries; the details:
AXManualAccessibilityschedules complete accessibility mode 2 s later, and every further set restarts the countdown (enableScreenReaderCompleteModeAfterDelay:in Electron 44.9.0'selectron_application.mm). The getter readsmode == kAXModeComplete, which stays false even after complete mode lands, because complete mode is created withkFromPlatform | kScreenReaderadded.-accessibilityRoleon NSApp turns on Basic mode (native APIs + web contents), and that alone exposes the page.ApplicationUIElement.init(pid:)fetches the role eagerly. And it writes the attribute once, under a refcounted per-(app, kind) assertion.Fix (
native/engine/Sources/Engine/Enablement.swift,Skyshot.swift,Settle.swift):AXUIElementCopyMultipleAttributeValuescall on the application element for AXRole, AXSubrole and AXRoleDescription, before the enablement step. It is never cached. It is timed asappRoleRead, which rides incua/observationasappRoleReadMs.enablementPriornow readsownedon an observation that touched nothing.Plugin 0.20.3 (its own commit, d7a99ed).
Measured (live, MacBook, 2026-11-01;
docs/evidence/2026-10-30-macos-agent-cursor/item-244/)Build ed8521553753 on a freshly launched Electron fixture, with the session binding nothing, so the first cell makes the first engine observation:
owned, with no read and no write.enabled: false. The judge was fixed and reviewed (139169a), and the verdict was recomputed offline from the recorded rows.Limits
SonomaAccessibilityActivationRefinementson. There the role read gives only native APIs, and the first observation misses the page (the sonoma row). The feature is off by default in Chromium, it isn't in the public field-trial config, and Electron apps get no field trials. A longer first-observation wait that would cover it is not built; it is macOS engine: a fresh Chromium/Electron app's first observation misses the page when SonomaAccessibilityActivationRefinements is on #246.Tests
ObservationRulesTests(enablement: N observations give 1 write; a release writes false once; a released process is enabled again; a true read is never owned; an unreadable value is written every time; the role read comes before the write and runs on every observation; none on an ineligible app; an interleaved second-connection enablement rejects the settled tree; the enablement count moves with every write).WalkTestscovers the adoption rule. Engine suite 648/648.appRoleReadMsin the observation diagnostics (test/services-engine-service.test.mjs).scripts/cursor-sitting/first-observation.mjsandscripts/repl-parity/scenes-mac.mjs's--electron-arg, with 206 kit tests and 94 scenes/spike tests. Runbook section "Item 244".ci-gateon d7a99ed: plugin, engine-swift, sandbox-live and test PASS (run 41285392239). parity-browser went red there on the known racywaitforcell alone (parity-browser hosted gate: fix the two racy parity cells (waitfor deadline race, drag ended wait), then run it on PRs #168) and passed on its re-run (run 41286183578, GREEN). The PR's own checks are green (run 41285432843).Docs
FUN_1007542ccis also the eager fetch at construction.Closes #244
Sminos-Session: cursor235#b93055dd (cua on macbook)