Table of Contents

Orleans.Lattice.Api.Schema API reference

This page documents Orleans.Lattice.Api.Schema 10.5.0, in 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 api.md, and llms.txt lists every page.

The public surface is the registration extension, the options type, and the facade interfaces published in the shared Orleans.Lattice.Api.Abstractions package under the Orleans.Lattice.Api.Schema namespace: ILatticeSchemaControl, ILatticeSchemaComplianceOperations, and ILatticeSchemaOperations, alongside LatticeSchemaCapabilities, the shared long-running operation records, and the ApiSchemaTypeAliases alias table. These facade interfaces are the contracts the gRPC binding adapts over, and are described by their operations below and in Architecture.

The schema policy, versioning, dead-letter, remediation, compliance, and transform records are defined in Orleans.Lattice.Schema. This package adds the control facade and its capability result, not a second schema model.

Registration

LatticeApiSchemaServiceCollectionExtensions

Static extension method on ISiloBuilder.

  • ISiloBuilder AddLatticeSchemaApi(this ISiloBuilder builder, Action<LatticeApiSchemaOptions>? configure = null)

    Adds the transport-agnostic schema-management control facade: binds LatticeApiSchemaOptions, registers one internal silo singleton as both ILatticeSchemaControl and ILatticeSchemaOperations (the singleton every transport binding adapts over), registers the default ILatticeSchemaComplianceOperations as a silo singleton, and adds an idempotency marker. Every service is registered with TryAdd. Adds no transport behaviour of its own. Must be called after AddLatticeSchemaEnforcement(...); throws InvalidOperationException when called first. Throws ArgumentNullException when builder is null. Idempotent.

Options

LatticeApiSchemaOptions

The options type reserved for future read-bounding and audit-tuning knobs, mirroring the sibling control-API facades. See Configuration for defaults.

It currently has no tunable properties.

Facade operations

Every treeId these operations accept is a tenant-local name: the facade resolves it to its effective, tenant-scoped id through ITenantContextResolver.ResolveEffectiveTreeIdAsync at the entry point and uses that one id for both the authorization check and the operation, so a verb can never authorize one tree and act on another. With the tenancy add-on absent - or registered, but with no active tenant asserted, which resolves the default tenant - the bare name is returned unchanged, so behaviour is byte-for-byte as before. Under an asserted active tenant an unqualified name is scoped into that tenant's t/{tenant}/{name} namespace, and an already-qualified t/ id or a _lattice_ system-tree name passes through unchanged (a well-formed foreign t/{other}/{name} is left to the tenancy access gate to adjudicate). The call fails closed with a LatticeTenantAccessDeniedException when the asserted tenant fails validation against the caller's own membership, or when it names a sys- tree or a malformed t/ id that belongs to no tenant. See Orleans.Lattice.Tenancy. Results that name a tree carry the effective id rather than echoing the caller's name: under an asserted non-default tenant the TreeId of a LatticeSchemaCapabilities or LatticeSchemaComplianceReport result is the tenant-scoped t/{tenant}/{name} id.

The control facade exposes these methods. Each method corresponds to one RPC in the gRPC binding, with ListDeadLettersAsync projected as the server-streaming StreamDeadLetters RPC. Every facade method authorizes its tree scope fail-closed before touching the admin plane.

Method Signature
GetRegistryAsync Task<LatticeSchemaRuntimeRegistration> GetRegistryAsync(string treeId, CancellationToken cancellationToken = default)
RegisterSchemaAsync Task RegisterSchemaAsync(string treeId, LatticeSchemaRuntimeRegistration registration, CancellationToken cancellationToken = default)
SetPolicyAsync Task SetPolicyAsync(string treeId, LatticeSchemaPolicy policy, CancellationToken cancellationToken = default)
ClearPolicyAsync Task<bool> ClearPolicyAsync(string treeId, CancellationToken cancellationToken = default)
GetPolicyAsync Task<LatticeSchemaPolicy?> GetPolicyAsync(string treeId, CancellationToken cancellationToken = default)
ListDeadLettersAsync IAsyncEnumerable<LatticeSchemaDeadLetterEntry> ListDeadLettersAsync(string treeId, CancellationToken cancellationToken = default)
CountDeadLettersAsync Task<int> CountDeadLettersAsync(string treeId, CancellationToken cancellationToken = default)
SetVersionConfigAsync Task SetVersionConfigAsync(string treeId, LatticeSchemaVersionConfig config, CancellationToken cancellationToken = default)
GetVersionConfigAsync Task<LatticeSchemaVersionConfig?> GetVersionConfigAsync(string treeId, CancellationToken cancellationToken = default)
AdvanceTargetVersionAsync Task<LatticeSchemaVersionConfig> AdvanceTargetVersionAsync(string treeId, uint newTargetVersion, CancellationToken cancellationToken = default)
ClearVersionConfigAsync Task<bool> ClearVersionConfigAsync(string treeId, CancellationToken cancellationToken = default)
GetRemediationStatusAsync Task<LatticeSchemaRemediationReport> GetRemediationStatusAsync(string treeId, CancellationToken cancellationToken = default)
ProbeCapabilitiesAsync Task<LatticeSchemaCapabilities> ProbeCapabilitiesAsync(string treeId, CancellationToken cancellationToken = default)

Policy operations manage a tree's write-validation policy. SetPolicyAsync and ClearPolicyAsync require SchemaAdmin authority; GetPolicyAsync requires Read authority. Once authorized, SetPolicyAsync compiles the policy before storing it and refuses one it cannot compile - a rule incomplete for its kind, a regex the non-backtracking engine rejects, or a MaxByteLength encoding rule with a negative limit - with an ArgumentException, storing nothing. The policy type, the structural predicate kinds (TypeOf, Length, Every, and Self), the public LatticeSchemaPolicyValidator preview helper, and the enforcement semantics are defined in Orleans.Lattice.Schema.

Dead-letter operations inspect diverted, schema-rejected writes. ListDeadLettersAsync streams entries with bounded memory and CountDeadLettersAsync returns the current count. Both require Read authority.

Versioning operations require the separate schema-versioning add-on. If the host did not register AddLatticeSchemaVersioning(...), these calls throw a clear InvalidOperationException rather than failing dependency resolution. Reads require Read authority; mutations require SchemaAdmin authority. The config and migration semantics are defined in Orleans.Lattice.Schema.

Remediation operations apply or report a tree-wide repair. StartRemediationAsync requires SchemaAdmin authority, accepts a tracked remediation that applies a LatticeValueTransform across a tree, and adopts the supplied target policy on cutover. GetRemediationStatusAsync requires Read authority and returns the status or last report; it never waits behind a running remediation, and it names the tracked operation that started the run in its OperationId.

The same singleton implements ILatticeSchemaOperations, whose start verbs return as soon as the run is accepted and whose status verbs report its phase and values processed. The blocking LATTICE0002 facade verbs were removed in this major version; see Schema operations for the migration table:

Method Signature
StartRemediationAsync Task<LatticeOperationHandle> StartRemediationAsync(string treeId, LatticeValueTransform transform, LatticeSchemaPolicy targetPolicy, string? operationId = null, CancellationToken cancellationToken = default)
StartMigrationAsync Task<LatticeOperationHandle> StartMigrationAsync(string treeId, string? operationId = null, CancellationToken cancellationToken = default)
StartAdvanceAndMigrateAsync Task<LatticeOperationHandle> StartAdvanceAndMigrateAsync(string treeId, uint newTargetVersion, string? operationId = null, CancellationToken cancellationToken = default)
GetOperationStatusAsync Task<LatticeOperationStatus?> GetOperationStatusAsync(string operationId, CancellationToken cancellationToken = default)
ListOperationsAsync Task<LatticeOperationPage> ListOperationsAsync(LatticeOperationListRequest request, CancellationToken cancellationToken = default)
CancelOperationAsync Task<LatticeOperationStatus?> CancelOperationAsync(string operationId, CancellationToken cancellationToken = default)

See Schema operations for the kinds, phases, outcomes, scoping and the migration from the removed blocking verbs.

Scan compliance is read-only. Start it with ILatticeSchemaComplianceOperations, then read the same LatticeSchemaComplianceReport back from the operation result with SchemaComplianceScanResults.TryReadReport. A large scan can outlast the caller's timeout, so the facade now exposes only the tracked operation path.

Probe capabilities has no side effects. It performs two fail-closed probes, Read and SchemaAdmin, and maps them to capability flags. The result is advisory only: every real operation still performs its own authorization immediately before touching data.

Compliance-scan operations

ILatticeSchemaComplianceOperations

The accept-then-poll compliance scan, published in Orleans.Lattice.Api.Abstractions under the Orleans.Lattice.Api.Schema namespace and registered by AddLatticeSchemaApi. It extends the shared ILatticeOperations read-and-cancel surface, scoped to the schema.compliance-scan kind, the caller's tenant and the trees the caller may read. See Schema compliance operations for the phases, units, result keys and the migration from the blocking scan.

Method Signature
StartComplianceScanAsync Task<LatticeOperationHandle> StartComplianceScanAsync(string treeId, string? operationId = null, CancellationToken cancellationToken = default)
GetOperationStatusAsync Task<LatticeOperationStatus?> GetOperationStatusAsync(string operationId, CancellationToken cancellationToken = default)
ListOperationsAsync Task<LatticeOperationPage> ListOperationsAsync(LatticeOperationListRequest request, CancellationToken cancellationToken = default)
CancelOperationAsync Task<LatticeOperationStatus?> CancelOperationAsync(string operationId, CancellationToken cancellationToken = default)

The kind, phase and unit names are the SchemaComplianceScanOperation constants and the result keys and TryReadReport are on SchemaComplianceScanResults, both in Orleans.Lattice.Schema.

Model records

LatticeSchemaCapabilities

The allowed-operation set the read-only capability probe reports for one tree. Every flag is default-deny (false means "not known to be permitted"), and the flags are advisory: the server still authorizes each real operation fail-closed. The probe distinguishes the two authorization grants the access gate models - Read and SchemaAdmin - so read-only flags move together and administrative flags move together.

  • string TreeId - the tree id these capabilities were evaluated over: the effective id the facade resolved the caller's name to, which under an asserted non-default tenant is the tenant-scoped t/{tenant}/{name} id.
  • bool CanViewPolicy - whether the caller may read the tree policy.
  • bool CanViewDeadLetters - whether the caller may read the tree's dead-letter entries.
  • bool CanViewVersionConfig - whether the caller may read the tree's version config.
  • bool CanViewRemediationStatus - whether the caller may read remediation status for the tree.
  • bool CanScanCompliance - whether the caller may run a read-only compliance audit.
  • bool CanManagePolicy - whether the caller may set or clear the tree policy.
  • bool CanManageVersion - whether the caller may set, advance, migrate, or clear the version config.
  • bool CanRemediate - whether the caller may run remediation for the tree.

The existing CanView*, CanManage*, CanScanCompliance and CanRemediate fields remain permission-only, including CanViewVersionConfig and CanManageVersion. A grant does not claim that a capability is installed.

Additional field Meaning
SupportsEnforcement Policy enforcement is installed.
SupportsVersioning Envelope versioning is installed.
SupportsRemediation The remediation engine is installed.
SupportsCompliance Compliance scanning is installed.
SupportsDeadLetters Dead-letter inspection is installed.
SupportsRuntimeRegistration Durable runtime catalogs are installed.
CanStartMigration / MigrationUnavailableReason Current caller and tree prerequisites admit a migration, or explain why not.
CanStartRemediation / RemediationUnavailableReason Current caller and installed prerequisites admit a remediation with valid supplied inputs, or explain why not.

Readiness is advisory and rechecked on attempt. It cannot certify unregistered versions that may exist in externally supplied data.

Runtime version catalog

GetRegistryAsync requires Read; RegisterSchemaAsync requires SchemaAdmin. Both resolve the effective tenant tree before authorization. LatticeSchemaRuntimeRegistration contains Descriptors (LatticeSchemaDescriptor[]), Upcasters (LatticeSchemaRuntimeUpcaster[]) and discovery-only SupportedTransformIds (string[]). A hop specifies its family, source and later destination version, and exactly one declarative Transform or host-installed TransformId. Names identify versions, not validation shapes.

Registration is append-only and idempotent for identical definitions; incompatible definitions or hops are refused without replacing earlier registrations. Registration is refused with ArgumentException when a descriptor has a zero schema id or version or a name that is blank or longer than 256 characters; when a hop does not advance between two versions of its family that are registered (in the catalog or the same request); when a hop carries both or neither of Transform and TransformId, a Transform whose root is not Passthrough, or a TransformId longer than 256 characters or not installed on the host; or when a request, or the merged catalog, exceeds 128 versions or 128 hops (a request is also limited to 256 KiB serialized). The catalog is durable per effective tree in the selected region and merges with the host's startup registry. Host transform ids reference explicitly installed code, never CLR names or uploaded assemblies. All serving silos must advertise the same host transforms. For multiple regions, provision matching registrations independently before advancing a replicated tree; the catalog is not automatically replicated. See Schema versioning.

ApiSchemaTypeAliases

A public static class (also in Orleans.Lattice.Api.Abstractions, namespace Orleans.Lattice.Api.Schema) holding the stable ois.-prefixed Orleans serialization aliases of the control-API contract types: AliasPrefix and the LatticeSchemaCapabilities alias.

The DTO types LatticeSchemaPolicy, LatticeSchemaVersionConfig, LatticeSchemaDeadLetterEntry, LatticeSchemaRemediationReport, LatticeSchemaComplianceReport, and LatticeValueTransform are defined in Orleans.Lattice.Schema.