Skip to content

fix(android): require explicit invoke coverage state - #2850

Closed
LcokHcak wants to merge 7 commits into
morluto:mainfrom
LcokHcak:codex/rea-android-invoke-coverage-json
Closed

LcokHcak wants to merge 7 commits into
morluto:mainfrom
LcokHcak:codex/rea-android-invoke-coverage-json

Conversation

@LcokHcak

@LcokHcak LcokHcak commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Require direct_invokes_exhaustive in the Android result schema while allowing null when coverage is unavailable.
  • Assert that unavailable and empty reference rows expose null in the boundary tests.
  • Reject upstream reference rows that claim exhaustive or partial invoke coverage without providing a direct_invokes site list. Keep valid true and false coverage values when the list is present.

The analyzer already serializes this field as reference.direct_invokes_exhaustive ?? null. Keeping the schema optional made the parsed output type include undefined, which is not a valid JsonValue and caused TS2322 in JadxAnalysis.ts after #2439 was merged.

Verification

  • npm run deps:check — passed after npm ci.
  • npx vitest run tests/boundary/android/JadxAnalysis.test.ts tests/boundary/android/jadxProtocol.test.ts — 16 tests passed.
  • npm run typecheck — passed.
  • Targeted oxlint and oxfmt --check on the changed files — passed.
  • npm run lint — blocked by src/dotnet/ManagedCilDecoding.test.ts:248 exceeding the max-lines-per-function limit, outside this patch. The latest main has a separate edit to that test.
  • The previous GitHub CI run also found Turkish README link drift, outside this PR's two Android files; the new commit will trigger fresh checks.

Follow-up to #2439; this commit was pushed to its source branch after #2439 had already merged, so it needs a separate PR.

@morluto
morluto marked this pull request as ready for review October 13, 2026 14:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T23:53:03.559903Z a1093d2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; no blocking issues were found.

Summary

This PR requires an explicit direct_invokes_exhaustive value in Android results and rejects bridge rows that claim coverage without an invoke list.

  • Android reference results require an explicit invoke coverage value.

Reviews (6) · Last reviewed commit: "fix(android): reject invoke coverage wit..." · Reviewed by Greptile

@greptile-apps

greptile-apps Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

@morluto morluto added area: runtime Process capture and runtime observation bug Something isn't working labels Oct 14, 2026
@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: The PR's tests pass on Node 22, 24 and 26. The new tests fail on the PR's base, so they catch the problem. Main already has one of the two source changes. Only the invoke-coverage check is still missing there. Thanks, LcokHcak, for the fix.

I tested head a1093d2. Its merge base is 97268f4 (#2704), and main was at 40f73f6 (#3735).

Results

I ran two test files each time. One is the PR's changed Jadx analysis file. The other is the Jadx protocol file, which the PR does not change but whose source it does.

Source under test Node Result
Merge base 97268f4, its own tests 24.18.0 12 passed
PR head a1093d2, its own tests 22.23.1 16 passed
PR head a1093d2, its own tests 24.18.0 16 passed
PR head a1093d2, its own tests 26.11.1 16 passed
Merge base source with the PR's tests 24.18.0 3 failed, 13 passed
Main 40f73f6, its own tests 24.18.0 17 passed
Main 40f73f6 with the PR's test changes merged in 24.18.0 2 failed, 18 passed
Same, plus the PR's JadxProtocol.ts 24.18.0 20 passed
  • The 3 failures on the base are new tests. One needs the explicit coverage field in the result. Two need a rejection when invoke coverage has no site list.
  • On main, only the 2 "rejects invoke coverage" tests fail. Main already has the result-schema change. Its androidAnalysis.ts file has no default on that field now. I read the file but did not diff it with the PR.
  • Main's JadxProtocol.ts is identical to the merge base copy. The PR's version of that file clears the 2 failures. Then all 20 tests pass.
  • npm run typecheck exits 0 on the PR head, on the merge base source and on main with the PR's changes applied. I could not reproduce the TS2322 error the PR body describes.
  • The PR body says npm run lint is blocked by another file. I did not run lint.

Not run

  • Any other test file, and the full suite.
  • npm run lint and deps:check.
  • Windows and macOS.
Commands
git -C ~/code/rea-mirror/rea.git fetch origin
git -C ~/code/rea-mirror/rea.git archive a1093d263b2afd85b5dfc8e73d5369a3b6ac7f93 | tar -x -C /tmp/fresh-1015/2850-head
npm ci && npm run build && npm run test:prepare   # Node 24.18.0, all exit 0
node scripts/run-development-tests.mjs focused \
  tests/boundary/android/JadxAnalysis.test.ts \
  tests/boundary/android/jadxProtocol.test.ts
# head: exit 0 on Node 22, 24 and 26 (16 passed)
# merge base source files swapped in: exit 1 (3 failed, 13 passed)
# base test files and base source: exit 0 (12 passed)
npm run typecheck   # head, base source, main with PR changes: each exit 0
git merge-file main.copy base.copy pr.copy   # JadxAnalysis.test.ts, exit 0
# fresh main tree (40f73f62b): own tests exit 0 (17 passed); merged tests exit 1 (2 failed);
# with the PR's JadxProtocol.ts copied in: exit 0 (20 passed)
Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • RAM: 32 GB DDR4-3600
  • Node: 22.23.1, 24.18.0, 26.11.1
  • Head: a1093d2
  • Base: 97268f4
  • Other: the box was shared with other test agents.

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

@morluto

morluto commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Thank you for tracking the invoke-coverage contract. Current main already requires the nullable direct_invokes_exhaustive result field and projects unavailable coverage as null, but the upstream JADX schema still accepts a coverage flag without a site list. Could you refresh and narrow this PR to the remaining protocol consistency check and its regression cases, preserving the distinction between unknown, partial, and exhaustive coverage? I am leaving it open for that work.

morluto pushed a commit that referenced this pull request Nov 18, 2026
The JADX bridge emits or removes direct_invokes and direct_invokes_exhaustive together. A protocol item carrying only the coverage flag reached trace_android_references as a reference that claimed true or false coverage over a null site list, while the coverage summary counted it as unknown. The protocol schema now rejects that combination.

Rebased onto current main from #2850. The companion change that removed the null default from the result schema already landed on main.

Co-authored-by: LcokHcak <[email protected]>
@morluto

morluto commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Closing as superseded by #10679. The bridge now rejects invoke coverage without a corresponding site list, and the result schema on main already requires an explicit coverage value. Thanks for the original fix, @LcokHcak.

@morluto morluto closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants