@automovie/template 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 (175) hide show
  1. package/README.md +8 -22
  2. package/generated/pnpm-workspace.json +5 -5
  3. package/generated/skills/3d-modeling/conditioning.md +3 -1
  4. package/generated/skills/3d-modeling/crafting/construction.md +29 -1
  5. package/generated/skills/3d-modeling/environments.md +47 -0
  6. package/generated/skills/3d-modeling/inspection.md +7 -4
  7. package/generated/skills/contracts/development/common.md +4 -6
  8. package/generated/skills/contracts/development/design.md +7 -17
  9. package/generated/skills/contracts/development/implementation.md +8 -36
  10. package/generated/skills/development/repair.md +2 -0
  11. package/generated/skills/documentation/SKILL.md +5 -5
  12. package/generated/skills/documentation/writing.md +2 -2
  13. package/generated/skills/motion/laws/authoring.md +2 -2
  14. package/generated/skills/motion/laws/contacts.md +6 -2
  15. package/generated/skills/motion/laws/transitions.md +14 -4
  16. package/generated/skills/motion/laws/variation.md +2 -2
  17. package/generated/skills/motion/laws/verification.md +7 -5
  18. package/generated/skills/multi-agent/continuing.md +5 -0
  19. package/generated/skills/prompting/SKILL.md +8 -22
  20. package/generated/skills/visual-debugging/correction-rounds.md +4 -0
  21. package/lib/IAutoMovieScaffoldProps.d.ts +12 -12
  22. package/lib/assertScaffoldProjectName.d.ts +8 -10
  23. package/lib/assertScaffoldProjectName.js +8 -10
  24. package/lib/assertScaffoldProjectName.js.map +1 -1
  25. package/lib/createAutoMovieScaffold.d.ts +23 -15
  26. package/lib/createAutoMovieScaffold.js +35 -18
  27. package/lib/createAutoMovieScaffold.js.map +1 -1
  28. package/lib/listAutoMovieScaffoldFiles.d.ts +8 -10
  29. package/lib/listAutoMovieScaffoldFiles.js +16 -12
  30. package/lib/listAutoMovieScaffoldFiles.js.map +1 -1
  31. package/lib/renderAutoMovieWorkspace.d.ts +8 -12
  32. package/lib/renderAutoMovieWorkspace.js +16 -14
  33. package/lib/renderAutoMovieWorkspace.js.map +1 -1
  34. package/lib/scaffoldSharedSkillPath.d.ts +13 -12
  35. package/lib/scaffoldSharedSkillPath.js +13 -12
  36. package/lib/scaffoldSharedSkillPath.js.map +1 -1
  37. package/package.json +6 -6
  38. package/scaffold/instructions/.agents/skills/3d-modeling/SKILL.md +2 -0
  39. package/scaffold/instructions/.agents/skills/3d-modeling/coarse-forms.md +3 -1
  40. package/scaffold/instructions/.agents/skills/3d-modeling/materials.md +11 -0
  41. package/scaffold/instructions/.agents/skills/audio/SKILL.md +1 -1
  42. package/scaffold/instructions/.agents/skills/audio/acquisition.md +5 -1
  43. package/scaffold/instructions/.agents/skills/audio/film-sound.md +3 -1
  44. package/scaffold/instructions/.agents/skills/audio/soundtrack.md +14 -0
  45. package/scaffold/instructions/.agents/skills/contracts/development/SKILL.md +4 -2
  46. package/scaffold/instructions/.agents/skills/contracts/development/behaviors.md +3 -3
  47. package/scaffold/instructions/.agents/skills/contracts/development/catalog.md +21 -0
  48. package/scaffold/instructions/.agents/skills/contracts/development/composition.md +37 -25
  49. package/scaffold/instructions/.agents/skills/contracts/development/entities.md +3 -1
  50. package/scaffold/instructions/.agents/skills/contracts/development/films.md +39 -0
  51. package/scaffold/instructions/.agents/skills/contracts/development/testing.md +21 -0
  52. package/scaffold/instructions/.agents/skills/contracts/story/principles/research.md +1 -1
  53. package/scaffold/instructions/.agents/skills/development/SKILL.md +2 -4
  54. package/scaffold/instructions/.agents/skills/development/entities.md +14 -2
  55. package/scaffold/instructions/.agents/skills/development/modules.md +16 -6
  56. package/scaffold/instructions/.agents/skills/development/source-layout.md +6 -6
  57. package/scaffold/instructions/.agents/skills/development/testing.md +1 -1
  58. package/scaffold/instructions/.agents/skills/evidence/configuration.md +2 -2
  59. package/scaffold/instructions/.agents/skills/motion/SKILL.md +4 -5
  60. package/scaffold/instructions/.agents/skills/motion/catalog-cases.md +3 -3
  61. package/scaffold/instructions/.agents/skills/motion/compose/composition.md +37 -18
  62. package/scaffold/instructions/.agents/skills/motion/compose/refusals.md +2 -2
  63. package/scaffold/instructions/.agents/skills/motion/control-channels.md +4 -4
  64. package/scaffold/instructions/.agents/skills/motion/diffusion/SKILL.md +2 -2
  65. package/scaffold/instructions/.agents/skills/motion/judgment.md +7 -3
  66. package/scaffold/instructions/.agents/skills/motion/laws/SKILL.md +2 -3
  67. package/scaffold/instructions/.agents/skills/motion/laws/method-references.md +4 -2
  68. package/scaffold/instructions/.agents/skills/motion/performance.md +2 -2
  69. package/scaffold/instructions/.agents/skills/motion/physical-feedback.md +6 -4
  70. package/scaffold/instructions/.agents/skills/motion/retargeting.md +1 -1
  71. package/scaffold/instructions/.agents/skills/motion/segment-review.md +1 -1
  72. package/scaffold/instructions/.agents/skills/motion/staging.md +12 -8
  73. package/scaffold/instructions/.agents/skills/multi-agent/$continuing.md +0 -0
  74. package/scaffold/instructions/.agents/skills/multi-agent/SKILL.md +8 -0
  75. package/scaffold/instructions/.agents/skills/production/SKILL.md +1 -2
  76. package/scaffold/instructions/.agents/skills/production/assembly.md +7 -5
  77. package/scaffold/instructions/.agents/skills/production/director.md +5 -5
  78. package/scaffold/instructions/.agents/skills/production/media-records.md +16 -1
  79. package/scaffold/instructions/.agents/skills/production/project-context.md +7 -13
  80. package/scaffold/instructions/.agents/skills/production/sustained-runs.md +3 -3
  81. package/scaffold/instructions/.agents/skills/production/workflow.md +1 -1
  82. package/scaffold/instructions/.agents/skills/review/delivery-review.md +4 -2
  83. package/scaffold/instructions/.agents/skills/review/source-review.md +3 -1
  84. package/scaffold/instructions/.agents/skills/story/answers.md +1 -1
  85. package/scaffold/instructions/.agents/skills/story/document-layout.md +2 -2
  86. package/scaffold/instructions/.agents/skills/story/layers/shots.md +1 -1
  87. package/scaffold/instructions/.agents/skills/story/planning/discovery.md +1 -1
  88. package/scaffold/instructions/.agents/skills/story/planning/research.md +2 -2
  89. package/scaffold/instructions/.agents/skills/story/workflow/routes.md +1 -1
  90. package/scaffold/instructions/.agents/skills/video/SKILL.md +1 -1
  91. package/scaffold/instructions/.agents/skills/video/diffusion/hints.md +1 -1
  92. package/scaffold/instructions/.agents/skills/video/direct-film.md +44 -9
  93. package/scaffold/instructions/.agents/skills/video/finishing.md +11 -3
  94. package/scaffold/instructions/.agents/skills/video/generated-film.md +1 -0
  95. package/scaffold/instructions/.agents/skills/video/requests.md +6 -2
  96. package/scaffold/instructions/AGENTS.md +21 -48
  97. package/scaffold/production/README.md +18 -99
  98. package/scaffold/production/package.json +3 -2
  99. package/scaffold/production/src/IFilm.ts +1 -6
  100. package/scaffold/production/src/IFilmProduction.ts +255 -31
  101. package/scaffold/production/src/clampProductionSeconds.ts +5 -8
  102. package/scaffold/production/src/composition/films/starter.ts +2 -7
  103. package/scaffold/production/src/executable/motionTake/IMotionTakeSource.ts +1 -2
  104. package/scaffold/production/src/executable/motionTake/assertMotionTakeBindings.ts +3 -10
  105. package/scaffold/production/src/executable/motionTake/collectMotionTakeFiles.ts +2 -6
  106. package/scaffold/production/src/executable/motionTake/hashMotionTakeFile.ts +2 -6
  107. package/scaffold/production/src/executable/motionTake/openMotionTake.ts +2 -6
  108. package/scaffold/production/src/executable/motionTake/readMotionTakeArtifact.ts +2 -6
  109. package/scaffold/production/src/executable/motionTake/readMotionTakeInstalledLock.ts +2 -6
  110. package/scaffold/production/src/executable/motionTake/readMotionTakePackageVersion.ts +2 -6
  111. package/scaffold/production/src/executable/motionTake/readMotionTakeSource.ts +2 -6
  112. package/scaffold/production/src/executable/motionTake/replayMotionTake.ts +2 -6
  113. package/scaffold/production/src/executable/motionTake/resolveMotionTakePath.ts +5 -12
  114. package/scaffold/production/src/executable/motionTake/verifyMotionTakeEditPrefix.ts +2 -6
  115. package/scaffold/production/src/executable/motionTake/writeMotionTakeArtifact.ts +2 -6
  116. package/scaffold/production/src/executable/recovery/node/artifact/archiveAutoMovieRecoveryModel.ts +12 -19
  117. package/scaffold/production/src/executable/recovery/node/artifact/createAutoMovieRecoveryArtifact.ts +13 -26
  118. package/scaffold/production/src/executable/recovery/node/artifact/writeAutoMovieRecoveryArtifact.ts +16 -22
  119. package/scaffold/production/src/executable/recovery/node/internal/IAutoMovieRecoveryMemoryUsage.ts +1 -2
  120. package/scaffold/production/src/executable/recovery/node/internal/RecoveryFileVectorTable.ts +11 -32
  121. package/scaffold/production/src/executable/recovery/node/internal/RecoveryFileVectorTableInput.ts +5 -14
  122. package/scaffold/production/src/executable/recovery/node/internal/createRecoveryFileVectorTable.ts +6 -13
  123. package/scaffold/production/src/executable/recovery/node/internal/observeRecoveryAtlas.ts +16 -24
  124. package/scaffold/production/src/executable/recovery/node/internal/readAutoMovieRecoveryBoundedFile.ts +9 -17
  125. package/scaffold/production/src/executable/recovery/node/internal/readRecoveryCameraImages.ts +2 -6
  126. package/scaffold/production/src/executable/recovery/node/internal/readRecoveryFixedReference.ts +2 -6
  127. package/scaffold/production/src/executable/recovery/node/internal/recovery.ts +12 -17
  128. package/scaffold/production/src/executable/recovery/node/internal/recoveryAtlas.ts +2 -6
  129. package/scaffold/production/src/executable/recovery/node/internal/recoveryCameraMap.ts +6 -12
  130. package/scaffold/production/src/executable/recovery/node/internal/recoveryCameraScene.ts +2 -10
  131. package/scaffold/production/src/executable/recovery/node/internal/recoveryCameras.ts +2 -9
  132. package/scaffold/production/src/executable/recovery/node/internal/recoveryContourPath.ts +7 -11
  133. package/scaffold/production/src/executable/recovery/node/internal/recoveryImages.ts +6 -14
  134. package/scaffold/production/src/executable/recovery/node/mesh/createAutoMovieRecoveryContourFileMesh.ts +10 -25
  135. package/scaffold/production/src/executable/recovery/node/mesh/createAutoMovieRecoveryMeshSpool.ts +9 -15
  136. package/scaffold/production/src/executable/recovery/node/mesh/readAutoMovieRecoveryMeshFrontier.ts +10 -13
  137. package/scaffold/production/src/executable/recovery/node/publishAutoMovieRecoveryArtifact.ts +2 -6
  138. package/scaffold/production/src/executable/recovery/node/reconstruction/reconstructAutoMovieRecoveryLocal.ts +13 -19
  139. package/scaffold/production/src/executable/recovery/node/runAutoMovieRecoveryCommand.ts +4 -19
  140. package/scaffold/production/src/executable/verify.ts +11 -0
  141. package/scaffold/production/src/inspectFilmProduction.ts +252 -0
  142. package/scaffold/production/src/main.ts +1 -0
  143. package/scaffold/production/src/markFilmProduction.ts +31 -19
  144. package/scaffold/production/src/readFilmVerdicts.ts +43 -0
  145. package/scaffold/production/src/selectFilm.ts +2 -6
  146. package/scaffold/production/src/subjectOfFilm.ts +158 -0
  147. package/scaffold/production/src/subjects.ts +13 -61
  148. package/scaffold/production/test/features/test_clamp_production_seconds.ts +2 -4
  149. package/scaffold/production/test/features/test_inspect_film_production.ts +325 -0
  150. package/scaffold/production/test/features/test_recovery_publication_cancellation.ts +2 -4
  151. package/scaffold/production/test/features/test_select_film.ts +2 -4
  152. package/scaffold/production/test/features/test_subject_of_film.ts +95 -0
  153. package/scaffold/production/test/features/testing/test_test_execution.ts +2 -4
  154. package/scaffold/production/test/features/testing/test_test_selection.ts +2 -4
  155. package/scaffold/production/test/helpers/assessTestExecution.ts +4 -7
  156. package/scaffold/production/test/helpers/overlappingPerformance.ts +199 -0
  157. package/scaffold/production/test/tsconfig.json +4 -1
  158. package/scaffold/production/tsconfig.json +2 -6
  159. package/scaffold/production/vite.config.ts +25 -2
  160. package/scaffold/workspace/README.md +9 -28
  161. package/scaffold/workspace/package.json +1 -1
  162. package/src/IAutoMovieScaffoldProps.ts +12 -12
  163. package/src/assertScaffoldProjectName.ts +8 -10
  164. package/src/createAutoMovieScaffold.ts +35 -18
  165. package/src/listAutoMovieScaffoldFiles.ts +16 -12
  166. package/src/renderAutoMovieWorkspace.ts +20 -15
  167. package/src/scaffoldSharedSkillPath.ts +13 -12
  168. package/generated/skills/contracts/development/testing.md +0 -27
  169. package/scaffold/instructions/.agents/skills/automovie/SKILL.md +0 -32
  170. package/scaffold/instructions/.agents/skills/motion/laws/extension.md +0 -39
  171. package/scaffold/instructions/.agents/skills/production/stage-caches.md +0 -26
  172. package/scaffold/production/src/executable/recovery/node/internal/recoveryLocal.ts +0 -153
  173. package/scaffold/production/src/executable/recovery/node/internal/recoveryOpen.ts +0 -237
  174. package/scaffold/production/tsconfig.test.json +0 -9
  175. /package/scaffold/instructions/.agents/skills/{contracts/development/$testing.md → 3d-modeling/$environments.md} +0 -0
@@ -1,34 +1,26 @@
1
1
  import fs from "node:fs";
2
2
 
3
3
  /**
4
- * Read one regular file under an explicit byte bound and close the descriptor on
5
- * every path. A final byte probe detects growth beyond the original admitted size.
6
- * Concurrent replacement or mutation is not an immutable-source guarantee; callers
7
- * bind complete returned bytes to their expected hash before using them.
4
+ * Read one regular file under an explicit byte bound and close the descriptor
5
+ * on every path. A final byte probe detects growth beyond the original admitted
6
+ * size. Concurrent replacement or mutation is not an immutable-source
7
+ * guarantee; callers bind complete returned bytes to their expected hash before
8
+ * using them.
8
9
  *
9
- * @evidence contracts/development/implementation.md#principled-implementation Descriptor metadata admits a finite regular-file size before allocation, exact reads detect truncation and a one-byte probe detects appended content before transfer.
10
- * @evidence contracts/development/implementation.md#clear-and-simple-structure This host helper owns only bounded file acquisition and cleanup while format and hash admission remain with command callers.
11
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No unbounded readFile, partial prefix acceptance, retry on changed content or fallback path supplies bytes.
10
+ * @evidence contracts/development/implementation.md#principled-implementation Descriptor metadata checks regular-file size before allocation. Exact reads detect truncation and a one-byte probe detects growth before transfer. A finite positive byte ceiling is a caller premise: the current helper and camera command argument readers use comparisons that do not reject NaN or positive infinity.
11
+ * @evidence contracts/development/implementation.md#efficient-algorithms Reads B bytes once into caller-owned output and probes one more byte. A valid finite maxBytes bounds the allocation by maxBytes plus one probe byte. The helper opens one descriptor after the lower-bound check and closes it in finally on success or failure. Each acquisition has its own file effect. Command callers own format and complete-byte hash admission.
12
12
  * @evidence contracts/development/common.md#meaningful-documentation States regular-file and byte-budget admission, concurrent-mutation limitation, complete-byte caller hashing and guaranteed descriptor cleanup.
13
- * @evidence contracts/development/implementation.md#efficient-algorithms Reads B admitted bytes once with O(B) caller-owned output and a one-byte probe; allocation never follows an unadmitted growing file size.
14
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each explicit file acquisition has its own byte effect and is not cached.
15
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources One descriptor is acquired after budget validation and closed in finally on success or failure; at most maxBytes plus one probe byte is allocated by this helper.
16
13
  */
17
14
  export function readAutoMovieRecoveryBoundedFile(
18
15
  file: string,
19
16
  maxBytes: number,
20
17
  ): Buffer {
21
- if (!Number.isSafeInteger(maxBytes) || maxBytes < 1)
18
+ if (maxBytes < 1)
22
19
  throw new Error("A positive safe integer maxInputBytes is required");
23
20
  const descriptor: number = fs.openSync(file, "r");
24
21
  try {
25
22
  const stat: fs.Stats = fs.fstatSync(descriptor);
26
- if (
27
- !stat.isFile() ||
28
- !Number.isSafeInteger(stat.size) ||
29
- stat.size < 1 ||
30
- stat.size > maxBytes
31
- )
23
+ if (!stat.isFile() || stat.size < 1 || stat.size > maxBytes)
32
24
  throw new Error(
33
25
  "Input must be a nonempty regular file within maxInputBytes",
34
26
  );
@@ -11,13 +11,9 @@ import { readAutoMovieRecoveryBoundedFile } from "./readAutoMovieRecoveryBounded
11
11
  /**
12
12
  * Acquire a bounded fixed camera set without changing its supplied pixel chart.
13
13
  *
14
- * @evidence contracts/development/implementation.md#principled-implementation Closed path/hash/provenance metadata, complete-byte SHA verification and explicit P6 sRGB decoding bind every acquired source. Remaining aggregate pixels are checked by the decoder before each raster allocation.
15
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Shared Node acquisition serves map/scene commands while resident operations own calibration admission, observation and geometry.
16
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No unverified byte, directory scan, transform/codec fallback, environment alias or truth camera supplies an image.
14
+ * @evidence contracts/development/implementation.md#principled-implementation Closed path/hash/provenance metadata, complete-byte SHA verification and explicit P6 sRGB decoding bind every acquired source. Remaining aggregate pixels are checked by the decoder before each raster allocation. No unverified byte, directory scan, transform/codec fallback, environment alias or truth camera supplies an image.
15
+ * @evidence contracts/development/implementation.md#efficient-algorithms Shared Node acquisition serves map/scene commands while resident operations own calibration admission, observation and geometry. N complete bounded reads/hashes cost O(B), decoding O(P); aggregate pixels bound retained RGB arrays. No geometric fitting or feature extraction occurs here. Each declared image is read and hashed once; the same decoded array transfers to the public operation without an intermediate file or new decode. Bounded readers close their descriptors synchronously; call-owned encoded buffers expire per iteration and decoded rasters transfer to the enclosing host. Throws retain no staging or external handle.
17
16
  * @evidence contracts/development/common.md#meaningful-documentation States manifest-relative paths, complete per-file byte/header limits, aggregate pixels and unchanged-chart provenance.
18
- * @evidence contracts/development/implementation.md#efficient-algorithms N complete bounded reads/hashes cost O(B), decoding O(P); aggregate pixels bound retained RGB arrays. No geometric fitting or feature extraction occurs here.
19
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each declared image is read and hashed once; the same decoded array transfers to the public operation without an intermediate file or new decode.
20
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Bounded readers close their descriptors synchronously; call-owned encoded buffers expire per iteration and decoded rasters transfer to the enclosing host. Throws retain no staging or external handle.
21
17
  */
22
18
  export function readRecoveryCameraImages(
23
19
  sources: readonly IAutoMovieRecoveryCameraFile[],
@@ -6,13 +6,9 @@ import path from "node:path";
6
6
  * Read one fixed atlas reference relative to its owning document and verify its bytes.
7
7
  * Returns the admitted bytes and absolute path; a mismatch throws before observation.
8
8
  *
9
- * @evidence contracts/development/implementation.md#principled-implementation Resolve the declared relative path and require the complete-byte SHA-256 to equal the declared identity.
10
- * @evidence contracts/development/implementation.md#clear-and-simple-structure This host helper owns byte admission while its caller owns schema and geometry admission.
11
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No alternate path, changed byte sequence, source replacement or hash bypass is attempted.
9
+ * @evidence contracts/development/implementation.md#principled-implementation Resolve the declared path against the caller's base with path.resolve and require the complete-byte SHA-256 to equal the declared identity. The helper does not confine the resolved path to that base.
10
+ * @evidence contracts/development/implementation.md#efficient-algorithms Reading and hashing are O(B) in file bytes. The synchronous read opens and closes its own descriptor. It allocates the complete file before hash verification without a byte ceiling and transfers that same buffer on success. The caller owns schema and geometry admission.
12
11
  * @evidence contracts/development/common.md#meaningful-documentation States relative ownership, returned data and mismatch failure effects.
13
- * @evidence contracts/development/implementation.md#efficient-algorithms Reading and hashing are O(B) in file bytes and retain one B-byte buffer.
14
- * @evidence contracts/development/implementation.md#reuse-equivalent-work The same read buffer is hashed and returned; this helper has no cross-call cache.
15
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The synchronous read closes its descriptor and transfers the buffer to the caller; no handle survives the call.
16
12
  */
17
13
  export function readRecoveryFixedReference(
18
14
  reference: { path: string; sha256: string },
@@ -18,21 +18,19 @@ import path from "node:path";
18
18
  import { writeAutoMovieRecoveryArtifact } from "../artifact/writeAutoMovieRecoveryArtifact";
19
19
 
20
20
  /**
21
- * Generic command seam for fixed meshes to saved cubics and saved cubics to engine models.
22
- * Extraction accepts a JSON specification with units mm, frame, pose, meshes containing
23
- * path/sha256, and the AutoMovieRecoveryMeshSections policy. Mesh JSON contains vertices and triangles.
24
- * extract-prefix accepts a fourth argument giving a fixed automatic station count and explicitly
25
- * publishes incomplete coverage. Reconstruction opens only the saved curve artifact.
26
- * source epoch argument identifies a frozen source commit. curveFormat selects all
27
- * saved cubic occurrences; reconstruction admits either saved cubic basis.
21
+ * Generic command seam for fixed meshes to saved cubics and saved cubics to
22
+ * engine models. Extraction accepts a JSON specification with units mm, frame,
23
+ * pose, meshes containing path/sha256, and the AutoMovieRecoveryMeshSections
24
+ * policy. Mesh JSON contains vertices and triangles. extract-prefix accepts a
25
+ * fourth argument giving a fixed automatic station count and explicitly
26
+ * publishes incomplete coverage. Reconstruction opens only the saved curve
27
+ * artifact. source epoch argument identifies a frozen source commit.
28
+ * curveFormat selects all saved cubic occurrences; reconstruction admits either
29
+ * saved cubic basis.
28
30
  *
29
- * @evidence contracts/development/implementation.md#principled-implementation Complete-byte hashes admit each fixed input; independent extract and reconstruct commands make source-free geometry consumption observable.
30
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The CLI owns byte admission and atomic publication, public recovery operations own terminal states and orchestration, and existing engine operations retain shared curve and surface computation.
31
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No subject name, rig field, source control table or normal field is read. Existing output bytes are never overwritten.
31
+ * @evidence contracts/development/implementation.md#principled-implementation Complete-byte hashes admit each fixed input; independent extract and reconstruct commands make source-free geometry consumption observable. No subject name, rig field, source control table or normal field is read. Existing output bytes are never overwritten.
32
+ * @evidence contracts/development/implementation.md#efficient-algorithms The CLI owns byte admission and atomic publication, public recovery operations own terminal states and orchestration, and existing engine operations retain shared curve and surface computation. JSON parsing and mesh assembly are linear in input bytes and geometry; downstream operators document extraction and tessellation costs. Each input is read and hashed once; the generated model and construction share one completed engine result. Synchronous reads close their handles; arrays live for one command and immutable outputs are caller-owned.
32
33
  * @evidence contracts/development/common.md#meaningful-documentation States full extraction, explicit incomplete prefix extraction and curve-only reconstruction, with input structure, physical units and pre-execution source epoch requirement.
33
- * @evidence contracts/development/implementation.md#efficient-algorithms JSON parsing and mesh assembly are linear in input bytes and geometry; downstream operators document extraction and tessellation costs.
34
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each input is read and hashed once; the generated model and construction share one completed engine result.
35
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Synchronous reads close their handles; arrays live for one command and immutable outputs are caller-owned.
36
34
  */
37
35
  export function recovery(
38
36
  args: string[],
@@ -52,10 +50,7 @@ export function recovery(
52
50
  );
53
51
  const sectionLimit: number | undefined =
54
52
  command === "extract-prefix" ? Number(prefixCount) : undefined;
55
- if (
56
- sectionLimit !== undefined &&
57
- (!Number.isSafeInteger(sectionLimit) || sectionLimit < 2)
58
- )
53
+ if (sectionLimit !== undefined && sectionLimit < 2)
59
54
  throw new Error("An explicit integer prefix section count is required");
60
55
  if (!sourceEpoch || !/^[a-f0-9]{40,64}$/i.test(sourceEpoch))
61
56
  throw new Error("A frozen pre-execution source epoch argument is required");
@@ -19,13 +19,9 @@ import { observeRecoveryAtlas } from "./observeRecoveryAtlas";
19
19
  * Compile opens only the resulting public atlas and cannot infer replacements
20
20
  * for absent coefficients; an engine invocation never receives source incidence.
21
21
  *
22
- * @evidence contracts/development/implementation.md#principled-implementation The public bicubic geometry contract drives its canonical engine realizer; the recipe model and compiled mesh model retain one input-byte identity and separate actual processing qualification.
23
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Separate recipe, generated geometry and compile manifests expose both viewer recipe consumption and independent evaluation without duplicating coefficient authority.
24
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Original mesh input is confined to the explicit observation command; compile reads only public coefficients and preserves its actual engine mesh without source fallback or quality-driven face deletion.
22
+ * @evidence contracts/development/implementation.md#principled-implementation The public bicubic geometry contract drives its canonical engine realizer; the recipe model and compiled mesh model retain one input-byte identity and separate actual processing qualification. Original mesh input is confined to the explicit observation command; compile reads only public coefficients and preserves its actual engine mesh without source fallback or quality-driven face deletion.
23
+ * @evidence contracts/development/implementation.md#efficient-algorithms Separate recipe, generated geometry and compile manifests expose both viewer recipe consumption and independent evaluation without duplicating coefficient authority. Compile admission and hashing are linear in publication bytes; one engine call performs adaptive generation. The separate observation owner documents fitting costs, and bounded artifact serialization avoids a whole output string. The single engine result supplies generated mesh, primitive ownership and processing findings; camera changes consume the same recipe or compiled artifact. One input publication and explicitly vertex-bounded engine output remain live for the command; synchronous handles close, immutable output belongs to the caller and no process is spawned.
25
24
  * @evidence contracts/development/common.md#meaningful-documentation States the source-free input boundary, command, frozen epoch requirement, units, immutable files and qualification limits.
26
- * @evidence contracts/development/implementation.md#efficient-algorithms Compile admission and hashing are linear in publication bytes; one engine call performs adaptive generation. The separate observation owner documents fitting costs, and bounded artifact serialization avoids a whole output string.
27
- * @evidence contracts/development/implementation.md#reuse-equivalent-work The single engine result supplies generated mesh, primitive ownership and processing findings; camera changes consume the same recipe or compiled artifact.
28
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources One input publication and explicitly vertex-bounded engine output remain live for the command; synchronous handles close, immutable output belongs to the caller and no process is spawned.
29
25
  */
30
26
  export function recoveryAtlas(args: string[], sourceEpoch: string): void {
31
27
  const [command, inputFile, outputDirectory]: string[] = args;
@@ -8,17 +8,14 @@ import { readAutoMovieRecoveryBoundedFile } from "./readAutoMovieRecoveryBounded
8
8
  import { readRecoveryCameraImages } from "./readRecoveryCameraImages";
9
9
 
10
10
  /**
11
- * Acquire fixed three-image bytes and publish one immutable sparse-map artifact.
12
- * The command is cameras map input.json new-output.json maxInputBytes. Completed
13
- * seed-only/refused geometry still has an artifact; a no-value failure has none.
11
+ * Acquire fixed three-image bytes and publish one immutable sparse-map
12
+ * artifact. The command is cameras map input.json new-output.json
13
+ * maxInputBytes. Completed seed-only/refused geometry still has an artifact; a
14
+ * no-value failure has none.
14
15
  *
15
- * @evidence contracts/development/implementation.md#principled-implementation Bounded complete reads and SHA checks precede explicit unchanged-chart sRGB P6 decoding. One public resident map operation supplies geometry, and immutable publication preserves source epoch, manifest identity and authoritative stage qualification.
16
- * @evidence contracts/development/implementation.md#clear-and-simple-structure This Node owner handles paths, byte provenance, decoding and publication; resident recovery owns automatic observation, track geometry and policy.
17
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No source scan, unverified image, transform fallback, truth camera, inferred calibration, changed numerical threshold, overwrite or installation supplies a result.
16
+ * @evidence contracts/development/implementation.md#principled-implementation Bounded complete reads and SHA checks precede explicit unchanged-chart sRGB P6 decoding. One public resident map operation supplies geometry, and immutable publication preserves source epoch, manifest identity and authoritative stage qualification. No source scan, unverified image, transform fallback, truth camera, inferred calibration, changed numerical threshold, overwrite or installation supplies a result.
17
+ * @evidence contracts/development/implementation.md#efficient-algorithms This Node owner handles paths, byte provenance, decoding and publication; resident recovery owns automatic observation, track geometry and policy. Three bounded reads/hashes cost O(B), decoding O(P), followed by the public map's explicit work limits. Remaining aggregate pixels are decremented before each raster allocation; serialization scales with the bounded sparse artifact. Each declared source is acquired/hashed once; a single public operation supplies the artifact with unchanged metadata, and there is no repeated geometry or effect cache. Bounded readers close their own descriptors; at most three rasters accumulate under the aggregate ceiling and expire after estimation. The existing atomic writer owns staging cleanup and no RGB enters the published JSON.
18
18
  * @evidence contracts/development/common.md#meaningful-documentation States command arguments, relative paths, per-file and aggregate pixel limits, source epoch, unchanged chart and computation versus accepted map semantics.
19
- * @evidence contracts/development/implementation.md#efficient-algorithms Three bounded reads/hashes cost O(B), decoding O(P), followed by the public map's explicit work limits. Remaining aggregate pixels are decremented before each raster allocation; serialization scales with the bounded sparse artifact.
20
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each declared source is acquired/hashed once; a single public operation supplies the artifact with unchanged metadata, and there is no repeated geometry or effect cache.
21
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Bounded readers close their own descriptors; at most three rasters accumulate under the aggregate ceiling and expire after estimation. The existing atomic writer owns staging cleanup and no RGB enters the published JSON.
22
19
  */
23
20
  export function recoveryCameraMap(args: string[], sourceEpoch: string): void {
24
21
  const [command, inputPath, outputPath, byteText]: string[] = args;
@@ -28,7 +25,6 @@ export function recoveryCameraMap(args: string[], sourceEpoch: string): void {
28
25
  command !== "map" ||
29
26
  !inputPath ||
30
27
  !outputPath ||
31
- !Number.isSafeInteger(maxInputBytes) ||
32
28
  maxInputBytes < 1
33
29
  )
34
30
  throw new Error(
@@ -75,9 +71,7 @@ export function recoveryCameraMap(args: string[], sourceEpoch: string): void {
75
71
  "budget",
76
72
  ]) ||
77
73
  !spec.capture.budget ||
78
- !Number.isSafeInteger(spec.capture.budget.maxPixels) ||
79
74
  spec.capture.budget.maxPixels < 1 ||
80
- !Number.isSafeInteger(spec.maxHeaderBytes) ||
81
75
  spec.maxHeaderBytes < 1 ||
82
76
  !Array.isArray(spec.views) ||
83
77
  spec.views.length !== 3
@@ -12,13 +12,9 @@ import { readRecoveryCameraImages } from "./readRecoveryCameraImages";
12
12
  * partial/refused geometric component has evidence; a no-value operation does
13
13
  * not publish an artifact. This host invokes the same public RGB operation.
14
14
  *
15
- * @evidence contracts/development/implementation.md#principled-implementation Closed source/work metadata and bounded complete-byte acquisition precede unchanged-chart decoding. The resident scene operation owns registration, point growth and joint qualification; the shared immutable writer owns final publication.
16
- * @evidence contracts/development/implementation.md#clear-and-simple-structure This Node owner handles paths, bytes, provenance and publication while all camera/point algorithms remain in resident recovery.
17
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No private observation injection, source scan, inferred camera, truth pose, changed policy, overwrite or installation supplies a result.
15
+ * @evidence contracts/development/implementation.md#principled-implementation Closed source/work metadata and bounded complete-byte acquisition precede unchanged-chart decoding. The resident scene operation owns registration, point growth and joint qualification; the shared immutable writer owns final publication. No private observation injection, source scan, inferred camera, truth pose, changed policy, overwrite or installation supplies a result.
16
+ * @evidence contracts/development/implementation.md#efficient-algorithms This Node owner handles paths, bytes, provenance and publication while all camera/point algorithms remain in resident recovery. N bounded file reads/hashes and O(P) decoding precede the resident operation's admitted feature, matching and aggregate scene work. View count and aggregate pixels are checked before retention grows. Each fixed image is acquired once and one public call supplies one complete artifact; no geometry or effectful command is repeated. Bounded file descriptors close synchronously, decoded rasters expire after the resident operation, and the shared atomic writer cleans staging on failure. No RGB or descriptor enters JSON output.
18
17
  * @evidence contracts/development/common.md#meaningful-documentation States command arguments, per-source and aggregate limits, explicit source epoch and computation versus registered-component coverage.
19
- * @evidence contracts/development/implementation.md#efficient-algorithms N bounded file reads/hashes and O(P) decoding precede the resident operation's admitted feature, matching and aggregate scene work. View count and aggregate pixels are checked before retention grows.
20
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each fixed image is acquired once and one public call supplies one complete artifact; no geometry or effectful command is repeated.
21
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Bounded file descriptors close synchronously, decoded rasters expire after the resident operation, and the shared atomic writer cleans staging on failure. No RGB or descriptor enters JSON output.
22
18
  */
23
19
  export function recoveryCameraScene(args: string[], sourceEpoch: string): void {
24
20
  const [command, inputPath, outputPath, byteText]: string[] = args;
@@ -28,7 +24,6 @@ export function recoveryCameraScene(args: string[], sourceEpoch: string): void {
28
24
  command !== "scene" ||
29
25
  !inputPath ||
30
26
  !outputPath ||
31
- !Number.isSafeInteger(maxInputBytes) ||
32
27
  maxInputBytes < 1
33
28
  )
34
29
  throw new Error(
@@ -75,11 +70,8 @@ export function recoveryCameraScene(args: string[], sourceEpoch: string): void {
75
70
  "budget",
76
71
  ]) ||
77
72
  !spec.capture.budget ||
78
- !Number.isSafeInteger(spec.capture.budget.maxPixels) ||
79
73
  spec.capture.budget.maxPixels < 1 ||
80
- !Number.isSafeInteger(spec.capture.budget.maxViews) ||
81
74
  spec.capture.budget.maxViews < 3 ||
82
- !Number.isSafeInteger(spec.maxHeaderBytes) ||
83
75
  spec.maxHeaderBytes < 1 ||
84
76
  !Array.isArray(spec.views) ||
85
77
  spec.views.length < 3 ||
@@ -16,13 +16,9 @@ import { recoveryCameraScene } from "./recoveryCameraScene";
16
16
  * evidence artifact. Completed observations may refuse a camera; the artifact's
17
17
  * status and reasons remain authoritative even when the command completes.
18
18
  *
19
- * @evidence contracts/development/implementation.md#principled-implementation Bounded complete-byte reads, SHA-256 verification and explicit sRGB P6 decoding precede the public resident camera operation. Supplied calibration and declared prior pixel history stay assertions, while this host verifies the exact files it actually acquired.
20
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The Node command owns explicit paths, codec dispatch, input/source provenance and immutable publication; the resident operation owns feature observation, camera fitting and qualification without filesystem access.
21
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No source directory scan, unverified image, format fallback, synthetic camera, trained feature, changed budget or overwrite supplies a result. A cancelled/refused/failed resident operation without a value publishes nothing.
19
+ * @evidence contracts/development/implementation.md#principled-implementation Bounded complete-byte reads, SHA-256 verification and explicit sRGB P6 decoding precede the public resident camera operation. Supplied calibration and declared prior pixel history stay assertions, while this host verifies the exact files it actually acquired. No source directory scan, unverified image, format fallback, synthetic camera, trained feature, changed budget or overwrite supplies a result. A cancelled/refused/failed resident operation without a value publishes nothing.
20
+ * @evidence contracts/development/implementation.md#efficient-algorithms The Node command owns explicit paths, codec dispatch, input/source provenance and immutable publication; the resident operation owns feature observation, camera fitting and qualification without filesystem access. The pair branch reads/hashes two bounded sources in O(B) and copies O(P) raster bytes; map and scene branches delegate bounded acquisition over three or N admitted sources plus their declared numerical costs. Each host decrements aggregate pixels before decoder allocation and serializes bounded evidence once. Every source is read and hashed once, and one public operation supplies the complete artifact. Source/input digests and source epoch identify publication without sharing or resuming an effectful command. Pair readers retain at most two rasters; delegated map/scene hosts own at most three or N rasters under their admitted pixel/view ceilings. Readers close descriptors, rasters expire after estimation, and the atomic writer owns staging cleanup; no resident RGB enters JSON evidence.
22
21
  * @evidence contracts/development/common.md#meaningful-documentation Gives command arguments, per-file byte bound, unchanged decoding chart, prior-history assertion, source epoch and computational completion versus conditional camera status.
23
- * @evidence contracts/development/implementation.md#efficient-algorithms The pair branch reads/hashes two bounded sources in O(B) and copies O(P) raster bytes; map and scene branches delegate bounded acquisition over three or N admitted sources plus their declared numerical costs. Each host decrements aggregate pixels before decoder allocation and serializes bounded evidence once.
24
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Every source is read and hashed once, and one public operation supplies the complete artifact. Source/input digests and source epoch identify publication without sharing or resuming an effectful command.
25
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Pair readers retain at most two rasters; delegated map/scene hosts own at most three or N rasters under their admitted pixel/view ceilings. Readers close descriptors, rasters expire after estimation, and the atomic writer owns staging cleanup; no resident RGB enters JSON evidence.
26
22
  */
27
23
  export function recoveryCameras(args: string[], sourceEpoch: string): void {
28
24
  if (args[0] === "scene") {
@@ -40,7 +36,6 @@ export function recoveryCameras(args: string[], sourceEpoch: string): void {
40
36
  command !== "estimate" ||
41
37
  !inputPath ||
42
38
  !outputPath ||
43
- !Number.isSafeInteger(maxInputBytes) ||
44
39
  maxInputBytes < 1
45
40
  )
46
41
  throw new Error(
@@ -83,9 +78,7 @@ export function recoveryCameras(args: string[], sourceEpoch: string): void {
83
78
  ].includes(key),
84
79
  ) ||
85
80
  !spec.capture.budget ||
86
- !Number.isSafeInteger(spec.capture.budget.maxPixels) ||
87
81
  spec.capture.budget.maxPixels < 1 ||
88
- !Number.isSafeInteger(spec.maxHeaderBytes) ||
89
82
  spec.maxHeaderBytes < 1 ||
90
83
  !Array.isArray(spec.views) ||
91
84
  spec.views.length !== 2
@@ -7,18 +7,15 @@ import path from "node:path";
7
7
  import { writeAutoMovieRecoveryArtifact } from "../artifact/writeAutoMovieRecoveryArtifact";
8
8
 
9
9
  /**
10
- * Compile a bounded saved polygon/path publication through the engine.
11
- * Usage: recoveryContourPath input.json new-output-directory, with source epoch argument.
12
- * The input supplies ordered evaluated curves and path instructions, never faces.
13
- * Each subject receives independently generated geometry and actual boundary lines.
10
+ * Compile a bounded saved polygon/path publication through the engine. Usage:
11
+ * recoveryContourPath input.json new-output-directory, with source epoch
12
+ * argument. The input supplies ordered evaluated curves and path instructions,
13
+ * never faces. Each subject receives independently generated geometry and
14
+ * actual boundary lines.
14
15
  *
15
- * @evidence contracts/development/implementation.md#principled-implementation The fuchs1977-pair-path-v1 publication supplies only physical polygons and combinatorial path instructions; tessellateAutoMovieContourPath64 owns every new vertex, index and normal.
16
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One bounded CLI admits and hashes the immutable publication, compiles each declared subject and publishes its model and generation report in a fresh directory.
17
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No source path, source geometry, external triangle list, optimizer replacement or failed-quality geometry filtering enters generation; unsupported-pair counts remain explicit.
16
+ * @evidence contracts/development/implementation.md#principled-implementation The fuchs1977-pair-path-v1 publication supplies only physical polygons and combinatorial path instructions; tessellateAutoMovieContourPath64 owns every new vertex, index and normal. No source path, source geometry, external triangle list, optimizer replacement or failed-quality geometry filtering enters generation; unsupported-pair counts remain explicit.
17
+ * @evidence contracts/development/implementation.md#efficient-algorithms The CLI checks a 32 MiB metadata limit before reading and hashing the input once. The separate whole-file read does not enforce that limit if the file grows or is replaced. Input bytes and parsed polygons stay live through the command. Subjects compile sequentially with engine O(V+T) work. Each subject reuses one engine result for geometry, construction and ownership reports and publishes it before the next subject. Synchronous file operations own their handles.
18
18
  * @evidence contracts/development/common.md#meaningful-documentation States command, source epoch, source-free publication boundary, bounded file admission and the distinction between path consumption and successful source recovery.
19
- * @evidence contracts/development/implementation.md#efficient-algorithms File admission is linear in at most 32 MiB input; subjects compile sequentially with engine O(V+T) work and incremental output serialization.
20
- * @evidence contracts/development/implementation.md#reuse-equivalent-work The input bytes provide one hash for every output; each subject invokes the engine once and reuses that exact result for geometry, construction and ownership reports.
21
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Input bytes and parsed polygons remain live for the bounded command; each generated subject transfers to immutable files before the next iteration. Synchronous handles close and no child process or cache is created.
22
19
  */
23
20
  export function recoveryContourPath(args: string[], sourceEpoch: string): void {
24
21
  const [inputFile, outputDirectory]: string[] = args;
@@ -79,7 +76,6 @@ export function recoveryContourPath(args: string[], sourceEpoch: string): void {
79
76
  !/^[a-zA-Z0-9._-]+$/.test(subject.id) ||
80
77
  subject.id === "." ||
81
78
  subject.id === ".." ||
82
- !Number.isSafeInteger(subject.unsupportedPairCount) ||
83
79
  subject.unsupportedPairCount < 0
84
80
  )
85
81
  throw new Error(
@@ -21,18 +21,14 @@ import { readAutoMovieRecoveryBoundedFile } from "./readAutoMovieRecoveryBounded
21
21
  /**
22
22
  * Run fixed-image observation, qualified fitting or recipe-only compilation.
23
23
  * Every command requires input, a new immutable output path and maxInputBytes.
24
- * observe consumes the P6 sRGB manifest; fit consumes {observation,
25
- * policy}; realize consumes {recipe,budget}. Fit outputs keep dense observation
26
- * evidence separate from recipe coefficients. Realize reads only its supplied
27
- * recipe document; no source path or acquisition cache is consulted.
24
+ * observe consumes the P6 sRGB manifest; fit consumes {observation, policy};
25
+ * realize consumes {recipe,budget}. Fit outputs keep dense observation evidence
26
+ * separate from recipe coefficients. Realize reads only its supplied recipe
27
+ * document; no source path or acquisition cache is consulted.
28
28
  *
29
- * @evidence contracts/development/implementation.md#principled-implementation Bounded complete-byte acquisition and SHA-256 image verification precede deterministic P6 decoding and public resident operations. Independent commands expose the observation-to-recipe-to-source-free-model boundaries.
30
- * @evidence contracts/development/implementation.md#clear-and-simple-structure This Node host owns explicit paths, codec dispatch, provenance and immutable publication while recovery library operations own observation/fitting and the engine owns geometry.
31
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No directory scan, unknown-format fallback, unverified image bytes, source mesh, trained estimator, changed budget or output overwrite is used; a refused operation publishes nothing.
29
+ * @evidence contracts/development/implementation.md#principled-implementation Bounded complete-byte acquisition and SHA-256 image verification precede deterministic P6 decoding and public resident operations. Independent commands expose the observation-to-recipe-to-source-free-model boundaries. No directory scan, unknown-format fallback, unverified image bytes, source mesh, trained estimator, changed budget or output overwrite is used; a refused operation publishes nothing.
30
+ * @evidence contracts/development/implementation.md#efficient-algorithms This Node host owns explicit paths, codec dispatch, provenance and immutable publication while recovery library operations own observation/fitting and the engine owns geometry. Reading and hashing are O(B) in admitted bytes, RGB copies O(P) in bounded pixels, and serialization O(O) in output size. Delegated observation/fitting costs retain their declared budgets; image sources are acquired once and aggregate pixels are checked before accumulating decoded arrays. One command invokes one public operation and publishes its completed value once; exact source hashes and operation/source-epoch provenance identify that effect without a hidden resume cache. Bounded reads close descriptors synchronously. Decoded arrays grow only to the manifest pixel/view budget, expire after observation and never enter recipe-only compilation; the atomic writer owns and cleans its staging file.
32
31
  * @evidence contracts/development/common.md#meaningful-documentation States command input structures, explicit per-file byte bound, raw P6 colour convention, separate evidence/recipe files, source epoch and recipe-only consumption.
33
- * @evidence contracts/development/implementation.md#efficient-algorithms Reading and hashing are O(B) in admitted bytes, RGB copies O(P) in bounded pixels, and serialization O(O) in output size. Delegated observation/fitting costs retain their declared budgets; image sources are acquired once and aggregate pixels are checked before accumulating decoded arrays.
34
- * @evidence contracts/development/implementation.md#reuse-equivalent-work One command invokes one public operation and publishes its completed value once; exact source hashes and operation/source-epoch provenance identify that effect without a hidden resume cache.
35
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Bounded reads close descriptors synchronously. Decoded arrays grow only to the manifest pixel/view budget, expire after observation and never enter recipe-only compilation; the atomic writer owns and cleans its staging file.
36
32
  */
37
33
  export function recoveryImages(args: string[], sourceEpoch: string): void {
38
34
  const [command, inputPath, outputPath, byteText]: string[] = args;
@@ -42,7 +38,6 @@ export function recoveryImages(args: string[], sourceEpoch: string): void {
42
38
  !outputPath ||
43
39
  args.length !== 4 ||
44
40
  !["observe", "fit", "realize"].includes(command) ||
45
- !Number.isSafeInteger(maxInputBytes) ||
46
41
  maxInputBytes <= 0
47
42
  )
48
43
  throw new Error(
@@ -68,11 +63,8 @@ export function recoveryImages(args: string[], sourceEpoch: string): void {
68
63
  !spec ||
69
64
  spec.encoding !== "ppm-srgb-rgb8" ||
70
65
  !spec.capture?.budget ||
71
- !Number.isSafeInteger(spec.capture.budget.maxViews) ||
72
66
  spec.capture.budget.maxViews < 3 ||
73
- !Number.isSafeInteger(spec.capture.budget.maxPixels) ||
74
67
  spec.capture.budget.maxPixels < 1 ||
75
- !Number.isSafeInteger(spec.maxHeaderBytes) ||
76
68
  spec.maxHeaderBytes < 1 ||
77
69
  !Array.isArray(spec.views) ||
78
70
  spec.views.length < 3 ||
@@ -14,20 +14,17 @@ import { createRecoveryFileVectorTable } from "../internal/createRecoveryFileVec
14
14
 
15
15
  /**
16
16
  * Consume the actual contour kernel without retaining complete output channels.
17
- * Original millimetre vertices and accumulated area vectors use fixed-width files.
18
- * Face cross products accumulate in original face and corner order, then each
19
- * vertex is normalized once by the original normal formula. Construction samples
20
- * and scalar channels publish bounded immutable fragments. Original preparation
21
- * rings, reports and identity maps still have their actual input/output bounds;
22
- * this is not a constant-memory claim for the whole kernel.
17
+ * Original millimetre vertices and accumulated area vectors use fixed-width
18
+ * files. Face cross products accumulate in original face and corner order, then
19
+ * each vertex is normalized once by the original normal formula. Construction
20
+ * samples and scalar channels publish bounded immutable fragments. Original
21
+ * preparation rings, reports and identity maps still have their actual
22
+ * input/output bounds; this is not a constant-memory claim for the whole
23
+ * kernel.
23
24
  *
24
- * @evidence contracts/development/implementation.md#principled-implementation The shared indexed kernel supplies every original vertex and face. Binary64 file round trips preserve values and reduction order before one metre conversion and normalization.
25
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One sink owns file-backed coordinates and normal accumulation, then returns exact fragment bindings for the ordinary artifact writer.
26
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No source surface or normal, coordinate weld, omitted face, changed triangulation or placeholder validation substitutes for actual generation.
25
+ * @evidence contracts/development/implementation.md#principled-implementation The shared indexed kernel supplies every original vertex and face. Binary64 file round trips preserve values and reduction order before one metre conversion and normalization. No source surface or normal, coordinate weld, omitted face, changed triangulation or placeholder validation substitutes for actual generation.
26
+ * @evidence contracts/development/implementation.md#efficient-algorithms One sink owns file-backed coordinates and normal accumulation, then returns fragment bindings for the artifact writer. Channel and normal passes take O(V+T+K) scalar work and persisted bytes, in addition to kernel preparation and strip search. Each face contributes one cross product to its three corner accumulators. A scalar channel stages up to 8192 numbers, and each structured ring flushes immediately. Each table retains up to three 65520-byte pages. A miss reads at most one page and can flush one dirty victim. Fragment descriptors and kernel reports grow with admitted output. Cleanup attempts every descriptor close and preserves the primary error.
27
27
  * @evidence contracts/development/common.md#meaningful-documentation Separates bounded channel buffers from retained kernel metadata and canonical validation deferred status.
28
- * @evidence contracts/development/implementation.md#efficient-algorithms Channel and normal passes cost O(V+T+K) scalar work and O(V+T+K) persisted bytes, in addition to unchanged kernel preparation and strip search. Table misses transfer at most one valid page plus a dirty victim; nonlocal access can still cause repeated page I/O.
29
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each original face contributes one cross product to all three original corner accumulators; immutable fragments serve model and sidecar publication.
30
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Scalar channel buffers retain at most 8192 numbers each. Every structured generating ring flushes immediately, so at most one indivisible ring's copied points/phases are pending; its size is bounded by the original retained ring, independently of emitted-mesh limits. Each table owns at most three 65520-byte pages, totaling 393120 bytes across both tables, plus bounded headers and per-face triples. Dirty victims flush before reuse and both tables finish before success. Fragment descriptors and kernel reports grow with actual admitted output. Every acquired descriptor closes independently without replacing a primary failure.
31
28
  */
32
29
  export function createAutoMovieRecoveryContourFileMesh(
33
30
  input: IAutoMovieContourLoft64,
@@ -36,9 +33,7 @@ export function createAutoMovieRecoveryContourFileMesh(
36
33
  ): IAutoMovieRecoveryContourFileMesh {
37
34
  if (
38
35
  !limits ||
39
- !Number.isSafeInteger(limits.maxVertices) ||
40
36
  limits.maxVertices < 1 ||
41
- !Number.isSafeInteger(limits.maxTriangles) ||
42
37
  limits.maxTriangles < 1 ||
43
38
  limits.maxVertices > Math.floor(Number.MAX_SAFE_INTEGER / 24) ||
44
39
  limits.maxTriangles > Math.floor(Number.MAX_SAFE_INTEGER / 3)
@@ -123,10 +118,6 @@ export function createAutoMovieRecoveryContourFileMesh(
123
118
  areaTable.append([0, 0, 0]);
124
119
  for (const value of point) {
125
120
  const metre: number = value * 0.001;
126
- if (!Number.isFinite(metre) || !Number.isFinite(Math.fround(metre)))
127
- throw new Error(
128
- "Contour output position is not representable for upload",
129
- );
130
121
  append(0, metre);
131
122
  }
132
123
  vertices++;
@@ -135,8 +126,7 @@ export function createAutoMovieRecoveryContourFileMesh(
135
126
  if (
136
127
  triangles >= limits.maxTriangles ||
137
128
  [a, b, c].some(
138
- (index: number): boolean =>
139
- !Number.isSafeInteger(index) || index < 0 || index >= vertices,
129
+ (index: number): boolean => index < 0 || index >= vertices,
140
130
  )
141
131
  )
142
132
  throw new Error(
@@ -198,11 +188,6 @@ export function createAutoMovieRecoveryContourFileMesh(
198
188
  const length: number = Math.hypot(...normal);
199
189
  for (const value of normal) {
200
190
  const normalized: number = length > 0 ? value * (1 / length) : 0;
201
- if (
202
- !Number.isFinite(normalized) ||
203
- !Number.isFinite(Math.fround(normalized))
204
- )
205
- throw new Error("Contour normal is not representable for upload");
206
191
  append(2, normalized);
207
192
  }
208
193
  }
@@ -12,18 +12,15 @@ import path from "node:path";
12
12
  import { writeAutoMovieRecoveryArtifact } from "../artifact/writeAutoMovieRecoveryArtifact";
13
13
 
14
14
  /**
15
- * Own append-only engine mesh buffers as immutable bounded JSON array fragments.
16
- * A published prefix is one indexed mesh: shared station vertices keep their actual
17
- * global index across chunks and runs. Source-free chunk ownership maps generated
18
- * triangles back to run, interval and patch records without carrying source faces.
15
+ * Own append-only engine mesh buffers as immutable bounded JSON array
16
+ * fragments. A published prefix is one indexed mesh: shared station vertices
17
+ * keep their actual global index across chunks and runs. Source-free chunk
18
+ * ownership maps generated triangles back to run, interval and patch records
19
+ * without carrying source faces.
19
20
  *
20
- * @evidence contracts/development/implementation.md#principled-implementation Sequential vertex suffixes and already-declared global indices preserve the engine's shared boundary contract; byte-bound array fragments assemble the interface mesh without regenerating geometry.
21
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One closure owns generated mesh placeholders, bounded pending arrays, fragment bindings and prefix publication.
22
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No source mesh, coordinate weld, numeric rounding, chunk-local duplicated boundary or replacement of existing output is permitted.
21
+ * @evidence contracts/development/implementation.md#principled-implementation Sequential vertex suffixes and already-declared global indices preserve the engine's shared boundary contract; byte-bound array fragments assemble the interface mesh without regenerating geometry. No source mesh, coordinate weld, numeric rounding, chunk-local duplicated boundary or replacement of existing output is permitted.
22
+ * @evidence contracts/development/implementation.md#efficient-algorithms One closure owns generated mesh placeholders, bounded pending arrays, fragment bindings and prefix publication. Appending and final serialization are linear in generated values. Each frontier serializes only new fragment bindings plus its caller-supplied context; repeated context has its own cumulative cost. Each standalone prefix rereads its immutable fragments to verify bytes and assemble the artifact. The same generated fragments serve successive explicit prefixes and final output; shared vertices are written once rather than copied into separate mesh parts. All seven pending channels flush at 8192 items or a one-MiB encoded-size upper estimate, plus one indivisible admitted record. Fragment and frontier descriptors grow with persisted output. Publication owns temporary descriptors through the writer; immutable spool and journal files remain lineage artifacts.
23
23
  * @evidence contracts/development/common.md#meaningful-documentation States units, append-only indices, generated ownership and immutable prefix semantics.
24
- * @evidence contracts/development/implementation.md#efficient-algorithms Appending and final serialization are linear in generated values. Each frontier serializes only new fragment bindings plus its caller-supplied context; repeated context has its own cumulative cost. Each standalone prefix rereads its immutable fragments to verify bytes and assemble the artifact.
25
- * @evidence contracts/development/implementation.md#reuse-equivalent-work The same generated fragments serve successive explicit prefixes and final output; shared vertices are written once rather than copied into separate mesh parts.
26
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources All seven pending channels flush at 8192 items or a one-MiB encoded-size upper estimate, plus one indivisible admitted record. Fragment and frontier descriptors grow with persisted output. Publication owns temporary descriptors through the writer; immutable spool and journal files remain lineage artifacts.
27
24
  */
28
25
  export function createAutoMovieRecoveryMeshSpool(
29
26
  directory: string,
@@ -143,15 +140,12 @@ export function createAutoMovieRecoveryMeshSpool(
143
140
  const count: number = chunk.positions.length / 3;
144
141
  if (
145
142
  chunk.vertexStart !== counts.vertices ||
146
- !Number.isSafeInteger(count) ||
143
+ chunk.positions.length % 3 !== 0 ||
147
144
  chunk.normals.length !== chunk.positions.length ||
148
145
  chunk.physicalVertexIds.length !== count ||
149
146
  chunk.indices.length % 3 ||
150
- chunk.positions.some((x: number): boolean => !Number.isFinite(x)) ||
151
- chunk.normals.some((x: number): boolean => !Number.isFinite(x)) ||
152
147
  chunk.indices.some(
153
- (x: number): boolean =>
154
- !Number.isSafeInteger(x) || x < 0 || x >= counts.vertices + count,
148
+ (x: number): boolean => x < 0 || x >= counts.vertices + count,
155
149
  )
156
150
  )
157
151
  throw new Error(
@@ -7,17 +7,14 @@ import fs from "node:fs";
7
7
  import path from "node:path";
8
8
 
9
9
  /**
10
- * Verify a closed source-free spool frontier and recover its complete array bindings.
11
- * The caller supplies the expected source/input binding and bounded read budgets.
12
- * This reads committed fragments only; uncommitted files are neither inferred nor removed.
10
+ * Verify a closed source-free spool frontier and recover its complete array
11
+ * bindings. The caller supplies the expected source/input binding and bounded
12
+ * read budgets. This reads committed fragments only; uncommitted files are
13
+ * neither inferred nor removed.
13
14
  *
14
- * @evidence contracts/development/implementation.md#principled-implementation Exact SHA-256 predecessor links reconstruct the append-only journal, then independent byte hashes, JSON populations, append-only indices and ownership ranges verify the common seven-channel boundary.
15
- * @evidence contracts/development/implementation.md#clear-and-simple-structure This reader owns persisted-byte admission. The spool owns writes, the caller owns the immutable base model, and generator resumption separately proves deterministic replay.
16
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No directory-order guess, coordinate weld, missing-array reconstruction, source mesh, normal substitution or incomplete-file salvage supplies output. A mismatched source binding refuses the frontier.
17
- * @evidence contracts/development/common.md#meaningful-documentation Returns verified array-source descriptors and the exact last context. This does not certify source fidelity, geometry quality or a resumed engine iterator.
18
- * @evidence contracts/development/implementation.md#efficient-algorithms Journal admission costs O(J+F), followed by one required byte/hash/JSON pass over the F referenced fragments. Index and ownership checks visit stored values once; uncommitted directory contents are not scanned.
19
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Verified original fragment paths feed the existing artifact writer without regenerating vertices, copying a whole mesh or fitting curves. Later publication still verifies its own required reads.
20
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Declared journal, fragment count and byte budgets bound metadata and one parsed fragment. Peak metadata includes O(J+F+C) retained journal/context bytes C; only the last context and O(F) binding records survive. Synchronous reads close their descriptors and no complete numeric channel is retained.
15
+ * @evidence contracts/development/implementation.md#principled-implementation Exact SHA-256 links bind the append-only journal and its fragment bytes. Admission checks the supplied source binding, declared channel populations, append order, numeric position and normal entries, index ranges and contiguous ownership totals. Finite coordinates and integral indices and counts come from the producing spool.
16
+ * @evidence contracts/development/implementation.md#efficient-algorithms The reader owns journal and fragment admission. The spool owns writes, and the caller retains the immutable base model and supplies finite positive count and byte limits. Reads and checks scale with journal and fragment bytes, including the source binding compared for each journal. Retained metadata consists of the journal records and fragment bindings plus one parsed fragment. The returned last context and original fragment paths let the artifact writer assemble a publication with its own byte verification. Synchronous reads close their descriptors.
17
+ * @evidence contracts/development/common.md#meaningful-documentation Identifies the checked fields of the returned array-source descriptors, the caller's finite read budgets and the exact last context. Source fidelity, geometry quality and deterministic iterator resumption require separate proofs.
21
18
  */
22
19
  export function readAutoMovieRecoveryMeshFrontier(
23
20
  input: IAutoMovieRecoveryMeshFrontierInput,
@@ -49,11 +46,11 @@ export function readAutoMovieRecoveryMeshFrontier(
49
46
  input.maxJournalBytes,
50
47
  input.maxFragmentBytes,
51
48
  ])
52
- if (!Number.isSafeInteger(budget) || budget < 1)
49
+ if (budget < 1)
53
50
  throw new Error("Positive finite frontier read budgets are required");
54
51
  const directory: string = fs.realpathSync(input.directory);
55
52
  const validCount: (value: number) => boolean = (value: number): boolean =>
56
- Number.isSafeInteger(value) && value >= 0;
53
+ value >= 0;
57
54
  const read: (receipt: Receipt, limit: number) => Buffer = (
58
55
  receipt: Receipt,
59
56
  limit: number,
@@ -185,7 +182,7 @@ export function readAutoMovieRecoveryMeshFrontier(
185
182
  for (const value of values) {
186
183
  if (
187
184
  (channel.name === "positions" || channel.name === "normals") &&
188
- (typeof value !== "number" || !Number.isFinite(value))
185
+ typeof value !== "number"
189
186
  )
190
187
  throw new Error("A committed numeric channel is not finite");
191
188
  if (
@@ -16,13 +16,9 @@ import { writeAutoMovieRecoveryArtifact } from "./artifact/writeAutoMovieRecover
16
16
  * file. A process crash can leave an unpublished temporary file, as documented by
17
17
  * the writer. Cancellation does not delete a completed immutable publication.
18
18
  *
19
- * @evidence contracts/development/implementation.md#principled-implementation The bounded JSON writer closes a same-directory temporary file before nonoverwriting hard-link publication and hashes the exact written bytes.
20
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One Node host wraps publication lifecycle; portable workflows neither open paths nor own output files.
21
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No geometry filtering, rounding, source fallback, output replacement or claimed asynchronous cancellation changes the artifact.
19
+ * @evidence contracts/development/implementation.md#principled-implementation The bounded JSON writer closes a same-directory temporary file before nonoverwriting hard-link publication and hashes the exact written bytes. No geometry filtering, rounding, source fallback, output replacement or claimed asynchronous cancellation changes the artifact.
20
+ * @evidence contracts/development/implementation.md#efficient-algorithms The Node host delegates encoding and publication to the JSON writer. Work scales with visited keys and values and emitted UTF-8. The writer hashes each emitted chunk once and owns its descriptors and private staging file. Staging includes bounded shallow-array chunks, the largest encoded primitive and active records' key lists. The writer attempts cleanup on failure while preserving the primary error. The caller retains the input and any completed immutable publication.
22
21
  * @evidence contracts/development/common.md#meaningful-documentation States byte identity, immutable effects, cancellation granularity and temporary-file cleanup limits.
23
- * @evidence contracts/development/implementation.md#efficient-algorithms Serialization and hashing are O(B) in emitted bytes with fixed shallow-array staging and O(depth) ancestor tracking; the largest string is not separately bounded.
24
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each emitted chunk feeds both the file and hash once; no complete output reread or regenerated geometry is required.
25
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The delegated writer closes file descriptors and removes its private temporary file on return or exception; the caller retains input data and the completed output.
26
22
  */
27
23
  export function publishAutoMovieRecoveryArtifact(
28
24
  output: string,