Skip to content

Commit bf0ba9d

Browse files
authored
docs: require atomic state transitions (#2617)
Follow-up to #2616. Documents the invariant that state and history for one logical transition must be computed before persistence and committed in one store transaction. It also keeps preparatory writes out of transport code and requires malformed durable data to be rejected. Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
1 parent be4d7aa commit bf0ba9d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Every component has a single responsibility. If code reaches into another compon
4949

5050
**Operations are atomic from the caller's perspective.** Database-only operations use transactions. Workflows that cross database and network boundaries use durable phases, idempotent retries, and compensating cleanup so partial work can be safely resumed or removed. Never hold a database transaction or lock across a network call.
5151

52+
**Persist transitions atomically.** When one logical transition changes task state and history, compute it before persistence and commit it through one store transaction. Transport code must not perform preparatory writes. Reject malformed durable data rather than silently omitting it.
53+
5254
**Internal mechanics are not API.** Locks, accounting counters, query sequencing, and cloned dependencies stay hidden from callers. An implementation change should not force callers to change.
5355

5456
**Behavior lives where the knowledge is.** Do not move behavior sideways into a wrapper; push it down to the component that understands the domain.

0 commit comments

Comments
 (0)