boot

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package boot manages the Boot watchdog - the daemon's entry point for Deacon triage. Boot is a dog that runs fresh on each daemon tick, deciding whether to wake/nudge/interrupt the Deacon or let it continue. This centralizes the "when to wake" decision in an agent.

Index

Constants

View Source
const DefaultMarkerTTL = 5 * time.Minute

DefaultMarkerTTL is how long a marker is considered valid before it's stale.

View Source
const MarkerFileName = ".boot-running"

MarkerFileName is the file that indicates Boot is currently running.

View Source
const SessionName = "gt-boot"

SessionName is the tmux session name for Boot. Note: We use "gt-boot" instead of "hq-deacon-boot" to avoid tmux prefix matching collisions. Tmux matches session names by prefix, so "hq-deacon-boot" would match when checking for "hq-deacon", causing HasSession("hq-deacon") to return true when only Boot is running.

View Source
const StatusFileName = ".boot-status.json"

StatusFileName stores Boot's last execution status.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boot

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

Boot manages the Boot watchdog lifecycle.

func New

func New(townRoot string) *Boot

New creates a new Boot manager.

func (*Boot) AcquireLock

func (b *Boot) AcquireLock() error

AcquireLock creates the marker file to indicate Boot is starting. Returns error if Boot is already running.

func (*Boot) DeaconDir

func (b *Boot) DeaconDir() string

DeaconDir returns the Deacon's directory.

func (*Boot) Dir

func (b *Boot) Dir() string

Dir returns Boot's working directory.

func (*Boot) EnsureDir

func (b *Boot) EnsureDir() error

EnsureDir ensures the Boot directory exists.

func (*Boot) IsDegraded

func (b *Boot) IsDegraded() bool

IsDegraded returns whether Boot is in degraded mode.

func (*Boot) IsRunning

func (b *Boot) IsRunning() bool

IsRunning checks if Boot is currently running. Returns true if marker exists and isn't stale, false otherwise.

func (*Boot) IsSessionAlive

func (b *Boot) IsSessionAlive() bool

IsSessionAlive checks if the Boot tmux session exists.

func (*Boot) LoadStatus

func (b *Boot) LoadStatus() (*Status, error)

LoadStatus loads Boot's last execution status.

func (*Boot) ReleaseLock

func (b *Boot) ReleaseLock() error

ReleaseLock removes the marker file.

func (*Boot) SaveStatus

func (b *Boot) SaveStatus(status *Status) error

SaveStatus saves Boot's execution status.

func (*Boot) Spawn

func (b *Boot) Spawn() error

Spawn starts Boot in a fresh tmux session. Boot runs the mol-boot-triage molecule and exits when done. In degraded mode (no tmux), it runs in a subprocess.

func (*Boot) Tmux

func (b *Boot) Tmux() *tmux.Tmux

Tmux returns the tmux manager.

type Status

type Status struct {
	Running     bool      `json:"running"`
	StartedAt   time.Time `json:"started_at,omitempty"`
	CompletedAt time.Time `json:"completed_at,omitempty"`
	LastAction  string    `json:"last_action,omitempty"` // start/wake/nudge/nothing
	Target      string    `json:"target,omitempty"`      // deacon, witness, etc.
	Error       string    `json:"error,omitempty"`
}

Status represents Boot's execution status.

Jump to

Keyboard shortcuts

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