Living Document Notice
Published 2026-09-17. The evolving architecture, revisions, and connected notes for this dispatch live in the Stax Digital Garden.
Offline Conflict-Free Task Reconciliation
Summary
Updating task statuses across disconnected phones and workstations inevitably triggers Git merge conflicts. Trice introduces monotonic state advancement and three-way checklist merges that guarantee conflict-free convergence across devices.
The Chaos of Concurrent Task Edits
Consider an operator marking a task as completed on their mobile device while simultaneously editing the task’s technical checklist on their workstation. When synchronization occurs, traditional line-based file mergers fail:
<<<<<<< HEAD
task_state: "completed"
=======
* [ ] Add regression test for boundary overflow
>>>>>>> incoming-mobile
Corrupted task files lock up automated dispatchers and require manual Git conflict resolution.
Trice implements specialized Conflict-Free Replicated Data Type (CRDT) merge semantics for task notes.
+-------------------------------------------------------------+
| Trice Three-Way Task Reconciliation |
| |
| Base Task: v1.0 (State: Active, Checkboxes: 2/3) |
| │ │ |
| ▼ ▼ |
| Node A: Mark Completed Node B: Add Checkbox Item |
| (State: Completed) (+ Regression Test Item) |
| │ │ |
| └────────────────┬───────────────┘ |
| │ |
| v |
| Merged Task: v2.0 |
| - State: Completed (Monotonic Advancement Wins) |
| - Checkboxes: 3 Items Preserved, 2 Checked |
+-------------------------------------------------------------+
Monotonic State Advancement Lattice
Trice models task states as a partially ordered set (poset) forming a join-semilattice:
Pending (0) < Active (1) < Blocked (2) < Completed (3) < Archived (4)When two nodes report differing states for the same task without an intervening rollback, the engine computes the least upper bound (join):
pub fn merge_states(local: TaskState, remote: TaskState) -> TaskState {
match (local, remote) {
(TaskState::Archived, _) | (_, TaskState::Archived) => TaskState::Archived,
(TaskState::Completed, _) | (_, TaskState::Completed) => TaskState::Completed,
(TaskState::Blocked, TaskState::Active) => TaskState::Blocked,
(TaskState::Active, TaskState::Pending) => TaskState::Active,
_ => remote,
}
}A task marked completed on one device cannot be accidentally reverted to active by a concurrent edit from another device.
Checkbox Set Union
For action checklists within note bodies, Trice uses an Observed-Remove Set (OR-Set) algorithm keyed on the hash of each checklist line:
- Checked boxes remain checked across merges.
- Newly added checklist items on either branch are unioned into the final list.
- Whitespace and indentation are preserved exactly according to CST trivia rules.
This guarantees that operators can toggle tasks freely on mobile devices without fear of corrupting vault notes.
- Directus Target: trice
- Garden Source Reference: MOC - Bosun PKM Tools, MOC - Fleet Operations
- Garden Source Reference: [TRC-1009 - Offline Conflict-Free Task Reconciliation](TRC-1009 - Offline Conflict-Free Task Reconciliation)