Skip to content

fix(open): wait for the launched app's first screen before the first capture - #4513

Open
thymikee wants to merge 17 commits into
mainfrom
fix/open-waits-for-first-screen
Open

thymikee wants to merge 17 commits into
mainfrom
fix/open-waits-for-first-screen

Conversation

@thymikee

@thymikee thymikee commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

On iOS, the first capture after open launches an app now waits for the app's first screen. This includes the open --foreground initial snapshot. Before this change, a React Native launch tree that held only the Application root settled on its first quiet pair, so open --relaunch --foreground returned a 1-node snapshot.

Rule (loop in post-gesture-stability.ts, predicate showsFirstScreen in deferred-interaction-outcome.ts, armed by markPostOpenStabilization on Apple only):

  • A tree qualifies when an element other than the Application/Window roots has a label or value that is not a busy indicator's, and two reads in a row agree (positions included, so a splash-to-app animation keeps polling).
  • A splash image, an empty view, or only a busy indicator never qualifies, however long it stays unchanged.
  • No node threshold or quiet window. An earlier revision accepted a tree with ≤4 nodes after 1.5 s unchanged. Bluesky traces showed why that fails: its storyboard splash is one unlabeled full-screen Image, and it held unchanged for 1.2–1.9 s after open returned. The empty React Native root that follows is one unlabeled view.
  • Trade-off: an app whose first screen has no labeled element (a game canvas) waits the full budget. An opt-out (open with settle: false) is a follow-up.
  • Polling budget 10s (a capture started in time still completes and is judged). When it runs out, the snapshot returns what it read with postGestureOutcome: {kind: "loading"} and a warning. is/wait absent reports observation: "loading".

Help and docs: the open --foreground CLI usage line and website/docs/docs/commands.md describe the wait. The always-loaded MCP open schema keeps its main wording, because it is within bytes of the 22 KB budget. An agent learns of a timed-out wait from the warning in the response.

observable opens arm the wait too. The open record replaces any stabilization or moving-target baseline an earlier action still owed: the open replaced that screen, so a verdict against it would charge the open to the earlier action. Android stays unchanged: its trees have no root node, so the content rule needs its own design.

Validation

Live run on head 72afa34 (readiness rule from 896ab43, budget fix 72afa34). iPhone 17 Pro sim (iOS 27.0), Agent Device Tester Debug dev build, Metro (expo start --dev-client) serving on 8081. The run used this branch's CLI (pnpm build, bin/agent-device.mjs) with its own --state-dir. Command: open com.callstack.agentdevicelab --relaunch --foreground --metro-port 8081 --json. Host load average was 90–128 during the runs.

Run Time Nodes (interactive) postGestureOutcome Banner or root-only tree
first connect (cold Metro bundle, 7.4 s) 17.0 s 52 none no
relaunch 1–6 6.4, 6.9, 10.9, 7.0, 6.4, 6.4 s 52 each none no
warm open, app already running (n=3) 2.2–2.3 s 55 none no

All 7 relaunches returned the full home tree. The home screen has grown since the earlier run, so it is now 52 interactive nodes, not about 30. No run returned a Metro loading banner or a root-only tree. The first open, before Metro connected, returned the dev launcher (Development Build, DEVELOPMENT SERVERS). That is the dev client's own screen, not a loading surface.

Read-by-read trace of the same relaunch with the pre-PR CLI (0.21.36): open returned while the tree was root-only. That phase lasted about 1.3 s, and then the tree went 41 → 88 nodes (still changing) → the same 88 nodes twice. No read held a banner node. The Metro banner does not appear in the app's accessibility tree, so showsFirstScreen needs no banner rule.

Readiness rule change (896ab43): Bluesky Release build, iOS 27.0 sim, 4 launches traced read by read. The new predicate rejected every splash and empty-root read and accepted only the home screen. Tester Release, FlappyMorse (a game with labeled elements), and native Settings, Contacts, Calendar, Maps, Photos, Files, Reminders, Health and Safari show labeled trees by the time open returns.

Earlier runs (before 896ab43, under the replaced sparse-tree rule): base 80075b6 --relaunch returned 1 node 10/10 (about 2.7 s). The previous rule returned 30 nodes 0/22 sparse (3.5–9.5 s, median about 4.5 s). Warm open went from a 625 ms median to 1004 ms (n=15). These no longer describe the current iOS logic. The live run above replaces them.

CI owns the full suite. Locally, with main merged: typecheck, format, the MCP budget test, and the touched capture-kit, daemon, command-surface and MCP suites passed.

Risks: providers that report no postOpenObservation do not arm the wait. An app whose tree stays root-only (empty UI or accessibility unavailable) waits the full 10s and reports loading.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.30 MB 6.31 MB +2.1 kB
Package (unpacked) 6.30 MB 6.31 MB +2.1 kB
Package (download) 1.91 MB 1.91 MB -77 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 18.6 ms 21.5 ms +2.9 ms
CLI --help 40.2 ms 39.3 ms -1.0 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 21 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread website/docs/docs/commands.md Resolved
thymikee and others added 2 commits November 13, 2026 21:46
…capture

The post-open stabilization accepted any quiet pair, so a React Native
launch or loading tree (only the Application root) settled at once and
open --foreground returned a 1-node snapshot. Every iOS and Android app
launch now marks a first-screen wait: a content-free tree never settles,
a sparse tree settles after 1.5s unchanged, and a 10s budget ends in a
typed postGestureOutcome.kind 'loading' with a warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ivate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@apex-sentinel-staging

apex-sentinel-staging Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No open findings.

1 new finding away from what changed since d67b371 not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (ef19edc2a540).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

Earlier reviews

Review of d67b3717 · 16.11.2026 10:14 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (ef19edc2a540).

Review of 896ab432 · 16.11.2026 10:03 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No open findings.

Reviewed with this repository's own Sentinel configuration (74633f7dda2a).

Review of 882598e2 · 14.11.2026 11:12 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No open findings.

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 7872ffdb · 13.11.2026 23:20 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 1 no longer raised (1 marked fixed)

No open findings.

1 new finding away from what changed since 61f5873 not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (ddbfc855661f).

Review of 61f5873c · 13.11.2026 23:11 UTC

Apex Sentinel · ✅ Approve

Since the last review: 1 new · 0 still open · 0 no longer raised

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
website/docs/docs/commands.md:114 🆕 commands.md still says only a non-"observable" open arms the wait, and that it is brief

1 finding below minor hidden (user_settings.min_severity).

1 new finding away from what changed since 8638f3e not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (ddbfc855661f).

Review of 8638f3e6 · 13.11.2026 21:54 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 1 no longer raised (1 marked fixed)

No open findings.

1 finding below minor hidden (user_settings.min_severity).

1 new finding away from what changed since eea1539 not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (ddbfc855661f).

Review of eea1539b · 13.11.2026 21:44 UTC

Apex Sentinel · ✅ Approve

Since the last review: 1 new · 0 still open · 1 no longer raised (1 marked fixed)

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
packages/capture-kit/src/post-gesture-stability.ts:341 🆕 A sparse tree that quiets only at the 10s deadline is returned as a settled first screen

Reviewed with this repository's own Sentinel configuration (ddbfc855661f).

Review of a4a80367 · 13.11.2026 21:31 UTC

Apex Sentinel · ✅ Approve

Since the last review: 1 new · 0 still open · 3 no longer raised (1 marked fixed)

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
packages/capture-kit/src/post-gesture-stability.ts:341 🆕 Timeout on a sparse-but-changing launch tree is reported as 'loading', not 'unsettled'

Reviewed with this repository's own Sentinel configuration (ddbfc855661f).

Review of 61c230a0 · 13.11.2026 21:13 UTC

Apex Sentinel · ✅ Approve

Since the last review: 3 new · 0 still open · 0 no longer raised

3 finding(s): 3 minor.

🟡 Minor (3)

Where Finding
packages/daemon/src/core/deferred-interaction-outcome.ts:236 🆕 An open now erases a scroll's owed stabilization, dropping its baseline checks
packages/daemon/src/core/deferred-interaction-outcome.ts:403 🆕 Sparse-marked launch tree is accepted as the first screen on one quiet pair
packages/daemon/src/core/deferred-interaction-outcome.ts:403 🆕 Legacy sparse capture (Application root only, no snapshotQuality) waits the full 10s

Reviewed with this repository's own Sentinel configuration (ddbfc855661f).

Review of f9ee613a · 13.11.2026 20:49 UTC

Apex Sentinel · ✅ Approve

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (ddbfc855661f).

@thymikee

Copy link
Copy Markdown
Member Author

I reviewed f9ee613. The iOS change looks right, but this PR also changes Android launch behavior and has no Android evidence yet.

The PR removes the isApplePlatform gate in deferred-interaction-outcome.ts. Every Android app launch now arms a deferred stabilize record with readiness first-screen, and before this PR Android never did. The next Android capture (the foreground snapshot, or a snapshot, press or selector capture) now runs the 10s first-screen loop. Its content count relies on isViewportRootNode, which matches nothing on Android. So a launch or splash tree with decor FrameLayouts may count as content and qualify at once, and the fix does nothing on Android. A real one-button Android screen may instead pay the 1.5s quiet window. The added latency on warm Android opens is also unmeasured.

Please run open <RN app> --relaunch --foreground and a warm open <app> --foreground on an Android emulator, at least 5 runs each, on this head and on base 80075b6. Report the node count of the returned snapshot, postGestureOutcome if present, and the latency. The run must show that the open path armed the first-screen loop, for example through the snapshot latency or the diagnostics of the deferred stabilize record. If you prefer, restore a platform gate here and file Android as a follow-up. The iOS simulator table in the PR body covers iOS only, and I did not reproduce it.

The open inline threads on Android root counting (r4568478849) and the sparse-read exception missing from the help text (r4568478841) still apply, as does the exhaustiveness check on the outcome kinds (r4568478812). The five lower-priority threads still apply too, so none of them can be resolved yet.

Not blocking, take or leave: runPostGestureStabilityLoop calls observeUntil without deadlineMs, so a short --timeout can fire the request deadline inside the loop and return a timeout instead of the partial tree with loading; the rule should be that the first-screen loop ends before the request deadline and always returns a tree. Also, observable opens now arm the wait too, which costs about 380ms on the next capture after a plain open on iOS; either state that cost or skip arming when the launch probe already read a populated tree.

Coverage is failing. The PR adds production lines without direct tests (result-serialization.ts:84, response-views.ts:38, snapshot.ts:131, readPostGestureOutcome), so a changed-line gate plausibly overlaps this diff, but I could not see the job log to confirm. Numeric Ranges and the other checks were still running. Before merge, please add the Android emulator evidence above and fix the Android root counting and help wording.

… first screen

Restore the Apple-only gate on markPostOpenStabilization: Android trees carry no
Application/Window root, so the content count cannot tell a launch surface from a
first screen there. Move the content count into the daemon so capture-kit's import
closure stays unchanged. Classify a miss on a loading tree as its own absence
observation, tie the outcome-kind table to the union, state the sparse-read
exception and the polling budget in help and docs, and give the post-open reads in
the provider and contract scenarios a populated first screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the fix/open-waits-for-first-screen branch from f9ee613 to 61c230a Compare November 13, 2026 21:06
@thymikee

Copy link
Copy Markdown
Member Author

Re the Chief of Staff review. I chose (b): the Apple-only gate is restored at 61c230a.

Android. Android trees carry no Application/Window root node, so a root-based content count cannot separate a launch or decor-only tree from a first screen. A credible fix needs a new Android structural-root rule, and that rule needs its own design and emulator measurements. markPostOpenStabilization returns early again for non-Apple devices, so Android open latency and semantics are the same as on main. Follow-up, with no issue filed per instructions: define Android launch-surface recognition, for example decor and content containers with no descendant that has text, an id, or an action. Then arm the wait on Android and measure open --relaunch --foreground and a warm open --foreground on an RN fixture app against base.

Inline threads. All 8 are fixed, answered and resolved:

  • The outcome kinds are a Record<PostGestureOutcome['kind'], true>.
  • The help and docs state the sparse-read exception and the 10s polling budget.
  • loading is its own absence observation.
  • Digest, serialization, runtime pass-through and readPostGestureOutcome have tests.

Coverage job. The failure was not changed-line coverage. 76 tests failed:

  • Scripted transcripts fed post-open root-only trees, which the first-screen rule correctly refuses. Their settling reads now return a populated first screen (FIRST_SCREEN_NODES).
  • eager-closure-budgets failed because capture-kit imported the snapshot facade. The content count moved into the daemon.

Locally, interaction-contract, provider-integration and the touched unit suites pass.

Non-blocking.

  • The ~380ms warm-open cost on iOS is now stated in the PR body.
  • The request-deadline bound is not in this push. The deferred-outcome capture receives no request deadline today, and the same gap applies to the existing gesture loop, so it belongs in a separate change.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 29 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread website/docs/docs/commands.md Resolved

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 3 new findings on 61c230a. The verdict and the full list are in the summary comment.

thymikee and others added 3 commits November 13, 2026 22:14
…arent fixture rows on the app root

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… supersedes owed stabilization

A root-only tree is a launch or loading surface whatever quality verdict the
producer gave it: the iOS runner marks exactly that tree sparse, and a runner
that predates verdicts publishes it with none. Count content beyond the roots
instead of trusting the sparse verdict. State why an open replaces a scroll's
owed stabilization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread website/docs/docs/commands.md Resolved

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on a4a8036. The verdict and the full list are in the summary comment.

thymikee and others added 2 commits November 13, 2026 22:32
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A small first screen that keeps changing through the budget is unsettled,
as the docs say; loading means nothing beyond the app roots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on eea1539. The verdict and the full list are in the summary comment.

… rule

A small tree whose last pair agrees just before the budget ends has not held
the 1.5 s quiet window, so it is unsettled, not settled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Thanks for the fixes since f9ee613. At 8638f3e the root-only tree, the Android arm, the timeout classification and the test gaps are fixed, and all 22 checks pass (the earlier Coverage failure was fixed in 61c230a). One docs problem remains, and there are no conflicts.

The help says the first-screen wait applies "On iOS", and commands.md says it runs where "local simulators and devices do". But the only Apple writer of postOpenObservation is open-policy.ts:179, and observeLaunchedApp (line 349) returns nothing unless the device is a local iOS simulator with the AX bridge. On a physical iPhone, or a remote iOS backend without a local bridge, open <app> --foreground skips the wait and can return the 1-node launch tree with no loading or unsettled warning. An agent on those devices will trust that snapshot as the first screen, which is the bug this PR fixes. The rule to satisfy is that every help and doc sentence promising the wait names the condition the code checks: a reported postOpenObservation, which today means a local iOS simulator. Please apply that qualifier to commands.md, the open summary in app.ts:46, the --foreground description in flag-definitions-action.ts:416 and the doc in client-app.ts:93-99, for example "local iOS simulators do; physical devices and backends that report no post-open observation skip the wait". Arming those devices would also fix it, but that is new behavior and out of scope here.

Not blocking, and fine to take or leave: classifyAbsenceObservation at absence-observation.ts:103 hand-lists unsettled and loading, which repeats isPostGestureRestUnproven, so a new rest-unproven kind would compile there and a zero-match capture would count as absent; a Record<PostGestureOutcome['kind'], UnprovableAbsenceKind | undefined> (or deriving from isPostGestureRestUnproven) would make that a compile error, as the Record fix did for readPostGestureOutcome.

The open inline thread on the physical-device qualifier (#4513 (comment)) still applies and is the same point as above. These threads no longer apply and can be resolved: #4513 (comment) (superseding an owed scroll record on open is deliberate and documented at deferred-interaction-outcome.ts:232-235), and #4513 (comment) (a legacy root-only tree reporting loading after 10 s is the documented outcome). The other open threads are fixed at this head.

I did not reproduce the iOS simulator runs in the PR body; eea1539 and 8638f3e change only the timeout classification, not the success route those runs used, so I accepted the earlier evidence for this delta. I could not run the test suites, so the deadline test's validity comes from reading the eea1539 code. I also did not check whether a remote iOS provider supplies a launch observation port with localIosSimulator true; the finding assumes only a local simulator with the AX bridge reports one. Before merge, the help and docs need the qualifier above.

Only a local iOS simulator reports the post-open observation that arms the
wait; physical devices and other backends skip it. Absence classification
now maps every post-gesture outcome kind, so a new rest-unproven kind is a
compile error rather than a silent absent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Fixed in d6a0872: every sentence that promises the first-screen wait now names the condition the code checks — a local iOS simulator (the only Apple writer of postOpenObservation); physical devices and backends that report no post-open observation skip the wait, and commands.md says their first capture can still show a launch screen. Updated: commands.md, the open summary (app.ts), the --foreground description and its verbatim SDK doc (client-app.ts). The --foreground text is now shorter so the open MCP schema stays inside its 5 KB budget; the full rule stays in the open summary and commands.md.

Non-blocking note taken: classifyAbsenceObservation now maps every PostGestureOutcome[kind] through a Record (unsettled/loading → unproven, no-effect → none), so a new rest-unproven kind is a compile error instead of a silent absent.

The inline threads you listed (r4568712653, r4568723351, r4568723372) are resolved; I added a follow-up reply on r4568712653 with the narrowed wording. Unit tests (2,441), typecheck and format check pass locally.

…ifyAbsenceObservation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 61f5873. The verdict and the full list are in the summary comment.

Comment thread website/docs/docs/commands.md Resolved
…very reported observation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 7872ffd. The delta fixes the docs finding from the earlier review: the physical-device qualifier is now in all four sites (commands.md:101, app.ts:46, flag-definitions-action.ts:416, client-app.ts:93-99), and the iOS Simulator bullet at commands.md:114 now matches the code. All 22 checks pass at this head, and there are no conflicts.

Not blocking: commands.md:101 and app.ts:46 say "backends that report no post-open observation skip the wait", but Android reports one and still skips the wait because markPostOpenStabilization returns early for non-Apple platforms (deferred-interaction-outcome.ts:244), so you could end the parenthetical at "other devices and backends skip the wait", as the --foreground and client-app.ts texts already do. Take it or leave it.

On the earlier inline threads, these no longer apply and can be resolved: the Simulator launch-behavior wording is fixed at commands.md:114 (#4513 (comment)), the physical-device qualifier is fixed (#4513 (comment)), superseding an owed scroll record on open is deliberate and documented (#4513 (comment)), and a legacy root-only tree reporting loading after 10s is the documented outcome (#4513 (comment)). No other threads remain open.

I read the code and docs at this head but did not run the test suites or re-run the simulator validation in the PR body. The delta changes help text and a behavior-preserving selectors refactor, not iOS logic. The claim that the client-app.ts doc comment matches the flag description rests on green CI, not on me running that test. I also did not check remote or provider iOS backends for other paths that report a post-open observation.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 13, 2026
@thymikee

Copy link
Copy Markdown
Member Author

At 7872ffd this branch now conflicts with main. Please rebase onto the current main and push. The code review of this commit was clean, so after a clean rebase only the conflict resolution needs a look.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 14, 2026
Resolves the open summary conflict with #4507: keeps main's agent guidance
and adds the local-iOS-simulator first-screen wait, compact enough to keep
the always-loaded tools inside their 22 KB budget. Takes the review note
that other devices and backends (Android included) skip the wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Brought up to date with main in 882598e (merged main rather than rebasing: the branch has ~20 commits that touch the same open help text, so a merge resolves the one conflict once; the PR squash-merges either way).

  • Conflict: the open summary in app.ts, where feat(mcp)!: preload loop tools, trim schemas, and shorten errors #4507 added agent guidance. Kept main's guidance and added the first-screen wait for a local iOS simulator. Since feat(mcp)!: preload loop tools, trim schemas, and shorten errors #4507 made open always loaded, the combined text has to fit the 22 KB always-loaded budget, so the summary and the --foreground text are compact; the full readiness rule stays in commands.md.
  • Took the non-blocking note: commands.md and app.ts now say "other devices and backends skip the wait" (Android reports an observation but still skips it).
  • Validated on the merged head: unit suites for mcp/commands/ai-sdk/command-surface/command-registry/contracts (2,207), typecheck, format check. Two Android snapshot-helper tests failed once in a full parallel run and pass alone (32/32); they come from main, not this PR.

@thymikee

Copy link
Copy Markdown
Member Author

I re-reviewed 882598e after the merge. The earlier conflict is resolved, the readiness logic is unchanged, the compacted help matches the code, and I found no problems. There are no conflicts, and all 22 checks pass at this commit.

Both open threads are fixed at this head, so please resolve them. The device qualifier thread (#4513 (comment)) stays fixed after the merge: app.ts:46 and commands.md:101 say other devices and backends skip the wait, and flag-definitions-action.ts:416 and client-app.ts:93-97 scope the promise to a local iOS simulator. The stabilization wording thread (#4513 (comment)) is also fixed: commands.md:114 is unchanged by the merge and matches markPostOpenStabilization in deferred-interaction-outcome.ts:240-253.

I did not measure the 22 KB always-loaded MCP budget myself and rely on green CI for it. I also took from the previous review that the local iOS simulator is the only producer of postOpenObservation that reaches the marker in open-policy.ts. Production code is unchanged in this delta, so I did not re-read it. Nothing else needs to happen before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 14, 2026
Measured on Bluesky, the storyboard splash is one unlabeled full-screen
image that held unchanged for 1.2-1.9 s after open returned, so the
"sparse tree quiet for 1.5 s" rule could return the splash as the first
screen. A first screen now needs an element besides the app roots with a
label or value that is not a busy indicator. The node threshold and the
quiet window are gone: a one-button screen is ready on its first quiet
pair, and a splash never is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files (changes from recent commits).

You’re at about 96% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

thymikee and others added 3 commits November 16, 2026 11:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* origin/main:
  fix(alert): derive the request envelope from an alert wait window (#4581)
  fix(android): require a nonzero chunk before a recorder counts as ready (#4559)
  chore(deps): clear astro and node-forge security alerts (#4577)
  fix(ios): establish the screen origin of a full-screen private AX root (#4573)
  docs(agents): trace behavior claims during review (#4576)
  fix(mcp): trim the press plan text back under the always-loaded byte budget (#4572)
  refactor(alert): one helper owns the alert runner budget (#4563)
  feat(interaction): multi-ref press plan lowered through the ordinary press lane (#4296)
  fix(ios): use the caller's budget for alert get and type the watchdog outcome (#4540)
  feat(recovery): bound remote health and runner-busy recovery by the command's deadline (#4541)
  fix(ios): find the navigation bar back button outside the bar's subtree (#4542)
  feat(open): report device kind, model and osVersion on open and session identity (#4543)
  fix(apple): use typed screenshot timeouts and observed shutdown recovery (#4544)
  feat(device-status): report per device whether a new session can take it (#4547)
  fix(runner): type the refusals for a control the target cannot supply (#4548)
  refactor(transport): share outgoing transfer phase ownership (#4551)
  fix(remote): bound artifact preparation and upload phases (#4552)
…hema

Merged with main, the always-loaded tools were 433 bytes over the 22 KB
budget. The open summary and the foreground input text return to their
main wording; the CLI usage line and the docs keep the 10s wait, and a
timed-out wait still carries its own warning in the response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

The MCP budget concern from the earlier review is fixed at 72afa34, and all 22 checks pass, including the always-loaded MCP budget. One thing remains before merge: the changed open route has no live run at the new readiness rule. There are no conflicts.

896ab43 replaces the readiness rule for the next capture after open and for the open --foreground initial snapshot. The PR's end-to-end runs (Agent Device Tester dev build on f9ee613, Release on a4a8036) used the old rule, "sparse tree quiet for 1.5 s". The PR body still says "iOS logic unchanged since", which is no longer true. The only evidence at the new rule is the Bluesky Release trace, and it does not say whether it ran open at 896ab43 or applied the predicate offline to captured reads. The case this PR exists to fix, a dev build where open --relaunch --foreground returned a 1-node tree, has no run at the new rule. Please re-run that table row at 72afa34: iPhone simulator, Agent Device Tester dev build with Metro serving, open com.callstack.agentdevicelab --relaunch --foreground, at least 5 runs. It passes when every run returns the full home tree (about 30 nodes) with no postGestureOutcome, and none returns a Metro loading banner or a root-only tree. Please add one warm-open timing and update the Validation section and the "iOS logic unchanged since" line.

Not blocking, take or leave: in a React Native dev build a stable loading text, such as the Metro "Loading from ..." banner, is a labeled non-root StaticText, so showsFirstScreen would accept it on the first agreeing pair 200 ms apart, where the old rule held a tree of 4 or fewer nodes for 1.5 s. Whether the banner window reaches the XCTest app snapshot is unproven, so the dev-build run above can settle this; if a banner-only snapshot shows up, the rule is that a first screen needs labeled content outside transient loading surfaces, enforced in showsFirstScreen, which owns it.

The thread about the splash-image test name is fixed at d67b371, so it can be resolved: #4513 (comment).

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 16, 2026
@thymikee

Copy link
Copy Markdown
Member Author

Live evidence for head 72afa34, as requested in #4513 (comment):

  • iPhone 17 Pro sim (iOS 27.0), Agent Device Tester Debug dev build, Metro serving on 8081. The run used this branch's CLI with its own --state-dir.
  • open com.callstack.agentdevicelab --relaunch --foreground --metro-port 8081 ran 7 times: the first connect (with a cold 7.4 s Metro bundle) plus 6 relaunches. Every run returned the full home tree, 52 interactive nodes, with no postGestureOutcome and no warnings. The home screen has grown since the earlier run, so it is now 52 nodes, not about 30. Times were 17.0 s for the cold connect and 6.4–10.9 s for the relaunches, at host load average 90–128.
  • No run returned a Metro loading banner or a root-only tree.
  • Warm open, with the app already running: 2.2–2.3 s (n=3), 55 nodes.
  • A read-by-read trace with the pre-PR CLI shows why the wait matters. open returned on a root-only tree that lasted about 1.3 s. Then the tree went 41 → 88 nodes (still changing) → the same 88 nodes twice. No read held a banner node, so the Metro banner is not in the app's accessibility tree. That means no showsFirstScreen change is needed.

I rewrote the Validation section with these results and removed the outdated "iOS logic unchanged since" line. No code changed, so the head is still 72afa34, with 22/22 checks green.

This branch has not been deployed

No deployments
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