Repository navigation
feat(native): inspect oversized retained function dossiers via bounded views - #1345
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Review of adb96bd: the retained-Evidence projection is the right direction, and the UTF-16 surrogate-boundary checks and explicit truncated-flow unknowns are useful. I reviewed the native projector, request schema and service provenance path. P2 design issue to resolve before merge: Please retain a useful default but either remove the arbitrary ceiling, or document and verify its actual resource basis. If the requirement is a bounded transport result, account for serialized bytes/expansion at the projection boundary and preserve explicit omissions and parent provenance. Include a test for a small page above the former row ceiling and a large single-row/metadata case. This is a static review of the change, not a fresh real-Hopper/Ghidra verification. GitHub currently reports mergeable but blocked, with no checks attached to this head; the existing injected retained-dossier MCP test is integration evidence, not real-provider evidence. |
|
TL;DR: I tested this on Linux with real Ghidra. The new views work. A real dossier went over the 10 MiB limit. Paging it worked fine. But one 256-row page was still 3.8 MB. So the row cap does not bound size. What ran.
Over stdio MCP (
Then
CLI with inline Evidence. 18 of 20 views exited 0. One was past the end and gave an empty page. Limit 257 was refused. Procedure at offset 1 was refused. Main ( On the P2:
Not run. Hopper. Windows. The full Test setup
🤖 Generated with Claude Code (Opus 5.5) 🦊 |
|
TL;DR: I checked my last note again. The numbers hold. One line was too broad. Here is a sharper picture of the rows. I ran it again on head
On the 700 rows:
The row cap still does not bound bytes. 🤖 Generated with Claude Code (Opus 5.5) 🦊 |
Refs #1247 and #1065.
A complete native
analyze_functiondossier can exceed default MCP framing. Extend the existinginspect_analysis_viewworkflow so callers can read selected native facts from authenticated same-session Evidence or portable inline Evidence without restarting a provider.Native facets cover procedure, pseudocode, assembly, callers/callees, typed references and high-pcode summaries/operations/def-use/effects/parameters. Offset defaults to 0 and positive caller-selected limit defaults to 64. Pseudocode uses UTF-16 code units, rejects offsets inside surrogate pairs and returns safe continuation offsets. Other pages count rows. Actual serialized bytes govern transport admission; no arbitrary row ceiling substitutes for that check.
Views keep artifact path/hash, exact parent Evidence ID, distinct view digest, procedure address as recorded, provider limitations and explicit unknowns. Unavailable API residual unknowns and decompiler caveats survive selection. Empty recorded addresses and paths stay empty and do not create invalid address/path locations. Malformed native dossiers report the specific field. Complete default analysis and retained Evidence remain available, including an oversized selected row; CLI help, contracts and packaged skill source describe the added views.
Example (replace the placeholder with an actual same-session Evidence ID):
{"source":{"kind":"retained-evidence","evidence_id":"ev_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"view":{"kind":"native","facet":"value_flow_operations","offset":0,"limit":32}}Validation on latest integrated main
4d8ef3f, pinned Node 24.18.0/npm 11.16.0, Linux x64, two CPUs and a 2 GiB process-family RSS guard:npm run typecheck -- --singleThreaded, lint/module boundaries, docs generation check, changed-file formatting and Git whitespace checks pass. Runtime compilation uses the same documented single-thread mode. The pinned native TypeScript compiler's documented single-thread mode preserves the full checking scope within the local memory budget.This covers the selected-facet portion of #1247. Retained-dossier discovery and cross-session snapshot-backed reuse remain open. Our follow-up also ran a real Ghidra 12.1.4 workflow on a 16,784-byte source-owned ELF with JDK 21, a verified 512 MiB JVM heap and two CPUs. Latest main CLI native-view rejection was reproduced; the candidate CLI returns exact pseudocode from that real parent. Candidate stdio MCP verified six native facets with caller limit 500, parent/subject identity, API limitations, text/structured parity, ping and close. The complete native Evidence ID exactly matches main CLI; input bytes remained unchanged. MCP native responses were 15,580–27,676 bytes versus 84,046 bytes for the complete dossier, and selected calls took 4–70 ms after a roughly 91-second cold analysis; these are one small-target observation and byte measurements, not token or provider startup improvements. Family RSS peaked at 1,271,345,152 bytes under the native 3 GiB guard. Hopper was not run. Existing contributor larger-target real-Ghidra observations remain separately attributed in PR comments.