Documentation
¶
Index ¶
- Variables
- type Action
- type Controller
- func (c *Controller) Enforce(action Action, minimum Mode) error
- func (c *Controller) MarkFactPromotion()
- func (c *Controller) Mode() Mode
- func (c *Controller) ModeSet() bool
- func (c *Controller) RecordFailure(tool string)
- func (c *Controller) RecordFileEdit(path string)
- func (c *Controller) RefreshTinyTasksState() error
- func (c *Controller) RequiresStrict() bool
- func (c *Controller) SetMode(mode Mode) error
- func (c *Controller) StrictReason() string
- func (c *Controller) TinyTasksPath() string
- func (c *Controller) TriggerStrict(reason string)
- type Mode
Constants ¶
This section is empty.
Variables ¶
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) 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.