Repository navigation
fix!: qualify call paths by provider discovery - #8443
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
[Medium impact] The reviewed changes appear safe to merge; no new actionable issue was found. SummarySeparates reading provider-observed call edges from establishing call discovery.
The previous and current commits have different merge bases with the target, so this review covered the full PR diff. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
P[Provider observation] --> E[Observed call edges]
P --> D[Directional discovery facts]
E --> S[Search observed graph]
D --> Q[Qualify search result]
S --> Q
Q --> F[Keep found paths]
Q --> C{Missing goal and complete coverage?}
C -->|Yes| A[Report absent]
C -->|No| U[Report unknown]
D --> V[Qualify comparison and reconstruction]
Reviews (11) · Last reviewed commit: "Merge branch 'main' of https://github.co..." · Reviewed by Greptile |
trace_call_path and trace_native_values both use workflow revision 2. Value-trace absence stays specific to trace_native_values, and an unrevised operation still matches the default profile.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 367be83922
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
# Conflicts: # src/application/binary/AnalysisSnapshotCache.test.ts
Summary
Separate retrieval of the provider's observed call edges from discovery of applicable code. Related to #8362.
Problem and expected behavior
Kuna can label a reachable code address as data and return no outgoing edge. Its graph read can be complete even though call discovery is not. Previously
trace_call_pathandbuild_call_pathcould report that the goal was absent; a found path could also be described as shortest without saying which graph was searched.Change and scope
Kuna preserves the data-node classification as directional discovery information. Call-path workflows retain observed paths and report the graph-scoped outcome alongside discovery coverage. A negative result is unknown when discovery is unestablished. Function comparison reports differences between observed sets with discovery limitations; reconstruction verification treats a call or unchanged overall claim as unknown when static caller or callee discovery is incomplete or unreported, while preserving independently established non-call changes. Revised provider and workflow profiles distinguish the changed semantics. Existing historical Evidence remains unchanged.
Contract and boundary impact
search_scopedetails; negative statuses change where discovery was unestablished. Call comparison carries discovery limitations and reconstruction verification propagates them from source Evidence.Expected effects:
Ghidra's existing headless analysis scripts and Kuna were launched; the fixtures themselves were not executed.
Evidence and regression coverage
The previous release produced
not_reachedin both directions for a real Mach-O where Kuna classified the intermediate address as data; direct instruction inspection and Ghidra observed the missing static edge. A paired no-call fixture produced the same Kuna graph, so the graph cannot distinguish those cases alone. The new real Kuna MCP control reportsgoal_status: "unknown"andsearch_scope.observed_goal_status: "not_reached"in both directions; the direct observed path remainsreached.A second unchanged fixture produced a three-hop Kuna path and a two-hop Ghidra path. Both remain visible with discovery qualification. Boundary tests cover both directions, dossier reconstruction, full/compact MCP schema profiles, retained views and independent graph traversal. Reconstructed paths carry each expanded function’s explicit discovery reason inline; the data-node dossier regression uses controlled Evidence because Kuna refuses to analyze that data-classified node as a function. Real snapshot round-trip and import of old Evidence preserved the records and changed the active profile. A controlled public MCP comparison probe additionally exercised partial, absent, and explicitly complete discovery in full and compact profiles: observed call-set comparison remained unchanged, while verification returned unknown, unknown, and pass respectively. These synthetic comparison controls are distinct from the real-provider check: replaying retained Ghidra dossiers from the two controlled fixtures through target-free MCP showed an unchanged observed call-set comparison in both revisions; verification changed from pass at the parent commit to unknown with unreported discovery in the current revision, in both schema profiles. The analogous Kuna comparison and verification were unknown in both revisions. Both fixture hashes were unchanged. These observations do not establish runtime reachability or exhaustive provider discovery.
A same-session real Kuna compact MCP control at main
60c0cf977and this PR head followed the reported incoming call address throughaddress_name,xrefs, procedure lookup and path tracing. The path changed from an unqualified negative to an observed-graph negative with partial discovery while retaining the incoming edge. The valid-address procedure lookups still categorically label the unflagged section as data and suggest schema inspection; that separate classification and recovery issue remains open in #8352. Successful replies used the advertised schemas; error payloads were inspected, not separately schema-validated in this control. The unexecuted fixture hash was unchanged.Kuna 1.988 release control
At exact head
b7160bd7, real full-schema stdio MCP with Kuna 1.986 and 1.988 on the original two-hop and paired NOP fixtures returnedgoal_status: unknownand the observed-graphnot_reachedscope; the direct positive remained reached. In 1.986 the data-node discovery was partial; in 1.988 the omitted node left discovery unknown. The unrelated negative also became unknown. Target digests were unchanged, and targets were not executed. These are one-host controlled cases, not broad accuracy or agent-behavior measurements.A separate 1.988 snapshot saved on main was refused with
profile_mismatchon this head. Extracting its Evidence bundle into a file and importing it in a target-free session preserved the old negative record exactly; a fresh analysis returned unknown with a different profile. This was a manual JSON extraction, not a dedicated snapshot migration workflow. Snapshot and target bytes were unchanged.Ghidra path scope control
Real Ghidra 12.1.4, JDK 21, macOS arm64, full and compact advertised stdio MCP schemas: on base
53363166f, the original two-hop fixture returned reached and the paired NOP fixture returned not_reached. At exact PR headb7160bd7, the first stayed reached; the paired fixture became unknown whilesearch_scope.observed_goal_statusretained not_reached. A direct positive remained reached and an unrelated negative likewise became unknown. Both target hashes were unchanged and neither executable ran. This shows the user-visible cost of unknown provider discovery; it is not an agent-selection or broad correctness study.Ghidra computed-call reverse control
At
ef5a7e68, real Ghidra 12.1.4 stdio MCP on macOS arm64, in both compact and full profiles, analyzed the mutable-slot ELF from #8277. A backward search from the alternate target to the indirect caller returnedunknownwith observed-graphnot_reachedand discoveryunknown; the recorded-target backward positive stayedreached.procedure_callersstill reported complete coverage for the alternate target, so this path-level qualification does not resolve the provider's individual caller-coverage claim. On separate #8340 headb7e0b280, that backward path remainednot_reached; the forward computed-call path wasunknown. Successful outputs validated against advertised schemas. The unexecuted target SHA-25660152582c3d599b9a6923d7ac7138887b6e5ab9f40114735c88980429cfe70e5was unchanged. This is one fixture, not a combined-branch or broad provider-accuracy test.Current main integration
Merged main
d3ab0faf5and combined its cleanup-aware relationship reads with discovery aggregation. A stopped or unavailable read now leaves discovery unknown while retaining the original cleanup/cancellation outcome. New public MCP controls cover both traversal directions when a complete-discovery read is followed by an incomplete cleanup.At merge head
ef5a7e68b, real Kuna 1.988 on macOS arm64 through compact and full stdio MCP reported the unflagged-section two-hop fixture as unknown with observed-graphnot_reached; the direct positive remained reached. Advertised output schemas validated, and the target SHA-25659f969db3cc65c93ab6e412f85a60094437ee600e7e4aac73d9dd0d7e3164b04remained unchanged. The fixture was not executed.Focused call-path and cleanup MCP tests: 42 passed, including the two new directional cleanup controls.
npm run check:fastpassed after the merge; changed-file formatting andgit diff --checkpassed.Kuna 1.990 paired-path control on head
ef5a7e68b: real compact/full MCP returnedunknownwith observednot_reachedfor both the direct-call and NOP fixtures, while the direct positive remainedreached; an unrelated negative also becameunknown. Independent LLVM disassembly confirmed the differing instruction, and both targets remained unchanged. The baseline 1.990 branch returned definitenot_reachedfor both; see [Bug] Kuna call paths can report complete negative despite omitted direct calls #8362. This tests one controlled pair on macOS arm64 and does not recover the missing edge.Ghidra control on the rebuilt pair: real Ghidra 12.1.4 returned
reachedfor the call fixture andunknownwith observednot_reachedfor the NOP fixture in both MCP profiles. The direct positive stayed reached; unrelated negatives remained unknown. Target hashes stayed unchanged. This is one macOS arm64 pair, not proof of complete Ghidra discovery.Combined Kuna path recovery control: a disposable checkout combining fix!: qualify call paths by provider discovery #8443 head
ef5a7e68band fix(kuna): guide inventory selector recovery #8397 head65939bc4areturned discovery-qualifiedunknown, an inventory-specific assembly refusal, and a reached Ghidra path after explicit same-session provider selection. The original Kuna trace was retained exactly; successful responses validated against fetched compact/full MCP schemas. This is one real Kuna 1.990 / Ghidra 12.1.4 fixture on macOS arm64, not an automatic fallback or a merge of either PR. Details: [Bug] Kuna call paths can report complete negative despite omitted direct calls #8362.Validation performed
Hosted CI run 41363820022 on head
ef5a7e68bfailed: repository-wide formatting reported 16 files outside this PR diff, and process-boundary Frida verifier cleanup tests failed because their temporary fixture lackeddist/domain/fridaRemoteAddress.js. These failures were not reproduced or fixed in this PR; the hosted checks do not establish a green gate. Human author-readiness checks also remain unfilled.Focused Kuna boundary, call-path reconstruction, public MCP and JSON Schema parity tests: 114 passed before the main integration. A separate 91-test run covered snapshot profiles and retained views after the compact-schema correction.
Focused public MCP tests for call paths, directional coverage, reconstruction, retained views and unknown identity: passed after updating historical expectations. After the comparison and verification changes, 253 focused tests passed across 11 suites. The CI stdio acceptance control initially failed because its synthetic dossiers omitted discovery; after declaring complete discovery in that fixture, that control and its related MCP suite passed (26 tests). Public stdio MCP controls passed in both schema profiles. Real Ghidra and Kuna dossiers from the controlled fixtures were also replayed through target-free stdio servers at the parent and current commits in both profiles.
npm run check:fast— passed.npm run docs:check— passed, including 9 README consistency tests.Real Kuna 1.986 and Ghidra 12.1.4 stdio MCP controls — passed on the supplied static fixtures; fixture SHA-256 remained unchanged. Kuna control covered full and compact profiles. Historical Evidence import and new snapshot round-trip passed.
Compatibility, safety, and release
unknownwhen discovery was never established. A previously validtrace_call_pathorbuild_call_pathnegative can also now beunknownwhen discovery was never established; consumers can inspectsearch_scope.observed_goal_statusorsearch_scope.observed_statusfor the observed-graph outcome. Output schemas gain scope and discovery fields; clients caching strict old schemas must refresh them. Keeping the old unqualified negative would preserve the misleading result.Latest main integration
Merged main
c3647ade1at670d025e3.check:fast,docs:check, formatting, the previously failing provider-verifier cleanup suite (8 tests), and the affected domain, composition and MCP call-path suites (63 tests) passed locally. Real Kuna 1.990 and Ghidra 12.1.4 stdio MCP controls in compact and full output-schema profiles (default input profile) preserved the expected outcomes: the sampled Kuna negative wasunknownwith observednot_reached, the direct positive wasreached, and Ghidra found the sampled two-hop path; the unrelated negative remainedunknown. The unexecuted target SHA-256 stayed17a184835ff22f86c6398d96b699acdd2eb200ebb3d966d6fb5af7d0cebff4ed. Hosted checks are rerunning; this is one host and fixture, not evidence of complete discovery.Review follow-up and current validation
At head
95c8fc2aa5, merged mainf8bb792f15and corrected the discovery ownership gap: equal observed call sets previously lost their incomplete discovery qualification when producing unknown inputs and changed-behavior findings. The shared call-coverage owner now retains typed discovery status in comparison evidence. An incomplete or unreported discovery produces an unresolved call finding even when observed sets match, and remains unresolved alongside a separately observed change. Older evidence without this field remains unknown. Observed equality and differences are preserved; they do not establish exhaustive discovery.npm run check:fastpassed on this head; 107 focused domain and public MCP tests passed, including full and compact SDK-advertised output-schema validation with Ajv 2020. Mutation controls confirmed the public regressions fail when uncertainty propagation is removed.Facet availability follow-up
At
bd234dedfa(including mainac30fbd658), an unavailable or undeclared call facet still makes its observed comparison unknown, but the replacement result retains the independently recorded discovery status. Previously that replacement discarded the status and downstream findings incorrectly said discovery was unrecorded. Public MCP controls for complete and partial discovery with an unavailable facet passed, alongside the existing four coverage controls;check:fastpassed. The unrelated main formatting file now passes its targeted formatting check. Hosted checks are pending; real-provider controls were not rerun for this follow-up.Current main refresh
Head
4262983238merges mainc928bb8d80. The snapshot-cache test conflict preserved main's classified-reference non-replay control and this PR's revised call-path and trace workflow profile controls. Focused snapshot, call-path, comparison, discovery, changed-behavior and MCP tests passed (239 tests), including both advertised MCP schema profiles and reference-classification comparisons.npm run check:fastandgit diff --checkpassed. Hosted checks are pending; real-provider checks were not rerun on this head.Author readiness
Human owner:
Before merge
type(scope): outcome.Kuna 1.989 discovery control
On head
ef5a7e68b, real Kuna 1.989 and both compact and full stdio MCP profiles, the owned unflagged-section call fixture and paired NOP fixture both producedunknownwith observed-graphnot_reached; the direct positive remained reached and the unrelated negative became unknown. On the version-bump branch, both fixtures instead returned complete-lookingnot_reached. Independentllvm-objdumpshowed the call versus NOP; target hashes were unchanged and targets were not executed. Direct Kuna 1.989xrefs --fromnow distinguishes the exact source in these fixtures and reports decode coverage, but REA's graph path does not yet use that observation; see #8362. This one-host control establishes neither broad coverage nor a new edge-recovery implementation.