bootstrap

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Overview

dependency wiring, and control-plane serving in one process seam.

Package bootstrap wires the local Swobu runtime.

It owns startup composition for the daemon process boundary: config loading, dependency wiring, listener startup, and the minimal runtime status truth the rest of the process can query.

Bootstrap also composes embedded telemetry runtime export as a downstream consumer of traffic evidence append events (plus local install state) rather than a request-path control input. It does not own HTTP rendering, domain rules, or provider dialect behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

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

Daemon is the live process boundary produced by bootstrap. It owns listener lifetime, runtime health, and graceful shutdown for the local daemon.

Close owns cleanup: it drives http.Server.Shutdown (which stops accepting and waits for active handlers to finish before returning), then stops telemetry and closes the config store. Cleanup therefore never overlaps an in-flight request. There is no retryable shutdown state machine and no force-close mode: a handler that ignores cancellation will block Close, which is the process supervisor's boundary to break. Close runs once and returns the cached terminal result.

func Start

func Start(ctx context.Context, in StartInput) (*Daemon, error)

operator routes, and request-path dependencies in one bootstrap flow.

func (*Daemon) Addr

func (d *Daemon) Addr() string

func (*Daemon) BaseURL

func (d *Daemon) BaseURL() string

func (*Daemon) Close

func (d *Daemon) Close() error

Close stops request serving before closing request-owned dependencies. Shutdown stops accepting and waits for active handlers to finish; only then are telemetry and the config store closed. It runs once and returns the cached terminal result (the join of shutdown, serve, and cleanup errors).

func (*Daemon) Status

func (d *Daemon) Status() (Status, error)

func (*Daemon) Wait

func (d *Daemon) Wait(ctx context.Context) error

type HealthState

type HealthState string
const (
	HealthStateUninitialized HealthState = "uninitialized"
	HealthStateHealthy       HealthState = "healthy"
	HealthStateDegraded      HealthState = "degraded"
)

type StartInput

type StartInput struct {
	ConfigPath       string
	StartupConfig    config.StartupConfig
	Providers        provider.BackendResolver
	ModelCatalog     provider.Discovery
	TrafficEventSink observation.TrafficEventSink
	Logger           *slog.Logger
}

StartInput collects the one runtime config path plus the dependencies bootstrap must wire into the live request path.

type Status

type Status struct {
	State          HealthState `json:"state"`
	WorkspaceCount int         `json:"workspace_count"`
}

Status is the first machine-readable runtime health projection. CLI and TUI surfaces can render or relay it without re-deriving state from prose.

Jump to

Keyboard shortcuts

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