You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f83b9e6
Browse filesBrowse the repository at this point in the historyBrowse files
fix: rank divergence screen.refs within the cap so overlays are not buried
The #1264 root cause is cap burial, not capture scope: buildReplayDivergenceScreenRefs
sliced candidates in document order, so a fully-captured separate-window
overlay (volume dialog, QS shade, permission dialog) that enumerates after
the app window's ~77 nodes lands past position 20 and is truncated away —
the report shows a healthy-looking app under a covering overlay it cannot see
(archived evidence: screen.truncated: true, zero volume refs).
- Rank within the cap instead of document-order slicing: foreign-window
(non-app-bundleId) hittable nodes — the dismiss targets for whatever covers
the app — are promoted ahead of app content, otherwise stable (document
order preserved within each tier; equal-priority app nodes never reshuffled).
The 20-cap is a byte bound, not a first-20-in-tree-order policy.
- Occlusion fallback: when a system overlay mass-covers the app (every app
node annotated interactionBlocked: 'covered'), surface those covered nodes
rather than emitting an empty screen.refs — a report whose capture holds
meaningful nodes but whose refs is empty is broken by construction.
- repairHint/suggestions consume the full captured node list, not the capped
refs slice, so hint routing is unaffected; only screen.refs selection changes.
Detection keys off node.bundleId (Android-only, from the a11y package); iOS/macOS
leave per-node bundleId undefined, so ranking degrades to document order there
(safe — those platforms surface modals via the probe path, not by cap-competing).
Guarded on a known appBundleId so a sessionless capture never reorders.
Tests: replaces the small-fixture #1264 test (which the overlay fit inside the
cap regardless of order, so it did not prove the invariant) with a realistic
full fixture (24 app controls + overlay dismiss-target captured LAST) that
fails on document-order slicing and passes with ranking; plus occlusion tests
(mass-covered app -> overlay surfaces, refs non-empty; bare-scrim fallback ->
covered app nodes surfaced, refs non-empty). Both were verified to fail before
the fix. ADR-0012 decision 4 amendment reworded to cover ref-selection ranking
and the occlusion guarantee, not only capture scope.
Refs #1264
@@ -472,20 +472,17 @@ test('buildReplayFailureDivergence excludes Android status-bar/IME chrome from s
472
472
expect(screen.truncated).toBeUndefined();
473
473
});
474
474
475
-
// #1264 invariant: an agent must never see a healthier `screen` in a
476
-
// divergence report than a plain `snapshot` would show it. A separate-window
477
-
// system overlay (e.g. the volume dialog) that a full `snapshot` capture would
478
-
// include must also survive into divergence `screen.refs` — its actionable
479
-
// (hittable) content passing the meaningful-target filter — while ordinary
475
+
// #1264 coexistence (chrome filter + overlay, real walked fixture): a
476
+
// separate-window system overlay (volume dialog) that a full `snapshot` capture
477
+
// includes survives into divergence `screen.refs` — its actionable (hittable)
478
+
// content passing the meaningful-target filter — while ordinary
480
479
// status-bar/nav-bar/IME chrome in the SAME capture is still excluded. This
481
-
// extends the real (walked) Android fixture from the test above with a
482
-
// systemui overlay run using real, live-verified volume-dialog leaf ids
483
-
// (`volume_dialog_container`, `volume_new_ringer_active_icon_container`, see
484
-
// `core/__tests__/snapshot-chrome-android-statusbar.test.ts`), appended to the
485
-
// RAW array so the whole tree — app content, status bar, AND the overlay —
486
-
// goes through the real non-raw walk together, exactly as a single full
487
-
// capture would.
488
-
test('buildReplayFailureDivergence: a system-overlay window in the full capture survives into screen.refs while status/nav chrome is filtered (#1264)',async()=>{
480
+
// runs the real non-raw Android walk over app content + status bar + overlay
481
+
// together, proving the chrome filter and the overlay coexist. NOTE: this
482
+
// fixture is small enough that the overlay fits inside the 20-cap regardless of
483
+
// ordering, so it does NOT by itself prove cap-burial resistance — that is the
484
+
// dedicated realistic-tree test below.
485
+
test('buildReplayFailureDivergence: a system-overlay window survives into screen.refs while status/nav chrome is filtered (#1264)',async()=>{
test('buildReplayFailureDivergence: a fully-captured overlay dismiss-target enumerating LAST still lands within the screen.refs cap (#1264 cap burial)',async()=>{
test('buildReplayFailureDivergence: when a system overlay mass-covers the app, the overlay dismiss-target surfaces in screen.refs and refs is non-empty (#1264 occlusion)',async()=>{
// Bare overlay scrim: overlay-like `Dialog` type (covers the app) but no
764
+
// label, no identifier, non-hittable — not itself a meaningful candidate.
765
+
{
766
+
index: appButtons.length,
767
+
depth: 0,
768
+
type: 'android.app.Dialog',
769
+
bundleId: 'com.android.systemui',
770
+
rect: {x: 0,y: 0,width: 402,height: 874},
771
+
},
772
+
];
773
+
}
774
+
775
+
test('buildReplayFailureDivergence: a mass-covered app with no actionable overlay node still returns non-empty screen.refs (#1264 occlusion fallback)',async()=>{
0 commit comments