Repository navigation
Conversation
Size Report
Startup median (7 runs, lower is better):
Affected plugins
|
21f48a5 to
32fd448
Compare
This comment has been minimized.
This comment has been minimized.
32fd448 to
59a0fcc
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 3 new findings on 59a0fcc. The verdict and the full list are in the summary comment.
This comment has been minimized.
This comment has been minimized.
be3fd48 to
3fa3614
Compare
1c9851b to
84ef5e7
Compare
84ef5e7 to
6449c02
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 2 new findings on e11d593. The verdict and the full list are in the summary comment.
|
The code at e11d593 needs changes before merge: warm calls got much more expensive, complete screens can be reported as truncated, and the keyboard helper still trusts the version alone. One clipped value marks the whole snapshot as truncated ( Each memo hit now reads the installed package again: the package list, The keyboard helper route still accepts a matching version code on a repeat ensure and reports the stored digest without reading the device bytes. A same-version APK signed with the exposed shared key and installed after the first ensure is reused as current. This gap was named on #5198 and deferred to the shared admission path, and the claim in this PR does not hold for this route. The rule: one admission owner checks version, digest and the newer-version refusal for both helpers, at snapshot session launch and at IME activation, with no device read on later hits. The other option is to limit the claim to the snapshot helper and file the IME path as the deferred follow-up. No live Android run is reported for these device-facing changes. At the fixed head, please run on an emulator and show: (1) two warm Could one admission state machine in Not blocking: these can be taken or left: return The per-capture probe thread still applies. Two threads can be resolved: this one, because the 32 MiB cap now covers the raw UTF-8 body, and this one, because escaped characters now count against the budget. The checks that are not passing look unrelated to this code: Not verified here: no tests, build or device run were performed; the Java change and its test were not compiled or run; APK size and remote pull latency were not measured, and the per-request cost was traced from code; not every complete-capture caller was traced beyond system dialog detection and the observation host; and it was not observed on a device whether a same-version replacement always kills the live instrumentation session, which the once-per-launch check relies on. Before merge, |
c378296 to
1cacb3a
Compare
|
Addressed the blocking points at
The ten PR commits were restacked onto #5244 at |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 1cacb3a. The verdict and the full list are in the summary comment.
|
At 1cacb3a, one problem still needs a fix before merge: a The 64 KiB per-attribute cap counts escaped characters, while A live emulator run at the fixed head is required before merge, because these device-facing changes have no reported emulator run at this head. Please show: (1) two warm Not blocking: the new docs sentence points to The 64K clip limit thread still applies, and so does one lower-priority thread. These threads can be resolved: this one, because a repeat keyboard activation now checks the digest and a same-version replacement test covers it; this one, because that path runs only at keyboard activation, so an unreadable The only check that is not passing is Not verified here: no tests, build or device run were performed, and the Java change and its test were not compiled or run. The fill failure was traced from code and not reproduced, and the smallest value that clips depends on how much of the text needs escaping. The spy on the module export in Before merge, every admitted fill value needs to serialize unclipped, or the verifier needs to see the clip, and then the live emulator run above needs to be provided. |
88af7a6 to
7e9c0c4
Compare
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
android/snapshot-helper/src/main/java/com/callstack/agentdevice/snapshothelper/AccessibilityTreeCapture.java:196 |
🆕 Window loop's <= reserve check lets one more window cross the 8 MiB document cap |
android/snapshot-helper/src/main/java/com/callstack/agentdevice/snapshothelper/AccessibilityTreeCapture.java:196 |
🆕 Character-budget break in the window loop skips windows without marking their roots missing |
packages/platform-android/src/__tests__/fill-verification.test.ts:148 |
🆕 1500 ms deadline test asserts the first fromTimeoutMs call, not the fill's own |
packages/platform-android/src/__tests__/fill-verification.test.ts:148 |
🆕 Deadline test asserts call[0] but production calls fromTimeoutMs before the probe |
packages/platform-android/src/fill-verification.ts:365 |
🆕 text_clipped verification still carries the captured prefix in actual |
packages/platform-android/src/fill-verification.ts:365 |
🆕 text_clipped failure reports actualLength of the clipped prefix |
1 finding below minor hidden (user_settings.min_severity).
Reviewed with this repository's own Sentinel configuration (7c6ef4a2ed46).
💬 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.
There was a problem hiding this comment.
Apex Sentinel: 6 new findings on 7e9c0c4. The verdict and the full list are in the summary comment.
- 🟡 Minor · Window loop's <= reserve check lets one more window cross the 8 MiB document cap ·
android/snapshot-helper/src/main/java/com/callstack/agentdevice/snapshothelper/AccessibilityTreeCapture.java:196 - 🟡 Minor · Character-budget break in the window loop skips windows without marking their roots missing ·
android/snapshot-helper/src/main/java/com/callstack/agentdevice/snapshothelper/AccessibilityTreeCapture.java:196 - 🟡 Minor · 1500 ms deadline test asserts the first fromTimeoutMs call, not the fill's own ·
packages/platform-android/src/__tests__/fill-verification.test.ts:148 - 🟡 Minor · Deadline test asserts call[0] but production calls fromTimeoutMs before the probe ·
packages/platform-android/src/__tests__/fill-verification.test.ts:148 - 🟡 Minor · text_clipped verification still carries the captured prefix in
actual·packages/platform-android/src/fill-verification.ts:365 - 🟡 Minor · text_clipped failure reports actualLength of the clipped prefix ·
packages/platform-android/src/fill-verification.ts:365
| for (int index = 0; index < windows.size(); index += 1) { | ||
| if (stats.nodeCount >= maxNodes) { | ||
| if (stats.nodeCount >= maxNodes | ||
| || AccessibilityTreeXml.remainingDocumentChars(xml) | ||
| <= AccessibilityTreeXml.NODE_SUFFIX_RESERVE_CHARS) { | ||
| stats.truncated = true; | ||
| break; | ||
| } |
There was a problem hiding this comment.
🆕 🟡 Minor · Window loop's <= reserve check lets one more window cross the 8 MiB document cap
A capture whose document ends with remainingDocumentChars(xml) == NODE_SUFFIX_RESERVE_CHARS + 1 (≈540,704 chars) passes the loop's <= guard, so the window lands past MAX_XML_CHARS at ~8 MiB + 540K chars. appendNode's guard is >= but the window path checks xml.length() + reserve >= maxXmlChars inside a fresh builder starting at 0, so it double-counts the reserve.
Suggested change
if (stats.nodeCount >= maxNodes
|| AccessibilityTreeXml.remainingDocumentChars(xml)
< AccessibilityTreeXml.NODE_SUFFIX_RESERVE_CHARS) {
Raised as major, posted as minor: no verification confirmed it.
Details
persona: senior-developer
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
| for (int index = 0; index < windows.size(); index += 1) { | ||
| if (stats.nodeCount >= maxNodes) { | ||
| if (stats.nodeCount >= maxNodes | ||
| || AccessibilityTreeXml.remainingDocumentChars(xml) | ||
| <= AccessibilityTreeXml.NODE_SUFFIX_RESERVE_CHARS) { | ||
| stats.truncated = true; | ||
| break; | ||
| } |
There was a problem hiding this comment.
🆕 🟡 Minor · Character-budget break in the window loop skips windows without marking their roots missing
When the XML character budget is consumed by an earlier window (e.g. IME), appendInteractiveWindowRoots breaks out of the window loop before later windows are listed, so missingRootWindowTypes.add(...) and stats.activeWindowRootMissing |= activeWindow never execute for them. The result has truncated=true yet isComplete() returns true, and AccessibilityCaptureStabilizer accepts the partial tree without attempting an active-window fallback. Record skipped windows as missing roots (or clear completeness flags) when the loop breaks on the character budget.
Details
persona: jvm
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
| assert.equal(verification.ok, false); | ||
| assert.equal(verification.reason, 'text_mismatch'); | ||
| assert.equal(verification.actual, `Key echo ${session.captureCount()}`); | ||
| assert.ok( | ||
| elapsedMs >= 1_500 && elapsedMs < 1_650, | ||
| `sampled until the deadline, took ${elapsedMs} ms`, | ||
| ); | ||
| assert.ok(session.captureCount() >= 10, 'verification polls through the full sample budget'); | ||
| }); | ||
|
|
||
| test('default verification uses a 1500 ms deadline', async () => { | ||
| const session = createFillHelperSession({ | ||
| textForCapture: (captureIndex) => `Key echo ${captureIndex}`, | ||
| }); | ||
| const fromTimeout = vi.spyOn(Deadline, 'fromTimeoutMs'); | ||
| try { | ||
| await underFakeTimers(async () => { | ||
| await withFillHelperProvider( | ||
| session.provider, | ||
| async () => | ||
| await verifyAndroidFilledText(device, 10, 10, 'chips', { | ||
| helperSessionScope: 'daemon-session', | ||
| }), | ||
| ); | ||
| }); | ||
| assert.equal(fromTimeout.mock.calls[0]?.[0], 1500); | ||
| } finally { | ||
| fromTimeout.mockRestore(); | ||
| } |
There was a problem hiding this comment.
🆕 🟡 Minor · 1500 ms deadline test asserts the first fromTimeoutMs call, not the fill's own
The assertion fromTimeoutMs.mock.calls[0]?.[0] === 1500 passes on the first call made by anything in the process, not the fill verification's own. Other production paths in the same call chain (the helper capture/session or the pre-action read) also call Deadline.fromTimeoutMs, so calls[0] can be an unrelated deadline. Assert the fill's own budget instead, e.g. by expecting a call with 1500 (fromTimeoutMs.mock.calls.some(([ms]) => ms === 1500)) or by injecting the clock and asserting the sampled count as the sibling test already does.
Details
persona: jvm
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
| assert.equal(verification.ok, false); | ||
| assert.equal(verification.reason, 'text_mismatch'); | ||
| assert.equal(verification.actual, `Key echo ${session.captureCount()}`); | ||
| assert.ok( | ||
| elapsedMs >= 1_500 && elapsedMs < 1_650, | ||
| `sampled until the deadline, took ${elapsedMs} ms`, | ||
| ); | ||
| assert.ok(session.captureCount() >= 10, 'verification polls through the full sample budget'); | ||
| }); | ||
|
|
||
| test('default verification uses a 1500 ms deadline', async () => { | ||
| const session = createFillHelperSession({ | ||
| textForCapture: (captureIndex) => `Key echo ${captureIndex}`, | ||
| }); | ||
| const fromTimeout = vi.spyOn(Deadline, 'fromTimeoutMs'); | ||
| try { | ||
| await underFakeTimers(async () => { | ||
| await withFillHelperProvider( | ||
| session.provider, | ||
| async () => | ||
| await verifyAndroidFilledText(device, 10, 10, 'chips', { | ||
| helperSessionScope: 'daemon-session', | ||
| }), | ||
| ); | ||
| }); | ||
| assert.equal(fromTimeout.mock.calls[0]?.[0], 1500); | ||
| } finally { | ||
| fromTimeout.mockRestore(); | ||
| } |
There was a problem hiding this comment.
🆕 🟡 Minor · Deadline test asserts call[0] but production calls fromTimeoutMs before the probe
The default verification uses a 1500 ms deadline test asserts fromTimeout.mock.calls[0]?.[0] === 1500, but verifyAndroidFilledText calls Deadline.fromTimeoutMs(FILL_VERIFICATION_DEADLINE_MS) before the spy exists, so under isolation that preserves that call (e.g. --pool=threads) calls[0] is [Infinity]. Assert mock.calls.some(([ms]) => ms === 1500) or spy before the call instead.
Details
persona: senior-developer
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
| if (inspection.actualInput?.textClipped) { | ||
| return { | ||
| ok: false, | ||
| actual: inspection.actualInput.text, | ||
| reason: 'text_clipped', | ||
| targetInput: inspection.targetInput, | ||
| actualInput: inspection.actualInput, | ||
| }; | ||
| } |
There was a problem hiding this comment.
🆕 🟡 Minor · text_clipped verification still carries the captured prefix in actual
A clipped fill on an ordinary field sets actual: inspection.actualInput.text in the verification, and fill failure reporting prints that value directly. buildFillFailureDetails redacts that same prefix via sensitive = clipped || …, so the two paths disagree on whether the partial value is safe to expose. Either null actual on the text_clipped branch or document why the raw prefix is safe outside the diagnostics path.
Details
persona: maintainability
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
| if (inspection.actualInput?.textClipped) { | ||
| return { | ||
| ok: false, | ||
| actual: inspection.actualInput.text, | ||
| reason: 'text_clipped', | ||
| targetInput: inspection.targetInput, | ||
| actualInput: inspection.actualInput, | ||
| }; | ||
| } |
There was a problem hiding this comment.
🆕 🟡 Minor · text_clipped failure reports actualLength of the clipped prefix
A text_clipped failure reports actualLength as Array.from(verification.actual ?? '').length — the length of the clipped prefix, not the field's real value — so a caller comparing it against expectedLength can wrongly conclude the app truncated the input. buildFillFailureDetails masks the top-level actual/expected but leaves actualLength computed from the truncated string.
Suggested change
For reason 'text_clipped', omit actualLength or name it clippedPrefixLength so the number cannot be read as the field's value length.
Details
persona: senior-developer
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
Summary
Bound Android helper XML and response sizes. Keep complete trees distinct from clipped field text, and refuse fill or selector text success when only a prefix is available. Omit clipped non-text helper attributes so partial labels cannot appear complete.
This is the Android XML and fill layer of the Daybreak remediation stack. APK identity and warm-call timing are separate work.
Before / after
get textcould return a cached prefix after a live clipped read. After: it fails with typedandroid_text_clipped.Validation
7e9c0c4e67passed merge-tree. Hosted checks pending.At
88af7a669c, the focused fill verification test file passed (14 tests), including deadline polling. On an isolated Android emulator, a 460,020-character TextView produced a 393,216-character snapshot label. The savedsnapshot --jsonoutput, reduced to the relevant fields, shows:{"success":true,"data":{"truncated":false,"nodes":[{"ref":"e1","textClipped":true}]}}The same capture's
get text @e1 --jsonresponse returnedCOMMAND_FAILEDwithreason: android_text_clippedanddispatched: no. CI at88af7a669cpassed, including Body rules.