Epoch-scoped request ledger with conflicting-retry detection (#6) #22

Merged
faumaray merged 1 commits from issue/6-request-ledger into main 2026-12-03 08:08:19 +00:00
1 Commits
Author SHA1 Message Date
selikhov afd4d99a2d feat(Messaging): epoch-scoped request ledger with conflict detection (#6)
- RequestLedger<Payload, Result, PayloadEqual> keys idempotent host
  requests by (epoch, trusted client, request id).
- check() admits the first request, replays a recorded result for an
  exact repeat (including a rejected outcome), reports in_progress while
  the request is still running, rejects a changed payload and rejects
  keys from an obsolete/future epoch before side effects.
- record() stores the caller-defined result exactly once; results are
  never overwritten.
- Capacity/admission/archival is explicit: entries are never evicted
  within an epoch (capacity_exceeded instead), and advancing the epoch
  clears memory. An old request number therefore cannot execute a second
  time after cleanup.
- 8 tests: replay, rejected outcome, payload conflict, delayed retry
  after newer operations, epoch rollover, capacity pressure, in-flight
  state/immutable result and non-advancing epoch rejection.
2026-12-03 09:40:47 +03:00