fix(mcp): declare binary session prerequisite process effects
Recover the isolated effect metadata correction identified in #1669. Keep the generic annotation-algebra fixture independent of operation-specific effects. Co-authored-by: Pompilio Donato <238757198+pompiliodonatoapp@users.noreply.github.com>
This commit is contained in:
parent
4758ba30b6
commit
579ecbd032
|
|
@ -1,7 +1,11 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { TOOL_CONTRACTS } from "./toolContracts.js";
|
||||
import { TOOL_EFFECTS, annotationsFromEffects } from "./toolEffects.js";
|
||||
import {
|
||||
TOOL_EFFECTS,
|
||||
annotationsFromEffects,
|
||||
type ToolEffects,
|
||||
} from "./toolEffects.js";
|
||||
|
||||
/**
|
||||
* Descriptions that name running, launching, executing, starting, installing,
|
||||
|
|
@ -148,8 +152,19 @@ describe("tool effects", () => {
|
|||
});
|
||||
|
||||
it("derives destructiveHint from each destructive effect alone", () => {
|
||||
const base = TOOL_EFFECTS["binary_session"];
|
||||
if (base === undefined) throw new Error("binary_session is unaudited");
|
||||
// Keep annotation algebra independent of any operation's audited effects.
|
||||
const base: ToolEffects = {
|
||||
mutatesTarget: false,
|
||||
mutatesSession: false,
|
||||
writesFilesystem: false,
|
||||
launchesProcess: false,
|
||||
accessesNetwork: false,
|
||||
changesUiState: false,
|
||||
mayDiscardData: false,
|
||||
executesForeignCode: false,
|
||||
mutatesDevice: false,
|
||||
idempotent: true,
|
||||
};
|
||||
expect(annotationsFromEffects(base)).toEqual({
|
||||
readOnlyHint: true,
|
||||
destructiveHint: false,
|
||||
|
|
|
|||
|
|
@ -605,7 +605,7 @@ export const TOOL_EFFECTS: Readonly<Record<string, ToolEffects>> = {
|
|||
mayDiscardData: true,
|
||||
idempotent: false,
|
||||
}),
|
||||
binary_session: effects(),
|
||||
binary_session: effects({ launchesProcess: true }),
|
||||
export_evidence_bundle: effects({
|
||||
writesFilesystem: true,
|
||||
mayDiscardData: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue