A precedence ladder is an ordered list of rules that answers one question: when two sources write the same field of the same record, which value survives? The sources are typically systems, not people: a CRM sync, an enrichment vendor, an agent that inferred a value, a bulk import, a manual edit in the admin console, a migration script. Each source writes with a scope (tenant, account, user, record) and a timestamp. The ladder decides the winner from those attributes.
The important property is that the ladder is a data structure, not an if chain buried in a sync job. If it lives in one function, you can test it. If it is spread across five services that each "know" that agents never overwrite manual edits, you cannot, and the rule will drift.
Policy engines make this explicit. In Rego, the conflict question is under your control: neither allow nor deny is a keyword, so you define a document such as authz where one overrides the other by design. The same discipline applies to write precedence: define a decision document, name it, and test the document rather than the call sites.
A ladder worth testing looks like this, highest first:
- Record-level manual override from an authorized user.
- Record-level value confirmed by a human reviewer.
- Account-scoped set by an administrator.
- Tenant-level policy default.
- Source-system value from the system of record.
- Enrichment vendor value.
- Agent-inferred value.
- Bulk import value.
Two more attributes matter as much as rank: recency (a newer write at a lower rank still loses to a higher rank unless you decide otherwise) and liveness (a write that was deleted, retracted, or marked stale must not win even if it is newest). Ladders that ignore liveness are the ones that resurrect deleted phone numbers.



