From c1f60677c5f776c0286889468df9ab632e072226 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 10 Jul 2026 06:00:13 +0100 Subject: [PATCH] Define portable Eve asset catalogs --- docs/eve-migration-roadmap.md | 21 ++- .../Runtime/EveAssetCatalogDocument.cs | 144 ++++++++++++++++++ .../Runtime/EveAssetCatalogDocument.cs.meta | 2 + .../gamecult.eve.asset_catalog.v1.schema.json | 46 ++++++ 4 files changed, 209 insertions(+), 4 deletions(-) create mode 100644 packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs create mode 100644 packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs.meta create mode 100644 schemas/gamecult.eve.asset_catalog.v1.schema.json diff --git a/docs/eve-migration-roadmap.md b/docs/eve-migration-roadmap.md index 4ad7fc6..2b03105 100644 --- a/docs/eve-migration-roadmap.md +++ b/docs/eve-migration-roadmap.md @@ -285,13 +285,26 @@ Exit criteria: ## Active Work Queue -1. Run the same EveUnity-owned PlayMode client against Aetheria's separately - running daemon and attach the Aetheria world PNG plus command/receipt proof. -2. Graduate the generic Unity transport and capture contracts only after the - product witness proves that no Aetheria authority leaked into EveUnity. +1. Replace EveUnity's scoped per-chunk CDN requests with a persistent transfer + session while retaining content-addressed disk caching and hash checks. +2. Add generic action/combat command evidence and improve runtime-owned camera + framing for provider-authored world assets. Recently cut: +- The clean EveUnity PlayMode client now consumes Aetheria's independently + running daemon without importing Aetheria code. Aetheria builds its authored + prefabs into a provider-owned Unity AssetBundle, advertises an Eve core asset + catalog, and serves the immutable bundle through standard CultMesh CDN + manifest/chunk documents. EveUnity selects the platform variant, verifies + size and SHA-256, caches it by content hash, loads the prefab hierarchy, owns + entity pose on a wrapper root, submits movement, observes the authoritative + receipt and later surface version, and captures + `E:\Projects\EveUnity\artifacts\aetheria-daemon\aetheria-daemon-world.png`. + The warm-cache witness passes; first-load transfer still needs a persistent + CDN session, and the current capture framing is diagnostic rather than a + presentation-quality gameplay camera. + - Eve core now publishes typed CultCache wire documents for provider advertisement, command invocation, and provider receipt. Command descriptors remain `gamecult.eve.command.v1`; executable intents are the distinct diff --git a/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs b/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs new file mode 100644 index 0000000..eba3b44 --- /dev/null +++ b/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using GameCult.Caching; +using MessagePack; + +#nullable enable + +namespace GameCult.Eve.Surface +{ + [CultDocument("gamecult.eve.asset_catalog", SchemaId)] + [MessagePackObject] + public sealed class EveAssetCatalogDocument + { + public const string SchemaId = "gamecult.eve.asset_catalog.v1"; + + [SerializationConstructor] + public EveAssetCatalogDocument( + string schema, + string providerId, + string catalogId, + long version, + string updatedAtUtc, + EveAssetCatalogEntry[] assets) + { + Schema = string.IsNullOrWhiteSpace(schema) ? SchemaId : schema; + ProviderId = providerId ?? ""; + CatalogId = catalogId ?? ""; + Version = version; + UpdatedAtUtc = updatedAtUtc ?? ""; + Assets = assets ?? Array.Empty(); + } + + public EveAssetCatalogDocument( + string providerId, + string catalogId, + long version, + string updatedAtUtc, + EveAssetCatalogEntry[] assets) + : this(SchemaId, providerId, catalogId, version, updatedAtUtc, assets) + { + } + + [Key(0)] public string Schema { get; } + [Key(1)] public string ProviderId { get; } + [Key(2)] public string CatalogId { get; } + [Key(3)] public long Version { get; } + [Key(4)] public string UpdatedAtUtc { get; } + [Key(5)] public EveAssetCatalogEntry[] Assets { get; } + } + + [MessagePackObject] + public sealed class EveAssetCatalogEntry + { + [SerializationConstructor] + public EveAssetCatalogEntry( + string assetRef, + string assetKind, + EveAssetVariant[] variants, + Dictionary metadata) + { + AssetRef = assetRef ?? ""; + AssetKind = assetKind ?? ""; + Variants = variants ?? Array.Empty(); + Metadata = metadata == null + ? new Dictionary(StringComparer.Ordinal) + : new Dictionary(metadata, StringComparer.Ordinal); + } + + public EveAssetCatalogEntry( + string assetRef, + string assetKind, + EveAssetVariant[] variants, + IReadOnlyDictionary? metadata = null) + : this( + assetRef, + assetKind, + variants, + metadata == null ? new Dictionary() : new Dictionary(metadata)) + { + } + + [Key(0)] public string AssetRef { get; } + [Key(1)] public string AssetKind { get; } + [Key(2)] public EveAssetVariant[] Variants { get; } + [Key(3)] public Dictionary Metadata { get; } + } + + [MessagePackObject] + public sealed class EveAssetVariant + { + [SerializationConstructor] + public EveAssetVariant( + string runtimeId, + string platform, + string format, + string uri, + string contentHash, + long sizeBytes, + string assetKey, + Dictionary metadata) + { + RuntimeId = runtimeId ?? ""; + Platform = platform ?? ""; + Format = format ?? ""; + Uri = uri ?? ""; + ContentHash = contentHash ?? ""; + SizeBytes = sizeBytes; + AssetKey = assetKey ?? ""; + Metadata = metadata == null + ? new Dictionary(StringComparer.Ordinal) + : new Dictionary(metadata, StringComparer.Ordinal); + } + + public EveAssetVariant( + string runtimeId, + string platform, + string format, + string uri, + string contentHash, + long sizeBytes, + string assetKey, + IReadOnlyDictionary? metadata = null) + : this( + runtimeId, + platform, + format, + uri, + contentHash, + sizeBytes, + assetKey, + metadata == null ? new Dictionary() : new Dictionary(metadata)) + { + } + + [Key(0)] public string RuntimeId { get; } + [Key(1)] public string Platform { get; } + [Key(2)] public string Format { get; } + [Key(3)] public string Uri { get; } + [Key(4)] public string ContentHash { get; } + [Key(5)] public long SizeBytes { get; } + [Key(6)] public string AssetKey { get; } + [Key(7)] public Dictionary Metadata { get; } + } +} diff --git a/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs.meta b/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs.meta new file mode 100644 index 0000000..0af6487 --- /dev/null +++ b/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8f53654f7c98d894588127ba001f11b4 \ No newline at end of file diff --git a/schemas/gamecult.eve.asset_catalog.v1.schema.json b/schemas/gamecult.eve.asset_catalog.v1.schema.json new file mode 100644 index 0000000..579afc9 --- /dev/null +++ b/schemas/gamecult.eve.asset_catalog.v1.schema.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "gamecult.eve.asset_catalog.v1", + "title": "Eve Asset Catalog", + "type": "object", + "required": ["schema", "providerId", "catalogId", "version", "assets"], + "properties": { + "schema": { "const": "gamecult.eve.asset_catalog.v1" }, + "providerId": { "type": "string", "minLength": 1 }, + "catalogId": { "type": "string", "minLength": 1 }, + "version": { "type": "integer", "minimum": 0 }, + "updatedAtUtc": { "type": "string" }, + "assets": { + "type": "array", + "items": { + "type": "object", + "required": ["assetRef", "assetKind", "variants"], + "properties": { + "assetRef": { "type": "string", "minLength": 1 }, + "assetKind": { "type": "string", "minLength": 1 }, + "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, + "variants": { + "type": "array", + "items": { + "type": "object", + "required": ["runtimeId", "platform", "format", "uri", "contentHash", "sizeBytes", "assetKey"], + "properties": { + "runtimeId": { "type": "string", "minLength": 1 }, + "platform": { "type": "string", "minLength": 1 }, + "format": { "type": "string", "minLength": 1 }, + "uri": { "type": "string", "minLength": 1 }, + "contentHash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }, + "sizeBytes": { "type": "integer", "minimum": 0 }, + "assetKey": { "type": "string", "minLength": 1 }, + "metadata": { "type": "object", "additionalProperties": { "type": "string" } } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false +}