How bookang869/re-vi works
Re:vi is a self-healing telemetry and alert-triage pipeline. Production alerts are enriched and deduplicated by the Gateway, queued for dispatch to the companion repository’s Hermes workflow, and later reported back for run tracking and a scheduled Slack digest. The Gateway also exposes a repair toggle and run-status endpoint. The README documents the observability stack and external repair workflow; source excerpts show key Gateway calls. The companion workflow’s internals are outside this repository, so it is represented as an external system.
Main entry points: main.go Gateway server · queue.go NATS JetStream · dispatcher.go Repair dispatcher · handler.go Outcome intake
Components 24
Telemetry and alerts
- OTel Collector
- VictoriaMetrics
- VictoriaLogs
- vmalert
- Alertmanager
Gateway processing
- Gateway server
gateway/cmd/server/main.go - Alert endpoint
gateway/internal/alerts/handler.go - Alert parsing
gateway/internal/alerts/alerts.go - Lock and publish
gateway/internal/alerts/dispatch.go - Log context query
gateway/internal/victorialogs/client.go - NATS JetStream
gateway/internal/queue/queue.go - Repair dispatcher
gateway/internal/dispatcher/dispatcher.go - GitHub dispatch
gateway/internal/github/dispatch.go - Repair toggle API
gateway/internal/admin/handler.go
Run tracking
- Run status API
gateway/internal/runs/handler.go - Outcome intake
gateway/internal/digest/handler.go - Run records
gateway/internal/store/store.go - Gateway metrics
gateway/internal/metrics/metrics.go
Digest delivery
- Digest scheduler
gateway/internal/digestcron/cron.go - Slack delivery
gateway/internal/slack/client.go
Other components
- Production app
- Target Hermes workflow
- Slack
- Operator
Connections 33
- Production app → OTel Collector: exports telemetry
README.md - OTel Collector → VictoriaMetrics: sends metrics
README.md - OTel Collector → VictoriaLogs: sends logs
README.md - VictoriaMetrics → vmalert: evaluates alerts
README.md - vmalert → Alertmanager: routes alerts
README.md - Alertmanager → Alert endpoint: posts webhook
README.md - Gateway server → Alert endpoint: registers route
gateway/cmd/server/main.go - Gateway server → Repair toggle API: registers routes
gateway/cmd/server/main.go - Gateway server → Outcome intake: registers route
gateway/cmd/server/main.go - Gateway server → Run status API: registers route
gateway/cmd/server/main.go - Gateway server → NATS JetStream: connects
gateway/cmd/server/main.go - Gateway server → Repair dispatcher: starts consumer
gateway/cmd/server/main.go - Gateway server → Digest scheduler: starts scheduler
gateway/cmd/server/main.go - Alert endpoint → Alert parsing: parses alerts
gateway/internal/alerts/handler.go - Alert endpoint → Lock and publish: publishes alerts
gateway/internal/alerts/handler.go - Lock and publish → NATS JetStream: locks and queues
gateway/internal/alerts/dispatch.go - Lock and publish → Log context query: fetches context
gateway/internal/alerts/dispatch.go - Log context query → VictoriaLogs: queries logs
gateway/internal/victorialogs/client.go - Repair dispatcher → NATS JetStream: consumes alerts
gateway/internal/dispatcher/dispatcher.go - Repair dispatcher → GitHub dispatch: dispatches event
gateway/internal/dispatcher/dispatcher.go - GitHub dispatch → Target Hermes workflow: triggers workflow
README.md - Repair dispatcher → Run records: records skipped runs
gateway/internal/dispatcher/dispatcher.go - Repair dispatcher → Gateway metrics: records routing
gateway/internal/dispatcher/dispatcher.go - Repair toggle API → NATS JetStream: sets repair toggle
gateway/internal/admin/handler.go - Outcome intake → NATS JetStream: buffers outcomes
gateway/internal/digest/handler.go - Outcome intake → Run records: records outcomes
gateway/internal/digest/handler.go - Outcome intake → Gateway metrics: counts failures
gateway/internal/digest/handler.go - Run status API → Run records: reads run status
gateway/internal/runs/handler.go - Target Hermes workflow → Outcome intake: reports outcomes
README.md - Digest scheduler → NATS JetStream: reads and clears digest
gateway/internal/digestcron/cron.go - Digest scheduler → Slack delivery: posts digest
gateway/internal/digestcron/cron.go - Slack delivery → Slack: sends message
gateway/internal/slack/client.go - Operator → Repair toggle API: controls repair
README.md