ADR 0007: Visibility versus mutation relations
Status
Accepted
Decision
Typed EAV keeps two relations for partitioned definitions:
for_entityis a visibility relation. It includes the requested(entity_type, scope, parent_scope)row plus the global and partial-scope fallback rows used for collision precedence.for_partitionis a mutation relation. It matchesentity_type,scope, andparent_scopeexactly, including SQLNULLaxes, and is used by ordering mutations and theirFOR UPDATElocks.
Field ordering queries TypedEAV::Field::Base.for_partition so STI field
subclasses remain one ordering partition. Section ordering queries the Section
base relation directly for the same reason of keeping the mutation boundary
independent from the receiver’s relation scope.
Consequences
Moving a definition cannot renumber a global fallback, a scope-only fallback,
or a different full (scope, parent_scope) tuple. Visibility lookup and its
collision precedence remain unchanged. Mutation locks still run in one
transaction, acquire every exact-partition row in deterministic id order,
and normalize only those rows.