Repository navigation
feat(mcp): select views of retained analysis results - #1180
Conversation
Add inspect_analysis_view so callers can read a summary, one section/module, or a stable page from already completed layout or JavaScript application Evidence without repeating analysis.
Narrow projected view unions in tests, rebind JavaScript companion graphs after fixture edits, and refresh the authored skill 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. |
|
Thanks for the implementation and the thoughtful demo! I’m reviewing it now and testing the retained views on a real Notion ASAR. I’ll add any needed fixes to this PR. |
|
Pushed The real Windows Notion run passed with one analysis: summary 54 ms, module 31 ms, pages 24–29 ms, all around 35–41 KB. Evidence identity and the retained trace match the previous complete analysis. Focused CLI/MCP/schema regressions pass, including oversized selected values and recovery. The remaining CI jobs are running. |
N0zoM1z0
left a comment
There was a problem hiding this comment.
Reviewed at 045b9370. The follow-up fixes preserve complete observations and artifact identity, reuse validated retained graphs, and cover malformed selectors and oversized escaped observations. Focused CLI/MCP regressions and the complete native Windows Notion workflow pass; all 22 CI checks are green. Thanks again for the implementation and demo.
Add explicit summary, facet, item and paged views of retained analysis Evidence without repeating analysis. Preserve captured observations, graph validation, artifact identity, coverage and complete default results. Fixes morluto#1050 Verified with focused source, CLI, pinned-SDK schema and MCP tests, serial static checks, and one complete native Windows Notion ASAR workflow. Real Hopper/Ghidra verification was not performed for this provider-independent projection change. Co-authored-by: Matt Van Horn <[email protected]>
|
Many thanks @N0zoM1z0 for landing the MCP view selection. Agents can now pull one section or page of a finished analysis without rerunning it. |
Summary
Agents can now project a summary, one section or module, or a stable page from already completed layout or JavaScript application Evidence after a large MCP result, without repeating analysis.
Fixes #1050
Demo
The sample is a generated local app, not third-party code.
Problem and expected behavior
A completed
inspect_binary_layoutoranalyze_javascript_applicationresult can exceed the MCP stdio receive buffer once Evidence wrapping and repeated encodings are applied. Callers still need a compact overview, a single section or module, or a bounded page of identity rows from that retained record.inspect_analysis_view(CLIinspect-analysis-view) reads inline Evidence or an exact same-sessionevidence_idand returns only the selected projection. It does not start Hopper, Ghidra, IDA, or JavaScript reconstruction. Pagelimitis a caller-selected positive integer. Actual serialized size determines transport admission; oversized views retain complete derived Evidence and return its reference for recovery.Change and scope
New application workflow behind shared CLI and MCP adapters:
summary,facetmitigations|linkage,itemsections|symbols,page) and JavaScript applications (summary,itemmodules,page).{ kind: "retained-evidence", evidence_id }or{ kind: "inline", evidence }.evidenceResultOfthe view.view_digestis SHA-256 of the canonical projected JSON and changes when the projection changes; it is not the parent digest.ANALYSIS_VIEW_PROVIDER, predicaterea.analysis-view, parent authority, andevidence_linksto the parent.skill-src/(skill version 34). Catalog regenerated; build outputs not committed.Out of scope: other parent operations, rewriting executable bytes, saving or closing an attached GUI database, and paging arbitrary JSON with
--filter-output.Contract and boundary impact
src/domain/analysisView/, then applicationAnalysisViewService, CLI/MCP adapters.inspect_analysis_view/inspect-analysis-viewonTOOL_CONTRACTS; kindapplication; effects session Evidence write only (inspect_analysis_view: evidence).docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions inskill-src/and never commit build outputs):ANALYSIS_VIEW_PROVIDERadded to catalog-core/builders; authored skill version 34;src/generatedPackageMetadata.tsskillVersion 34.Evidence and regression coverage
70e5c247the tool is absent fromTOOL_CONTRACTSand the CLI.examined=8,total=22,next_offset=8,exhausted=false.For evidence-bearing changes:
Validation performed
npm ci— pass (374 packages, 0 vulnerabilities)npm run test:focused -- src/domain/analysisView/analysisView.test.ts src/application/analysisView/AnalysisViewService.test.ts tests/boundary/mcp/analysisViewMcp.test.ts tests/boundary/cli/analysisViewCli.test.ts tests/boundary/cli/productCatalog.test.ts tests/boundary/mcp/binaryDiagnosticsMcp.test.ts tests/boundary/mcp/retainedApplicationEvidenceMcp.test.ts src/contracts/toolContracts.test.ts src/application/CapabilityInventory.test.ts src/contracts/promptContracts.test.ts tests/boundary/cli/jsonInputStatus.test.ts src/contracts/contractSnapshot.test.ts— pass (12 files, 95 tests)npm run check:fast— passnpm run check— pass (typecheck, lint, format, knip, metadata:check; 6/6 turbo tasks)npm run docs:check— passnpm run verify:test-discovery— pass (“Discovered all 654 test files exactly once.”)Compatibility, safety, and release
ANALYSIS_VIEW_TOOL_CONTRACTS.Review checklist
type(scope): outcome.Maintainer follow-up verification
Current main integrated; follow-up
ea0aa95afixes retained-graph reparsing, module selection, captured-value preservation, semantic coverage, subject identity handling and the duplicate-code gate. The original demo remains above.npm run check:ci -- --concurrency=1and pre-pushnpm run check:fastpass.045b9370also passes all seven pinned-SDK schema tests and pre-push checks. CI run 37883418585 passes all 22 checks on the final exact head.