Repository navigation
feat(native): select retained batch decompile results through analysis views - #8629
Merged
Merged
Conversation
…s views A completed batch_decompile could only be read whole. When it did not fit the MCP response budget, or an agent wanted one function, inspect_analysis_view refused the parent as unsupported and the only recovery was exporting the session. - Own the batch result schema in the domain, replacing the contract's copy and the workflow's hand-written item types. - Add summary and batch-decompile views: body-free rows keyed by original index with exact filters and opt-in bodies, and UTF-16 pages of one body. - Report the decompiling provider from the upstream analysis profile, since the Evidence provider is the composing workflow. - Keep batch limitations visibly aggregated rather than attributing them to one successful item. Fixes #8498 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. |
15 of 22 tasks
label_unavailable only counted failed lookups, so a batch whose provider answered null for every label reported zero. The identity contract defines a null name as an unavailable label in both cases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
[Medium impact] The reviewed changes appear safe to merge. SummaryAdds selected views of completed
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Completed batch Evidence] --> B[Check parent and result]
B --> C[Summary]
B --> D[Selected rows]
B --> E[One body page]
C --> F[View linked to unchanged parent]
D --> F
E --> F
Reviews (3) · Last reviewed commit: "test(native): require advertised batch s..." · Reviewed by Greptile |
…idator A local validator map dropped any tool without an output schema, so removing an advertised schema would have left these contract tests green. Require both named schemas and validate through createMcpSchemaValidation, as docs/testing.md asks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
coyoteXujie
pushed a commit
to coyoteXujie/rea
that referenced
this pull request
Nov 2, 2026
…s views (morluto#8629) * feat(native): select retained batch decompile results through analysis views A completed batch_decompile could only be read whole. When it did not fit the MCP response budget, or an agent wanted one function, inspect_analysis_view refused the parent as unsupported and the only recovery was exporting the session. - Own the batch result schema in the domain, replacing the contract's copy and the workflow's hand-written item types. - Add summary and batch-decompile views: body-free rows keyed by original index with exact filters and opt-in bodies, and UTF-16 pages of one body. - Report the decompiling provider from the upstream analysis profile, since the Evidence provider is the composing workflow. - Keep batch limitations visibly aggregated rather than attributing them to one successful item. Fixes morluto#8498 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(native): count every unavailable entry label in a batch summary label_unavailable only counted failed lookups, so a batch whose provider answered null for every label reported zero. The identity contract defines a null name as an unavailable label in both cases. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(native): require advertised batch schemas through the shared validator A local validator map dropped any tool without an output schema, so removing an advertised schema would have left these contract tests green. Require both named schemas and validate through createMcpSchemaValidation, as docs/testing.md asks. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #8498 (proposal: #8498 (comment)). A stacked follow-up adds
detail: "summary"delivery and overflow continuations; this PR is the retained view it depends on.Problem and expected behavior
Before: a batch over the 10 MiB response budget completes and is retained, but the record could not be read selectively.
inspect_analysis_viewreturnedParent Evidence operation "batch_decompile" does not support analysis views.Expected: a client reads a selected completed item and its identity, status, provenance and omissions without repeating analysis or transferring the bundle.
Change and scope
src/domain/native/batchDecompile.ts(new owner): the result shape lived intoolOutputSchemaGroups.tsand again as hand-written types inEnhancedTools.ts. The contract, workflow and view now share it.name_errorand itemlimitationsuseexactOptional, because a JSON value cannot holdundefined; the advertised shape is unchanged.src/domain/analysisView/batchDecompileView.ts, registered forbatch_decompile, so MCP and CLIinspect-analysis-viewshare it:summary: producer counts, provider and profile identity, procedure identity counts, total and largest body size, limitation count.{kind:"batch-decompile", collection:"items", where?, offset, limit, include_pseudocode}: rows in retained order with the originalindex, so duplicate selectors stay distinct.wheretakes exactindices,addresses,procedure_addressesandstatuses; omitted selects all,[]selects none. Bodies are opt-in; a row otherwise reportspseudocode_code_units, or its exacterrorandlimitations.{kind:"batch-decompile", collection:"pseudocode", index, offset, limit}: UTF-16 pages of one body through the existinganalysisTextPage.decompiling_providercomes from the upstream analysis profile, because the Evidence provider is the composing workflow. It isnullwhen the parent records none.rea.analysispredicate and a valid result, like other native views.detail: "summary"and overflow continuations (stacked follow-up); input bounds ([Bug] batch_decompile accepts unbounded address arrays #5930); per-item provider provenance ([Bug] Successful batch decompiles lose per-item provider provenance #8350); retention-failure recovery (fix!: preserve results when source publication fails #8444); a CLI batch command.Follow the contribution scope. This is a read-only view of completed Evidence within existing boundaries, so no maintainer scope decision is required. The API shape was posted on the issue before implementation; there has been no maintainer response yet.
Contract and boundary impact
batchDecompileResultSchemaowns the producer shape;projectBatchDecompileViewowns selection. The superseded contract copy and workflow item types are removed.inspect_analysis_viewaccepts a new view kind and result; its description names it.batch_decompileis unchanged.docs/public/product-catalog.json), package, or installation impact: the catalog grows with the view contract; nothing else.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
Before and after, executed. Real Kuna 1.988 (release digest verified), stdio MCP compact profile, macOS arm64, warm project cache, on Homebrew's unexecuted
tmux(arm64 Mach-O, SHA-2568ab1bd9e…a86d, unchanged). The over-budget batch selects the largest real body of 64 functions 1,000 times (13.4M code units). Bytes are the SDK-serialized reply; tokens aretokenxestimates, not billing.8250bf232resource_constraint, export guidanceunsupported_targetThe last row's body equals the same function's body from the direct 64-function batch. A view adds no provider call in the test harness; the real timings above are consistent with that but do not prove it.
Schema cost, one catalog per session: compact 580,675 to 581,021 B (+346 B, about +97 estimated tokens); full 3,958,851 to 3,968,714 B (+9,863 B, about +2,971 estimated tokens).
tests/boundary/mcp/batchDecompileViewsMcp.test.ts(public MCP, full and compact input and output profiles, replies validated throughcreateMcpSchemaValidationagainst output schemas both tools must advertise): duplicates, interior selectors, unknown identity, null and failed entry labels, no-body items, exact and empty filters, page coverage, surrogate-safe text pages, refusals, target-free bundle and Evidence-file sources, wrong view and foreign parents, forged predicate, malformed result, empty batch, and a page mixing another collection's rows.tests/boundary/cli/analysisViewCli.test.tscovers target-free CLI reads from a bundle.{"index":0,"address":"0x100001b48","procedure":{"status":"resolved","address":"0x100001b48","name":"_alerts_check_session"},"status":"ok","pseudocode_code_units":299}Applicable boundary regressions: projection fidelity, malformed input, page boundaries and duplicate identity. No lifecycle stage changes.
For evidence-bearing changes:
Validation performed
npm run check:fast— passednpm run format:check— passednpm run knip— passednpm run docs:check— passednpm run metadata:check— passednpm run test:focused -- tests/boundary/mcp/batchDecompileViewsMcp.test.ts tests/boundary/mcp/enhancedTools.callPathsAndBatches.test.ts tests/boundary/mcp/ghidraRoutingMcp.test.ts tests/boundary/providers/kuna/kunaBatchDecompileMcp.test.ts tests/boundary/mcp/nativeViewPredicateMcp.test.ts tests/boundary/cli/analysisViewCli.test.ts tests/boundary/cli/cliToolCoverage.test.ts tests/conformance/contracts/targetContentProvenance.test.ts src/application/analysisView/AnalysisViewService.test.ts src/application/WorkflowEvidence.test.ts src/application/EnhancedInputDiagnostics.test.ts src/application/EnhancedToolSelectorOrigin.test.ts— 12 files, 186 tests passedlabel_unavailablefix (a575803),npm run test:focused -- tests/boundary/mcp/batchDecompileViewsMcp.test.ts— 6 tests passed. The suites above and the real workflow were not rerun for that one-line count change.mainatf95bdbce7,npx tsc --noEmitandnpm run test:focused -- tests/boundary/mcp/batchDecompileViewsMcp.test.ts tests/boundary/cli/analysisViewCli.test.ts— 2 files, 35 tests passed. Every required CI check had passed ona57580325before this merge.mainat0e6943c9d,npx tsc --noEmitand the same 2 focused files passed (35 tests). Every required CI check had passed onf469b5959before this merge.npm run test:focused -- tests/boundary/mcp/batchDecompileViewsMcp.test.ts— 6 tests passed.Compatibility, safety, and release
Author readiness
Human owner: @kaoru0822-kitauji
Before merge
type(scope): outcome.🤖 Generated with Claude Code