add JetstreamConsumer service and jetstream:consume Ace command
Foundation for the Bluesky firehose worker. Adds:
- JetstreamConsumer service class with full DI seam (WebSocket factory,
cursor read/write, tracked DID source, clock) for testability
- jetstream:consume Ace staysAlive command that wires production
implementations (real WebSocket, SQLite raw queries) and SIGTERM/SIGINT
graceful shutdown handlers
- 13 unit tests covering: like/repost filtering by tracked author, drop
unrelated event types, drop like-deletes (per spec §10), buffer flush
size + interval triggers, cursor checkpointing after flush, retry on
failed flush, tracked-DID refresh, shutdown drains buffer, reconnect
uses last flushed cursor not in-memory pending
Compress=false intentionally — zstd dictionary handling deferred until
bandwidth becomes a concern. Cursor stored as BigInt internally, written
to SQLite via raw queries (Lucid would lose precision on 64-bit time_us).
Task 10 will add post-event handling, post-delete tombstones, account
event handling, and quote detection — the dispatcher in handleMessage
already falls through cleanly for those event kinds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>