Why this matters
Prevents inconsistent states and race conditions.
Provide a single updater that applies deltas/patches to messages rather than multiple ad-hoc updaters.
Prevents inconsistent states and race conditions.
Side-by-side examples engineers can pattern-match during review.
fun setStatus(m: Msg, s: String) { m.status = s }
fun setSeen(m: Msg, v: Boolean) { m.seen = v }fun update(m: Msg, patch: MsgPatch) { /* apply atomically */ }many tiny setterssingle update(m, patch)From the same buckets as this rule.