Backing calculation for inherited_place DSL declarations.
Traverses AssignmentRelationship by alias to reach source instances, then reads
their PlaceRef records for the declared source_role. Injected automatically by
TransformInheritedRefs — do not reference this module directly; use the
inherited_place DSL entity instead.
See Diffo.Provider.Extension.InheritedPlaceDeclaration for the DSL options.
Result shape
A list per input record. Each entry corresponds to one source instance reached by the traversal:
- One or more
Diffo.Provider.Placevalues when the source has matchingPlaceRefrecords atsource_role. %Diffo.Unknown{}when the source is reached but carries noPlaceRefatsource_role.
When no sources are reached at all (e.g. no assignment), the result is [].
Unknown is reserved for "we got here but the role isn't declared" — the
X-state from the AGENTS.md Diffo.Unknown discipline.
Reason vocabulary
Only one reason is possible here — PlaceRef is a universal indirection so
no cross-world dispatch is needed (which is why this calc is cleaner than the
characteristic equivalents):
:role_not_declared— source instance reached but itsPlaceRefrecords carry no entry atsource_role.:contextis%{source_id: id, role: source_role}.
:world stamping
TransformInheritedRefs passes the consumer's resource as :world at compile
time. Each emitted %Diffo.Unknown{} stamps it.
Summary
Functions
Callback implementation for Ash.Resource.Calculation.describe/1.
Callback implementation for Ash.Resource.Calculation.has_expression?/0.
Callback implementation for Ash.Resource.Calculation.init/1.
Callback implementation for Ash.Resource.Calculation.strict_loads?/0.
Functions
Callback implementation for Ash.Resource.Calculation.describe/1.
Callback implementation for Ash.Resource.Calculation.has_expression?/0.
Callback implementation for Ash.Resource.Calculation.init/1.
Callback implementation for Ash.Resource.Calculation.strict_loads?/0.