reflexivecapture

package
v1.127.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package reflexivecapture wires reflexive knowledge activation (#635) into the platform: it observes Trino query errors and mints a "misconception + fix" correction memory when a later related query succeeds in the same session. It lives in its own package so the platform facade stays within its size budget and the wiring is cohesive and independently testable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wire

Wire registers the reflexive-capture middleware when enabled and the memory subsystem is available, returning the session error tracker so the caller can Stop it on shutdown (nil when not wired).

Types

type Config

type Config struct {
	Enabled *bool `yaml:"enabled"`
}

Config is the reflexive-capture YAML config block.

func (Config) IsEnabled

func (c Config) IsEnabled() bool

IsEnabled reports whether reflexive capture is enabled, defaulting to true when not explicitly set.

type Deps

type Deps struct {
	Enabled bool
	Server  *mcp.Server
	Toolkit *memorykit.Toolkit
	// BuildURN entity-keys a correction to the dataset it concerns. The
	// platform owns the one builder (connection -> platform and catalog
	// mapping -> URN); nil leaves corrections unkeyed.
	BuildURN middleware.URNBuilder
	// PersonaAllowsTool gates capture on the memory_capture grant. Nil means no
	// persona gating is configured (allow), matching the tools/list visibility
	// middleware when no authorizer is wired.
	PersonaAllowsTool PersonaToolCheck
}

Deps carries the platform primitives Wire needs, kept as plain values and closures so this package never imports the platform package (which would cycle).

type PersonaToolCheck

type PersonaToolCheck func(ctx context.Context, roles []string, tool string) bool

PersonaToolCheck reports whether a caller with the given roles is authorized the named tool. Reflexive capture uses it to respect the memory_capture grant.

Jump to

Keyboard shortcuts

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