Interface ITenantPartitionedCapability<TContract>
Registration-time capability marker declaring that a persistence store contract
(TContract) keeps tenant rows separated by carrying the tenant
discriminator on the row rather than by reading an ambient tenant.
public interface ITenantPartitionedCapability<TContract>
Type Parameters
TContractThe store contract the capability applies to (the outbox store being the canonical case).
- Extension Methods
Remarks
What this attests, and how it differs from ITenantScopingCapability<TContract>. The scoping capability attests that the store applies the ambient tenant discriminator to every operation. This one attests a different — and, for some contracts, the only correct — mechanism: the store persists the tenant discriminator on every row it writes and hands that value back on read, so the owning tenant is re-established from the row. Its reads are deliberately estate-wide.
The outbox is why this exists. One drain pass carries every tenant's messages, and the processor establishes a per-message tenant scope from the discriminator the row carries. A store that instead filtered on the ambient tenant would read it as absent at drain time, claim the empty set, and stall the drain permanently — while still satisfying any test that only asserts one tenant cannot see another's rows. Attesting ambient scoping for such a store is therefore not merely inaccurate; it describes behaviour that would be a defect if it were true.
In the framework's tenancy vocabulary. Every tenancy-bearing operation is exactly one of three kinds, and the kind is a property of the operation rather than a provider's choice. A tenant-confined operation takes its partition as an explicit argument and fails closed without one. A deliberately estate-wide operation takes nothing and applies no tenant term, and states its reason where it is declared. An identity-addressed operation is reached by an identifier the caller already holds, and adding a tenant term to it can only turn the correct row into no row. A store presenting this capability is built from the second and third kinds: it stamps the partition it is given on write, and re-establishes it from the row on read. It never infers a tenant from ambient state — which is why the seam that emits this marker offers no ambient context to infer one from.
Structural lock. Excalibur.Dispatch.ITenantPartitionedCapability<TContract>.AssertWiredThroughPartitionedSeam() is internal, so
this interface can only be implemented from within Excalibur.Dispatch.Abstractions (and its
InternalsVisibleTo friends). Its sole implementation is the internal
TenantPartitionedCapabilityMarker<TContract>, emitted only by
TenantScopedStoreServiceCollectionExtensions.AddTenantAwareStore. A provider assembly outside
the friend set cannot register a cloned bare marker beside a store that carries no discriminator — the
clone fails to compile.
What earns this marker, stated precisely. The absence of an ITenantContext constructor parameter is NOT, by itself, sufficient — that absence is equally consistent with a store implementing no tenancy mechanism at all, and the two are indistinguishable by constructor shape alone. The seam emits this marker only when the store ALSO implements ITenantPartitionedStore: the store's own explicit declaration of the mechanism, made by the provider that wrote it, not inferred from what its constructor happens to omit. A store with neither an ITenantContext parameter nor an ITenantPartitionedStore implementation receives no capability marker at all.
What the lock does NOT prove, stated rather than implied. The seam emitting this marker takes no ITenantContext, so the "handed a dependency and silently discarded it" leak is inexpressible on this path. It does not, and at registration time cannot, prove that the store's writes actually populate the discriminator column: that is behaviour observable only against real infrastructure, and it is the conformance suite's round-trip — write under one tenant, drain, and read the owning tenant back off the message — that holds it, not this marker.