How duckiec/srek3s works
SREK3S is a read-only Kubernetes incident-response agent. The principal path observes pod failures, sanitizes telemetry before egress, sends a validated incident to the Python service, and returns a deterministic triage outcome with a verified GitOps patch where safe or human escalation otherwise. The graph includes the documented verification and provider capabilities; some internal wiring is omitted where excerpts do not establish the call.
Main entry points: triage.py Triage orchestration · main.py Triage API · pool.go Incident worker pool · main.go Sentinel process
Components 25
Cluster observation
- Read-only Kubernetes access
internal/k8s - Pod failure watcher
internal/k8s/watcher.go - Incident worker pool
internal/worker/pool.go - Sentinel process
cmd/sentinel/main.go
Sanitize and transport
- Secret scrubbing
internal/scrubber/scrubber.go - Payload and HTTP emitter
internal/emitter/emitter.go
Triage and remediation
- Triage orchestration
agent/triage.py - Classification and routing
agent/classifier.py - Evidence and rationale
agent/prompt.py - Analysis budget
agent/budget.py - Model boundary
agent/llm.py - Model provider adapters
agent/providers.py - Patch generation
agent/patch.py - Patch verification
agent/verify.py - Output rescanning
agent/rescan.py - Human escalation
agent/warroom.py
Agent runtime
- Triage API
agent/main.py - Incident and response schemas
agent/models.py - Jailed analysis worker
agent/sandbox.py - Deterministic worker
agent/sandbox_worker.py
Other components
- Cluster operator
- GitOps manifest checkout
- Kubernetes cluster
- LLM service
- GitOps reviewer
Connections 27
- Sentinel process → Pod failure watcher: starts watch
cmd/sentinel/main.go - Sentinel process → Incident worker pool: starts pool
cmd/sentinel/main.go - Sentinel process → Read-only Kubernetes access: wires clients
cmd/sentinel/main.go - Pod failure watcher → Read-only Kubernetes access: observes pods
- Read-only Kubernetes access → Kubernetes cluster: reads events
- Pod failure watcher → Incident worker pool: queues incidents
- Incident worker pool → Secret scrubbing: scrubs telemetry
internal/worker/pool.go - Incident worker pool → Payload and HTTP emitter: dispatches incident
internal/worker/pool.go - Payload and HTTP emitter → Triage API: posts payload
- Triage API → Incident and response schemas: validates contract
agent/main.py - Triage API → Analysis budget: bounds jobs
agent/main.py - Triage API → Jailed analysis worker: runs analysis
agent/main.py - Jailed analysis worker → Deterministic worker: executes worker
agent/sandbox_worker.py - Deterministic worker → Classification and routing: classifies and routes
agent/sandbox_worker.py - Triage API → Triage orchestration: orchestrates triage
agent/main.py - Triage orchestration → Classification and routing: classifies and routes
agent/triage.py - Triage orchestration → Evidence and rationale: builds evidence
agent/triage.py - Triage orchestration → Model boundary: requests analysis
agent/triage.py - Model boundary → Model provider adapters: selects transport
agent/llm.py - Model provider adapters → LLM service: sends prompt
- Triage orchestration → Patch generation: generates patch
agent/triage.py - Triage orchestration → Patch verification: verifies patch
- Patch verification → GitOps manifest checkout: checks target bytes
- Triage orchestration → Output rescanning: redacts response
agent/triage.py - Triage orchestration → Human escalation: escalates for review
agent/triage.py - Triage API → GitOps reviewer: returns RCA or escalation
- Cluster operator → Kubernetes cluster: deploys agent