Skip to content

fix(android): bound helper output and verify installed bytes - #5339

Merged
thymikee merged 8 commits into
0.22from
t3/android-daybreak-output-identity
Dec 3, 2026
Merged

thymikee merged 8 commits into
0.22from
t3/android-daybreak-output-identity

Conversation

@thymikee

@thymikee thymikee commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Summary

The installed Android helper must be the trusted artifact, and the host must stay bounded about app text. Install checks cover replacements that complete before admission. A holder of the helper signing key can still update the package between pm path and am instrument, so the guarantee depends on #5341's key rotation.

Before / after

Before After
Installed helper with a higher versionCode Counted as current, ran unverified State newer: uninstall, then install the bundled APK. versionCode comes from dumpsys package
Warm admission Memo hit skipped device checks One pm path compared with the verified path
Helper output on the host Unbounded 32 MiB cap per stream: command_output_limit for a one-shot call, android_snapshot_helper_session_response_too_large for a session
Text over 64K chars Serialized in full Helper keeps a prefix and marks text-clipped. get text and is text refuse with text_clipped. Fill verification accepts a clipped node only when it is the prefix of a longer expected value

Validation

  • Head 2ff26e8. Prod delta vs 0.22: about +240 / -170 lines.
  • Affected Android, selector and helper test files pass; hosted CI green.
  • Reverting each change failed the tests that pin it.
  • No device runs. The Java test was not run locally.
  • Known gap: before Android 8.0, a same-path reinstall is not detected by warm admission.

@thymikee

thymikee commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

Fixed the clipped-prefix assertion blocker in 6ebda4e7a56de3504a3ab5fdecdc4bb86d9ce0fd.

Regression proof on source head 93ee459615b3e22ab35b67d8d7500b1fe50dc082 plus the new test patch: pnpm exec vitest run --project unit-core packages/command-runtime/src/commands/interaction/runtime/selector-is.test.ts reported 2 failed / 18 passed, both failures Missing expected rejection: the normal device.selectors.is entrypoint accepted a 65,536-quote clipped prefix under local and restricted policies.

At exact head 6ebda4e7a56de3504a3ab5fdecdc4bb86d9ce0fd, this command passed 67 tests / 3 files:

pnpm exec vitest run --project unit-core packages/command-runtime/src/commands/interaction/runtime/selector-is.test.ts packages/daemon/src/execution/__tests__/selector-text-runtime.test.ts packages/platform-android/src/__tests__/text-input-fill.test.ts

The shared contracts admission now rejects incomplete assertion evidence with existing typed reason android_text_clipped, and get fallback/fill verification use the same completeness rule. Complete live get reads remain supported. Selector matching, exists/editable checks and unrelated absence remain unchanged. Versioned help and user docs describe the refusal.

No local broad gates, device runs, remote transport tests or CI waits. Cold self-review completed; independent review and broad CI remain pending. #5245 untouched.

@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.29 MB 5.29 MB +272 B
Package (unpacked) 5.28 MB 5.29 MB +272 B
Package (download) 1.62 MB 1.62 MB +335 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 17.1 ms 16.7 ms -0.5 ms
CLI --help 29.4 ms 27.7 ms -1.7 ms

Affected plugins

Plugin Installed (including dependencies) Unpacked Download
@agent-device/aws-device-farm 133.2 kB → 133.2 kB (0 B) 132.8 kB → 132.8 kB (0 B) 40.6 kB → 40.6 kB (+2 B)
@agent-device/browserstack 139.7 kB → 139.7 kB (0 B) 139.2 kB → 139.2 kB (0 B) 42.3 kB → 42.3 kB (+1 B)
@agent-device/harmonyos 370.0 kB → 370.2 kB (+115 B) 369.6 kB → 369.7 kB (+115 B) 106.2 kB → 106.3 kB (+36 B)
@agent-device/limrun 3.08 MB → 3.08 MB (0 B) 430.6 kB → 430.6 kB (0 B) 128.2 kB → 128.2 kB (0 B)
@agent-device/linux 298.9 kB → 299.1 kB (+115 B) 298.5 kB → 298.6 kB (+115 B) 84.7 kB → 84.8 kB (+47 B)
@agent-device/macos 226.1 kB → 226.3 kB (+115 B) 225.7 kB → 225.8 kB (+115 B) 64.4 kB → 64.4 kB (+51 B)
@agent-device/maestro 896.5 kB → 896.5 kB (+36 B) 896.0 kB → 896.1 kB (+36 B) 278.2 kB → 278.2 kB (+15 B)
@agent-device/replay 72.6 kB → 72.6 kB (0 B) 72.1 kB → 72.1 kB (0 B) 23.8 kB → 23.8 kB (-3 B)
@agent-device/revyl 187.1 kB → 187.1 kB (0 B) 186.7 kB → 186.7 kB (0 B) 60.5 kB → 60.5 kB (-2 B)
@agent-device/testmu 139.2 kB → 139.2 kB (0 B) 138.8 kB → 138.8 kB (0 B) 42.8 kB → 42.8 kB (0 B)
@agent-device/tizen 100.8 kB → 100.8 kB (0 B) 100.4 kB → 100.4 kB (0 B) 35.3 kB → 35.3 kB (0 B)
@agent-device/vega 262.9 kB → 263.0 kB (+115 B) 262.5 kB → 262.6 kB (+115 B) 73.8 kB → 73.8 kB (+38 B)
@agent-device/web 94.0 kB → 94.0 kB (0 B) 93.6 kB → 93.6 kB (0 B) 30.8 kB → 30.8 kB (-2 B)
@agent-device/webos 99.6 kB → 99.6 kB (0 B) 99.2 kB → 99.2 kB (0 B) 35.0 kB → 35.0 kB (-1 B)

@blacksmith-sh

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@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 d9abb91. The verdict and the full list are in the summary comment.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

At 8546af3 the code review found one problem that must be fixed before merge: the device-facing changes have no live run. All 18 checks are green at this head, and no conflicts are known.

The helper XML budget and clip marker, the snapshot and touch admission that now pulls and hashes the installed APK, and the newer-version refusal have no live run at this head (https://github.com/callstack/agent-device/blob/8546af3/android/snapshot-helper/src/main/java/com/callstack/agentdevice/snapshothelper/AccessibilityTreeXml.java#L32). The PR body says no device work ran, and the #5245 emulator evidence belongs to a different commit and a different admission design. So the helper Java and the adb pull of base.apk per command are only proven against fakes. Please run this on an Android emulator at this head: (1) with a TextView or EditText over 393,216 chars, snapshot --json must show the node with textClipped:true and no truncated, get text @eN --json must fail with COMMAND_FAILED reason android_text_clipped, and is text 'id=...' <prefix> must fail with android_text_clipped; (2) replace the installed helper with a same-versionCode build of different bytes, and the next snapshot --json --debug must show android_snapshot_helper_install_decision with reason mismatched and installed: true, and the capture must succeed; (3) install a higher-versionCode helper, and both snapshot and press must fail with android_helper_newer_untrusted; (4) report the android_snapshot_helper_install timer for two warm snapshots, so the added per-command cost is known.

Not blocking, and these can be taken or left: warm admission now runs cmd package list, pm path, and an adb pull plus hash of base.apk on every capture attempt and every gesture or automation command, where base did one version shell on a cache hit (snapshot-helper-install.ts:107); setAndroidLocale admits the helper and then pulls and hashes the same APK again in readVerifiedHelperApkPath (settings-locale.ts:40); an installed helper with a higher versionCode throws android_helper_newer_untrusted with no hint and no repair, and the snapshot route also force-stops the helper runtime (helper-package-install.ts:138); the host-side byte limit applies only to the session socket, so one-shot am instrument chunks, the touch helper one-shot and SystemLocaleCommand reads have no maxBuffer although adb-transport.ts:54 accepts one (snapshot-helper-capture.ts:270); the get-text refusal lives in the daemon backend while the shared readText still returns extractReadableText(node) when a backend has no readText or returns blank text (selector-read-shared.ts:141); and the docs say truncated means the node or total XML budget, but a single non-text attribute over 64 Ki chars also sets it (website/docs/docs/snapshots.md:222).

Could the verified base APK path be memoized per device, since the install directory is unique per install on API 26+, so warm admission runs only pm path and pulls and hashes only when the path changes? Admission could return that path so settings-locale stops re-pulling, the get refusal could live in selector-read-shared.readText as its one owner, and a newer helper could be repaired by uninstall and reinstall under missing-or-outdated instead of refused.

The inline thread at #5339 (comment) does not apply and can be resolved: the get-attrs refusal does not occur because selector-read.ts returns attrs before readText, and a regression test was added.

Not verified here: tests or a device (Java unit tests and TS suites are trusted from green CI), helper APK size and remote-transport pull latency, the kernel-error scope 601->600 claim, and host handling of an omitted class attribute now that Java omits an empty class instead of emitting class="". The live emulator run above is required before merge. After it, the per-command APK pull cost needs a decision.

@thymikee
thymikee force-pushed the t3/android-daybreak-output-identity branch from 8546af3 to bfb8eb5 Compare December 3, 2026 07:55
@thymikee
thymikee removed this pull request from stack #5345 December 3, 2026 07:57
@blacksmith-sh

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@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: 8 new findings on bfb8eb5. The verdict and the full list are in the summary comment.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Commit bfb8eb5 still has a gap in live evidence, and CI is red. The earlier findings at 8546af3 (#5339 (comment)) are only partly closed.

The CI failures look related to this PR. Lint, Typecheck & Package, Numeric Ranges and Integration Tests fail on TS2353 at packages/platform-android/src/snapshot-helper-capture.ts:111, because maxBuffer is not in AndroidAdbExecutorOptions. The same cause gives TS2339 at snapshot-helper.test.ts:679. Coverage fails in scripts/tests/eager-closure-budgets.test.ts: many facades now evaluate more modules than at the merge-base. The likely shared cause is that selectors/src/internal/predicates.ts now value-imports AppError and INTERACTION_ERROR_REASONS from @agent-device/kernel/errors. Please declare maxBuffer on the executor options type, or route it through the option the transport already forwards. Please also keep predicates.ts inside its existing closure, for example by throwing from the command-runtime callers.

The open blocker from 8546af3 is not closed: https://github.com/callstack/agent-device/blob/bfb8eb5/android/snapshot-helper/src/main/java/com/callstack/agentdevice/snapshothelper/AccessibilityTreeXml.java#L219. The helper text clip, the text_clipped refusals, the pm path warm admission, same-version repair and the new newer-helper uninstall/reinstall repair have no live run at this head. The PR body says no device runs were done. The rebuild changed the design the earlier ask named: a newer helper is now repaired, the reason is text_clipped, and the clip is 65,536 chars. So the evidence must come from this head. Required before merge, on an Android emulator at bfb8eb5: (1) a TextView or EditText with more than 65,536 chars must show textClipped:true and a 65,536-char label in snapshot --json, get text @eN --json must fail with COMMAND_FAILED reason text_clipped, and is text 'id=...' <prefix> must report text_clipped; (2) after replacing the installed helper with a same-versionCode build of different bytes, the next snapshot --json --debug must show android_snapshot_helper_install_decision with reason mismatched and installed true, and capture must succeed; (3) after installing a higher-versionCode helper, the next snapshot --json --debug must show reason newer and installed true, capture must succeed, and a following press must succeed; (4) for two warm snapshots, please report the android_snapshot_helper_install timer and confirm that the only admission device call is pm path.

The open inline threads still stand: #5339 (comment) (maxBuffer type error). Five lower-priority threads still apply. Two threads do not apply, so please resolve them: #5339 (comment) (replacing base.apk in place needs root outside the package manager, and every package-manager install on API 26+ changes the pm path) and #5339 (comment) (get attrs returns before readText, so attrs reads never hit the refusal).

Not verified here: remote and provider adb executors forwarding maxBuffer once it is declared. Not verified here: the Java and TypeScript test suites, which were not run. Not verified here: the eager-closure attribution to the predicates.ts imports, which is inferred from the failing test names and the diff. Mixed-version CLIs sharing one device now uninstall each other's helper instead of accepting a newer one; this follows the intended trust rule and was not traced further.

No conflicts are known. Before merge, fix the maxBuffer type error and the eager-closure growth so CI is green, then post the emulator evidence at the new head.

@apex-sentinel-staging

This comment has been minimized.

@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: 2 findings moved to a new line on 68c91bc. The verdict and the full list are in the summary comment.

- A newer installed helper versionCode is not the trusted artifact; the install
  step uninstalls it and installs the bundled APK. Warm admission compares the
  memoized verified base APK path with one pm path read instead of re-hashing.
- The host caps helper output at 32 MiB on the session socket and passes the
  same cap as maxBuffer to one-shot helper captures.
- The helper clips text past 64K chars and marks text-clipped; is text, get
  text, and fill verification refuse a clipped value with reason text_clipped.
… versions on all API levels

- maxBuffer is an AndroidAdbExecutorOptions field, so the snapshot helper cap reaches runCmd.
- The installed helper versionCode comes from dumpsys package, which Android 6.0+ answers;
  pm list packages --show-versioncode is absent before 8.0, so a newer helper read as missing.
- The clipped-text refusal moves to command-runtime, keeping the selectors eager closure.
@thymikee
thymikee force-pushed the t3/android-daybreak-output-identity branch from 68c91bc to 1b905cd Compare December 3, 2026 09:12
@apex-sentinel-staging

This comment has been minimized.

@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: 2 findings moved to a new line on 1b905cd. The verdict and the full list are in the summary comment.

@apex-sentinel-staging

This comment has been minimized.

@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 743cc47. The verdict and the full list are in the summary comment.

@thymikee
thymikee marked this pull request as ready for review December 3, 2026 10:31

@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.

2 issues found across 59 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/platform-android/src/__tests__/snapshot-helper-session.fixtures.ts">

<violation number="1" location="packages/platform-android/src/__tests__/snapshot-helper-session.fixtures.ts:32">
P3: The hardcoded `versionCode=13003` duplicates the fixture artifact's manifest version. Build the probe stdout from `ANDROID_SNAPSHOT_HELPER_FIXTURE_ARTIFACT.manifest.versionCode` so the 'current' state cannot drift from the artifact the tests install.</violation>
</file>

<file name="packages/platform-android/src/snapshot-helper-install.ts">

<violation number="1" location="packages/platform-android/src/snapshot-helper-install.ts:133">
P3: This stores a verified path without evicting older keys for the same device and package, so the process-global map grows with each artifact upgrade. Evict sibling keys for that device/package before storing the new path.</violation>
</file>

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

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

@blacksmith-sh

This comment has been minimized.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

The code findings from the earlier review (#5339 (comment)) are fixed at fb33027, and one finding remains: the device-facing paths have no live run. The helper now verifies installed bytes, the newer-helper case reinstalls with uninstallFirst, the probes take timeoutMs, and the clipped-prefix fill check skips a showing hint.

The device-facing changes in snapshot-helper-install.ts:93 still have no live run, and the PR body says "No device runs". This covers the text clip in AccessibilityTreeXml.java, the text_clipped refusals, the dumpsys versionCode probe, mismatched and newer repair, warm pm path admission, and the clipped-prefix fill acceptance. A dumpsys shape that the regex misses would reinstall the helper on every cold admission, and a broken clip would leave long fields unreadable. Please post emulator output at fb33027 or later that shows four things. First, a TextView or EditText with more than 65,536 chars gives textClipped:true and a 65,536-char label in snapshot --json, get text @eN --json fails with COMMAND_FAILED reason text_clipped, is text 'id=...' <prefix> reports text_clipped, and fill of a 70,000-char value into an EditText succeeds. Second, after replacing the helper with a same-versionCode build of different bytes, the next snapshot --json --debug shows android_snapshot_helper_install_decision with reason mismatched and installed: true, and capture succeeds. Third, after installing a higher-versionCode helper, the next snapshot --json --debug shows reason newer and installed: true, capture succeeds, and a following press succeeds. Fourth, two warm snapshots report the android_snapshot_helper_install timer, and the only admission device call is pm path.

None of the earlier inline threads still apply, and no high-priority thread or lower-priority thread is left open. These can be resolved: #5339 (comment) (maxBuffer typed, fixed), #5339 (comment) (cap reaches command_output_limit, fixed), #5339 (comment) (same-path replacement needs root, every pm install changes pm path), #5339 (comment) (shared fixture used, fixed), #5339 (comment) (a missing memo costs one re-verify), #5339 (comment) (failure returns null text, fixed), #5339 (comment) (prefix not echoed, fixed), #5339 (comment) (one extra checksum, invariant holds), #5339 (comment) (local fixture copies deleted), #5339 (comment) (prefix acceptance and test added), #5339 (comment) (PR body names both overflow codes), #5339 (comment) (text nulled in actualInput, fixed), #5339 (comment) (uninstallFirst for newer, fixed), #5339 (comment) (per-stream cap keeps the buffer finite), #5339 (comment) (timeoutMs threaded, fixed), #5339 (comment) (hintShowing guard added), #5339 (comment) (surrogate test added), #5339 (comment) (docs name find ... get_text, fixed), #5339 (comment) (test asserts the dumpsys command), #5339 (comment) (test renamed), #5339 (comment) (helper doc updated), #5339 (comment) (test-only constant, drift fails loudly), #5339 (comment) (memo bounded in practice).

CI is pending at fb33027. Coverage and one other check are still running with no failure, and all other checks pass, including Repo Guards after the error-reasons sync. Coverage passed at 743cc47 on the same base, and the later changes add no imports to an eager facade. No conflicts are known.

Not verified here: the Java test suite (the surrogate case) and the TypeScript tests were not run. The dumpsys package output shape was checked only against hand-written fixtures, not a real device. Remote and provider adb executors forwarding maxBuffer were not re-traced at this head. The clipped-prefix fill check verifies only the first ~64K chars, so a field that truncates a longer value to between 65,537 and expected-1 chars would pass where full-text comparison would fail. Is that acceptable?

Before merge, the emulator run above at fb33027 or later is required.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Emulator run at fb33027

  • Device: emulator-5554, Pixel_7_CI AVD, Android 16.
  • CLI: this branch's node bin/agent-device.mjs, run after pnpm build. Every command used --platform android --serial emulator-5554 --session live5339 --state-dir <scratch>. Below, ad stands for that command.
  • Helper: built from this branch with pnpm package:android-snapshot-helper:npm. The artifact is 0.22.0-dev, versionCode 22000, sha256 2b529b4e…8fd2.
  • App: com.callstack.agentdevicelab, an Expo dev-client launcher. Its URL EditText is the long-text target.
  • Test helper builds: made with scripts/build-android-helper.sh into scratch. Nothing was committed.
    • 0.22.0-dev: same versionCode 22000, different bytes (sha ef910123…6948).
    • 0.23.0: versionCode 23000.
  • Device calls (checks 3 and 4): recorded by an argv-logging adb shim. The shim sits in a scratch ANDROID_HOME/platform-tools and calls the real adb. The daemon was restarted under the shim before these checks.
  • adb outside the CLI: used only to install the test helper builds.

1. Text clip, text_clipped refusals, clipped-prefix fill: PASS

$ ad open com.callstack.agentdevicelab --relaunch
$ ad fill @e5 "<'x' * 70000>" --json        # exit 0, ~1.4 s
  "success": true, "message": "Filled 70000 chars", "ref": "e5"

$ ad snapshot --json
  androidSnapshot: backend=android-helper helperVersion=0.22.0-dev installReason=current
  {"type":"android.widget.EditText","label":<65536 chars>,"value":<65536 chars>,
   "textClipped":true,"editable":true,"hintShowing":false,
   "selectionStart":70000,"selectionEnd":70000,"ref":"e155","kind":"text-field"}

$ ad get text @e155 --json                   # success:false
  "code": "COMMAND_FAILED", "message": "The element text is clipped, so its full value is unknown",
  "details": { "reason": "text_clipped", "dispatched": "no" }

$ ad is text 'role="edittext" editable=true' xxxxxxxxxx --json   # success:false, exit 1
  "code": "COMMAND_FAILED", "details": { "reason": "text_clipped", "dispatched": "no" }

selectionStart: 70000 shows that the field holds the full 70,000-char value. Only the label is clipped, at 65,536 chars.
The node has no resource id, so is text used the role selector that fill reported in selectorChain.

2. Same versionCode, different bytes: PASS (reason mismatched, installed: true)

$ adb -s emulator-5554 install -r same/agent-device-android-snapshot-helper-0.22.0-dev.apk   # sha ef910123…
$ ad snapshot --json --debug                 # exit 0
  android_snapshot_helper_install  durationMs=135
  android_snapshot_helper_install_decision {"versionCode":22000,"installedVersionCode":22000,
    "artifactSha256":"2b529b4e…8fd2","installedSha256":"ef910123…6948","installed":true,"reason":"mismatched"}
  android_snapshot_helper_session_exited {"instrumentation":{"shortMsg":"Process crashed."}}   # old session died when its package was replaced
  android_snapshot_helper_session_acquisition {"outcome":"created"}
  androidSnapshot: installReason=mismatched helperSessionReused=false nodeCount=224
  snapshotQuality: healthy

3. Newer installed helper: PASS (reason newer, installed: true, uninstall then install, capture and press succeed)

$ adb -s emulator-5554 install -r newer/agent-device-android-snapshot-helper-0.23.0.apk
  dumpsys: versionCode=23000 versionName=0.23.0
$ ad snapshot --json --debug                 # exit 0
  android_snapshot_helper_install  durationMs=440
  android_snapshot_helper_install_decision {"versionCode":22000,"installedVersionCode":23000,
    "artifactSha256":"2b529b4e…8fd2","installed":true,"reason":"newer"}
  androidSnapshot: installReason=newer helperVersion=0.22.0-dev nodeCount=79, snapshotQuality: healthy
  adb calls (shim):
    shell pm path com.callstack.agentdevice.snapshothelper
    shell dumpsys package com.callstack.agentdevice.snapshothelper
    uninstall com.callstack.agentdevice.snapshothelper
    install -r …/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.22.0-dev.apk
    forward --remove …; shell am force-stop …; pidof …; forward …; shell am instrument … (new session)
  dumpsys after: versionCode=22000 versionName=0.22.0-dev

$ ad snapshot -i                             # refs for the press
$ ad press @e18 --json                       # success:true, "Tapped @e18 (886, 2260)"; the Settings tab opened (screenshot checked)

The dumpsys package regex read the real Android 16 output: installedVersionCode: 23000. The newer path ran uninstall before install -r.

4. Warm admission: PASS (timer present, the only admission call is pm path)

This ran after the daemon restart. The cold admission ran during open: dumpsys package, pm path, then pull of base.apk for the checksum. It gave reason: current. After that:

$ ad snapshot --json --debug   # warm 1, exit 0
  android_snapshot_helper_install  durationMs=54
  android_snapshot_helper_install_decision {"installed":false,"reason":"current", installedSha256 == artifactSha256}
  androidSnapshot: installReason=current helperSessionReused=true, healthy
  adb calls (shim): shell pm path com.callstack.agentdevice.snapshothelper

$ ad snapshot --json --debug   # warm 2, exit 0
  android_snapshot_helper_install  durationMs=54
  android_snapshot_helper_install_decision {"installed":false,"reason":"current"}
  androidSnapshot: installReason=current helperSessionReused=true, healthy
  adb calls (shim): shell pm path com.callstack.agentdevice.snapshothelper

Each warm snapshot made exactly one adb call, pm path, and no other.

Side notes (no action required for this PR)

  • press @e18 returned "refLabel": "Home" with selectorChain: ["role=\"view\""], but snapshot -i showed @e18 as [group] "Settings". The tap landed on Settings. Only the reported label is wrong.
  • In check 3, the press made three pm path calls, which is one warm admission per helper use in that command.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

The emulator run at fb33027 (#5339 (comment)) covers all four checks from the last review:

  1. A 70,000-char fill succeeds, snapshot --json reports textClipped:true with a 65,536-char label, and get text and is text both refuse with text_clipped.
  2. A same-versionCode helper with different bytes gives reason: mismatched, installed: true, and capture succeeds.
  3. A higher-versionCode helper gives reason: newer, runs uninstall before install -r, and capture and press both succeed. The dumpsys package regex reads the real Android 16 output.
  4. Two warm snapshots report the android_snapshot_helper_install timer, and the only admission device call is pm path.

The device-run finding is closed. The refLabel mismatch on press from the side notes is outside this PR's scope and does not block it.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Dec 3, 2026
@thymikee
thymikee added this pull request to stack #5360 December 3, 2026 11:33
@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Dec 3, 2026
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 8b0408d

Since the review of fb33027: 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 (64dd30eae755).

💬 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.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

The hung Coverage job from the earlier review (fb33027) is fixed at 8b0408d, and the code has no remaining problems. The change since then is test-only, so production code is identical and the emulator evidence already accepted on this PR (#5339 (comment)) still covers the behavior. CI is green: 18 checks, none failing, including Coverage and Integration Tests, with Proof skipped. No conflicts are known. Not verified here: the Coverage job was not run locally, and the import-cycle diagnosis rests on reading the import graph plus the green Coverage check at this head. The 24 review threads were resolved before the earlier review and none changed since, so they are not re-judged here. Maintainer review is the remaining step before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Dec 3, 2026
@thymikee
thymikee merged commit 622c154 into 0.22 Dec 3, 2026
18 checks passed
@thymikee
thymikee deleted the t3/android-daybreak-output-identity branch December 3, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant