Repository navigation
perf(artifacts): add opt-in Interface Builder summary delivery and pages - #2684
kaoru0822-kitauji wants to merge 7 commits into
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. |
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 765ba7ff55
ℹ️ 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".
|
Heads-up on b6d0fb5: the new
If you meant the SDK-level refusal to be the contract, this assertion passes: expect(invalidDetail.isError).toBe(true);
expect(JSON.stringify(invalidDetail.content)).toContain(
'detail: Invalid option: expected one of \\"complete\\"|\\"summary\\"',
);If you'd rather have REA's structured |
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. The shared delivery preflight now parses the canonical analysisDetailSchema before admission or execution. An invalid selection returns the tagged AnalysisInputError Result with a detail issue, which is delivered as invalid_request; the field is only removed later from execution/Evidence parameters. Both artifact and native delivery families consume this owner. Added an MCP request regression for detail="brief"; it was not run at the user's explicit request. Source inspected at b6d0fb5; git diff --check passed. Tests, builds, source checks and CI reruns were skipped at the user's explicit request. No passing runtime/provider verification is claimed for this update. |
decode_interface_builder returns the complete object, hierarchy and connection graph inline. XLD.app's graph is 6.7 MB (about 1.98M o200k tokens) and Transmission.app's 6.3 MB; over MCP the doubled text and structured content exceed the default response budget, so an agent got a resource_constraint error instead of any answer. Add the established opt-in delivery: omitted or complete detail keeps the complete result and its Evidence ID, while summary retains the complete Evidence and returns every decoded document with node-kind, edge-relation and coverage-status tallies (10k tokens for XLD). inspect_analysis_view kind interface-builder pages documents, nodes, edges or coverage; nodes and edges accept an exact decoded document path, matched against each row's recorded evidence, and an undecoded path is refused. Decoder truncation stays visible on every page. Related cleanup, since the new code repeated it a ninth time: - parseAnalysisViewResult owns parsing a view parent's normalized result with the operation's schema and mapping issues into the view source. - retainedSummaryDelivery owns the preflight/summary hook pair and the shared registration options for artifact, native and managed tools. - openProductionTarget owns the production MCP session test setup. Duplication drops from 3.02% to 2.98% (threshold 3.0%). Co-Authored-By: Claude Opus 5.5 <[email protected]>
graph.truncated is also set for invalid archives, omitted dictionary keys and fixed decode budgets, not only caller-selected limits, so the view's unknown now points at coverage and limitations for the cause. The MCP test requests the summary first and reads its retained pages before any complete call, covering the flow where complete delivery cannot fit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
62bdd3a to
94e360c
Compare
|
CI-fix track: the failing lanes (real-web-runtime |
|
CI-fix track: the Windows lane failure ( |
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.
Use one named input-schema projection for clients and catalog identity, preserve dialect declarations, and bound compact schema depth. Keep canonical SDK output validation when output advertisements are disabled. Release request-owned state on cancellation and carry upstream limitations through composed workflows. Preserve doctor full-output envelopes and validate navigation facts at their owner. Reviewed fixes: #2088, #2108, #2513, #2684, #2693, #2695, #2836, #2864, #2868, #2877, #2933, #2998, #3002, #3015. Validation: focused schema, SDK output-validation, context, and workflow tests passed; no schema dialect or canonical output validation was relaxed.
# Conflicts: # docs/mcp-contracts.md # src/server/retainedSummaryDelivery.ts # tests/boundary/mcp/interfaceBuilderSummaryMcp.test.ts
|
CI-fix track: merged current main to clear the conflicts. Most of this PR already landed on main in 80de314, so overlapping files take main's version: |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
CI-fix track: the new |
|
@kaoru0822-kitauji, thanks for identifying that complete Interface Builder graphs could exceed MCP response budgets and proposing a summary-plus-pages workflow. The current tool keeps complete Evidence while allowing compact summaries and selected pages for callers (main). |
Summary
Over MCP,
decode_interface_buildercurrently fails on ordinary apps. The complete graph for XLD.app is 6.7 MB (1,980,857 o200k tokens) and for Transmission.app 6.3 MB. The text andstructuredContentcopies together exceed the default 10 MiB response budget, so the caller getsresource_constraint("its complete MCP response exceeds the stdio response budget") instead of an answer. A caller who only wants the windows, outlets or actions of one nib had no way to ask for less.This PR adds the same opt-in delivery #2634 added for
inspect_macho, which WASM, EVM, managed, Android, Dart AOT and pcap already have. Refs #2016, #1065.Problem and expected behavior
Smallest trigger:
open_binary /Applications/Transmission.app, thendecode_interface_builder {}returnsresource_constraint. Expected: a first call can return a bounded answer while the complete Evidence stays retained for exact pages.Change and scope
src/domain/analysisView/interfaceBuilderView.ts(new) owns Interface Builder views.available_counts, tallies by node kind, edge relation and coverage status, and decoder truncation.kind: "interface-builder"pages: coverdocuments,nodes,edgesorcoveragein original order. For nodes and edges, an optionaldocumentkeeps rows whose recordedevidence[].artifact_pathequals that exactdocuments[].relative_path. That's the producer's own attribution; nothing is reparsed from IDs. An undecoded path is refused instead of returning an empty page. Every page carriessource_truncated.graph.target_sha256must both equaltarget_sha256.decode_interface_buildergets an optionaldetailand a complete-or-summary output schema. Delivery detail is stripped before execution and from Evidence parameters, so the summary'sparent_evidence_idequals a complete call's Evidence ID. The preflight refusessummarybefore decoding when the server keeps no Evidence (the fix from perf(native): add opt-in Mach-O summary delivery and retained pages #2634).Related cleanup: the new view would have been the ninth copy of three patterns, pushing jscpd to 3.02% (threshold 3.0%). Each now has one owner:
parseAnalysisViewResult(analysisViewParent.ts) parses a parent's normalized result and maps issues intosource.normalized_result. It replaces the identical blocks in the WASM, EVM, managed, Android, Dart AOT, web capture, Mach-O and IB views.retainedSummaryDelivery/withoutDeliveryDetail(retainedSummaryDelivery.ts) own the preflight and summary hooks and the shared registration options type used by the artifact, native and managed registrations.openProductionTarget(tests/support/mcp/productionSession.ts) owns the "production session plusopen_binary" setup in five MCP tests.Duplication is now 2.98%. Behavior of the existing views and registrations is unchanged; their suites pass.
Docs:
docs/mcp-contracts.md,docs/native-investigation.md, the skill reference, and theinspect_analysis_viewdescription.Not included: changing the producer's representation. Nodes repeat the document path in
id,nameand evidence, and limitations list eachmax_documentsomission; that's a contract question. The default stays complete, and the CLI is unchanged (inspect-analysis-viewwith inline Evidence already supports the new kind).Contribution scope: not applicable. This is the established opt-in delivery pattern with no new execution, mutation or authority.
Contract and boundary impact
Semantic owner and earliest changed stage: projection of retained
decode_interface_builderEvidence; MCP delivery selection inregisterArtifactTools.Contribution scope fit and linked maintainer decision: not applicable.
CLI and MCP/tool-catalog contract: additive. The new optional
detailand summary output variant, and a newinterface-builderview request/result. Omitted detail keeps the old result and Evidence identity.Provider, bridge, target-format, or platform compatibility: none. The decoder receives the same parameters.
Evidence, artifact, provenance, or reconstruction contract: the complete Evidence and its ID are unchanged. Views are derived Evidence linked to the retained parent.
Generated metadata, package, or installation impact: catalog regenerated at build;
docs:checkpasses.Read existing files or captured data.
Evidence and regression coverage
src/domain/analysisView/interfaceBuilderView.test.ts(any platform) covers:tests/boundary/mcp/interfaceBuilderSummaryMcp.test.ts(any platform; production session, realUIKitOutlet.xmlnib archives in a two-document.app) checks:detail.parent_evidence_idequals the complete Evidence ID.document-filtered node read equals the complete nodes attributed to that nib (and is a strict subset).Real applications (macOS, real MCP stdio, this branch)
resource_constraint; CLI JSON 6,734,711 B / 1,980,857 tokresource_constraint; CLI JSON 6,313,752 B / 1,948,182 tokFor both apps, the summary's parent equals the CLI complete Evidence ID, and paging every node 500 at a time reproduces all nodes exactly. Decoding takes 0.5–1.5 s for complete and summary alike (same analysis); each page takes about 30–40 ms. Tokens are o200k_base via tiktoken. CPU and peak memory weren't measured separately, because only delivery differs.
About 7 KB of each XLD response is the producer's 69 limitations, and they appear twice (normalized result and Evidence envelope), as in every view. I left that envelope repetition alone.
Catalog cost:
tools/listgrows from 687,395 to 690,367 o200k tokens (+2,972, +0.43%).decode_interface_builderadds 862 andinspect_analysis_viewadds 2,110. Each page's rows use the existing strict graph schemas, so the union can't strip fields (the #2634 Greptile finding).Validation performed
npx vitest run src— 5,127 passed. One failure,src/ida/IdaWorkspaceThinning.test.ts"copies exactly the selected slice when later slices follow it across read boundaries", fails identically on unmodified main on this host.npm run test:focused --with these files passes:interfaceBuilderSummaryMcp,nativeMachoSummaryMcp,nativeDemangleMcp,keyedArchivePrototypeKeyMcp,keyedArchiveNumberMetadataMcp,artifactMcp.inlineInventory,analysisSummaryDetailMcp,toolSchemaValidity,serverIdentity,managedArtifactSummaryMcp,wasmArtifactMcp,evmInterfaceMcp,androidPackageSummaryMcp,dartAotSummaryMcp,pcapRetainedView,analysisViewCli,analysisViewMcp,sazWebCapture,qlogCapture,retainedApplicationEvidenceMcp,binaryDiagnosticsMcp,interfaceBuilderUIKitKeyedArchive,dylibResolutionMcp,enhancedTools.01,keyedArchiveSelection,targetContentProvenance.npm run check:fast,npm run typecheck,npm run format:check,npm run docs:check,npm run knip,npm run jscpd(2.98%),npm run verify:architecture-guards— pass.Compatibility, safety, and release
Before merge
type(scope): outcome.🤖 Generated with Claude Code