Repository navigation
perf(managed): add retained member summary and pages - #3061
Conversation
inspect_managed_members always returned the assembly-wide member_refs, so one selected or unmatched type produced megabytes, and an unselected ordinary assembly exceeded the MCP response budget. Add opt-in detail: "summary" that retains the complete Evidence and returns identity, selection with unmatched names, coverage, user-string coverage, limitations and per-collection counts. Page original rows through inspect_analysis_view with kind managed-members; each page names its collection so no row schema is chosen by union order. Complete delivery stays the default. Refs #3010 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
|
Each managed-members page reparsed the whole parent report, about 35 ms for an 18 MB assembly result regardless of the page size. The analysis view service now reports whether the parent Evidence is a sealed snapshot, and the member view reuses the validated report for that sealed result through a weak reference. Unsealed input is still validated on every call. The round-trip test fixture now carries an exported type, an ldstr literal, a field access and a call edge, and requires every collection to be nonempty so a row schema that drops facts cannot pass on empty arrays. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Resolve analysis-view conflicts with the Interface Builder views, and adopt main's single owners: parseAnalysisViewResult for the member parent parse and retainedSummaryDelivery for managed summary delivery. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary, omitted and complete delivery of the same managed inspection now retain one parent record, as inspect_macho already does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary
Closes #3010.
inspect_managed_membersalways returns the assembly-widemember_refsandexported_types, andtype_namesdoesn't narrow them. So one selected type, or a name that matches nothing, still returns megabytes. Over MCP, an ordinary assembly with no selection fails outright withresource_constraint.This adds the same opt-in delivery that
inspect_managed_artifactgot in #2413:detail: "summary"retains the complete Evidence and returns a linkedinspect_analysis_viewsummary. It contains:kind: "managed-members"pages covertypes,exported_types,fields,methods,member_refs,call_edges,field_accessesanduser_strings(the literals). They return original rows in order. Each page also carries the source selection, coverage and build-local token scope.nullcount and refuses those pages instead of returning an empty one.completedetail returns the same complete result as before.Bug found while testing against real data
My first version used
z.unionover the row array schemas, like the artifact view does. Sealing re-parses the page through that union, and the first schema that matches wins. The member row schemas are non-strict and share keys, so method rows parsed astypesrows and silently lostrva,impl_flagsandbody. Each page now has the shape{collection, rows}in adiscriminatedUnion("collection"). The boundary test rebuilds every collection page by page and compares it exactly. (The existing artifact view's reference/resource/attribute rows each have distinct required keys, and its pages are exact on both assemblies below, so it is left unchanged.)Related cleanup
managedViewIdentityUnknowns, shared by both managed views.parseAnalysisViewResult, and managed registration uses main'sretainedSummaryDeliveryinstead of its own preflight and projection hooks. Summary is now refused before admission, like the artifact and native families.tests/boundary/mcp/browserComparisonInput.test.tsfails locally on plainorigin/main(bcc1415) as well; it's unrelated and untouched.Verification
Real data: two .NET assemblies from NuGet, parsed and never loaded or run.
ICSharpCode.Decompiler.dll9.1.0.7988 (netstandard2.0, 2,558,464 bytes)Newtonsoft.Json.dll13.0.3 (net45 and net6.0)Calls went over real MCP stdio (
rea mcp) on macOS with Node 26.Correctness: every collection was rebuilt through pages and compared exactly (
isDeepStrictEqual) with the complete result. The summary's non-collection fields matched exactly.type_names=[CSharpDecompiler]No.Such.Typeunmatched_type_namesreportedtype_names=[JsonConvert]Size and time: before = merge base
30128a03c; after = this branch. Same machine, three runs each; the runs were identical to within a few ms. Token counts aretokenxestimates of the serialized replies, not model usage.CSharpDecompilerpresent and which direct calls does it declare?call_edgespages of 500 = 4 calls, 904,558 B (~293k est. tokens), 211 msNo.Such.Typeexist?resource_constrainterror, no resultFor the first question, the whole client+server process ran two passes of the task (first call in a fresh server, then a repeat in the same session):
The repeat pass is only about 10 ms faster in both builds, since the parser doesn't cache across calls.
Paging cost (after review): a sealed retained parent is validated once and its report is reused for later pages; unsealed inline input is still validated on every call. Paging all 19,137 Newtonsoft (net6.0) call edges over MCP, 39 pages of 500, two runs each:
Response bytes are identical (10,667,479). In process, one 64-row page drops from ~36 ms to 0.6–2.2 ms.
Costs: the advertised catalog grows by 20,098 B (about 6k estimated tokens).
inspect_analysis_viewgains 16 KB for the eight row schemas andinspect_managed_membersgains 4 KB. Summary-first only pays off when a reply would otherwise be large. I did not run real-model (Codex) trials, so I'm not claiming any model-token saving.Tests:
tests/boundary/mcp/managedMemberSummaryMcp.test.ts(fixture with an exported type, a#USliteral, a field access and a call edge; every collection must be non-empty) covers:completeand omitted deliverymanagedArtifactSummaryMcp.test.tsnow:detailon members (native boundaries still reject it)summarybefore file accessnpm run check:fast,npm run check:changed(58 files),npm run docs:check,npm run jscpd(3.14% < 3.5%), andnpm run test:focusedon 66 MCP catalog/schema/analysis-view suites plus the managed boundary/acceptance suites.Not verified: Windows and the issue's exact ILSpy.dll, real-model trials, and the CLI. The CLI has no MCP response budget, so like #2413 this delivery option is MCP-only;
inspect-analysis-viewaccepts the new view kind through its shared schema.🤖 Generated with Claude Code