Skip to content

Make iPhone UI-test readiness survive a slow simulator - #153

Merged
BunsDev merged 1 commit into
mainfrom
ios-ui-test-readiness
Oct 9, 2026
Merged

BunsDev merged 1 commit into
mainfrom
ios-ui-test-readiness

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Why

The iPhone companion job failed five times in two days (#133, #141, #148, and twice on #149's branch), each time on a different line. The uploaded .xcresult bundles — step timelines, element debug descriptions, the runner's Session-*.log and XCTest's in-app agent log — show three causes. None is in the app: its accessibility capture is <0.1 s in 316/317 local snapshots and 177/193 CI snapshots.

  1. tapWhenReady could not survive the wait it existed for. It waited on an XCTNSPredicateExpectation over hittable. XCTest answers hittable by fetching the element's frame in a nested XCTWaiter; when the outer wait timed out it interrupted that fetch (faulted in (null): Interrupted by waiter), the frame came back as CGRectNull, and XCTest recorded Failed to determine hittability … Activation point invalid as a test failure — while the button was on screen at (201, 354). Run 37927792976: snapshots took 2–3 s each, one evaluation took 10 s, budget was 10 s. docs: retire the resolved worktree list in status.md #147's bump to 30 s only lengthened the fuse.
  2. Keystrokes and taps land after the call returns. Run 37936899163 typed "Ship it", the send tap fired after "Sh", and "ip it" stayed in the draft (hierarchy at failure: Got it: "Sh" / value: ip it). Run 37831389640 tapped a field while its sheet was still animating and the keyboard never came.
  3. A SpringBoard prompt two minutes into the paired flow (run 37755334306: Incremented alert counter for com.apple.springboard). The app stops polling while its scene is inactive, so "Mac connected" never arrived; waitForExistence cannot see a prompt and interruption monitors only run before an action.

What

apps/ios/ModexCompanion/UITests/XCUIElement+Ready.swift:

  • Readiness polls in a plain loop, so no evaluation can be interrupted; it reads the frame via snapshot() (never records a failure), requires it finite, non-empty and unchanged between two samples, and only then asks isHittable. At least three samples even when one outlasts the timeout; a clear message on timeout.
  • typeTextWhenReady re-taps until the field has keyboard focus (up to 3×), then waits until the field's value ends with the typed text (keeps Thread approval policy, full skill text on iPhone, and task retirement #149's intent, without XCTWaiter).
  • appears(within:) for the long app-state waits answers a SpringBoard prompt (Allow / OK / Not Now / Done / Close) between polls; an interruption monitor does the same during actions.
  • Tests use isReadyToTap instead of bare isHittable for scroll decisions, and two waits that sat under the phone's 8 s request timeout (retry re-enable, recovery card) get 30 s.

docs/status.md: Known rough edges records the three causes.

Verification

  • apps/ios/ModexCompanion/Scripts/test-e2e.sh (fixture + both UI tests) locally: run 1 passed (demo 72.9 s, paired ~97 s, 169.6 s total, load avg ~20); run 2 passed (demo 71.7 s, paired 95.6 s, 167.3 s total) while another session held the machine at load avg ~210.
  • npm run build && npm test: 465 passed, 0 failed.
  • Not reproducible on demand: all three mechanisms need a slow simulator. The CI run on this PR is one more sample, not proof.

🤖 Generated with Claude Code

Five iPhone companion CI failures in two days had three causes, all in the
test harness: the tap helper's XCTNSPredicateExpectation over `hittable`
was interrupted by its own timeout mid frame-fetch (null frame, "Failed to
determine hittability" on a visible button); keystrokes and taps landed
after the call returned (a prefix was sent, a field never focused); and a
SpringBoard prompt arrived mid-flow while the app's polling was paused.

Readiness now polls in plain loops with a settled finite frame before
isHittable, typing re-taps until the field has keyboard focus and waits
for the value, and long waits answer system prompts. Timeouts alone (#147)
removed none of the three. Local test-e2e.sh passed twice, once at load
avg ~210; the mechanisms are logged in docs/status.md.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Oct 9, 2026 6:56pm UTC

Request Review

@BunsDev
BunsDev merged commit 8fc3506 into main Oct 9, 2026
5 checks passed
@BunsDev
BunsDev deleted the ios-ui-test-readiness branch October 11, 2026 07:39
BunsDev added a commit that referenced this pull request Oct 18, 2026
Val decided on #290: Known rough edges keeps only open problems. Six fixed
incidents move, word for word, to docs/reviews/2026-10-18-resolved-rough-edges.md,
each under the PR that fixed it (#153, #189, #190, #197, #204, #265 and #271).
The section now links to them.

Entries with an open part stay: the layout e2e note, the demo-thread and sizing
test corrections whose causes are unproven, and the poisoned ChatGPT threads.
Also: node-pty's line says Modex still ships the beta, the demo-thread note no
longer waits on a merge that happened (#189), and the tracker pointers list the
open CF PRs after #289 landed.

Coven-Harness: Claude Code / claude-opus-5-5
BunsDev added a commit that referenced this pull request Oct 18, 2026
…ycle 1) (#292)

* Record what shipped in plans, specs, README and status

Docs and plans steward, cycle 1 (#290).

- Plans: a status line on each ledger under docs/superpowers/plans/ and on
  docs/mac-store-preview-plan.md, naming the PRs and release that delivered it.
  Unticked boxes stay as history rather than being ticked after the fact.
- Specs: routines (Phases 0 and 1 on main), sticky Auto routing (shipped in
  v0.0.11) and approval rules (parts 1 and 2 shipped, gate off).
- README: app-owned sign-in, self-updating Macs from v0.0.12, Windows and Linux
  installers from v0.1.0, Images and Plugins no longer marked unreleased.
- status.md: the site's static fallback follows apps/site/release.json; the
  delivered release-candidates entry leaves In flight for a pointer to tracker
  #273; Next 3 points to #286.

Coven-Harness: Claude Code / claude-opus-5-5

* Bring reference docs in line with main and the releases

Docs and plans steward, cycle 1 (#290). Each change was checked against the
code on main, a release section of status.md or a review.

- Shipped work no longer reads as pending: the approval rules editor (v0.0.7),
  Modex sign-in (v0.0.9), 1Password filling (v0.0.11), the notes folder
  (v0.1.0), the hosted native updater scenarios and the first
  published-to-published upgrade, and Windows/Linux publication.
- Behaviour matches the code: Windows and Linux show no update banner; Auto's
  judge sees a placeholder for assistant replies and runs `jev` with one
  attempt; Claude's model list is Modex's fixed aliases; the Settings sections
  and transport labels; Space options → Agent notes; the companion's policy
  route and current version; the knowledge fence for overlapping folders; CI's
  e2e runs the unpackaged build.
- The Store record and processed 0.0.8 package are recorded under gate 5.

Coven-Harness: Claude Code / claude-opus-5-5

* Close the two finished In flight entries and add the GitHub App to Next

Val decided on #290: the local work recovery and retired worktrees entries
are done, so they leave In flight. The recovery audit and the archive
READMEs keep their record. Their one open item, repository authorization
through a GitHub App, becomes Next 4, ahead of the out-of-scope Cloud tasks.

Coven-Harness: Claude Code / claude-opus-5-5

* Move fixed rough edges into a dated review

Val decided on #290: Known rough edges keeps only open problems. Six fixed
incidents move, word for word, to docs/reviews/2026-10-18-resolved-rough-edges.md,
each under the PR that fixed it (#153, #189, #190, #197, #204, #265 and #271).
The section now links to them.

Entries with an open part stay: the layout e2e note, the demo-thread and sizing
test corrections whose causes are unproven, and the poisoned ChatGPT threads.
Also: node-pty's line says Modex still ships the beta, the demo-thread note no
longer waits on a merge that happened (#189), and the tracker pointers list the
open CF PRs after #289 landed.

Coven-Harness: Claude Code / claude-opus-5-5

* Move status.md's release sections into their release reviews

Val decided on #290: status.md keeps the Shipped table as the index, and each
release's details live in its review. The v0.0.6 to v0.1.0 sections (651 lines)
move unchanged to a "Status summary" section at the end of each review. Only link
targets change, so they resolve from docs/reviews/. status.md drops from 1,060 to
388 lines.

The Shipped rows now link their reviews. Four links that pointed at the old
release anchors now point at the reviews. A new convention and step 1 of the
release procedure say where a release's details go from now on.

Coven-Harness: Claude Code / claude-opus-5-5

* Trim the Mac App Store entry to its current state

Val decided on #290. The 52-line In flight entry becomes 15 lines: what Apple
shows, what signed acceptance covered, and what is open, each linked to its
receipt. The old entry moves unchanged to a "Status summary" section of the
October 11 signed-acceptance review, with links re-based to docs/reviews/.

The short entry drops two statements that no longer hold. The iPhone CI failures
have been diagnosed (resolved rough edges), and the Store recovery changes are
on main (edf52fc, #173).

Coven-Harness: Claude Code / claude-opus-5-5

This branch was successfully deployed

1 active deployment
Preview — 96bec6ad Deployed Oct 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant