{
  "schema": "lattice.agents/api/v1",
  "surface": "replication",
  "packages": [
    "Orleans.Lattice.Api.Abstractions",
    "Orleans.Lattice.Api.Replication",
    "Orleans.Lattice.Api.Replication.Grpc",
    "Orleans.Lattice.Replication",
    "Orleans.Lattice.Replication.Grpc"
  ],
  "sources": [
    "docs/lattice.replication/dead-letter-queue.md",
    "src/lattice.api.abstractions/Replication/ILatticeReplicationControl.cs#ILatticeReplicationControl",
    "src/lattice.api.abstractions/Replication/ILatticeReplicationPeerAdmin.cs#ILatticeReplicationPeerAdmin",
    "src/lattice.api.abstractions/Replication/ILatticeReplicationStatus.cs#ILatticeReplicationStatus",
    "src/lattice.api.replication.grpc/LatticeReplicationApiGrpcServiceCollectionExtensions.Status.cs#AddLatticeReplicationStatusApiGrpc",
    "src/lattice.api.replication.grpc/LatticeReplicationGrpcMethods.cs#LatticeReplicationGrpcMethods",
    "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#LatticeReplicationGrpcService",
    "src/lattice.api.replication.grpc/LatticeReplicationStatusGrpcMethods.cs#LatticeReplicationStatusGrpcMethods",
    "src/lattice.api.replication.grpc/LatticeReplicationStatusGrpcService.cs#LatticeReplicationStatusGrpcService",
    "src/lattice.api.replication.grpc/Security/LatticeReplicationApiGrpcAuthInterceptor.cs#LatticeReplicationApiGrpcAuthInterceptor",
    "src/lattice.api.replication/LatticeApiReplicationServiceCollectionExtensions.Status.cs#AddLatticeReplicationStatusApi",
    "src/lattice.api.replication/LatticeReplicationControl.cs#LatticeReplicationControl",
    "src/lattice.api.replication/LatticeReplicationStatus.cs#LatticeReplicationStatus",
    "src/lattice.api.replication/LatticeReplicationStatusOptions.cs#LatticeReplicationStatusOptions",
    "src/lattice.api.replication/ReplicationPeerStatusContinuation.cs#ReplicationPeerStatusContinuation",
    "src/lattice.replication.grpc/GrpcPushTransport.cs#GrpcPushTransport",
    "src/lattice.replication.grpc/GrpcRemoteSnapshotTransport.cs#GrpcRemoteSnapshotTransport",
    "src/lattice.replication.grpc/GrpcSagaControlChannel.cs#GrpcSagaControlChannel",
    "src/lattice.replication.grpc/LatticeRemoteSnapshotGrpcMethods.cs#LatticeRemoteSnapshotGrpcMethods",
    "src/lattice.replication.grpc/LatticeRemoteSnapshotGrpcService.cs#LatticeRemoteSnapshotGrpcService",
    "src/lattice.replication.grpc/LatticeReplicationGrpcMethod.cs#LatticeReplicationGrpcMethod",
    "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#LatticeReplicationGrpcService",
    "src/lattice.replication.grpc/LatticeSagaGrpcMethods.cs#LatticeSagaGrpcMethods",
    "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#LatticeSagaGrpcService",
    "src/lattice.replication.grpc/PeerMapSagaPeerAuthorizer.cs#PeerMapSagaPeerAuthorizer",
    "src/lattice.replication.grpc/Security/GrpcChannelHardening.cs#GrpcChannelHardening",
    "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor",
    "src/lattice.replication/BootstrapCoordinatorStatus.cs",
    "src/lattice.replication/DefaultShardCountProvider.cs#GetShardRootKeysAsync",
    "src/lattice.replication/Grains/LatticeBootstrapCoordinatorGrain.cs",
    "src/lattice.replication/ILatticeBootstrapCoordinator.cs",
    "src/lattice.replication/ILatticeReplicationAdmin.cs#ILatticeReplicationAdmin",
    "src/lattice.replication/ILatticeReplicationConfigAuthority.cs#ILatticeReplicationConfigAuthority",
    "src/lattice.replication/ILatticeReplicationDeadLetters.cs",
    "src/lattice.replication/ILatticeSagaControlHandler.cs#ILatticeSagaControlHandler",
    "src/lattice.replication/IRemoteSnapshotTransport.cs#IRemoteSnapshotTransport",
    "src/lattice.replication/ISagaControlChannel.cs#ISagaControlChannel",
    "src/lattice.replication/IShardCountProvider.cs#GetShardRootKeysAsync",
    "src/lattice.replication/LatticeRemoteSnapshotService.cs#LatticeRemoteSnapshotService",
    "src/lattice.replication/LatticeReplicationDeadLetters.cs",
    "src/lattice.replication/LatticeReplicationLocalVcSeeder.cs#LatticeReplicationLocalVcSeeder",
    "src/lattice.replication/PeerStatus/IReplicationPeerStatusReader.cs#IReplicationPeerStatusReader",
    "src/lattice.replication/PeerStatus/ReplicationPeerStatusReadPath.cs#AddReplicationPeerStatusReadPath"
  ],
  "in_process": {
    "interface": "ILatticeReplicationControl; ILatticeReplicationPeerAdmin; ILatticeReplicationStatus",
    "registration": "ISiloBuilder.AddLatticeReplicationApi after AddLatticeReplication(..., enableRuntimeConfig: true); ISiloBuilder.AddLatticeReplicationStatusApi after AddLatticeReplication(...).",
    "source": "src/lattice.api.replication/LatticeApiReplicationServiceCollectionExtensions.Status.cs#AddLatticeReplicationStatusApi"
  },
  "grpc": {
    "service": "orleans.lattice.api.replication; orleans.lattice.api.replication.status; orleans.lattice.replication.LatticeReplication; orleans.lattice.replication.LatticeRemoteSnapshot; orleans.lattice.replication.LatticeSaga",
    "methods_source": "src/lattice.api.replication.grpc/LatticeReplicationGrpcMethods.cs#LatticeReplicationGrpcMethods",
    "marshalling": "API facade methods use LatticeReplicationGrpcMarshallers; peer replication methods use Orleans serializer-backed code-first marshallers and the replication batch encoder for WAL envelopes.",
    "metadata": [
      {
        "name": "authorization",
        "purpose": "Credential token header; the default bridge strips the configured ****** and stamps a LatticeCredential.",
        "source": "src/lattice.api.replication.grpc/HeaderLatticeReplicationApiCredentialBridge.cs#HeaderLatticeReplicationApiCredentialBridge"
      },
      {
        "name": "active tenant header",
        "purpose": "Configured active tenant assertion header; the assertion is re-validated downstream and grants no access by itself.",
        "source": "src/lattice.api.replication.grpc/LatticeReplicationApiGrpcOptions.cs#ActiveTenantHeaderName"
      },
      {
        "name": "x-lattice-replication-secret",
        "purpose": "Shared-secret credential attached to every peer replication gRPC call and validated by the receiver interceptor.",
        "source": "src/lattice.replication.grpc/Security/LatticeReplicationGrpcMetadataNames.cs#SecretHeader"
      },
      {
        "name": "x-lattice-replication-origin",
        "purpose": "Local cluster id stamped on peer calls for diagnostics, peer attribution, saga authorization, origin/body consistency checks, and credential-to-origin binding (on by default, disabled with BindCredentialToOriginCluster false).",
        "source": "src/lattice.replication.grpc/Security/LatticeReplicationGrpcMetadataNames.cs#OriginClusterIdHeader"
      }
    ],
    "auth": {
      "interceptor": "LatticeReplicationGrpcAuthInterceptor and facade-specific LatticeReplicationApiGrpcAuthInterceptor",
      "authorizer": "IReplicationSecretProvider for peer transports; ILatticeReplicationApiAuthorizer for the facade and status facade; ISagaPeerAuthorizer for saga control after shared-secret auth.",
      "decision": "Peer replication methods require the shared-secret header when RequireAuthentication is true; missing credentials are Unauthenticated and bad credentials are PermissionDenied. With BindCredentialToOriginCluster at its default true, an accepted credential must also match the outbound secret configured for the stamped origin or the call is PermissionDenied. The facade authorizer covers the control service and peer-status service, exempts only GetAuthScheme, and maps GetPeerStatus to LatticeReplicationApiOperation.GetPeerStatus. Saga control additionally requires the interceptor's credential-to-origin binding, so it is refused when RequireAuthentication or BindCredentialToOriginCluster is false, denies origins outside the configured peer map before state mutation, and answers a GetDecision query only to a recorded participant of the saga.",
      "source": "src/lattice.api.replication.grpc/Security/LatticeReplicationApiGrpcAuthInterceptor.cs#LatticeReplicationApiGrpcAuthInterceptor"
    }
  },
  "availability": {
    "in_process": [
      {
        "registration": "AddLatticeReplicationApi",
        "package": "Orleans.Lattice.Api.Replication",
        "provides": [
          "ILatticeReplicationControl",
          "ILatticeReplicationPeerAdmin"
        ],
        "source": "src/lattice.api.replication/LatticeApiReplicationServiceCollectionExtensions.cs#LatticeApiReplicationServiceCollectionExtensions.AddLatticeReplicationApi"
      },
      {
        "registration": "AddLatticeReplicationStatusApi",
        "package": "Orleans.Lattice.Api.Replication",
        "provides": [
          "ILatticeReplicationStatus"
        ],
        "source": "src/lattice.api.replication/LatticeApiReplicationServiceCollectionExtensions.Status.cs#LatticeApiReplicationServiceCollectionExtensions.AddLatticeReplicationStatusApi"
      },
      {
        "registration": "AddLatticeReplication",
        "package": "Orleans.Lattice.Replication",
        "provides": [
          "ILatticeReplicationAdmin",
          "ILatticeReplicationDeadLetters",
          "ILatticeBootstrapCoordinator"
        ],
        "source": "src/lattice.replication/LatticeReplicationServiceCollectionExtensions.cs#LatticeReplicationServiceCollectionExtensions.AddLatticeReplication"
      }
    ],
    "requires": [
      {
        "name": "AddLatticeReplication",
        "kind": "registration",
        "arguments": "enableRuntimeConfig: true",
        "reason": "The replication control facade needs the runtime config authority registered by AddLatticeReplication with enableRuntimeConfig true.",
        "source": "src/lattice.api.replication/LatticeApiReplicationServiceCollectionExtensions.cs#LatticeApiReplicationServiceCollectionExtensions.AddLatticeReplicationApi"
      },
      {
        "name": "AddLatticeReplication",
        "kind": "registration",
        "reason": "The replication status facade reads replication status from the replication package and fails fast when AddLatticeReplication has not registered it.",
        "source": "src/lattice.api.replication/LatticeApiReplicationServiceCollectionExtensions.Status.cs#LatticeApiReplicationServiceCollectionExtensions.AddLatticeReplicationStatusApi"
      }
    ],
    "grpc_server": [
      {
        "registration": "AddLatticeReplicationApiGrpc",
        "package": "Orleans.Lattice.Api.Replication.Grpc",
        "source": "src/lattice.api.replication.grpc/LatticeReplicationApiGrpcServiceCollectionExtensions.cs#LatticeReplicationApiGrpcServiceCollectionExtensions.AddLatticeReplicationApiGrpc"
      },
      {
        "registration": "MapLatticeReplicationApiGrpc",
        "package": "Orleans.Lattice.Api.Replication.Grpc",
        "source": "src/lattice.api.replication.grpc/LatticeReplicationApiGrpcServiceCollectionExtensions.cs#LatticeReplicationApiGrpcServiceCollectionExtensions.MapLatticeReplicationApiGrpc"
      },
      {
        "registration": "AddLatticeReplicationStatusApiGrpc",
        "package": "Orleans.Lattice.Api.Replication.Grpc",
        "source": "src/lattice.api.replication.grpc/LatticeReplicationApiGrpcServiceCollectionExtensions.Status.cs#LatticeReplicationApiGrpcServiceCollectionExtensions.AddLatticeReplicationStatusApiGrpc"
      },
      {
        "registration": "MapLatticeReplicationStatusApiGrpc",
        "package": "Orleans.Lattice.Api.Replication.Grpc",
        "source": "src/lattice.api.replication.grpc/LatticeReplicationApiGrpcServiceCollectionExtensions.Status.cs#LatticeReplicationApiGrpcServiceCollectionExtensions.MapLatticeReplicationStatusApiGrpc"
      },
      {
        "registration": "AddLatticeReplicationGrpc",
        "package": "Orleans.Lattice.Replication.Grpc",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcServiceCollectionExtensions.cs#LatticeReplicationGrpcServiceCollectionExtensions.AddLatticeReplicationGrpc"
      },
      {
        "registration": "MapLatticeReplicationGrpc",
        "package": "Orleans.Lattice.Replication.Grpc",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcServiceCollectionExtensions.cs#LatticeReplicationGrpcServiceCollectionExtensions.MapLatticeReplicationGrpc"
      }
    ],
    "grpc_client": [],
    "absent": null
  },
  "types": {
    "AdvertisedCompressionDictionary": {
      "kind": "record struct",
      "fields": [
        {
          "name": "Id",
          "type": "uint",
          "required": true
        },
        {
          "name": "Fingerprint",
          "type": "ulong",
          "required": true
        }
      ],
      "source": "src/lattice.replication/SharedDictionaryNegotiation.cs#AdvertisedCompressionDictionary"
    },
    "ApplyResult": {
      "kind": "record struct",
      "fields": [
        {
          "name": "Applied",
          "type": "bool",
          "required": true
        },
        {
          "name": "HighWaterMark",
          "type": "HybridLogicalClock",
          "required": true
        },
        {
          "name": "Deferred",
          "type": "bool",
          "required": true
        },
        {
          "name": "SourceLineageRefused",
          "type": "bool",
          "required": true
        },
        {
          "name": "TenantIsolationRefused",
          "type": "bool",
          "required": true
        },
        {
          "name": "DeadLettered",
          "type": "bool",
          "required": true
        }
      ],
      "source": "src/lattice.replication/ApplyResult.cs#ApplyResult"
    },
    "AuthSchemeAdvertisement": {
      "kind": "record",
      "fields": [
        {
          "name": "Schemes",
          "type": "IReadOnlyList<AuthSchemeDescriptor>",
          "required": false
        }
      ],
      "source": "src/lattice.api.replication.grpc/Model/AuthSchemeAdvertisement.cs#AuthSchemeAdvertisement"
    },
    "AuthSchemeAdvertisementRequest": {
      "kind": "record",
      "fields": [],
      "source": "src/lattice.api.replication.grpc/Model/AuthSchemeAdvertisementRequest.cs#AuthSchemeAdvertisementRequest"
    },
    "AuthSchemeDescriptor": {
      "kind": "record",
      "fields": [
        {
          "name": "SchemeId",
          "type": "string",
          "required": true
        },
        {
          "name": "DisplayName",
          "type": "string",
          "required": false
        },
        {
          "name": "Parameters",
          "type": "IReadOnlyDictionary<string, string>",
          "required": false
        }
      ],
      "source": "src/lattice.api.replication.grpc/Model/AuthSchemeDescriptor.cs#AuthSchemeDescriptor"
    },
    "CompressionDictionaryPullRequest": {
      "kind": "struct",
      "fields": [
        {
          "name": "DictionaryId",
          "type": "uint",
          "required": true
        }
      ],
      "source": "src/lattice.replication/CompressionDictionaryPullRequest.cs#CompressionDictionaryPullRequest"
    },
    "CompressionDictionaryPullResponse": {
      "kind": "struct",
      "fields": [
        {
          "name": "ExchangeSupported",
          "type": "bool",
          "required": true
        },
        {
          "name": "Found",
          "type": "bool",
          "required": true
        },
        {
          "name": "DictionaryId",
          "type": "uint",
          "required": true
        },
        {
          "name": "Fingerprint",
          "type": "ulong",
          "required": true
        },
        {
          "name": "Dictionary",
          "type": "ReadOnlyMemory<byte>",
          "required": false
        }
      ],
      "source": "src/lattice.replication/CompressionDictionaryPullResponse.cs#CompressionDictionaryPullResponse"
    },
    "ContentManifestEntry": {
      "kind": "struct",
      "fields": [
        {
          "name": "EntryIndex",
          "type": "int",
          "required": true
        },
        {
          "name": "Key",
          "type": "string",
          "required": true
        },
        {
          "name": "ContentHash",
          "type": "ulong",
          "required": true
        },
        {
          "name": "Hlc",
          "type": "HybridLogicalClock",
          "required": true
        }
      ],
      "source": "src/lattice.replication/ContentManifestEntry.cs#ContentManifestEntry"
    },
    "ContentManifestRequest": {
      "kind": "struct",
      "fields": [
        {
          "name": "TreeName",
          "type": "string",
          "required": true
        },
        {
          "name": "OriginClusterId",
          "type": "string",
          "required": true
        },
        {
          "name": "Entries",
          "type": "IReadOnlyList<ContentManifestEntry>",
          "required": false
        }
      ],
      "source": "src/lattice.replication/ContentManifestRequest.cs#ContentManifestRequest"
    },
    "ContentManifestResponse": {
      "kind": "struct",
      "fields": [
        {
          "name": "ExchangeSupported",
          "type": "bool",
          "required": true
        },
        {
          "name": "MissingEntryIndices",
          "type": "IReadOnlyList<int>",
          "required": false
        },
        {
          "name": "AdvancedHlc",
          "type": "HybridLogicalClock",
          "required": true
        }
      ],
      "source": "src/lattice.replication/ContentManifestResponse.cs#ContentManifestResponse"
    },
    "DeadLetterEntry": {
      "kind": "record struct",
      "fields": [
        {
          "name": "EntryId",
          "type": "long",
          "required": true
        },
        {
          "name": "Entry",
          "type": "WalRecord",
          "required": true
        },
        {
          "name": "FailureReason",
          "type": "string",
          "required": true
        },
        {
          "name": "RetryCount",
          "type": "int",
          "required": true
        },
        {
          "name": "EnqueuedAtTicks",
          "type": "long",
          "required": true
        },
        {
          "name": "SourceLineageClusterId",
          "type": "string?",
          "required": false
        },
        {
          "name": "SourceLineage",
          "type": "Guid?",
          "required": false
        }
      ],
      "source": "src/lattice.replication/DeadLetterEntry.cs#DeadLetterEntry"
    },
    "DigestProbeRequest": {
      "kind": "struct",
      "fields": [
        {
          "name": "TreeName",
          "type": "string",
          "required": true
        },
        {
          "name": "ShardIndex",
          "type": "int",
          "required": true
        }
      ],
      "source": "src/lattice.replication/DigestProbeRequest.cs#DigestProbeRequest"
    },
    "DigestProbeResponse": {
      "kind": "struct",
      "fields": [
        {
          "name": "DigestAvailable",
          "type": "bool",
          "required": true
        },
        {
          "name": "Digest",
          "type": "LeafProjectionDigest",
          "required": true
        }
      ],
      "source": "src/lattice.replication/DigestProbeResponse.cs#DigestProbeResponse"
    },
    "LatticeMergeMode": {
      "kind": "enum",
      "values": [
        "LwwRegister",
        "OrSet",
        "PnCounter",
        "VersionVector",
        "MvRegister",
        "OrMap",
        "Sequence",
        "OrFlag",
        "RwFlag",
        "GCounter",
        "GSet",
        "RwSet",
        "MaxRegister",
        "MinRegister"
      ],
      "source": "src/lattice/BPlusTree/Grains/LatticeMergeMode.cs#LatticeMergeMode"
    },
    "MerkleWalkProbeRequest": {
      "kind": "struct",
      "fields": [
        {
          "name": "TreeName",
          "type": "string",
          "required": true
        },
        {
          "name": "ShardIndex",
          "type": "int",
          "required": true
        },
        {
          "name": "RangeStartKey",
          "type": "string?",
          "required": false
        },
        {
          "name": "RangeEndKey",
          "type": "string?",
          "required": false
        },
        {
          "name": "Depth",
          "type": "int",
          "required": true
        }
      ],
      "source": "src/lattice.replication/MerkleWalkProbeRequest.cs#MerkleWalkProbeRequest"
    },
    "MerkleWalkProbeResponse": {
      "kind": "struct",
      "fields": [
        {
          "name": "Available",
          "type": "bool",
          "required": true
        },
        {
          "name": "Digest",
          "type": "LeafProjectionDigest",
          "required": true
        }
      ],
      "source": "src/lattice.replication/MerkleWalkProbeResponse.cs#MerkleWalkProbeResponse"
    },
    "OperatorReseedDecision": {
      "kind": "record struct",
      "fields": [
        {
          "name": "Triggered",
          "type": "bool",
          "required": true
        },
        {
          "name": "LastRequestedAt",
          "type": "DateTimeOffset?",
          "required": false
        },
        {
          "name": "RetryAfter",
          "type": "TimeSpan?",
          "required": false
        }
      ],
      "source": "src/lattice.replication/OperatorReseedDecision.cs#OperatorReseedDecision"
    },
    "PeerHighWaterMarkRequest": {
      "kind": "struct",
      "fields": [
        {
          "name": "TreeName",
          "type": "string",
          "required": true
        },
        {
          "name": "OriginClusterId",
          "type": "string",
          "required": true
        }
      ],
      "source": "src/lattice.replication/PeerHighWaterMarkRequest.cs#PeerHighWaterMarkRequest"
    },
    "PeerHighWaterMarkResponse": {
      "kind": "struct",
      "fields": [
        {
          "name": "Clock",
          "type": "HybridLogicalClock",
          "required": true
        }
      ],
      "source": "src/lattice.replication/PeerHighWaterMarkResponse.cs#PeerHighWaterMarkResponse"
    },
    "RemoteSnapshotMetadata": {
      "kind": "struct",
      "fields": [
        {
          "name": "TreeName",
          "type": "string",
          "required": true
        },
        {
          "name": "SourceClusterId",
          "type": "string",
          "required": true
        },
        {
          "name": "AsOfHlc",
          "type": "HybridLogicalClock",
          "required": true
        },
        {
          "name": "CausalStableFrontier",
          "type": "VersionVector",
          "required": true
        }
      ],
      "source": "src/lattice.replication/RemoteSnapshotMetadata.cs#RemoteSnapshotMetadata"
    },
    "RemoteSnapshotMetadataRequest": {
      "kind": "struct",
      "fields": [
        {
          "name": "TreeName",
          "type": "string",
          "required": true
        },
        {
          "name": "SourceClusterId",
          "type": "string",
          "required": true
        },
        {
          "name": "FromAsOfHlc",
          "type": "HybridLogicalClock",
          "required": true
        }
      ],
      "source": "src/lattice.replication/RemoteSnapshotMetadataRequest.cs#RemoteSnapshotMetadataRequest"
    },
    "RemoteSnapshotStreamItem": {
      "kind": "struct",
      "fields": [
        {
          "name": "Entry",
          "type": "SnapshotEntry",
          "required": true
        }
      ],
      "source": "src/lattice.replication/RemoteSnapshotStreamItem.cs#RemoteSnapshotStreamItem"
    },
    "ReplicationAck": {
      "kind": "struct",
      "fields": [
        {
          "name": "Accepted",
          "type": "bool",
          "required": true
        },
        {
          "name": "HighestAppliedHlc",
          "type": "HybridLogicalClock",
          "required": true
        },
        {
          "name": "BlockedAtHlc",
          "type": "HybridLogicalClock?",
          "required": false
        },
        {
          "name": "SuggestedBatchSize",
          "type": "int?",
          "required": false
        },
        {
          "name": "PauseForMs",
          "type": "int?",
          "required": false
        },
        {
          "name": "SupportedWireVersion",
          "type": "int?",
          "required": false
        },
        {
          "name": "AdvertisedDictionaryIds",
          "type": "uint[]?",
          "required": false
        },
        {
          "name": "AdvertisedDictionaries",
          "type": "AdvertisedCompressionDictionary[]?",
          "required": false
        }
      ],
      "source": "src/lattice.replication/ReplicationAck.cs#ReplicationAck"
    },
    "ReplicationBatchEnvelope": {
      "kind": "struct",
      "fields": [
        {
          "name": "WireVersion",
          "type": "int",
          "required": true
        },
        {
          "name": "TreeName",
          "type": "string",
          "required": true
        },
        {
          "name": "OriginClusterId",
          "type": "string",
          "required": true
        },
        {
          "name": "Entries",
          "type": "IReadOnlyList<WalRecord>",
          "required": false
        }
      ],
      "source": "src/lattice.replication/ReplicationBatchEnvelope.cs#ReplicationBatchEnvelope"
    },
    "ReplicationConfigResponse": {
      "kind": "record",
      "fields": [
        {
          "name": "Trees",
          "type": "IReadOnlyList<ReplicationTreeConfigMessage>",
          "required": false
        }
      ],
      "source": "src/lattice.api.replication.grpc/Model/ReplicationConfigResponse.cs#ReplicationConfigResponse"
    },
    "ReplicationDisableRequestMessage": {
      "kind": "record",
      "fields": [
        {
          "name": "TreeId",
          "type": "string",
          "required": true
        }
      ],
      "source": "src/lattice.api.replication.grpc/Model/ReplicationDisableRequestMessage.cs#ReplicationDisableRequestMessage"
    },
    "ReplicationDisableResponse": {
      "kind": "record",
      "fields": [
        {
          "name": "TreeId",
          "type": "string",
          "required": true
        },
        {
          "name": "AlreadyDisabled",
          "type": "bool",
          "required": false
        }
      ],
      "source": "src/lattice.api.replication.grpc/Model/ReplicationDisableResponse.cs#ReplicationDisableResponse"
    },
    "ReplicationEnableRequestMessage": {
      "kind": "record",
      "fields": [
        {
          "name": "TreeId",
          "type": "string",
          "required": true
        },
        {
          "name": "Mode",
          "type": "LatticeMergeMode",
          "required": false
        },
        {
          "name": "BootstrapSourceClusterId",
          "type": "string?",
          "required": false
        }
      ],
      "source": "src/lattice.api.replication.grpc/Model/ReplicationEnableRequestMessage.cs#ReplicationEnableRequestMessage"
    },
    "ReplicationEnableResponse": {
      "kind": "record",
      "fields": [
        {
          "name": "TreeId",
          "type": "string",
          "required": true
        },
        {
          "name": "Mode",
          "type": "LatticeMergeMode",
          "required": false
        },
        {
          "name": "AlreadyEnabled",
          "type": "bool",
          "required": false
        },
        {
          "name": "BootstrapRequested",
          "type": "bool",
          "required": false
        }
      ],
      "source": "src/lattice.api.replication.grpc/Model/ReplicationEnableResponse.cs#ReplicationEnableResponse"
    },
    "ReplicationEnrollmentSource": {
      "kind": "enum",
      "values": [
        "Runtime",
        "Static",
        "RuntimeAndStatic"
      ],
      "source": "src/lattice.api.abstractions/Replication/Model/ReplicationEnrollmentSource.cs#ReplicationEnrollmentSource"
    },
    "ReplicationGetConfigRequest": {
      "kind": "record",
      "fields": [],
      "source": "src/lattice.api.replication.grpc/Model/ReplicationGetConfigRequest.cs#ReplicationGetConfigRequest"
    },
    "ReplicationLinkDirection": {
      "kind": "enum",
      "values": [
        "Outbound",
        "Inbound"
      ],
      "source": "src/lattice.api.abstractions/Replication/Model/ReplicationLinkDirection.cs#ReplicationLinkDirection"
    },
    "ReplicationLinkHealth": {
      "kind": "enum",
      "values": [
        "Unknown",
        "Healthy",
        "Lagging",
        "Stalled"
      ],
      "source": "src/lattice.api.abstractions/Replication/Model/ReplicationLinkHealth.cs#ReplicationLinkHealth"
    },
    "ReplicationPeerStatusEntry": {
      "kind": "record",
      "fields": [
        {
          "name": "TreeId",
          "type": "string",
          "required": false
        },
        {
          "name": "PeerRegionId",
          "type": "string",
          "required": false
        },
        {
          "name": "Direction",
          "type": "ReplicationLinkDirection",
          "required": false
        },
        {
          "name": "EntriesBehind",
          "type": "long",
          "required": false
        },
        {
          "name": "BytesBehind",
          "type": "long",
          "required": false
        },
        {
          "name": "ConsecutiveErrors",
          "type": "long",
          "required": false
        },
        {
          "name": "TimeSinceLastContact",
          "type": "TimeSpan?",
          "required": false
        },
        {
          "name": "InFlight",
          "type": "long",
          "required": false
        },
        {
          "name": "Health",
          "type": "ReplicationLinkHealth",
          "required": false
        }
      ],
      "source": "src/lattice.api.abstractions/Replication/Model/ReplicationPeerStatusEntry.cs#ReplicationPeerStatusEntry"
    },
    "ReplicationPeerStatusPage": {
      "kind": "record",
      "fields": [
        {
          "name": "LocalRegionId",
          "type": "string",
          "required": false
        },
        {
          "name": "Peers",
          "type": "IReadOnlyList<ReplicationPeerStatusEntry>",
          "required": false
        },
        {
          "name": "ContinuationToken",
          "type": "string?",
          "required": false
        }
      ],
      "source": "src/lattice.api.abstractions/Replication/Model/ReplicationPeerStatusPage.cs#ReplicationPeerStatusPage"
    },
    "ReplicationPeerStatusQuery": {
      "kind": "record",
      "fields": [
        {
          "name": "TreeId",
          "type": "string?",
          "required": false
        },
        {
          "name": "PeerRegionId",
          "type": "string?",
          "required": false
        },
        {
          "name": "PageSize",
          "type": "int",
          "required": false
        },
        {
          "name": "ContinuationToken",
          "type": "string?",
          "required": false
        }
      ],
      "source": "src/lattice.api.abstractions/Replication/Model/ReplicationPeerStatusQuery.cs#ReplicationPeerStatusQuery"
    },
    "ReplicationTreeConfigMessage": {
      "kind": "record",
      "fields": [
        {
          "name": "TreeId",
          "type": "string",
          "required": true
        },
        {
          "name": "Enabled",
          "type": "bool",
          "required": false
        },
        {
          "name": "HasMode",
          "type": "bool",
          "required": false
        },
        {
          "name": "Mode",
          "type": "LatticeMergeMode",
          "required": false
        },
        {
          "name": "Ambiguous",
          "type": "bool",
          "required": false
        },
        {
          "name": "Source",
          "type": "ReplicationEnrollmentSource",
          "required": false
        }
      ],
      "source": "src/lattice.api.replication.grpc/Model/ReplicationTreeConfigMessage.cs#ReplicationTreeConfigMessage"
    },
    "SagaControlRequest": {
      "kind": "struct",
      "fields": [
        {
          "name": "SagaId",
          "type": "string",
          "required": true
        },
        {
          "name": "TargetTree",
          "type": "string",
          "required": true
        },
        {
          "name": "ManifestId",
          "type": "string",
          "required": false
        },
        {
          "name": "CoordinatorClusterId",
          "type": "string",
          "required": true
        },
        {
          "name": "SetId",
          "type": "string?",
          "required": false
        }
      ],
      "source": "src/lattice.replication/SagaControlRequest.cs#SagaControlRequest"
    },
    "SagaControlResponse": {
      "kind": "struct",
      "fields": [
        {
          "name": "SagaId",
          "type": "string",
          "required": true
        },
        {
          "name": "Phase",
          "type": "SagaPhase",
          "required": true
        },
        {
          "name": "Vote",
          "type": "SagaVote",
          "required": true
        },
        {
          "name": "Detail",
          "type": "string",
          "required": false
        }
      ],
      "source": "src/lattice.replication/SagaControlResponse.cs#SagaControlResponse"
    },
    "SagaPhase": {
      "kind": "enum",
      "values": [
        "None",
        "Prepared",
        "Committed",
        "Aborted"
      ],
      "source": "src/lattice.replication/SagaPhase.cs#SagaPhase"
    },
    "SagaVote": {
      "kind": "enum",
      "values": [
        "None",
        "Commit",
        "Abort"
      ],
      "source": "src/lattice.replication/SagaVote.cs#SagaVote"
    },
    "SnapshotEntry": {
      "kind": "struct",
      "fields": [
        {
          "name": "Key",
          "type": "string",
          "required": true
        },
        {
          "name": "Value",
          "type": "byte[]",
          "required": true
        },
        {
          "name": "Timestamp",
          "type": "HybridLogicalClock",
          "required": true
        },
        {
          "name": "IsPrepared",
          "type": "bool",
          "required": true
        },
        {
          "name": "IsTombstone",
          "type": "bool",
          "required": true
        },
        {
          "name": "TransactionId",
          "type": "Guid",
          "required": true
        },
        {
          "name": "SourceShardIndex",
          "type": "int",
          "required": true
        },
        {
          "name": "AtomicBatchSize",
          "type": "int",
          "required": true
        },
        {
          "name": "AtomicBatchIndex",
          "type": "int",
          "required": true
        },
        {
          "name": "ExpiresAtTicks",
          "type": "long",
          "required": true
        },
        {
          "name": "Delta",
          "type": "byte[]?",
          "required": false
        },
        {
          "name": "Mode",
          "type": "LatticeMergeMode",
          "required": true
        }
      ],
      "source": "src/lattice.replication/SnapshotEntry.cs#SnapshotEntry"
    },
    "BootstrapCoordinatorStatus": {
      "kind": "record struct",
      "fields": [
        {
          "name": "Phase",
          "type": "LatticeBootstrapState",
          "required": true
        },
        {
          "name": "SourceClusterId",
          "type": "string?",
          "required": false
        },
        {
          "name": "ReadFenced",
          "type": "bool",
          "required": false
        },
        {
          "name": "EntriesApplied",
          "type": "long",
          "required": false
        },
        {
          "name": "RedriveAttempts",
          "type": "int",
          "required": false
        },
        {
          "name": "CompletedSourceClusterId",
          "type": "string?",
          "required": false
        }
      ],
      "source": "src/lattice.replication/BootstrapCoordinatorStatus.cs"
    },
    "LatticeBootstrapState": {
      "kind": "enum",
      "values": [
        "Idle",
        "RequestingSnapshot",
        "ApplyingSnapshot",
        "IncrementalHandoff",
        "LiveIncremental",
        "Failed"
      ],
      "source": "src/lattice.replication/LatticeBootstrapState.cs"
    }
  },
  "operations": [
    {
      "id": "bootstrap",
      "in_process": "ILatticeBootstrapCoordinator.BootstrapAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeName, string sourceClusterId",
      "response": "Task (kickoff only)",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "Tree or source id is empty."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Another source owns the in-flight bootstrap."
        },
        {
          "error_id": "cancelled",
          "condition": "The request was cancelled."
        }
      ],
      "retry": {
        "safe": false,
        "policy": "Read current status before retrying. Same-source in-flight kickoff is absorbed; repeating after completion starts another attempt.",
        "source": "src/lattice.replication/ILatticeBootstrapCoordinator.cs"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "Same-source in-flight kickoff is a no-op; different-source kickoff is refused. After completion, another call starts a new attempt.",
        "source": "src/lattice.replication/ILatticeBootstrapCoordinator.cs"
      },
      "concurrency": {
        "rule": "Single activation per tree; same-source concurrent kickoff is a no-op, different-source kickoff is refused. Fresh attempts import into a shadow copy and publish only after a complete drain; legacy partial fenced imports resume in place.",
        "source": "src/lattice.replication/ILatticeBootstrapCoordinator.cs"
      },
      "sources": [
        "src/lattice.replication/ILatticeBootstrapCoordinator.cs"
      ]
    },
    {
      "id": "dead-letter-count",
      "in_process": "ILatticeReplicationDeadLetters.CountAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeId, CancellationToken cancellationToken",
      "response": {
        "type": "int",
        "meaning": "The number of entries currently parked for the tree."
      },
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "treeId is null or empty."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Pure read with no facade retry policy; retry on the caller.",
        "source": "src/lattice.replication/ILatticeReplicationDeadLetters.cs#CountAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Pure read; it changes no state.",
        "source": "src/lattice.replication/ILatticeReplicationDeadLetters.cs#CountAsync"
      },
      "concurrency": {
        "rule": "Calls for one tree are routed to that tree's single dead-letter grain activation, which processes them one at a time.",
        "source": "src/lattice.replication/LatticeReplicationDeadLetters.cs#LatticeReplicationDeadLetters.Grain"
      },
      "sources": [
        "src/lattice.replication/ILatticeReplicationDeadLetters.cs#CountAsync",
        "src/lattice.replication/LatticeReplicationDeadLetters.cs#CountAsync",
        "src/lattice.replication/Grains/ReplicationDeadLetterGrain.cs#CountAsync"
      ]
    },
    {
      "id": "dead-letter-discard",
      "in_process": "ILatticeReplicationDeadLetters.DiscardAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeId, long entryId, CancellationToken cancellationToken",
      "response": {
        "type": "bool",
        "meaning": "true when an entry was removed without being applied; false when no entry with that id existed."
      },
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "treeId is null or empty."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "A repeat discard of the same entry id returns false and changes nothing.",
        "source": "src/lattice.replication/ILatticeReplicationDeadLetters.cs#DiscardAsync"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "The queue state converges on repeat, but only the first call returns true.",
        "source": "src/lattice.replication/ILatticeReplicationDeadLetters.cs#DiscardAsync"
      },
      "concurrency": {
        "rule": "Calls for one tree are routed to that tree's single dead-letter grain activation, which processes them one at a time.",
        "source": "src/lattice.replication/LatticeReplicationDeadLetters.cs#LatticeReplicationDeadLetters.Grain"
      },
      "sources": [
        "src/lattice.replication/ILatticeReplicationDeadLetters.cs#DiscardAsync",
        "src/lattice.replication/LatticeReplicationDeadLetters.cs#DiscardAsync",
        "src/lattice.replication/Grains/ReplicationDeadLetterGrain.cs#DiscardAsync",
        "docs/lattice.replication/dead-letter-queue.md"
      ]
    },
    {
      "id": "dead-letter-list",
      "in_process": "ILatticeReplicationDeadLetters.ListAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeId, CancellationToken cancellationToken",
      "response": {
        "type": "IReadOnlyList<DeadLetterEntry>",
        "meaning": "Every parked entry for the tree in ascending EntryId order; empty when nothing is parked."
      },
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "treeId is null or empty."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Pure read with no facade retry policy; retry on the caller.",
        "source": "src/lattice.replication/ILatticeReplicationDeadLetters.cs#ListAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Pure read; it changes no state.",
        "source": "src/lattice.replication/ILatticeReplicationDeadLetters.cs#ListAsync"
      },
      "concurrency": {
        "rule": "Calls for one tree are routed to that tree's single dead-letter grain activation, which processes them one at a time.",
        "source": "src/lattice.replication/LatticeReplicationDeadLetters.cs#LatticeReplicationDeadLetters.Grain"
      },
      "sources": [
        "src/lattice.replication/ILatticeReplicationDeadLetters.cs#ListAsync",
        "src/lattice.replication/LatticeReplicationDeadLetters.cs#ListAsync",
        "src/lattice.replication/Grains/ReplicationDeadLetterGrain.cs#ListAsync",
        "docs/lattice.replication/dead-letter-queue.md"
      ]
    },
    {
      "id": "dead-letter-poison-saga",
      "in_process": "ILatticeReplicationDeadLetters.PoisonSagaAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeId, string originClusterId, Guid transactionId, CancellationToken cancellationToken",
      "response": {
        "type": "bool",
        "meaning": "true when the receiver-side saga is recorded as poisoned (including when it already was) and a full re-seed from the origin is started or recorded as owed; false, with nothing written, when the receiver's own transaction registry already holds a terminal decision for the transaction or the bounded per-tree poison set is full. No receiver registry decision is ever written."
      },
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "treeId or originClusterId is null or empty, or transactionId is Guid.Empty."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled before the request is dispatched."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "A repeat for a saga already poisoned returns true without recording a second entry; a refused request can be retried once its refusal reason no longer holds.",
        "source": "src/lattice.replication/ILatticeReplicationDeadLetters.cs#PoisonSagaAsync"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "The poison set holds each origin and transaction pair once, so a repeat records nothing new; each accepted call asks again for the owed re-seed from that origin.",
        "source": "src/lattice.replication/Grains/ReceiverSagaPoisonGrain.cs#PoisonAsync"
      },
      "concurrency": {
        "rule": "The receiver's transaction registry is read before the poison is recorded, in a separate call; requests for one tree then serialize through that tree's single poison set.",
        "source": "src/lattice.replication/LatticeReplicationDeadLetters.cs#PoisonSagaAsync"
      },
      "sources": [
        "src/lattice.replication/ILatticeReplicationDeadLetters.cs#PoisonSagaAsync",
        "src/lattice.replication/LatticeReplicationDeadLetters.cs#PoisonSagaAsync",
        "src/lattice.replication/Grains/ReceiverSagaPoisonGrain.cs#PoisonAsync",
        "docs/lattice.replication/dead-letter-queue.md"
      ]
    },
    {
      "id": "dead-letter-release-quarantined-saga",
      "in_process": "ILatticeReplicationDeadLetters.ReleaseQuarantinedSagaAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeId, string originClusterId, Guid transactionId, CancellationToken cancellationToken",
      "response": {
        "type": "bool",
        "meaning": "true when the receiver-side saga was quarantined and is removed from the tree's durable quarantine set, so its records are applied again instead of parked and the bounded set regains capacity; false when the saga was not quarantined. Records already parked are not touched: list them with ListAsync and remove them with DiscardAsync."
      },
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "treeId or originClusterId is null or empty, or transactionId is Guid.Empty."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled before the request is dispatched."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "A repeat after a successful release finds nothing to release and returns false.",
        "source": "src/lattice.replication/ILatticeReplicationDeadLetters.cs#ReleaseQuarantinedSagaAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Release removes the origin and transaction entry once; a repeat changes nothing.",
        "source": "src/lattice.replication/Grains/ReceiverSagaPoisonGrain.cs#ReleaseQuarantineAsync"
      },
      "concurrency": {
        "rule": "Releases for one tree serialize through that tree's single quarantine set. The saga stays recorded as retired by its re-seed, so a record of it that keeps failing is quarantined again, never re-seeded.",
        "source": "src/lattice.replication/ILatticeReplicationDeadLetters.cs#ReleaseQuarantinedSagaAsync"
      },
      "sources": [
        "src/lattice.replication/ILatticeReplicationDeadLetters.cs#ReleaseQuarantinedSagaAsync",
        "src/lattice.replication/LatticeReplicationDeadLetters.cs#ReleaseQuarantinedSagaAsync",
        "src/lattice.replication/Grains/ReceiverSagaPoisonGrain.cs#ReleaseQuarantineAsync",
        "docs/lattice.replication/dead-letter-queue.md"
      ]
    },
    {
      "id": "dead-letter-replay",
      "in_process": "ILatticeReplicationDeadLetters.ReplayAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeId, long entryId, CancellationToken cancellationToken",
      "response": {
        "type": "ApplyResult?",
        "meaning": "null when no entry with that id exists. Otherwise the canonical applier's result: the entry is removed unless Deferred, SourceLineageRefused, TenantIsolationRefused or DeadLettered is true, in which case it stays parked (a receive fence or bootstrap drop floor held it back, its source lineage was refused, or the applier refused it again for the cause it was parked for)."
      },
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "treeId is null or empty."
        },
        {
          "error_id": "internal",
          "condition": "The applier throws; the entry stays parked."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "A replay that throws, is deferred, or is refused (SourceLineageRefused, TenantIsolationRefused or DeadLettered) leaves the entry parked and can be replayed again; after a replay that removed the entry a repeat returns null.",
        "source": "src/lattice.replication/ILatticeReplicationDeadLetters.cs#ReplayAsync"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "A successful replay removes the entry, so a repeat returns null instead of applying it again.",
        "source": "src/lattice.replication/LatticeReplicationDeadLetters.cs#ReplayAsync"
      },
      "concurrency": {
        "rule": "ReplayAsync reads the entry, applies it and then removes it in separate grain calls, so a concurrent DiscardAsync of the same entry can remove it after it was read while the replay still applies it.",
        "source": "src/lattice.replication/LatticeReplicationDeadLetters.cs#ReplayAsync"
      },
      "sources": [
        "src/lattice.replication/ILatticeReplicationDeadLetters.cs#ReplayAsync",
        "src/lattice.replication/LatticeReplicationDeadLetters.cs#ReplayAsync",
        "src/lattice.replication/Grains/ReplicationDeadLetterGrain.cs#RemoveReplayedAsync",
        "docs/lattice.replication/dead-letter-queue.md"
      ]
    },
    {
      "id": "decommission-peer",
      "in_process": "ILatticeReplicationPeerAdmin.DecommissionPeerAsync",
      "grpc_method": "/orleans.lattice.api.replication/DecommissionPeer",
      "transport_scope": "both",
      "request": "ReplicationDecommissionPeerRequestMessage",
      "response": "ReplicationDecommissionPeerResponse",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "PeerClusterId is null or empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "Caller is not authorized."
        },
        {
          "error_id": "failed-precondition",
          "condition": "The peer is still present in the configured replication peer set (ReplicationPeers / IReplicationTopology.CurrentPeers); it must be removed from ReplicationPeers before it can be decommissioned."
        },
        {
          "error_id": "unavailable",
          "condition": "The replication engine is not hosted in this process (ILatticeReplicationPeerDecommissioner is not registered), so the facade cannot carry out the decommission."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Idempotent per tree; iterating every registered tree and calling it again for an already-decommissioned peer re-marks the peer and is a no-op for trees that never enrolled it.",
        "source": "src/lattice.replication/LatticeReplicationPeerDecommissioner.cs#DecommissionPeerAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Decommissioning an already-decommissioned peer reaches the same end state and is reported via AlreadyDecommissioned=true, though the marker's timestamp is refreshed on every call.",
        "source": "src/lattice.replication/LatticeReplicationPeerDecommissioner.cs#DecommissionPeerAsync"
      },
      "concurrency": {
        "rule": "Fans out per tree rather than acting atomically across all trees; for each tree that actually enrolled the peer it un-enrols the peer from the tree's cross-tree peer enrolment and synchronously force-detaches that tree's shipper so the cross-tree decision hold releases without waiting on the asynchronous, retried background detach path.",
        "source": "src/lattice.replication/LatticeReplicationPeerDecommissioner.cs#DecommissionPeerAsync"
      },
      "sources": [
        "src/lattice.api.abstractions/Replication/ILatticeReplicationPeerAdmin.cs#DecommissionPeerAsync",
        "src/lattice.replication/ILatticeReplicationPeerDecommissioner.cs#DecommissionPeerAsync",
        "src/lattice.replication/LatticeReplicationPeerDecommissioner.cs#DecommissionPeerAsync",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcMethods.cs#DecommissionPeerMethodName",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#DecommissionPeer"
      ]
    },
    {
      "id": "disable-replication",
      "in_process": "ILatticeReplicationControl.DisableReplicationAsync",
      "grpc_method": "/orleans.lattice.api.replication/DisableReplication",
      "transport_scope": "both",
      "request": "ReplicationDisableRequestMessage",
      "response": "ReplicationDisableResponse",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "TreeId is null or empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "Caller is not authorized."
        },
        {
          "error_id": "failed-precondition",
          "condition": "A real disable would be authored but no local replica id is configured."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Idempotent; absent or already disabled trees author no new dot and report AlreadyDisabled=true.",
        "source": "src/lattice.replication/ILatticeReplicationConfigAuthority.cs#DisableReplicationAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Disabling a tree that is absent or already disabled authors no new dot.",
        "source": "src/lattice.replication/ILatticeReplicationConfigAuthority.cs#DisableReplicationAsync"
      },
      "concurrency": {
        "rule": "Disable authors a disable-wins flag dot and does not tear down already-active shippers or purge peer data.",
        "source": "src/lattice.replication/ILatticeReplicationConfigAuthority.cs#DisableReplicationAsync"
      },
      "sources": [
        "src/lattice.api.abstractions/Replication/ILatticeReplicationControl.cs#DisableReplicationAsync",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcMethods.cs#DisableReplicationMethodName",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#DisableReplication"
      ]
    },
    {
      "id": "enable-replication",
      "in_process": "ILatticeReplicationControl.EnableReplicationAsync",
      "grpc_method": "/orleans.lattice.api.replication/EnableReplication",
      "transport_scope": "both",
      "request": "ReplicationEnableRequestMessage",
      "response": "ReplicationEnableResponse",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "TreeId is null or empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "Caller is not authorized."
        },
        {
          "error_id": "failed-precondition",
          "condition": "Runtime preconditions are not met or the requested mode changes an already-enabled tree."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Safe for the same mode when already enabled; a different or ambiguous mode is rejected.",
        "source": "src/lattice.replication/ILatticeReplicationConfigAuthority.cs#EnableReplicationAsync"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "Already enabled under the same unambiguous mode authors no configuration; a named bootstrap source is still requested unless a bootstrap from it is already in flight. Different or ambiguous mode is rejected.",
        "source": "src/lattice.replication/ILatticeReplicationConfigAuthority.cs#EnableReplicationAsync"
      },
      "concurrency": {
        "rule": "Merge mode is fixed at enable time; disable then re-enable to change mode.",
        "source": "src/lattice.replication/ILatticeReplicationConfigAuthority.cs#EnableReplicationAsync"
      },
      "sources": [
        "src/lattice.api.abstractions/Replication/ILatticeReplicationControl.cs#EnableReplicationAsync",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcMethods.cs#EnableReplicationMethodName",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#EnableReplication"
      ]
    },
    {
      "id": "exchange-content-manifest",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeReplication/ExchangeContentManifest",
      "transport_scope": "grpc_only",
      "request": "ContentManifestRequest",
      "response": "ContentManifestResponse",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "TreeName or OriginClusterId is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The tree is not enrolled locally or OriginClusterId does not match the origin stamped on the call."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the target cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Unimplemented or unavailable peers return NotSupported; otherwise re-running the same manifest repeats a strict high-water-mark advance at most once.",
        "source": "src/lattice.replication.grpc/GrpcPushTransport.cs#ExchangeContentManifestAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "The only mutation is TryAdvanceAsync of the per-origin high-water mark to a candidate HLC; re-running the same exchange is a strict-greater-only no-op after the first advance.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#ExchangeContentManifest"
      },
      "concurrency": {
        "rule": "The receiver binds body OriginClusterId to the stamped origin header before advancing the durable high-water mark, so a peer may only advance its own stream.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#EnsureOriginMatchesCaller"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeReplicationGrpcMethod.cs#LatticeReplicationGrpcMethod",
        "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#LatticeReplicationGrpcService",
        "src/lattice.replication.grpc/GrpcPushTransport.cs#GrpcPushTransport",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    },
    {
      "id": "force-lift-bootstrap-read-fence",
      "in_process": "ILatticeReplicationAdmin.ForceLiftBootstrapReadFenceAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeName, string reason",
      "response": "bool (whether a fence was lifted)",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "Tree or audit reason is empty."
        },
        {
          "error_id": "invalid-operation",
          "condition": "A drain is active or the required grain factory is absent."
        },
        {
          "error_id": "cancelled",
          "condition": "The request was cancelled."
        },
        {
          "error_id": "not-supported",
          "condition": "A custom admin implementation retained the unsupported default interface method."
        }
      ],
      "retry": {
        "safe": false,
        "policy": "Never automate this override; confirm the partial-import exposure, read fence status and record the reason. A failed shard lift leaves the fence armed and throws.",
        "source": "src/lattice.replication/ILatticeReplicationAdmin.cs"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "After a successful lift, repeating when no fence is armed returns false; no bootstrap phase is advanced.",
        "source": "src/lattice.replication/ILatticeReplicationAdmin.cs"
      },
      "concurrency": {
        "rule": "Alarmed host-code-only override; refused during an active drain. Stops automatic re-drive and can expose a partial import. Not a network API.",
        "source": "src/lattice.replication/ILatticeReplicationAdmin.cs"
      },
      "sources": [
        "src/lattice.replication/ILatticeReplicationAdmin.cs"
      ]
    },
    {
      "id": "force-request-snapshot",
      "in_process": "ILatticeReplicationAdmin.ForceRequestSnapshotAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeName, string sourceClusterId",
      "response": "OperatorReseedDecision",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "treeName or sourceClusterId is null or empty."
        },
        {
          "error_id": "invalid-operation",
          "condition": "A bootstrap is already in flight from a different source cluster."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Kickoff is not completion; poll GetStatusAsync. Transient retries and crash resumes export the full snapshot with no upper HLC bound. Fresh attempts drain into a shadow copy, preserving the serving view until atomic publication; legacy fenced partial imports remain fenced and re-drive. RequestSnapshot may return Triggered=false with RetryAfter; ForceRequestSnapshot bypasses only the process-local rate limit.",
        "source": "src/lattice.replication/Grains/LatticeBootstrapCoordinatorGrain.cs#DrainSnapshotAsync"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "The bootstrap coordinator is idempotent under concurrent invocations against the same tree with the same source cluster id.",
        "source": "src/lattice.replication/ILatticeReplicationAdmin.cs#ILatticeReplicationAdmin"
      },
      "concurrency": {
        "rule": "Single coordinator activation per tree absorbs same-source kickoff and refuses a different concurrent source. Incremental handoff merges frontier coordinates by maximum and clears the legacy pinned floor; it never drops a genuinely new point write solely for an older HLC.",
        "source": "src/lattice.replication/Grains/LatticeBootstrapCoordinatorGrain.cs"
      },
      "sources": [
        "src/lattice.replication/ILatticeReplicationAdmin.cs#ForceRequestSnapshotAsync",
        "src/lattice.replication/Grains/LatticeBootstrapCoordinatorGrain.cs#DrainSnapshotAsync",
        "src/lattice.replication/IShardCountProvider.cs#GetShardRootKeysAsync",
        "src/lattice.replication/LatticeReplicationLocalVcSeeder.cs#LatticeReplicationLocalVcSeeder"
      ]
    },
    {
      "id": "get-auth-scheme",
      "in_process": "ILatticeReplicationApiAuthSchemeSource.GetAdvertisement",
      "grpc_method": "/orleans.lattice.api.replication/GetAuthScheme",
      "transport_scope": "both",
      "request": "AuthSchemeAdvertisementRequest",
      "response": "AuthSchemeAdvertisement",
      "errors": [],
      "retry": {
        "safe": true,
        "policy": "Unauthenticated read of configured public advertisement.",
        "source": "src/lattice.api.replication.grpc/Security/OptionsLatticeReplicationApiAuthSchemeSource.cs#GetAdvertisement"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Returns the configured advertised auth schemes and has no side effects.",
        "source": "src/lattice.api.replication.grpc/Security/OptionsLatticeReplicationApiAuthSchemeSource.cs#GetAdvertisement"
      },
      "concurrency": {
        "rule": "Exempt from the authorization interceptor so clients can discover how to sign in.",
        "source": "src/lattice.api.replication.grpc/Security/LatticeReplicationApiGrpcAuthInterceptor.cs#IsUnauthenticatedMethod"
      },
      "sources": [
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcMethods.cs#GetAuthSchemeMethodName",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#GetAuthScheme"
      ]
    },
    {
      "id": "get-bootstrap-state",
      "in_process": "ILatticeBootstrapCoordinator.GetStateAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeName",
      "response": "LatticeBootstrapState",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "Tree id is null or empty."
        },
        {
          "error_id": "cancelled",
          "condition": "The request was cancelled."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Read-only status may be retried.",
        "source": "src/lattice.replication/ILatticeBootstrapCoordinator.cs"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Read-only point-in-time observation.",
        "source": "src/lattice.replication/ILatticeBootstrapCoordinator.cs"
      },
      "concurrency": {
        "rule": "Phase is persisted and resumes across activation restart; an observation may see an intermediate phase.",
        "source": "src/lattice.replication/ILatticeBootstrapCoordinator.cs"
      },
      "sources": [
        "src/lattice.replication/ILatticeBootstrapCoordinator.cs",
        "src/lattice.replication/LatticeBootstrapCoordinator.cs"
      ]
    },
    {
      "id": "get-bootstrap-status",
      "in_process": "ILatticeBootstrapCoordinator.GetStatusAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeName",
      "response": "BootstrapCoordinatorStatus",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "Tree id is null or empty."
        },
        {
          "error_id": "cancelled",
          "condition": "The request was cancelled."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Read-only status may be retried.",
        "source": "src/lattice.replication/ILatticeBootstrapCoordinator.cs"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Read-only point-in-time observation.",
        "source": "src/lattice.replication/ILatticeBootstrapCoordinator.cs"
      },
      "concurrency": {
        "rule": "Reports progress, fence and re-drive attempts; SourceClusterId names only an in-flight attempt, while CompletedSourceClusterId survives LiveIncremental.",
        "source": "src/lattice.replication/ILatticeBootstrapCoordinator.cs"
      },
      "sources": [
        "src/lattice.replication/ILatticeBootstrapCoordinator.cs",
        "src/lattice.replication/LatticeBootstrapCoordinator.cs"
      ]
    },
    {
      "id": "get-peer-high-water-mark",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeReplication/GetPeerHighWaterMark",
      "transport_scope": "grpc_only",
      "request": "PeerHighWaterMarkRequest",
      "response": "PeerHighWaterMarkResponse",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "TreeName or OriginClusterId is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The tree is not enrolled for replication on this cluster, no enrollment source is wired, or OriginClusterId does not match the origin stamped on the call."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the target cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Unimplemented or unavailable peers fall back to HybridLogicalClock.Zero; otherwise retrying only re-reads the durable watermark.",
        "source": "src/lattice.replication.grpc/GrpcPushTransport.cs#GetPeerHighWaterMarkAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "The request is strictly read-only and answering it must never mutate data or replication cursors.",
        "source": "src/lattice.replication/PeerHighWaterMarkRequest.cs#PeerHighWaterMarkRequest"
      },
      "concurrency": {
        "rule": "The peer returns the durable per-origin high-water mark; an unseen origin returns HybridLogicalClock.Zero so re-replay conservatively re-ships all in-range retained entries.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#GetPeerHighWaterMark"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeReplicationGrpcMethod.cs#LatticeReplicationGrpcMethod",
        "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#LatticeReplicationGrpcService",
        "src/lattice.replication.grpc/GrpcPushTransport.cs#GrpcPushTransport",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor",
        "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#EnsureOriginMatchesCaller"
      ]
    },
    {
      "id": "get-peer-status",
      "in_process": "ILatticeReplicationStatus.GetPeerStatusAsync",
      "grpc_method": "/orleans.lattice.api.replication.status/GetPeerStatus",
      "transport_scope": "both",
      "request": "ReplicationPeerStatusQuery",
      "response": "ReplicationPeerStatusPage",
      "errors": [
        {
          "error_id": "cancelled",
          "condition": "The request or authorization check is cancelled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "The query is null, PageSize is negative, or ContinuationToken is malformed."
        },
        {
          "error_id": "permission-denied",
          "condition": "The transport authorizer denies the call, active-tenant resolution is denied, or the facade access gate denies a tree that would otherwise be reported; an unauthorized tree filter returns an empty page."
        },
        {
          "error_id": "internal",
          "condition": "The peer-status service or telemetry reader fails unexpectedly."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Read-only point-in-time telemetry report; retrying only re-runs authorization and the bounded cluster-wide telemetry read.",
        "source": "src/lattice.api.abstractions/Replication/ILatticeReplicationStatus.cs#GetPeerStatusAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "The operation reads in-memory per-peer telemetry and never mutates replication configuration, data, cursors, or link state.",
        "source": "src/lattice.api.replication/LatticeReplicationStatus.cs#GetPeerStatusAsync"
      },
      "concurrency": {
        "rule": "Rows are ordered by effective tree id, peer id and direction; denied rows are skipped, a tree filter is scoped to the caller tenant before the authorization check, and continuation tokens are issued only after rows the caller was shown. Inbound contact rows are populated only for runs the receiver locally admits, and new inbound rows are bounded at recording time.",
        "source": "src/lattice.api.replication/LatticeReplicationStatus.cs#GetPeerStatusAsync"
      },
      "sources": [
        "src/lattice.api.abstractions/Replication/ILatticeReplicationStatus.cs#GetPeerStatusAsync",
        "src/lattice.api.replication.grpc/LatticeReplicationApiGrpcServiceCollectionExtensions.Status.cs#AddLatticeReplicationStatusApiGrpc",
        "src/lattice.api.replication.grpc/LatticeReplicationStatusGrpcMethods.cs#LatticeReplicationStatusGrpcMethods",
        "src/lattice.api.replication.grpc/LatticeReplicationStatusGrpcService.cs#GetPeerStatus",
        "src/lattice.api.replication.grpc/Security/LatticeReplicationApiGrpcAuthInterceptor.cs#DescribeCall",
        "src/lattice.api.replication/LatticeApiReplicationServiceCollectionExtensions.Status.cs#AddLatticeReplicationStatusApi",
        "src/lattice.api.replication/LatticeReplicationStatus.cs#GetPeerStatusAsync"
      ]
    },
    {
      "id": "get-replication-config",
      "in_process": "ILatticeReplicationControl.GetReplicationConfigAsync",
      "grpc_method": "/orleans.lattice.api.replication/GetReplicationConfig",
      "transport_scope": "both",
      "request": "ReplicationGetConfigRequest",
      "response": "ReplicationConfigResponse",
      "errors": [
        {
          "error_id": "permission-denied",
          "condition": "Trees outside the caller grant are silently omitted."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Read-only permission-scoped status report.",
        "source": "src/lattice.api.abstractions/Replication/ILatticeReplicationControl.cs#GetReplicationConfigAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Read-only operation.",
        "source": "src/lattice.api.abstractions/Replication/ILatticeReplicationControl.cs#GetReplicationConfigAsync"
      },
      "concurrency": {
        "rule": "Denied trees are silently omitted, so discovery never reveals trees outside the caller grant.",
        "source": "src/lattice.api.abstractions/Replication/ILatticeReplicationControl.cs#GetReplicationConfigAsync"
      },
      "sources": [
        "src/lattice.api.abstractions/Replication/ILatticeReplicationControl.cs#GetReplicationConfigAsync",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcMethods.cs#GetReplicationConfigMethodName",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#GetReplicationConfig"
      ]
    },
    {
      "id": "probe-digest",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeReplication/ProbeDigest",
      "transport_scope": "grpc_only",
      "request": "DigestProbeRequest",
      "response": "DigestProbeResponse",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "TreeName is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The tree is not enrolled for replication on this cluster or no enrollment source is wired."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the target cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        },
        {
          "error_id": "unavailable",
          "condition": "The peer endpoint is temporarily unreachable."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Read-only digest probe; retrying only re-reads the peer digest.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#ProbeDigest"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "The operation is read-only and never mutates data or replication cursors.",
        "source": "src/lattice.replication/DigestProbeRequest.cs#DigestProbeRequest"
      },
      "concurrency": {
        "rule": "The service re-resolves the peer-supplied tree against local replication enrollment before reading under system origin.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#EnsureTreeEnrolledForPeerRead"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeReplicationGrpcMethod.cs#LatticeReplicationGrpcMethod",
        "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#LatticeReplicationGrpcService",
        "src/lattice.replication.grpc/GrpcPushTransport.cs#GrpcPushTransport",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    },
    {
      "id": "probe-merkle-walk",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeReplication/ProbeMerkleWalk",
      "transport_scope": "grpc_only",
      "request": "MerkleWalkProbeRequest",
      "response": "MerkleWalkProbeResponse",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "TreeName is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The tree is not enrolled for replication on this cluster or no enrollment source is wired."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the target cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Unimplemented or unavailable peers return Unavailable; otherwise retrying only re-reads a range digest.",
        "source": "src/lattice.replication.grpc/GrpcPushTransport.cs#ProbeMerkleWalkAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "The request is strictly read-only and answering it must never mutate data or replication cursors.",
        "source": "src/lattice.replication/MerkleWalkProbeRequest.cs#MerkleWalkProbeRequest"
      },
      "concurrency": {
        "rule": "The receiver checks local enrollment before reading the peer-selected key range under system origin.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#ProbeMerkleWalk"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeReplicationGrpcMethod.cs#LatticeReplicationGrpcMethod",
        "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#LatticeReplicationGrpcService",
        "src/lattice.replication.grpc/GrpcPushTransport.cs#GrpcPushTransport",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    },
    {
      "id": "probe-replication-capabilities",
      "in_process": "ILatticeReplicationControl.ProbeCapabilitiesAsync",
      "grpc_method": "/orleans.lattice.api.replication/ProbeCapabilities",
      "transport_scope": "both",
      "request": "ReplicationProbeCapabilitiesRequestMessage",
      "response": "ReplicationCapabilitiesResponse",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "The tree id is null or empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The transport authorizer refuses the call, or the asserted tenant fails resolution. A caller without the Replication capability is answered CanConfigure = false, not refused."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Read-only, side-effect-free capability probe.",
        "source": "src/lattice.api.replication/LatticeReplicationControl.cs#ProbeCapabilitiesAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Read-only operation; the engine is never consulted.",
        "source": "src/lattice.api.replication/LatticeReplicationControl.cs#ProbeCapabilitiesAsync"
      },
      "concurrency": {
        "rule": "The tree id is scoped to the caller tenant and authorized through the same Replication gate enable and disable use; the flag is advisory and every real enable or disable is authorized again on attempt.",
        "source": "src/lattice.api.replication/LatticeReplicationControl.cs#ProbeCapabilitiesAsync"
      },
      "sources": [
        "src/lattice.api.abstractions/Replication/ILatticeReplicationControl.cs#ProbeCapabilitiesAsync",
        "src/lattice.api.replication/LatticeReplicationControl.cs#ProbeCapabilitiesAsync",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcMethods.cs#ProbeCapabilitiesMethodName",
        "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#ProbeCapabilities"
      ]
    },
    {
      "id": "pull-compression-dictionary",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeReplication/PullCompressionDictionary",
      "transport_scope": "grpc_only",
      "request": "CompressionDictionaryPullRequest",
      "response": "CompressionDictionaryPullResponse",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the target cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Unimplemented or unavailable peers return NotSupported; otherwise retrying only re-reads dictionary availability.",
        "source": "src/lattice.replication.grpc/GrpcPushTransport.cs#PullCompressionDictionaryAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "The operation is read-only.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#PullCompressionDictionary"
      },
      "concurrency": {
        "rule": "Dictionary id 0 and unknown ids return a supported-but-not-held response rather than mutating receiver state.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#PullCompressionDictionary"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeReplicationGrpcMethod.cs#LatticeReplicationGrpcMethod",
        "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#LatticeReplicationGrpcService",
        "src/lattice.replication.grpc/GrpcPushTransport.cs#GrpcPushTransport",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    },
    {
      "id": "push-replication-batch",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeReplication/Push",
      "transport_scope": "grpc_only",
      "request": "ReplicationBatchEnvelope",
      "response": "ReplicationAck",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "TreeName or OriginClusterId is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "OriginClusterId does not match the origin stamped on the call; a peer may only act on its own origin."
        },
        {
          "error_id": "internal",
          "condition": "Receiver-side apply failed; details are logged server-side."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the target cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        },
        {
          "error_id": "unavailable",
          "condition": "The peer endpoint is temporarily unreachable."
        }
      ],
      "retry": {
        "safe": "conditional",
        "policy": "Retry after transport failure is safe for the sender when its cursor advances only after an accepted ack; a deferred ack keeps Accepted false so the same batch is re-shipped after backoff.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#Push"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "Receiver-side apply and per-origin high-water marks deduplicate replicated WAL entries by origin and HLC; rejected/deferred acks do not advance the sender cursor.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#Push"
      },
      "concurrency": {
        "rule": "Unary HTTP/2 calls are multiplexed per peer channel; receiver returns Accepted false when a durable inbound receive fence defers the batch, leaving sender cursor progress blocked.",
        "source": "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#Push"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeReplicationGrpcMethod.cs#LatticeReplicationGrpcMethod",
        "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#LatticeReplicationGrpcService",
        "src/lattice.replication.grpc/GrpcPushTransport.cs#GrpcPushTransport",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor",
        "src/lattice.replication.grpc/LatticeReplicationGrpcService.cs#EnsureOriginMatchesCaller"
      ]
    },
    {
      "id": "remote-snapshot-get-metadata",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeRemoteSnapshot/GetMetadata",
      "transport_scope": "grpc_only",
      "request": "RemoteSnapshotMetadataRequest",
      "response": "RemoteSnapshotMetadata",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "TreeName or SourceClusterId is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The sender-side enrollment gate refuses export because the tree is not enrolled locally or no enrollment source is wired."
        },
        {
          "error_id": "internal",
          "condition": "Snapshot metadata capture failed; details are logged server-side."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the source cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        },
        {
          "error_id": "unavailable",
          "condition": "The peer endpoint is temporarily unreachable."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Read-only metadata capture; retrying after a transient transport failure is safe, but HybridLogicalClock.Zero may capture a later cut point.",
        "source": "src/lattice.replication/IRemoteSnapshotTransport.cs#GetMetadataAsync"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "A request with a fixed non-zero FromAsOfHlc pins the same upper bound; a zero request lets the sender choose its current cut point and may observe a later AsOfHlc on retry.",
        "source": "src/lattice.replication/RemoteSnapshotMetadataRequest.cs#RemoteSnapshotMetadataRequest"
      },
      "concurrency": {
        "rule": "Sender-side handler re-resolves the peer-supplied tree against local replication enrollment before any tree is read.",
        "source": "src/lattice.replication/LatticeRemoteSnapshotService.cs#EnsureTreeEnrolledForExport"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeRemoteSnapshotGrpcMethods.cs#LatticeRemoteSnapshotGrpcMethods",
        "src/lattice.replication.grpc/LatticeRemoteSnapshotGrpcService.cs#LatticeRemoteSnapshotGrpcService",
        "src/lattice.replication.grpc/GrpcRemoteSnapshotTransport.cs#GrpcRemoteSnapshotTransport",
        "src/lattice.replication/LatticeRemoteSnapshotService.cs#LatticeRemoteSnapshotService",
        "src/lattice.replication/IRemoteSnapshotTransport.cs#IRemoteSnapshotTransport",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    },
    {
      "id": "remote-snapshot-request-snapshot",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeRemoteSnapshot/RequestSnapshot",
      "transport_scope": "grpc_only",
      "request": "RemoteSnapshotMetadataRequest",
      "response": "stream RemoteSnapshotStreamItem",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "TreeName or SourceClusterId is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The sender-side enrollment gate refuses export because the tree is not enrolled locally or no enrollment source is wired."
        },
        {
          "error_id": "internal",
          "condition": "Snapshot stream failed; details are logged server-side."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the source cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        },
        {
          "error_id": "unavailable",
          "condition": "The peer endpoint is temporarily unreachable."
        }
      ],
      "retry": {
        "safe": "conditional",
        "policy": "Capture metadata first. Bootstrap retries re-open the full stream without an upper HLC resume bound. Only a complete successful drain installs the handoff frontier; deferred entries fail the attempt rather than sealing past unapplied data.",
        "source": "src/lattice.replication/Grains/LatticeBootstrapCoordinatorGrain.cs"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "Streaming the same upper-bound snapshot is read-only; applying a retried drain is idempotent on the receiver through per-key LWW reconciliation.",
        "source": "src/lattice.replication/Grains/LatticeBootstrapCoordinatorGrain.cs#DrainSnapshotAsync"
      },
      "concurrency": {
        "rule": "The stream emits entries at or below the supplied cut point; sender-side export is gated by local enrollment and concurrent calls for the same pair are serialized by the receiver-side coordinator.",
        "source": "src/lattice.replication/IRemoteSnapshotTransport.cs#RequestSnapshotAsync"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeRemoteSnapshotGrpcMethods.cs#LatticeRemoteSnapshotGrpcMethods",
        "src/lattice.replication.grpc/LatticeRemoteSnapshotGrpcService.cs#LatticeRemoteSnapshotGrpcService",
        "src/lattice.replication.grpc/GrpcRemoteSnapshotTransport.cs#GrpcRemoteSnapshotTransport",
        "src/lattice.replication/LatticeRemoteSnapshotService.cs#LatticeRemoteSnapshotService",
        "src/lattice.replication/IRemoteSnapshotTransport.cs#IRemoteSnapshotTransport",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    },
    {
      "id": "request-snapshot",
      "in_process": "ILatticeReplicationAdmin.RequestSnapshotAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string treeName, string sourceClusterId",
      "response": "OperatorReseedDecision",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "treeName or sourceClusterId is null or empty."
        },
        {
          "error_id": "invalid-operation",
          "condition": "A bootstrap is already in flight from a different source cluster."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Kickoff is not completion; poll GetStatusAsync. Transient retries and crash resumes export the full snapshot with no upper HLC bound. Fresh attempts drain into a shadow copy, preserving the serving view until atomic publication; legacy fenced partial imports remain fenced and re-drive. RequestSnapshot may return Triggered=false with RetryAfter; ForceRequestSnapshot bypasses only the process-local rate limit.",
        "source": "src/lattice.replication/Grains/LatticeBootstrapCoordinatorGrain.cs#DrainSnapshotAsync"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "The bootstrap coordinator is idempotent under concurrent invocations against the same tree with the same source cluster id.",
        "source": "src/lattice.replication/ILatticeReplicationAdmin.cs#ILatticeReplicationAdmin"
      },
      "concurrency": {
        "rule": "Single coordinator activation per tree absorbs same-source kickoff and refuses a different concurrent source. Incremental handoff merges frontier coordinates by maximum and clears the legacy pinned floor; it never drops a genuinely new point write solely for an older HLC.",
        "source": "src/lattice.replication/Grains/LatticeBootstrapCoordinatorGrain.cs"
      },
      "sources": [
        "src/lattice.replication/ILatticeReplicationAdmin.cs#RequestSnapshotAsync",
        "src/lattice.replication/Grains/LatticeBootstrapCoordinatorGrain.cs#DrainSnapshotAsync",
        "src/lattice.replication/IShardCountProvider.cs#GetShardRootKeysAsync",
        "src/lattice.replication/LatticeReplicationLocalVcSeeder.cs#LatticeReplicationLocalVcSeeder"
      ]
    },
    {
      "id": "resolve-cross-cluster-saga-participant",
      "in_process": "ILatticeReplicationAdmin.ResolveCrossClusterSagaParticipantAsync",
      "grpc_method": null,
      "transport_scope": "in_process_only",
      "request": "string sagaId, bool commit, string reason",
      "response": "bool (whether an unresolved participant was resolved)",
      "errors": [
        {
          "error_id": "invalid-argument",
          "condition": "Saga id or audit reason is empty."
        },
        {
          "error_id": "invalid-operation",
          "condition": "The coordinator is still deciding, contradicts the request, or the required grain factory is absent."
        },
        {
          "error_id": "cancelled",
          "condition": "The request was cancelled."
        },
        {
          "error_id": "not-supported",
          "condition": "A custom admin implementation retained the unsupported default interface method."
        }
      ],
      "retry": {
        "safe": false,
        "policy": "Never automate the commit-or-compensate choice. Verify the coordinator decision and every participant before retrying; retain the same decision and audit reason.",
        "source": "src/lattice.replication/ILatticeReplicationAdmin.cs"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "Repeating the same terminal decision is a no-op; a reachable contradicting or undecided coordinator refuses the override.",
        "source": "src/lattice.replication/ILatticeReplicationAdmin.cs"
      },
      "concurrency": {
        "rule": "Alarmed host-code-only override. A reachable coordinator's decision wins; only an unreachable coordinator permits the requested choice. Resolve all participants consistently or restore cutovers diverge. Not a network API.",
        "source": "src/lattice.replication/ILatticeReplicationAdmin.cs"
      },
      "sources": [
        "src/lattice.replication/ILatticeReplicationAdmin.cs"
      ]
    },
    {
      "id": "saga-abort",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeSaga/Abort",
      "transport_scope": "grpc_only",
      "request": "SagaControlRequest",
      "response": "SagaControlResponse",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "SagaId or TargetTree is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The call carries no origin cluster bound to its credential by the interceptor, the body declares a CoordinatorClusterId other than the stamped origin, or the origin cluster is not an authorized replication peer."
        },
        {
          "error_id": "internal",
          "condition": "Saga control 'Abort' failed; details are logged server-side."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the participant cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        },
        {
          "error_id": "unavailable",
          "condition": "The peer endpoint is temporarily unreachable."
        }
      ],
      "retry": {
        "safe": "conditional",
        "policy": "Retry the same SagaId request after a transport failure; the durable participant grain re-attaches duplicate prepare, commit, and abort calls to the recorded phase.",
        "source": "src/lattice.replication/ILatticeSagaControlHandler.cs#AbortAsync"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "The cross-cluster saga participant returns the recorded phase/vote on duplicate prepare, treats duplicate commit as a no-op, and treats duplicate abort as a no-op.",
        "source": "src/lattice.replication/Grains/CrossClusterSagaParticipantGrain.cs#CrossClusterSagaParticipantGrain"
      },
      "concurrency": {
        "rule": "Peer authorization runs before delegation; imperative calls mutate participant state only after the origin is authorized, while status reports the durable phase without changing state.",
        "source": "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#HandleAsync"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeSagaGrpcMethods.cs#LatticeSagaGrpcMethods",
        "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#LatticeSagaGrpcService",
        "src/lattice.replication.grpc/GrpcSagaControlChannel.cs#GrpcSagaControlChannel",
        "src/lattice.replication/ISagaControlChannel.cs#ISagaControlChannel",
        "src/lattice.replication/ILatticeSagaControlHandler.cs#ILatticeSagaControlHandler",
        "src/lattice.replication.grpc/PeerMapSagaPeerAuthorizer.cs#PeerMapSagaPeerAuthorizer",
        "src/lattice.replication/Grains/CrossClusterSagaParticipantGrain.cs#CrossClusterSagaParticipantGrain",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    },
    {
      "id": "saga-commit",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeSaga/Commit",
      "transport_scope": "grpc_only",
      "request": "SagaControlRequest",
      "response": "SagaControlResponse",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "SagaId or TargetTree is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The call carries no origin cluster bound to its credential by the interceptor, the body declares a CoordinatorClusterId other than the stamped origin, or the origin cluster is not an authorized replication peer."
        },
        {
          "error_id": "internal",
          "condition": "Saga control 'Commit' failed; details are logged server-side."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the participant cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        },
        {
          "error_id": "unavailable",
          "condition": "The peer endpoint is temporarily unreachable."
        }
      ],
      "retry": {
        "safe": "conditional",
        "policy": "Retry the same SagaId request after a transport failure; the durable participant grain re-attaches duplicate prepare, commit, and abort calls to the recorded phase.",
        "source": "src/lattice.replication/ILatticeSagaControlHandler.cs#CommitAsync"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "The cross-cluster saga participant returns the recorded phase/vote on duplicate prepare, treats duplicate commit as a no-op, and treats duplicate abort as a no-op.",
        "source": "src/lattice.replication/Grains/CrossClusterSagaParticipantGrain.cs#CrossClusterSagaParticipantGrain"
      },
      "concurrency": {
        "rule": "Peer authorization runs before delegation; imperative calls mutate participant state only after the origin is authorized, while status reports the durable phase without changing state.",
        "source": "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#HandleAsync"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeSagaGrpcMethods.cs#LatticeSagaGrpcMethods",
        "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#LatticeSagaGrpcService",
        "src/lattice.replication.grpc/GrpcSagaControlChannel.cs#GrpcSagaControlChannel",
        "src/lattice.replication/ISagaControlChannel.cs#ISagaControlChannel",
        "src/lattice.replication/ILatticeSagaControlHandler.cs#ILatticeSagaControlHandler",
        "src/lattice.replication.grpc/PeerMapSagaPeerAuthorizer.cs#PeerMapSagaPeerAuthorizer",
        "src/lattice.replication/Grains/CrossClusterSagaParticipantGrain.cs#CrossClusterSagaParticipantGrain",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    },
    {
      "id": "saga-get-decision",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeSaga/GetDecision",
      "transport_scope": "grpc_only",
      "request": "SagaControlRequest",
      "response": "SagaControlResponse",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "SagaId or TargetTree is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The call carries no origin cluster bound to its credential by the interceptor, or the origin cluster is not an authorized replication peer."
        },
        {
          "error_id": "permission-denied",
          "condition": "The stamped origin cluster is not a recorded participant of the saga on this coordinator cluster."
        },
        {
          "error_id": "internal",
          "condition": "Saga control 'GetDecision' failed, including on a host whose saga control handler hosts no saga coordinator; details are logged server-side."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the coordinator cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        },
        {
          "error_id": "unavailable",
          "condition": "The peer endpoint is temporarily unreachable."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Read-only decision query; the coordinator only reads its recorded phase and never writes the decision on a query.",
        "source": "src/lattice.replication/Grains/CrossClusterSagaCoordinatorGrain.cs#CrossClusterSagaCoordinatorGrain.ResolveDecisionForParticipantAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "The operation is read-only: it answers Committed, Aborted, or Prepared while the decision is still pending, and Aborted for a saga the coordinator never started or has already cleared.",
        "source": "src/lattice.replication/Grains/CrossClusterSagaCoordinatorGrain.cs#CrossClusterSagaCoordinatorGrain.ResolveDecisionForParticipantAsync"
      },
      "concurrency": {
        "rule": "A participant asks the saga's coordinator cluster; the transport-stamped origin replaces any RequesterClusterId in the body, the coordinator-attribution check does not apply, and the coordinator answers only a requester recorded as one of the saga's participants.",
        "source": "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#LatticeSagaGrpcService.HandleAsync"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeSagaGrpcMethods.cs#LatticeSagaGrpcMethods.GetDecisionMethodName",
        "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#LatticeSagaGrpcService.GetDecision",
        "src/lattice.replication.grpc/GrpcSagaControlChannel.cs#GrpcSagaControlChannel.GetDecisionAsync",
        "src/lattice.replication/ISagaControlChannel.cs#ISagaControlChannel",
        "src/lattice.replication/ILatticeSagaControlHandler.cs#ILatticeSagaControlHandler.GetDecisionAsync",
        "src/lattice.replication/LatticeSagaControlHandler.cs#LatticeSagaControlHandler.GetDecisionAsync",
        "src/lattice.replication/Grains/CrossClusterSagaCoordinatorGrain.cs#CrossClusterSagaCoordinatorGrain.ResolveDecisionForParticipantAsync",
        "src/lattice.replication.grpc/PeerMapSagaPeerAuthorizer.cs#PeerMapSagaPeerAuthorizer",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    },
    {
      "id": "saga-get-status",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeSaga/GetStatus",
      "transport_scope": "grpc_only",
      "request": "SagaControlRequest",
      "response": "SagaControlResponse",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "SagaId or TargetTree is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The call carries no origin cluster bound to its credential by the interceptor, the body declares a CoordinatorClusterId other than the stamped origin, or the origin cluster is not an authorized replication peer."
        },
        {
          "error_id": "internal",
          "condition": "Saga control 'GetStatus' failed; details are logged server-side."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the participant cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        },
        {
          "error_id": "unavailable",
          "condition": "The peer endpoint is temporarily unreachable."
        }
      ],
      "retry": {
        "safe": true,
        "policy": "Read-only status read.",
        "source": "src/lattice.replication/ILatticeSagaControlHandler.cs#GetStatusAsync"
      },
      "idempotency": {
        "idempotent": true,
        "basis": "The operation is read-only.",
        "source": "src/lattice.replication/Grains/CrossClusterSagaParticipantGrain.cs#CrossClusterSagaParticipantGrain"
      },
      "concurrency": {
        "rule": "Peer authorization runs before delegation; GetStatus reports the durable participant phase without changing state.",
        "source": "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#HandleAsync"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeSagaGrpcMethods.cs#LatticeSagaGrpcMethods",
        "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#LatticeSagaGrpcService",
        "src/lattice.replication.grpc/GrpcSagaControlChannel.cs#GrpcSagaControlChannel",
        "src/lattice.replication/ISagaControlChannel.cs#ISagaControlChannel",
        "src/lattice.replication/ILatticeSagaControlHandler.cs#ILatticeSagaControlHandler",
        "src/lattice.replication.grpc/PeerMapSagaPeerAuthorizer.cs#PeerMapSagaPeerAuthorizer",
        "src/lattice.replication/Grains/CrossClusterSagaParticipantGrain.cs#CrossClusterSagaParticipantGrain",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    },
    {
      "id": "saga-prepare",
      "in_process": null,
      "grpc_method": "/orleans.lattice.replication.LatticeSaga/Prepare",
      "transport_scope": "grpc_only",
      "request": "SagaControlRequest",
      "response": "SagaControlResponse",
      "errors": [
        {
          "error_id": "unauthenticated",
          "condition": "The shared-secret header is missing while peer authentication is required."
        },
        {
          "error_id": "permission-denied",
          "condition": "The shared secret is not accepted by the receiver."
        },
        {
          "error_id": "cancelled",
          "condition": "The cancellation token is canceled."
        },
        {
          "error_id": "invalid-argument",
          "condition": "SagaId or TargetTree is empty."
        },
        {
          "error_id": "permission-denied",
          "condition": "The call carries no origin cluster bound to its credential by the interceptor, the body declares a CoordinatorClusterId other than the stamped origin, or the origin cluster is not an authorized replication peer."
        },
        {
          "error_id": "internal",
          "condition": "Saga control 'Prepare' failed; details are logged server-side."
        },
        {
          "error_id": "invalid-operation",
          "condition": "Client transport has no endpoint for the participant cluster or rejects a non-HTTPS endpoint without explicit plaintext opt-in."
        },
        {
          "error_id": "unavailable",
          "condition": "The peer endpoint is temporarily unreachable."
        }
      ],
      "retry": {
        "safe": "conditional",
        "policy": "Retry the same SagaId request after a transport failure; the durable participant grain re-attaches duplicate prepare, commit, and abort calls to the recorded phase.",
        "source": "src/lattice.replication/ILatticeSagaControlHandler.cs#PrepareAsync"
      },
      "idempotency": {
        "idempotent": "conditional",
        "basis": "The cross-cluster saga participant returns the recorded phase/vote on duplicate prepare, treats duplicate commit as a no-op, and treats duplicate abort as a no-op.",
        "source": "src/lattice.replication/Grains/CrossClusterSagaParticipantGrain.cs#CrossClusterSagaParticipantGrain"
      },
      "concurrency": {
        "rule": "Peer authorization runs before delegation; imperative calls mutate participant state only after the origin is authorized, while status reports the durable phase without changing state.",
        "source": "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#HandleAsync"
      },
      "sources": [
        "src/lattice.replication.grpc/LatticeSagaGrpcMethods.cs#LatticeSagaGrpcMethods",
        "src/lattice.replication.grpc/LatticeSagaGrpcService.cs#LatticeSagaGrpcService",
        "src/lattice.replication.grpc/GrpcSagaControlChannel.cs#GrpcSagaControlChannel",
        "src/lattice.replication/ISagaControlChannel.cs#ISagaControlChannel",
        "src/lattice.replication/ILatticeSagaControlHandler.cs#ILatticeSagaControlHandler",
        "src/lattice.replication.grpc/PeerMapSagaPeerAuthorizer.cs#PeerMapSagaPeerAuthorizer",
        "src/lattice.replication/Grains/CrossClusterSagaParticipantGrain.cs#CrossClusterSagaParticipantGrain",
        "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
      ]
    }
  ],
  "error_taxonomy": [
    {
      "id": "cancelled",
      "type": "OperationCanceledException",
      "grpc_status": "Cancelled",
      "retryable": false,
      "meaning": "The request or authorization check was cancelled.",
      "source": "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#InvokeAsync"
    },
    {
      "id": "cluster-timeout",
      "type": "TimeoutException",
      "grpc_status": "DeadlineExceeded",
      "retryable": false,
      "meaning": "A grain call timed out inside the cluster, so the outcome is unknown and a write may already have applied. Retry an idempotent read; confirm state before retrying a write (#5742).",
      "source": "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs"
    },
    {
      "id": "cluster-unavailable",
      "type": "OrleansMessageRejectionException (including SiloUnavailableException) or EnumerationAbortedException",
      "grpc_status": "Unavailable",
      "retryable": true,
      "meaning": "A silo was unavailable or rejected the message, or a remote enumerator was lost to a grain deactivation mid-read: a transient cluster fault. Retry after a short backoff (#5742).",
      "source": "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs"
    },
    {
      "id": "saturated",
      "type": "LatticeSaturatedException",
      "grpc_status": "ResourceExhausted",
      "retryable": true,
      "meaning": "Storage back-pressure: the store refused the call on purpose and nothing was applied. Retry after a short backoff (#5722, #5723).",
      "source": "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs"
    },
    {
      "id": "wal-quiescing",
      "type": "LatticeWalQuiescingException",
      "grpc_status": "Unavailable",
      "retryable": true,
      "meaning": "A WAL shard is briefly quiesced for a placement move: the write was refused without being applied, and the shard accepts writes again once the move lifts its fence. Retry after a short backoff (#5800).",
      "source": "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs"
    },
    {
      "id": "failed-precondition",
      "type": "LatticeReplicationPreconditionFailedException or LatticeReplicationModeChangeRejectedException",
      "grpc_status": "FailedPrecondition",
      "retryable": false,
      "meaning": "Replication runtime preconditions failed or a mode change was rejected.",
      "source": "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#InvokeAsync"
    },
    {
      "id": "internal",
      "type": "Exception",
      "grpc_status": "Internal",
      "retryable": false,
      "meaning": "Unhandled server failure; peer gRPC services log the underlying exception and return Internal where they catch it.",
      "source": "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#InvokeAsync"
    },
    {
      "id": "invalid-argument",
      "type": "ArgumentException",
      "grpc_status": "InvalidArgument",
      "retryable": false,
      "meaning": "The request is invalid.",
      "source": "src/lattice.api.replication.grpc/LatticeReplicationGrpcService.cs#InvokeAsync"
    },
    {
      "id": "invalid-operation",
      "type": "InvalidOperationException",
      "grpc_status": null,
      "retryable": false,
      "meaning": "Client-side transport configuration is missing or invalid, or the bootstrap coordinator rejected the re-seed.",
      "source": "src/lattice.replication/ILatticeReplicationAdmin.cs#RequestSnapshotAsync"
    },
    {
      "id": "not-supported",
      "type": "NotSupportedException",
      "grpc_status": null,
      "retryable": false,
      "meaning": "The host-code admin implementation does not implement the alarmed override; no network mapping exists.",
      "source": "src/lattice.replication/ILatticeReplicationAdmin.cs"
    },
    {
      "id": "permission-denied",
      "type": "LatticeAuthorizationDeniedException, LatticeTenantAccessDeniedException, UnauthorizedAccessException, or RpcException",
      "grpc_status": "PermissionDenied",
      "retryable": false,
      "meaning": "Caller is not authorized, peer shared-secret authentication failed, a tree is not locally enrolled for peer replication, the origin header/body check failed, or a saga origin is not an authorized peer.",
      "source": "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
    },
    {
      "id": "unauthenticated",
      "type": "RpcException",
      "grpc_status": "Unauthenticated",
      "retryable": false,
      "meaning": "A peer replication call is missing the shared-secret credential while authentication is required.",
      "source": "src/lattice.replication.grpc/Security/LatticeReplicationGrpcAuthInterceptor.cs#LatticeReplicationGrpcAuthInterceptor"
    },
    {
      "id": "unavailable",
      "type": "RpcException",
      "grpc_status": "Unavailable",
      "retryable": true,
      "meaning": "The peer endpoint is temporarily unreachable. Some optional anti-entropy exchanges translate this to a conservative fallback response.",
      "source": "src/lattice.replication.grpc/GrpcPushTransport.cs#GrpcPushTransport"
    },
    {
      "id": "unimplemented",
      "type": "RpcException",
      "grpc_status": "Unimplemented",
      "retryable": false,
      "meaning": "The peer has not bound an optional rolling-upgrade RPC; supported clients translate this to a conservative fallback response.",
      "source": "src/lattice.replication.grpc/GrpcPushTransport.cs#GrpcPushTransport"
    }
  ]
}
