lifecycle

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package lifecycle owns the config-apply lifecycle matrix shared by runtime, API, CLI, web, docs, and codegen checks.

Index

Constants

This section is empty.

Variables

View Source
var Matrix = []Rule{
	{Pattern: "skills.disabled_skills", Lifecycle: Live, DiffClass: DiffClassLive},
	{Pattern: pathDaemonReloadTimeoutProviders, Lifecycle: Live, DiffClass: DiffClassLive},
	{Pattern: pathDaemonReloadTimeoutMCP, Lifecycle: Live, DiffClass: DiffClassLive},
	{Pattern: pathDaemonReloadTimeoutBridges, Lifecycle: Live, DiffClass: DiffClassLive},
	{Pattern: "providers.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "mcp-servers.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "sandboxes.*", Lifecycle: SessionRebind, DiffClass: DiffClassSessionRebind},
	{Pattern: "hooks.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "extensions.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "defaults.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "limits.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "session.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "permissions.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "http.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "daemon.socket", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "memory.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "automation.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "network.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "observability.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "log.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
	{Pattern: "skills.*", Lifecycle: RestartRequired, DiffClass: DiffClassRestartRequired},
}

Matrix is the canonical config lifecycle matrix. Patterns use "." path segments and "*" wildcards for one segment.

Functions

func ClassifyPaths

func ClassifyPaths(paths []string) (Lifecycle, DiffClass, error)

ClassifyPaths returns the aggregate lifecycle and diff class for a mutation.

Types

type DiffClass

type DiffClass string

DiffClass summarizes the broad subsystem touched by one apply attempt.

const (
	DiffClassLive               DiffClass = DiffClass(Live)
	DiffClassLiveAdd            DiffClass = DiffClass(LiveAdd)
	DiffClassLiveRemoveIfUnused DiffClass = DiffClass(LiveRemoveIfUnused)
	DiffClassRestartRequired    DiffClass = DiffClass(RestartRequired)
	DiffClassSessionRebind      DiffClass = DiffClass(SessionRebind)
)

func DiffClassForRoot

func DiffClassForRoot(root string) DiffClass

DiffClassForRoot maps a settings section or collection name onto a diff class.

type Lifecycle

type Lifecycle string

Lifecycle names how a desired config change becomes daemon runtime truth.

const (
	// Live applies in-place and advances the active config generation.
	Live Lifecycle = "live"
	// LiveAdd applies a new catalog entry in-place and advances the active generation.
	LiveAdd Lifecycle = "live-add"
	// LiveRemoveIfUnused applies a removal only when the removed resource has no active users.
	LiveRemoveIfUnused Lifecycle = "live-remove-if-unused"
	// RestartRequired writes desired state but cannot update daemon runtime truth.
	RestartRequired Lifecycle = "restart-required"
	// SessionRebind applies to new sessions while existing sessions keep their bound runtime values.
	SessionRebind Lifecycle = "session-rebind"
)

type NextAction

type NextAction string

NextAction is the user/agent-facing recovery or continuation hint.

const (
	NextActionNone          NextAction = "none"
	NextActionRestartDaemon NextAction = "restart-daemon"
	NextActionNewSession    NextAction = "new-session"
	NextActionRetry         NextAction = "retry"
)

func NextActionForLifecycle

func NextActionForLifecycle(lifecycle Lifecycle, status Status) NextAction

NextActionForLifecycle returns the canonical user-visible next action.

type Rule

type Rule struct {
	Pattern   string
	Lifecycle Lifecycle
	DiffClass DiffClass
}

Rule records the lifecycle for a config path pattern.

func ClassifyPath

func ClassifyPath(path string) (Rule, error)

ClassifyPath returns the matrix rule for one changed config path.

func SortedMatrix

func SortedMatrix() []Rule

SortedMatrix returns a stable copy for docs and tests.

type Status

type Status string

Status names the persisted apply-record state.

const (
	StatusPendingApply Status = "pending_apply"
	StatusApplied      Status = "applied"
	StatusBlocked      Status = "blocked"
	StatusFailed       Status = "failed"
)

Jump to

Keyboard shortcuts

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