miroir/crates
jedarden ddd84f53e1 feat(cdc): implement webhook sink batching, retries, and cursor persistence (P5.13.a, miroir-uhj.13.1)
Implements plan §13.13 webhook sink with:
- Time-based batch flushing (batch_flush_ms timer) in addition to size-based (batch_size)
- Exponential backoff retries with jitter, capped by retry_max_s (default 3600s)
- Per-sink cursor persistence on successful ACK only (at-least-once delivery)
- Document body inclusion controlled by include_body sink config

Key changes:
- Added duration_jitter() helper for randomized backoff (±25%)
- Modified background_publisher to use tokio::select! for event + timer handling
- Implemented retry loop in flush_webhook with:
  - Initial delay: 100ms
  - Exponential multiplier: 2x (max 60s)
  - Retries on 5xx, 429, and network errors
  - No retry on 4xx client errors (except 429)
- Cursor advances only on 2xx response via internal_queue.persist_cursor()

Closes: miroir-uhj.13.1

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 12:33:58 -04:00
..
miroir-core feat(cdc): implement webhook sink batching, retries, and cursor persistence (P5.13.a, miroir-uhj.13.1) 2026-05-24 12:33:58 -04:00
miroir-ctl docs(miroir-ctl): add subcommand runbooks and help text (P11.4, miroir-uyx.4) 2026-05-24 11:47:36 -04:00
miroir-proxy feat(security): implement CSRF posture for Admin UI and Search UI (plan §9, P10.6) 2026-05-24 11:17:08 -04:00