Follow the practices defined in ~/Projects/SiteNetSoft/ai-skills/:
dev-practices/golang/— Go style, error handling, functions, testing, lintingdev-practices/git/— Git authorship rules, multi-repo workspace patterns
Lighthouse is the notification/alerting tool in the Amadla pipeline. It sits at the end of pipelines (unravel discover | judge audit | lighthouse notify) and provides intelligent notification suppression to prevent alert storms.
Entity types: None (receives alerts from other tools via stdin/file)
make build # Build for current platform
make test # Run tests
make clean # Remove build artifactsCommands:
lighthouse notify -f <file> # Process incoming alert
lighthouse resolve -f <file> # Send resolution notification
lighthouse silence <fp> --for 2h # Silence an alert
lighthouse status # Show active alerts/silences
lighthouse plugins # List discovered plugins
Package Structure:
main.go- CLI entry point (Cobra)alert/- Alert struct, fingerprinting, parsing (JSON/YAML)config/- Configuration loading (~/.config/lighthouse/config.yaml)engine/- Core suppression pipeline (dedup, backoff, grouping, flap detection, rate limiting, silencing)state/- Alert/silence/group/rate-limit state persistence (~/.local/share/lighthouse/)plugin/- Plugin discovery and execution (PATH scanning for lighthouse-* binaries)cmd/- CLI commands
Suppression Pipeline (engine.Process):
- Compute fingerprint (SHA256 of source|name|sorted labels)
- Handle resolved -> update state, send resolve notification, record transition
- Check silences -> suppress if silenced
- Check flap detection -> suppress if >=5 transitions in 1h
- New alert -> create state, deliver (or group)
- Existing within dedup window -> increment count, suppress
- Existing within backoff -> suppress
- Check rate limits -> suppress if all channels exhausted
- Check grouping -> buffer if group_wait active
- Deliver via plugin(s), update backoff
Plugin Protocol (lighthouse- binaries):
info-> JSON metadata (name, version, channel, description)send-> reads enriched alert JSON from stdin, delivers, outputs result JSON
Exit codes: 0=success, 1=delivery failure, 2=usage error.
Note: lighthouse is a CLI, not a daemon. Group flush happens at the next notify call. group_wait is a minimum, not exact.