# `AshReplicant.Resource.Verifiers.ValidateTenantSource`
[🔗](https://github.com/baselabs/ash_replicant/blob/v0.3.0/lib/ash_replicant/resource/verifiers/validate_tenant_source.ex#L1)

Compile-verifier (surfaced as a Spark diagnostic; build-blocking under
`--warnings-as-errors`): a resource that declares **non-global Ash multitenancy**
must declare a `replicant` tenant source — `tenant_attribute` or `tenant_mfa`.

This is the CONVERSE of `ValidateMultitenancy` (which checks the *shape* of a
declared discriminator). The sink resolves the per-row tenant from the source
record via one of those keys; with neither,
`AshReplicant.Resolver.resolve_tenant/2` yields `{:ok, nil}` and the mirror write
is attempted with `tenant: nil`. For a non-`global?` multitenant resource Ash then
raises `TenantRequired` at RUNTIME — so it is fail-closed, never a cross-tenant
leak, but the pipeline halts on every row of that resource. This gate moves the
failure to COMPILE time, matching the project's fail-closed-at-compile-time posture
(`ValidateMultitenancy`, `ValidateSensitive`).

Exempt: a `global?` resource (tenant is optional) and a non-multitenant resource.
The message is value-free — it names schema structure only, never a row value.

---

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