lifecycle

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendTransitionRecord

func AppendTransitionRecord(chain *proof.Chain, transition Transition, eventType string) error

func ChainPath

func ChainPath(statePath string) string

func LoadChain

func LoadChain(path string) (*proof.Chain, error)

func ParseExpiry

func ParseExpiry(raw string, now time.Time) (time.Time, error)

func RecordsForAgent

func RecordsForAgent(chain *proof.Chain, agentID string) []proof.Record

func SaveChain

func SaveChain(path string, chain *proof.Chain) error

Types

type ObservedTool

type ObservedTool struct {
	AgentID       string
	ToolID        string
	ToolType      string
	Org           string
	Repo          string
	Location      string
	DataClass     string
	EndpointClass string
	AutonomyLevel string
	RiskScore     float64
}

type Transition

type Transition struct {
	AgentID       string         `json:"agent_id" yaml:"agent_id"`
	PreviousState string         `json:"previous_state" yaml:"previous_state"`
	NewState      string         `json:"new_state" yaml:"new_state"`
	Trigger       string         `json:"trigger" yaml:"trigger"`
	Diff          map[string]any `json:"diff,omitempty" yaml:"diff,omitempty"`
	Timestamp     string         `json:"timestamp" yaml:"timestamp"`
}

func ApplyManualState

func ApplyManualState(m manifest.Manifest, agentID, state, approver, scope, reason string, expiresAt time.Time, now time.Time) (manifest.Manifest, Transition, error)

func Reconcile

func Reconcile(previous manifest.Manifest, observed []ObservedTool, now time.Time) (manifest.Manifest, []Transition)

Jump to

Keyboard shortcuts

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