[GH-ISSUE #99] Expose Evidence v2 records and analysis artifacts as MCP resources #65

Closed
opened 2026-10-15 18:20:44 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @morluto on GitHub (Jul 13, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/99

Summary

Expose retained Evidence v2, analysis snapshots, investigation workspaces, artifact pages, function dossiers, captures, and residual unknowns through addressable MCP resources and resource_link tool results.

Use REA's existing canonical evidence identities and 1.3.0 persistence primitives as the backing store. Do not create an unrelated second cache solely for MCP.

Current state in REA 1.3.0

  • Tool calls return full Evidence v2 records inline.
  • The session retains evidence and unknowns in memory.
  • Provider-neutral persistent analysis snapshots now exist.
  • Persistent cross-version investigation workspaces now exist with deterministic identities and CAS-linked revisions.
  • Evidence bundle import/export exists under approved roots.
  • No MCP resources, resource templates, rea:// URIs, subscriptions, or resource_link results exist.

User problem

Large evidence objects consume context repeatedly. Agents cannot cheaply retrieve only:

  • one capture dimension;
  • one artifact page;
  • one function dossier section;
  • one investigation revision;
  • one active unknown;
  • one canonical record by evidence ID.

They often re-run analysis or carry entire records through unrelated reasoning.

Canonical resource model

Candidate URI families:

  • rea://evidence/
  • rea://snapshot/
  • rea://workspace//revision/
  • rea://artifact/ with paged nodes, occurrences, and edges
  • rea://capture/ with terminal, filesystem, process, and protocol dimensions
  • rea://function//
  • rea://unknown/ and rea://unknowns/active

URI details may change, but identity must be canonical, stable, and derived from existing Evidence v2/store concepts.

Tool-result behavior

Evidence-producing tools should return:

  • concise structuredContent with primary IDs, status, authority, limitations, and pagination metadata;
  • resource_link blocks for large or independently useful evidence;
  • inline compatibility output for clients without resource support or for small results.

A resource link is discoverability, not authorization.

Storage and retention

Define one evidence repository abstraction over:

  • current session evidence;
  • imported/exported bundles;
  • persistent snapshots;
  • investigation workspaces;
  • retained process captures.

Every resource must report:

  • canonical evidence or content digest;
  • authority/confidence/provider;
  • creation or observation identity where applicable;
  • retention/expiry behavior;
  • limitations;
  • access context.

Security

  • Bind session evidence to the originating connection unless explicitly exported.
  • Enforce approved roots for persistent files.
  • Never let a rea:// URI escape filesystem policy.
  • Do not expose another client's tasks, captures, or unknown registry.
  • Keep secret-bearing capture bodies redacted/aliased according to capture policy.
  • Resource retrieval must not imply approval to extract, execute, mount, or access the network.

Acceptance criteria

  • REA implements an evidence repository abstraction shared by session state, snapshots, workspaces, and imported bundles.
  • Successful evidence-producing tools can return resource_link content.
  • Agents can fetch one evidence record by evidence ID without re-running analysis.
  • Capture dimensions are independently retrievable.
  • Artifact node/occurrence/edge collections remain deterministically paginated.
  • Function dossiers retain page/dimension identity and provider provenance.
  • Workspace revisions are immutable and CAS relationships remain verifiable.
  • Resource contents preserve canonical Evidence v2 hashes, authority, confidence, provider, locations, and limitations.
  • Missing, expired, unauthorized, and integrity-invalid resources return typed structured errors.
  • Access is isolated by session/authorization context.
  • Inline compatibility remains available for clients without resources.
  • Tests cover large pagination, stale IDs, expiry, session isolation, imported bundles, snapshot reuse, workspace revisions, and capture redaction.
  • Documentation defines URI stability and retention guarantees.

Non-goals

  • Treating MCP resources as an authorization boundary.
  • Making mutable Hopper GUI cursor state a durable resource.
  • Duplicating evidence bytes separately for every URI.
  • Replacing Evidence v2 bundle import/export.

Relationships

  • #97 may return task-result evidence links.
  • #100 governs structured tool and error contracts.
  • #73 governs the residual-unknown registry.
  • REA 1.3.0 snapshots and investigation workspaces should become backing stores rather than parallel systems.
Originally created by @morluto on GitHub (Jul 13, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/99 ## Summary Expose retained Evidence v2, analysis snapshots, investigation workspaces, artifact pages, function dossiers, captures, and residual unknowns through addressable MCP resources and resource_link tool results. Use REA's existing canonical evidence identities and 1.3.0 persistence primitives as the backing store. Do not create an unrelated second cache solely for MCP. ## Current state in REA 1.3.0 - Tool calls return full Evidence v2 records inline. - The session retains evidence and unknowns in memory. - Provider-neutral persistent analysis snapshots now exist. - Persistent cross-version investigation workspaces now exist with deterministic identities and CAS-linked revisions. - Evidence bundle import/export exists under approved roots. - No MCP resources, resource templates, rea:// URIs, subscriptions, or resource_link results exist. ## User problem Large evidence objects consume context repeatedly. Agents cannot cheaply retrieve only: - one capture dimension; - one artifact page; - one function dossier section; - one investigation revision; - one active unknown; - one canonical record by evidence ID. They often re-run analysis or carry entire records through unrelated reasoning. ## Canonical resource model Candidate URI families: - rea://evidence/<evidence-id> - rea://snapshot/<snapshot-digest> - rea://workspace/<workspace-id>/revision/<revision> - rea://artifact/<manifest-id> with paged nodes, occurrences, and edges - rea://capture/<evidence-id> with terminal, filesystem, process, and protocol dimensions - rea://function/<subject-sha256>/<address> - rea://unknown/<unknown-id> and rea://unknowns/active URI details may change, but identity must be canonical, stable, and derived from existing Evidence v2/store concepts. ## Tool-result behavior Evidence-producing tools should return: - concise structuredContent with primary IDs, status, authority, limitations, and pagination metadata; - resource_link blocks for large or independently useful evidence; - inline compatibility output for clients without resource support or for small results. A resource link is discoverability, not authorization. ## Storage and retention Define one evidence repository abstraction over: - current session evidence; - imported/exported bundles; - persistent snapshots; - investigation workspaces; - retained process captures. Every resource must report: - canonical evidence or content digest; - authority/confidence/provider; - creation or observation identity where applicable; - retention/expiry behavior; - limitations; - access context. ## Security - Bind session evidence to the originating connection unless explicitly exported. - Enforce approved roots for persistent files. - Never let a rea:// URI escape filesystem policy. - Do not expose another client's tasks, captures, or unknown registry. - Keep secret-bearing capture bodies redacted/aliased according to capture policy. - Resource retrieval must not imply approval to extract, execute, mount, or access the network. ## Acceptance criteria - [ ] REA implements an evidence repository abstraction shared by session state, snapshots, workspaces, and imported bundles. - [ ] Successful evidence-producing tools can return resource_link content. - [ ] Agents can fetch one evidence record by evidence ID without re-running analysis. - [ ] Capture dimensions are independently retrievable. - [ ] Artifact node/occurrence/edge collections remain deterministically paginated. - [ ] Function dossiers retain page/dimension identity and provider provenance. - [ ] Workspace revisions are immutable and CAS relationships remain verifiable. - [ ] Resource contents preserve canonical Evidence v2 hashes, authority, confidence, provider, locations, and limitations. - [ ] Missing, expired, unauthorized, and integrity-invalid resources return typed structured errors. - [ ] Access is isolated by session/authorization context. - [ ] Inline compatibility remains available for clients without resources. - [ ] Tests cover large pagination, stale IDs, expiry, session isolation, imported bundles, snapshot reuse, workspace revisions, and capture redaction. - [ ] Documentation defines URI stability and retention guarantees. ## Non-goals - Treating MCP resources as an authorization boundary. - Making mutable Hopper GUI cursor state a durable resource. - Duplicating evidence bytes separately for every URI. - Replacing Evidence v2 bundle import/export. ## Relationships - #97 may return task-result evidence links. - #100 governs structured tool and error contracts. - #73 governs the residual-unknown registry. - REA 1.3.0 snapshots and investigation workspaces should become backing stores rather than parallel systems.
bsakaguchi 2026-10-15 18:20:44 +00:00
Author
Owner

@morluto commented on GitHub (Jul 17, 2026):

Completed on current main. registerEvidenceResources exposes session-scoped evidence, sections and dimensions, unknowns, snapshots, artifact collections, function dossiers, workspace revisions, and reconstruction coverage. toolResult emits resource links; evidenceResources and investigation MCP tests cover list/read ownership, links, and stale IDs; docs/mcp-contracts.md documents URI, retention, and authorization behavior.

<!-- gh-comment-id:5001541287 --> @morluto commented on GitHub (Jul 17, 2026): Completed on current main. registerEvidenceResources exposes session-scoped evidence, sections and dimensions, unknowns, snapshots, artifact collections, function dossiers, workspace revisions, and reconstruction coverage. toolResult emits resource links; evidenceResources and investigation MCP tests cover list/read ownership, links, and stale IDs; docs/mcp-contracts.md documents URI, retention, and authorization behavior.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#65
No description provided.