Repository navigation
feat(evidence): read selected complete records without the whole bundle - #8528
Merged
Merged
Conversation
get_evidence_bundle could discover a record by exact ID, but reading it required the complete canonical bundle: complete + filters was rejected, and inspect_analysis_view refuses parents without a view, such as annotations, pseudocode sources and native traces. - Add detail: records, a page (offset, limit; default 0, 8) of the complete matching records in canonical bundle order. Records keep their original IDs, subjects, providers and readback; missing_evidence_links names direct links of the returned records that are not retained. - The selection is labelled as historical and not an importable bundle; complete keeps returning the canonical bundle, and offset/limit require detail: records. - Filters keep one owner shared by summary and records delivery, for the MCP session and the CLI's inspect-evidence-bundle. - An oversized record page now advises a smaller limit or one evidence_id; whole-bundle overflow guidance mentions record reads. Fixes #8307 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. |
3 tasks done
Contributor
[Medium impact] The PR appears safe to merge, with no outstanding findings. SummaryAdds
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
MCP["MCP get_evidence_bundle"] --> Shared["inspectEvidenceBundle"]
CLI["CLI inspect-evidence-bundle"] --> Read["Read and validate local bundle"]
Read --> Shared
Shared --> Complete["complete: canonical bundle"]
Shared --> Summary["summary: matching record metadata"]
Shared --> Records["records: matching complete records"]
Records --> Page["Page in Evidence ID order"]
Page --> Result["Original records, missing direct links, and limitations"]
Reviews (2) · Last reviewed commit: "test(evidence): compare record-selection..." · Reviewed by Greptile |
Assert the record-selection limitations and oversized-page guidance against their owning constants, and check the reported limit facts separately, instead of pinning explanatory phrases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 1, 2026
coyoteXujie
pushed a commit
to coyoteXujie/rea
that referenced
this pull request
Nov 2, 2026
…le (morluto#8528) * feat(evidence): read selected complete records without the whole bundle get_evidence_bundle could discover a record by exact ID, but reading it required the complete canonical bundle: complete + filters was rejected, and inspect_analysis_view refuses parents without a view, such as annotations, pseudocode sources and native traces. - Add detail: records, a page (offset, limit; default 0, 8) of the complete matching records in canonical bundle order. Records keep their original IDs, subjects, providers and readback; missing_evidence_links names direct links of the returned records that are not retained. - The selection is labelled as historical and not an importable bundle; complete keeps returning the canonical bundle, and offset/limit require detail: records. - Filters keep one owner shared by summary and records delivery, for the MCP session and the CLI's inspect-evidence-bundle. - An oversized record page now advises a smaller limit or one evidence_id; whole-bundle overflow guidance mentions record reads. Fixes morluto#8307 Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(evidence): compare record-selection guidance with its owners Assert the record-selection limitations and oversized-page guidance against their owning constants, and check the reported limit facts separately, instead of pinning explanatory phrases. 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 #8307 (proposal: #8307 (comment)).
One general, operation-agnostic contract instead of per-operation views. An agent that discovered an Evidence ID can fetch that exact record, or a bounded page of exactly filtered records, and learn which of its direct sources this session does not retain. It doesn't need to transfer the bundle.
Problem and expected behavior
Before, on
aa48d494e, in a real stdio MCP session after analyzing Discord'sapp.asar(detail: summary):get_evidence_bundle {}returnedresource_constraint,response_bytes_at_least: 10511827.inspect_analysis_viewon a discoveredinspect_analysis_viewrecord returnedunsupported_target.get_evidence_bundle {detail:"records", …}returnedinvalid_request.The issue's boundary requirements are to preserve the exact Evidence ID, subject digest, provider/profile, readback and historical semantics. A selection must not silently become an authenticated complete bundle or drop closure, and must not present an old annotation as live state.
Change and scope
src/domain/evidenceRecordSummary.ts(one owner of filter semantics):matchingEvidenceRecordsnow serves bothsummarizeEvidenceBundleand the newselectEvidenceRecords, so summary and records can't drift.offset/limitdefaulting to 0/8.missing_evidence_linkscovers direct links of the returned records only, without traversal.InspectEvidenceBundle.ts(shared by the MCP session tool and the CLI file command) dispatchesrecordsand rejectsoffset/limitfor other details.detailgainsrecords, plus optional top-leveloffset/limitdocumented "records only". The output union gainsevidenceRecordSelectionSchema, and one sentence is added to the description.limitor oneevidence_id(MCP_TRANSPORT_EVIDENCE_RECORDS). Whole-bundle overflow guidance now also points at record reads.mcp-contracts.md, plus the wasm and route-inventory docs that previously told readers to fetch the complete bundle for one record, and the skill guidance.list_unknownsalready pages it), multi-ID batch filters, link traversal, and annotation replay ([Feature] Ghidra: export analyst names and comments from a session and re-apply them when the target is reopened #6405). Complementary to fix(mcp): qualify retained Evidence view guidance #8377, which is guidance-only; overlapping description text will be merged when either lands.Contract and boundary impact
Semantic owner and earliest changed stage:
evidenceRecordSummary.tsfilter matching, consumed by summary, records, the MCPget_evidence_bundlehandler and CLIinspect-evidence-bundle. The duplicate inline filter loop was removed.Contribution scope fit and linked maintainer decision: read-only selection of already retained Evidence. Proposal posted on [Design] Retrieve selected historical annotation Evidence without transferring the whole bundle #8307. No new authority.
CLI and MCP/tool-catalog contract: additive
detailvalue and two optional fields. Output union superset.Provider, bridge, target-format, or platform compatibility: none; no provider is consulted.
Evidence, artifact, provenance, or reconstruction contract: records are returned unchanged (same IDs). The selection carries explicit closure (
missing_evidence_links), coverage (matching_records,total_retained_records,next_offset) and historical/non-bundle limitations.Target selection, authority, upstream behavior, and cleanup details: not applicable.
Generated metadata, package, or installation impact: none committed;
docs:checkandmetadata:checkpass.Read existing files or captured data.
Evidence and regression coverage
tests/boundary/mcp/evidenceRecordSelectionMcp.test.ts(new; production MCP registration, full and compact output profiles). It uses synthetic annotation, pseudocode-source and trace records shaped like the issue's observations; no provider runs. It covers:missing_evidence_linksreported only for selected records and cleared once the source is retained;complete+ filters,summary+limit,complete+offset, default-detaillimitandlimit: 0all rejected;tests/boundary/cli/analysisViewCli.test.ts:inspect-evidence-bundlewithdetail: "records"on a portable bundle file returns the same complete record.Before/after on a real session (Discord
app.asar, macOS arm64, Node 24.22.1, stdiorea mcp)get_evidence_bundle {}resource_constraint≥ 10,511,827 Bdetail: recordsinspect_analysis_viewon a retained view recordunsupported_targetunsupported_target(unchanged)get_evidence_bundle {detail:"records", filters:{evidence_id}}, a view recordinvalid_requestinvalid_requestresource_constraintwith "Request fewer records … a smaller limit or an exact evidence_id … A single record larger than one response needs export."Validation performed
npm run test:focusedonevidenceRecordSelectionMcp,analysisViewCli,largeToolResult,analysisViewMcp,fridaMcp,javascriptSourceSelectionandprocess-global/bundleComparisonFailures: 7 files, 115/115 passed.npm run test:changed: 444 files, 7377 passed, 22 skipped, and 1 failure,src/inspector/JavaScriptRuntimeScope.cancellation.test.ts("stops Inspector target authorization after the current stat settles"). That test also fails identically on a branch without this change on this macOS host. It is unrelated to this diff, which touches no Inspector code.npm run check:fast,npm run format:check,npm run docs:check,npm run metadata:check: passed.Compatibility, safety, and release
complete/summaryrequests are unchanged; only thecomplete+ filters error message now also namesrecords.Author readiness
Human owner: @kaoru0822-kitauji
Before merge
type(scope): outcome.🤖 Generated with Claude Code