Repository navigation
feat(android): trace callers of external DEX methods - #8154
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The latest changes appear safe to merge; no new blocking issue was found. SummaryAdds caller tracing for exact external DEX methods, including observed prototypes, caller selectors and instruction coverage. The latest update compiles both Java regressions in one shared call.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
Q["Exact class and method"] --> D{"APK class exists?"}
D -->|Yes| A["Existing APK references"]
D -->|No| P["Bounded observed prototypes"]
P --> S["Select exact prototype"]
S --> C["Reserve complete caller identities"]
C --> I["Retain bounded invoke sites"]
A --> N["Normalize caller and instruction coverage"]
I --> N
N --> O["CLI and MCP Evidence"]
Reviews (3) · Last reviewed commit: "refactor(android): compile verifier regr..." · Reviewed by Greptile |
|
Investigated CodeQL at external-invokes.mjs:331: the executable was selected from operator JAVA_HOME, not APK data, using argument-array execution. It also duplicated compiler selection and a compiler launch already owned by metadata.mjs. Commit 5d7b4f5 compiles both Java regression programs in the existing validated compiler cohort, then the external verifier consumes those classes. No suppression or budget increase; rerunning the complete real Android lane and the current-head scans. |
Summary
Trace callers of an exact external DEX method through the existing
trace_android_referencesCLI/MCP operation. APK-defined queries keep their existing behavior. External results identify observed prototypes, direct invoke sites and follow-up caller selectors without inventing external class definitions or bodies.Absorbs #8096 by @xu91102; fixes #7811. The contributor branch does not allow maintainer edits. This integration integrates main
675d4076d, preserves its resource controls, and excludes unrelated Hopper/debugger cleanup and JavaScript worker-test changes.Implementation
direct_invokes_coveragein the shared normalization layer: complete/partial/unknown using-node counts and retained site count. This exposes bounded positions while preservingcoverage: completefor the complete using-node inventory. Historical omission stays unexamined.No APK execution, external classpath, reflection/JNI resolution, inherited lookup or runtime dispatch inference. No new provider, tool or dependency. Caller identity, DEX carrier, raw method ID, code-unit offset, opcode, target digest and retained raw Evidence remain available through both adapters. External class selectors use exact DEX spelling, including
$for nested classes. The operation still returns its complete bounded caller inventory; it does not add caller paging.Validation
Linux x64, Node 24.22.1/npm 11.16.0, existing OpenJDK 21.0.12.1:
check:fast,docs:check(9 consistency tests), formatting and diff checks passed.npm run verify:androidpassed with the checksum-pinned JAR and ApiDemos fixture, JVM heap 512 MiB and 2 processors. Covers actual compiled CLI/stdio MCP, single/multidex external calls, overloaded/nested caller source follow-up, 10,000-site + 10-short-caller truncation, oversized method/caller inventories, refusal/recovery, APK replacement, SIGTERM and awaited cleanup. 414.294 s elapsed / 552.218 CPU s. That initial RSS sampler tracked a session only, so its RSS is not claimed as complete process-family memory.18447bfb1e06d113edc88df93f471827280de06f6f3d4dc42f56f28b9c1bab79):NotificationManager.notify(int, Notification)returns exactly 6 callers / 7 sites acrossclasses.dexandclasses3.dex, matching independent AOSP dexdump 11 in caller identity, carrier, code-unit offset and opcode. Baseline main refuses the same query. APK bytes remained unchanged.Relevant
trace_android_references/inspect_android_methodinput definitions estimate 599 → 678 tokens; full definitions including output schemas estimate 9,386 → 9,731 tokens. Tool count is unchanged. These schema estimates are separate from the 4,938-token CLI result above; actual agent scaffolding/billing remains unmeasured.Latest-main refresh
083cfe9b0: 98 direct Android tests,check:fastanddocs:check(9 tests) passed again. Android production and real-verifier files are byte-identical to the real-engine-testedb382333f4; the intervening main change is test maintenance plus a CLI inventory empty-result guard. Runtime evidence above is reused only for those unchanged Android inputs.Follow-up
5d7b4f5b2removes the external verifier's duplicate JAVA_HOME/compiler selection and compiles both Java regressions in the existing metadata-owned cohort. The complete real lane passed again on this source: 400.379 s elapsed, 558.709 CPU s, 2.16 GiB sampled peak process-family RSS (corrected ancestry/start-time sampler), 512 MiB JVM heap / 2 processors. CodeQL and Greptile passed on this head; no suppression, budget increase or production behavior change was introduced by the verifier refactor.Current-head CI and automated review are tracked separately. Scope remains read-only static analysis; device/runtime behavior and other real host platforms were not locally verified.
Credit
Original implementation and conformance work: @xu91102, #8096. The integration retains the original commits and author identity. The position-coverage aggregate and removal of unrelated changes were added during maintainer-side integration.
Author readiness
Human owner: @gensokyo-dev
The user explicitly authorized this integration, ready-for-review publication and waiver of the human-declaration gate. Automation leaves the declarations unchecked rather than attesting that human review occurred.