---
title: "Driving and testing"
description: "packages/speech-recognition/test/drives.mjs --help runs the web drives. An Android APK drive needs an awake, unlocked screen. A production bake does not open an agent socket."
modificationDate: "2026-12-01"
---

> ## Documentation index
> Fetch the complete documentation index at: https://exact.expo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Driving and testing

<AgentInstructions>

## Submitting feedback

From the app's directory, read `bun exact.mjs feedback status`. Under `never`, keep no note.
Respect `EXACT_FEEDBACK=0` and do not change the policy.

Otherwise record specific, actionable feedback with:
`bun exact.mjs feedback note "Exact docs: https://exact.expo.dev/reference/pitfalls/driving-and-testing: <what was wrong or missing>"`

The note goes to Expo only as that status allows. Include no secrets or personal data.

</AgentInstructions>

- **`packages/speech-recognition/test/drives.mjs --help` runs the web drives.**
  That short package script has no help mode, so an unrecognized first argument
  leaves its default platform in place. Pass a platform and optional drive number,
  for example `ios --only 6`, or read the script before invoking it.
  (Speech transcription rebase, 2026-11-15.)

- **An Android APK drive needs an awake, unlocked screen.** The relay checks and
  wakes it and dismisses an insecure keyguard before launching. A secure lock
  screen fails at once: unlock the device and run the drive again. A readiness
  timeout includes the screen state observed before launch. Headless drives do
  not need the display. (expo/exact#365; covered with stubbed adb calls.)

- **A production bake does not open an agent socket.** Its baked
  `embedded.trust="production"` makes the host ignore `EXACT_AGENT` and
  `EXACT_AGENT_*`, including `EXACT_AGENT_SOCKET` and `EXACT_AGENT_LIVE`,
  with a message on stderr. Check the binary's `--exact-receipt` and use a
  development bake for an agent drive. A release benchmark needs its own
  probe or ordinary input. (LLP 1069.007 D2; M10 cut 2, 2026-10-31.)

- **A temporary import fixture says a sibling `use` leaves the app directory.**
  Canonicalize its directory before passing the entry path to the compiler. On
  macOS, `/var` aliases `/private/var`; mixing those paths makes the containment
  check reject the sibling. (`contract-property-cone`, 2026-10-28.)

- **A timer has fired before the next assertion although the test has no clock line.**
  The test driver advances one millisecond per mutation request after each step,
  including requests answered synchronously and those issued by an automatic advance.
  Read the expansion's `.events` file from `contract verify` when checking a timer's
  exact deadline. An input and its continuations land before those advances.
  (LLP 1151 delivery; `mutations/then` and `queue-then`, 2026-10-28.)

- **An HDR gradient samples as 1, or a visible box shadow samples as black.**
  Apple's agent samples through `CALayer.render(in:)`, which does not reproduce
  every compositor effect. On iOS 27, a native `CAGradientLayer` from 1× to 4×
  white also captures as 1, and layer shadows disappear from that capture.
  Compare the layer's colors and range with UI Gallery's UIKit reference,
  then inspect the displayed screen through iPhone Mirroring. A float capture
  alone cannot judge those effects. (UI Gallery, iPhone 16 Pro, 2026-10-27.)

- **A build's refusals do not say "error".** A compile refusal prints as
  `app.contract:5:13 [lower-attr-value] symbol \`warning\` is not a role; …` and the
  build exits 1, so a check that greps the output for `error` passes a build that
  failed. Judge a build by its exit status (`bun host/web/build.mjs`, `bun
  host/apple/build.mjs`). (Excord port, `symbol:warning`, LLP 1142 D7, 2026-10-25.)

- **The first text read in a newly built Mac app takes a minute or more.** Vision's
  text recognizer is compiled for the Neural Engine per app binary
  (`ANECompilerService`, which a `sample` of the app shows as `_ANEClient
  compileModel`), so a drive's first `detectText` after each build waits while the
  later ones answer at once. It looks like a hang. Give the first read several
  `clock data` ops, or keep one fixture between runs
  (`EXACT_VISION_FIXTURE`, `packages/barcode-detection/test/agent.mjs`). (LLP
  1133.027, 2026-10-26.)

- **A host timing bug on iOS is chased with `NSLog` and rebuilds of Exact.** A
  development build already journals what the host did: `logs` has `host:` lines for
  navigation (`willShow`, `didShow`, and whether the app, UIKit's Back or the edge swipe
  started it), sheets presented and dismissed, autofocus applied or skipped with what holds
  the focus, the keyboard, and the status bar's style. A run driven by hand prints them to
  `xcrun simctl spawn booted log stream --level debug --predicate 'subsystem == "dev.exact"
  AND category == "host"'`, and the rest of the journal under `subsystem == "com.exact.app"
  AND category == "journal"` (`--level info`). Read them before patching the host (LLP 1143).

- **Repeated macOS `s.type("composer", text)` calls replace earlier text.** The
  string form sets the whole textarea: AppKit selects all, then inserts the supplied
  value. Even one character per call is replacement, so `" suffix"` does not append
  to the existing prompt. Keep strings for whole-value setup. For incremental ASCII,
  first verify the actual native selection is collapsed at the intended insertion
  point, then send keys, including `Space` for a space:

  ```js
  await s.type('composer', 'seed'); // Replace the whole field.
  // Verify the native caret is at source offset 4 before appending.
  for (const character of ' a') {
    const reply = await s.type('composer', {
      key: character === ' ' ? 'Space' : character,
    });
    assert.equal(reply.delivery, 'platform');
  }
  ```

  Wait for the app's accepted source after each key: `"seed "`, then `"seed a"`.
  Assert one accepted-input serial increment per character and an unchanged owner;
  the final value or a delivery receipt alone does not prove incremental input.
  This ASCII example does not exercise IME composition. (T3 composer acceptance,
  2026-10-19; [AgentMac.swift](https://github.com/expo/exact/blob/41ded8c5ede0b2959ef0daa83b1ff78545dd4428/host/apple/Sources/ExactKit/Mac/AgentMac.swift),
  textarea branch of `type`; [public driver](https://github.com/expo/exact/blob/41ded8c5ede0b2959ef0daa83b1ff78545dd4428/scripts/agent.mjs), `type`.)

- **A compiler fixture silently tests its helper instead of `App`.** The first
  component is the root; the name `App` has no special meaning. Put the root
  before its helpers. (SVG `use` warning's component-expansion test, 2026-10-17;
  `contract/syntax/src/inline.rs`, `expand_with_sites`.)

- **An alert's action has not run by the next step on iOS.** `tap "remove-confirm"`
  then `clock data` finds nothing removed, though a drive shows the press. Cause:
  UIKit runs an alert button's handler after the alert has gone, a transition the
  tap does not wait out. Fix: `clock settle` after tapping an alert's button (and
  after the action that shows it, before tapping in it), as `apps/shelf`'s tests do.
  (Shelf recipe, 2026-10-10.)
- **An alert's buttons and the tab bar ignore `axe tap` on iOS 27; the app looks stuck.**
  An action sheet a long press opened stays up whatever is tapped, a rename prompt
  with it, and a first tap on a tab after launch does nothing, while the app's own
  buttons answer. Cause: UIKit's controls (`UIAlertController`'s actions, the tab bar's
  items) do not take AXe 1.8.0's zero-length tap, neither its default style nor
  `--tap-style physical`; the app is not stuck. A prompt the Sequencer's menu opens
  ignores it the same way, so the long press is not the cause either. Fix: a touch
  held for a tenth of a second, which each of those took at once: `axe touch -x … -y
  … --down --up --delay 0.1`; or real touches with the agent, which taps an alert's
  buttons by `testId`: `bun exact.mjs agent ios --touch platform "tap <row> down"
  "tap hold 900" "tap up" "clock settle" "tap <button testId>"`. (euxy ports 16 and 17,
  2026-10-18 and 2026-10-20: the Patterns long-press sheet, measured on a dev build.)
- **A deep link in a drive is `"type <root> euxy://p/…"`, not `simctl openurl`; a
  blind tap where iOS's "Open in …?" alert was dismisses the sheet the link opened.**
  `xcrun simctl openurl` asks "Open in …?" only sometimes (the first link after the simulator boots, in
  one run); otherwise the app opens the link at once. A drive that then taps where
  the confirmation's Open button would be (`axe tap -x 275 -y 474` on an iPhone 17)
  taps the dimmed screen just above the 45 % `navigationPresentation="modal"` route
  the link presented, and UIKit dismisses that sheet and pops the route, as it would
  for a person (a `dialog` sheet closes on that tap only with `closedby="any"`). Fix: check for the confirmation with
  `axe describe-ui` and tap Open by its label only when it is there; in a drive,
  `"type <root> euxy://p/…"` delivers the link with no confirmation at all. (euxy
  port's "Added to Library" sheet, Release build, 2026-10-18.)
- **`xcrun simctl ui <udid> appearance dark` does not darken an agent drive.** The
  driver sets the media preferences itself. Fix: `"prefer prefers-color-scheme dark"`
  as the drive's first operation. (Shelf recipe, 2026-10-10.)

- **Asserting a boot loading state against a live backend is a race.** The
  real reply lands on real time, and under load it can arrive before the first
  `expect`, so `expect tree has "loading"` passes once and fails once. Assert
  loading against a stand-in server that answers late, never by racing the real
  one; `fail fetch` (LLP 1103) tests the error state and its retry, not loading.
  (Authoring bench, LLP 1087, t3-recipes, Studio, 2026-10-08.)

- **On the web, a save still in flight when the tab closes is lost.** A
  `storage.fs` write is one IndexedDB transaction, and the browser drops a
  transaction still running when the page goes away (an immediate close after
  Enter lost it 4 of 4 times; native hosts finish it, LLP 1097 D10). In a test,
  let saves land (`clock data`, or wait for the saved state) before `reload`,
  `relaunch` or closing. In the app, show a saving state until the write
  resolves. (Authoring bench, LLP 1087, t5-pomodoro on the Android round,
  2026-10-08.)

- **A test fixture that patches `window.fetch` after boot changes nothing.** A
  data source's `fetch` is captured when the data module loads, so a stub
  installed later (a browser script's `page.evaluate`, a console patch) never
  sees its requests. Fix: to test a failure, `fail fetch "<url prefix>"` (the
  guide's testing section). For a response, lead the authored test with
  `answer fetch "<url prefix>" with 200 {"text":"Hello"}`. The driver installs
  it before the first resource load. (Authoring bench, LLP 1087, t8-library,
  codex, 2026-10-08; response fixtures, #699.)

- **`xcrun simctl io booted screenshot` can capture the wrong simulator.** With
  several simulators booted, `booted` names any one of them, not the one the
  app runs on. Fix: use the UDID the build prints (`… on iPhone 17 <UDID>`), or
  the agent's own `screenshot`, which targets the app's simulator. (Authoring
  bench, LLP 1087, t9-profile, 2026-10-07.)

- **`axe tap` misses on an Exact app about one time in three.** Its default
  style (FBSimulator `tapAt`) sometimes lands as nothing: a mute button toggled
  1 of 3, a drawer button did not open, and the app looked frozen until
  relaunched. Fix: `axe tap … --tap-style physical` (a real touch down and up),
  which hit 6 of 6; or drive by `testId` with the agent. (Bluesky clone, b12,
  2026-10-08.)

- **Records an agent drive writes are dated 2026-01-01.** The driver's clock
  starts at a fixed epoch, so `wallTime.epochAtZero + performanceNow()` is that date, and a
  `createdAt` taken from it is too: Bluesky's AppView then sorted the clone's
  test posts out of the author feed, and they turned up only through search.
  Fix: `--epoch now` (the machine's clock, read once at launch; a test file's
  `epoch now`) on any drive or test that talks to a real service, `snapback4 dev`
  included: a backend on real time otherwise sees the app's dates months early
  ("Due in 403783 min"). (Bluesky clone, b12, 2026-10-07; app farm round 2.)

- **A screenshot right after a state change shows a transition's start.** A
  `transition` (a background colour, an opacity) is held by the driver's clock,
  so the frame and the computed style still read the old value: the toggle
  looks unchanged. Fix: `clock settle` (or `clock +N` past the transition)
  before `screenshot`. (Authoring bench, LLP 1087, t5-pomodoro, 2026-10-07:
  about 5 minutes and a probe script to find.)

- **A macOS viewport screenshot omits a box's 3D rotation.** Both a static
  `rotate="-45deg x"` and a sampled axis keyframe can look unrotated in the
  default capture. Use `screenshot out.png window` to read the composited
  window; `layout` also reports the transformed bounds. (#609, 2026-11-14.)

- **Use `screenshot out.png window` to check how an `iframe` appears on macOS.**
  The default viewport capture paints a fresh guest snapshot into the frame's
  box. It can show page content while the window is still blank, or miss a
  hatch's magnification or added layers. The window capture shows what the
  window server composited. (#1282.)

- **A macOS `screenshot` shows no focus ring on a native field or button.** AppKit
  draws its focus ring only in the key window of the active app, and the driver's
  window is never key; nor is the ring in any picture a process can make of its own
  window (`cacheDisplay`, the layer tree). A focused native field looks unfocused
  in the picture, and a bare field shows only the ring Exact itself draws. Fix: do
  not judge a Mac focus ring from the driver's picture; read `state`'s `focus`, and
  look at a key window by hand. (LLP 1115.000 D7.9, 2026-10-12: an earlier lane
  concluded from the picture that AppKit's ring never drew.)

- **A test passes on the web and fails on iOS right after an input that saves.** An
  `expect` straight after `type` or `tap` reads what the input's mutation answered,
  but an input step only finishes the `then`s of answers already settled; it does not
  wait for outstanding storage ([authored tests](https://exact.expo.dev/reference/contract-grammar/authored-tests.md)).
  A fast web reply (the web input waits two frames) can make the `expect` pass while
  the native reply is still pending. Fix: put `clock data` after the input, before the
  `expect` that reads what its reply sets.
  (Authoring bench, LLP 1087, ios23 t5-pomodoro, 2026-10-05; iOS round 6.)

- **An `iframe` can show an app-owned document.** Use
  `src="app:/data/doc.pdf"` (also `app:/cache` and `app:/tmp`). The host
  reads it as its file type and keeps the authored sandbox; a missing or
  refused app file fires `error`, without a successful `load`. This does
  not provide a portable fit-to-width PDF viewer or toolbar controls.

- **`EXACT_MAC_BIN` overrides the bundled macOS launch and skips the freshness
  check.** A bare executable named by this override has no bundled App Transport
  Security policy. An executable inside an `.app` reads its assets (bundled pages,
  images, fonts) from that bundle's `Contents/Resources`; a bare one reads the
  build capture under this shell's target directory, and the driver refuses when
  that capture is missing. `EXACT_ASSETS` names another root.

- **A bundled web page that works on the web can break on Apple if it reaches its
  parent, sets cookies or registers a service worker.** An `iframe` of an HTML page
  under `assets/` or `deck/` (a built web app: scripts, styles, fonts, chunks,
  workers, wasm) loads with its files on the web, macOS and iOS. On the web it is same-origin
  with the app's page; on Apple it is `exact-app://app/<path>`, a secure context
  with no app page above it, where WebKit refuses `navigator.serviceWorker.register`
  and drops `document.cookie`. Fix: talk to the app by `postMessage` only, keep
  saved data in `localStorage`, IndexedDB or OPFS (kept across launches on all
  three), and treat a service worker as optional. Untrusted content belongs at its
  own URL, or under a `sandbox` without `allow-same-origin`. (LLP 1020.001 D5;
  Exact Draw, 2026-10-15.)

- **A bundled page cannot fetch an `app:/` path.** A page under `assets/` handed
  `app:/tmp/a.pdf` in a message cannot load it: no browser fetches the `app:`
  scheme, and `readFile`'s bytes posted to the page stop at 16 MiB. Fix: name the
  file in the page's own `src`, encoded,
  `` src=`assets/viewer/index.html?file=${encodeURIComponent(path)}` `` (unencoded,
  `report #2.pdf` or `a&b.pdf` is cut short), and read
  `new URLSearchParams(location.search).get('file')` as a URL: each `app:/cache` or
  `app:/tmp` value there becomes one the page can fetch, until the frame's `src`
  changes. `app:/data`, a link or a file that is not there is emptied, and the host
  logs `… is not given (…)`: copy the file into `app:/cache` first. An HTML, SVG or
  XML file comes as `application/octet-stream`: read its bytes to show it. Android
  gives no files: its page sees the paths. (LLP 1020.001 D7, 2026-10-29.)

- **A magnified Mac iframe still lays out at its box's width.** For a sharp canvas
  preview with the original line breaks, load your own wrapper with a fixed-size
  HTML iframe and set `apple.magnification` on the outer Exact frame. The child
  must allow framing. [Sizing and wrapper example](https://exact.expo.dev/reference/developer/open-the-same-development-url-on-apple-hosts.md#enlarge-an-iframe-on-macos)

- **A browser tab's title comes after its load.** On Apple a partitioned
  `iframe`'s `navigatesuccess` usually carries the old or an empty `title`: WebKit
  reports the new one a moment later, as its own `currententrychange`. Show the last
  record's fields, not the ones `navigatesuccess` had. The commands (`navigate`,
  `traverseHistory`, `reload(id)`, `stopLoading`) move only a frame with
  `partition=` on Apple; without one they fire `navigateerror` with
  `NotSupportedError`. `clearSiteData` from Rust data code answers
  `NotSupportedError` unless `@exact/browser` is in the plan (via `app.json`'s
  `rust.data.packages`, a Contract `use`, or an `app.ts` import): a module call
  is admitted only by a row of the plan (LLP 1133.002 D14).
  (LLP 1020.002, stage 1, 2026-10-23.)

- **A frame without `newwindow=` opens nothing.** On Apple a guest's
  `target=_blank`, ⌘-click and `window.open` reach the app only through
  `newwindow=`; without it they are refused, and an OAuth sign-in that opens a
  popup waits forever. A tab disposition opens nothing even with it: the action
  opens the tab. Under the agent, a guest `tap` whose click opens `alert`,
  `confirm` or `prompt` answers at once with `held=<ticket>`; the page waits until
  `tap @<ticket> ok` (or `cancel`, or `type @<ticket> <text>` for a prompt).
  (LLP 1020.002, stage 2, 2026-10-25.)

- **Calling a native module package from Rust data code needs it in the plan.**
  TypeScript that `app.ts` reaches and that imports a package puts it in the
  plan; a Rust data crate cannot be scanned before `modules.rs` is generated, so
  list any package that only Rust data code calls in `app.json`'s
  `rust.data.packages` (for example `"packages": ["@exact/browser-automation"]`).
  Without that entry (or a `use` in Contract or import in `app.ts`), every call
  answers `NotSupportedError` and the journal says `not a module this app's
  plan names`. For `@exact/browser-automation` specifically: without
  `browser.automation` in the grants each call answers `NotAllowedError`, a
  frame without `partition=` answers `NotSupportedError`, an `evaluate` that
  opens `alert`, `confirm` or `prompt` answers only once the dialog is answered
  (so call `handleUserPrompt` after `userpromptopened=` without awaiting it
  first), `expression` is one expression (`callFunction` takes statements), and
  `result` is typed as a record (`as unknown as string`).
  (LLP 1020.002, stage 4, 2026-10-25; updated for `rust.data.packages` in #2291.)

- **A local PDF in an `iframe` is no web page on Apple.** An unsandboxed,
  unpartitioned frame of an `app:/` or `assets/` PDF shows PDFKit's view: `tree`
  gives it `pdf` and `pages` and no guest outline, a guest `tap` or `type` fails, and
  the frame commands answer `NotSupportedError`. `captureScreenshot` still works,
  its `clip` in the view's points. A `sandbox` keeps WebKit's PDF view. A capture's
  answer is the frame's `capture=`: a path that is not an `app:/data`, `app:/cache`
  or `app:/tmp` file answers `SyntaxError`, and the web always `NotSupportedError`.
  (LLP 1020.002, stage 3, 2026-10-25.)

- **A local server behind an `iframe` is loaded from the frame's parent, not the
  app.** On macOS an `iframe` of an `http(s)` URL with no `sandbox` is the web view's
  own document. With a `sandbox` on macOS, and always on iOS, it is the child of a
  wrapper page at `http://exact.invalid` (for an `http:` guest) or
  `https://exact.invalid`: the page's first request is a cross-site navigation, and
  `window.parent`'s origin is the wrapper's. Either way its request carries
  `Referer: http://exact.invalid/` (or `https:`), the parent's origin, as a browser
  sends it for a cross-origin frame; Android's frame, a page of its own, is asked
  for with the same value. On the web the parent is the app's own
  page, whose loopback port differs between the dev loop and an `agent web` or
  `test web` run. A server that checks `Origin`, `Referer` or `Sec-Fetch-Site`
  against a fixed list therefore refuses its own page on some hosts. Fix: admit the
  page by a token in the `src` URL the data module builds, and keep the origin check
  for the API requests the page itself makes. (Exact Draw, 2026-10-15.)

- **An embed inside a bundled page gets no `Referer` on Apple.** An `iframe` the
  app writes is asked for with its parent's origin as `Referer`, which an embed
  that requires one (YouTube's player, else "Error 153") accepts. An `<iframe>`
  written in the HTML of a page under `assets/` is not: that page is
  `exact-app://app/<path>`, and WebKit sends no `Referer` from a custom scheme,
  whatever its `<meta name="referrer">` says. Fix: put the embed in the app's own
  `iframe`, or give the player what identifies its embedder in its URL (YouTube's
  `origin` or `widget_referrer` parameter). (#704, 2026-11-15.)

- **A focus ring never shows in an `agent macos` screenshot.** `type save key Tab`
  moves the focus (`state` reads it in `focus.logical`), yet neither `screenshot`
  nor `screenshot … window` shows AppKit's ring. Cause: the agent's app is an
  accessory whose window is ordered front but never key, and AppKit draws a focus
  ring only in the key window; nor can a script activate a dev build here (macOS
  refuses `activate` from the background). Fix: read the focus from `state`, and
  for the ring itself make the presenter's window an `NSPanel` with
  `.nonactivatingPanel` in an XCTest (it becomes key without activating the app)
  and read its pixels with `CGWindowListCreateImage`. (Issue #179, 2026-10-07.)

- **A drive script kept in the app folder makes the build stale.** A `drive.py` beside
  `app.contract` made the driver refuse the next drive until `bun exact.mjs web-build`.
  Cause: a file in the app folder counts as a build input unless no build reads it: an
  output (a screenshot, a log), a `.sh` or `.ops` helper, anything under `tools/`,
  `shots/` or `repros/`, a file git ignores outside the input trees (`data/`, `web/`,
  `assets/` and the like count even when ignored), and a script or `.json` that `app.ts`
  never imports (with no `app.ts`, every one counts). Fix: keep drive scripts, evidence,
  logs and runtime files in the app's `.exact/` (no build, dev-loop watcher or freshness
  check reads a dot directory at the app's root), in `tools/`, or outside the app folder.
  (Authoring bench, LLP 1087: five builders, 2026-10-05; Depot's evidence JSON,
  2026-10-05.)

- **A latency test passes at once, or a reply never lands.** Cause: every drive
  holds the app's clock, in every browser and on every host: `clock +N` moves the
  app's time and nothing else, while a `fetch`, a storage call or a stream's next
  message arrives on real time. Fix: `clock settle` to land what is in flight;
  `clock +N real` to let N ms of wall time pass with the clock moving alongside
  (polling, a server push, a measured latency). `state` lists what is pending.
  (Depot on three backends, 2026-10-05.)

- **A date input reads `10/05/2026` beside a label the app wrote in UTC.** Cause:
  `input type="date"`/`"time"` show the browser's own locale format and mean a
  local wall time, as on the web; the app's label used another zone. Fix: label in
  the viewer's zone, or pass `--locale` and `--time-zone` on a drive (`locale` and
  `time-zone` lines in a test file) so both agree and the run stays reproducible.
  (Depot, 2026-10-05.)

- **The same test passes on the web and fails on iOS at a date past `max`.** Cause:
  the runner refuses a date, time or datetime outside `min`/`max` (the agent says the
  date was refused) on iOS, macOS, Linux and the wasm web; the JS web target keeps the
  value as a browser's date input does. Fix: test values inside the range, or the
  bound itself. (Authoring bench, t7-wizard on iOS,
  2026-10-05.)

- **The agent taps the simulator by screen coordinates** (`axe tap -x -y`,
  `simctl`), and the drive breaks whenever layout moves. Cause: the controls have
  no `testId`, or the driver was not used on iOS. Fix: give every control a
  `testId` and drive with `bun exact.mjs agent ios tree "tap <testId>"
  "screenshot s.png"`; find targets with `tree`, or `tree --ax` for the
  accessibility tree. (Exact-new iOS app feedback, 2026-10-04.)

- **An iOS build replaced the app another session was driving.** Simulator
  builds use `--sim` or `EXACT_SIM`; `--phone` names a physical device.
  Without an explicit simulator, selection can reuse one with the app
  installed. Git worktrees share an app's bundle ID, so this can select
  another worktree's simulator. Create a simulator for each concurrent
  worktree with `xcrun simctl create "<name>" <device-type> <runtime>` and
  set `EXACT_SIM=<udid>` for its builds, tests, verification and agent runs.
  Pass `--sim <udid>` when invoking `build.mjs` directly.

- **`tap <row>` pressed a link card, Like or Repost inside the row.** Cause: a
  plain tap aimed at the row's middle, and a finger there presses the deepest
  control (the Bluesky clone liked and reposted real people's posts,
  2026-10-09). Now a tap that names a node presses that node: one with its own
  `press` is pressed beside the control its middle holds (the reply's `avoided`
  says so, `at` where it landed), or refused when no point of it reaches it; one
  without a `press` refuses rather than press a control inside it
  (`tap post-0 would press card-0 inside it; tap card-0, or tap post-0 at <x> <y>`).
  Fix: tap the control by its own `testId`, or `tap <row> at <x> <y>` (a point
  from its top left) for whatever a finger there reaches; name a point too when a
  refusal says no point reaches the row but a thin strip of it does (the search
  is a grid). Every host (LLP 1012 §1).

- **Every date in a screenshot is 1 January 2026** (31 December 2025 west of UTC).
  Cause: the agent's clock starts at `2026-01-01T00:00:00Z`, in UTC. Fix: `--epoch <ISO time> --time-zone <zone>` on
  `scripts/agent.mjs` for dates that read as intended and stay reproducible; in a test
  file, `epoch "…"` and `time-zone "…"` lines, so a run without the flags still means it.
  Against a live backend, `--epoch now` (`epoch now`) instead.
- **Every app launches slowly on the same iOS simulator.** An XCTest UI session can leave accessibility enabled
  across reboots. `test ios` reports the existing settings and the commands to
  clear them. [Timing an installed build](https://exact.expo.dev/recipes/porting-and-release.md).
- **A simulator measurement shows a 100–200 ms stall the app never makes.** A
  plain launch's frames hold 16.7 ms, but a run driven with `axe` shows one
  stall with no batch applied about 0.4 s after `axe` first reads the screen
  (`describe-ui`, `swipe`, `tap` by label), and every push afterwards is 30+ ms
  slower. Cause: an accessibility client turns on UIKit's accessibility runtime
  in the app; Time Profiler puts the whole stall in
  `-[UIApplication _accessibilityInit]` (loading the accessibility bundles,
  starting the server), and from then on UIKit keeps accessibility state for
  every view it moves. A phone pays this only with an assistive technology on
  (VoiceOver, Voice Control, Switch Control). `xctrace` and `sample` attached to
  the app stall it too, and so does an `agent ios --touch platform` drive, which turns
  the simulator's accessibility on while it runs and puts it back at its end (euxy's
  launch: 1.4 s more). Fix: time a plain launch; drive taps with `axe touch`
  (HID, no accessibility) or have the host press a row itself, and read frames
  from Save Trace or a temporary log, not from a run an accessibility client
  touched. (x2-perf, 2026-10-05.)
- **A `sample` of an agent-driven Mac app blames the presenter for a scroll.** Twenty
  wheels in Excord put most of the main thread in `ExactSession.apply` →
  `Presenter.apply`, about 0.75 ms a batch, over 1,800 batches that carried no ops.
  Cause: the agent applies a batch for each of its own clock steps (`Agent.clockStep`)
  and position reports (`tellAgentOffset`): 1,533 of the 1,573 empty batches in that
  drive, against 13 from the app itself. A real session makes none of them. Fix:
  measure scrolling from a recording of a real session (Record Frames in the developer
  menu, on before it scrolls and off after, which saves its trace; on tvOS, ⌘D on a
  keyboard opens the menu); in an agent drive's
  profile, discount every stack under `Agent`. (Excord, the Mac transcript, 2026-10-27.)
- **`axe` stops delivering taps.** Use `axe` only as a last resort, for native
  chrome only a normal launch presents (bars, `UIMenu`s); drive everything else
  with `agent ios` by `testId`. After `axe touch --down --up --delay` (a long
  press) or an `axe drag`, a following `axe tap` often reaches no window; it is
  intermittent, and a native bar button can miss the same way with no gesture
  before it. `axe touch --down --up` lands more often, not always. Fix: use the
  agent's own taps where it can; with `axe`, tap by touch, check every step with
  `axe describe-ui` before the next, and `xcrun simctl shutdown` / `boot` the
  simulator when taps stop landing. `axe` also cannot press tab bar items or
  `UIMenu` rows. (Signal Clone, builds 10 and 11; reproduced on `05d0c576e`.)
- **A `UISwitch` does not flip under `axe tap -x -y`.** Cause: a tap by
  coordinates resolves no element, so `--tap-style automatic` sends the
  simulator's own tap, a touch with no duration, and iOS 27's `UISwitch`
  ignores it: a bare UIKit app's switch does not flip either. A grouped
  list's toggle (LLP 1084) looks broken while its app logic is fine. Fix:
  `axe tap --id <testId>` (a switch element gets a physical touch),
  `axe tap -x <x> -y <y> --tap-style physical`, or
  `axe touch -x <x> -y <y> --down --up`; or the agent's `tap <testId>`.
  (Signal Clone Privacy, 2026-10-04.)

- **The software keyboard does not rise after `axe type`.** A field takes
  focus (its caret blinks) but no keyboard rises, and `keyboardWillShow`
  never fires, so nothing that rides the keyboard can be measured. Cause:
  `axe type` sends HID key events, and after them the simulator shows no
  software keyboard until its hardware keyboard is turned off. A reboot
  does not always clear it. Fix: turn the hardware keyboard off with
  CoreSimulator's private
  `-[SimDevice setHardwareKeyboardEnabled:keyboardType:error:]` (`NO`,
  type `0`); the keyboard rises for the focused field, which keeps its
  text. A short Objective-C tool reaches the device: `dlopen`
  `/Library/Developer/PrivateFrameworks/CoreSimulator.framework/CoreSimulator`,
  call `+[SimServiceContext sharedServiceContextForDeveloperDir:error:]`
  with the Xcode's `Contents/Developer` and then
  `-defaultDeviceSetWithError:`, and take the entry of `-devices` whose
  `-UDID` matches. Call it again after each `axe type`, or type by tapping
  the keyboard's keys with `axe tap`, which leaves the keyboard up. A
  Device Hub window gives the same symptom another way: it writes the
  device's `com.apple.keyboard.preferences`
  `AutomaticMinimizationEnabled = 1`, which keeps the software keyboard
  minimized until the key is deleted (LLP 1078, "As built (app half)";
  `scripts/smoke-duo.mjs`). Setting that key to false does not undo
  `axe type`. (Signal Clone keyboard timing, 2026-10-05; Lexy sign-in,
  2026-11-09.)

- **A storage test fails with `storage is busy`, or storage is "unavailable in
  agent mode".** Cause: a drive has no storage unless it names a scratch store, and
  an open SQLite database locks its file until close. Competing opens now wait
  up to 10 seconds; a timeout means another handle or tab still owns it.
  Fix: `--storage <name>` on an `agent` drive (authored tests get a
  store of their own), and close each handle in `finally` or reuse it through
  `Snapback.switcher`. Queue short-lived `storage.sqlite.open` calls in `app.ts`
  ([the human guide](https://exact.expo.dev/learn/contract-for-humans/writing-the-data-module.md) shows one).
  (LLP 1086 reading-list example, 2026-10-04.)

- **A browser proof reopens an old password session after rebuilding the backend.**
  `agent web --storage <name>` now resets its scratch profile on each CLI run.
  `--keep-storage` deliberately preserves it; `--reset-storage` explicitly
  starts empty. Use `fresh` only with `snapback4 dev`; against `serve`, provision
  uniquely keyed fixtures or log in to a provisioned account. Backend rows
  survive browser resets. `E_AUTH` from the server forgets the current managed
  session. (Wave 9, lanes 015/060, 2026-10-12.)

- **An agent drive shows the app's defaults (a mock, an empty store) though
  the app's files are there.** Cause: a web drive without `--storage <name>`
  (a native one uses the store `default`, kept between drives), or an authored
  test, whose store starts empty: the data
  module reads an empty store (`readFile`, `readdir`, `stat` and `realpath` reject
  with code `ENOENT`, as for a missing file) and every write throws "storage is
  unavailable in agent mode…", so a module that catches a missing file falls back
  silently, as it would on a fresh install (the drive says so once, after the first op that
  met a refusal, a screenshot too: `note: this drive names no --storage, so the
  app's storage was refused …`).
  The installed app's own files are not the drive's: a named scratch store lives
  apart (on iOS under `Library/Caches/exact/<app id>/agent/<name>/data`). Fix:
  `--storage <name>`, and copy the files the drive needs (a config, a saved
  store) into that folder first; `logs` shows the module's `console.log`.
  (Signal clone, live transport, 2026-10-05.)

- **A drive shows another app's data.** Cause: a store is named by the app's id, and
  apps made before `exact new` wrote a unique id share one when they share a name
  (`com.example.contacts-exact2`, a bake-off's every round): a native drive's
  `--storage s1`, a simulator's container and the installed app are that id's. The
  web keeps a development store by the app's folder too, so there it is the app's
  own. Fix: give an older app an id of its own, in `app.json`'s `app.id` (and `id`),
  as `exact new` writes them (`com.example.<name>-3f9a2c`), and in an `appId` its
  `app.ts` exports.
  (LLP 1116.004 D8, bake-off round 6 contacts.)

- **A save that fails in the background is lost to the person.** An answer that
  saves unawaited has replied before the write fails, so no answer reports it;
  `logs` has `storage failed: …`, but the person sees nothing. Fix: keep the
  error in the module (`.catch((e) => { saveError = e.message; })`) and say it
  in the next answer. (LLP 1097, x2apps drums.)

- **A read misses a save chained on a promise.** `saving = saving.then(() =>
  storage.fs.atomicWriteFile(…))` issues the write only when the one before it
  lands, so a read issued meanwhile runs first and sees the older file. Cause:
  the module's storage runs in the order it was issued. Fix: call storage in
  the answer (`storage.fs.atomicWriteFile(…).catch(note)`) and let the queue
  order it. (LLP 1097 §1.)

- **Two awaited writes of one answer had another's write between them.**
  Answers interleave at their awaits, as two async calls do on the web. Fix: put
  writes that must stay together in one `transaction` (SQLite) or one operation.
  (LLP 1097 D4.)

- **A database stays locked after the answer that opened it failed.** An
  answer that opens a database and fails, or that the runner let go, leaves its
  chain running in the background; if that chain throws before `db.close()`,
  the handle stays open and every later open finds the database busy. The host
  does not close it for you, since an app may keep or share a handle across
  answers. `logs` says `storage: app:/data/x.db is still open after a failure in
  background work that opened it`. Fix: close in a finally,
  `try { … } finally { await db.close(); }`. (LLP 1097 D7, Charlie,
  2026-10-07.)

- **Native button contents can be viewless.** Read color ownership from
  the face's `rows.title`, `rows.subtitle` and `rows.symbol` `written` fields.
  Walking child views misses these contents and can replace a child's authored
  color with an inherited active color.

- **A native button refuses an image's frame or a third text.** Its face is
  semantic: two texts (title and subtitle) and one symbol image. Raster faces
  need `appearance="none"` until every graphical host paints them. The symbol's size
  is `font-size` on the image, not `width`, `height` or `object-fit`. Its own
  colour is `-exact-tint-color`; the title's is `color`. Use a custom `button`
  without `appearance="auto"` for aligned image frames or arbitrary children.
  `-exact-control-size` and `-exact-corner-style` are admitted only on an
  explicit native button, including through classes, and `-exact-control-size`
  also written on a segmented control, a `tablist` or `radiogroup`.
  (LLP 1069.011.001 D8, D12–D14.)

- **`Request::continuation` does not compile: "type annotations needed"**, or
  an Apple production build answers a source's request with `Unlinked("io")`.
  A continuation runs on the host's executor, which an Apple production build
  links only with `io` (LLP 1047.001 D12). Declare the work on the source that
  builds it: `impl exact_runner::HostWork for MySource {}`, and write
  `Request::continuation::<Self>(token)`. The build script passes
  `exact_bake::hands_out_work!(source)` to `compatibility_id` beside the grants,
  so the bake links `io` with nothing in `app.json`; pass the source the entry
  runs, which may not be the one the bake runs (Markdown Stress bakes with
  `MarkdownStress` and runs `NativeMarkdownStress`). A source that forwards
  another's continuations declares it too. A TypeScript module needs nothing:
  its bake reads the bundle for the prelude's timers (`setTimeout`,
  `AbortSignal.timeout`) and `scheduler.yield()`, and links I/O for a native
  slot's `native.later()`. It cannot see a timer the
  module names at run time (`globalThis["set" + "Timeout"]`), nor a source
  that names another type's marker: those are refused by name. A push of a
  module that newly hands out host work to a binary without `io` is refused
  (`appleUses.io`): bake a new binary.

- **Natively, a Snapback resource or mutation fails with `native call outside an
  answer` while the same app works on the web.** Seen with five resources
  opening one `Snapback.switcher` partition at launch, and with a `setTyping`
  write overlapping a `sendMessage` write. Cause: the native device is the
  data module's native module, and the executor attributes a continuation to
  the answer whose fetch resumed it; a source that awaited another answer's
  promise (the switcher's opening, the partition's round in flight) continues
  after that answer ends, and its next device call is refused. On the web the
  device is wasm in the page, with no such guard. Fix: one read resource
  answering everything the view shows (a `snapshot`), and writes that
  `db.write` (admit; the device predicts) rather than `db.send`, so no write
  waits on a round: the write's `refreshes world` runs it. Gate the live
  timer on `not pending(...)` of every mutation. (Harmony, `~/projects/harmony`,
  2026-10-21.)

- **The Mac or iOS app says `Snapback4: the native module is not available: …
  link exact_snapback4::Module`.** `exact new --snapback` wires the web's wasm
  device only. Fix: in `apple/src/lib.rs` and `linux/src/main.rs`, wrap
  `exact_snapback4::Module::new(APP, GRANTS)` in a struct implementing
  `exact_js::NativeModule` (`configure_storage`, `call`), attach it with
  `.with_native(factory)` on the `exact_js::Module`, add `exact-snapback4` and
  `serde_json` to those crates' `Cargo.toml`, then `bun exact.mjs lock`.
  (Harmony, 2026-10-21.)

- **The web build refuses every brand token (`color="ink.light"` is not a valid
  `color`) that `contract build` accepted a moment ago.** Cause: a later line
  in `app.forma` was refused (here `color-mix(in oklab, AccentColor 16%,
  transparent)`, `forma-residual`), and the web build reports the tokens the
  design would have defined, not the design's refusal. Run `bun exact.mjs
  contract build app.contract --json`, which names the design's line. Also:
  a token's name is identifiers joined by dots (`hue.rose`, never `hue.1`).
  (Harmony, 2026-10-21.)

- **A brand token named by data (a custom emoji's `fill` from the server) is
  black on iOS and the Mac, right on the web.** Natively a token is resolved
  where the compiler sees its literal; a string from a source is not one.
  Fix: a `fn fillToken(name: string): string` whose arms return the literal
  token names, and for an SVG path `fill="currentcolor"` with the token on an
  ancestor box's `color` (a token on `fill` itself draws black on the web).
  (Harmony, 2026-10-21.)

- **`bun exact.mjs forma check .` in an app outside the checkout says each icon's
  SVG under `assets/` is missing though it is there.** The check resolves
  `assets/<path>` from the process's working directory, which `exact.mjs`
  moves to the checkout; the app's build finds the files. Trust
  `contract build`, or run the check from the checkout naming the app's
  absolute path. (Harmony, 2026-10-21.)

- **Under `agent macos` the tab bar sits at the bottom and no list splits beside
  its detail.** The agent shows authored chrome by default; pass `--chrome
  platform` to see the sidebar and the split as a person does (the screenshot
  then captures the content column only). (Harmony, 2026-10-21.)
