Repository navigation
Commit bb31ad1
fix(mcp): draft a test line for every step a desktop session takes (ENG-1533) (e2e-inc#2355)
* fix(desktop): let a scroll area scroll itself only with a scroll bar for the axis
SwiftUI gives every scroll area the AXScroll*ByPage actions, also one whose
content fits or that scrolls only along the other axis. `scroll` counted
the page action for the direction as "scrolls itself", so a swipe down on
a horizontal carousel inside a vertical page sent AXScrollDownByPage to
the carousel, moved nothing, and answered success.
`scrolls_itself` now uses the rule the snapshot offers `Scroll` with: a
scroll bar for the axis, or, for any role but a scroll area, the page
action. A scroll area without that bar hands the swipe to the scroll area
above it, and with none is refused as "nothing here scrolls".
Review: michal-e2e on e2e-inc#2322 at e7a74d4 (must fix).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): read focus before a key as a stall, and check frontmost last
The focus reads before a key went through `Element::element()`, which
drops a stall: an app slow to answer AXFocusedUIElement or
AXFocusedWindow got "the field lost keyboard focus", a refusal the engine
does not retry, where every other stalled read is a retryable
APP_UNRESPONSIVE. `element_attribute` keeps the stall, and `type`,
`press`, and `key_window` read focus through it. Past the first typed
key, an unanswered read still only shortens the wait for the next key.
A headed `type` also re-read the field's focus after its AXFrontmost
check for the first key. That read waits on the app, and another app
that came forward meanwhile would take the key. The frontmost check is
now the last read before the first physical key, as it is for `press`.
Review: michal-e2e on e2e-inc#2322 at e7a74d4 (optional).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): refuse scrollTo on a gone element as a stale ref
`read_frame` and the parent reads in `placement` read AX_INVALID_ELEMENT
as no frame and no parent, so a gone element was `Placement::Shown` and
`scrollTo` answered success before any scroll. Before the reveal rewrite,
AXScrollToVisible refused a gone element as stale.
`read_frame` and `placement` now pass AX_INVALID_ELEMENT up as they pass
a stall, and `reveal` maps it to the retryable STALE_REF. `frame()` still
reads any failure as no frame.
Review: michal-e2e on e2e-inc#2322 at e7a74d4 (optional).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): do not confirm a secure fill by a field that went away
A secure fill checks AXNumberOfCharacters after the write. A field that a
change handler replaced answers AX_INVALID_ELEMENT there, which read as
"counts none", so the fill succeeded unchecked. `secure_count` now treats
a gone field like a stall: no proof the field counts none, so the fill
ends unconfirmed unless the count shows the whole text, as a plain
field's fill does.
Review: michal-e2e on e2e-inc#2322 at e7a74d4 (optional).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): retry a stepper whose value read stalls
A fill on a stepper whose AXValue cannot be written reads the value to
see that it shows a number. A read the app did not answer in time fell
through to "the value of this stepper cannot be set", a non-retryable
ACTION_NOT_SUPPORTED. It is now the retryable APP_UNRESPONSIVE (and a
gone element a stale ref), as every other stalled read is.
Review: michal-e2e on e2e-inc#2322 at e7a74d4 (follow-up).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): name no value in a stepper's failure messages
The stepper's failures printed the fill text and the parsed target, and
the engine copies the driver's message into the step's error. The secret
ledger matches a secret in every spelling a serializer gives it, but not
re-parsed as a number, so a secret `0042` filled into a stepper would
print as `42`. The five messages (out of range, stopped short, wraps,
already showed, steps past) now say "the value" and "where it started"
instead of numbers.
Review: michal-e2e on e2e-inc#2322 at e7a74d4 (for the maintainer).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): name a list row for select as the snapshot names it
`row_texts` stopped at a text child and read only that child's own
label, while the snapshot walks into it and names the row from every
text below. A row holding "Invoice" and an untitled heading over "Paid"
was "Invoice Paid" to a locator but "Invoice" to `select`.
`gather_texts` now walks the way the snapshot gathers a name from
content: every level, a text's children before the text itself, and no
scroll bar's parts. It takes the tree reads as closures, so a unit test
pins the order on a fake tree.
Review: michal-e2e on e2e-inc#2322 at e7a74d4 (optional).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): stop waiting on a row the list replaced as it scrolled it in
After `AXScrollToVisible`, `reveal` polled until the element read as
shown. Since the gone-element fix, `placement` answers a replaced element
with `AX_INVALID_ELEMENT`, which never reads as shown, so a tap, check, or
scrollIntoView on a row the list replaces as it scrolls in waited out the
poll and then failed as "still off screen". It now ends the poll at once
with `STALE_REF`, delivered like any failure after that scroll, as
`after_scroll` counts it.
Found by michal-e2e's review of e2e-inc#2353.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): step a stepper from the number its first read showed
`set_value` mapped a stalled first `AXValue` read to a retryable stall,
then read `AXValue` again for the number to step from, a read that turned
a stall into no number. `step_to` then returned without a step, and the
fill failed unconfirmed as "stopped short of the value" with nothing
pressed. The first read's number is now where stepping starts.
The read is split into `shown_number`, so a unit test feeds it a stall and
a gone element.
Found by michal-e2e's review of e2e-inc#2353.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): read a stall as one in raise, focus, and the window list
The stall fix covered the five focus reads e2e-inc#2322's review named. Four
more places still read a stall as an answer: `raise` read a stalled
`AXFrontmost` or `AXFocusedWindow` as "could not be brought forward";
`focus` read a stalled `AXFocusedUIElement` as no focus; `holds_focus`
read a stalled sheet `AXParent` as another window, so a key for a field
in a sheet got a non-retryable "not the app's key window"; and
`windows::list` listed every window as unfocused. Each now fails with the
retryable `APP_UNRESPONSIVE`, before anything is sent where the read comes
first.
`stalled` is the one mapping they share, and a unit test feeds it
`AX_CANNOT_COMPLETE`.
Found by michal-e2e's review of e2e-inc#2353.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): refuse a swipe with nothing to scroll as not actionable
A node swipe where nothing scrolls along the axis failed with
`ACTION_NOT_SUPPORTED`, which the engine reads as `UNSUPPORTED_CAPABILITY`
and an agent step reports as `POLICY_DENIED`. A window swipe with nothing
to scroll already fails as `NOT_ACTIONABLE`; the node swipe now does too
(`ACTION_FAILED`), with the same "nothing here scrolls" message.
Raised by michal-e2e's review of e2e-inc#2353.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(desktop): check that no stepper failure names a value
The doc comment on `step_to` promises its failures name no value, since a
secret filled into a stepper could come back re-parsed (`0042` as `42`),
where the ledger would not redact it. Only the "steps past" message was
checked. The test now drives every failure `step_to` gives: a wrap, a
step past and back, a step past that cannot go back, a probe that left
the value changed, and one out of time. It asserts no ASCII digit
appears in any of them.
Asked for by michal-e2e's review of e2e-inc#2353.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(desktop): install rustup from a pinned, checksum-verified rustup-init
Both `native` jobs ran `curl https://sh.rustup.rs | sh` when the image had
no rustup, and the release job builds the driver npm ships right after it.
The new `.github/actions/rust-toolchain` composite action downloads
rustup-init 1.29.3 for the runner's architecture from
static.rust-lang.org and checks it against the SHA-256 recorded in the
action before it runs it. It then installs the toolchain
rust-toolchain.toml pins and puts that toolchain's cargo first on PATH,
the step spec's job already had; the release job now runs it too, which
build-native.ts did implicitly through rustup before. rust-toolchain.toml
stays the toolchain pin.
Answers the follow-up from the e2e-inc#2325 review (okwasniewski): the release
job's rustup install was an unpinned curl | sh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(desktop): load the x64 addon under Rosetta before it ships
The x64 driver was built and its architecture read with lipo, but no job
loaded it, so a build that fails to dlopen or to answer would reach Intel
users unnoticed. The new `.github/actions/load-x64-addon` composite action
installs Rosetta when `arch -x86_64` cannot run, downloads the official
darwin-x64 Node of the version setup-node installed, checks the tarball
against that release's SHASUMS256.txt, and has it require the x64 addon
under `arch -x86_64` and call status(). It fails on a Node that is not x64,
a load failure, or a status() without a boolean `accessibility`.
Spec's `native` job runs it after the arm64 load. The release job's
`native` job now loads both builds, the arm64 one natively and the x64 one
this way, before it uploads them. The engine's loader test stays arm64
only: vitest's native dependencies are installed for arm64.
Answers the follow-up from the e2e-inc#2325 review (okwasniewski): the x64 addon
is built but never loaded by any job.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(desktop): pick rustup-init by OS and architecture together
The rustup step chose its binary by `uname -m` alone, so a Linux x86_64
job using the action would download the macOS build, pass the checksum,
and fail with an exec format error. It now matches `Darwin arm64` and
`Darwin x86_64`, and anything else gets the message it already printed:
no pinned rustup-init for that OS and architecture.
Raised by michal-e2e's review of e2e-inc#2354.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(desktop): retry the rustup-init and x64 Node downloads
The native job runs on every pull request and `spec gate` needs it, so a
single 5xx or reset from static.rust-lang.org or nodejs.org failed every
pull request and merge-queue entry until a rerun. Each download now
retries 3 times, as `mcp-publisher` already does.
Raised by michal-e2e's review of e2e-inc#2354.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(mcp): print a test line for every point tool
The point tools (tap_at, hover_at, drag_at, type_at, press_at,
select_at) printed no test line, so test_lines left their steps out of
the draft without saying so: a tab tapped and a field edited at a point
were missing from a desktop draft.
Each point tool now plans its line the way the step resolves its
target, through the step's own hit test on the newest screen. Where the
engine takes the bare point, a tap prints screen.tapAt({ x, y }) in the
viewport's CSS pixels; elsewhere the tool acts on the listed control
under the point by id and prints that control's locator line (tap,
hover, fill, press, selectOption, dragTo). A hover or a drag at bare
points, and a typed key on a point where nothing is listed, print
"No test line:" and why, and the draft keeps the step as a comment. A
point tool called before the first screenshot does nothing and records
nothing.
Answers okwasniewski's e2e mcp pass on e2e-inc#2323 (2026-11-26T17:54).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(mcp): write the line of an earlier screen's id for the node it acted on
An action on a node id from an earlier observation ran, then answered
"No test line: not on the newest screen". The step resolves the id as
an agent step does (feed.resolve): an id the newest observation no
longer lists is found again by what its node read as, when exactly one
node on the newest screen reads the same, and the action runs on that
node. The test line looked the id up on the newest screen only.
Keeping the action is the decision here, not refusing it before it
acts: it is the agent's own resolution, the node it acts on is on the
newest screen, a secret fill still runs the full authorization on that
node, and an engine that numbers every screen afresh (SwiftUI) would
otherwise fail every second call of a batch. The line now keeps the
screens before the newest one, as the step does, and finds the same
node; two nodes that read alike give no line, as the action fails then.
The MCP reference said ids were valid only against the newest
observation; it now says how an earlier id resolves.
Answers okwasniewski's e2e mcp pass on e2e-inc#2323 (2026-11-26T17:54).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(core): let a fixture operation say how a test line writes its call
`e2e mcp`'s test_lines wrote desktop.useWindow({ id: '36086', ... }):
the window id run_code passed, which no window has on the next launch,
so the drafted line never replays.
A fixture operation may now declare testLine (FixtureOperation, in
@e2e-dev/core/engine): for an argument that holds only while the app
runs, the arguments as a test writes them to find the same thing again,
or a note the line carries on why the arguments may not hold. The
fixture recorder keeps it by the recorded method, and run_code's
recorder asks it before it writes a line, with every string in the
arguments through the secret ledger. Core still names no engine: the
desktop engine declares it for useWindow, which now drafts as
desktop.useWindow((await desktop.windows()).find((window) =>
window.title === "Inbox")), the form the testbed's own tests use; an
untitled window or a bare id keeps its arguments with a comment that
the id holds only while the window is open.
Answers okwasniewski's e2e mcp pass on e2e-inc#2323 (2026-11-26T17:54). The
only change in packages/desktop is the useWindow declaration and its
unit test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(mcp): give attached run_code the engine's fixtures
run_code in a session attached to a held test (open_session { attach })
had no engine fixture: `desktop is not defined`, even when the test
names it, while a standalone session's code has it. On macOS 27 the
attached agent then could not pick the real window back with
desktop.useWindow() once a system dialog took the screen.
Core's new createEngineFixtures builds the engine's own fixtures over a
session, each on first touch, as a test's are, recording into the step
recorder and budget it is given. The held test's tools give run_code
those fixtures over the held test's session, beside the app they
already built, with the attachment's own step recorder: the calls stay
out of the test's report, and a --step hold never stops one of them,
which recording into the test's recorder would. What a fixture changes
lives in the engine session, so the test sees it after it resumes.
Answers okwasniewski's e2e mcp pass on e2e-inc#2323 (2026-11-26T18:09).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): draft a useWindow line that fails when no window has the title
The drafted `useWindow` line found the window by title, and on replay
with no window of that title `find` returned `undefined`, which
`useWindow` takes as "go back to the focused window": the test then read
and asserted on another window with no error. The line now ends with
`?? "titled Inbox"`, an id `useWindow` refuses with "the app has no
window titled Inbox". It drafts by title only when the title is a
non-empty string; a window object with none, as plain JavaScript can
pass, keeps the id and its note.
Found by michal-e2e's review of e2e-inc#2355.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(desktop): raise the core and e2e peer floor to the release with testLine
`@e2e-dev/desktop` now declares `FixtureOperation.testLine`, which
`@e2e-dev/core` 0.25.0 does not have; on it the window line is drafted
with the id again, without a word. Both peers now read `>=0.25.1 <1`, as
the web and mobile engines already do.
Found by michal-e2e's review of e2e-inc#2355.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(mcp): keep one set of engine fixtures for an attachment's run_code
`run_code` asks for its attempt on every call, and the held test's
attachment built new engine fixtures each time. State a fixture keeps
did not carry from one call to the next: a web route added in one call
lived on that call's `browser`, so `unroute` in the next removed nothing
and the route was still there when the test resumed. The attachment now
builds the attempt once, on the first call, as a standalone session
keeps its own, and each call enters its own phase of the attachment's
one budget, cancelled with that call.
The new test sets a property on the fixture in one call and reads it in
the next; on the per-call fixtures it reads nothing.
Found by michal-e2e's review of e2e-inc#2355.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(core): carry a node's test id on ExecutorNode
The listing an executor reads shows a node's test id (`testid="..."`),
but `ExecutorNode` had no field for it, so code working from the tree
could not tell apart two controls only their test ids separate.
`projectTree` now copies `testId` onto the node.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(mcp): find an earlier screen's id for its line by the action's own rule
The line for an id only an earlier screen listed re-found the node with
its own `twinsOf`, which compares role, name, text, and placeholder and
ignores the test id, while the action re-finds it with `describeTarget`
and `relocateDescriptor`, which go by role, name, test id, placeholder,
and input purpose. Two "Delete" buttons with different test ids,
renumbered: the tap landed on the right one and the line said "not on
the newest screen". Two nameless rows whose text swapped: the line named
the row the action did not touch. The line now calls the same two
functions on the listed nodes.
Found by michal-e2e's review of e2e-inc#2355.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(mcp): tell the agent an older node id works when one node reads like it
`open_session` still said node ids are valid only for the newest
observation, while the docs and the skill say an older id is found again
when exactly one node on the newest screen reads like its node. Its text
now says the same, and the reference names the fields the action goes
by: role, name, test id, placeholder, and the text of a node with
neither a name nor a test id.
Raised by michal-e2e's review of e2e-inc#2355.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(mcp): replay a drafted check line beside the tap_at lines
The point-tool change replaced the `check` step with a `tap_at` on the
checkbox and left the `check` entry as dead data, so no drafted
`.check()` line was replayed. The checkbox is checked with `check` again,
then tapped twice at its point with `tap_at`, off and on, and every line
replays in the run.
Raised by michal-e2e's review of e2e-inc#2355.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>1 parent 8525d2e commit bb31ad1
26 files changed
Lines changed: 705 additions & 83 deletions
File tree
- .changeset
- docs
- reference
- packages
- core/src
- agent
- engine
- run
- desktop
- src
- tests/unit
- e2e
- src
- mcp
- run/worker
- session-tools
- tests
- integration
- unit
- plugins/e2e/skills/e2e/references
- skills/e2e/references
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2582 | 2582 | | |
2583 | 2583 | | |
2584 | 2584 | | |
| 2585 | + | |
2585 | 2586 | | |
2586 | 2587 | | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
2587 | 2593 | | |
2588 | 2594 | | |
2589 | 2595 | | |
| |||
2600 | 2606 | | |
2601 | 2607 | | |
2602 | 2608 | | |
| 2609 | + | |
| 2610 | + | |
2603 | 2611 | | |
2604 | 2612 | | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
2605 | 2616 | | |
2606 | 2617 | | |
2607 | 2618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
314 | 321 | | |
315 | 322 | | |
316 | 323 | | |
| |||
358 | 365 | | |
359 | 366 | | |
360 | 367 | | |
361 | | - | |
| 368 | + | |
| 369 | + | |
362 | 370 | | |
363 | 371 | | |
364 | 372 | | |
| |||
388 | 396 | | |
389 | 397 | | |
390 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
391 | 402 | | |
392 | 403 | | |
393 | 404 | | |
394 | 405 | | |
395 | 406 | | |
396 | | - | |
397 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
398 | 412 | | |
399 | 413 | | |
400 | 414 | | |
| |||
641 | 655 | | |
642 | 656 | | |
643 | 657 | | |
644 | | - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
645 | 663 | | |
646 | 664 | | |
647 | 665 | | |
| |||
680 | 698 | | |
681 | 699 | | |
682 | 700 | | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
683 | 705 | | |
684 | 706 | | |
685 | 707 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
227 | 236 | | |
228 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
229 | 241 | | |
230 | 242 | | |
231 | 243 | | |
| |||
0 commit comments