@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
@@ -22,21 +22,19 @@ import { createAutoMovieRecoveryArtifact } from "../artifact/createAutoMovieReco
22
22
  import { createAutoMovieRecoveryMeshSpool } from "../mesh/createAutoMovieRecoveryMeshSpool";
23
23
 
24
24
  /**
25
- * Generate saved tensor ordinary domains, retained closed domains and bounded open surfaces.
26
- * Explicit ruled or local quadratic interpolation differs from coefficientwise PCHIP.
27
- * Its exact source edges and conforming local cells share actual global mesh indices.
28
- * Spool-backed checkpoints retain all emitted finite geometry and explicit incompletion.
29
- * The immutable analytic-and-retained-closed base is published before the first open chunk,
30
- * even when repeated standalone open checkpoints are disabled. Joint spool frontiers
31
- * persist channel bindings and source-free run cursors independently of rendering.
25
+ * Generate saved tensor ordinary domains, retained closed domains and bounded
26
+ * open surfaces. Explicit ruled or local quadratic interpolation differs from
27
+ * coefficientwise PCHIP. Its exact source edges and conforming local cells
28
+ * share actual global mesh indices. Spool-backed checkpoints retain all emitted
29
+ * finite geometry and explicit incompletion. The immutable
30
+ * analytic-and-retained-closed base is published before the first open chunk,
31
+ * even when repeated standalone open checkpoints are disabled. Joint spool
32
+ * frontiers persist channel bindings and source-free run cursors independently
33
+ * of rendering.
32
34
  *
33
- * @evidence contracts/development/implementation.md#principled-implementation One analytic realization owns its declared closed and open occurrences; the closed adapter dispatches tensor families and retained curve-only domains. Declared ordinary open-arc transport fixes maximal runs and orientation; cubic controls feed the local Hermite engine, whose shared global indices are appended unchanged.
34
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Graph admission, run ownership, engine streaming and immutable artifact publication are separate stages. Generated triangle ranges retain run, saved curves and local patch ownership.
35
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No source geometry, positional weld, hidden closure, hand-selected station, nonlinear limiter or sample reduction enters reconstruction. Analytic domains own explicitly delegated occurrences; all other unsupported branches remain graph records.
35
+ * @evidence contracts/development/implementation.md#principled-implementation One analytic realization owns its declared closed and open occurrences; the closed adapter dispatches tensor families and retained curve-only domains. Declared ordinary open-arc transport fixes maximal runs and orientation; cubic controls feed the local Hermite engine, whose shared global indices are appended unchanged. No source geometry, positional weld, hidden closure, hand-selected station, nonlinear limiter or sample reduction enters reconstruction. Analytic domains own explicitly delegated occurrences; all other unsupported branches remain graph records.
36
+ * @evidence contracts/development/implementation.md#efficient-algorithms Graph admission, run ownership, engine streaming and immutable artifact publication are separate stages. Generated triangle ranges retain run, saved curves and local patch ownership. Graph admission is O(P+A); each supported arc belongs to one maximal run. The engine uses local four-course partitions, while disk assembly is linear in emitted data per publication; checkpoints explicitly incur rereads of earlier chunks. Each shared station edge and its analytic normal are generated once. The same immutable engine fragments supply unfinished checkpoints and final model, without repeated fitting or reconstruction for camera changes. Source-free bundle and graph remain caller-owned. Open output retention is bounded by plans, one chunk and spool staging; closed, analytic and tensor meshes and scalar reports remain retained until publication. Completed open chunks transfer to disk, and cancellation releases local state on exceptions.
36
37
  * @evidence contracts/development/common.md#meaningful-documentation States the changed operator, coefficient authority, approximation budget, streamed indexing and independent qualification of coverage, regularity and source fidelity.
37
- * @evidence contracts/development/implementation.md#efficient-algorithms Graph admission is O(P+A); each supported arc belongs to one maximal run. The engine uses local four-course partitions, while disk assembly is linear in emitted data per publication; checkpoints explicitly incur rereads of earlier chunks.
38
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each shared station edge and its analytic normal are generated once. The same immutable engine fragments supply unfinished checkpoints and final model, without repeated fitting or reconstruction for camera changes.
39
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Source-free bundle and graph remain caller-owned. Open output retention is bounded by plans, one chunk and spool staging; closed, analytic and tensor meshes and scalar reports remain retained until publication. Completed open chunks transfer to disk, and cancellation releases local state on exceptions.
40
38
  */
41
39
  export function reconstructAutoMovieRecoveryLocal(
42
40
  bundle: IAutoMovieRecoveryTensorFamiliesInput,
@@ -46,10 +44,7 @@ export function reconstructAutoMovieRecoveryLocal(
46
44
  ): IAutoMovieRecoveryLocalResult {
47
45
  if (
48
46
  (binding.operator !== "quadratic" && binding.operator !== "ruled") ||
49
- !(
50
- bundle.policy.toleranceMm > 0 &&
51
- Number.isFinite(bundle.policy.toleranceMm)
52
- )
47
+ !(bundle.policy.toleranceMm > 0)
53
48
  )
54
49
  throw new Error(
55
50
  "Explicit interpolation and a positive physical approximation budget required",
@@ -57,8 +52,7 @@ export function reconstructAutoMovieRecoveryLocal(
57
52
  if (
58
53
  graph.intervals.length !== bundle.reports.length - 1 ||
59
54
  graph.orientations.length !== bundle.reports.length ||
60
- !(graph.resolutionMm > 0 && Number.isFinite(graph.resolutionMm)) ||
61
- !Number.isSafeInteger(graph.maxVerticesPerRun) ||
55
+ !(graph.resolutionMm > 0) ||
62
56
  graph.maxVerticesPerRun < 4
63
57
  )
64
58
  throw new Error(
@@ -5,8 +5,6 @@ import { recoveryAtlas } from "./internal/recoveryAtlas";
5
5
  import { recoveryCameras } from "./internal/recoveryCameras";
6
6
  import { recoveryContourPath } from "./internal/recoveryContourPath";
7
7
  import { recoveryImages } from "./internal/recoveryImages";
8
- import { recoveryLocal } from "./internal/recoveryLocal";
9
- import { recoveryOpen } from "./internal/recoveryOpen";
10
8
 
11
9
  /**
12
10
  * Run an installed recovery command with explicit generating-source provenance.
@@ -15,27 +13,22 @@ import { recoveryOpen } from "./internal/recoveryOpen";
15
13
  * coverage and diagnostics remain authoritative. This host alone writes console
16
14
  * records; importing the memory package performs no command or filesystem work.
17
15
  *
18
- * @evidence contracts/development/implementation.md#principled-implementation An explicit command table dispatches existing source observation or source-free reconstruction owners after validating a supplied source epoch.
19
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Installed and compatibility entry points share one dispatcher with explicit arguments; no environment variable supplies package behavior.
20
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The dispatcher does not infer paths, change numeric policy, retry failed geometry, spawn workers or overwrite existing artifacts.
16
+ * @evidence contracts/development/implementation.md#principled-implementation An explicit command table dispatches existing source observation or source-free reconstruction owners after validating a supplied source epoch. The dispatcher does not infer paths, change numeric policy, retry failed geometry, spawn workers or overwrite existing artifacts.
17
+ * @evidence contracts/development/implementation.md#efficient-algorithms Installed and compatibility entry points share one dispatcher with explicit arguments; no environment variable supplies package behavior. Argument admission is O(A) in argument count before one delegated operation; generating and serialization costs remain with their owners. One command executes once with the supplied epoch and arguments; there is no result or effect cache. The dispatcher acquires no handle. Delegated hosts own their declared files and staging.
21
18
  * @evidence contracts/development/common.md#meaningful-documentation States exit meanings, explicit provenance and the separate meaning of partial geometry.
22
- * @evidence contracts/development/implementation.md#efficient-algorithms Argument admission is O(A) in argument count before one delegated operation; generating and serialization costs remain with their owners.
23
- * @evidence contracts/development/implementation.md#reuse-equivalent-work One command executes once with the supplied epoch and arguments; there is no result or effect cache.
24
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The dispatcher acquires no handle and awaits the asynchronous local writer before returning; delegated hosts own their declared files and staging.
25
19
  */
26
20
  export async function runAutoMovieRecoveryCommand(
27
21
  args: readonly string[],
28
22
  ): Promise<number> {
29
23
  if (args.length === 0 || args[0] === "--help") {
30
24
  console.log(
31
- "automovie-recovery <recovery|recoveryOpen|recoveryLocal|recoveryAtlas|recoveryContourPath|images|cameras> --source-epoch <git-or-source-sha> <arguments>\n" +
25
+ "automovie-recovery <recovery|recoveryAtlas|recoveryContourPath|images|cameras> --source-epoch <git-or-source-sha> <arguments>\n" +
32
26
  "images: observe|fit|realize input.json new-output.json maxInputBytes\n" +
33
27
  "cameras: estimate|map|scene input.json new-output.json maxInputBytes\n" +
34
28
  "recovery: extract|extract-prefix|reconstruct input.json output.json [prefixSections] [--curve-format bezier|hermite]\n" +
35
- "recoveryOpen: observe spec.json curves.json graph.json | reconstruct curves.json graph.json model.json\n" +
36
- "recoveryLocal: curves.json graph.json model.json ruled|quadratic [final-only|final-only-gzip] [analytic.json]\n" +
37
29
  "recoveryAtlas: observe|compile input.json new-output-directory\n" +
38
30
  "recoveryContourPath: input.json new-output-directory\n" +
31
+ "For open continuation and local reconstruction, see Recover an open surface in the production README.\n" +
39
32
  "Outputs can be partial. Inspect coverage and diagnostics; completion does not certify source fidelity or smoothness.",
40
33
  );
41
34
  return 0;
@@ -54,8 +47,6 @@ export async function runAutoMovieRecoveryCommand(
54
47
  !/^[a-f0-9]{40,64}$/i.test(sourceEpoch) ||
55
48
  ![
56
49
  "recovery",
57
- "recoveryOpen",
58
- "recoveryLocal",
59
50
  "recoveryAtlas",
60
51
  "recoveryContourPath",
61
52
  "images",
@@ -116,12 +107,6 @@ export async function runAutoMovieRecoveryCommand(
116
107
  case "recovery":
117
108
  recovery(operands, sourceEpoch, curveFormat);
118
109
  break;
119
- case "recoveryOpen":
120
- recoveryOpen(parameters, sourceEpoch);
121
- break;
122
- case "recoveryLocal":
123
- await recoveryLocal(parameters, sourceEpoch);
124
- break;
125
110
  case "recoveryAtlas":
126
111
  recoveryAtlas(parameters, sourceEpoch);
127
112
  break;
@@ -0,0 +1,11 @@
1
+ import type { IAutoMovieVerification } from "automovie";
2
+
3
+ /**
4
+ * The model, motion or film targets this production has chosen to verify. Add
5
+ * each check at its authoring scope with a comment describing the expectation,
6
+ * the exact views or interval and the evidence used to judge it. The command
7
+ * derives status from measurements and owning records.
8
+ */
9
+ const targets: readonly IAutoMovieVerification[] = [];
10
+
11
+ export default targets;
@@ -0,0 +1,252 @@
1
+ import { classifyAutoMoviePlaybackBoundary } from "@automovie/engine";
2
+ import type {
3
+ IAutoMovieInspectionDiagnostics,
4
+ IAutoMoviePreparePhysicalGeometry,
5
+ } from "@automovie/interface";
6
+ import {
7
+ type IAutoMovieDrawScene,
8
+ observeAutoMovieCollisionMotion,
9
+ observeAutoMoviePlacedCamera,
10
+ observeAutoMoviePlacedScene,
11
+ observeAutoMovieSceneCollision,
12
+ } from "@automovie/render";
13
+
14
+ import type { IFilmProduction } from "./IFilmProduction";
15
+ import type { FilmVerdictPacket } from "./readFilmVerdicts";
16
+
17
+ /** Work a capture or delivery may spend: never a reason to defer a check. */
18
+ const SETTLED: Parameters<typeof observeAutoMovieSceneCollision>[0]["limits"] =
19
+ {
20
+ comparisons: Number.MAX_SAFE_INTEGER,
21
+ posedVertices: Number.MAX_SAFE_INTEGER,
22
+ surfaceTriangles: Number.MAX_SAFE_INTEGER,
23
+ sweptCells: Number.MAX_SAFE_INTEGER,
24
+ };
25
+
26
+ /**
27
+ * Collision work per placed sample. Interactive playback may defer a pair it
28
+ * cannot finish within a frame; a capture or delivery settles the same scene
29
+ * without a work limit.
30
+ *
31
+ * The viewer limits give collision at most about 7.5 ms of a 60 Hz frame,
32
+ * leaving room for motion checks and the render: 2.5 ms collecting parts, 2 ms
33
+ * of comparisons at 2.4 µs each, and 1.5 ms each of surface triangles at 0.24
34
+ * µs and posed vertices at up to 0.49 µs, measured with unlimited work on a
35
+ * 1,024-member formation crossed by a growing barrier and on overlapping closed
36
+ * meshes of growing density. A real formation, wall, bed and rope film peaks at
37
+ * 384 comparisons, 221 posed vertices and no surface triangles. No measured
38
+ * scene spends swept cells.
39
+ */
40
+ const COLLISION_LIMITS: Record<
41
+ IAutoMovieDrawScene.IPlacedSample["mode"],
42
+ Parameters<typeof observeAutoMovieSceneCollision>[0]["limits"]
43
+ > = {
44
+ viewer: {
45
+ comparisons: 850,
46
+ posedVertices: 3_000,
47
+ surfaceTriangles: 6_300,
48
+ sweptCells: 256,
49
+ // Collecting a part costs about 6.4 µs (6.4 ms per 1,024 formation members),
50
+ // which no other limit bounds; 400 parts keep collection near 2.5 ms.
51
+ parts: 400,
52
+ },
53
+ capture: SETTLED,
54
+ delivery: SETTLED,
55
+ };
56
+
57
+ /**
58
+ * Motion work per placed sample. Interactive playback places a few extra
59
+ * instants and defers a crossing it cannot settle; a capture or delivery
60
+ * subdivides until every moving pair is resolved, within a depth that resolves
61
+ * a frame into about a billion steps.
62
+ */
63
+ const MOTION_LIMITS: Record<
64
+ IAutoMovieDrawScene.IPlacedSample["mode"],
65
+ Parameters<typeof observeAutoMovieCollisionMotion>[0]["limits"]
66
+ > = {
67
+ viewer: {
68
+ // Each extra instant costs a placement plus a collection; the work limits
69
+ // follow the collision measurements above, at about a third of its share.
70
+ placements: 4,
71
+ depth: 6,
72
+ comparisons: 300,
73
+ posedVertices: 1_000,
74
+ surfaceTriangles: 2_000,
75
+ parts: 400,
76
+ },
77
+ capture: { ...SETTLED, placements: Number.MAX_SAFE_INTEGER, depth: 30 },
78
+ delivery: { ...SETTLED, placements: Number.MAX_SAFE_INTEGER, depth: 30 },
79
+ };
80
+
81
+ /**
82
+ * Collect stock review checks from the same world that will be drawn.
83
+ *
84
+ * The scaffold always checks the placed scene and camera and consumes the
85
+ * existing native performance frame when offered. Without authored layers the
86
+ * whole scene is one automatic collision layer: every drawn box, closed prop,
87
+ * skin, formation member and cord segment is checked, and its unresolved
88
+ * coverage is reported without blocking delivery. Authored shot layers mark
89
+ * their own collision obligations required. When the subject places
90
+ * synchronously, the motion since the preceding output instant is subdivided at
91
+ * placed instants to find crossings no drawn frame shows, except across a cut
92
+ * or declared break of the production's playback; the drawn second is placed
93
+ * again before returning. Random seeks and sequential playback examine the same
94
+ * span, so they report the same result.
95
+ *
96
+ * A capture or delivery sample also carries the film's human performance
97
+ * verdicts when the mount supplies its reader (`readFilmVerdicts`): every
98
+ * finding and coverage row of the whole-performance report, the same in each
99
+ * packet of the run. The interactive viewer never calls the reader.
100
+ *
101
+ * @param props Film identity, production inspection sources, prepared geometry
102
+ * queries, the run's verdict reader and the one settled draw sample.
103
+ * @returns One serializable packet carrying the scene, collision and authored
104
+ * camera observations.
105
+ * @evidence contracts/development/common.md#meaningful-documentation States what runs by default, which source rules are optional and the placement precondition.
106
+ * @evidence contracts/development/implementation.md#principled-implementation Runs each applicable checker on the already placed scene and its canonical delivery camera, using one borrow of any native frame. Only a producer can supply its shot, authored exclusions, contact intent or required camera subjects.
107
+ * @evidence contracts/development/implementation.md#efficient-algorithms Resolve source metadata, call the three existing check owners and combine their emitted findings and coverage. One bounded collision observation and one native scene observation per placed frame, with a smaller interactive collision budget than capture and delivery. Camera raster work is delegated only for declared targets under its host budget. The film's whole-performance verdicts are read once per capture or delivery run by the mount's reader and only mapped into each packet, never in the interactive viewer. Borrows initialized geometry queries, placed world matrices, the film's actual physical frame, the run's one verdict packet and the same delivery projection. Returns diagnostic values only. No scene, frame or renderer is held after the call.
108
+ */
109
+ export function inspectFilmProduction(props: {
110
+ name: string;
111
+ production: IFilmProduction;
112
+ geometry: Pick<IAutoMoviePreparePhysicalGeometry.IQueries, "contact">;
113
+ /**
114
+ * Output frame rate, which locates the preceding output instant; motion
115
+ * between frames is not examined without it.
116
+ */
117
+ fps?: number;
118
+ /**
119
+ * The run's verdict reader from `readFilmVerdicts`; asked only in a capture
120
+ * or delivery sample.
121
+ */
122
+ verdicts?: () => FilmVerdictPacket;
123
+ sample: IAutoMovieDrawScene.IPlacedSample;
124
+ }): IAutoMovieInspectionDiagnostics {
125
+ const { name, production, geometry, sample } = props;
126
+ const layersAt = (
127
+ seconds: number,
128
+ ): Parameters<typeof observeAutoMovieSceneCollision>[0]["layers"] =>
129
+ (
130
+ production.inspectionLayers?.({
131
+ ...sample,
132
+ time: { filmSeconds: seconds },
133
+ }) ?? [{ id: name, root: sample.scene, localSeconds: seconds }]
134
+ ).map((layer) =>
135
+ sample.place === undefined ||
136
+ props.fps === undefined ||
137
+ layer.sweeps !== undefined
138
+ ? layer
139
+ : { ...layer, sweeps: [] },
140
+ );
141
+ const authored: IAutoMovieInspectionDiagnostics | undefined =
142
+ production.inspectPlaced?.(sample);
143
+ const layers: Parameters<typeof observeAutoMovieSceneCollision>[0]["layers"] =
144
+ layersAt(sample.time.filmSeconds);
145
+ const native: Pick<IAutoMovieInspectionDiagnostics, "findings" | "coverage"> =
146
+ observeAutoMoviePlacedScene({
147
+ scene: sample.scene,
148
+ camera: sample.camera,
149
+ time: sample.time,
150
+ physicalFrame: production.performance?.frame(),
151
+ checks: production.inspectionChecks?.(sample),
152
+ });
153
+ const collision: Pick<
154
+ IAutoMovieInspectionDiagnostics,
155
+ "findings" | "coverage"
156
+ > = observeAutoMovieSceneCollision({
157
+ time: sample.time,
158
+ layers,
159
+ geometry,
160
+ // Region bounds gave the same findings and coverage as group bounds and
161
+ // were faster on sparse and 2,048 and 8,192 member formation scenes.
162
+ refinement: "region",
163
+ limits: COLLISION_LIMITS[sample.mode],
164
+ });
165
+ const motion: Pick<IAutoMovieInspectionDiagnostics, "findings" | "coverage"> =
166
+ observeMotion(props, layersAt);
167
+ const targets: Parameters<typeof observeAutoMoviePlacedCamera>[0]["targets"] =
168
+ production.inspectionCamera?.(sample) ?? [];
169
+ const camera: Pick<IAutoMovieInspectionDiagnostics, "findings" | "coverage"> =
170
+ observeAutoMoviePlacedCamera({ sample, targets });
171
+ const human: FilmVerdictPacket =
172
+ sample.mode === "viewer" || props.verdicts === undefined
173
+ ? { findings: [], coverage: [] }
174
+ : props.verdicts();
175
+ const shot: IAutoMovieInspectionDiagnostics.IShotTime | undefined =
176
+ layers.length === 1 && layers[0]!.shotPath !== undefined
177
+ ? { path: layers[0]!.shotPath, seconds: layers[0]!.localSeconds }
178
+ : undefined;
179
+ return {
180
+ scope:
181
+ authored?.scope ??
182
+ JSON.stringify([
183
+ name,
184
+ ...layers.map((layer: (typeof layers)[number]): string => layer.id),
185
+ ]),
186
+ time: authored?.time ?? {
187
+ ...sample.time,
188
+ ...(shot === undefined ? {} : { shot }),
189
+ },
190
+ findings: [
191
+ ...native.findings,
192
+ ...collision.findings,
193
+ ...motion.findings,
194
+ ...camera.findings,
195
+ ...human.findings,
196
+ ...(authored?.findings ?? []),
197
+ ],
198
+ coverage: [
199
+ ...native.coverage,
200
+ ...collision.coverage,
201
+ ...motion.coverage,
202
+ ...camera.coverage,
203
+ ...human.coverage,
204
+ ...(authored?.coverage ?? []),
205
+ ],
206
+ };
207
+ }
208
+
209
+ /**
210
+ * Subdivide the motion since the preceding output instant when the subject
211
+ * places synchronously; otherwise disclose that motion between frames stays
212
+ * unverified. A cut or declared break in the production's playback between the
213
+ * two instants has no physical path to examine.
214
+ */
215
+ function observeMotion(
216
+ props: Parameters<typeof inspectFilmProduction>[0],
217
+ layersAt: (
218
+ seconds: number,
219
+ ) => Parameters<typeof observeAutoMovieSceneCollision>[0]["layers"],
220
+ ): Pick<IAutoMovieInspectionDiagnostics, "findings" | "coverage"> {
221
+ const { production, geometry, sample, fps } = props;
222
+ if (sample.place === undefined || fps === undefined || !(fps > 0))
223
+ return { findings: [], coverage: [] };
224
+ const seconds: number = sample.time.filmSeconds;
225
+ // The output index at or after this second, from the delivery schedule when
226
+ // known; otherwise rounded up past binary rounding of seconds * fps.
227
+ const index: number =
228
+ sample.time.outputFrame ?? Math.ceil(seconds * fps - 2 ** -20);
229
+ const from: number = (index - 1) / fps;
230
+ const playback: IFilmProduction["playback"] = production.playback;
231
+ const relation: string =
232
+ playback === undefined || !(from >= 0)
233
+ ? "continuous"
234
+ : classifyAutoMoviePlaybackBoundary({
235
+ sequence: playback.sequence,
236
+ timeline: playback.timeline,
237
+ before: from,
238
+ after: seconds,
239
+ ...(playback.discontinuities === undefined
240
+ ? {}
241
+ : { discontinuities: playback.discontinuities }),
242
+ }).boundary;
243
+ return observeAutoMovieCollisionMotion({
244
+ time: sample.time,
245
+ fromSeconds: Math.max(0, from),
246
+ continuous: relation !== "cut" && relation !== "discontinuity",
247
+ place: sample.place,
248
+ layers: layersAt,
249
+ geometry,
250
+ limits: MOTION_LIMITS[sample.mode],
251
+ });
252
+ }
@@ -6,6 +6,7 @@ import { subjects } from "./subjects";
6
6
  mountAutoMovieInspectorPage({
7
7
  root: document.getElementById("root")!,
8
8
  subjects: subjects(null),
9
+ captureCommand: ["pnpm", "run", "capture"],
9
10
  location: window.location,
10
11
  history: window.history,
11
12
  });
@@ -1,43 +1,55 @@
1
1
  import {
2
2
  markAutoMovieContacts,
3
3
  markAutoMovieSkeleton,
4
+ markAutoMovieSupportWrenches,
4
5
  } from "@automovie/engine";
5
6
  import type { IAutoMovieMark } from "@automovie/interface";
6
7
 
7
8
  import type { IFilmProduction } from "./IFilmProduction";
8
9
 
9
10
  /**
10
- * Every mark a mounted film supplies at an exact second: its own `marks`, then, when it supplies a physical performance, the skeleton of its displayed bodies (`joint`, `bone`) and the contact forces of that second (`contact`), as the engine's producers draw them.
11
+ * Every mark a mounted film supplies at an exact second: its own `marks`, then, when it supplies a physical performance, the skeleton of its displayed bodies (`joint`, `bone`), the contact forces of that second (`contact`) and, when the performance supplies its support wrenches, the allocated support force and any shortfall (`support/allocated`, `support/shortfall`), as the engine's producers draw them.
11
12
  *
12
13
  * The Viewer page and the draw-only page both hand these to the inspection, so `marks=joint` or `marks=contact` draws the same thing in every host. Call it after the film's `seek` to the same second.
13
14
  *
14
15
  * @evidence contracts/development/common.md#meaningful-documentation States what is gathered, from which producers and kinds, who calls it and when.
15
- * @evidence contracts/development/implementation.md#principled-implementation The skeleton and the contacts are the engine's mark producers fed from the performance the film displays, so the picture shows the state the film was placed in, not a second model.
16
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Concatenation of the film's marks and the two producers; drawing them is the inspection's.
17
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No body, bone or contact is named here; the scale of a force arrow is the film's own `metresPerNewton`.
18
- * @evidence contracts/development/implementation.md#efficient-algorithms Linear in the film's marks, the displayed bodies' joints and the contact receipts' steps.
19
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure gathering of one second.
20
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns fresh marks and keeps nothing.
16
+ * @evidence contracts/development/implementation.md#principled-implementation The skeleton, contacts and support wrenches are the engine's mark producers fed from the performance the film displays, so the picture shows the state the film was placed in, not a second model. No body, bone or contact is named here; the scale of every force arrow is the film's own `metresPerNewton`, and the support step is the performance's own cache interval.
17
+ * @evidence contracts/development/implementation.md#efficient-algorithms Concatenation of the film's marks and the three producers; drawing them is the inspection's. Linear in the film's marks, the displayed bodies' joints, the contact receipts' steps and the support wrench records. A pure gathering of one second. Returns fresh marks and keeps nothing.
21
18
  */
22
19
  export function markFilmProduction(
23
20
  production: Pick<IFilmProduction, "marks" | "performance">,
24
21
  seconds: number,
25
22
  ): IAutoMovieMark[] {
26
23
  const performance: IFilmProduction["performance"] = production.performance;
24
+ if (performance === undefined)
25
+ return [...(production.marks?.(seconds) ?? [])];
26
+ const supports:
27
+ | ReturnType<NonNullable<typeof performance.supports>>
28
+ | undefined = performance.supports?.();
27
29
  return [
28
30
  ...(production.marks?.(seconds) ?? []),
29
- ...(performance === undefined
31
+ ...markAutoMovieSkeleton({
32
+ bodies: performance.bodies,
33
+ frame: performance.frame(),
34
+ }),
35
+ ...markAutoMovieContacts({
36
+ receipts: performance.contacts(),
37
+ seconds,
38
+ metresPerNewton: performance.metresPerNewton,
39
+ ...(performance.maximumArrowLength === undefined
40
+ ? {}
41
+ : { maximumLength: performance.maximumArrowLength }),
42
+ ...(performance.ownership === undefined
43
+ ? {}
44
+ : { ownership: performance.ownership() }),
45
+ }),
46
+ ...(supports === undefined
30
47
  ? []
31
- : [
32
- ...markAutoMovieSkeleton({
33
- bodies: performance.bodies,
34
- frame: performance.frame(),
35
- }),
36
- ...markAutoMovieContacts({
37
- receipts: performance.contacts(),
38
- seconds,
39
- metresPerNewton: performance.metresPerNewton,
40
- }),
41
- ]),
48
+ : markAutoMovieSupportWrenches({
49
+ wrenches: supports.wrenches,
50
+ interval: supports.interval,
51
+ seconds,
52
+ metresPerNewton: performance.metresPerNewton,
53
+ })),
42
54
  ];
43
55
  }
@@ -0,0 +1,43 @@
1
+ import type { IAutoMovieInspectionDiagnostics } from "@automovie/interface";
2
+ import { HumanVerdictInspection } from "@automovie/motions";
3
+
4
+ import type { IFilmProduction } from "./IFilmProduction";
5
+
6
+ /**
7
+ * The findings and coverage one inspection packet carries.
8
+ *
9
+ * @evidence contracts/development/common.md#meaningful-documentation States which part of the inspection diagnostics one verdict packet carries.
10
+ * @evidence contracts/development/design.md#principled-representation Picks its members from the interface's inspection diagnostics, so the packet keeps the inspector's own shape. Derives the members from the interface type instead of restating them.
11
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Carries only the two members the verdict reader fills; the rest of the diagnostics stays with the inspector.
12
+ */
13
+ export type FilmVerdictPacket = Pick<
14
+ IAutoMovieInspectionDiagnostics,
15
+ "findings" | "coverage"
16
+ >;
17
+
18
+ /**
19
+ * The verdict reader of one mounted film: reads the film's human performance
20
+ * through `IFilmProduction.humanPerformance` the first time it is called and
21
+ * answers every later call with the same findings and coverage.
22
+ *
23
+ * The report judges the whole performance, which costs seconds to minutes, so a
24
+ * capture or delivery run keeps it for the run; the mount that owns the run
25
+ * owns the reader. A film without the member has no reader.
26
+ *
27
+ * @param production The film.
28
+ * @returns The memoizing reader, or `undefined` for a film without a human
29
+ * performance.
30
+ * @evidence contracts/development/common.md#meaningful-documentation States what the reader reads, when, and that it is kept for the run.
31
+ * @evidence contracts/development/implementation.md#principled-implementation Reads the film's performance once through motions' report mapper and keeps the mapped packet. A film without the member has no reader, so no verdict coverage is invented.
32
+ * @evidence contracts/development/implementation.md#efficient-algorithms One closure holding the packet, filled at the first call. The report is read once per run and its mapping is linear in the report. Every sample of the run shares the one packet. Keeps only the mapped packet, never the performance, and the mount's disposal drops the reader.
33
+ */
34
+ export function readFilmVerdicts(
35
+ production: IFilmProduction,
36
+ ): (() => FilmVerdictPacket) | undefined {
37
+ const source: IFilmProduction["humanPerformance"] =
38
+ production.humanPerformance?.bind(production);
39
+ if (source === undefined) return undefined;
40
+ let packet: FilmVerdictPacket | undefined;
41
+ return (): FilmVerdictPacket =>
42
+ (packet ??= HumanVerdictInspection.read(source()));
43
+ }
@@ -8,12 +8,8 @@ import type { IFilm } from "./IFilm";
8
8
  * empty registry throws an error that lists the registered names.
9
9
  *
10
10
  * @evidence contracts/development/common.md#meaningful-documentation The comment states when the name may be omitted and every refusal, and the return names the selected film.
11
- * @evidence contracts/development/implementation.md#principled-implementation Own-property lookup keeps inherited object keys such as toString from resolving as films, and an omitted name resolves only when one film exists, so a production with several films never plays an unintended one.
12
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One pure function serves the render and review commands, so both select by the same rule; the inspector page selects through the draw subjects' own rule.
13
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No film name is special-cased, and nothing falls back to the first film when the choice is ambiguous.
14
- * @evidence contracts/development/implementation.md#efficient-algorithms Listing the registry is linear in its film count, which is small; lookup is constant time.
15
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each call selects from its arguments alone; there is no shared work to reuse.
16
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only the returned pair and an error message are allocated; nothing is retained.
11
+ * @evidence contracts/development/implementation.md#principled-implementation Own-property lookup keeps inherited object keys such as toString from resolving as films, and an omitted name resolves only when one film exists, so a production with several films never plays an unintended one. No film name is special-cased, and nothing falls back to the first film when the choice is ambiguous.
12
+ * @evidence contracts/development/implementation.md#efficient-algorithms One pure function serves the render and review commands, so both select by the same rule; the inspector page selects through the draw subjects' own rule. Listing the registry is linear in its film count, which is small; lookup is constant time. Each call selects from its arguments alone; there is no shared work to reuse. Only the returned pair and an error message are allocated; nothing is retained.
17
13
  */
18
14
  export function selectFilm(
19
15
  films: Readonly<Record<string, IFilm>>,