# `Diffo.Provider.Calculations.InheritedPlace`
[🔗](https://github.com/diffo-dev/diffo/blob/v0.9.0/lib/diffo/provider/components/calculations/inherited_place.ex#L5)

Backing calculation for `inherited_place` 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 `PlaceRef` 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_place` 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 place — the ref graph — is a
calculation concern, not a `via:` capability (see #227).

See `Diffo.Provider.Extension.InheritedPlaceDeclaration` for the DSL options.

## Result shape

Without `collapse`, a list per input record — one or more `Diffo.Provider.Place` values
per reached instance that carries a `PlaceRef` at `source_role`, or `%Diffo.Unknown{}`
when an instance is reached but has no `PlaceRef` there. With `collapse: :first | :last`,
a single value (or `nil`). When no instance is reached at all, `[]` (or `nil` when
collapsing).

## Reason vocabulary

`PlaceRef` is a universal indirection (no cross-world dispatch), so only one reason:

- `:role_not_declared` — instance reached but its `PlaceRef` records carry no entry at
  `source_role`. `:context` is `%{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.

# `describe`

# `has_calculate?`

# `has_expression?`

# `init`

# `strict_loads?`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
