supervisor

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSupervisedActionFromSDK

func NewSupervisedActionFromSDK(action core.Action, evaluator core.Evaluator, failureMode string, logger core.Logger) core.Action

func WithExtractor

func WithExtractor(action core.Action, ext Extractor) core.Action

WithExtractor sets the optional text-to-struct extractor on a supervised action. This enables the neuro-symbolic bridge: free-text LLM responses are extracted to structured data before flattenToQuads, so Datalog rules can fire on the result.

Parameters:

  • action: A supervised action (must be *supervisedActionV2).
  • ext: The extractor to use for free-text payloads.

Returns:

  • The action with extractor set, or the original action if type doesn't match.

Types

type Action

type Action interface {
	Execute(ctx context.Context, input domain.Envelope) (domain.Envelope, error)
}

Action defines the inner, unprotected execution capability.

type Extractor

type Extractor interface {
	// Extract converts free-text input to a structured payload.
	Extract(ctx context.Context, text string) (any, error)
}

Extractor defines the interface for converting free-text payloads to structured data. When set on a supervised action, it bridges the neuro-symbolic gap for unstructured LLM responses that would otherwise produce zero facts in flattenToQuads.

type SupervisedAction

type SupervisedAction struct {
	// contains filtered or unexported fields
}

SupervisedAction wraps an inner capability with the Zero-Trust Gatekeeper. LLD 6.1: Intercepts execution, shadows audit, and reflects on output.

func New

func New(inner Action, verifier ports.ReasoningPort, genePool ports.GenePoolPort) *SupervisedAction

func (*SupervisedAction) ExecuteInternal

func (g *SupervisedAction) ExecuteInternal(ctx context.Context, intent domain.IntentStr, input any) (domain.Envelope, error)

executeInternal wraps the payload in an Envelope and performs the shadow audit.

Jump to

Keyboard shortcuts

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