A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix(platform): a mini-game reads the file the package actually carries
esengineaa99cac4ed9d
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a943ac8cd..37760ee6c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -14,6 +14,27 @@ published separately; it ships inside the editor.## [Unreleased]+### Fixed++- **A mini-game package can read its own prefabs and materials.** The mini-game+ filesystem adapter rewrote every custom extension whose content is JSON —+ `.esprefab`, `.esmaterial`, `.estileset`, `.esanimator`, `.eslocale` — to+ `.json` before handing the name to the host. That was how a long-replaced+ exporter staged them; the cook keeps the authored extension, and the export+ declares it in `packOptions.include` so the packer ships it under that name.+ So a WeChat build resolved a prefab to exactly the right file, asked the+ device for one it had never written, and died on the first load with+ `File not found: "assets/…/Foo.json"` — a name the project does not contain+ anywhere, which is why it read as a culled asset rather than a wrong spelling.+ The adapter now reads the path the manifest gives it.+ ([#61](https://github.com/esengine/estella/issues/61))++ The two halves of this — what the exporter NAMES a file and what the runtime+ ASKS for — never read each other, so only a build can show that they agree:+ a new export gate walks the real resolution a packaged runtime performs over+ the manifest an export actually wrote, and asserts every spelling of every+ asset lands on a file the package carries.+## [0.67.0] - 2026-09-15### Addeddiff --git a/docs/astro/src/data/apiStability.generated.json b/docs/astro/src/data/apiStability.generated.jsonindex 9ace8db32..758f056ef 100644--- a/docs/astro/src/data/apiStability.generated.json+++ b/docs/astro/src/data/apiStability.generated.json@@ -3,10 +3,10 @@"counts": {"public": 114,"beta": 101,- "experimental": 1909,+ "experimental": 1908,"deprecated": 3},- "total": 2124,+ "total": 2123,"subsystems": [{"id": "ecs",diff --git a/pipeline/tests/export-wechat-read-paths.test.ts b/pipeline/tests/export-wechat-read-paths.test.tsnew file mode 100644index 000000000..c3f0e3530--- /dev/null+++ b/pipeline/tests/export-wechat-read-paths.test.ts@@ -0,0 +1,143 @@+// SPDX-License-Identifier: Apache-2.0+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team+/**+ * @file The mini-game package must answer the path its own runtime asks for.+ *+ * Two halves have to agree and only a build can show that they do: the+ * exporter decides the NAME a file ships under, and the shipped runtime+ * decides the name it hands the host filesystem (manifest lookup, then+ * the adapter's path mapping). Nothing in either half reads the other,+ * so a rename on one side is invisible until a device says "file not+ * found" — which is how a build shipped every prefab and material under+ * a name no read would ever produce.+ *+ * So this drives the REAL read the packaged runtime performs — manifest+ * lookup (`indexPackagedManifest`) then the shipped adapter over the+ * exported directory — and asserts every spelling of every asset lands+ * on a file the package carries.+ */+import { describe, it, expect, afterAll } from 'vitest';+import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, existsSync, rmSync } from 'node:fs';+import { tmpdir } from 'node:os';+import path from 'node:path';+import { exportGame } from '../src/export/exportGame';+import { indexPackagedManifest } from '../../sdk/src/runtime/packagedRuntime';+import { MiniGamePlatformAdapter } from '../../sdk/src/platform/minigame/adapter';+import type { MiniGameGlobal } from '../../sdk/src/platform/minigame/api';+import type { AddressableManifest } from '../../sdk/src/asset/AddressableManifest';++const TEX = 'dddddddd-dddd-dddd-dddd-dddddddddddd';+const MAT = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee';+const PREFAB = 'ffffffff-ffff-ffff-ffff-ffffffffffff';+const SCN = '11111111-2222-3333-4444-555555555555';+const meta = (uuid: string, type: string) => JSON.stringify({ uuid, version: '2.0', type, importer: {} });++const roots: string[] = [];+afterAll(() => {+ for (const dir of roots) rmSync(dir, { recursive: true, force: true, maxRetries: 10, retryDelay: 50 });+});++/** A project whose scene names a prefab and a material — the custom extensions+ * whose CONTENT is JSON, which is what the mapping under test keys on. */+function scaffold(): { root: string; out: string } {+ const root = mkdtempSync(path.join(tmpdir(), 'estella-wechat-readpath-'));+ roots.push(root);+ mkdirSync(path.join(root, 'assets'), { recursive: true });+ writeFileSync(path.join(root, 'assets', 'hero.png'), 'PNGDATA');+ writeFileSync(path.join(root, 'assets', 'hero.png.meta'), meta(TEX, 'texture'));+ writeFileSync(+ path.join(root, 'assets', 'hero.esmaterial'),+ JSON.stringify({ version: '1.0', shader: 'builtin:sprite', properties: { mainTexture: `@uuid:${TEX}` } }),+ );+ writeFileSync(path.join(root, 'assets', 'hero.esmaterial.meta'), meta(MAT, 'material'));+ writeFileSync(+ path.join(root, 'assets', 'hero.esprefab'),+ JSON.stringify({ version: '1.0', name: 'Hero', entities: [{ id: 0, components: [{ type: 'Sprite', data: { texture: `@uuid:${TEX}` } }] }] }),+ );+ writeFileSync(path.join(root, 'assets', 'hero.esprefab.meta'), meta(PREFAB, 'prefab'));+ mkdirSync(path.join(root, 'scenes'), { recursive: true });+ writeFileSync(+ path.join(root, 'scenes', 'main.esscene'),+ JSON.stringify({+ version: '1.0', name: 'Main',+ entities: [{+ id: 0,+ components: [+ { type: 'Sprite', data: { texture: `@uuid:${TEX}`, material: `@uuid:${MAT}` } },+ { type: 'PrefabInstance', data: { prefab: `@uuid:${PREFAB}` } },+ ],+ }],+ }),+ );+ writeFileSync(path.join(root, 'scenes', 'main.esscene.meta'), meta(SCN, 'scene'));+ mkdirSync(path.join(root, 'src'), { recursive: true });+ writeFileSync(path.join(root, 'src', 'main.ts'), "import { defineComponent } from 'esengine';\ndefineComponent('Marker', { n: 1 });\n");+ mkdirSync(path.join(root, '_sdk'), { recursive: true });+ writeFileSync(path.join(root, '_sdk', 'index.wechat.js'), 'export function initWeChatRuntime(){return Promise.resolve();}\nexport function defineComponent(){}\n');+ mkdirSync(path.join(root, '_wxwasm'), { recursive: true });+ writeFileSync(path.join(root, '_wxwasm', 'esengine.js'), 'module.exports = () => Promise.resolve({});');+ writeFileSync(path.join(root, '_wxwasm', 'esengine.wasm'), 'wasmbytes');+ return { root, out: path.join(root, 'dist-wechat') };+}++/** The shipped adapter over the exported package — the host filesystem is the+ * staged directory, so a read asks for exactly what a device would ask for. */+function adapterOver(out: string): MiniGamePlatformAdapter {+ const fs = {+ readFileSync: (p: string, encoding?: string) => {+ const abs = path.join(out, p);+ if (!existsSync(abs)) throw new Error(`no such file or directory ${p}`);+ return encoding ? readFileSync(abs, 'utf8') : readFileSync(abs).buffer;+ },+ accessSync: (p: string) => {+ if (!existsSync(path.join(out, p))) throw new Error(`no such file or directory ${p}`);+ },+ };+ const global = { getFileSystemManager: () => fs } as unknown as MiniGameGlobal;+ return new MiniGamePlatformAdapter({ id: 'wechat', hostLabel: 'WeChat', global });+}++describe('exportGame (wechat) — every asset resolves to a file the package carries', () => {+ it('resolves each manifest asset to a staged file', async () => {+ const { root, out } = scaffold();+ const res = await exportGame({+ root,+ entryScene: 'scenes/main.esscene',+ gameHostEntry: 'unused-for-wechat',+ scriptsEntry: 'src/main.ts',+ sdkDistDir: path.join(root, '_sdk'),+ wasmDir: path.join(root, '_wxwasm'),+ outDir: out,+ platform: 'wechat',+ });+ expect(res.ok).toBe(true);++ const manifest = JSON.parse(readFileSync(path.join(out, 'asset-manifest.json'), 'utf8')) as AddressableManifest;+ const index = indexPackagedManifest(manifest);++ // Both the prefab and the material ship — the scene names them — and the+ // packer is told to carry those suffixes, else the file never lands.+ const keys = Object.keys(manifest.groups.main.assets);+ expect(keys).toContain(MAT);+ expect(keys).toContain(PREFAB);+ const pcfg = JSON.parse(readFileSync(path.join(out, 'project.config.json'), 'utf8'));+ expect(pcfg.packOptions.include).toContainEqual({ type: 'suffix', value: '.esprefab' });+ expect(pcfg.packOptions.include).toContainEqual({ type: 'suffix', value: '.esmaterial' });++ // Every spelling the game can hold: the uuid a scene carries, and the+ // project-relative path code writes by hand.+ const adapter = adapterOver(out);+ const missing: string[] = [];+ for (const [uuid, asset] of Object.entries(manifest.groups.main.assets)) {+ for (const ref of [uuid, `@uuid:${uuid}`, asset.address ?? asset.path]) {+ const read = index.resolvePath(ref);+ if (!(await adapter.fileExists(read))) missing.push(`${ref} → ${read}`);+ }+ }+ expect(missing).toEqual([]);++ // …and the bytes come back, which is what the game was after.+ const prefab = JSON.parse(await adapter.readTextFile(index.resolvePath(PREFAB)));+ expect(prefab.name).toBe('Hero');+ }, 60_000);+});diff --git a/sdk/etc/index.api.md b/sdk/etc/index.api.mdindex 4ccf3a39e..a5cec83fc 100644--- a/sdk/etc/index.api.md+++ b/sdk/etc/index.api.md@@ -1,7 +1,7 @@# API surface — esengine/index<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->-Symbols: 114 public · 94 beta · 1748 experimental · 3 deprecated+Symbols: 114 public · 94 beta · 1747 experimental · 3 deprecated## ABI_LAYOUT_HASH — const @experimental```@@ -4992,7 +4992,7 @@ groupNames: () => string[]groupsByMode: (mode: BundleMode) => string[]remoteAssetIdentity: (ref: string) => string | nullremoteAssetPath: (ref: string) => string | null-resolvePath: (ref: string, normalize?: (ref: string) => string) => string+resolvePath: (ref: string) => stringrevision: () => string | nullspineCullingLookup: () => (skeleton: string, atlas: string) => SpineCullingRect | undefinedtextureImportLookup: () => (ref: string) => ParsedTextureImportSettings | undefined@@ -14077,11 +14077,6 @@ TimelinePluginPlugin```-## toBuildPath — function @experimental-```-(path: string): string-```-## trailPlugin — const @experimental```TrailPlugindiff --git a/sdk/etc/index.native.api.md b/sdk/etc/index.native.api.mdindex 39e996a4b..52569c982 100644--- a/sdk/etc/index.native.api.md+++ b/sdk/etc/index.native.api.md@@ -1,7 +1,7 @@# API surface — esengine/index.native<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->-Symbols: 114 public · 99 beta · 1767 experimental · 3 deprecated+Symbols: 114 public · 99 beta · 1766 experimental · 3 deprecated## ABI_LAYOUT_HASH — const @experimental```@@ -5000,7 +5000,7 @@ groupNames: () => string[]groupsByMode: (mode: BundleMode) => string[]remoteAssetIdentity: (ref: string) => string | nullremoteAssetPath: (ref: string) => string | null-resolvePath: (ref: string, normalize?: (ref: string) => string) => string+resolvePath: (ref: string) => stringrevision: () => string | nullspineCullingLookup: () => (skeleton: string, atlas: string) => SpineCullingRect | undefinedtextureImportLookup: () => (ref: string) => ParsedTextureImportSettings | undefined@@ -14320,11 +14320,6 @@ TimelinePluginPlugin```-## toBuildPath — function @experimental-```-(path: string): string-```-## trailPlugin — const @experimental```TrailPlugindiff --git a/sdk/etc/index.node.api.md b/sdk/etc/index.node.api.mdindex 232f81298..1b201162b 100644--- a/sdk/etc/index.node.api.md+++ b/sdk/etc/index.node.api.md@@ -1,7 +1,7 @@# API surface — esengine/index.node<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->-Symbols: 114 public · 96 beta · 1747 experimental · 3 deprecated+Symbols: 114 public · 96 beta · 1746 experimental · 3 deprecated## ANCHOR_AXES — const @experimental```@@ -4987,7 +4987,7 @@ groupNames: () => string[]groupsByMode: (mode: BundleMode) => string[]remoteAssetIdentity: (ref: string) => string | nullremoteAssetPath: (ref: string) => string | null-resolvePath: (ref: string, normalize?: (ref: string) => string) => string+resolvePath: (ref: string) => stringrevision: () => string | nullspineCullingLookup: () => (skeleton: string, atlas: string) => SpineCullingRect | undefinedtextureImportLookup: () => (ref: string) => ParsedTextureImportSettings | undefined@@ -14082,11 +14082,6 @@ TimelinePluginPlugin```-## toBuildPath — function @experimental-```-(path: string): string-```-## trailPlugin — const @experimental```TrailPlugindiff --git a/sdk/etc/minigame.api.md b/sdk/etc/minigame.api.mdindex 6efab7db4..9b36a3c0d 100644--- a/sdk/etc/minigame.api.md+++ b/sdk/etc/minigame.api.md@@ -1,7 +1,7 @@# API surface — esengine/minigame<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->-Symbols: 114 public · 94 beta · 1769 experimental · 3 deprecated+Symbols: 114 public · 94 beta · 1768 experimental · 3 deprecated## ANCHOR_AXES — const @experimental```@@ -4987,7 +4987,7 @@ groupNames: () => string[]groupsByMode: (mode: BundleMode) => string[]remoteAssetIdentity: (ref: string) => string | nullremoteAssetPath: (ref: string) => string | null-resolvePath: (ref: string, normalize?: (ref: string) => string) => string+resolvePath: (ref: string) => stringrevision: () => string | nullspineCullingLookup: () => (skeleton: string, atlas: string) => SpineCullingRect | undefinedtextureImportLookup: () => (ref: string) => ParsedTextureImportSettings | undefined@@ -14341,11 +14341,6 @@ TimelinePluginPlugin```-## toBuildPath — function @experimental-```-(path: string): string-```-## trailPlugin — const @experimental```TrailPlugindiff --git a/sdk/etc/wechat.api.md b/sdk/etc/wechat.api.mdindex 2a75046eb..6270f7953 100644--- a/sdk/etc/wechat.api.md+++ b/sdk/etc/wechat.api.md@@ -1,7 +1,7 @@# API surface — esengine/wechat<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->-Symbols: 114 public · 94 beta · 1759 experimental · 3 deprecated+Symbols: 114 public · 94 beta · 1758 experimental · 3 deprecated## ANCHOR_AXES — const @experimental```@@ -4994,7 +4994,7 @@ groupNames: () => string[]groupsByMode: (mode: BundleMode) => string[]remoteAssetIdentity: (ref: string) => string | nullremoteAssetPath: (ref: string) => string | null-resolvePath: (ref: string, normalize?: (ref: string) => string) => string+resolvePath: (ref: string) => stringrevision: () => string | nullspineCullingLookup: () => (skeleton: string, atlas: string) => SpineCullingRect | undefinedtextureImportLookup: () => (ref: string) => ParsedTextureImportSettings | undefined@@ -14105,11 +14105,6 @@ TimelinePluginPlugin```-## toBuildPath — function @experimental-```-(path: string): string-```-## trailPlugin — const @experimental```TrailPlugindiff --git a/sdk/src/asset/AddressableManifest.ts b/sdk/src/asset/AddressableManifest.tsindex 64156bf1a..adfff901f 100644--- a/sdk/src/asset/AddressableManifest.ts+++ b/sdk/src/asset/AddressableManifest.ts@@ -349,16 +349,13 @@ export class ManifestModel {/*** Resolve a serialized asset ref (a uuid, an address, or a path) to its- * build path. `normalize` maps a ref to its expected build path (e.g.- * `toBuildPath`); it is applied before the lookups and is the fallback when- * nothing matches. This is the single manifest→path resolution used by the- * shipped runtimes — callers never re-walk `groups` to build their own.+ * build path, falling back to the ref itself. The single manifest→path+ * resolution the shipped runtimes use, and the last word on the name: a+ * build path is whatever the cook staged the file as.*/- resolvePath(ref: string, normalize: (ref: string) => string = (s) => s): string {+ resolvePath(ref: string): string {const { byKey, byPath } = this.indexes();- const resolved = normalize(ref);- const entry =- byKey.get(ref) ?? byKey.get(resolved) ?? byPath.get(resolved) ?? byPath.get(ref);- return entry ? entry.path : resolved;+ const entry = byKey.get(ref) ?? byPath.get(ref);+ return entry ? entry.path : ref;}}diff --git a/sdk/src/assetTypes.ts b/sdk/src/assetTypes.tsindex cf8be43e4..5ebf791d2 100644--- a/sdk/src/assetTypes.ts+++ b/sdk/src/assetTypes.ts@@ -218,12 +218,3 @@ export function isCustomExtension(path: string): boolean {const entry = getAssetTypeEntry(path);return entry?.wechatPackInclude ?? false;}--export function toBuildPath(path: string): string {- const entry = getAssetTypeEntry(path);- if (!entry || !entry.wechatPackInclude) return path;- if (entry.contentType !== 'json') return path;- const dotIndex = path.lastIndexOf('.');- return dotIndex >= 0 ? path.substring(0, dotIndex) + '.json' : path;-}-diff --git a/sdk/src/core-content.ts b/sdk/src/core-content.tsindex 67098438d..59fc56462 100644--- a/sdk/src/core-content.ts+++ b/sdk/src/core-content.ts@@ -33,7 +33,6 @@ export {getWeChatPackOptions,getAssetMimeType,isCustomExtension,- toBuildPath,} from './assetTypes';// =============================================================================diff --git a/sdk/src/platform/minigame/adapter.ts b/sdk/src/platform/minigame/adapter.tsindex ff4ab3c86..721febdb8 100644--- a/sdk/src/platform/minigame/adapter.ts+++ b/sdk/src/platform/minigame/adapter.ts@@ -31,7 +31,6 @@ import type {} from '../types';import type { PlatformAudioBackend } from '../../audio/PlatformAudioBackend';import type { PlatformVideoBackend, VideoBackendContext } from '../../video/PlatformVideoBackend';-import { toBuildPath } from '../../assetTypes';import { log } from '../../util/logger';import type {MiniGameGlobal, MiniGameProfile, MiniGameCanvas, MiniGameFileSystemManager, MiniGameTouchEvent,@@ -73,15 +72,15 @@ export class MiniGamePlatformAdapter implements PlatformAdapter {}async readFile(path: string): Promise<ArrayBuffer> {- return mgReadFileSync(this.fs(), toBuildPath(path), this.profile_.hostLabel);+ return mgReadFileSync(this.fs(), path, this.profile_.hostLabel);}async readTextFile(path: string): Promise<string> {- return mgReadTextFileSync(this.fs(), toBuildPath(path), this.profile_.hostLabel);+ return mgReadTextFileSync(this.fs(), path, this.profile_.hostLabel);}async fileExists(path: string): Promise<boolean> {- return mgFileExistsSync(this.fs(), toBuildPath(path));+ return mgFileExistsSync(this.fs(), path);}async loadImagePixels(path: string): Promise<ImageLoadResult> {diff --git a/sdk/src/platform/minigame/fs.ts b/sdk/src/platform/minigame/fs.tsindex 1c16606bf..412fe71f0 100644--- a/sdk/src/platform/minigame/fs.ts+++ b/sdk/src/platform/minigame/fs.ts@@ -4,8 +4,9 @@* @file fs.ts* @brief Filesystem helpers over a mini-game FileSystemManager (vendor-neutral).*- * Thin wrappers over `MiniGameGlobal.getFileSystemManager()`. Path conversion- * (toBuildPath) happens at the adapter level, not here — this layer is pure I/O.+ * Thin wrappers over `MiniGameGlobal.getFileSystemManager()`. A path arrives+ * already resolved against the package's manifest — the file ships under the+ * name the cook staged it as, so this layer reads it verbatim.* The `hostLabel` threads the vendor name ("WeChat" / "抖音") into permission* guidance so the message names the right devtools.*/diff --git a/sdk/src/runtime/packagedRuntime.ts b/sdk/src/runtime/packagedRuntime.tsindex 497216f11..2a3c658bd 100644--- a/sdk/src/runtime/packagedRuntime.ts+++ b/sdk/src/runtime/packagedRuntime.ts@@ -12,7 +12,6 @@* the bytes arrive, so the same code serves both realms.*/-import { toBuildPath } from '../assetTypes';import { extractUuid } from '../asset/AssetRegistry';import { platformReadTextFile, platformLoadImagePixels } from '../platform';import { ManifestModel, type AddressableManifest } from '../asset/AddressableManifest';@@ -271,7 +270,7 @@ export function indexPackagedManifest(manifest: AddressableManifest): PackagedAs// A scene spells asset refs `@uuid:<v4>`, while the manifest indexes bare// uuids — strip the prefix before looking up, or every `@uuid:` ref falls// through as a literal path and 404s.- resolvePath: (ref) => model.resolvePath(extractUuid(ref) ?? ref, toBuildPath),+ resolvePath: (ref) => model.resolvePath(extractUuid(ref) ?? ref),// The authored logical path behind any spelling — its uuid, its logical// address, or its staged (content-addressed) path. Lets a loader recover the// directory a sibling was authored in after the rename hid it.diff --git a/sdk/tests/assetTypes.test.ts b/sdk/tests/assetTypes.test.tsindex 786c96f6d..3c622f5a5 100644--- a/sdk/tests/assetTypes.test.ts+++ b/sdk/tests/assetTypes.test.ts@@ -13,7 +13,6 @@ import {getWeChatPackOptions,getAssetMimeType,isCustomExtension,- toBuildPath,} from '../src/assetTypes';describe('getAssetTypeEntry', () => {@@ -195,22 +194,3 @@ describe('isCustomExtension', () => {expect(isCustomExtension('file.xyz')).toBe(false);});});--describe('toBuildPath', () => {- it('should convert json-content custom extension to .json', () => {- expect(toBuildPath('data/item.esmaterial')).toBe('data/item.json');- expect(toBuildPath('data/hero.esprefab')).toBe('data/hero.json');- });-- it('should not convert non-json content types', () => {- expect(toBuildPath('spine/char.atlas')).toBe('spine/char.atlas');- });-- it('should not convert non-packable files', () => {- expect(toBuildPath('assets/hero.png')).toBe('assets/hero.png');- });-- it('should pass through unknown extensions', () => {- expect(toBuildPath('file.xyz')).toBe('file.xyz');- });-});diff --git a/sdk/tests/manifest-model.test.ts b/sdk/tests/manifest-model.test.tsindex d0d452e22..b6a1b53ba 100644--- a/sdk/tests/manifest-model.test.ts+++ b/sdk/tests/manifest-model.test.ts@@ -132,24 +132,15 @@ describe('ManifestModel resolution', () => {expect(model().resolvePath('uuid-1')).toBe('images/a.abc123.png');});- it('resolvePath: key hit after normalize', () => {- // ref isn't a key, but normalize maps it onto one.- const r = model().resolvePath('raw', (s) => (s === 'raw' ? 'uuid-1' : s));- expect(r).toBe('images/a.abc123.png');- });-- it('resolvePath: path hit (identity normalize)', () => {+ it('resolvePath: path hit', () => {expect(model().resolvePath('b.png')).toBe('b.png');});- it('resolvePath: path hit after normalize (toBuildPath-style)', () => {- const r = model().resolvePath('b.src', (s) => (s === 'b.src' ? 'b.png' : s));- expect(r).toBe('b.png');- });-- it('resolvePath: miss returns the normalized ref', () => {- expect(model().resolvePath('nope', (s) => `${s}.x`)).toBe('nope.x');- expect(model().resolvePath('nope')).toBe('nope');+ // A build path is the name the cook staged the file under. A ref nothing+ // knows comes back spelled exactly as it was asked for, so the read that+ // fails names the file the caller actually wanted.+ it('resolvePath: miss returns the ref verbatim', () => {+ expect(model().resolvePath('assets/hero.esprefab')).toBe('assets/hero.esprefab');});// The address is the asset's LOGICAL source path, kept when content-addressed