Import remote facts with managed catalog

This commit is contained in:
Meta Vens 2026-06-28 10:46:28 +01:00
commit bf87e47999
3 changed files with 21 additions and 3 deletions

View file

@ -308,7 +308,8 @@ static async Task<AetheriaRuntimeDaemonTickResult> ImportRemoteCommittedFactsAsy
options.DaemonId,
frame.SessionId,
options.VerseId,
importedFactIds);
importedFactIds,
node.RuntimeCatalog().Latest());
var importedFrame = import.Frame;
importedFrame.ImportedFactIds = import.AcceptedFactIds;

View file

@ -10055,6 +10055,7 @@ static void RequireDaemonVersePublication(string root)
"startServer: true",
"node.LatestFrame().ReadAsync()",
"Catalog = node.RuntimeCatalog().Latest()",
"node.RuntimeCatalog().Latest());",
"node.VerseAuthorityPolicy().ReadAsync()",
"node.StarbridgeScenario().ReadAsync()",
"node.StarbridgeSession().ReadAsync()",
@ -10115,6 +10116,21 @@ static void RequireDaemonVersePublication(string root)
string.Join(", ", missingDaemonHostSymbols));
}
var committedFactImportStart = daemonHostSource.IndexOf(
"static async Task<AetheriaRuntimeDaemonTickResult> ImportRemoteCommittedFactsAsync",
StringComparison.Ordinal);
var committedFactImportEnd = committedFactImportStart >= 0
? daemonHostSource.IndexOf("static RudpCultNetSchemaServer StartRtsCultMeshHost", committedFactImportStart, StringComparison.Ordinal)
: -1;
var committedFactImportBlock = committedFactImportStart >= 0 && committedFactImportEnd > committedFactImportStart
? daemonHostSource.Substring(committedFactImportStart, committedFactImportEnd - committedFactImportStart)
: "";
if (!committedFactImportBlock.Contains("node.RuntimeCatalog().Latest())", StringComparison.Ordinal))
{
throw new InvalidOperationException(
"Remote committed fact import must pass the managed runtime catalog document into the tick importer instead of reopening catalog storage.");
}
var apiPublicationStart = daemonHostSource.IndexOf(
"static async Task PublishDaemonApiDocumentsAsync",
StringComparison.Ordinal);

View file

@ -40,7 +40,8 @@ namespace GameCult.Aetheria.State.Verse
string daemonId,
string sessionId,
string verseId,
IEnumerable<string>? importedFactIds = null)
IEnumerable<string>? importedFactIds = null,
AetheriaRuntimeCatalogSnapshot? catalog = null)
{
currentFrame ??= new AetheriaRuntimeDaemonFrameDocument
{
@ -111,7 +112,7 @@ namespace GameCult.Aetheria.State.Verse
AccountedCommandIds = currentFrame.AccountedCommandIds,
CumulativeAppliedCommandIds = currentFrame.CumulativeAppliedCommandIds,
CumulativeRejectedCommandIds = currentFrame.CumulativeRejectedCommandIds,
Catalog = AetheriaRuntimeCatalogStore.OpenReadOnly(stateFilePath),
Catalog = catalog ?? AetheriaRuntimeCatalogStore.OpenReadOnly(stateFilePath),
BuildPublications = false
});