configreload

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package configreload is the dependency-neutral, secret-safe canonical reload contract.

It declares trigger kinds, terminal result categories, and bounded result/status/history shapes used by runtimehost, public facades, management HTTP, and diagnostics. This package must not import internal config, source, or runtime packages and must not carry raw YAML, credentials, DSNs, private digests, filesystem paths, or opaque plugin configuration (requirements 7.1–7.8).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsKnownTriggerKind

func IsKnownTriggerKind(k TriggerKind) bool

IsKnownTriggerKind reports whether k is in the closed trigger vocabulary.

Types

type HistoryEntry

type HistoryEntry struct {
	AttemptID           int64
	Trigger             TriggerKind
	Stage               string
	Category            ResultCategory
	ActiveGeneration    int64
	CandidateGeneration int64
	DurationMs          int64
	RestartFieldCount   int
	ReasonCategory      string
	SafeActor           string
	RecordedAt          time.Time
}

HistoryEntry is one bounded, secret-safe reload attempt/status record.

func CloneHistory

func CloneHistory(in []HistoryEntry) []HistoryEntry

CloneHistory returns a defensive copy of history entries (nil stays nil).

type Result

type Result struct {
	Category           ResultCategory
	AttemptID          int64
	ActiveGeneration   int64
	PreviousGeneration int64
	RestartFields      []string
	RestartFieldCount  int
	ReasonCategory     string
	CoalescedSignals   int64
}

Result is the bounded, secret-safe terminal outcome of one attempt. It never carries raw YAML, private digests, credentials, paths, or configuration values.

func (Result) Clone

func (r Result) Clone() Result

Clone returns a defensive copy with an independent RestartFields slice.

type ResultCategory

type ResultCategory string

ResultCategory is the terminal reload attempt classification.

const (
	ResultPublished         ResultCategory = "published"
	ResultNoop              ResultCategory = "no-op"
	ResultBusy              ResultCategory = "busy"
	ResultRestartRequired   ResultCategory = "restart-required"
	ResultRetentionBlocked  ResultCategory = "retention-blocked"
	ResultInvalid           ResultCategory = "invalid"
	ResultSourceIntegrity   ResultCategory = "source-integrity-failed"
	ResultCanceled          ResultCategory = "canceled"
	ResultPreparationFailed ResultCategory = "preparation-failed"
	ResultInternalFailed    ResultCategory = "internal-failed"
)

func NormalizeResultCategory

func NormalizeResultCategory(c ResultCategory) ResultCategory

NormalizeResultCategory maps an unknown category to ResultInternalFailed once at the error boundary. Empty stays empty so callers can distinguish "unset". Policy uses a private closed switch independent of the ResultCategories enumeration copy handed to callers.

func ResultCategories

func ResultCategories() []ResultCategory

ResultCategories returns a defensive copy of the closed vocabulary for terminal attempt results. Mutating the returned slice affects neither later calls nor category validation policy.

type Status

type Status struct {
	ActiveGeneration    int64
	CurrentAttempt      *Result // non-nil while Busy
	LastResult          Result
	LastSuccess         Result
	LastFailure         Result // most recent failed or no-op attempt
	SourceIntegrity     string // bounded posture category (ok|failed|unknown)
	RetainedGenerations int
	RetentionPressure   bool
	ControlDegraded     bool // reload-control posture; independent of data-plane readiness
	ModelGeneration     string
	History             []HistoryEntry
	Busy                bool
	PendingSignal       bool
	CoalescedSignals    int64
}

Status is the bounded public status snapshot. It never carries raw YAML, credentials, DSNs, filesystem paths, or opaque plugin configuration. Fixed-source filesystem paths are intentionally omitted; management adapters retrieve them through a narrow coordinator capability (for example FixedSourcePath()).

func (Status) Clone

func (s Status) Clone() Status

Clone returns a defensive copy of status, including CurrentAttempt and History.

type Trigger

type Trigger struct {
	Kind       TriggerKind
	AcceptedAt time.Time
	SafeActor  string
}

Trigger is the host-accepted explicit reload envelope.

type TriggerKind

type TriggerKind string

TriggerKind identifies the explicit reload trigger surface. Triggers never carry paths, YAML, URLs, or plugin-install instructions.

const (
	TriggerSIGHUP TriggerKind = "sighup"
	TriggerAPI    TriggerKind = "api"
)

Jump to

Keyboard shortcuts

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