From ed56dab81224d4ac33ef8ffc61fe1dc3a4959570 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 23 Aug 2026 19:31:47 +0200 Subject: [PATCH] Persist Ghostlight public schema catalogs --- README.md | 5 +++++ src/odin/documents.cjs | 11 ++++++++++ test/ghostlight-discovery-documents.test.cjs | 21 ++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 test/ghostlight-discovery-documents.test.cjs diff --git a/README.md b/README.md index 3281d7f..3f878a7 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ their contents; Odin owns catalog acceptance and exact retrieval. Sensitive auth commands and claims travel directly between the consuming app and Heimdall, never through Odin. +Ghostlight publishes a `ghostlight.schema_catalog.v1` envelope containing only +the state contracts named by its public provider surface. Odin registers that +envelope so it can persist and return the provider-owned catalog; it does not +register every private Ghostlight receipt, transition, or simulation schema. + ## Gjallar Gjallar is the herald display daemon that runs on Nightwing. Odin sees the diff --git a/src/odin/documents.cjs b/src/odin/documents.cjs index d8047ab..cc93102 100644 --- a/src/odin/documents.cjs +++ b/src/odin/documents.cjs @@ -7,6 +7,7 @@ function defineOdinDocuments(defineDocumentType) { return { interfaceBindingDefinition: null, evePluginAdvertisementDefinition: null, + ghostlightSchemaCatalogDefinition: null, heimdallCommandBoundaryDefinition: null, heimdallTransportProfileDefinition: null, idunnCommandBoundaryDefinition: null, @@ -95,6 +96,15 @@ function defineOdinDocuments(defineDocumentType) { name: (value) => value?.pluginId || value?.plugin?.id || "plugin", schema: parseObjectDocument("Eve plugin advertisement"), }); + const ghostlightSchemaCatalogDefinition = defineDocumentType({ + type: "ghostlight.schema_catalog", + schemaName: "ghostlight.schema_catalog", + schemaId: "ghostlight.schema_catalog.v1", + schemaVersion: "ghostlight.schema_catalog.v1", + global: false, + name: (value) => value?.providerId || "gamecult.ghostlight.dungeon", + schema: parseObjectDocument("Ghostlight public schema catalog"), + }); const heimdallCommandBoundaryDefinition = defineDocumentType({ type: "heimdall.command_boundary", schemaName: "heimdall.command_boundary", @@ -477,6 +487,7 @@ function defineOdinDocuments(defineDocumentType) { return { interfaceBindingDefinition, evePluginAdvertisementDefinition, + ghostlightSchemaCatalogDefinition, heimdallCommandBoundaryDefinition, heimdallTransportProfileDefinition, interfaceLayoutDefinition, diff --git a/test/ghostlight-discovery-documents.test.cjs b/test/ghostlight-discovery-documents.test.cjs new file mode 100644 index 0000000..5c96e9e --- /dev/null +++ b/test/ghostlight-discovery-documents.test.cjs @@ -0,0 +1,21 @@ +"use strict"; + +const assert = require("node:assert/strict"); +const test = require("node:test"); + +const { defineOdinDocuments } = require("../src/odin/documents.cjs"); + +test("Odin persists Ghostlight's public schema catalog envelope", () => { + const documents = defineOdinDocuments((definition) => definition); + const catalog = documents.ghostlightSchemaCatalogDefinition; + + assert.equal(catalog.type, "ghostlight.schema_catalog"); + assert.equal(catalog.schemaId, "ghostlight.schema_catalog.v1"); + assert.equal(catalog.schemaVersion, "ghostlight.schema_catalog.v1"); + assert.equal(catalog.name({ providerId: "gamecult.ghostlight.dungeon" }), "gamecult.ghostlight.dungeon"); +}); + +test("Odin's unavailable-runtime projection includes the Ghostlight catalog slot", () => { + const documents = defineOdinDocuments(null); + assert.equal(documents.ghostlightSchemaCatalogDefinition, null); +});