onboarding

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package onboarding derives bootstrap progress from authoritative artifacts and implements exact-plan configuration changes. It never persists an optimistic completion flag.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAuthority

func ApplyAuthority(plan AuthorityPlan) error

func CleanupAuthority added in v0.1.13

func CleanupAuthority(plan AuthorityPlan)

func CleanupHostAuthority

func CleanupHostAuthority(plan AuthorityPlan)

CleanupHostAuthority removes only the two artifacts created by a confirmed host-file onboarding plan. It is used to roll back a failed pre-publication transaction; callers must never use it for a configured authority.

func InitializeConfiguredSystemdAuthority added in v0.1.12

func InitializeConfiguredSystemdAuthority(ctx context.Context, configPath string) error

InitializeConfiguredSystemdAuthority creates and verifies only the database for a previously confirmed systemd-custody configuration. The KEK remains an externally delivered systemd credential and is never copied by Aegis.

func InitializeHostAuthority

func InitializeHostAuthority(ctx context.Context, plan AuthorityPlan) error

func InitializePassphraseAuthority added in v0.1.13

func InitializePassphraseAuthority(ctx context.Context, plan AuthorityPlan, passphrase []byte) error

func StatOwned0600

func StatOwned0600(path string) bool

StatOwned0600 is exposed for truthful previews without leaking platform ownership structures into terminal rendering.

Types

type AuthorityPlan

type AuthorityPlan struct {
	ConfigPath     string `json:"config_path"`
	StatePath      string `json:"state_path"`
	Custody        string `json:"custody"`
	Database       string `json:"database"`
	DeploymentID   string `json:"deployment_id"`
	KEKFile        string `json:"kek_file,omitempty"`
	KEKCredential  string `json:"kek_credential,omitempty"`
	OriginalDigest string `json:"original_config_digest"`
	ResultDigest   string `json:"result_config_digest"`
	Confirmation   string `json:"confirmation"`
	// contains filtered or unexported fields
}

func PreviewAuthority

func PreviewAuthority(configPath, custody string) (AuthorityPlan, error)

func (AuthorityPlan) String

func (p AuthorityPlan) String() string

type Check

type Check struct {
	Name   string `json:"name"`
	Status string `json:"status"`
	Reason string `json:"reason,omitempty"`
	Remedy string `json:"remedy,omitempty"`
}

type Inspector

type Inspector struct {
	Runtime             RuntimeDiscovery
	Current             func() (*user.User, error)
	LookupID            func(string) (*user.User, error)
	AuthorityPassphrase []byte
}

func NewInspector

func NewInspector(runtime RuntimeDiscovery) *Inspector

func (*Inspector) Inspect

func (i *Inspector) Inspect(ctx context.Context, configuredPath string) Snapshot

Inspect is read-only. It does not open the normal Aegis store, start Ollama, load a model, or update credential-authority shutdown metadata.

func (*Inspector) WithAuthorityPassphrase added in v0.1.13

func (i *Inspector) WithAuthorityPassphrase(passphrase []byte) *Inspector

type RuntimeDiscovery

type RuntimeDiscovery interface {
	Discover(context.Context) (core.RuntimeDescriptor, error)
}

type Snapshot

type Snapshot struct {
	State         State   `json:"state"`
	Reason        string  `json:"reason"`
	NextCommand   string  `json:"next_command"`
	ConfigPath    string  `json:"config_path"`
	StatePath     string  `json:"state_path,omitempty"`
	Principal     string  `json:"principal,omitempty"`
	HermesPath    string  `json:"hermes_path,omitempty"`
	HermesVersion string  `json:"hermes_version,omitempty"`
	OllamaRoute   string  `json:"ollama_route,omitempty"`
	Model         string  `json:"model,omitempty"`
	ModelDigest   string  `json:"model_digest,omitempty"`
	Checks        []Check `json:"checks"`
}

type State

type State string
const (
	Uninitialized       State = "uninitialized"
	PrincipalConfigured State = "principal-configured"
	AuthorityConfigured State = "authority-configured"
	RuntimeConfigured   State = "runtime-configured"
	ModelPresent        State = "model-present"
	ModelCertified      State = "model-certified"
	Ready               State = "ready"
	RepairRequired      State = "repair-required"
)

Jump to

Keyboard shortcuts

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