@forgeax/engine-assets-runtime 0.0.0-dev.8d955ade1c79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +491 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/__tests__/aabb.unit.test.d.ts +2 -0
  5. package/dist/__tests__/aabb.unit.test.d.ts.map +1 -0
  6. package/dist/__tests__/artifact-integrity.unit.test.d.ts +2 -0
  7. package/dist/__tests__/artifact-integrity.unit.test.d.ts.map +1 -0
  8. package/dist/__tests__/artifact-io.unit.test.d.ts +2 -0
  9. package/dist/__tests__/artifact-io.unit.test.d.ts.map +1 -0
  10. package/dist/__tests__/asset-evidence-sdk.integration.test.d.ts +2 -0
  11. package/dist/__tests__/asset-evidence-sdk.integration.test.d.ts.map +1 -0
  12. package/dist/__tests__/asset-evidence.unit.test.d.ts +2 -0
  13. package/dist/__tests__/asset-evidence.unit.test.d.ts.map +1 -0
  14. package/dist/__tests__/asset-kind.unit.test.d.ts +2 -0
  15. package/dist/__tests__/asset-kind.unit.test.d.ts.map +1 -0
  16. package/dist/__tests__/asset-registry-catalog-reconcile.integration.test.d.ts +2 -0
  17. package/dist/__tests__/asset-registry-catalog-reconcile.integration.test.d.ts.map +1 -0
  18. package/dist/__tests__/asset-registry-catalog-reconcile.unit.test.d.ts +2 -0
  19. package/dist/__tests__/asset-registry-catalog-reconcile.unit.test.d.ts.map +1 -0
  20. package/dist/__tests__/asset-registry-catalog.unit.test.d.ts +2 -0
  21. package/dist/__tests__/asset-registry-catalog.unit.test.d.ts.map +1 -0
  22. package/dist/__tests__/asset-registry.pack-cache.test.d.ts +2 -0
  23. package/dist/__tests__/asset-registry.pack-cache.test.d.ts.map +1 -0
  24. package/dist/__tests__/asset-registry.unit.test.d.ts +2 -0
  25. package/dist/__tests__/asset-registry.unit.test.d.ts.map +1 -0
  26. package/dist/__tests__/asset-runtime-error-code-owner.test-d.d.ts +2 -0
  27. package/dist/__tests__/asset-runtime-error-code-owner.test-d.d.ts.map +1 -0
  28. package/dist/__tests__/catalog-replica.unit.test.d.ts +2 -0
  29. package/dist/__tests__/catalog-replica.unit.test.d.ts.map +1 -0
  30. package/dist/__tests__/catalog-source-v2.unit.test.d.ts +2 -0
  31. package/dist/__tests__/catalog-source-v2.unit.test.d.ts.map +1 -0
  32. package/dist/__tests__/catalog-source.unit.test.d.ts +2 -0
  33. package/dist/__tests__/catalog-source.unit.test.d.ts.map +1 -0
  34. package/dist/__tests__/catalog-subscription-order.unit.test.d.ts +2 -0
  35. package/dist/__tests__/catalog-subscription-order.unit.test.d.ts.map +1 -0
  36. package/dist/__tests__/catalog-subscription.unit.test.d.ts +2 -0
  37. package/dist/__tests__/catalog-subscription.unit.test.d.ts.map +1 -0
  38. package/dist/__tests__/decode-image-bytes-pass-through.test.d.ts +2 -0
  39. package/dist/__tests__/decode-image-bytes-pass-through.test.d.ts.map +1 -0
  40. package/dist/__tests__/decode-image-bytes.browser.test.d.ts +2 -0
  41. package/dist/__tests__/decode-image-bytes.browser.test.d.ts.map +1 -0
  42. package/dist/__tests__/decode-image-bytes.test-d.d.ts +2 -0
  43. package/dist/__tests__/decode-image-bytes.test-d.d.ts.map +1 -0
  44. package/dist/__tests__/decode-image-bytes.test.d.ts +2 -0
  45. package/dist/__tests__/decode-image-bytes.test.d.ts.map +1 -0
  46. package/dist/__tests__/decode-image-mime-owner.test.d.ts +2 -0
  47. package/dist/__tests__/decode-image-mime-owner.test.d.ts.map +1 -0
  48. package/dist/__tests__/dynamic-texture-store.unit.test.d.ts +2 -0
  49. package/dist/__tests__/dynamic-texture-store.unit.test.d.ts.map +1 -0
  50. package/dist/__tests__/errors-asset.unit.test.d.ts +2 -0
  51. package/dist/__tests__/errors-asset.unit.test.d.ts.map +1 -0
  52. package/dist/__tests__/inline-pack-loaders.unit.test.d.ts +2 -0
  53. package/dist/__tests__/inline-pack-loaders.unit.test.d.ts.map +1 -0
  54. package/dist/__tests__/instantiate-context.unit.test.d.ts +2 -0
  55. package/dist/__tests__/instantiate-context.unit.test.d.ts.map +1 -0
  56. package/dist/__tests__/instantiate-publication-fence.unit.test.d.ts +2 -0
  57. package/dist/__tests__/instantiate-publication-fence.unit.test.d.ts.map +1 -0
  58. package/dist/__tests__/instantiate.unit.test.d.ts +2 -0
  59. package/dist/__tests__/instantiate.unit.test.d.ts.map +1 -0
  60. package/dist/__tests__/loader-input-contract.unit.test.d.ts +2 -0
  61. package/dist/__tests__/loader-input-contract.unit.test.d.ts.map +1 -0
  62. package/dist/__tests__/loader-registry.unit.test.d.ts +2 -0
  63. package/dist/__tests__/loader-registry.unit.test.d.ts.map +1 -0
  64. package/dist/__tests__/material-dependency-invalidation.unit.test.d.ts +2 -0
  65. package/dist/__tests__/material-dependency-invalidation.unit.test.d.ts.map +1 -0
  66. package/dist/__tests__/material-generation-cache.unit.test.d.ts +2 -0
  67. package/dist/__tests__/material-generation-cache.unit.test.d.ts.map +1 -0
  68. package/dist/__tests__/material-load-consumer.test-d.d.ts +2 -0
  69. package/dist/__tests__/material-load-consumer.test-d.d.ts.map +1 -0
  70. package/dist/__tests__/material-ready.integration.test.d.ts +2 -0
  71. package/dist/__tests__/material-ready.integration.test.d.ts.map +1 -0
  72. package/dist/__tests__/material-stale-generation.unit.test.d.ts +2 -0
  73. package/dist/__tests__/material-stale-generation.unit.test.d.ts.map +1 -0
  74. package/dist/__tests__/mesh-bin-morph-v3.test.d.ts +2 -0
  75. package/dist/__tests__/mesh-bin-morph-v3.test.d.ts.map +1 -0
  76. package/dist/__tests__/mesh-bin.unit.test.d.ts +2 -0
  77. package/dist/__tests__/mesh-bin.unit.test.d.ts.map +1 -0
  78. package/dist/__tests__/mipmap-generator.unit.test.d.ts +2 -0
  79. package/dist/__tests__/mipmap-generator.unit.test.d.ts.map +1 -0
  80. package/dist/__tests__/pack-artifact-transcode-model-owner.test.d.ts +2 -0
  81. package/dist/__tests__/pack-artifact-transcode-model-owner.test.d.ts.map +1 -0
  82. package/dist/__tests__/pack-basis-load.integration.test.d.ts +2 -0
  83. package/dist/__tests__/pack-basis-load.integration.test.d.ts.map +1 -0
  84. package/dist/__tests__/payload-validate.unit.test.d.ts +2 -0
  85. package/dist/__tests__/payload-validate.unit.test.d.ts.map +1 -0
  86. package/dist/__tests__/plugin.test.d.ts +2 -0
  87. package/dist/__tests__/plugin.test.d.ts.map +1 -0
  88. package/dist/__tests__/registry-concurrency.bench.test.d.ts +2 -0
  89. package/dist/__tests__/registry-concurrency.bench.test.d.ts.map +1 -0
  90. package/dist/__tests__/registry-failure-retry.integration.test.d.ts +2 -0
  91. package/dist/__tests__/registry-failure-retry.integration.test.d.ts.map +1 -0
  92. package/dist/__tests__/registry-load-graph.integration.test.d.ts +2 -0
  93. package/dist/__tests__/registry-load-graph.integration.test.d.ts.map +1 -0
  94. package/dist/__tests__/registry-load-state.unit.test.d.ts +2 -0
  95. package/dist/__tests__/registry-load-state.unit.test.d.ts.map +1 -0
  96. package/dist/__tests__/registry-package-cache.unit.test.d.ts +2 -0
  97. package/dist/__tests__/registry-package-cache.unit.test.d.ts.map +1 -0
  98. package/dist/__tests__/registry-public-ready.unit.test.d.ts +2 -0
  99. package/dist/__tests__/registry-public-ready.unit.test.d.ts.map +1 -0
  100. package/dist/__tests__/resolve-asset-handle.unit.test.d.ts +2 -0
  101. package/dist/__tests__/resolve-asset-handle.unit.test.d.ts.map +1 -0
  102. package/dist/__tests__/scene-handle-fields.unit.test.d.ts +2 -0
  103. package/dist/__tests__/scene-handle-fields.unit.test.d.ts.map +1 -0
  104. package/dist/__tests__/scene-payload.unit.test.d.ts +2 -0
  105. package/dist/__tests__/scene-payload.unit.test.d.ts.map +1 -0
  106. package/dist/__tests__/scene-publication-fence.test.d.ts +2 -0
  107. package/dist/__tests__/scene-publication-fence.test.d.ts.map +1 -0
  108. package/dist/__tests__/scriptable-pack-public-surface.test-d.d.ts +2 -0
  109. package/dist/__tests__/scriptable-pack-public-surface.test-d.d.ts.map +1 -0
  110. package/dist/__tests__/static-rig.integration.test.d.ts +2 -0
  111. package/dist/__tests__/static-rig.integration.test.d.ts.map +1 -0
  112. package/dist/__tests__/validate-material.unit.test.d.ts +2 -0
  113. package/dist/__tests__/validate-material.unit.test.d.ts.map +1 -0
  114. package/dist/__tests__/video-pack-loader.integration.test.d.ts +2 -0
  115. package/dist/__tests__/video-pack-loader.integration.test.d.ts.map +1 -0
  116. package/dist/aabb.d.ts +3 -0
  117. package/dist/aabb.d.ts.map +1 -0
  118. package/dist/asset-kind.d.ts +4 -0
  119. package/dist/asset-kind.d.ts.map +1 -0
  120. package/dist/asset-registry.d.ts +554 -0
  121. package/dist/asset-registry.d.ts.map +1 -0
  122. package/dist/builtin-asset-registry.d.ts +22 -0
  123. package/dist/builtin-asset-registry.d.ts.map +1 -0
  124. package/dist/catalog-source.d.ts +24 -0
  125. package/dist/catalog-source.d.ts.map +1 -0
  126. package/dist/decode-image-bytes.d.ts +57 -0
  127. package/dist/decode-image-bytes.d.ts.map +1 -0
  128. package/dist/dynamic-texture-store.d.ts +89 -0
  129. package/dist/dynamic-texture-store.d.ts.map +1 -0
  130. package/dist/errors/asset.d.ts +201 -0
  131. package/dist/errors/asset.d.ts.map +1 -0
  132. package/dist/handles.d.ts +143 -0
  133. package/dist/handles.d.ts.map +1 -0
  134. package/dist/image-error.d.ts +6 -0
  135. package/dist/image-error.d.ts.map +1 -0
  136. package/dist/index.d.ts +34 -0
  137. package/dist/index.d.ts.map +1 -0
  138. package/dist/index.mjs +8359 -0
  139. package/dist/index.mjs.map +1 -0
  140. package/dist/internal/artifact-cache.d.ts +17 -0
  141. package/dist/internal/artifact-cache.d.ts.map +1 -0
  142. package/dist/internal/asset-graph.d.ts +70 -0
  143. package/dist/internal/asset-graph.d.ts.map +1 -0
  144. package/dist/internal/catalog-session.d.ts +60 -0
  145. package/dist/internal/catalog-session.d.ts.map +1 -0
  146. package/dist/internal/decoder-registry.d.ts +19 -0
  147. package/dist/internal/decoder-registry.d.ts.map +1 -0
  148. package/dist/internal/immutable-payload.d.ts +9 -0
  149. package/dist/internal/immutable-payload.d.ts.map +1 -0
  150. package/dist/internal/load-asset.d.ts +31 -0
  151. package/dist/internal/load-asset.d.ts.map +1 -0
  152. package/dist/internal/pack-reader.d.ts +18 -0
  153. package/dist/internal/pack-reader.d.ts.map +1 -0
  154. package/dist/internal/validate-runtime-row.d.ts +7 -0
  155. package/dist/internal/validate-runtime-row.d.ts.map +1 -0
  156. package/dist/internal.d.ts +3 -0
  157. package/dist/internal.d.ts.map +1 -0
  158. package/dist/internal.mjs +329 -0
  159. package/dist/internal.mjs.map +1 -0
  160. package/dist/loader-registry.d.ts +63 -0
  161. package/dist/loader-registry.d.ts.map +1 -0
  162. package/dist/loaders/inline-pack.d.ts +72 -0
  163. package/dist/loaders/inline-pack.d.ts.map +1 -0
  164. package/dist/loaders/mesh-bin.d.ts +21 -0
  165. package/dist/loaders/mesh-bin.d.ts.map +1 -0
  166. package/dist/loaders/pack-artifact.d.ts +20 -0
  167. package/dist/loaders/pack-artifact.d.ts.map +1 -0
  168. package/dist/material/dependency-graph.d.ts +9 -0
  169. package/dist/material/dependency-graph.d.ts.map +1 -0
  170. package/dist/material/generation-cache.d.ts +24 -0
  171. package/dist/material/generation-cache.d.ts.map +1 -0
  172. package/dist/material/inspection.d.ts +24 -0
  173. package/dist/material/inspection.d.ts.map +1 -0
  174. package/dist/material/loader.d.ts +59 -0
  175. package/dist/material/loader.d.ts.map +1 -0
  176. package/dist/material/runtime-shader.d.ts +14 -0
  177. package/dist/material/runtime-shader.d.ts.map +1 -0
  178. package/dist/mesh-bin.d.ts +3 -0
  179. package/dist/mesh-bin.d.ts.map +1 -0
  180. package/dist/mipmap-generator.d.ts +132 -0
  181. package/dist/mipmap-generator.d.ts.map +1 -0
  182. package/dist/payload-validate.d.ts +60 -0
  183. package/dist/payload-validate.d.ts.map +1 -0
  184. package/dist/plugin.d.ts +16 -0
  185. package/dist/plugin.d.ts.map +1 -0
  186. package/dist/registry/artifact-io.d.ts +16 -0
  187. package/dist/registry/artifact-io.d.ts.map +1 -0
  188. package/dist/registry/asset-evidence.d.ts +13 -0
  189. package/dist/registry/asset-evidence.d.ts.map +1 -0
  190. package/dist/registry/catalog-state.d.ts +47 -0
  191. package/dist/registry/catalog-state.d.ts.map +1 -0
  192. package/dist/registry/catalog.d.ts +48 -0
  193. package/dist/registry/catalog.d.ts.map +1 -0
  194. package/dist/registry/instantiate.d.ts +153 -0
  195. package/dist/registry/instantiate.d.ts.map +1 -0
  196. package/dist/registry/load-by-guid.d.ts +247 -0
  197. package/dist/registry/load-by-guid.d.ts.map +1 -0
  198. package/dist/registry/load-state.d.ts +26 -0
  199. package/dist/registry/load-state.d.ts.map +1 -0
  200. package/dist/registry/runtime-projection.d.ts +16 -0
  201. package/dist/registry/runtime-projection.d.ts.map +1 -0
  202. package/dist/registry/scene-publication-fence.d.ts +38 -0
  203. package/dist/registry/scene-publication-fence.d.ts.map +1 -0
  204. package/dist/registry/validate-material.d.ts +77 -0
  205. package/dist/registry/validate-material.d.ts.map +1 -0
  206. package/dist/resolve-asset-handle.d.ts +43 -0
  207. package/dist/resolve-asset-handle.d.ts.map +1 -0
  208. package/dist/resolve-tileset-runtime.d.ts +23 -0
  209. package/dist/resolve-tileset-runtime.d.ts.map +1 -0
  210. package/dist/scene-handle-fields.d.ts +88 -0
  211. package/dist/scene-handle-fields.d.ts.map +1 -0
  212. package/dist/scene-payload.d.ts +15 -0
  213. package/dist/scene-payload.d.ts.map +1 -0
  214. package/dist/wire-default-loaders.d.ts +29 -0
  215. package/dist/wire-default-loaders.d.ts.map +1 -0
  216. package/package.json +76 -0
  217. package/src/__tests__/aabb.unit.test.ts +97 -0
  218. package/src/__tests__/artifact-integrity.unit.test.ts +99 -0
  219. package/src/__tests__/artifact-io.unit.test.ts +127 -0
  220. package/src/__tests__/asset-evidence-sdk.integration.test.ts +32 -0
  221. package/src/__tests__/asset-evidence.unit.test.ts +32 -0
  222. package/src/__tests__/asset-kind.unit.test.ts +14 -0
  223. package/src/__tests__/asset-registry-catalog-reconcile.integration.test.ts +74 -0
  224. package/src/__tests__/asset-registry-catalog-reconcile.unit.test.ts +89 -0
  225. package/src/__tests__/asset-registry-catalog.unit.test.ts +170 -0
  226. package/src/__tests__/asset-registry.pack-cache.test.ts +96 -0
  227. package/src/__tests__/asset-registry.unit.test.ts +511 -0
  228. package/src/__tests__/asset-runtime-error-code-owner.test-d.ts +63 -0
  229. package/src/__tests__/catalog-replica.unit.test.ts +196 -0
  230. package/src/__tests__/catalog-source-v2.unit.test.ts +158 -0
  231. package/src/__tests__/catalog-source.unit.test.ts +126 -0
  232. package/src/__tests__/catalog-subscription-order.unit.test.ts +65 -0
  233. package/src/__tests__/catalog-subscription.unit.test.ts +28 -0
  234. package/src/__tests__/decode-image-bytes-pass-through.test.ts +34 -0
  235. package/src/__tests__/decode-image-bytes.browser.test.ts +102 -0
  236. package/src/__tests__/decode-image-bytes.test-d.ts +108 -0
  237. package/src/__tests__/decode-image-bytes.test.ts +90 -0
  238. package/src/__tests__/decode-image-mime-owner.test.ts +38 -0
  239. package/src/__tests__/dynamic-texture-store.unit.test.ts +115 -0
  240. package/src/__tests__/errors-asset.unit.test.ts +92 -0
  241. package/src/__tests__/inline-pack-loaders.unit.test.ts +548 -0
  242. package/src/__tests__/instantiate-context.unit.test.ts +65 -0
  243. package/src/__tests__/instantiate-publication-fence.unit.test.ts +158 -0
  244. package/src/__tests__/instantiate.unit.test.ts +684 -0
  245. package/src/__tests__/loader-input-contract.unit.test.ts +89 -0
  246. package/src/__tests__/loader-registry.unit.test.ts +101 -0
  247. package/src/__tests__/material-dependency-invalidation.unit.test.ts +14 -0
  248. package/src/__tests__/material-generation-cache.unit.test.ts +46 -0
  249. package/src/__tests__/material-load-consumer.test-d.ts +42 -0
  250. package/src/__tests__/material-ready.integration.test.ts +508 -0
  251. package/src/__tests__/material-stale-generation.unit.test.ts +147 -0
  252. package/src/__tests__/mesh-bin-morph-v3.test.ts +22 -0
  253. package/src/__tests__/mesh-bin.unit.test.ts +152 -0
  254. package/src/__tests__/mipmap-generator.unit.test.ts +202 -0
  255. package/src/__tests__/pack-artifact-transcode-model-owner.test.ts +32 -0
  256. package/src/__tests__/pack-basis-load.integration.test.ts +168 -0
  257. package/src/__tests__/payload-validate.unit.test.ts +285 -0
  258. package/src/__tests__/plugin.test.ts +55 -0
  259. package/src/__tests__/registry-concurrency.bench.test.ts +40 -0
  260. package/src/__tests__/registry-failure-retry.integration.test.ts +69 -0
  261. package/src/__tests__/registry-load-graph.integration.test.ts +246 -0
  262. package/src/__tests__/registry-load-state.unit.test.ts +35 -0
  263. package/src/__tests__/registry-package-cache.unit.test.ts +53 -0
  264. package/src/__tests__/registry-public-ready.unit.test.ts +38 -0
  265. package/src/__tests__/resolve-asset-handle.unit.test.ts +238 -0
  266. package/src/__tests__/scene-handle-fields.unit.test.ts +129 -0
  267. package/src/__tests__/scene-payload.unit.test.ts +151 -0
  268. package/src/__tests__/scene-publication-fence.test.ts +129 -0
  269. package/src/__tests__/scriptable-pack-public-surface.test-d.ts +27 -0
  270. package/src/__tests__/static-rig.integration.test.ts +8 -0
  271. package/src/__tests__/validate-material.unit.test.ts +359 -0
  272. package/src/__tests__/video-pack-loader.integration.test.ts +83 -0
  273. package/src/aabb.ts +107 -0
  274. package/src/asset-kind.ts +6 -0
  275. package/src/asset-registry.ts +2045 -0
  276. package/src/builtin-asset-registry.ts +164 -0
  277. package/src/catalog-source.ts +89 -0
  278. package/src/decode-image-bytes.ts +126 -0
  279. package/src/dynamic-texture-store.ts +234 -0
  280. package/src/errors/asset.ts +347 -0
  281. package/src/handles.ts +186 -0
  282. package/src/image-error.ts +45 -0
  283. package/src/index.ts +189 -0
  284. package/src/internal/artifact-cache.ts +65 -0
  285. package/src/internal/asset-graph.ts +420 -0
  286. package/src/internal/catalog-session.ts +345 -0
  287. package/src/internal/decoder-registry.ts +175 -0
  288. package/src/internal/immutable-payload.ts +20 -0
  289. package/src/internal/load-asset.ts +254 -0
  290. package/src/internal/pack-reader.ts +183 -0
  291. package/src/internal/validate-runtime-row.ts +51 -0
  292. package/src/internal.ts +6 -0
  293. package/src/loader-registry.ts +157 -0
  294. package/src/loaders/inline-pack.ts +837 -0
  295. package/src/loaders/mesh-bin.ts +304 -0
  296. package/src/loaders/pack-artifact.ts +665 -0
  297. package/src/material/dependency-graph.ts +46 -0
  298. package/src/material/generation-cache.ts +177 -0
  299. package/src/material/inspection.ts +46 -0
  300. package/src/material/loader.ts +326 -0
  301. package/src/material/runtime-shader.ts +133 -0
  302. package/src/mesh-bin.ts +5 -0
  303. package/src/mipmap-generator.ts +450 -0
  304. package/src/payload-validate.ts +573 -0
  305. package/src/plugin.ts +48 -0
  306. package/src/registry/artifact-io.ts +259 -0
  307. package/src/registry/asset-evidence.ts +51 -0
  308. package/src/registry/catalog-state.ts +409 -0
  309. package/src/registry/catalog.ts +369 -0
  310. package/src/registry/instantiate.ts +1056 -0
  311. package/src/registry/load-by-guid.ts +1657 -0
  312. package/src/registry/load-state.ts +115 -0
  313. package/src/registry/runtime-projection.ts +63 -0
  314. package/src/registry/scene-publication-fence.ts +256 -0
  315. package/src/registry/validate-material.ts +385 -0
  316. package/src/resolve-asset-handle.ts +147 -0
  317. package/src/resolve-tileset-runtime.ts +72 -0
  318. package/src/scene-handle-fields.ts +221 -0
  319. package/src/scene-payload.ts +207 -0
  320. package/src/wire-default-loaders.ts +79 -0
@@ -0,0 +1,129 @@
1
+ import type { AssetPublicationEnvelope } from '@forgeax/engine-types';
2
+ import { describe, expect, it } from 'vitest';
3
+ import {
4
+ compareScenePublicationFences,
5
+ createScenePublicationFence,
6
+ observeScenePublication,
7
+ parseScenePublicationFence,
8
+ type ScenePublicationFence,
9
+ scenePublicationFenceFromCatalog,
10
+ } from '../registry/scene-publication-fence.js';
11
+
12
+ function publication(generation: number): AssetPublicationEnvelope {
13
+ return {
14
+ schemaVersion: 'asset-publication/1',
15
+ sourcePath: 'assets/showcase.pack.ts',
16
+ sourceRevision: `source-${generation}`,
17
+ generation,
18
+ digest: `sha256:publication-${generation}`,
19
+ outputSetDigest: `sha256:outputs-${generation}`,
20
+ outputs: [
21
+ {
22
+ guid: '01890000-0000-7000-8000-111111111111',
23
+ sourceKey: 'scene/main',
24
+ kind: 'scene',
25
+ digest: `sha256:scene-${generation}`,
26
+ refs: [],
27
+ },
28
+ ],
29
+ receipt: {
30
+ schemaVersion: 'asset-publication-receipt/1',
31
+ sourcePath: 'assets/showcase.pack.ts',
32
+ sourceRevision: `source-${generation}`,
33
+ inputFingerprint: `sha256:receipt-${generation}`,
34
+ outputDigest: `sha256:publication-${generation}`,
35
+ outputSetDigest: `sha256:outputs-${generation}`,
36
+ externalEvidence: [],
37
+ },
38
+ externalEvidence: [],
39
+ };
40
+ }
41
+
42
+ describe('Scene publication fence', () => {
43
+ it('serializes one complete source publication tuple', () => {
44
+ const created = createScenePublicationFence(publication(4));
45
+ expect(created.ok).toBe(true);
46
+ if (!created.ok) return;
47
+ const parsed = parseScenePublicationFence(JSON.parse(JSON.stringify(created.value)));
48
+ expect(parsed).toEqual(created);
49
+ expect(created.value).toMatchObject<ScenePublicationFence>({
50
+ schemaVersion: 'scene-publication-fence/1',
51
+ sourcePath: 'assets/showcase.pack.ts',
52
+ sourceRevision: 'source-4',
53
+ publicationGeneration: 4,
54
+ outputDigest: 'sha256:publication-4',
55
+ outputSetDigest: 'sha256:outputs-4',
56
+ receiptIdentity: 'sha256:receipt-4',
57
+ });
58
+ });
59
+
60
+ it('rejects missing output and receipt or digest mismatches before observation', () => {
61
+ expect(createScenePublicationFence({ ...publication(1), outputs: [] })).toMatchObject({
62
+ ok: false,
63
+ error: { code: 'asset-generation-fence-mismatch', phase: 'publication' },
64
+ });
65
+ expect(
66
+ createScenePublicationFence({
67
+ ...publication(1),
68
+ receipt: { ...publication(1).receipt, outputDigest: 'sha256:wrong' },
69
+ }),
70
+ ).toMatchObject({
71
+ ok: false,
72
+ error: { code: 'asset-generation-fence-mismatch', phase: 'publication' },
73
+ });
74
+ });
75
+
76
+ it('fails closed for mixed generations and observation timeout while preserving LKG', async () => {
77
+ const first = createScenePublicationFence(publication(1));
78
+ const second = createScenePublicationFence(publication(2));
79
+ expect(first.ok && second.ok).toBe(true);
80
+ if (!first.ok || !second.ok) return;
81
+ expect(compareScenePublicationFences(first.value, second.value)).toMatchObject({
82
+ ok: false,
83
+ error: {
84
+ code: 'asset-generation-fence-mismatch',
85
+ phase: 'observation',
86
+ currentGeneration: 2,
87
+ },
88
+ });
89
+
90
+ const observed = await observeScenePublication({
91
+ publication: publication(2),
92
+ waitForOutput: async () => {
93
+ await new Promise((resolve) => setTimeout(resolve, 20));
94
+ },
95
+ timeoutMs: 1,
96
+ lastKnownGood: first.value,
97
+ });
98
+ expect(observed).toMatchObject({
99
+ ok: false,
100
+ error: {
101
+ code: 'asset-generation-fence-mismatch',
102
+ phase: 'observation',
103
+ lastKnownGood: { publicationGeneration: 1 },
104
+ recoveryActions: ['continue-last-known-good', 'retry-rebuild', 'fresh-reopen'],
105
+ },
106
+ });
107
+ });
108
+
109
+ it('requires every Catalog output row to carry the same publication tuple', () => {
110
+ const source = publication(7);
111
+ const entries = source.outputs.map((output) => ({
112
+ guid: output.guid,
113
+ kind: output.kind,
114
+ packageUrl: '/assets/showcase.pack.json',
115
+ sourcePath: source.sourcePath,
116
+ publication: source,
117
+ }));
118
+ const outputGuid = source.outputs[0]?.guid;
119
+ if (outputGuid === undefined) return;
120
+ expect(scenePublicationFenceFromCatalog(entries, outputGuid)).toMatchObject({
121
+ ok: true,
122
+ value: { publicationGeneration: 7 },
123
+ });
124
+ expect(scenePublicationFenceFromCatalog(entries.slice(0, 0), outputGuid)).toMatchObject({
125
+ ok: false,
126
+ error: { code: 'asset-generation-fence-mismatch', phase: 'catalog' },
127
+ });
128
+ });
129
+ });
@@ -0,0 +1,27 @@
1
+ import type {
2
+ AnimationGraph,
3
+ AssetRegistry,
4
+ AssetRegistryResolver,
5
+ AudioClipAsset,
6
+ ParticleEffectAsset,
7
+ RuntimeAssetRegistry,
8
+ TilesetAsset,
9
+ } from '@forgeax/engine-assets-runtime';
10
+ import { expectTypeOf, it } from 'vitest';
11
+
12
+ it('exports concrete loadByGuid payload types from the runtime entry point', () => {
13
+ expectTypeOf<AssetRegistry>().toHaveProperty('loadByGuid');
14
+ expectTypeOf<AnimationGraph['kind']>().toEqualTypeOf<'animation-graph'>();
15
+ expectTypeOf<TilesetAsset['kind']>().toEqualTypeOf<'tileset'>();
16
+ expectTypeOf<AudioClipAsset['mediaType']>().toMatchTypeOf<`audio/${string}`>();
17
+ expectTypeOf<ParticleEffectAsset['program']>().toMatchTypeOf<ParticleEffectAsset['program']>();
18
+ });
19
+
20
+ it('exports the five-action runtime registry and its resolver from the root entry point', () => {
21
+ expectTypeOf<RuntimeAssetRegistry>().toHaveProperty('installDecoder');
22
+ expectTypeOf<RuntimeAssetRegistry>().toHaveProperty('load');
23
+ expectTypeOf<RuntimeAssetRegistry>().toHaveProperty('snapshot');
24
+ expectTypeOf<RuntimeAssetRegistry>().toHaveProperty('subscribe');
25
+ expectTypeOf<AssetRegistryResolver>().toHaveProperty('lookup');
26
+ expectTypeOf<AssetRegistryResolver>().toHaveProperty('guidOf');
27
+ });
@@ -0,0 +1,8 @@
1
+ import { Skin } from '@forgeax/engine-skinning';
2
+ import { describe, expect, it } from 'vitest';
3
+
4
+ describe('static rig asset consumer', () => {
5
+ it('does not require animation to describe Skin', () => {
6
+ expect(Skin.name).toBe('Skin');
7
+ });
8
+ });
@@ -0,0 +1,359 @@
1
+ // @forgeax/engine-assets-runtime -- material-validation free-function coverage
2
+ // (fix issue #709). validateMaterialPasses / validateSpriteSlices /
3
+ // validateParamType / detectTileNeedsRepeatSampler / materialShaderTextureFieldNames.
4
+ //
5
+ // The free functions read only `registry.shaderRegistry` / `.metrics` /
6
+ // `.assetCatalog`, so a duck-typed stub standing in for AssetRegistry suffices
7
+ // (charter F2: test against the surface the code touches, not the whole class).
8
+
9
+ import {
10
+ type MaterialAsset,
11
+ type ParamSchemaEntry,
12
+ ParamSchemaProjectionOwner,
13
+ } from '@forgeax/engine-types';
14
+ import { describe, expect, it } from 'vitest';
15
+ import type { AssetRegistry } from '../asset-registry';
16
+ import {
17
+ detectTileNeedsRepeatSampler,
18
+ materialShaderTextureFieldNames,
19
+ validateMaterialCookIdentity,
20
+ validateMaterialPasses,
21
+ validateParamType,
22
+ validateSpriteSlices,
23
+ } from '../registry/validate-material';
24
+
25
+ interface StubShaders {
26
+ [shaderId: string]: readonly ParamSchemaEntry[];
27
+ }
28
+
29
+ function makeRegistry(
30
+ shaders: StubShaders,
31
+ opts: { metrics?: { increment(k: string): void }; catalog?: Map<string, unknown> } = {},
32
+ ): AssetRegistry {
33
+ const projectionOwner = new ParamSchemaProjectionOwner();
34
+ return {
35
+ shaderRegistry: {
36
+ findMaterialArtifact(id: string) {
37
+ const paramSchema = shaders[id];
38
+ const paramSchemaProjection =
39
+ paramSchema === undefined
40
+ ? undefined
41
+ : projectionOwner.admit({ ownerId: id, revision: 1, schema: paramSchema });
42
+ return paramSchemaProjection !== undefined
43
+ ? {
44
+ ok: true as const,
45
+ value: {
46
+ source: '',
47
+ paramSchema: paramSchemaProjection.schema,
48
+ paramSchemaProjection,
49
+ },
50
+ }
51
+ : { ok: false as const, error: new Error('not found') };
52
+ },
53
+ },
54
+ metrics: opts.metrics ?? null,
55
+ assetCatalog: opts.catalog ?? new Map(),
56
+ } as unknown as AssetRegistry;
57
+ }
58
+
59
+ function mat(over: Record<string, unknown>): MaterialAsset {
60
+ return { kind: 'material', ...over } as unknown as MaterialAsset;
61
+ }
62
+
63
+ describe('validateMaterialCookIdentity', () => {
64
+ const record = {
65
+ guid: 'mat-child',
66
+ receipt: {
67
+ identity: { layoutIdentity: 'sha256:root-layout' },
68
+ derivedInterface: { layoutIdentity: 'sha256:root-layout' },
69
+ },
70
+ } as never;
71
+
72
+ it('accepts an effective root identity and rejects a stale one', () => {
73
+ expect(
74
+ validateMaterialCookIdentity(record, {
75
+ guid: 'mat-parent',
76
+ layoutIdentity: 'sha256:root-layout',
77
+ }),
78
+ ).toBeNull();
79
+ expect(
80
+ validateMaterialCookIdentity(record, {
81
+ guid: 'mat-parent',
82
+ layoutIdentity: 'sha256:changed-layout',
83
+ }),
84
+ ).toMatchObject({
85
+ code: 'material-derived-interface-mismatch',
86
+ detail: { stage: 'extract', action: 'recook' },
87
+ });
88
+ });
89
+ });
90
+
91
+ describe('validateMaterialPasses', () => {
92
+ it('returns null when passes is undefined (inherits from parent)', () => {
93
+ expect(validateMaterialPasses(makeRegistry({}), mat({}))).toBeNull();
94
+ });
95
+
96
+ it('errors when passes is an explicit empty array', () => {
97
+ const e = validateMaterialPasses(makeRegistry({}), mat({ passes: [] }));
98
+ expect(e?.code).toBe('asset-invalid-value');
99
+ expect((e?.detail as { passCount: number }).passCount).toBe(0);
100
+ });
101
+
102
+ it('errors when a pass has no program module', () => {
103
+ const e = validateMaterialPasses(
104
+ makeRegistry({}),
105
+ mat({ passes: [{ name: 'main', program: { module: '' } }] }),
106
+ );
107
+ expect(e?.code).toBe('asset-invalid-value');
108
+ });
109
+
110
+ it('errors when a required (no-default) param is missing from values', () => {
111
+ const e = validateMaterialPasses(
112
+ makeRegistry({}),
113
+ mat({
114
+ passes: [{ name: 'm', program: { module: 'forgeax_material::standard' } }],
115
+ parameters: [{ name: 'roughness', type: 'f32' }],
116
+ }),
117
+ );
118
+ expect(e?.code).toBe('asset-invalid-value');
119
+ expect((e?.detail as { missingParams: string[] }).missingParams).toContain('roughness');
120
+ });
121
+
122
+ it('accepts when a required param is supplied with the right type', () => {
123
+ expect(
124
+ validateMaterialPasses(
125
+ makeRegistry({}),
126
+ mat({
127
+ passes: [{ name: 'm', program: { module: 'forgeax_material::standard' } }],
128
+ parameters: [{ name: 'roughness', type: 'f32' }],
129
+ values: { roughness: 0.5 },
130
+ }),
131
+ ),
132
+ ).toBeNull();
133
+ });
134
+
135
+ it('errors on a supplied param with a mismatched type', () => {
136
+ const e = validateMaterialPasses(
137
+ makeRegistry({}),
138
+ mat({
139
+ passes: [{ name: 'm', program: { module: 'forgeax_material::standard' } }],
140
+ parameters: [{ name: 'roughness', type: 'f32' }],
141
+ values: { roughness: 'no' },
142
+ }),
143
+ );
144
+ expect((e?.detail as { paramName: string }).paramName).toBe('roughness');
145
+ });
146
+
147
+ it('skips params that carry a default', () => {
148
+ expect(
149
+ validateMaterialPasses(
150
+ makeRegistry({}),
151
+ mat({
152
+ passes: [{ name: 'm', program: { module: 'forgeax_material::standard' } }],
153
+ parameters: [{ name: 'roughness', type: 'f32', default: 0.5 }],
154
+ }),
155
+ ),
156
+ ).toBeNull();
157
+ });
158
+
159
+ it('accepts absent and explicitly cleared optional params', () => {
160
+ const material = {
161
+ passes: [{ name: 'm', program: { module: 'forgeax_material::standard' } }],
162
+ parameters: [{ name: 'alphaCutoff', type: 'f32', optional: true }],
163
+ };
164
+ expect(validateMaterialPasses(makeRegistry({}), mat(material))).toBeNull();
165
+ expect(
166
+ validateMaterialPasses(makeRegistry({}), mat({ ...material, values: { alphaCutoff: null } })),
167
+ ).toBeNull();
168
+ });
169
+
170
+ it('still validates a supplied optional param', () => {
171
+ const e = validateMaterialPasses(
172
+ makeRegistry({}),
173
+ mat({
174
+ passes: [{ name: 'm', program: { module: 'forgeax_material::standard' } }],
175
+ parameters: [{ name: 'alphaCutoff', type: 'f32', optional: true }],
176
+ values: { alphaCutoff: 'no' },
177
+ }),
178
+ );
179
+ expect((e?.detail as { paramName: string }).paramName).toBe('alphaCutoff');
180
+ });
181
+ });
182
+
183
+ describe('validateParamType', () => {
184
+ const reg = makeRegistry({});
185
+ it('numeric scalars', () => {
186
+ expect(validateParamType(reg, 'x', 'f32', 1)).toBe(true);
187
+ expect(validateParamType(reg, 'x', 'u32', 'no')).toBe(false);
188
+ });
189
+ it('vector arities', () => {
190
+ expect(validateParamType(reg, 'x', 'vec2', [1, 2])).toBe(true);
191
+ expect(validateParamType(reg, 'x', 'vec3', [1, 2])).toBe(false);
192
+ expect(validateParamType(reg, 'x', 'vec4', [1, 2, 3, 4])).toBe(true);
193
+ });
194
+ it('color accepts length 3 or 4', () => {
195
+ expect(validateParamType(reg, 'x', 'color', [1, 2, 3])).toBe(true);
196
+ expect(validateParamType(reg, 'x', 'color', [1, 2, 3, 4])).toBe(true);
197
+ expect(validateParamType(reg, 'x', 'color', [1, 2])).toBe(false);
198
+ });
199
+ it('texture values accept compact GUIDs and structured records', () => {
200
+ expect(validateParamType(reg, 'x', 'texture', 'guid')).toBe(true);
201
+ expect(validateParamType(reg, 'x', 'texture', { texture: 'guid' })).toBe(true);
202
+ expect(validateParamType(reg, 'x', 'texture', 123)).toBe(false);
203
+ });
204
+ it('unknown type -> false', () => {
205
+ expect(validateParamType(reg, 'x', 'mat4', {})).toBe(false);
206
+ });
207
+ });
208
+
209
+ describe('validateSpriteSlices', () => {
210
+ const reg = makeRegistry({});
211
+ const spritePass = { name: 'main', program: { module: 'forgeax_material::sprite' } };
212
+
213
+ it('returns null for non-sprite shaders', () => {
214
+ expect(
215
+ validateSpriteSlices(
216
+ reg,
217
+ mat({ passes: [{ name: 'm', program: { module: 'forgeax::standard' } }] }),
218
+ ),
219
+ ).toBeNull();
220
+ });
221
+
222
+ it('returns null when slices is absent', () => {
223
+ expect(validateSpriteSlices(reg, mat({ passes: [spritePass], values: {} }))).toBeNull();
224
+ });
225
+
226
+ it('accepts a well-formed slices tuple', () => {
227
+ expect(
228
+ validateSpriteSlices(
229
+ reg,
230
+ mat({ passes: [spritePass], values: { slices: [0.1, 0.1, 0.1, 0.1] } }),
231
+ ),
232
+ ).toBeNull();
233
+ });
234
+
235
+ it('rejects a non-array / wrong-length / non-number slices', () => {
236
+ expect(
237
+ validateSpriteSlices(reg, mat({ passes: [spritePass], values: { slices: 'x' } }))?.code,
238
+ ).toBe('asset-invalid-value');
239
+ expect(
240
+ validateSpriteSlices(reg, mat({ passes: [spritePass], values: { slices: [0, 0, 0] } }))?.code,
241
+ ).toBe('asset-invalid-value');
242
+ expect(
243
+ validateSpriteSlices(reg, mat({ passes: [spritePass], values: { slices: [0, 0, 0, 'x'] } }))
244
+ ?.code,
245
+ ).toBe('asset-invalid-value');
246
+ });
247
+
248
+ it('rejects NaN, Infinity, and negative components', () => {
249
+ expect(
250
+ validateSpriteSlices(
251
+ reg,
252
+ mat({ passes: [spritePass], values: { slices: [Number.NaN, 0, 0, 0] } }),
253
+ ),
254
+ ).not.toBeNull();
255
+ expect(
256
+ validateSpriteSlices(
257
+ reg,
258
+ mat({ passes: [spritePass], values: { slices: [Number.POSITIVE_INFINITY, 0, 0, 0] } }),
259
+ ),
260
+ ).not.toBeNull();
261
+ expect(
262
+ validateSpriteSlices(reg, mat({ passes: [spritePass], values: { slices: [-0.1, 0, 0, 0] } })),
263
+ ).not.toBeNull();
264
+ });
265
+
266
+ it('rejects X-axis / Y-axis overlap against region', () => {
267
+ // default region z/w = 1; left+right = 1.2 >= 1
268
+ expect(
269
+ validateSpriteSlices(
270
+ reg,
271
+ mat({ passes: [spritePass], values: { slices: [0.6, 0, 0.6, 0] } }),
272
+ ),
273
+ ).not.toBeNull();
274
+ expect(
275
+ validateSpriteSlices(
276
+ reg,
277
+ mat({ passes: [spritePass], values: { slices: [0, 0.6, 0, 0.6] } }),
278
+ ),
279
+ ).not.toBeNull();
280
+ });
281
+ });
282
+
283
+ describe('detectTileNeedsRepeatSampler', () => {
284
+ const spritePass = { name: 'main', program: { module: 'forgeax_material::sprite' } };
285
+
286
+ it('no-ops when metrics is null', () => {
287
+ // makeRegistry defaults metrics to null; call must not throw.
288
+ expect(() =>
289
+ detectTileNeedsRepeatSampler(
290
+ makeRegistry({}),
291
+ mat({ passes: [spritePass], values: { sliceMode: 1, sampler: 'g' } }),
292
+ ),
293
+ ).not.toThrow();
294
+ });
295
+
296
+ it('increments the metric when a tile sampler is not repeat/repeat', () => {
297
+ const counts: string[] = [];
298
+ const catalog = new Map<string, unknown>([
299
+ [
300
+ 's-guid',
301
+ {
302
+ kind: 'sampler',
303
+ payload: { kind: 'sampler', addressModeU: 'clamp', addressModeV: 'repeat' },
304
+ },
305
+ ],
306
+ ]);
307
+ const reg = makeRegistry({}, { metrics: { increment: (k) => counts.push(k) }, catalog });
308
+ detectTileNeedsRepeatSampler(
309
+ reg,
310
+ mat({ passes: [spritePass], values: { sliceMode: 1, sampler: 'S-GUID' } }),
311
+ );
312
+ expect(counts).toContain('nineslice.tile-needs-repeat-sampler');
313
+ });
314
+
315
+ it('does not increment when the sampler is repeat/repeat', () => {
316
+ const counts: string[] = [];
317
+ const catalog = new Map<string, unknown>([
318
+ [
319
+ 's-guid',
320
+ {
321
+ kind: 'sampler',
322
+ payload: { kind: 'sampler', addressModeU: 'repeat', addressModeV: 'repeat' },
323
+ },
324
+ ],
325
+ ]);
326
+ const reg = makeRegistry({}, { metrics: { increment: (k) => counts.push(k) }, catalog });
327
+ detectTileNeedsRepeatSampler(
328
+ reg,
329
+ mat({ passes: [spritePass], values: { sliceMode: 1, sampler: 's-guid' } }),
330
+ );
331
+ expect(counts).toEqual([]);
332
+ });
333
+
334
+ it('no-ops for sliceMode !== 1', () => {
335
+ const counts: string[] = [];
336
+ const reg = makeRegistry({}, { metrics: { increment: (k) => counts.push(k) } });
337
+ detectTileNeedsRepeatSampler(reg, mat({ passes: [spritePass], values: { sliceMode: 0 } }));
338
+ expect(counts).toEqual([]);
339
+ });
340
+ });
341
+
342
+ describe('materialShaderTextureFieldNames', () => {
343
+ it('returns the texture field-name set derived from paramSchema', () => {
344
+ const reg = makeRegistry({
345
+ 'forgeax::x': [
346
+ { name: 'roughness', type: 'f32' },
347
+ { name: 'baseColorTexture', type: 'texture2d' },
348
+ ],
349
+ });
350
+ const names = materialShaderTextureFieldNames(reg, 'forgeax::x');
351
+ expect(names).toBeDefined();
352
+ expect(names?.has('baseColorTexture')).toBe(true);
353
+ expect(names?.has('roughness')).toBe(false);
354
+ });
355
+
356
+ it('returns undefined for an unregistered shader', () => {
357
+ expect(materialShaderTextureFieldNames(makeRegistry({}), 'forgeax::nope')).toBeUndefined();
358
+ });
359
+ });
@@ -0,0 +1,83 @@
1
+ // M59: exercise the Pack v2 video loader through AssetRegistry's default
2
+ // registry, including failure cleanup and same-GUID invalidate/reload.
3
+
4
+ import { describe, expect, it, vi } from 'vitest';
5
+ import { AssetRegistry } from '../asset-registry';
6
+
7
+ const GUID = 'f1b3d000-1111-4aaa-9eee-aa1111112222';
8
+
9
+ describe('Pack v2 video loader recovery', () => {
10
+ it('fails before publication, then retries the same GUID with a repaired descriptor', async () => {
11
+ const registry = new AssetRegistry({} as never);
12
+ expect(registry.loaders.get('video')).toBeDefined();
13
+ registry.configurePackIndex('/pack-index.json');
14
+
15
+ let repaired = false;
16
+ const fetchCalls: string[] = [];
17
+ const originalFetch = globalThis.fetch;
18
+ vi.stubGlobal('fetch', async (input: RequestInfo | URL) => {
19
+ const url = String(input);
20
+ fetchCalls.push(url);
21
+ if (url.endsWith('/pack-index.json')) {
22
+ return new Response(
23
+ JSON.stringify([
24
+ {
25
+ guid: GUID,
26
+ packageUrl: '/video.pack.json',
27
+ kind: 'video',
28
+ sourcePath: 'cutscene.webm',
29
+ },
30
+ ]),
31
+ );
32
+ }
33
+ if (!url.endsWith('/video.pack.json')) {
34
+ throw new Error(`unexpected media fetch: ${url}`);
35
+ }
36
+ return new Response(
37
+ JSON.stringify({
38
+ schemaVersion: '2.0.0',
39
+ kind: 'internal-text-package',
40
+ assets: [
41
+ {
42
+ guid: GUID,
43
+ kind: 'video',
44
+ payload: {
45
+ url: repaired ? '/cutscene.webm' : 'javascript:alert(1)',
46
+ },
47
+ refs: [],
48
+ artifacts: {},
49
+ },
50
+ ],
51
+ }),
52
+ );
53
+ });
54
+
55
+ try {
56
+ const first = await registry.loadByGuid(registry.parseGuid(GUID));
57
+ expect(first.ok).toBe(false);
58
+ if (first.ok) return;
59
+ expect(first.error.code).toBe('asset-parse-failed');
60
+ expect(registry.lookup(GUID)).toBeUndefined();
61
+ expect(registry.assetCatalog.has(GUID)).toBe(false);
62
+ expect(fetchCalls).toEqual(['/pack-index.json', '/video.pack.json']);
63
+
64
+ repaired = true;
65
+ registry.invalidate(GUID);
66
+ const retried = await registry.loadByGuid(registry.parseGuid(GUID));
67
+ expect(retried).toEqual({ ok: true, value: { kind: 'video', url: '/cutscene.webm' } });
68
+ expect(registry.lookup(GUID)).toEqual({ kind: 'video', url: '/cutscene.webm' });
69
+ expect(registry.assetCatalog.get(GUID)?.payload).toEqual({
70
+ kind: 'video',
71
+ url: '/cutscene.webm',
72
+ });
73
+ expect(fetchCalls).toEqual([
74
+ '/pack-index.json',
75
+ '/video.pack.json',
76
+ '/pack-index.json',
77
+ '/video.pack.json',
78
+ ]);
79
+ } finally {
80
+ globalThis.fetch = originalFetch;
81
+ }
82
+ });
83
+ });