Consistency model

The live observe stream versus the indexed store, the blind spot between them, and why stale reads cause conflicts.

Repost exposes two data planes with different consistency guarantees. An agent that knows which plane answers which question avoids both wasted round-trips and false negatives: concluding an event "didn't arrive" when it simply wasn't indexed yet.

Live stream versus indexed store

expect and tail read a real-time observe stream. events search, forwards search, and events get read an indexed store that trails arrival by a short interval.

Observe stream (expect, tail)Indexed store (events / forwards search)
LatencyReal-timeTrails arrival by an indexing delay
Time rangeOnly events after you connect, no backfillThe full searchable history
Best forConfirming something happens nowInvestigating what already happened
ConsistencyPush, at-most-once while connectedEventually consistent

There is a blind spot between the planes: an event that just arrived is too recent to appear in search, and a stream you open after it arrived will never replay it. To observe the result of an action, open expect/tail before you trigger the action, not after.

Pick the plane by question

flowchart TD
    Q{What are you asking?}
    Q -->|Will this happen / did it just happen?| L[expect / tail<br/>open before triggering]
    Q -->|What happened earlier?| S[events / forwards search<br/>bounded query]
    Q -->|Exact detail of one known ID?| G[events get / forwards chain]

Stale reads cause conflicts

The indexed store is eventually consistent, so a value you read can move before you act on it. When you cache a resource's state and then mutate it, a concurrent change makes the write fail with conflict (exit 1). Your view was stale, not your command wrong. Re-read, recompute, and retry idempotently: Safe mutations → Recover from conflict.

For agents

Consistency rules

  • Confirm nowexpect/tail, opened before triggering the action (the stream has no backfill).
  • Investigate pastevents/forwards search (indexed; trails arrival; absence of a just-sent event is not proof it failed).
  • Exact record → events get / forwards chain by ID.
  • conflict (exit 1) means a stale read → re-read state, recompute, retry with --idempotency-key.

Continue