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
- type Boot
- func (b *Boot) AcquireLock() error
- func (b *Boot) DeaconDir() string
- func (b *Boot) Dir() string
- func (b *Boot) EnsureDir() error
- func (b *Boot) IsDegraded() bool
- func (b *Boot) IsRunning() bool
- func (b *Boot) IsSessionAlive() bool
- func (b *Boot) LoadStatus() (*Status, error)
- func (b *Boot) ReleaseLock() error
- func (b *Boot) SaveStatus(status *Status) error
- func (b *Boot) Spawn() error
- func (b *Boot) Tmux() *tmux.Tmux
- type Status
Constants ¶
const DefaultMarkerTTL = 5 * time.Minute
DefaultMarkerTTL is how long a marker is considered valid before it's stale.
const MarkerFileName = ".boot-running"
MarkerFileName is the file that indicates Boot is currently running.
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.
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 (*Boot) AcquireLock ¶
AcquireLock creates the marker file to indicate Boot is starting. Returns error if Boot is already running.
func (*Boot) IsDegraded ¶
IsDegraded returns whether Boot is in degraded mode.
func (*Boot) IsRunning ¶
IsRunning checks if Boot is currently running. Returns true if marker exists and isn't stale, false otherwise.
func (*Boot) IsSessionAlive ¶
IsSessionAlive checks if the Boot tmux session exists.
func (*Boot) LoadStatus ¶
LoadStatus loads Boot's last execution status.
func (*Boot) SaveStatus ¶
SaveStatus saves Boot's execution status.
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.