Expose private evidence associations through HTTP and agent tools
Retained evidence can be linked to multiple existing roster/business records by the companion Database #90, but humans and agents cannot yet invoke that shared operation. Add attach_evidence, read_evidence_attachment and list_evidence_attachments to authenticated POST /api/context, plus individually discoverable standard MCP tools using the same domain function and authenticated actor.
Strict typed inputs reject identity overrides, unknown fields, duplicate UUID targets and unsupported target shapes. Validated receipts must match the requested owner, version, receipt or target set; invalid/cross-scope responses are withheld. These operations express relevance only and run no provider/model collection, provisioning, roster enrollment or charges. The database transaction remains responsible for current membership, independent target access, retention, exact-key replay/conflict, immutable history and withdrawals. Professional-containing evidence actions and their dedicated tools remain excluded from delegated OAuth pending the organization-grant audit.
Standard MCP's existing combined Context tool advertises an empty union input schema in the real SDK. The three new evidence tools therefore use individually discoverable object schemas. Combined and dedicated handlers share authentication/domain logic and now mark Context failures with isError: true while withholding private storage errors. Existing combined Context actions remain compatible; this is not a redesign of all legacy tool discovery.
Validation: 64 focused tests across seven files pass, including 41 new operation/HTTP/MCP cases and real MCP SDK discovery/execution for all three evidence tools, caller overrides, revoked scope, mismatched output, empty withheld pages, and delegated catalog exclusion. Ten operation tests and five transport regressions failed before their fixes. Full lint, scoped formatting/diff checks, extension build and typecheck:mcp-oauth pass, as do 188 compatibility tests (one skipped). The initial local build failure was corrected by reusing the matching locked UI workspace dependencies; no dependencies changed. Database tests pass independently on disposable PostgreSQL15/17. No hosted customer import, merge or deployment occurred.
Release Database #90 and verify all migrations/permissions before deploying this API. Database head74f7e3e preserves the already-applied initial migration and applies forward corrections; its fresh/upgrade tests, CI15/16 and current preview pass. Final API head0de8df4f CI and both final reviews must be rechecked before approval/release. This slice does not implement original-file registration, version discovery, validated document locators, parsing, review or saved company assessments. Research-to-roster side effects still need explicit-intent correction before broad provider imports. Part of recoupable/app#2116, #2147 and #2140.