Documentation
¶
Overview ¶
Package sessiondebug provides the target-bound, read-only evidence tool used by dedicated debug sessions.
Index ¶
- Constants
- func BindSelectedMCP(candidate tool.Tool, store port.SessionStore, target session.SessionID, ...) tool.Tool
- func New(target session.SessionID, store port.SessionStore, log port.EventLog) tool.Tool
- func NewBound(target session.SessionID, expectedFingerprint string, ...) tool.Tool
- type PermissionPolicy
Constants ¶
const (
// ToolName is the sole tool advertised by a dedicated debug engine.
ToolName = "InspectSession"
)
Variables ¶
This section is empty.
Functions ¶
func BindSelectedMCP ¶
func BindSelectedMCP(candidate tool.Tool, store port.SessionStore, target session.SessionID, expectedFingerprint string, expectedOwner *session.Principal, ownershipEnforced bool) tool.Tool
BindSelectedMCP wraps one selected direct MCP tool with a final target- incarnation check at execution time, after any interactive approval wait.
func New ¶
New constructs an InspectSession tool from the target's current incarnation. Composition uses NewBound so authorization and construction share one read.
func NewBound ¶
func NewBound(target session.SessionID, expectedFingerprint string, expectedOwner *session.Principal, ownershipEnforced bool, store port.SessionStore, log port.EventLog) tool.Tool
NewBound constructs an InspectSession tool permanently bound to one authorized target incarnation and owner scope.
Types ¶
type PermissionPolicy ¶
type PermissionPolicy struct {
// contains filtered or unexported fields
}
PermissionPolicy preserves deployment denies and configured asks while forcing every selected debug MCP call through a fresh human approval. Read-only annotations do not weaken this rule because outbound reads can disclose target-derived data.
func NewPermissionPolicy ¶
func NewPermissionPolicy(base port.PermissionPolicy, store port.SessionStore, target session.SessionID, expectedFingerprint string, expectedOwner *session.Principal, ownershipEnforced, headless bool, mounted []tool.Tool) *PermissionPolicy
NewPermissionPolicy decorates base for the selected direct MCP tools.
func (*PermissionPolicy) Evaluate ¶
func (p *PermissionPolicy) Evaluate(ctx context.Context, id session.SessionID, mode session.PermissionMode, call session.ToolCall, ws tool.WorkspaceReader) governance.PermissionDecision
Evaluate delegates to the base policy first. It preserves base denies and configured asks, grants InspectSession only as a debugger floor, and forces selected direct MCP calls through the debug approval posture after revalidating the target incarnation.