effects

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package effects ports Trajectory IR tool effect classes and MCP mapping. Rules match pkg/trajectory_ir/effects/classify.py (fail closed).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequiresBlockAndGate

func RequiresBlockAndGate(e EffectClass) bool

RequiresBlockAndGate reports whether resume must gate this effect (R02). Only NON_IDEMPOTENT_WRITE is gated. PURE (R03) and other classes may re-execute on resume without BlockedNeedsGate.

Types

type EffectClass

type EffectClass string

EffectClass is how dangerous a tool is for resume and gate policy.

const (
	PURE                 EffectClass = "PURE"
	READ_ONLY            EffectClass = "READ_ONLY"
	IDEMPOTENT_WRITE     EffectClass = "IDEMPOTENT_WRITE"
	NON_IDEMPOTENT_WRITE EffectClass = "NON_IDEMPOTENT_WRITE"
	AGENT_SPAWN          EffectClass = "AGENT_SPAWN"
	SENSITIVE            EffectClass = "SENSITIVE"
)

func ClassifyFromMCP

func ClassifyFromMCP(annotations map[string]any) EffectClass

ClassifyFromMCP maps MCP tool annotations to an EffectClass. Missing or ambiguous input becomes NON_IDEMPOTENT_WRITE.

Python treats annotations.get("x") is True / is False strictly, so only boolean true/false count. Other JSON types fall through to fail closed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL