Backing calculation for inherited_party DSL declarations.
Walks the instance graph along the via: hop chain (the shared
Diffo.Provider.Calculations.Traversal — :forward/:reverse over assignment /
relationship edges), then reads each reached instance's PartyRef records at the
declared source_role, optionally collapsing the result to one end. Injected
automatically by TransformInheritedRefs — do not reference this module directly; use the
inherited_party DSL entity instead.
via: reaches the instance that holds the ref; the source_role deref is a fixed
terminal step, not a via: hop. Routing through a party — the ref graph — is a
calculation concern, not a via: capability (see #227).
See Diffo.Provider.Extension.InheritedPartyDeclaration for the DSL options.
Result shape
Without collapse, a list per input record — one or more Diffo.Provider.Party values
per reached instance that carries a PartyRef at source_role, or %Diffo.Unknown{}
when an instance is reached but has no PartyRef there. With collapse: :first | :last,
a single value (or nil). When no instance is reached at all, [] (or nil when
collapsing).
Reason vocabulary
PartyRef is a universal indirection (no cross-world dispatch), so only one reason:
:role_not_declared— 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.