@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
@@ -0,0 +1,95 @@
1
+ import type {
2
+ IAutoMovieFilmOptics,
3
+ IAutoMovieRenderSoftPropFrame,
4
+ } from "@automovie/interface";
5
+ import type { IAutoMovieDrawScene } from "@automovie/render";
6
+ import { TestValidator } from "@nestia/e2e";
7
+ import * as THREE from "three";
8
+
9
+ import type { IFilm } from "../../src/IFilm";
10
+ import type { IFilmProduction } from "../../src/IFilmProduction";
11
+ import { subjectOfFilm } from "../../src/subjectOfFilm";
12
+
13
+ /**
14
+ * A film becomes its draw subject with every placement passed through: the shot
15
+ * and its shot-local time of `seekShot` unclamped, the film second clamped to
16
+ * the running time, and the soft props read after every placement.
17
+ *
18
+ * Scenarios, on a 15 s film whose production records each call:
19
+ *
20
+ * 1. `seekShot` of shot A at −1/64 s, a shutter sample's handle, during film
21
+ * second 20 places A at −1/64 s during 15 s, then reads the soft props at 15
22
+ * s.
23
+ * 2. `seek` and `place` at −1 s place the film at 0 s, each then reading the soft
24
+ * props at 0 s, and `optics` at 20 s reads the film's optics at 15 s.
25
+ * 3. A film without `seekShot` gives a subject without it.
26
+ *
27
+ * @evidence contracts/development/common.md#meaningful-documentation Lists the three scenarios and the placements and readings each pins.
28
+ * @evidence contracts/development/testing.md#behavioral-verification Creates the subject through `subjectOfFilm`, the mapping `src/subjects.ts` uses, and asserts the arguments the production receives in order; a clamped shot-local time, an unclamped film second, a dropped soft-prop read after `seekShot` or a stubbed `seekShot` fails. A unit test with an in-memory film, discovered by test/index.ts; it prepares the physical geometry queries but starts no Viewer, browser or render.
29
+ * @evidence contracts/development/testing.md#independent-expectations The clamp's ends are zero and the literal 15 s running time, and −1/64 s is exactly representable. Shot and film placements, times before zero and past the end, and a film with and without `seekShot`.
30
+ */
31
+ export async function test_subject_of_film(): Promise<void> {
32
+ const calls: string[] = [];
33
+ const film: (seekShot: boolean) => IFilm = (seekShot: boolean): IFilm => ({
34
+ durationSeconds: 15,
35
+ fps: 24,
36
+ create: async (): Promise<IFilmProduction> => ({
37
+ scene: new THREE.Scene(),
38
+ camera: new THREE.PerspectiveCamera(),
39
+ seek: (seconds: number): void => {
40
+ calls.push(`seek ${seconds}`);
41
+ },
42
+ ...(seekShot
43
+ ? {
44
+ seekShot: (
45
+ shot: string,
46
+ seconds: number,
47
+ filmSeconds: number,
48
+ ): void => {
49
+ calls.push(`seekShot ${shot} ${seconds} ${filmSeconds}`);
50
+ },
51
+ }
52
+ : {}),
53
+ softPropsAt: (seconds: number): IAutoMovieRenderSoftPropFrame[] => {
54
+ calls.push(`softProps ${seconds}`);
55
+ return [];
56
+ },
57
+ optics: (seconds: number): IAutoMovieFilmOptics => {
58
+ calls.push(`optics ${seconds}`);
59
+ return { ev100: 10, toneMapping: "none" };
60
+ },
61
+ dispose: (): void => {},
62
+ }),
63
+ });
64
+ const subject: IAutoMovieDrawScene = await subjectOfFilm(
65
+ "film",
66
+ film(true),
67
+ ).create();
68
+
69
+ // 1. A shot placement.
70
+ await subject.seekShot!("shot:a", -1 / 64, 20);
71
+ TestValidator.equals(
72
+ "seekShot passes the shot-local time unclamped and clamps the film second",
73
+ calls.splice(0),
74
+ [`seekShot shot:a ${-1 / 64} 15`, "softProps 15"],
75
+ );
76
+
77
+ // 2. Film placements and a reader.
78
+ await subject.seek(-1);
79
+ subject.place!(-1);
80
+ subject.optics!(20);
81
+ TestValidator.equals(
82
+ "film placements and readers take the clamped film second",
83
+ calls.splice(0),
84
+ ["seek 0", "softProps 0", "seek 0", "softProps 0", "optics 15"],
85
+ );
86
+ subject.dispose();
87
+
88
+ // 3. A film without seekShot.
89
+ const bare: IAutoMovieDrawScene = await subjectOfFilm(
90
+ "film",
91
+ film(false),
92
+ ).create();
93
+ TestValidator.equals("no seekShot", bare.seekShot, undefined);
94
+ bare.dispose();
95
+ }
@@ -10,10 +10,8 @@ import { assessTestExecution } from "../../helpers/assessTestExecution";
10
10
  * 2. Assertion failures, invalid timestamps and reversed timestamps fail.
11
11
  *
12
12
  * @evidence contracts/development/common.md#meaningful-documentation The comment lists the two scenarios, accepted elapsed durations and failed records, and the runner status each pins.
13
- * @evidence contracts/development/testing.md#behavioral-verification Calls the runner's assessment function with literal execution records and asserts the pass state and elapsed milliseconds; a discarded assertion error, accepted invalid timing or an invented duration limit fails.
14
- * @evidence contracts/development/testing.md#independent-expectations Expected elapsed times are the differences between literal UTC instants, zero and 60000 milliseconds; an Error is a failure by the runner's definition.
15
- * @evidence contracts/development/testing.md#distinguishing-cases Cases cover zero and long elapsed time, an assertion failure, malformed start and end instants and reversed timing. Process exit and DynamicExecutor import belong to the runner source.
16
- * @evidence contracts/development/testing.md#execution-ownership A pure unit test with literal records, discovered by test/index.ts as an exported test_ function; it spawns no process.
13
+ * @evidence contracts/development/testing.md#behavioral-verification Calls the runner's assessment function with literal execution records and asserts the pass state and elapsed milliseconds; a discarded assertion error, accepted invalid timing or an invented duration limit fails. A pure unit test with literal records, discovered by test/index.ts as an exported test_ function; it spawns no process.
14
+ * @evidence contracts/development/testing.md#independent-expectations Expected elapsed times are the differences between literal UTC instants, zero and 60000 milliseconds; an Error is a failure by the runner's definition. Cases cover zero and long elapsed time, an assertion failure, malformed start and end instants and reversed timing. Process exit and DynamicExecutor import belong to the runner source.
17
15
  */
18
16
  export function test_test_execution(): void {
19
17
  const started_at: string = "2026-01-01T00:00:00.000Z";
@@ -11,10 +11,8 @@ import { selectTestFiles } from "../../helpers/selectTestFiles";
11
11
  * 3. Empty discovery and excluding every selected file throw.
12
12
  *
13
13
  * @evidence contracts/development/common.md#meaningful-documentation The comment lists the three scenarios, default and grouped selection, malformed options and empty or fully excluded selection, and the selection rule each pins.
14
- * @evidence contracts/development/testing.md#behavioral-verification Calls the runner's selection helper on supplied basenames and compares the exact selected set or the thrown refusal; widened selection or an ignored invalid option fails.
15
- * @evidence contracts/development/testing.md#independent-expectations Expected subsets follow from literal filenames and the runner's substring include and exclude semantics.
16
- * @evidence contracts/development/testing.md#distinguishing-cases Cases cover default selection, repeated and equals-form include groups with exclusion, exclusion alone, a singleton, duplicate basenames, an unchanged input array, each malformed option, unmatched terms, excluding every match and empty discovery. Discovery and import belong to DynamicExecutor.
17
- * @evidence contracts/development/testing.md#execution-ownership A pure unit test with in-memory names, discovered by test/index.ts as an exported test_ function; it reads no file system and starts no process.
14
+ * @evidence contracts/development/testing.md#behavioral-verification Calls the runner's selection helper on supplied basenames and compares the exact selected set or the thrown refusal; widened selection or an ignored invalid option fails. A pure unit test with in-memory names, discovered by test/index.ts as an exported test_ function; it reads no file system and starts no process.
15
+ * @evidence contracts/development/testing.md#independent-expectations Expected subsets follow from literal filenames and the runner's substring include and exclude semantics. Cases cover default selection, repeated and equals-form include groups with exclusion, exclusion alone, a singleton, duplicate basenames, an unchanged input array, each malformed option, unmatched terms, excluding every match and empty discovery. Discovery and import belong to DynamicExecutor.
18
16
  */
19
17
  export function test_test_selection(): void {
20
18
  const names: string[] = ["test_walk.ts", "test_turn.ts", "test_lift.ts"];
@@ -1,8 +1,9 @@
1
1
  import type { DynamicExecutor } from "@nestia/e2e";
2
2
 
3
3
  /**
4
- * Preserve assertion failures and require valid, nondecreasing executor timestamps.
5
- * Milliseconds describe the run; elapsed duration has no acceptance threshold.
4
+ * Preserve assertion failures and require valid, nondecreasing executor
5
+ * timestamps. Milliseconds describe the run; elapsed duration has no acceptance
6
+ * threshold.
6
7
  */
7
8
  export function assessTestExecution(
8
9
  execution: Pick<
@@ -13,10 +14,6 @@ export function assessTestExecution(
13
14
  const started: number = new Date(execution.started_at).getTime();
14
15
  const completed: number = new Date(execution.completed_at).getTime();
15
16
  const elapsedMs: number | null =
16
- Number.isFinite(started) &&
17
- Number.isFinite(completed) &&
18
- completed >= started
19
- ? completed - started
20
- : null;
17
+ completed >= started ? completed - started : null;
21
18
  return { passed: execution.error === null && elapsedMs !== null, elapsedMs };
22
19
  }
@@ -0,0 +1,199 @@
1
+ import { AutoMovieHumanCanonicalBody } from "@automovie/human";
2
+ import type {
3
+ IAutoMovieHumanCanonicalBody,
4
+ IAutoMovieHumanParameters,
5
+ IAutoMovieMotionHumanBody,
6
+ IAutoMovieMotionHumanPerformance,
7
+ } from "@automovie/interface";
8
+ import {
9
+ HumanChain,
10
+ HumanPerformance,
11
+ createHumanBody,
12
+ } from "@automovie/motions";
13
+
14
+ /**
15
+ * An average adult man's Human parameters, millimetres and degrees as the Human
16
+ * package reads them.
17
+ */
18
+ const PARAMETERS: IAutoMovieHumanParameters = {
19
+ body: {
20
+ anatomy: {
21
+ sex: "male",
22
+ bodyFatPercentage: 20.559,
23
+ stature: 1755.81,
24
+ chestCircumference: 990.59,
25
+ bustPointWidth: 215.732,
26
+ underbustCircumference: 925.389,
27
+ sideNeckToBustPoint: 272.277,
28
+ waistCircumference: 839.057,
29
+ hipCircumference: 982.954,
30
+ neckBaseCircumference: 408.198,
31
+ neckCircumference: 379.386,
32
+ upperArmLength: 340.792,
33
+ forearmLength: 269.841,
34
+ elbowCircumference: 276.93,
35
+ wristCircumference: 174.15,
36
+ thighCircumference: 595.925,
37
+ kneeCircumference: 386.139,
38
+ calfCircumference: 377.802,
39
+ handCircumference: 213.736,
40
+ backNeckToWaist: 402.793,
41
+ acrossBackShoulderWidth: 419.895,
42
+ highHipCircumference: 882.419,
43
+ upperArmCircumference: 340.26,
44
+ forearmCircumference: 279.278,
45
+ inseam: 739.002,
46
+ },
47
+ },
48
+ head: {
49
+ length: 197.089,
50
+ cephalicIndex: 76.949,
51
+ circumference: 567.581,
52
+ height: 227.179,
53
+ faceHeight: 127.187,
54
+ faceWidth: 140.437,
55
+ mandibularWidth: 104.475,
56
+ minimumFrontalWidth: 111.373,
57
+ mouthOpening: 54,
58
+ mandibularLaterotrusion: 11,
59
+ face: {
60
+ eyePair: {
61
+ left: {
62
+ palpebralFissureLength: 28.793,
63
+ palpebralFissureHeight: 8.318,
64
+ },
65
+ right: {
66
+ palpebralFissureLength: 28.793,
67
+ palpebralFissureHeight: 8.318,
68
+ },
69
+ },
70
+ intercanthalWidth: 32.692,
71
+ nose: {
72
+ width: 36.091,
73
+ height: 56.594,
74
+ protrusion: 20.998,
75
+ },
76
+ mouth: {
77
+ width: 50.888,
78
+ upperVermilionHeight: 7.499,
79
+ lowerVermilionHeight: 8.699,
80
+ },
81
+ },
82
+ earPair: {
83
+ left: {
84
+ length: 64.658,
85
+ breadth: 30.821,
86
+ protrusion: 24.198,
87
+ },
88
+ right: {
89
+ length: 64.658,
90
+ breadth: 30.821,
91
+ protrusion: 24.198,
92
+ },
93
+ },
94
+ },
95
+ extremities: {
96
+ hands: {
97
+ left: {
98
+ handLength: 193.765,
99
+ palmLength: 116.78,
100
+ handBreadth: 90.41,
101
+ thumbLength: 58.661,
102
+ },
103
+ right: {
104
+ handLength: 193.765,
105
+ palmLength: 116.78,
106
+ handBreadth: 90.41,
107
+ thumbLength: 58.661,
108
+ },
109
+ },
110
+ feet: {
111
+ left: {
112
+ footLength: 269.653,
113
+ footBreadth: 100.594,
114
+ ankleHeight: 67.063,
115
+ },
116
+ right: {
117
+ footLength: 269.653,
118
+ footBreadth: 100.594,
119
+ ankleHeight: 67.063,
120
+ },
121
+ },
122
+ },
123
+ appearance: {
124
+ skin: {
125
+ oiliness: 0.3,
126
+ wrinkles: 0,
127
+ seed: 51003,
128
+ },
129
+ hair: {
130
+ style: "short",
131
+ color: "black",
132
+ length: 100,
133
+ curl: "II",
134
+ hairline: "rectangular",
135
+ },
136
+ browPair: {
137
+ left: {
138
+ color: "black",
139
+ },
140
+ right: {
141
+ color: "black",
142
+ },
143
+ },
144
+ lashPair: {
145
+ left: {
146
+ color: "black",
147
+ length: 8,
148
+ },
149
+ right: {
150
+ color: "black",
151
+ length: 8,
152
+ },
153
+ },
154
+ underwear: {
155
+ bottom: "boxerBriefs",
156
+ top: "none",
157
+ color: "#3D454B",
158
+ },
159
+ },
160
+ } as IAutoMovieHumanParameters;
161
+
162
+ /**
163
+ * A performance of two average men who stand for one second on one floor point,
164
+ * so their bodies occupy the same space and the verdict report holds one
165
+ * partner finding.
166
+ *
167
+ * @param subjects The two performers' subjects.
168
+ * @returns The performance.
169
+ * @evidence contracts/development/common.md#meaningful-documentation States what the performance holds and the one violation it plants.
170
+ * @evidence contracts/development/implementation.md#principled-implementation Prepares one canonical body from the parameters and stands two performers on the origin. The body is a prepared Human body, not a stand-in, and the two performers differ only in subject.
171
+ * @evidence contracts/development/implementation.md#efficient-algorithms Prepare the body, place two performers, compose two stands. One body preparation and one composition, both closed form. Both performers share the one prepared body. Holds only the returned performance.
172
+ */
173
+ export function overlappingPerformance(
174
+ subjects: readonly [string, string],
175
+ ): IAutoMovieMotionHumanPerformance {
176
+ const prepared: IAutoMovieHumanCanonicalBody.IBody =
177
+ AutoMovieHumanCanonicalBody.prepare(PARAMETERS, {
178
+ mass: 78.365,
179
+ id: "man",
180
+ });
181
+ const body: IAutoMovieMotionHumanBody = createHumanBody(
182
+ prepared.skeleton,
183
+ prepared.profile,
184
+ );
185
+ const [a, b]: readonly [string, string] = subjects;
186
+ return new HumanPerformance({
187
+ seed: "overlap",
188
+ performers: [a, b].map((subject: string) => ({
189
+ subject,
190
+ body,
191
+ at: { x: 0, y: 0, z: 0 },
192
+ yaw: 0,
193
+ proficiency: { level: "trained" as const },
194
+ })),
195
+ composition: HumanChain.subject(a)
196
+ .stand({ hold: 1 })
197
+ .with(HumanChain.subject(b).stand({ hold: 1 })).node,
198
+ });
199
+ }
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "extends": "../tsconfig.json",
3
3
  "compilerOptions": {
4
+ "lib": ["ESNext"],
5
+ "types": ["node"],
4
6
  "noEmit": true
5
- }
7
+ },
8
+ "include": ["index.ts", "helpers", "features"]
6
9
  }
@@ -4,6 +4,7 @@
4
4
  "lib": ["ESNext", "DOM", "DOM.Iterable"],
5
5
  "module": "esnext",
6
6
  "moduleResolution": "bundler",
7
+ "rewriteRelativeImportExtensions": true,
7
8
  "verbatimModuleSyntax": true,
8
9
  "isolatedModules": true,
9
10
  "esModuleInterop": true,
@@ -16,12 +17,7 @@
16
17
  "rootDir": ".",
17
18
  "noEmitOnError": true,
18
19
  "inlineSourceMap": true,
19
- "inlineSources": true,
20
- "plugins": [
21
- {
22
- "transform": "@ttsc/lint"
23
- }
24
- ]
20
+ "inlineSources": true
25
21
  },
26
22
  "include": [
27
23
  "lint.config.ts",
@@ -5,7 +5,22 @@ import { defineConfig } from "vite";
5
5
  /** Scratch names belong to this production, including when its parent uses one. */
6
6
  const productionRoot: string = fileURLToPath(new URL(".", import.meta.url));
7
7
 
8
- /** The production's inspector page; generated evidence and capture scratch never reload it. `automovie capture`, `render` and `inspect` build their own pages with this configuration. */
8
+ /**
9
+ * Linked SDKs resolve to TypeScript and would otherwise load one module per
10
+ * request.
11
+ */
12
+ const linkedSdk: string[] = [
13
+ "@automovie/engine",
14
+ "@automovie/motions",
15
+ "@automovie/render",
16
+ "@automovie/viewer",
17
+ ].filter((id: string): boolean => import.meta.resolve(id).endsWith(".ts"));
18
+
19
+ /**
20
+ * The production's inspector page; generated evidence and capture scratch never
21
+ * reload it. `automovie capture`, `render` and `inspect` build their own pages
22
+ * with this configuration.
23
+ */
9
24
  export default defineConfig({
10
25
  resolve: {
11
26
  // Published SDK CommonJS imports must share the browser's ESM Three.js;
@@ -17,6 +32,11 @@ export default defineConfig({
17
32
  },
18
33
  ],
19
34
  },
35
+ optimizeDeps: {
36
+ include: linkedSdk,
37
+ // A linked SDK can change without touching the production's lockfile.
38
+ force: linkedSdk.length !== 0,
39
+ },
20
40
  build: {
21
41
  target: "es2022",
22
42
  // Preserve lazy initialization across the published SDK's require cycles.
@@ -27,7 +47,10 @@ export default defineConfig({
27
47
  port: 5173,
28
48
  strictPort: true,
29
49
  watch: {
30
- /** Match scratch components inside the project; ancestor names cannot hide source. */
50
+ /**
51
+ * Match scratch components inside the project; ancestor names cannot hide
52
+ * source.
53
+ */
31
54
  ignored: (file: string): boolean => {
32
55
  const local: string = relative(
33
56
  productionRoot,
@@ -1,40 +1,21 @@
1
1
  # {{name}}
2
2
 
3
- An AutoMovie workspace lets productions share skills, contracts, an AutoMovie release and workspace packages. Follow each production's README for its workflow.
3
+ An AutoMovie workspace for productions that share instructions, package versions and code.
4
4
 
5
- ## Layout
5
+ ## Add a production
6
6
 
7
- | Path | Holds |
8
- | --- | --- |
9
- | `AGENTS.md`, `CLAUDE.md`, `.agents/skills` | The skills and bundled contracts every production follows |
10
- | `movies/shorts/<name>` | A short production, written brief → screenplay |
11
- | `movies/series/<name>` | A long production, written settings → treatments → scripts → screenplay |
12
- | `packages/<name>` | The workspace's own libraries that several productions import |
13
- | `pnpm-workspace.yaml` | Workspace members and the named `catalogs` of versions every production uses through `catalog:<name>` |
7
+ Use Node.js 22.23.2 or later and pnpm. Run these commands from the workspace root.
14
8
 
15
- A production is the directory holding its `PROJECT.md`, `README.md`, `src`, `test`, `docs` and configuration, and its commands run there. Its own work and language contracts live in its `docs/contracts`.
16
-
17
- ## First run
18
-
19
- Use Node.js 22.23.2 or later with pnpm, and run these at the workspace root:
20
-
21
- ```bash
9
+ ```powershell
22
10
  pnpm install
23
- pnpm automovie add shorts/<name>
11
+ pnpm automovie add shorts/my-film
24
12
  pnpm install
25
13
  ```
26
14
 
27
- `pnpm automovie add shorts/<name>` or `pnpm automovie add series/<name>` creates the production from the installed scaffold and fills any missing dependency catalog entries. Existing pins and overrides keep their values. The package name is the lowercased, npm-safe form of `<name>`, unless you supply `--name <package>`. Run `pnpm install` again to link the production, then follow its README.
28
-
29
- ## Packages
15
+ Use `series/<name>` for a long production. The add command creates `movies/shorts/my-film` and fills missing catalog entries in `pnpm-workspace.yaml`, keeping existing pins. Open the new directory and follow its README. Its own commands run from the directory with `PROJECT.md`.
30
16
 
31
- Put code that several productions share in `packages/<name>` as an ordinary pnpm package with its own `package.json`, and depend on it from a production with `"<package>": "workspace:^"`. Code serving one production stays in that production.
17
+ ## Share code
32
18
 
33
- ## Commands
19
+ Put libraries several productions use under `packages/` and declare them in each consumer with a `workspace:^` dependency. Keep shared agent instructions at this root in [`AGENTS.md`](AGENTS.md) and `.agents/skills/`.
34
20
 
35
- | Command | Purpose |
36
- | --- | --- |
37
- | `pnpm lint` | Every member's `lint` |
38
- | `pnpm evidence` | Every member's `evidence` |
39
- | `pnpm test` | Every member's `test` |
40
- | `pnpm --filter <name> <script>` | One member's script, such as `pnpm --filter <name> dev` |
21
+ From the root, run `pnpm lint` or `pnpm test` to check all workspace members. Use `pnpm --filter <name> <script>` for one member.
@@ -2,7 +2,7 @@
2
2
  "name": "{{name}}",
3
3
  "private": true,
4
4
  "type": "module",
5
- "version": "0.3.4",
5
+ "version": "0.4.0",
6
6
  "license": "MIT",
7
7
  "description": "An AutoMovie workspace of productions and their shared packages.",
8
8
  "engines": {
@@ -1,23 +1,23 @@
1
- /**
2
- * What {@link createAutoMovieScaffold} creates.
3
- *
4
- * @evidence contracts/development/design.md#principled-representation The record holds only what differs between creations: the installation kind and the name. Dependency versions are fixed when the package is built, so a caller cannot pin a scaffold to ranges the package was not built with.
5
- * @evidence contracts/development/design.md#minimal-and-owned-surface `kind` selects the layers and generated files, and `name` fills the one per-project token; the name rule lives in `assertScaffoldProjectName`.
6
- * @evidence contracts/development/design.md#prohibited-design-shortcuts No override or raw token field lets a caller bypass the name rule or the built versions.
7
- * @evidence contracts/development/common.md#meaningful-documentation Each member states its effect on the created files.
8
- */
1
+ /** What {@link createAutoMovieScaffold} creates. */
9
2
  export interface IAutoMovieScaffoldProps {
10
3
  /**
11
4
  * The installation created.
12
5
  *
13
- * - `production`: a single production in its own repository, with the shared instructions and a `pnpm-workspace.yaml` holding its dependency catalogs.
14
- * - `workspace`: a pnpm workspace root for `movies/shorts/*`, `movies/series/*` and `packages/*`, with the shared instructions and the catalogs every production uses.
15
- * - `workspace-production`: a production inside such a workspace, three levels below the root whose instructions and catalogs it uses.
6
+ * - `production`: a single production in its own repository, with the shared
7
+ * instructions and a `pnpm-workspace.yaml` holding its dependency
8
+ * catalogs.
9
+ * - `workspace`: a pnpm workspace root for `movies/shorts/*`, `movies/series/*`
10
+ * and `packages/*`, with the shared instructions and the catalogs every
11
+ * production uses.
12
+ * - `workspace-production`: a production inside such a workspace, three levels
13
+ * below the root whose instructions and catalogs it uses.
16
14
  */
17
15
  kind: "production" | "workspace" | "workspace-production";
18
16
 
19
17
  /**
20
- * The project's or workspace's name, written into its `package.json` and README heading after trimming. `assertScaffoldProjectName` lists the refused names.
18
+ * The project's or workspace's name, written into its `package.json` and
19
+ * README heading after trimming. `assertScaffoldProjectName` lists the
20
+ * refused names.
21
21
  */
22
22
  name: string;
23
23
  }
@@ -1,19 +1,17 @@
1
1
  /**
2
- * Trim a project name and refuse one that cannot serve as a portable directory segment and JSON string.
2
+ * Trim a project name and refuse one that cannot serve as a portable directory
3
+ * segment and JSON string.
3
4
  *
4
- * The name is trimmed, then refused when empty, `.` or `..`, ending in `.`, containing `<>:"/\|?*` or an ASCII control character, or matching the ASCII device-name pattern `con`, `prn`, `aux`, `nul`, `com1` through `com9`, or `lpt1` through `lpt9`, with or without an extension. These checks prevent separators and JSON string delimiters; they do not establish npm package-name validity or every filesystem's name and length restrictions.
5
+ * The name is trimmed, then refused when empty, `.` or `..`, ending in `.`,
6
+ * containing `<>:"/\|?*` or an ASCII control character, or matching the ASCII
7
+ * device-name pattern `con`, `prn`, `aux`, `nul`, `com1` through `com9`, or
8
+ * `lpt1` through `lpt9`, with or without an extension. These checks prevent
9
+ * separators and JSON string delimiters; they do not establish npm package-name
10
+ * validity or every filesystem's name and length restrictions.
5
11
  *
6
12
  * @param name The name as supplied.
7
13
  * @returns The trimmed name.
8
14
  * @throws When the name is refused.
9
- *
10
- * @evidence contracts/development/implementation.md#principled-implementation After trim, explicit separator, ASCII control and device-name checks refuse the listed unsafe names; excluding quote, backslash and ASCII controls keeps plain substitution inside package.json's JSON string valid. This is a partial filename policy rather than npm-name or universal filesystem validation.
11
- * @evidence contracts/development/implementation.md#clear-and-simple-structure `createAutoMovieScaffold` admits its `{{name}}` through this one rule, so a production, a workspace and a workspace production refuse the same names.
12
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A refused name throws; nothing is rewritten into an admitted spelling.
13
- * @evidence contracts/development/common.md#meaningful-documentation The comment states the trim, every refusal and why it matters, and what the rule does not establish.
14
- * @evidence contracts/development/implementation.md#efficient-algorithms Two regular-expression scans and fixed comparisons cost linear time in the name's length.
15
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call checks one supplied name once.
16
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function returns a string and retains nothing.
17
15
  */
18
16
  export const assertScaffoldProjectName: (name: string) => string = (
19
17
  name: string,
@@ -7,35 +7,46 @@ import { listAutoMovieScaffoldFiles } from "./listAutoMovieScaffoldFiles";
7
7
  import { renderAutoMovieWorkspace } from "./renderAutoMovieWorkspace";
8
8
  import { scaffoldSharedSkillPath } from "./scaffoldSharedSkillPath";
9
9
 
10
- /** The package root: `src` under ttsx and `lib` when published both sit one level below it. */
10
+ /**
11
+ * The package root: `src` under ttsx and `lib` when published both sit one
12
+ * level below it.
13
+ */
11
14
  const PACKAGE: string = path.resolve(__dirname, "..");
12
15
 
13
16
  /**
14
- * Create the files of a new AutoMovie installation as a `{ posixPath: content }` map.
17
+ * Create the files of a new AutoMovie installation as a `{ posixPath: content
18
+ * }` map.
15
19
  *
16
20
  * The map joins scaffold layers with generated files, by `kind`:
17
21
  *
18
- * - `production`: the `instructions` and `production` layers, `pnpm-workspace.yaml` with catalogs and no packages, and `evidence.config.ts` reading the production's own `.agents/skills`.
19
- * - `workspace`: the `instructions` and `workspace` layers, and `pnpm-workspace.yaml` listing `movies/shorts/*`, `movies/series/*` and `packages/*` with the same catalogs.
20
- * - `workspace-production`: the `production` layer, and `evidence.config.ts` reading the workspace root's `../../../.agents/skills`.
22
+ * - `production`: the `instructions` and `production` layers,
23
+ * `pnpm-workspace.yaml` with catalogs and no packages, and
24
+ * `evidence.config.ts` reading the production's own `.agents/skills`.
25
+ * - `workspace`: the `instructions` and `workspace` layers, and
26
+ * `pnpm-workspace.yaml` listing `movies/shorts/*`, `movies/series/*` and
27
+ * `packages/*` with the same catalogs.
28
+ * - `workspace-production`: the `production` layer, and `evidence.config.ts`
29
+ * reading the workspace root's `../../../.agents/skills`.
21
30
  *
22
- * A `$<name>` placeholder under a layer's `.agents/skills` is replaced by the repository skill item the build copied to `generated/skills`. A layer's root `_gitignore` becomes `.gitignore`, because npm pack renames a packed `.gitignore`. `{{name}}` becomes the admitted name and `{{skills}}` the path of the skills the production reads. Line endings become LF. Every `package.json` dependency is a `catalog:` reference: the `automovie` catalog ranges this package's own version, and the others carry the ranges the build read from the repository's `pnpm-workspace.yaml`.
31
+ * A `$<name>` placeholder under a layer's `.agents/skills` is replaced by the
32
+ * repository skill item the build copied to `generated/skills`. A layer's root
33
+ * `_gitignore` becomes `.gitignore`, because npm pack renames a packed
34
+ * `.gitignore`. `{{name}}` becomes the admitted name and `{{skills}}` the path
35
+ * of the skills the production reads. Line endings become LF. Every
36
+ * `package.json` dependency is a `catalog:` reference: the `automovie` catalog
37
+ * ranges this package's own version, and the others carry the ranges the build
38
+ * read from the repository's `pnpm-workspace.yaml`.
23
39
  *
24
- * Instruction Markdown omits reserved `<!-- @source ... -->` lines after shared skills are expanded. A source paragraph leaves one blank line between its heading and the body.
40
+ * Instruction Markdown omits reserved `<!-- @source ... -->` lines after shared
41
+ * skills are expanded. A source paragraph leaves one blank line between its
42
+ * heading and the body.
25
43
  *
26
44
  * Nothing is written; the caller writes the map.
27
45
  *
28
46
  * @param props The installation kind and its name.
29
47
  * @returns The files, keyed by path relative to the installation directory.
30
- * @throws When the name is refused, when the build outputs are missing, or when two sources produce the same path.
31
- *
32
- * @evidence contracts/development/implementation.md#principled-implementation Layers are read from the installed package, so the map always matches the shipped scaffold. Catalog ranges come from the build's record of the repository catalogs and the automovie range from this package's own manifest, so a workspace and its productions resolve the release the package belongs to. A duplicate path throws instead of keeping either source.
33
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One function owns the whole map for every kind; the kind decides only which layers are read and which generated files are added, and writing is left to the caller.
34
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No file is named except the generated `pnpm-workspace.yaml` and `evidence.config.ts`, whose content differs by kind, and the root `_gitignore`, whose rename npm pack forces.
35
- * @evidence contracts/development/common.md#meaningful-documentation The comment lists every kind's layers and generated files, shared skills, source notes, renames, substitutions, line endings, version sources and failures.
36
- * @evidence contracts/development/implementation.md#efficient-algorithms Each file is listed and read once. Source lines, tokens and line endings take a fixed number of linear scans, plus each directory's sort.
37
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call reads the scaffold as installed now, once per creation.
38
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Files are read with `readFileSync`, which releases its handle before returning; only the returned map, owned by the caller, outlives the call.
48
+ * @throws When the name is refused, when the build outputs are missing, or when
49
+ * two sources produce the same path.
39
50
  */
40
51
  export const createAutoMovieScaffold: (
41
52
  props: IAutoMovieScaffoldProps,
@@ -72,7 +83,10 @@ export const createAutoMovieScaffold: (
72
83
  return files;
73
84
  };
74
85
 
75
- /** Pass every file of one scaffold layer to `add`, expanding shared-skill placeholders and renaming the root `_gitignore`. */
86
+ /**
87
+ * Pass every file of one scaffold layer to `add`, expanding shared-skill
88
+ * placeholders and renaming the root `_gitignore`.
89
+ */
76
90
  const readLayer = (
77
91
  layer: "instructions" | "production" | "workspace",
78
92
  add: (relative: string, content: string) => void,
@@ -109,7 +123,10 @@ const readLayer = (
109
123
  }
110
124
  };
111
125
 
112
- /** The `evidence.config.ts` of a production, reading its own skills or, inside a workspace, the root's. */
126
+ /**
127
+ * The `evidence.config.ts` of a production, reading its own skills or, inside a
128
+ * workspace, the root's.
129
+ */
113
130
  const renderEvidenceConfig = (workspace: boolean): string =>
114
131
  [
115
132
  `import { createEvidenceConfig } from "@automovie/evidence";`,