Resumable Reactions 05 - ReactionBase checkpoint & dedup primitives
## Background
Part of the [Reaction Recovery](https://github.com/drasi-project/drasi-core/issues/393) initiative. See [design docs](https://github.com/drasi-project/design-documents/tree/main/drasi-lib/Reaction-Checkpoints), specifically doc 02 §1 (Primitives) and §2.
## Work
- Define `ReactionCheckpoint` type (`sequence: u64`, `config_hash: u64`) with serde derives
- Implement checkpoint helpers on `ReactionBase`:
- `read_checkpoint(query_id)` and `read_all_checkpoints()` (batched startup hydration via `get_many`)
- `write_checkpoint(query_id, checkpoint)`
- Key layout: `"checkpoint:{query_id}"` in the state store, partitioned by `store_id = reaction_id`
- Serialization via bincode
- Read failure on startup fails reaction startup
- Framework-level dedup: sequence comparison (`result.sequence <= checkpoint.sequence`) before plugin invocation
- Optional `run_standard_loop` helper that wraps dequeue, dedup, side-effect invocation, and checkpoint write in the correct order. Reactions needing custom scheduling skip the helper.
## Dependencies
- #398 (Reaction trait extensions & bootstrap hook)
0 条评论