From 580a4c37b839b4d0ad75bc593f0a865c9c724973 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 14 Jul 2026 16:40:48 +0100 Subject: [PATCH] Delete obsolete snapshot asset client --- .../Electron/aetheria-cultmesh.ts | 60 ------------------- Aetheria.State.Verify/Program.cs | 5 +- docs/renderless-aetheria-architecture.md | 4 +- 3 files changed, 6 insertions(+), 63 deletions(-) diff --git a/Aetheria.Rts.Web/Electron/aetheria-cultmesh.ts b/Aetheria.Rts.Web/Electron/aetheria-cultmesh.ts index fbb057109..02ef90bed 100644 --- a/Aetheria.Rts.Web/Electron/aetheria-cultmesh.ts +++ b/Aetheria.Rts.Web/Electron/aetheria-cultmesh.ts @@ -61,7 +61,6 @@ import { } from "./aetheria-rts-local-documents.js"; const connectionId = 0x43554c54; -const cultMeshCdnAssetBlobSchemaId = "gamecult.cultmesh.cdn.asset_blob.v1"; type AetheriaPublicationDocumentSpec = CultMeshPublicationDocumentBinding & { readonly localPath: string; @@ -272,33 +271,6 @@ export class AetheriaCultMeshClient { return this.aetheria.daemon.assetManifest(); } - public async assetBlob(uri: string): Promise<{ bytes: Uint8Array; mimeType: string }> { - const recordKey = normalizeCultMeshAssetUri(uri); - const document = CultMesh.documentFromPublication( - { - kind: "peer-snapshot", - peer: () => this.peer(), - endpoint: this.resolvedRudpEndpoint(), - }, - cultMeshCdnAssetBlobSchemaId, - recordKey, - { - documentId: recordKey, - routeHint: this.queryVerse.context.routeHint, - sourceId: recordKey, - timeoutMs: 1500, - pollMs: 50, - messageIdPrefix: `${this.runtimeId}:asset`, - }, - ); - const bytes = normalizeAssetBlob(await document.latest(this.queryContext())); - const manifest = await this.assetManifest().catch(() => null); - return { - bytes, - mimeType: resolveAssetMimeType(recordKey, manifest), - }; - } - public queryDiagnostics(): Readonly> { return describeAetheriaRuntimeGameQueryHandles(this.queries); } @@ -623,14 +595,6 @@ function normalizeDaemonTarget(target: string | AetheriaCultMeshDaemonTarget): R }; } -function normalizeCultMeshAssetUri(uri: string): string { - const value = (uri ?? "").trim(); - if (!value.toLowerCase().startsWith("cultmesh://")) { - throw new Error(`Aetheria asset URI must be CultMesh-native: ${value}`); - } - return value; -} - function managedViewportRecordKey(prefix: string, request: ViewportRequest): string { const minX = Math.min(finiteNumber(request.minX), finiteNumber(request.maxX)); const minY = Math.min(finiteNumber(request.minY), finiteNumber(request.maxY)); @@ -651,30 +615,6 @@ function finiteNumber(value: unknown): number { return typeof value === "number" && Number.isFinite(value) ? value : 0; } -function normalizeAssetBlob(value: unknown): Uint8Array { - if (value instanceof Uint8Array) - return value; - if (Array.isArray(value)) - return Uint8Array.from(value.map(entry => typeof entry === "number" ? entry : 0)); - throw new Error("Aetheria CultMesh CDN asset blob did not decode to bytes."); -} - -function resolveAssetMimeType(recordKey: string, manifest: AssetManifestDocument | null): string { - const entry = manifest?.assets.find(candidate => candidate.ref.uri === recordKey); - return entry?.ref.mimeType?.trim() || mimeTypeFromUri(recordKey); -} - -function mimeTypeFromUri(uri: string): string { - const normalized = uri.toLowerCase(); - if (normalized.endsWith(".jpg") || normalized.endsWith(".jpeg")) - return "image/jpeg"; - if (normalized.endsWith(".svg")) - return "image/svg+xml"; - if (normalized.endsWith(".png") || normalized.startsWith("cultmesh://")) - return "image/png"; - return "application/octet-stream"; -} - async function retryTransientPublicationRead(read: () => Promise): Promise { let lastError: unknown; for (let attempt = 0; attempt < 40; attempt += 1) { diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index e36062d2e..77865277f 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -20821,8 +20821,10 @@ static void RequireManagedContentOnlyAssetDelivery(string root) "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonDocuments.cs"); + var electronPath = Path.Combine(root, "Aetheria.Rts.Web", "Electron", "aetheria-cultmesh.ts"); var daemon = File.ReadAllText(daemonPath); var documents = File.ReadAllText(documentsPath); + var electron = File.ReadAllText(electronPath); var forbidden = new[] { "CultMeshCdnAssetBlob", @@ -20831,7 +20833,8 @@ static void RequireManagedContentOnlyAssetDelivery(string root) }; var surviving = forbidden .Where(symbol => daemon.Contains(symbol, StringComparison.Ordinal) || - documents.Contains(symbol, StringComparison.Ordinal)) + documents.Contains(symbol, StringComparison.Ordinal) || + electron.Contains(symbol, StringComparison.Ordinal)) .ToArray(); if (surviving.Length > 0) { diff --git a/docs/renderless-aetheria-architecture.md b/docs/renderless-aetheria-architecture.md index 96125a926..12cbd7cf4 100644 --- a/docs/renderless-aetheria-architecture.md +++ b/docs/renderless-aetheria-architecture.md @@ -45,8 +45,8 @@ embedded Ymir spatial kernel, but Ymir does not become a second state owner. Outputs: The daemon publishes typed state documents, committed facts, operation receipts, simulation frames, SoA/native view descriptors, scalar and vector field -documents, render splats, entity/object render rows, asset manifests, CultMesh -CDN asset blobs, and Eve/CultUI surfaces. +documents, render splats, entity/object render rows, typed CultMesh artifact +manifests, managed content sessions, and Eve/CultUI surfaces. Derived state: Unity GameObjects, Electron canvases, Hermodr browser nodes, Godot scene nodes,