Documentation
¶
Overview ¶
Package logging projects Spice Agent events into the Spice-native structured logger through one bounded best-effort mailbox. It never treats diagnostic logging as durable history or execution authority.
Index ¶
- Constants
- func NewMailbox(config Config) (*event.BestEffortObserver, error)
- type Config
- type CorrelationKey
- type HealthSource
- type Processor
- type Snapshot
- func (snapshot Snapshot) Closed() bool
- func (snapshot Snapshot) DecodeFailures() uint64
- func (snapshot Snapshot) Filtered() uint64
- func (snapshot Snapshot) Handled() uint64
- func (snapshot Snapshot) LogFailures() uint64
- func (snapshot Snapshot) OverflowDropped() uint64
- func (snapshot Snapshot) Processed() uint64
Constants ¶
const ContractVersion = "spice.agent.logging/v1"
ContractVersion identifies the safe Agent event projection.
Variables ¶
This section is empty.
Functions ¶
func NewMailbox ¶
func NewMailbox(config Config) (*event.BestEffortObserver, error)
NewMailbox constructs the sole queue used by Agent logging. Model deltas are always filtered; tool progress is admitted only by explicit configuration.
Types ¶
type Config ¶
type Config struct {
MailboxCapacity int
IncludeProgress bool
ReadinessImpact bool
CorrelationKey CorrelationKey
}
Config owns the bounded Agent logging mailbox and optional readiness impact. A zero CorrelationKey requests fresh process-local random key material.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns conservative secret-safe production defaults.
type CorrelationKey ¶
type CorrelationKey struct {
// contains filtered or unexported fields
}
CorrelationKey is immutable HMAC material with no material accessor.
func NewCorrelationKey ¶
func NewCorrelationKey(material []byte) (CorrelationKey, error)
NewCorrelationKey defensively copies exact 256-bit application-owned key material. Callers must treat the input as secret configuration.
type HealthSource ¶
type HealthSource struct {
// contains filtered or unexported fields
}
HealthSource is an optional passive fixed-code readiness contribution.
func NewHealthSource ¶
func NewHealthSource(config Config, processor *Processor) *HealthSource
NewHealthSource constructs an in-memory-only health adapter.
func (*HealthSource) HealthContribution ¶
func (source *HealthSource) HealthContribution() daemon.HealthContribution
HealthContribution never exposes handler errors or event payload text.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor owns exactly one consumer for one Agent logging mailbox.
func NewProcessor ¶
func NewProcessor( config Config, mailbox *event.BestEffortObserver, logger *spicelogging.Logger, ) (*Processor, lifecycle.Cleanup, error)
NewProcessor starts one lifecycle-owned consumer. Logger failures remain diagnostic accounting and never become Agent execution failures.
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot is one immutable accounting and health view.
func (Snapshot) DecodeFailures ¶
func (Snapshot) LogFailures ¶
func (Snapshot) OverflowDropped ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package autoconfigure contributes Agent event logging only when an application explicitly blank-imports it.
|
Package autoconfigure contributes Agent event logging only when an application explicitly blank-imports it. |