Backing calculation for inherited_party DSL declarations.
Traverses AssignmentRelationship by alias to reach source instances, then reads
their PartyRef records for the declared source_role. Injected automatically by
TransformInheritedRefs — do not reference this module directly; use the
inherited_party DSL entity instead.
See Diffo.Provider.Extension.InheritedPartyDeclaration 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.Partyvalues when the source has matchingPartyRefrecords atsource_role. %Diffo.Unknown{}when the source is reached but carries noPartyRefatsource_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 — PartyRef 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 itsPartyRefrecords 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.