Add CultMesh Verse discovery contracts
This commit is contained in:
parent
8fc548e452
commit
b831a8f3bf
8 changed files with 349 additions and 1 deletions
|
|
@ -69,6 +69,8 @@ Implemented:
|
|||
replacement and cursor advancement
|
||||
- CultMesh node option for file-backed authoritative shard logs with a default
|
||||
`.cultmesh/shard-logs` path beside the cache file
|
||||
- schema-v0 Verse catalog request/response messages
|
||||
- CultMesh Verse discovery server bridge over the local Verse catalog
|
||||
- client-authority scopes for locally predicted input documents
|
||||
- predicted and reconciled database change kinds for client-side prediction
|
||||
- simulation witness observations for mesh-side opinions about frame facts
|
||||
|
|
@ -121,7 +123,7 @@ Not implemented yet:
|
|||
|
||||
Add discovery fanout and operational polish:
|
||||
|
||||
- add Verse discovery over the schema-v0 mesh lane
|
||||
- add peer-to-peer Verse discovery fetchers and gossip fanout
|
||||
- add snapshot throttling and size limits for public mesh edges
|
||||
- after that, add simulation-frame rollback/resimulation helpers around
|
||||
predicted input streams
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ namespace GameCult.Networking
|
|||
CultNetSchemaVersions.ShardLogResponse => Deserialize<CultNetShardLogResponseMessage>(payload),
|
||||
CultNetSchemaVersions.SimulationObservation => Deserialize<CultNetSimulationObservationMessage>(payload),
|
||||
CultNetSchemaVersions.SimulationConsensusCandidate => Deserialize<CultNetSimulationConsensusCandidateMessage>(payload),
|
||||
CultNetSchemaVersions.VerseCatalogRequest => Deserialize<CultMeshVerseCatalogRequestMessage>(payload),
|
||||
CultNetSchemaVersions.VerseCatalogResponse => Deserialize<CultMeshVerseCatalogResponseMessage>(payload),
|
||||
CultNetSchemaVersions.SchemaCatalogRequest => Deserialize<CultNetSchemaCatalogRequestMessage>(payload),
|
||||
CultNetSchemaVersions.SchemaCatalogResponse => Deserialize<CultNetSchemaCatalogResponseMessage>(payload),
|
||||
_ => throw new MessagePackSerializationException(
|
||||
|
|
|
|||
|
|
@ -115,6 +115,14 @@ namespace GameCult.Networking
|
|||
/// simulation consensus candidate gossip contract identifier.
|
||||
/// </summary>
|
||||
public const string SimulationConsensusCandidate = "cultnet.simulation_consensus_candidate.v0";
|
||||
/// <summary>
|
||||
/// CultMesh Verse catalog request contract identifier.
|
||||
/// </summary>
|
||||
public const string VerseCatalogRequest = "cultmesh.verse_catalog_request.v0";
|
||||
/// <summary>
|
||||
/// CultMesh Verse catalog response contract identifier.
|
||||
/// </summary>
|
||||
public const string VerseCatalogResponse = "cultmesh.verse_catalog_response.v0";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -957,6 +965,118 @@ namespace GameCult.Networking
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Requests known CultMesh Verses from a peer.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class CultMeshVerseCatalogRequestMessage : ICultNetSchemaMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the schema version.
|
||||
/// </summary>
|
||||
[Key("schemaVersion")] public string SchemaVersion { get; set; } = CultNetSchemaVersions.VerseCatalogRequest;
|
||||
/// <summary>
|
||||
/// Gets or sets the request id.
|
||||
/// </summary>
|
||||
[Key("messageId")] public string MessageId { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets optional Verse ids to request.
|
||||
/// </summary>
|
||||
[Key("verseIds")] public string[]? VerseIds { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets an optional transport compatibility filter.
|
||||
/// </summary>
|
||||
[Key("transportVersion")] public string? TransportVersion { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns known CultMesh Verses.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class CultMeshVerseCatalogResponseMessage : ICultNetSchemaMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the schema version.
|
||||
/// </summary>
|
||||
[Key("schemaVersion")] public string SchemaVersion { get; set; } = CultNetSchemaVersions.VerseCatalogResponse;
|
||||
/// <summary>
|
||||
/// Gets or sets the request id.
|
||||
/// </summary>
|
||||
[Key("messageId")] public string MessageId { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets discovered Verses.
|
||||
/// </summary>
|
||||
[Key("verses")] public CultMeshVerseDescriptorMessage[] Verses { get; set; } = Array.Empty<CultMeshVerseDescriptorMessage>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wire representation of a CultMesh Verse.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class CultMeshVerseDescriptorMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the stable Verse id.
|
||||
/// </summary>
|
||||
[Key("verseId")] public string VerseId { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the display name.
|
||||
/// </summary>
|
||||
[Key("displayName")] public string DisplayName { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the authority model name.
|
||||
/// </summary>
|
||||
[Key("authorityModel")] public string AuthorityModel { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets compatibility metadata.
|
||||
/// </summary>
|
||||
[Key("compatibility")] public CultMeshVerseCompatibilityMessage Compatibility { get; set; } = new CultMeshVerseCompatibilityMessage();
|
||||
/// <summary>
|
||||
/// Gets or sets endpoints that can answer discovery for this Verse.
|
||||
/// </summary>
|
||||
[Key("discoveryEndpoints")] public string[] DiscoveryEndpoints { get; set; } = Array.Empty<string>();
|
||||
/// <summary>
|
||||
/// Gets or sets known authoritative runtime ids.
|
||||
/// </summary>
|
||||
[Key("authorityRuntimeIds")] public string[] AuthorityRuntimeIds { get; set; } = Array.Empty<string>();
|
||||
/// <summary>
|
||||
/// Gets or sets the parent Verse id for overlays or branches.
|
||||
/// </summary>
|
||||
[Key("parentVerseId")] public string? ParentVerseId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets an optional public description.
|
||||
/// </summary>
|
||||
[Key("description")] public string? Description { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wire representation of CultMesh Verse compatibility.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class CultMeshVerseCompatibilityMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the CultMesh transport compatibility version.
|
||||
/// </summary>
|
||||
[Key("transportVersion")] public string TransportVersion { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the stable rules hash.
|
||||
/// </summary>
|
||||
[Key("rulesHash")] public string RulesHash { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets Verse ids this Verse can transfer from or subscribe to.
|
||||
/// </summary>
|
||||
[Key("compatibleVerseIds")] public string[] CompatibleVerseIds { get; set; } = Array.Empty<string>();
|
||||
/// <summary>
|
||||
/// Gets or sets required plugin ids.
|
||||
/// </summary>
|
||||
[Key("requiredPluginIds")] public string[] RequiredPluginIds { get; set; } = Array.Empty<string>();
|
||||
/// <summary>
|
||||
/// Gets or sets optional plugin ids.
|
||||
/// </summary>
|
||||
[Key("optionalPluginIds")] public string[] OptionalPluginIds { get; set; } = Array.Empty<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes one schema exposed through the CultNet schema catalog.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue