Skip to content

test(native): assert failed-callee call identities and edge caps - #2888

Merged
morluto merged 5 commits into
morluto:mainfrom
IvenKooLab:fix/native-value-failed-attempts
Oct 21, 2026
Merged

morluto merged 5 commits into
morluto:mainfrom
IvenKooLab:fix/native-value-failed-attempts

Conversation

@IvenKooLab

@IvenKooLab IvenKooLab commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Strengthen the failed-callee regression so it verifies each call site's exact source and destination, including the two-edge prefix under max_edges=2. Three incorrect edges could previously satisfy the count-only assertion.

The original failed-selector traversal fix and the shared node-budget work are already present in upstream commit 55dd21a5e, which references #2888 and #2889. After syncing main, this PR's remaining diff is only the regression assertion update.

Problem and expected behavior

Review finding: checking only the call-edge count misses repeated source IDs or incorrect destinations. The test now requires bad-1 → 0x2000, bad-2 → 0x2000, and good → 0x3000, with fully qualified source IDs, and checks the exact first two relationships when the edge budget truncates output.

Change and scope

Reuse the existing regression fixture and production application traversal. Keep exact expected pairs in one local test value and assert both the complete and capped results. The existing retry-across-invocations, failure reason, function coverage, and truncation checks remain.

Routine test correction within existing static-analysis scope. No separate issue; the linked review finding is the concrete problem. No new provider or target capability; an advance maintainer scope decision is not applicable.

Contract and boundary impact

  • Semantic owner: regression assertions at the native application workflow boundary.
  • CLI/MCP/tool catalog: no production contract change.
  • Provider, bridge, format, or platform compatibility: no production change.
  • Evidence/provenance: tests protect exact call-site identity rather than only edge count.
  • Target selection, authority, upstream behavior, cleanup: simulated analysis ports only in the changed test; no added target interaction.
  • Generated metadata, package, or installation: none.

Expected effects of the final diff: execute local simulated regression tests only.

Evidence and regression coverage

A temporary mutation forced all three call edges to share bad-1 as their source, preserving the edge count. The strengthened assertion failed on the incorrect source pairs. The mutation was restored and is not committed.

After merging current main, the remaining diff is one test file, 21 insertions and one deletion. Original production fixes are already incorporated upstream; no further production refactor is needed for this assertion gap.

  • Observations, derived relationships, and unknowns remain distinct.
  • Artifact provenance and exact call-site relationships remain covered.
  • Failed attempts and incomplete outcomes remain visible.

Validation performed

Earlier local run with pinned Node 24.18.0/npm 11.16.0 and the locked dependencies available at that time:

  • npm run test:local -- src/application/native/NativeValueTrace.test.ts src/application/native/EnhancedNativeInvestigation.test.ts — 40 tests passed in that earlier local run.
  • npm run check — passed (typecheck, lint, format, knip, metadata, compile dependency, and architecture guards).
  • Test discovery, touched-file formatting, and git diff --check — passed.
  • Wrong-source mutation — rejected by the new assertion as expected; restored before commit.

Independent verification by CassieFox23 applied this patch to main 5b16f2431 and reported 42/42 tests passing across the same two files. Their wrong-source mutation also confirmed that the new assertion catches a case the old count check missed. These are independently reported results on the specified main snapshot; that run was not repeated during this update.

Compatibility, safety, and release

No runtime behavior, schema, migration, package metadata, or authority change. No real-provider or end-to-end CLI/MCP run was performed for this test-only follow-up. The earlier runtime performance measurements do not describe a new runtime change in the final diff.

Before merge

  • Concrete review finding linked; focused Conventional Commit title.
  • Scope and authority unchanged.
  • Complete and truncated call relationships covered.
  • Documentation and generated metadata unaffected by the final test-only diff.
  • Final diff checked for unrelated changes, secrets, and unsupported claims.

Author readiness

Human owner: @IvenKooLab

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@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-21T02:22:15.883489Z 0e4f2d2 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

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The test-only change appears safe to merge.

Summary

Strengthens the failed-callee regression without changing production code.

  • The native trace test checks exact call-site relationships.

Reviews (8) · Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." · Reviewed by Greptile

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open.

review thread

The regression checked only edge count, so wrong or repeated call-site pairs could pass. The existing public regression now asserts all three exact source/target pairs and the capped edge slice. Source inspection only; no tests ran.

@morluto
morluto force-pushed the fix/native-value-failed-attempts branch 2 times, most recently from 4b9a8ee to 7ef9981 Compare October 13, 2026 18:25
@morluto
morluto force-pushed the fix/native-value-failed-attempts branch from 7ef9981 to f558c24 Compare October 13, 2026 18:38
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working labels Oct 14, 2026
morluto added a commit that referenced this pull request Oct 14, 2026
Preserve XML and Interface Builder identity at their parsing boundary, retain usable Objective-C slots with precise coverage, and keep native trace failures distinct from absence. Add caller-selected Interface Builder summaries backed by complete retained Evidence, and preserve comparison limitations.

Reviewed fixes: #1969, #2088, #2108, #2513, #2639, #2684, #2731, #2759, #2875, #2888, #2889, #2970, #2971, #3002.

Validation: relevant native/domain focused lane passed 142 tests; earlier Interface Builder/MCP checks passed 24 tests. Real native UI and Ghidra producer coverage was not repeated.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@IvenKooLab IvenKooLab changed the title fix(native): attempt failed value trace selectors once per invocation test(native): assert failed-callee call identities and edge caps Oct 14, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@IvenKooLab

Copy link
Copy Markdown
Contributor Author

The previous head's CI failed in five JavaScript/Electron-domain test files (IdaNativeProtocol, electronWrappedCallPaths, javascriptSemanticAnalysis.native_bindings, javascriptSemanticAmbientWrites, JavaScriptSemanticGraphResources) that this PR's single-file test diff does not touch. Root cause: the earlier sync merge landed while those upstream changes were mid-flight; main has since completed them.

5a96fd8 syncs with current main. Execution evidence on the new head:

  • the five previously failing files: 98/98 passed locally
  • src/application/native/NativeValueTrace.test.ts (this PR's file): 13/13 passed
  • npx tsc --noEmit clean

The PR's remaining diff is unchanged: the failed-callee regression now asserts the exact three source/target pairs and the two-edge prefix under max_edges=2.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

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

@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: The new assertions pass on current main. They catch a bug that the old count check missed. With every call edge sharing one source, the old test passed and the new test failed.

I tested head 5a96fd8 on main 5b16f24. The patch (made from merge base cf6ea09) applied cleanly. The real CI on this PR ran 13 checks that passed and 19 that skipped, with no failures.

Results

Check Result
Both test files, PR on main 2 files passed, 42 tests passed (28 + 14), 0 failed
Same two files, plain main 2 files passed, 42 tests passed
Mutation on plain main (old test) the failed-callee test still passed
Mutation on main plus this PR the failed-callee test failed
  • The mutation sets the source of every call edge to 0x1000/bad-1. The edge count stays at 3. The old check counted edges, so it could not see this.
  • The new check compares source and target pairs. It failed with a "to deeply equal" error.
  • The mutation is blunt. It also broke three other tests in both trees. One checks repeated callees. One checks paging. One checks rejected callees. None is new.
  • The PR body says 40 tests. I saw 42 on main 5b16f24. I did not look into the gap.
  • I did not mutate the new capped-edge check on its own.
  • This PR changes only a test. There is no production bug to compare on main.

Not run

  • The 19 skipped CI checks, such as docs generation. I did not run them.
  • The full test suite. Some files in it run the doctor command, which reads agent files in the home folder.
  • Windows and macOS.

Thanks, IvenKooLab, for the work.

Commands
git -C ~/code/rea-mirror/rea.git fetch origin
git -C ~/code/rea-mirror/rea.git archive 5b16f2431062eea6ffd245a9e05512790007cb13 | tar -x -C /tmp/look-1015/main
git -C ~/code/rea-mirror/rea.git diff cf6ea09711 refs/pull/2888/head > /tmp/look-1015/patches/2888.patch
git -C /tmp/look-1015/t2888-after apply /tmp/look-1015/patches/2888.patch   # exit 0
npm ci   # Node 24.18.0, exit 0
npm run test:focused -- src/application/native/NativeValueTrace.test.ts src/application/native/EnhancedNativeInvestigation.test.ts   # exit 0
# mutation: in src/application/native/NativeValueTrace.ts, call edges get source: "0x1000/bad-1"
npm run test:focused -- src/application/native/NativeValueTrace.test.ts   # old test on main: exit 1, 3 other tests fail, failed-callee test passes
npm run test:focused -- src/application/native/NativeValueTrace.test.ts   # PR test: exit 1, the same 3 plus the failed-callee test fail
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: 24.18.0
  • Head: 5a96fd8
  • Base: 5b16f24
  • The box was shared with other test jobs. I give no timings.

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

@IvenKooLab

Copy link
Copy Markdown
Contributor Author

Thanks for rerunning this on 5b16f24 and checking the wrong-source mutation. The 40-test number in the body came from an earlier local run; I have labeled it accordingly and linked your independently reported 42/42 result separately. The PR branch is unchanged.

@morluto
morluto merged commit 7cdf8bc into morluto:main Oct 21, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants