perf(evidence): reuse authenticated file snapshots during session import (#1721)

Seal file-backed MCP imports at the session boundary while preserving mutable
ordinary file reads. Validate internally constructed ledger candidates directly
with the existing immutable bundle constructor.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
This commit is contained in:
Ysopwnable
2026-10-11 13:53:01 +08:00
committed by GitHub
parent 91f6840c35
commit 966dc3acde
4 changed files with 95 additions and 33 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import type { EvidenceMcpServer } from "./EvidenceMcpServer.js";
import type { BinarySessionPort } from "../application/binary/BinarySessionPort.js";
import {
readEvidenceBundle,
readImmutableEvidenceBundle,
writeEvidenceBundle,
} from "../application/EvidenceBundleFiles.js";
import { toolContract } from "../contracts/toolContracts.js";
@@ -91,7 +91,7 @@ const registerImportEvidenceTool = ({
toolRegistrationOptions(importContract),
async (input) => {
const path = input.path;
const loaded = await readEvidenceBundle(path);
const loaded = await readImmutableEvidenceBundle(path);
if (!loaded.ok)
return server.delivery.toCallToolResult(loaded, importContract);
const retainedUnknownRevisions = new Set(