You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Introduce a pluggable event sink architecture that allows operators to
choose Redis Streams, Lode, or both as the destination for granular
runtime events. Events flow through a `FanoutEventSink` that dispatches
to configured sinks concurrently, with per-sink delivery guarantees
(`mandatory` or `best_effort`). Artifact chunks always route to Lode
regardless of event sink configuration.
## Highlights
- **`EventSink` interface** — narrow event-only abstraction
(`WriteEvents` + `Close`), separate from the full `policy.Sink` which
also handles artifact chunks
- **`FanoutEventSink`** — concurrent dispatch to N sinks with per-sink
delivery mode; mandatory sink failures propagate, best-effort failures
are logged
- **`CompositeSink`** — routes events→FanoutEventSink, chunks→Lode,
satisfying `policy.Sink` so all three policies (strict, buffered,
streaming) work unchanged
- **`redisstream` package** — Redis Streams implementation using
pipelined `XADD` with `MAXLEN~` approximate trimming, exponential
backoff retries, and configurable TTL
- **`run_completed` unification** — when Redis sink is enabled, a
terminal `run_completed` event is also published to the stream, making
it a single event source for consumers
- **Backward compatible** — no `events` config → Lode-only behavior,
identical to today
## Test plan
- [x] `policy/` tests: FanoutEventSink (single, multi, mandatory
propagation, best-effort swallow, close, panic on empty)
- [x] `policy/` tests: CompositeSink (event routing, chunk routing,
error propagation, close, nil panics)
- [x] `adapter/redisstream/` tests: WriteEvents with miniredis
verification, empty batch, custom stream key, retry exhaustion, context
cancellation, config validation, defaults, close
- [x] CLI parity test passes with 9 new flag entries in
`CLI_PARITY.json`
- [x] Full `go test ./...` — all 17 packages pass
- [ ] Manual: `quarry run --event-sink redis --event-sink-redis-url
redis://localhost:6379` publishes events to stream
- [ ] Manual: `quarry run --event-sink lode --event-sink redis ...`
writes to both sinks concurrently
- [ ] Manual: verify `run_completed` appears in Redis stream after run
finishes
Closes#222
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments