classifier

package
v1.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SignalModeClassifier

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

SignalModeClassifier classifies signals as reactive or proactive using a YAML-based lookup table.

Design Decision: YAML config (not Rego) because signal mode classification is a simple key-value lookup, unlike severity/environment/priority which evaluate complex multi-input policies via Rego.

BR-SP-106: Proactive Signal Mode Classification ADR-054: Proactive Signal Mode Classification and Prompt Strategy

func NewSignalModeClassifier

func NewSignalModeClassifier(logger logr.Logger) *SignalModeClassifier

NewSignalModeClassifier creates a new signal mode classifier. The classifier starts with empty mappings (all signals default to reactive) until LoadConfig is called.

func (*SignalModeClassifier) Classify

func (c *SignalModeClassifier) Classify(signalName string) SignalModeResult

Classify determines the signal mode and normalized name for a given signal name.

  • If the signal name is in the proactive mappings, it returns mode "proactive" with the normalized (base) name and preserves the original for audit.
  • Otherwise, it returns mode "reactive" with the name unchanged.

This is a pure function (no I/O) after config is loaded. Safe for concurrent use.

func (*SignalModeClassifier) LoadConfig

func (c *SignalModeClassifier) LoadConfig(configPath string) error

LoadConfig loads proactive signal mappings from a YAML config file. This method is safe for concurrent use and supports hot-reload (BR-SP-072 pattern): call it again to update mappings at runtime.

type SignalModeResult

type SignalModeResult struct {
	// SignalMode is "reactive" (default) or "proactive"
	SignalMode string
	// SignalName is the base signal name for workflow catalog matching.
	// For proactive signals, this is the mapped base name (e.g., "OOMKilled").
	// For reactive signals, this is the original name unchanged.
	SignalName string
	// SourceSignalName is preserved for audit trail (SOC2 CC7.4).
	// Only populated for proactive signals; empty for reactive.
	SourceSignalName string
}

SignalModeResult contains the classification outcome for a signal name. BR-SP-106: Proactive Signal Mode Classification ADR-054: Proactive Signal Mode Classification and Prompt Strategy

Jump to

Keyboard shortcuts

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