Skip to content

fix(android): publish covered state from exact order evidence - #1981

Open
thymikee wants to merge 2 commits into
mainfrom
fix/android-occlusion-single-owner
Open

fix(android): publish covered state from exact order evidence#1981
thymikee wants to merge 2 commits into
mainfrom
fix/android-occlusion-single-owner

Conversation

@thymikee

@thymikee thymikee commented Aug 23, 2026

Copy link
Copy Markdown
Member

Summary

Centralize Android covered-state publication without guessing z-order.

  • Keep nodes in regular snapshots and make the daemon the sole owner of interactionBlocked: "covered" publication.
  • Carry API 24+ sibling drawing order through one private, non-serializable evidence sidecar. The evidence includes the original sibling group, so presentation wrapper collapse cannot compare unrelated nodes.
  • Fail conservative on API 23, where Android does not expose sibling drawing order, and retain androidSnapshot.occlusionScanUnavailable: true rather than claiming API-level neutrality.
  • Replace recursive and semantic-order heuristics with a bounded iterative classifier. Sparse overlays remain actionable, 5,000-node deep trees cannot overflow the stack, and exhausted evidence publishes no covered verdict.

This advances #1832 but does not close it: API 23 cannot provide the exact order needed for a reliable covered-state claim.

Validation

  • Planted red/green: sparse floating overlay was falsely classified as a replacement surface without exact order.
  • Planted red/green: presentation-reparented nodes from different source sibling groups were incorrectly compared.
  • Planted red/green: a 5,000-node deep capture overflowed the recursive footprint builder.
  • Focused contracts, Android capture, daemon publication, and classifier suite: 114 tests passed.
  • pnpm check:affected --run: all runnable checks passed, including format, lint, typecheck, layering, fallow complexity/dead-code audit, build, command-doc coverage, and 547 related test files / 4,446 tests.

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.37 MB 2.38 MB +812 B
JS gzip 797.9 kB 798.2 kB +316 B
npm tarball 919.3 kB 919.5 kB +248 B
npm unpacked 3.19 MB 3.19 MB +804 B

npm unpacked components

Component Base Current Diff
JS / dist source 2.52 MB 2.52 MB +804 B
Apple runner source/project 564.3 kB 564.3 kB 0 B
macOS helper source 54.5 kB 54.5 kB 0 B
Android helper artifacts 0 B 0 B 0 B
Other package files 44.5 kB 44.5 kB 0 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 29.3 ms 29.1 ms -0.2 ms
CLI --help 79.9 ms 79.8 ms -0.1 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/session-snapshot.js +2.4 kB +774 B
dist/src/snapshot.js -2.0 kB -601 B
dist/src/runtime.js +4 B +7 B
dist/src/session2.js +4 B +6 B
dist/src/internal/daemon.js 0 B +2 B

Top changed packed files

Packed file Base Current Diff
dist/src/session-snapshot.js 34.1 kB 36.6 kB +2.4 kB
dist/src/snapshot.js 31.3 kB 29.2 kB -2.0 kB
dist/src/snapshot-private-evidence.js 0 B 425 B +425 B
dist/src/snapshot-clickability.js 164 B 0 B -164 B
dist/src/snapshot-chrome.js 7.9 kB 8.0 kB +124 B
dist/src/sdk-selectors.d.ts 26.0 kB 26.0 kB -8 B
dist/src/android.js 16.7 kB 16.7 kB +4 B
dist/src/device-claim-conflict.js 87.8 kB 87.8 kB +4 B
dist/src/runtime.js 64.2 kB 64.2 kB +4 B
dist/src/session2.js 230.1 kB 230.1 kB +4 B

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstack.github.io/agent-device/pr-preview/pr-1981/

Built to branch gh-pages at 2026-08-23 17:27 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@thymikee thymikee changed the title fix(android): unify snapshot occlusion across API levels fix(android): publish covered state from exact order evidence Aug 23, 2026
@thymikee

Copy link
Copy Markdown
Member Author

Not ready at 91281d2c:

  1. The migration drops the old classifier’s multi-rect union semantics. android-replacement-surface-occlusion.ts reduces a covering subtree to one strongestPaint rect, whereas the prior owner measured the union of every paint rect. Two higher-order actionable descendants can collectively cover a stale surface >=90% while each alone covers <90%, leaving the stale action hittable. Restore bounded union coverage and add a planted regression for collective descendant coverage.
  2. Coverage is deterministically red: the test-file-size ratchet reports growth in src/platforms/android/__tests__/snapshot.test.ts (1495→1542) and src/daemon/handlers/__tests__/session-replay-divergence.test.ts (1215→1218). Move the new scoped evidence/publication case to a focused sibling test owner and avoid growing the replay aggregation.
  3. Before readiness, attach the Android native-a11y → snapshot: conform to the acquire/present engine contracts (sibling of #1797) #1832-required 33-screen true-positive corpus/consumer inventory and live Pixel evidence for this changed path. Current fixture evidence is insufficient for removing the platform pruner.

The private evidence route and size impact otherwise look sound.

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