Expand description
Epoch+Phase state CRDT for work item lifecycle.
The lifecycle state (Open/Doing/Done/Archived) uses a non-standard (epoch, phase) CRDT that handles concurrent close/reopen correctly: if agent A closes an item while agent B reopens it, the higher epoch wins.
§Phase Ranking
Phases have a total ordering: Open(0) < Doing(1) < Done(2) < Archived(3)
§Merge Rules
Given two EpochPhaseState values a and b:
- If
a.epoch != b.epoch: the one with higher epoch wins entirely. - If
a.epoch == b.epoch: the one with higher phase rank wins.
This satisfies the semilattice laws (commutative, associative, idempotent).
§Reopen Semantics
To reopen an item, increment the epoch and set phase to Open. This guarantees the reopen wins against any concurrent operations in the previous epoch.
Structs§
- Epoch
Phase State - CRDT state combining an epoch counter with a lifecycle phase.
Enums§
- Phase
- Work item lifecycle phase with total ordering by rank.
- State
Error - Error for invalid state transitions.