@automovie/ingest 0.3.4 → 0.4.0

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 (225) hide show
  1. package/README.md +9 -29
  2. package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.d.ts +4 -1
  3. package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.js +4 -1
  4. package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.js.map +1 -1
  5. package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.d.ts +4 -1
  6. package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.js +4 -1
  7. package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.js.map +1 -1
  8. package/lib/adoptAutoMovieExternalMotion.d.ts +21 -11
  9. package/lib/adoptAutoMovieExternalMotion.js +26 -12
  10. package/lib/adoptAutoMovieExternalMotion.js.map +1 -1
  11. package/lib/audio/admitProductionTtsReceipt.d.ts +25 -0
  12. package/lib/audio/admitProductionTtsReceipt.js +166 -0
  13. package/lib/audio/admitProductionTtsReceipt.js.map +1 -0
  14. package/lib/audio/decodeProductionAudioAsset.d.ts +42 -14
  15. package/lib/audio/decodeProductionAudioAsset.js +53 -30
  16. package/lib/audio/decodeProductionAudioAsset.js.map +1 -1
  17. package/lib/audio/index.d.ts +1 -0
  18. package/lib/audio/index.js +1 -0
  19. package/lib/audio/index.js.map +1 -1
  20. package/lib/audio/resampleProductionAudio.d.ts +22 -0
  21. package/lib/audio/resampleProductionAudio.js +103 -0
  22. package/lib/audio/resampleProductionAudio.js.map +1 -0
  23. package/lib/decodeAutoMoviePpmImage.d.ts +10 -18
  24. package/lib/decodeAutoMoviePpmImage.js +10 -18
  25. package/lib/decodeAutoMoviePpmImage.js.map +1 -1
  26. package/lib/font/TrueTypeByteReader.d.ts +34 -0
  27. package/lib/font/TrueTypeByteReader.js +67 -0
  28. package/lib/font/TrueTypeByteReader.js.map +1 -0
  29. package/lib/font/decodeAutoMovieTrueTypeFont.d.ts +31 -0
  30. package/lib/font/decodeAutoMovieTrueTypeFont.js +168 -0
  31. package/lib/font/decodeAutoMovieTrueTypeFont.js.map +1 -0
  32. package/lib/font/index.d.ts +1 -0
  33. package/lib/font/index.js +18 -0
  34. package/lib/font/index.js.map +1 -0
  35. package/lib/font/readTrueTypeCharacterMap.d.ts +23 -0
  36. package/lib/font/readTrueTypeCharacterMap.js +98 -0
  37. package/lib/font/readTrueTypeCharacterMap.js.map +1 -0
  38. package/lib/font/readTrueTypeGlyphOutline.d.ts +45 -0
  39. package/lib/font/readTrueTypeGlyphOutline.js +275 -0
  40. package/lib/font/readTrueTypeGlyphOutline.js.map +1 -0
  41. package/lib/font/readTrueTypeKerning.d.ts +19 -0
  42. package/lib/font/readTrueTypeKerning.js +63 -0
  43. package/lib/font/readTrueTypeKerning.js.map +1 -0
  44. package/lib/font/readTrueTypeNames.d.ts +20 -0
  45. package/lib/font/readTrueTypeNames.js +75 -0
  46. package/lib/font/readTrueTypeNames.js.map +1 -0
  47. package/lib/humanoidSkeleton.d.ts +28 -15
  48. package/lib/humanoidSkeleton.js +28 -15
  49. package/lib/humanoidSkeleton.js.map +1 -1
  50. package/lib/index.d.ts +1 -0
  51. package/lib/index.js +1 -0
  52. package/lib/index.js.map +1 -1
  53. package/lib/ingestDocument.d.ts +25 -12
  54. package/lib/ingestDocument.js +25 -12
  55. package/lib/ingestDocument.js.map +1 -1
  56. package/lib/inspectAutoMovieExternalModelBytes.d.ts +24 -12
  57. package/lib/inspectAutoMovieExternalModelBytes.js +24 -12
  58. package/lib/inspectAutoMovieExternalModelBytes.js.map +1 -1
  59. package/lib/internal/IAccessorSource.d.ts +11 -8
  60. package/lib/internal/IExternalModelAccessorReader.d.ts +1 -8
  61. package/lib/internal/IHumanoidSlot.d.ts +9 -10
  62. package/lib/internal/IParsedContainer.d.ts +10 -8
  63. package/lib/internal/SHAPE_COMPONENTS.d.ts +4 -1
  64. package/lib/internal/SHAPE_COMPONENTS.js +4 -1
  65. package/lib/internal/SHAPE_COMPONENTS.js.map +1 -1
  66. package/lib/internal/accessorElementByteLength.d.ts +1 -11
  67. package/lib/internal/accessorElementByteLength.js +1 -11
  68. package/lib/internal/accessorElementByteLength.js.map +1 -1
  69. package/lib/internal/accessorReader.d.ts +5 -9
  70. package/lib/internal/accessorReader.js +5 -9
  71. package/lib/internal/accessorReader.js.map +1 -1
  72. package/lib/internal/accessorValues.d.ts +10 -10
  73. package/lib/internal/accessorValues.js +10 -10
  74. package/lib/internal/collectExternalResources.d.ts +1 -11
  75. package/lib/internal/collectExternalResources.js +1 -11
  76. package/lib/internal/collectExternalResources.js.map +1 -1
  77. package/lib/internal/compareCodeUnits.d.ts +1 -11
  78. package/lib/internal/compareCodeUnits.js +1 -11
  79. package/lib/internal/compareCodeUnits.js.map +1 -1
  80. package/lib/internal/composeLocalTransform.d.ts +13 -10
  81. package/lib/internal/composeLocalTransform.js +13 -10
  82. package/lib/internal/composeLocalTransform.js.map +1 -1
  83. package/lib/internal/decodeDataUri.d.ts +4 -9
  84. package/lib/internal/decodeDataUri.js +4 -9
  85. package/lib/internal/decodeDataUri.js.map +1 -1
  86. package/lib/internal/decodeGlb.d.ts +1 -11
  87. package/lib/internal/decodeGlb.js +1 -11
  88. package/lib/internal/decodeGlb.js.map +1 -1
  89. package/lib/internal/decodeJson.d.ts +1 -11
  90. package/lib/internal/decodeJson.js +10 -12
  91. package/lib/internal/decodeJson.js.map +1 -1
  92. package/lib/internal/fileExtension.d.ts +2 -9
  93. package/lib/internal/fileExtension.js +2 -9
  94. package/lib/internal/fileExtension.js.map +1 -1
  95. package/lib/internal/finiteTuple.d.ts +4 -9
  96. package/lib/internal/finiteTuple.js +4 -9
  97. package/lib/internal/finiteTuple.js.map +1 -1
  98. package/lib/internal/gltfHumanoidBones.d.ts +5 -9
  99. package/lib/internal/gltfHumanoidBones.js +5 -9
  100. package/lib/internal/gltfHumanoidBones.js.map +1 -1
  101. package/lib/internal/humanoidBoneOfName.d.ts +7 -9
  102. package/lib/internal/humanoidBoneOfName.js +7 -9
  103. package/lib/internal/humanoidBoneOfName.js.map +1 -1
  104. package/lib/internal/inspectExternalModelHierarchy.d.ts +1 -11
  105. package/lib/internal/inspectExternalModelHierarchy.js +1 -11
  106. package/lib/internal/inspectExternalModelHierarchy.js.map +1 -1
  107. package/lib/internal/inspectExternalMotion.d.ts +8 -9
  108. package/lib/internal/inspectExternalMotion.js +8 -9
  109. package/lib/internal/inspectExternalMotion.js.map +1 -1
  110. package/lib/internal/inspectExternalMotionNodes.d.ts +6 -9
  111. package/lib/internal/inspectExternalMotionNodes.js +6 -9
  112. package/lib/internal/inspectExternalMotionNodes.js.map +1 -1
  113. package/lib/internal/integerIndex.d.ts +1 -11
  114. package/lib/internal/integerIndex.js +1 -11
  115. package/lib/internal/integerIndex.js.map +1 -1
  116. package/lib/internal/integerIndices.d.ts +1 -11
  117. package/lib/internal/integerIndices.js +1 -11
  118. package/lib/internal/integerIndices.js.map +1 -1
  119. package/lib/internal/nonNegativeInteger.d.ts +1 -11
  120. package/lib/internal/nonNegativeInteger.js +1 -11
  121. package/lib/internal/nonNegativeInteger.js.map +1 -1
  122. package/lib/internal/object.d.ts +1 -11
  123. package/lib/internal/object.js +1 -11
  124. package/lib/internal/object.js.map +1 -1
  125. package/lib/internal/optionalArray.d.ts +1 -11
  126. package/lib/internal/optionalArray.js +1 -11
  127. package/lib/internal/optionalArray.js.map +1 -1
  128. package/lib/internal/optionalObject.d.ts +1 -11
  129. package/lib/internal/optionalObject.js +1 -11
  130. package/lib/internal/optionalObject.js.map +1 -1
  131. package/lib/internal/optionalStringArray.d.ts +1 -11
  132. package/lib/internal/optionalStringArray.js +1 -11
  133. package/lib/internal/optionalStringArray.js.map +1 -1
  134. package/lib/internal/positiveInteger.d.ts +1 -11
  135. package/lib/internal/positiveInteger.js +1 -11
  136. package/lib/internal/positiveInteger.js.map +1 -1
  137. package/lib/internal/readMotionAccessor.d.ts +5 -9
  138. package/lib/internal/readMotionAccessor.js +5 -9
  139. package/lib/internal/readMotionAccessor.js.map +1 -1
  140. package/lib/internal/requiredArray.d.ts +1 -11
  141. package/lib/internal/requiredArray.js +1 -11
  142. package/lib/internal/requiredArray.js.map +1 -1
  143. package/lib/internal/uniqueStrings.d.ts +1 -11
  144. package/lib/internal/uniqueStrings.js +1 -11
  145. package/lib/internal/uniqueStrings.js.map +1 -1
  146. package/lib/internal/validNodeIndex.d.ts +1 -11
  147. package/lib/internal/validNodeIndex.js +1 -11
  148. package/lib/internal/validNodeIndex.js.map +1 -1
  149. package/lib/internal/validateAccessorRange.d.ts +6 -9
  150. package/lib/internal/validateAccessorRange.js +6 -9
  151. package/lib/internal/validateAccessorRange.js.map +1 -1
  152. package/lib/internal/validateHumanoidSkinning.d.ts +8 -10
  153. package/lib/internal/validateHumanoidSkinning.js +8 -10
  154. package/lib/internal/validateHumanoidSkinning.js.map +1 -1
  155. package/lib/internal/validatePayloadClosure.d.ts +8 -9
  156. package/lib/internal/validatePayloadClosure.js +8 -9
  157. package/lib/internal/validatePayloadClosure.js.map +1 -1
  158. package/lib/internal/validateSparseAccessor.d.ts +6 -9
  159. package/lib/internal/validateSparseAccessor.js +6 -9
  160. package/lib/internal/validateSparseAccessor.js.map +1 -1
  161. package/lib/internal/vrmHumanoidBones.d.ts +7 -9
  162. package/lib/internal/vrmHumanoidBones.js +12 -10
  163. package/lib/internal/vrmHumanoidBones.js.map +1 -1
  164. package/lib/isAutoMovieExternalModelIngestProfile.d.ts +4 -10
  165. package/lib/isAutoMovieExternalModelIngestProfile.js +4 -10
  166. package/lib/isAutoMovieExternalModelIngestProfile.js.map +1 -1
  167. package/package.json +7 -7
  168. package/src/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.ts +4 -1
  169. package/src/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.ts +4 -1
  170. package/src/adoptAutoMovieExternalMotion.ts +26 -12
  171. package/src/audio/admitProductionTtsReceipt.ts +262 -0
  172. package/src/audio/decodeProductionAudioAsset.ts +54 -39
  173. package/src/audio/index.ts +1 -0
  174. package/src/audio/resampleProductionAudio.ts +114 -0
  175. package/src/decodeAutoMoviePpmImage.ts +10 -18
  176. package/src/font/TrueTypeByteReader.ts +80 -0
  177. package/src/font/decodeAutoMovieTrueTypeFont.ts +217 -0
  178. package/src/font/index.ts +1 -0
  179. package/src/font/readTrueTypeCharacterMap.ts +115 -0
  180. package/src/font/readTrueTypeGlyphOutline.ts +375 -0
  181. package/src/font/readTrueTypeKerning.ts +73 -0
  182. package/src/font/readTrueTypeNames.ts +74 -0
  183. package/src/humanoidSkeleton.ts +28 -15
  184. package/src/index.ts +1 -0
  185. package/src/ingestDocument.ts +25 -12
  186. package/src/inspectAutoMovieExternalModelBytes.ts +24 -12
  187. package/src/internal/IAccessorSource.ts +11 -8
  188. package/src/internal/IExternalModelAccessorReader.ts +1 -8
  189. package/src/internal/IHumanoidSlot.ts +9 -10
  190. package/src/internal/IParsedContainer.ts +10 -8
  191. package/src/internal/SHAPE_COMPONENTS.ts +4 -1
  192. package/src/internal/accessorElementByteLength.ts +1 -11
  193. package/src/internal/accessorReader.ts +5 -9
  194. package/src/internal/accessorValues.ts +10 -10
  195. package/src/internal/collectExternalResources.ts +1 -11
  196. package/src/internal/compareCodeUnits.ts +1 -11
  197. package/src/internal/composeLocalTransform.ts +13 -10
  198. package/src/internal/decodeDataUri.ts +4 -9
  199. package/src/internal/decodeGlb.ts +1 -11
  200. package/src/internal/decodeJson.ts +10 -12
  201. package/src/internal/fileExtension.ts +2 -9
  202. package/src/internal/finiteTuple.ts +4 -9
  203. package/src/internal/gltfHumanoidBones.ts +5 -9
  204. package/src/internal/humanoidBoneOfName.ts +7 -9
  205. package/src/internal/inspectExternalModelHierarchy.ts +1 -11
  206. package/src/internal/inspectExternalMotion.ts +8 -9
  207. package/src/internal/inspectExternalMotionNodes.ts +6 -9
  208. package/src/internal/integerIndex.ts +1 -11
  209. package/src/internal/integerIndices.ts +1 -11
  210. package/src/internal/nonNegativeInteger.ts +1 -11
  211. package/src/internal/object.ts +1 -11
  212. package/src/internal/optionalArray.ts +1 -11
  213. package/src/internal/optionalObject.ts +1 -11
  214. package/src/internal/optionalStringArray.ts +1 -11
  215. package/src/internal/positiveInteger.ts +1 -11
  216. package/src/internal/readMotionAccessor.ts +5 -9
  217. package/src/internal/requiredArray.ts +1 -11
  218. package/src/internal/uniqueStrings.ts +1 -11
  219. package/src/internal/validNodeIndex.ts +1 -11
  220. package/src/internal/validateAccessorRange.ts +6 -9
  221. package/src/internal/validateHumanoidSkinning.ts +8 -10
  222. package/src/internal/validatePayloadClosure.ts +8 -9
  223. package/src/internal/validateSparseAccessor.ts +6 -9
  224. package/src/internal/vrmHumanoidBones.ts +12 -10
  225. package/src/isAutoMovieExternalModelIngestProfile.ts +4 -10
@@ -1,17 +1,7 @@
1
1
  import { integerIndex } from "./integerIndex";
2
2
  import { requiredArray } from "./requiredArray";
3
3
 
4
- /**
5
- * Validate every index in an optional glTF reference array.
6
- *
7
- * @evidence contracts/development/implementation.md#principled-implementation Undefined allows omitted references; a supplied array delegates each element's safe in-range admission with an indexed path.
8
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Array shape belongs to requiredArray and each index predicate to integerIndex, leaving this owner only enumeration.
9
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Malformed references are neither skipped nor coerced, so the first failing index remains observable.
10
- * @evidence contracts/development/common.md#meaningful-documentation Comments describe optional-array meaning, indexed failures and the predeclared inventory length.
11
- * @evidence contracts/development/implementation.md#efficient-algorithms An N-reference array costs O(N) with no new result array and constant work per index.
12
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each reference is checked once using the shared single-index admission rule.
13
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The enumeration borrows its array for the call and retains no graph or payload resource.
14
- */
4
+ /** Validate every index in an optional glTF reference array. */
15
5
  export const integerIndices: (
16
6
  value: unknown,
17
7
  length: number,
@@ -1,14 +1,4 @@
1
- /**
2
- * Require a safe nonnegative glTF byte offset.
3
- *
4
- * @evidence contracts/development/implementation.md#principled-implementation Number type, safe-integer identity and nonnegative sign protect subsequent declared-range arithmetic.
5
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One shared scalar rule serves buffer/accessor offsets without embedding range ownership.
6
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Fractions, negative offsets and unsafe integers throw rather than being truncated or clamped.
7
- * @evidence contracts/development/common.md#meaningful-documentation Prose states zero allowance, integer precision requirement, path diagnostic and unchanged input.
8
- * @evidence contracts/development/implementation.md#efficient-algorithms Three scalar checks require constant time without payload allocation or byte traversal.
9
- * @evidence contracts/development/implementation.md#reuse-equivalent-work All offset owners reuse this gate; final offset-plus-length bounds remain with their range validators.
10
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources No input record or offset cache survives this pure admission call.
11
- */
1
+ /** Require a safe nonnegative glTF byte offset. */
12
2
  export const nonNegativeInteger: (value: unknown, path: string) => void = (
13
3
  value: unknown,
14
4
  path: string,
@@ -1,14 +1,4 @@
1
- /**
2
- * Require a non-null non-array JSON record at its owning path.
3
- *
4
- * @evidence contracts/development/implementation.md#principled-implementation Runtime type and null/array exclusions establish an object shape before fields are read.
5
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One shared JSON record gate keeps identical error semantics across structural, payload and profile consumers.
6
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No value is cast into a usable record until the object predicate succeeds, and malformed inputs are not repaired.
7
- * @evidence contracts/development/common.md#meaningful-documentation The comment identifies accepted shape, path-named failure and returned borrowed identity.
8
- * @evidence contracts/development/implementation.md#efficient-algorithms Object shape admission uses constant-time predicates rather than copying or traversing properties.
9
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Every optional-object path delegates this same gate for present values.
10
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The helper returns the existing object and retains no metadata, payload or resource state.
11
- */
1
+ /** Require a non-null non-array JSON record at its owning path. */
12
2
  export const object: (
13
3
  value: unknown,
14
4
  path: string,
@@ -1,16 +1,6 @@
1
1
  import { requiredArray } from "./requiredArray";
2
2
 
3
- /**
4
- * Read an absent optional JSON array as an empty inventory.
5
- *
6
- * @evidence contracts/development/implementation.md#principled-implementation Undefined alone produces an empty array; supplied values must pass the common Array.isArray gate.
7
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The wrapper owns omission while requiredArray owns shape admission and named-path diagnostics.
8
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Null, strings and array-like objects are refused rather than being treated as missing inventories.
9
- * @evidence contracts/development/common.md#meaningful-documentation Prose identifies the undefined case, unchanged supplied arrays and malformed-value refusal.
10
- * @evidence contracts/development/implementation.md#efficient-algorithms One omission check and constant-time array identity test run without scanning elements.
11
- * @evidence contracts/development/implementation.md#reuse-equivalent-work The same required-array operation is reused for every present optional inventory.
12
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only omitted input creates a new empty array; valid supplied arrays remain borrowed and unretained.
13
- */
3
+ /** Read an absent optional JSON array as an empty inventory. */
14
4
  export const optionalArray: (value: unknown, path: string) => unknown[] = (
15
5
  value: unknown,
16
6
  path: string,
@@ -1,16 +1,6 @@
1
1
  import { object } from "./object";
2
2
 
3
- /**
4
- * Read an absent optional JSON object as an empty record.
5
- *
6
- * @evidence contracts/development/implementation.md#principled-implementation Undefined alone means omitted; a supplied value must pass the shared non-null non-array object gate.
7
- * @evidence contracts/development/implementation.md#clear-and-simple-structure This wrapper owns omission semantics while object identity and path diagnostics stay in the required-object helper.
8
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Null or arrays do not silently become empty optional objects, preserving malformed input distinctions.
9
- * @evidence contracts/development/common.md#meaningful-documentation Comments state undefined-only omission and borrowed identity for supplied valid records.
10
- * @evidence contracts/development/implementation.md#efficient-algorithms One omission test and at most one object gate require constant time without property scans.
11
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Required and optional records share the same object admission predicate instead of separate coercion logic.
12
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Omission allocates one empty record; supplied records are borrowed with no retained handle or cache.
13
- */
3
+ /** Read an absent optional JSON object as an empty record. */
14
4
  export const optionalObject: (
15
5
  value: unknown,
16
6
  path: string,
@@ -1,16 +1,6 @@
1
1
  import { optionalArray } from "./optionalArray";
2
2
 
3
- /**
4
- * Read an omitted or nonblank-string glTF extension inventory.
5
- *
6
- * @evidence contracts/development/implementation.md#principled-implementation Omission produces an empty array; supplied arrays must contain only nonblank strings with path/index diagnostics.
7
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Optional-array identity is delegated and this owner adds extension-name element admission.
8
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Names are not trimmed or case-folded, preserving exact identifiers after nonblank validation.
9
- * @evidence contracts/development/common.md#meaningful-documentation The description explains omission, exact spelling preservation and indexed error paths.
10
- * @evidence contracts/development/implementation.md#efficient-algorithms Cost is linear in element count plus trim scans of string lengths, with one returned array.
11
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each name is checked once for this inventory; exact duplicate removal belongs to the downstream canonical inventory.
12
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only the returned string array survives; original arrays and validation metadata are not retained.
13
- */
3
+ /** Read an omitted or nonblank-string glTF extension inventory. */
14
4
  export const optionalStringArray: (value: unknown, path: string) => string[] = (
15
5
  value: unknown,
16
6
  path: string,
@@ -1,14 +1,4 @@
1
- /**
2
- * Require a positive safe-integer glTF count or declared byte length.
3
- *
4
- * @evidence contracts/development/implementation.md#principled-implementation Type, safe-integer and strict-positive checks reject nonnumeric, fractional, zero and unsafe values before range arithmetic.
5
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The scalar gate is shared by buffer lengths, view lengths and accessor counts.
6
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A count is not rounded, clamped or silently replaced with a default value.
7
- * @evidence contracts/development/common.md#meaningful-documentation The comment identifies safe-integer positivity, named-path errors and unchanged caller input.
8
- * @evidence contracts/development/implementation.md#efficient-algorithms Three scalar predicates require constant time without metadata traversal or allocation.
9
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Repeated schema owners use the same positive-count predicate; no value admission cache is retained.
10
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The predicate retains no metadata and allocates only an error when refusing a value.
11
- */
1
+ /** Require a positive safe-integer glTF count or declared byte length. */
12
2
  export const positiveInteger: (value: unknown, path: string) => void = (
13
3
  value: unknown,
14
4
  path: string,
@@ -7,15 +7,11 @@ import { object } from "./object";
7
7
  /**
8
8
  * Read a finite non-sparse FLOAT accessor into caller-owned motion values.
9
9
  *
10
- * The source inventories and byte ranges are already admitted. The requested SCALAR, VEC3 or VEC4 shape must match an accessor with a buffer view, FLOAT components and no sparse overrides. Every component is copied in element order and checked finite; a mismatch or non-finite value throws with the supplied path.
11
- *
12
- * @evidence contracts/development/implementation.md#principled-implementation Shape and FLOAT storage are checked before stride-aware component reads; every copied numeric value must be finite.
13
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Motion-specific shape admission stays here while shared reader code owns buffer view, stride and little-endian decoding.
14
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Sparse or normalized integer motion data is not coerced into the profile's exact FLOAT interpretation.
15
- * @evidence contracts/development/common.md#meaningful-documentation Comments state source admission premises, permitted shapes, finite-value refusal and flat element/component order.
16
- * @evidence contracts/development/implementation.md#efficient-algorithms Count times shape width drives time and output space; one reader and DataView serve the entire accessor copy.
17
- * @evidence contracts/development/implementation.md#reuse-equivalent-work The inspector caches this complete decoded accessor by index and expected shape within one immutable input revision.
18
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The output array belongs to its caller; the reader's borrowed payload reference ends when decoding completes.
10
+ * The source inventories and byte ranges are already admitted. The requested
11
+ * SCALAR, VEC3 or VEC4 shape must match an accessor with a buffer view, FLOAT
12
+ * components and no sparse overrides. Every component is copied in element
13
+ * order and checked finite; a mismatch or non-finite value throws with the
14
+ * supplied path.
19
15
  */
20
16
  export const readMotionAccessor: (
21
17
  source: IAccessorSource,
@@ -1,14 +1,4 @@
1
- /**
2
- * Require an actual JSON array at a named external-document path.
3
- *
4
- * @evidence contracts/development/implementation.md#principled-implementation Array.isArray admits only array values; rejected inputs report their owning JSON path.
5
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One shape gate centralizes array identity for structural, motion and skin inspection.
6
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Objects, null and array-looking values are refused rather than coerced into synthetic inventories.
7
- * @evidence contracts/development/common.md#meaningful-documentation Prose states input identity, path-named failure and that admitted arrays are borrowed unchanged.
8
- * @evidence contracts/development/implementation.md#efficient-algorithms One Array.isArray check is constant-time without scanning or copying elements.
9
- * @evidence contracts/development/implementation.md#reuse-equivalent-work All optional-array handling delegates this same identity check when a value is present.
10
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The helper allocates no collection and returns the caller's existing array reference.
11
- */
1
+ /** Require an actual JSON array at a named external-document path. */
12
2
  export const requiredArray: (value: unknown, path: string) => unknown[] = (
13
3
  value: unknown,
14
4
  path: string,
@@ -1,16 +1,6 @@
1
1
  import { compareCodeUnits } from "./compareCodeUnits";
2
2
 
3
- /**
4
- * Return distinct strings in deterministic JavaScript code-unit order.
5
- *
6
- * @evidence contracts/development/implementation.md#principled-implementation A Set preserves exact string equality before the shared comparator imposes canonical ordering.
7
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Deduplication and ordering form one inventory operation used by the external-extension report.
8
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Case, whitespace and Unicode normalization are preserved rather than merging near-match extension identities.
9
- * @evidence contracts/development/common.md#meaningful-documentation The description states exact equality, code-unit ordering and caller ownership of the result array.
10
- * @evidence contracts/development/implementation.md#efficient-algorithms N inputs cause N expected Set operations over exact strings; U unique values need O(U log U) comparisons, each scanning the compared shared prefix, plus text-dependent string identity/hash work and O(U) collection space.
11
- * @evidence contracts/development/implementation.md#reuse-equivalent-work A single Set performs deduplication before sorting; mutable input arrays prevent safe retained identity caching.
12
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources One temporary Set and returned U-element array are allocated; no input collection is retained after return.
13
- */
3
+ /** Return distinct strings in deterministic JavaScript code-unit order. */
14
4
  export const uniqueStrings: (values: string[]) => string[] = (
15
5
  values: string[],
16
6
  ): string[] => [...new Set<string>(values)].sort(compareCodeUnits);
@@ -1,14 +1,4 @@
1
- /**
2
- * Recognize a safe integer inside a zero-based inventory.
3
- *
4
- * @evidence contracts/development/implementation.md#principled-implementation Number type, safe-integer identity and half-open bounds determine resolvable node or array references.
5
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The boolean predicate separates recognition from integerIndex's field-specific throwing behavior.
6
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Nonnumeric, negative, fractional and unsafe values remain false without coercion or fallback.
7
- * @evidence contracts/development/common.md#meaningful-documentation Prose states accepted bounds, safe precision and the nonthrowing recognition role.
8
- * @evidence contracts/development/implementation.md#efficient-algorithms Four scalar predicates cost constant time independent of inventory size.
9
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Throwing index admission and VRM mapping reuse the same recognition semantics.
10
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The predicate retains no inventory references and acquires no resource.
11
- */
1
+ /** Recognize a safe integer inside a zero-based inventory. */
12
2
  export const validNodeIndex: (value: unknown, length: number) => boolean = (
13
3
  value: unknown,
14
4
  length: number,
@@ -4,15 +4,12 @@ import { object } from "./object";
4
4
  /**
5
5
  * Admit one accessor's dense byte extent using its component shape and stride.
6
6
  *
7
- * The caller has admitted component type, shape, positive count, nonnegative offset and referenced view. Dense storage requires offset + (count - 1) * stride + paddedElementBytes to fit the view and stride to cover one element. Missing dense storage is accepted only when a sparse declaration exists, whose own gate checks its ranges; this gate does not check component alignment or payload values.
8
- *
9
- * @evidence contracts/development/implementation.md#principled-implementation Count, zero-default byte offset and padded element size determine final extent; validated buffer views bound the resulting range.
10
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Dense range arithmetic belongs here and shared element sizing supplies matrix-column padding without another table.
11
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An accessor lacking both a buffer view and sparse payload is refused; no fallback data is synthesized.
12
- * @evidence contracts/development/common.md#meaningful-documentation Comments give the dense extent formula, sparse-only allowance and prevalidated metadata premise.
13
- * @evidence contracts/development/implementation.md#efficient-algorithms Constant-time arithmetic resolves one view and shape without visiting accessor elements.
14
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Padded element sizing is shared with sparse validation and component readers; no computed payload values are cached.
15
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The gate borrows metadata for the duration of one call and owns no reader or resident bytes.
7
+ * The caller has admitted component type, shape, positive count, nonnegative
8
+ * offset and referenced view. Dense storage requires offset + (count - 1) *
9
+ * stride + paddedElementBytes to fit the view and stride to cover one element.
10
+ * Missing dense storage is accepted only when a sparse declaration exists,
11
+ * whose own gate checks its ranges; this gate does not check component
12
+ * alignment or payload values.
16
13
  */
17
14
  export const validateAccessorRange: (
18
15
  accessor: Record<string, unknown>,
@@ -6,17 +6,15 @@ import { object } from "./object";
6
6
  import { requiredArray } from "./requiredArray";
7
7
 
8
8
  /**
9
- * Check complete mesh/skin bindings and collect joints actually receiving positive weights.
9
+ * Check complete mesh/skin bindings and collect joints actually receiving
10
+ * positive weights.
10
11
  *
11
- * Matched VEC4 joints/weights and POSITION counts drive each vertex read. Negative components throw before a finite positive sum establishes weighted coverage. This pass reads only JOINTS_0/WEIGHTS_0; it does not enforce weight-sum normalization, uniqueness of nonzero influences or complete coverage of additional joint sets, and does not establish anatomical validity.
12
- *
13
- * @evidence contracts/development/implementation.md#principled-implementation Matched VEC4 joint/weight counts drive each vertex read; individual negative weights throw before a finite positive sum establishes coverage.
14
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Mesh/skin pairs own weight admission, while the shared accessor reader owns stride, numeric decoding and resident views.
15
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Negative weights cannot be hidden by cancellation with positive weights; malformed bindings throw without guessed or clamped influences.
16
- * @evidence contracts/development/common.md#meaningful-documentation Prose states nonnegative influence admission, positive finite total and the unresolved normalization/additional-set limits of this coverage pass.
17
- * @evidence contracts/development/implementation.md#efficient-algorithms Cost is O(N plus unique bound mesh/skin vertex counts), with four weight reads and up to four joint-index reads per vertex, using expected constant-time membership sets.
18
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Repeated nodes binding the identical mesh/skin pair reuse completed checks within immutable synchronous inspection only.
19
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The per-call pair set and weighted-joint set scale with bindings and joints; no mesh bytes or running resources survive.
12
+ * Matched VEC4 joints/weights and POSITION counts drive each vertex read.
13
+ * Negative components throw before a finite positive sum establishes weighted
14
+ * coverage. This pass reads only JOINTS_0/WEIGHTS_0; it does not enforce
15
+ * weight-sum normalization, uniqueness of nonzero influences or complete
16
+ * coverage of additional joint sets, and does not establish anatomical
17
+ * validity.
20
18
  */
21
19
  export const validateHumanoidSkinning: (props: {
22
20
  nodes: unknown[];
@@ -6,15 +6,14 @@ import { object } from "./object";
6
6
  /**
7
7
  * Bind every declared glTF buffer and image to its exact resident payload.
8
8
  *
9
- * The caller has admitted declared counts, lengths, views and URI shapes. Only buffer zero in a GLB/VRM container may borrow BIN, with at most three pad bytes; URI buffers require exact declared lengths, and views must fit declared and resident extents. Each external URI entry invokes the caller resolver independently, without network access here; data URIs decode locally and URI images need nonempty bytes. Returned buffer references live with the synchronous inspector, while image formats and sparse contents remain uninspected.
10
- *
11
- * @evidence contracts/development/implementation.md#principled-implementation GLB buffer zero owns BIN with at most three pad bytes; URI buffers require exact lengths and views fit declared and resident bounds.
12
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One payload owner sequences buffer binding, orphan-BIN checks, view bounds and image presence before profile decoding.
13
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Missing sidecars throw; resolver effects occur per declared entry and are not silently deduplicated or replaced.
14
- * @evidence contracts/development/common.md#meaningful-documentation Comments state read-only resident bytes, URI resolver responsibility, padding limits and no network fetch.
15
- * @evidence contracts/development/implementation.md#efficient-algorithms Work follows buffer/view/image counts and encoded data-URI bytes, plus the caller's complete resolver work for each declared external URI entry; repeated URIs repeat callback effects, borrowed payloads avoid copies, and data URIs allocate decoded arrays.
16
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each resolved buffer is reused by its accessors inside the call; callback effects prohibit caching by URI without caller guarantees.
17
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The inspector owns the temporary payload list and decoded data-URI arrays only for the call; sidecar buffers remain borrowed.
9
+ * The caller has admitted declared counts, lengths, views and URI shapes. Only
10
+ * buffer zero in a GLB/VRM container may borrow BIN, with at most three pad
11
+ * bytes; URI buffers require exact declared lengths, and views must fit
12
+ * declared and resident extents. Each external URI entry invokes the caller
13
+ * resolver independently, without network access here; data URIs decode locally
14
+ * and URI images need nonempty bytes. Returned buffer references live with the
15
+ * synchronous inspector, while image formats and sparse contents remain
16
+ * uninspected.
18
17
  */
19
18
  export const validatePayloadClosure: (props: {
20
19
  format: "gltf" | "glb" | "vrm";
@@ -8,15 +8,12 @@ import { positiveInteger } from "./positiveInteger";
8
8
  /**
9
9
  * Admit sparse accessor byte ranges within validated glTF buffer views.
10
10
  *
11
- * Absent sparse metadata does nothing. Present metadata needs a positive count no greater than accessor count, valid index/value views, unsigned byte/short/int indices and nonnegative zero-default offsets. Both tightly packed extents must fit their views; index ordering, index values and sparse payload values are not decoded, and skin/motion readers reject sparse accessors separately.
12
- *
13
- * @evidence contracts/development/implementation.md#principled-implementation Sparse count cannot exceed accessor count; unsigned index widths and padded matrix element sizes determine both payload ranges.
14
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The sparse gate owns count, index format and subview range checks while shared element sizing owns matrix padding.
15
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Sparse layout is checked structurally but skin/motion consumers explicitly refuse sparse reading rather than inventing dense values.
16
- * @evidence contracts/development/common.md#meaningful-documentation Prose explains admitted view indices, zero-default offsets, count bounds and consumer limitations.
17
- * @evidence contracts/development/implementation.md#efficient-algorithms One sparse accessor requires constant-size field checks and two range calculations independent of sparse element count.
18
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Subview metadata is read once per sparse payload; no byte decoding is performed or cached here.
19
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The range gate creates temporary metadata references only and retains no payload, reader or handle.
11
+ * Absent sparse metadata does nothing. Present metadata needs a positive count
12
+ * no greater than accessor count, valid index/value views, unsigned
13
+ * byte/short/int indices and nonnegative zero-default offsets. Both tightly
14
+ * packed extents must fit their views; index ordering, index values and sparse
15
+ * payload values are not decoded, and skin/motion readers reject sparse
16
+ * accessors separately.
20
17
  */
21
18
  export const validateSparseAccessor: (
22
19
  accessor: Record<string, unknown>,
@@ -10,15 +10,13 @@ import { validNodeIndex } from "./validNodeIndex";
10
10
  /**
11
11
  * Read declared VRM humanoid mappings using version-specific thumb migration.
12
12
  *
13
- * VRMC_vrm takes precedence when both metadata families exist and emits recognized bone keys in code-unit order; VRM 0.x retains array order, migrates thumb names and rejects duplicate slots. Unknown names and invalid node indices throw, and absent metadata returns an empty list. VRMC_vrm is interpreted with 1.0 thumb names even for 1.0-beta declarations; this pass does not validate a complete VRM schema, unique target nodes or skin weights.
14
- *
15
- * @evidence contracts/development/implementation.md#principled-implementation VRMC_vrm uses named 1.0 slots and valid node indices; VRM 0.x maps renamed thumb slots and rejects duplicates.
16
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Version branching, thumb migration and the closed humanoid vocabulary stay with this metadata owner.
17
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Unknown or dangling mappings throw; VRMC_vrm beta thumb conventions remain an explicit unresolved interpretation limit.
18
- * @evidence contracts/development/common.md#meaningful-documentation The comment states metadata version branching, node references, ordering and unsupported beta interpretation.
19
- * @evidence contracts/development/implementation.md#efficient-algorithms Work follows mapping entries and name text; 1.0 metadata enumerates B keys before O(B log B) prefix-scanning comparisons, while 0.x uses expected constant-time slot lookups after name admission.
20
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each metadata mapping is resolved once during its inspector call; mutable documents prevent persistent equivalence caching.
21
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Result slot records scale with declared mappings; temporary entries and uniqueness sets die on return or throw.
13
+ * VRMC_vrm takes precedence when both metadata families exist and emits
14
+ * recognized bone keys in code-unit order; VRM 0.x retains array order,
15
+ * migrates thumb names and rejects duplicate slots. Unknown names and invalid
16
+ * node indices throw, and absent metadata returns an empty list. VRMC_vrm is
17
+ * interpreted with 1.0 thumb names even for 1.0-beta declarations; this pass
18
+ * does not validate a complete VRM schema, unique target nodes or skin
19
+ * weights.
22
20
  */
23
21
  export const vrmHumanoidBones: (
24
22
  document: Record<string, unknown>,
@@ -96,7 +94,11 @@ export const vrmHumanoidBones: (
96
94
  return [];
97
95
  };
98
96
 
99
- /** Read a VRM 0.x bone name as its VRM 1.0 slot. VRM 1.0 renamed the thumb chain, so 0.x `ThumbProximal` is the 1.0 `ThumbMetacarpal` and 0.x `ThumbIntermediate` the 1.0 `ThumbProximal`; every other name is shared. */
97
+ /**
98
+ * Read a VRM 0.x bone name as its VRM 1.0 slot. VRM 1.0 renamed the thumb
99
+ * chain, so 0.x `ThumbProximal` is the 1.0 `ThumbMetacarpal` and 0.x
100
+ * `ThumbIntermediate` the 1.0 `ThumbProximal`; every other name is shared.
101
+ */
100
102
  const vrm0Bone: (value: unknown) => AutoMovieHumanoidBone | undefined = (
101
103
  value: unknown,
102
104
  ): AutoMovieHumanoidBone | undefined => {
@@ -3,20 +3,14 @@ import type { AutoMovieExternalModelIngestProfile } from "@automovie/interface";
3
3
  import { AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES } from "./AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES";
4
4
 
5
5
  /**
6
- * Whether an untyped selection, such as a command-line or manifest value, names one supported ingest profile exactly.
6
+ * Whether an untyped selection, such as a command-line or manifest value, names
7
+ * one supported ingest profile exactly.
7
8
  *
8
- * Only an exact element of the frozen profile list passes, so `toString` and other inherited names are refused.
9
+ * Only an exact element of the frozen profile list passes, so `toString` and
10
+ * other inherited names are refused.
9
11
  *
10
12
  * @param value Candidate selection of any type.
11
13
  * @returns `true` when `value` is one of the profile literals.
12
- *
13
- * @evidence contracts/development/implementation.md#principled-implementation Exact membership in the four-element frozen registry-derived list admits only supported profile literals, including no inherited object names.
14
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The byte inspector delegates profile admission to this guard, which consumes the single frozen list derived from the closed typed registry.
15
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The guard does no trimming or case folding, so a near-miss spelling is refused rather than accepted.
16
- * @evidence contracts/development/common.md#meaningful-documentation The documentation states the intended untyped inputs, the exact-match rule, and the inherited-name refusal.
17
- * @evidence contracts/development/implementation.md#efficient-algorithms One type check and at most four literal comparisons per call require constant time without allocating another profile inventory.
18
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A constant-time check has nothing worth reusing.
19
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The guard retains nothing and reads a module constant.
20
14
  */
21
15
  export const isAutoMovieExternalModelIngestProfile: (
22
16
  value: unknown,