refactor(mcp): simplify evidence and workflows

This commit is contained in:
morluto
2026-09-29 13:58:26 +08:00
parent abf7c1142e
commit 6740ed5215
23 changed files with 79 additions and 83 deletions
@@ -33,7 +33,7 @@ describe("reconstruction obligation ledger CLI parity", () => {
);
expect(JSON.parse(stdout)).toMatchObject({
operation: "build_reconstruction_obligation_ledger",
predicate_type: "rea.reconstruction-obligation-ledger/v1",
predicate_type: "rea.reconstruction-obligation-ledger",
normalized_result: {
schema: "ReconstructionObligationLedger",
status: "unknown",
@@ -53,7 +53,7 @@ describe("Node runtime characterization", () => {
output_format: "commonjs-factory",
},
transformation_evidence: {
predicate_type: "rea.javascript-export-transformation/v1",
predicate_type: "rea.javascript-export-transformation",
authority: "shipped-artifact",
},
replay: { phase: "plan" },
@@ -84,7 +84,7 @@ describe("Node runtime characterization", () => {
evidence: { authority: "controlled-replay" },
},
evidence: {
predicate_type: "rea.runtime-characterization/v1",
predicate_type: "rea.runtime-characterization",
authority: "controlled-replay",
},
});
+2 -1
View File
@@ -1,4 +1,5 @@
import { Client, InMemoryTransport } from "@modelcontextprotocol/client";
import { tmpdir } from "node:os";
import { describe, expect, it } from "vitest";
import type { AnalysisOperationPort } from "../../../src/application/AnalysisProvider.js";
@@ -37,7 +38,7 @@ describe("MCP permission preflight", () => {
code: "permission_required",
details: {
capability: "artifact_extract",
missing: { roots: [expect.stringMatching(/rea-extracted-/u)] },
missing: { roots: [tmpdir()] },
},
remediation: {
restart_required: true,
+5 -6
View File
@@ -126,12 +126,11 @@ describe("guided prompts over MCP", () => {
arguments: { feature: " " },
}),
).rejects.toThrow(/Invalid arguments/u);
await expect(
client.getPrompt({
name: "investigate_feature",
arguments: { feature: "x".repeat(4_097) },
}),
).rejects.toThrow(/Invalid arguments/u);
const longPrompt = await client.getPrompt({
name: "investigate_feature",
arguments: { feature: "x".repeat(4_097) },
});
expect(longPrompt.messages[0]?.content).toMatchObject({ type: "text" });
await expect(client.getPrompt({ name: "missing_prompt" })).rejects.toThrow(
/not found/u,
);
+1 -1
View File
@@ -59,7 +59,7 @@ it("advertises the native function discovery-to-dossier workflow", async () => {
(await client.listTools()).tools.map((tool) => [tool.name, tool]),
);
expect(tools.get("binary_overview")?.description).toContain(
"follow with search_procedures or list_procedures, then pass a returned name or address to analyze_function",
"Use search_procedures, list_procedures, or analyze_function directly when you already know which procedure to inspect",
);
expect(tools.get("analyze_function")?.description).toContain(
"typically selected from search_procedures or list_procedures",
+1 -1
View File
@@ -108,7 +108,7 @@ describe("tool result projection", () => {
evidence: {
provider: { id: "fixture", name: "Fixture", version: "1" },
operation: "fixture",
predicate_type: "rea.analysis/v2",
predicate_type: "rea.analysis",
parameters: {},
raw_result: null,
confidence: "observed",