fix(mcp): preserve retained evidence on oversized delivery

This commit is contained in:
morluto
2026-10-09 05:55:55 +08:00
parent 826583dd43
commit 0639a541a3
36 changed files with 339 additions and 184 deletions
+9 -7
View File
@@ -23,7 +23,7 @@ import {
STATIC_RUNTIME_PROVIDER,
} from "./sessionToolPolicies.js";
import { toolRegistrationOptions } from "./toolRegistrationOptions.js";
import { toCallToolResult } from "./toolResult.js";
import { toCallToolResult, toEvidenceToolResult } from "./toolResult.js";
/** Register Evidence-composed differential investigation workflows. */
export const registerInvestigationTools = (
@@ -101,7 +101,7 @@ const registerChangedBehavior = (
],
},
);
return toCallToolResult(recorded, contract);
return toEvidenceToolResult(evidence, contract, recorded);
},
);
};
@@ -158,7 +158,7 @@ const registerCallPath = (
],
},
);
return toCallToolResult(recorded, contract);
return toEvidenceToolResult(evidence, contract, recorded);
},
);
};
@@ -198,7 +198,9 @@ const registerStaticRuntime = (
limitations: result.limitations,
evidenceLinks: links,
});
return toCallToolResult(
return toEvidenceToolResult(
evidence,
contract,
recordWorkflowEvidence(
session,
evidence,
@@ -218,7 +220,6 @@ const registerStaticRuntime = (
],
},
),
contract,
);
},
);
@@ -255,7 +256,9 @@ const registerReconstruction = (
limitations: result.limitations,
evidenceLinks: links,
});
return toCallToolResult(
return toEvidenceToolResult(
evidence,
contract,
recordWorkflowEvidence(session, evidence, result.status === "unknown", {
question: "Does the reconstruction satisfy every declared claim?",
domain: "reconstruction-verification",
@@ -266,7 +269,6 @@ const registerReconstruction = (
rationale,
})),
}),
contract,
);
},
);