atproto: per-relay firehose cursor resume master
Persist each relay's high-water sequence number in the index DB (new RelayCursor table) so a reconnect or restart resumes from where we left off instead of re-tailing from live (which leaves a gap). The latest seq is kept in memory, advanced on every frame, and flushed every 5s plus once on shutdown to keep write pressure off the high-volume firehose. A relay with no stored cursor dials with none, so a fresh external relay tails from live rather than backfilling its entire history; once we've recorded progress we resume from it. This also stops our own PDS firehose (relay-self) from replaying its whole history on every reconnect — it replays once, then resumes. Cursor precision is best-effort: the parallel scheduler can surface frames out of sequence order, so on an unclean crash a few in-flight frames just below the high-water mark may be skipped on resume. That is safe — downstream handlers are idempotent, and with multiple relays plus a cold deduper after restart those commits are re-delivered and re-indexed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>