Repository navigation
fix(hopper): reconcile observed caller relationships - #7953
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. |
[Medium impact] The changes since the last review appear safe to merge; no new blocking issue was found. SummaryThe PR combines Hopper’s reverse caller results with forward observations so callers, incoming references, dossiers, and backward walks can recover missing relationships. Coverage remains unknown.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
Native[Native caller or reference reply] --> Reconcile[Reconcile observed relationships]
Pages[Bounded forward scan pages] --> Index[Workflow-owned reverse index]
Index --> Reconcile
Reconcile --> Results[Callers, incoming references, and dossiers]
Results --> Walks[Backward graphs and paths]
Reconcile --> Evidence[Retained source Evidence]
Pages --> Failure[Cancellation or page failure]
Failure --> Partial[Native reply and completed scan facts]
Finish[Workflow finishes] --> Clear[Clear temporary index]
Reviews (9) · Last reviewed commit: "test(hopper): throw typed scan failures ..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 057370657d
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Attach the native reply and collected forward facts when reconciliation fails or is cancelled, and check scan stop codes separately from their wording. Live observations keep REA evidence ids rather than provider supplied ones, and the real Hopper verifier uses advertised MCP schemas.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
The packaged Hopper stand-in echoed unknown bridge methods, so analyze_function rejected rea_caller_scan_target as an invalid scan target and the native package baseline returned unreadable_output.
Failure partials repeated each caller identity under every destination. The page budget counted compact replies, then schema parsing copied the expanded form. Identities are stored once and destinations cite addresses.
The environment schema hard-coded the 2000 ms scan default. The domain limit owner now names that millisecond budget and the schema reuses it.
compare_bundles reports each relative path as an invalid_format issue instead of one joined diagnostic sentence.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
inspect_dart_aot reports the ABI label as an issue on path abi. The message is the selector contract, without an abi: prefix.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
A missing document selector blocks snapshot replay. Backward call-graph and trace reads still keep the native result and forward observations, and the workflow Evidence links those records.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…-5438 # Conflicts: # tests/boundary/mcp/flutterMcp.test.ts
…-5438 # Conflicts: # src/domain/flutter/flutterBuildAnalysis.ts
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Caller and callee walks still stay in Evidence without a document. procedure_pseudo_code does not, so decompile_all leaves each body in the file-backed export instead of retaining the whole export in memory.
Scan facts stay in the domain. Environment recovery, including the time budget bounds and the fixed allowances with no runtime override, is appended from configuration. Setup forwards the budget, and the bridge uses one byte allowance for instructions, native callers, and pages.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Recovered call sites stay in the address form the scan already counted. Expanded identity copies are measured before allocation and refused when they exceed the retention budget. Instruction lists are not part of the retained reply.
Documentless caller and callee reads stay in the ledger for the session. Their evidence keeps call sites and drops instruction lists the scan already consumed.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
A page reference marked source_procedure "caller" belongs to that page item's caller. Saved sites record that address, and an owner missing from the callee inventory is stored once instead of copied onto every site.
Documentless caller evidence stores the adapter's raw result unchanged. The session no longer reads native_result.instructions.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Successful caller-scan results now throw the typed error instead of returning after an ok check. Expected failures assert structured tags, stop codes, and reported limits.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Upstream's caller reconciliation (morluto#7953) and this branch both added imports and tests to src/hopper/HopperProvider.test.ts; keep both import sets. Together the tests took the "Hopper provider capabilities" block to 172 lines, over the 150-line function limit, so the inspectTargetSupport refusal tests move into their own "Hopper provider target support" block, as the IDA tests do. Test bodies are unchanged.
Summary
Fixes #5438. Hopper can report a resolved tail call in a forward callee inventory while omitting it from callers and incoming references. Reconcile those observations so backward graphs and paths can recover the caller and exact call site, while keeping relationship coverage unknown.
Problem and expected behavior
On the ARM64 fixture,
_call_directbranches to_target_fn, but the base revision returns no corresponding caller and cannot reach it in a backward path. The new result retains the observed caller and direct call reference; it does not infer completeness from Hopper's independent APIs.Change and scope
The Hopper bridge pages forward observations into a bounded reverse index owned by one composed workflow; standalone calls get a fresh scan. The same owner supplies callers, incoming references and dossiers. Evidence retains the native reply and the selected target's forward observations. Hopper capabilities are marked live because the document has no revision token. Safe live observations remain retainable as Evidence without snapshot replay. MCP progress now handles multiple child phases without dropping later updates.
The cooperative scan defaults to 2,000 ms and can be changed with
REA_HOPPER_CALLER_SCAN_BUDGET_MS; it reports examined counts and capacity omissions. Pages contain at most 64 procedures, with 512 KiB per page or target list and 4 MiB retained encoded scan data. Cancellation is checked between pages. Hopper's synchronous native array calls cannot be interrupted or bounded by REA mid-call, and a live document can change during a scan.Contract and boundary impact
Expected effects:
Evidence and regression coverage
/bin/lsalso recovered the branch at0x10000078cinto0x10000071cacross callers, references, dossier, graph and path; the artifact digest remained unchanged.Validation performed
npm run verify:hopper:callers— passed against real Hopper on macOS ARM64, including retained forward Evidence and 4,002-procedure progress/cancellation/retry.npm run test:local -- src/hopper/HopperProvider.test.ts src/hopper/HopperCallerReconciliation.test.ts src/server/mcpProgress.test.ts src/application/WorkflowEvidence.test.ts src/application/binary/BinarySessionLiveness.test.ts src/application/binary/AnalysisSnapshotCache.test.ts— 94 passed; the focused three-suite rerun after provenance changes passed 19.npm run test:focused -- tests/boundary/providers/hopper/hopperCallerReconciliation.test.ts— passed.npm run check:fastandnpm run docs:check— passed;git diff --checkpassed.A single-session, uncontrolled-cache/scheduling comparison on a 1,207-procedure synthetic target measured five warm backward graphs at 117–134 ms after the fix vs 1.8–4.8 ms on baseline. The complete open/caller/five-graph/close task took 4.66 s vs 3.68 s. Sampled process-family peak RSS was 592,752 vs 589,264 KiB and sampled CPU 1.88 vs 1.48 s. The index retained 587,580 encoded bytes;
tokenxestimated 6,822 vs 6,705 reply tokens. These are single samples, not controlled cold/warm distributions; catalog tokens were not included, and the baseline did not provide the recovered relationship. The latency increase is material.Compatibility, safety, and release
No caller migration is required. Native API allocations and single calls remain outside the cooperative page bound. Scope includes existing Hopper document analysis and owned temporary files; target binaries are not executed or modified.
Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.