Skip to content

feat(javascript): return a retained summary view on request - #1568

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
feat/analysis-summary-detail
Oct 10, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
feat/analysis-summary-detail

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Problem

Follow-up to #1560, which reduced the per-turn tool-definition context. This PR covers the other half of the feedback, output size. analyze_javascript_application always returns the complete application graph inline. Measured over SDK 2.3.1 stdio:

Fixture Complete reply text detail: "summary" reply text
2 files, 3 functions (185 source bytes) 84,791 B 10,149 B
300-function single file (#1065 reproduction) fails: resource_constraint (over the 10 MiB stdio budget) 10,177 B, and the next ping succeeds

The repo already has the right primitive: inspect_analysis_view reads summaries, module pages and items from retained Evidence. But agents only reach it after paying for (or failing on) the complete first reply.

Change

analyze_javascript_application gets an optional detail input:

  • complete (default): unchanged. The complete analysis Evidence is returned inline.
  • summary: the server records the complete analysis Evidence in the session, then returns the derived inspect_analysis_view summary Evidence (operation: "inspect_analysis_view"). Its normalized_result.parent_evidence_id and evidence_links name the retained analysis. Callers page modules, select items, or pass {"kind":"retained-evidence", ...} to the application workflows, without repeating the analysis.
  • A server that cannot retain Evidence (fixed-target embedders) refuses summary with capability_unavailable and advice to select detail complete. It never returns a summary whose analysis can't be reached.

Notes for review:

  • Output schema: normalized_result is now union(application analysis, analysis view). The root stays type: object, so there are no root combinators. Default responses are byte-identical to before. A consumer that statically types normalized_result as the analysis result should use operation / normalized_result.kind to tell them apart.
  • Layering: the summary logic is the application function summarizeRetainedAnalysis (src/application/analysisView/AnalysisViewService.ts). The MCP adapter only removes detail before analysis, so detail never enters the analysis Evidence.
  • CLI: unchanged and always complete. The CLI has no session retention, and its output goes to a file or pipe rather than model context. inspect-analysis-view already reads inline Evidence files.
  • Docs: docs/mcp-contracts.md, docs/javascript-artifact-reconstruction.md and the packaged skill (.agents/skills/...) describe when to use summary detail. The generated catalog and skill were regenerated.

Not in scope (possible follow-ups): the same option for analyze_function and inspect_binary_layout, which inspect_analysis_view also supports, and the text/structured duplication on the wire (#723).

Relates to #723, #1065.

Verification

  • npm run check:ci passes: typecheck, lint, format, knip, metadata, jscpd and architecture guards.
  • npm run docs:check passes.
  • npm run check:changed: 27 files, 280 tests.
  • npm run test:focused over all tests/boundary/mcp, tests/boundary/cli and tests/conformance files: 135 passed, 2 skipped (573 tests). Skill and setup tests pass.
  • New tests/boundary/mcp/analysisSummaryDetailMcp.test.ts (real fixture over the MCP client):
    • the default reply is the complete analysis;
    • summary returns the view, smaller than the complete reply, linked to the complete Evidence ID;
    • a follow-up inspect_analysis_view module page on the retained parent works;
    • a non-retaining server refuses with capability_unavailable.
  • New unit tests for summarizeRetainedAnalysis: it records before projecting, refuses without retention, and propagates a recording conflict.
  • Manual stdio run of the [Feature] Roadmap: improve MCP usability and performance under bounded resources #1065 300-function reproduction (table above).

No real Hopper/Ghidra/IDA verification was performed (they are not affected). No real host-client lanes were run.

🤖 Generated with Claude Code

analyze_javascript_application returns the complete application graph
inline, which repeats tens of kilobytes even for a few source lines and
exceeds the default 10 MiB MCP frame for a 300-function source file.

The new optional detail input keeps complete delivery by default. With
detail "summary" the server records the complete analysis Evidence in
the session and returns its inspect_analysis_view summary, whose
parent_evidence_id lets callers page modules, select items, or pass the
retained reference to application workflows. A server without Evidence
retention refuses summary detail with capability_unavailable rather
than returning a summary whose analysis cannot be reached.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@kaoru0822-kitauji
kaoru0822-kitauji merged commit c19e15a into main Oct 10, 2026
27 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the feat/analysis-summary-detail branch October 10, 2026 14:37

@786anisariwusjs-rgb 786anisariwusjs-rgb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feat/analysis-summary-detail

@786anisariwusjs-rgb

Copy link
Copy Markdown

0336793929

@786anisariwusjs-rgb

Copy link
Copy Markdown

Jejjzm. Udzx. Wz wz. Yv zz we wzn. Did wis. Qozkq. Qozkq oos. Zbw zj the diwz ll.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants