Refinement note: schema policy and version-config identity, change and caching
This page is part of the documentation for Orleans.Lattice 10.5.0 (release line 10.5), built 2026-12-05. It is also published as markdown, with every table and list, at SchemaPolicyConfigRefinement.md, and llms.txt lists every page.Model scope in one paragraph
One governed tree's schema setting, which is either its enforcement policy or its version config: both live as one row of a reserved tree, keyed by the governed tree id, behind a per-silo cache that holds a null sentinel for "no setting". An admin on some silo commits a set or a clear, evicts its own silo's entry and returns; the change then reaches every other silo and evicts its entry there. A cache miss reads the durable row and installs it unless an eviction overtook the read. A local write through a silo is judged by that silo's cached setting before it reaches the WAL, and a rejected write changes nothing. An uncompilable policy is refused before it is stored. The model checks the contract the providers state with #5238 and #5247 fixed: eventual propagation to every silo through the configuration tree's in-memory epoch, which the committing silo advances and every silo polls, with the admin's own silo current before the call returns, and no load installing a setting older than an eviction that overtook it.
Variable mapping
| Spec variable | Protocol role | Code counterpart |
|---|---|---|
stored, rev |
The durable setting row and a ghost count of committed changes. | LatticeSchemaPolicyStore.SetPolicyAsync, LatticeSchemaPolicyStore.ClearPolicyAsync, LatticeSchemaVersionStore.SetConfigAsync. |
admin, adminAt |
An admin call between its durable write and its return, and the silo serving it. | LatticeSchemaAdmin.SetPolicyAsync, LatticeSchemaAdmin.ClearPolicyAsync, LatticeSchemaVersionAdmin.SetVersionConfigAsync. |
cache, cacheRev |
Each silo's cached setting or null sentinel, and the change it was read at. | LatticeSchemaPolicyProvider.GetCompiledPolicyAsync, LatticeSchemaVersionProvider.GetConfigAsync. |
loading, loadVal, loadRev, overtaken |
A cache-miss read in flight, what it read, and whether an eviction overtook it. | LatticeSchemaPolicyProvider.LoadAndCacheAsync, LatticeSchemaVersionProvider.LoadAndCacheAsync, SchemaTreeCacheExtensions.CacheIfCurrent, SchemaTreeCacheGenerations.Capture. |
pending |
A change not yet delivered to a silo's cache: published as an advance of the configuration tree's epoch, observed by every silo's poll. | LatticeSchemaPolicyProvider.OnMutationAsync, LatticeSchemaVersionProvider.OnMutationAsync, SchemaConfigEpochGrain.AdvanceAsync, SchemaConfigEpochGrain.GetAsync. |
data, commits, writes, judge, outcome |
Local writes, the setting that judged each, and their verdict. | LatticeSchemaWriteInterceptor.OnWriteAsync, LatticeWriteInterceptorEnforcement.InterceptPointAsync. |
Action mapping
| Spec action | Protocol step | Code counterpart | Detector |
|---|---|---|---|
Change(s,p) |
Commit a set or clear of the setting row; the committing silo publishes the change to every silo by advancing the epoch. | LatticeSchemaAdmin.SetPolicyAsync, LatticeSchemaAdmin.ClearPolicyAsync, LatticeSchemaVersionAdmin.SetVersionConfigAsync, SchemaConfigEpochGrain.AdvanceAsync. |
Yes: SchemaConfigEpochSynchronizerTests.OnMutationAsync_config_tree_write_advances_the_cluster_epoch, SchemaConfigEpochSynchronizerTests.OnMutationAsync_failed_advance_is_retried_until_it_lands, LatticeSchemaAdminTests.SetPolicyAsync_delegates_and_invalidates_cache, LatticeSchemaAdminTests.ClearPolicyAsync_delegates_and_invalidates_cache, LatticeSchemaVersionAdminTests.SetVersionConfigAsync_writes_store_and_invalidates_cache. |
ChangeRefused |
An uncompilable policy is refused before the durable write. | LatticeSchemaPolicyStore.SetPolicyAsync, CompiledSchemaPolicy.Compile. |
Yes: LatticeSchemaPolicyStoreTests.SetPolicyAsync_negative_max_byte_length_is_rejected_and_not_stored. |
Acknowledge |
The admin evicts its own silo's entry before it returns. | LatticeSchemaAdmin.SetPolicyAsync, LatticeSchemaVersionAdmin.ClearVersionConfigAsync. |
Yes: LatticeSchemaAdminTests.SetPolicyAsync_delegates_and_invalidates_cache, LatticeSchemaVersionAdminTests.ClearVersionConfigAsync_removes_and_invalidates. |
Propagate(s) |
The change reaches silo s and evicts its entry: the committing silo's change feed, or every other silo's epoch poll dropping its cache. |
LatticeSchemaPolicyProvider.OnMutationAsync, LatticeSchemaVersionProvider.OnMutationAsync, SchemaTreeCacheExtensions.InvalidateForMutation, SchemaConfigEpochGrain.GetAsync. |
Yes: SchemaConfigCrossSiloIntegrationTests.Policy_written_through_one_silo_reaches_every_silo_within_the_propagation_interval, SchemaConfigCrossSiloIntegrationTests.Version_config_written_through_one_silo_reaches_every_silo_within_the_propagation_interval, SchemaConfigEpochSynchronizerTests.PollOnceAsync_advanced_epoch_drops_the_cache, LatticeSchemaPolicyProviderTests.OnMutationAsync_policy_tree_write_evicts_affected_tree, LatticeSchemaVersionProviderTests.OnMutationAsync_version_tree_write_evicts_affected_tree. |
BeginLoad(s) |
A cache miss reads the durable row. | LatticeSchemaPolicyProvider.GetCompiledPolicyAsync, LatticeSchemaVersionProvider.GetConfigAsync. |
Yes: LatticeSchemaPolicyProviderTests.Invalidate_forces_reload_on_next_get, LatticeSchemaVersionProviderTests.Invalidate_forces_reload_on_next_get. |
InstallLoad(s) |
The read installs its result unless an eviction overtook it. | LatticeSchemaPolicyProvider.LoadAndCacheAsync, LatticeSchemaVersionProvider.LoadAndCacheAsync. |
Yes: LatticeSchemaPolicyProviderTests.GetCompiledPolicyAsync_caches_after_first_load, LatticeSchemaPolicyProviderTests.GetCompiledPolicyAsync_caches_null_sentinel_for_ungoverned_tree, LatticeSchemaVersionProviderTests.GetConfigAsync_caches_after_first_load, LatticeSchemaPolicyProviderTests.GetCompiledPolicyAsync_load_overtaken_by_invalidate_does_not_cache_stale_policy. |
Write(s,v) |
A local write is judged by the silo's cached setting before the WAL append. | LatticeSchemaWriteInterceptor.OnWriteAsync, LatticeWriteInterceptorEnforcement.InterceptPointAsync. |
Yes: LatticeSchemaWriteInterceptorTests.OnWriteAsync_valid_local_value_accepts, LatticeSchemaWriteInterceptorTests.OnWriteAsync_invalid_local_value_throws_violation, SchemaValidationDataApiTests.SetAsync_strict_json_rejection_preserves_typed_diagnostics_and_commits_nothing. |
Stutter |
No protocol step. | No production counterpart. | Not applicable. |
Property mapping
| Spec property | Production property | Detector |
|---|---|---|
StoredPolicyCompiles |
A policy that does not compile is never written to the reserved tree. | Yes: LatticeSchemaPolicyStoreTests.SetPolicyAsync_negative_max_byte_length_is_rejected_and_not_stored. |
CacheCurrentOrPending |
A silo's cached setting is current or an eviction for it is on its way; no overtaken load installs an older setting. | Yes: SchemaConfigEpochSynchronizerTests.PollOnceAsync_restarted_epoch_grain_drops_the_cache_even_at_a_lower_version, SchemaConfigEpochSynchronizerTests.PollOnceAsync_membership_change_drops_the_cache, SchemaConfigEpochSynchronizerTests.Poll_loop_drops_the_cache_while_the_epoch_cannot_be_read, LatticeSchemaPolicyProviderTests.GetCompiledPolicyAsync_load_overtaken_by_invalidate_does_not_cache_stale_policy, LatticeSchemaPolicyProviderTests.GetCompiledPolicyAsync_load_overtaken_by_policy_mutation_does_not_cache_stale_policy, LatticeSchemaVersionProviderTests.GetConfigAsync_load_overtaken_by_invalidate_does_not_cache_stale_config, LatticeSchemaVersionProviderTests.GetConfigAsync_load_overtaken_by_version_mutation_does_not_cache_stale_config, LatticeSchemaPolicyProviderTests.OnMutationAsync_policy_tree_write_evicts_affected_tree, LatticeSchemaVersionProviderTests.OnMutationAsync_version_tree_write_evicts_affected_tree, LatticeSchemaPolicyProviderTests.Invalidate_forces_reload_on_next_get. |
AdminSiloCurrentAtAck |
The admin's own silo has evicted its entry before the admin call returns. | Yes: SchemaConfigCrossSiloIntegrationTests.Admin_policy_change_is_immediate_on_the_admin_silo_and_enforced_through_every_silo_within_the_propagation_interval, LatticeSchemaAdminTests.SetPolicyAsync_delegates_and_invalidates_cache, LatticeSchemaAdminTests.ClearPolicyAsync_delegates_and_invalidates_cache, LatticeSchemaVersionAdminTests.SetVersionConfigAsync_writes_store_and_invalidates_cache. |
AcceptedWriteValid |
A local write is committed only when the judging setting accepts it. | Yes: LatticeSchemaWriteInterceptorTests.OnWriteAsync_invalid_local_value_throws_violation, SchemaValidationDataApiTests.SetAsync_strict_json_rejection_preserves_typed_diagnostics_and_commits_nothing. |
RejectLeavesNoMutation |
A rejected local write is thrown before the WAL append and changes no data. | Yes: SchemaValidationDataApiTests.SetAsync_strict_json_rejection_preserves_typed_diagnostics_and_commits_nothing, LatticeSchemaWriteInterceptorTests.OnWriteAsync_invalid_local_value_persists_nothing_to_dlq. |
StaleEventuallyEvicted |
Every silo's stale setting is eventually evicted or refreshed, within the propagation interval of the change being published. | Yes: SchemaConfigCrossSiloIntegrationTests.Policy_written_through_one_silo_reaches_every_silo_within_the_propagation_interval, SchemaConfigCrossSiloIntegrationTests.Version_config_written_through_one_silo_reaches_every_silo_within_the_propagation_interval, SchemaConfigEpochSynchronizerTests.Poll_loop_follows_the_epoch_on_its_own_and_stops_cleanly, LatticeSchemaPolicyProviderTests.OnMutationAsync_policy_tree_write_evicts_affected_tree, LatticeSchemaVersionProviderTests.OnMutationAsync_version_tree_write_evicts_affected_tree. |
Excluded properties
| Spec property | Reason |
|---|---|
TypeOK |
Finite-domain model sanity, not a production representation. It retains its own paired experiment. |
Property classification (issue #2321)
TypeOK, StoredPolicyCompiles and CacheCurrentOrPending are state safety. AdminSiloCurrentAtAck, AcceptedWriteValid and RejectLeavesNoMutation are action safety. StaleEventuallyEvicted is temporal liveness under weak fairness of change delivery to each silo and of the admin's return. The ThreeSilos variant re-checks every state and action check with a third silo racing the two; the temporal check is bounded-out there for the TLC liveness budget and is retained on the base.
Every experiment is an anchored action perturbation:
| Mutation | Classification |
|---|---|
| TypeOKLoadReadsUndeclared | Anchored action: BeginLoad. |
| StoredPolicyCompilesUncompilableStored | Anchored action: ChangeRefused. |
| CacheCurrentOrPendingOvertakenLoadInstalls | Anchored action: InstallLoad. |
| CacheCurrentOrPendingAdminSiloOnly | Anchored action: Change. |
| StaleEventuallyEvictedNeverDelivered | Anchored action: Propagate. |
| AdminSiloCurrentAtAckNoLocalEviction | Anchored action: Acknowledge. |
| AcceptedWriteValidUnchecked | Anchored action: Write. |
| RejectLeavesNoMutationAppendedFirst | Anchored action: Write. |
Detectors
The detectors drive the real admins, stores, providers and the enforcement
interceptor. The provider and admin tests use substituted stores, so they
observe exactly the cache transitions the actions name: a durable write, the
local eviction, the change-feed eviction, a miss-driven load and its install.
SchemaValidationDataApiTests drives a strict JSON rejection through a real
cluster and data facade and reads back that nothing was committed.
Defect mutations whose fixes have landed
CacheCurrentOrPendingAdminSiloOnly is the #5238 mechanism: a change reached
only the silo that served the admin call and the silo whose grain committed the
row, so every other silo kept its setting indefinitely.
CacheCurrentOrPendingOvertakenLoadInstalls is the #5247 race: a load that read
the row before a change installed its result after the eviction ran, leaving the
pre-change setting cached even on the committing silo. Both are fixed in the
schema-assurance integration bucket, which landed on main with #5330 and
shipped in the 10.3.0 release.
Deliberate abstraction gaps
- One governed tree, one setting kind. The model tracks a single governed
tree and one abstract setting that stands for either the enforcement policy
or the version config, which share the cache admission and eviction rules.
Key isolation between governed trees, the reserved-tree short-circuit, the
bounded cache admission and the striped load generations (a stripe collision
only discards a still-current load) are checked by unit detectors, not
modelled.
Production symbols:
SchemaTreeCacheExtensions.CacheIfSpaceAvailable,SchemaTreeCacheExtensions.InvalidateForMutation,SchemaTreeCacheGenerations. - Propagation bound and its failure modes. Delivery of a change to a silo
other than the admin's is an environment step under weak fairness. The model
checks eventual eviction, not the configured interval within which it happens,
which the cross-silo detectors pin. Every failure the epoch mechanism handles -
an epoch grain reactivated with a fresh incarnation, a membership change, a
failed poll - collapses into the same step, dropping the silo's whole cache,
which is stronger than the per-tree eviction modelled. Within the interval a
stale versioning silo can still stamp at the previous target.
Production symbols:
LatticeSchemaEnforcementOptions.PropagationInterval,LatticeSchemaVersioningOptions.PropagationInterval,SchemaConfigEpochGrain. - Concurrent writes judged by an overtaken load. A write whose own miss-load an eviction overtook is still judged by that load's result; the model abstracts it as concurrent with the change and checks only what is cached. No production symbol: the gap states an abstraction of write concurrency, not a production mechanism.
- Policy content. Policies are three abstract values over a two-value domain. Rule semantics, JSON predicates and compilation are not modelled; only "compiles or not" is. No production symbol: the gap states a bound of the model, not a production mechanism.
- Version-config admission rules. Monotonic target advance, family changes and catalog validation of a version config are owned by the version-family model; here a version-config change is any committed change. No production symbol: the gap delegates to another model, not to a production mechanism.