Read Normalize Compare Mutate

BOUNDARY-READ-NORMALIZE-COMPARE-MUTATE

Summary

Reconcile external state by reading the current provider view, normalizing it, comparing intent, and mutating only the real difference. The loop avoids destructive or noisy writes when formatting, defaults, ordering, or outside actors create drift.

Rule

Reconcile external state by reading, normalizing, comparing, and then mutating.

Why

External state may be formatted differently, reordered, defaulted, or partially managed by another actor. Reading and normalizing before mutation prevents unnecessary writes and reduces destructive updates caused by comparing raw local intent to raw provider state.

Helps

  • Makes reconciliation idempotent and safer against provider drift.

Limits

Skip the full reconcile loop for simple create-only operations or APIs that already provide strong compare-and-swap semantics. Use it when safe mutation depends on current remote state.

Agent Instruction

Reconcile external state by reading, normalizing, comparing, then mutating so formatting, ordering,
defaults, and outside actors do not hide drift.

Mechanisms

Supported by read models, normalization functions, diff plans, dry runs, idempotency tests, and provider fixtures.

References