Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 2.5 KB

File metadata and controls

61 lines (47 loc) · 2.5 KB

CLAUDE.md

AI Skills

Follow the practices defined in ~/Projects/SiteNetSoft/ai-skills/:

  • dev-practices/golang/ — Go style, error handling, functions, testing, linting
  • dev-practices/git/ — Git authorship rules, multi-repo workspace patterns

Project Overview

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)

Build Commands

make build    # Build for current platform
make test     # Run tests
make clean    # Remove build artifacts

Architecture

Commands:

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):

  1. Compute fingerprint (SHA256 of source|name|sorted labels)
  2. Handle resolved -> update state, send resolve notification, record transition
  3. Check silences -> suppress if silenced
  4. Check flap detection -> suppress if >=5 transitions in 1h
  5. New alert -> create state, deliver (or group)
  6. Existing within dedup window -> increment count, suppress
  7. Existing within backoff -> suppress
  8. Check rate limits -> suppress if all channels exhausted
  9. Check grouping -> buffer if group_wait active
  10. 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.