execution

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStrictRequired = errors.New("STRICT mode required")

ErrStrictRequired is returned when the current execution requires STRICT mode.

Functions

This section is empty.

Types

type Action

type Action string

Action represents a guarded action that is regulated by the execution mode controller.

const (
	ActionMemoryQuery       Action = "memory_query"
	ActionMemoryWrite       Action = "memory_write"
	ActionTaskMutation      Action = "task_mutation"
	ActionFactPromotion     Action = "fact_promotion"
	ActionMemoryStats       Action = "memory_stats"
	ActionMemoryHealth      Action = "memory_health"
	ActionMemoryDoctor      Action = "memory_doctor"
	ActionMemoryEvalStats   Action = "memory_eval_stats"
	ActionMemoryRunMetadata Action = "memory_run_metadata"
	ActionClaimSuccess      Action = "memory_claim_success"
	ActionTaskAuthority     Action = "memory_check_task_authority"
	ActionTaskList          Action = "task_list"
	ActionTaskAdd           Action = "task_add"
	ActionTaskUpdate        Action = "task_update"
	ActionTaskComplete      Action = "task_complete"
	ActionModeDeclaration   Action = "memory_set_mode"
	ActionArtifactCreate    Action = "artifact_create"
	ActionArtifactRead      Action = "artifact_read"
	ActionArtifactList      Action = "artifact_list"
)

type Controller

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

Controller tracks the current execution mode, escalation state, and tinyTasks mutations.

func NewController

func NewController(initial Mode, tinyTasksPath string) *Controller

NewController creates a controller with the provided initial mode and tinyTasks path.

func (*Controller) Enforce

func (c *Controller) Enforce(action Action, minimum Mode) error

Enforce checks whether an action can proceed given the requested minimum mode. Read-only operations (PASSIVE level) are always allowed without explicit mode. Mutating operations (GUARDED/STRICT) require explicit mode declaration.

func (*Controller) MarkFactPromotion

func (c *Controller) MarkFactPromotion()

MarkFactPromotion marks that fact promotion requires STRICT mode.

func (*Controller) Mode

func (c *Controller) Mode() Mode

Mode returns the current execution mode.

func (*Controller) ModeSet

func (c *Controller) ModeSet() bool

ModeSet reports whether a mode has been explicitly set via SetMode.

func (*Controller) RecordFailure

func (c *Controller) RecordFailure(tool string)

RecordFailure records a failing tool invocation and checks for escalation.

func (*Controller) RecordFileEdit

func (c *Controller) RecordFileEdit(path string)

RecordFileEdit records an edit attempt for the given path.

func (*Controller) RefreshTinyTasksState

func (c *Controller) RefreshTinyTasksState() error

RefreshTinyTasksState checks the tinyTasks file for changes.

func (*Controller) RequiresStrict

func (c *Controller) RequiresStrict() bool

RequiresStrict reports whether the controller currently forces STRICT mode.

func (*Controller) SetMode

func (c *Controller) SetMode(mode Mode) error

SetMode updates the controller's mode and updates the environment variable.

func (*Controller) StrictReason

func (c *Controller) StrictReason() string

StrictReason returns the reason STRICT mode is required.

func (*Controller) TinyTasksPath

func (c *Controller) TinyTasksPath() string

TinyTasksPath returns the configured tinyTasks file path.

func (*Controller) TriggerStrict

func (c *Controller) TriggerStrict(reason string)

TriggerStrict marks that STRICT mode is required for future actions.

type Mode

type Mode string

Mode represents the execution mode of tinyMem.

const (
	ModePassive Mode = "PASSIVE"
	ModeGuarded Mode = "GUARDED"
	ModeStrict  Mode = "STRICT"
)

func ParseMode

func ParseMode(value string) (Mode, error)

ParseMode converts a string to a Mode value.

Jump to

Keyboard shortcuts

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