@automovie/template 0.0.0-stage → 0.0.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 (751) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -2
  3. package/build/resolveTemplateVersions.ts +92 -0
  4. package/build/syncScaffoldInstructions.ts +28 -0
  5. package/lib/AUTOMOVIE_TEMPLATE_CATALOGS.d.ts +14 -0
  6. package/lib/AUTOMOVIE_TEMPLATE_CATALOGS.js +52 -0
  7. package/lib/AUTOMOVIE_TEMPLATE_CATALOGS.js.map +1 -0
  8. package/lib/AUTOMOVIE_TEMPLATE_VERSIONS.d.ts +2 -0
  9. package/lib/AUTOMOVIE_TEMPLATE_VERSIONS.js +42 -0
  10. package/lib/AUTOMOVIE_TEMPLATE_VERSIONS.js.map +1 -0
  11. package/lib/AutoMovieScaffoldLayer.d.ts +15 -0
  12. package/lib/AutoMovieScaffoldLayer.js +3 -0
  13. package/lib/AutoMovieScaffoldLayer.js.map +1 -0
  14. package/lib/FILE_ATTRIBUTE_DIRECTORY.d.ts +2 -0
  15. package/lib/FILE_ATTRIBUTE_DIRECTORY.js +6 -0
  16. package/lib/FILE_ATTRIBUTE_DIRECTORY.js.map +1 -0
  17. package/lib/IAutoMovieCatalogVersionProps.d.ts +16 -0
  18. package/lib/IAutoMovieCatalogVersionProps.js +3 -0
  19. package/lib/IAutoMovieCatalogVersionProps.js.map +1 -0
  20. package/lib/IAutoMovieScaffoldProps.d.ts +14 -0
  21. package/lib/IAutoMovieScaffoldProps.js +3 -0
  22. package/lib/IAutoMovieScaffoldProps.js.map +1 -0
  23. package/lib/IAutoMovieScaffoldSourceEntry.d.ts +18 -0
  24. package/lib/IAutoMovieScaffoldSourceEntry.js +3 -0
  25. package/lib/IAutoMovieScaffoldSourceEntry.js.map +1 -0
  26. package/lib/IAutoMovieTemplateDependencyVersionsProps.d.ts +17 -0
  27. package/lib/IAutoMovieTemplateDependencyVersionsProps.js +3 -0
  28. package/lib/IAutoMovieTemplateDependencyVersionsProps.js.map +1 -0
  29. package/lib/IAutoMovieWorkspacePackageVersions.d.ts +34 -0
  30. package/lib/IAutoMovieWorkspacePackageVersions.js +3 -0
  31. package/lib/IAutoMovieWorkspacePackageVersions.js.map +1 -0
  32. package/lib/IBoundChild.d.ts +71 -0
  33. package/lib/IBoundChild.js +3 -0
  34. package/lib/IBoundChild.js.map +1 -0
  35. package/lib/IBoundChildStatus.d.ts +20 -0
  36. package/lib/IBoundChildStatus.js +3 -0
  37. package/lib/IBoundChildStatus.js.map +1 -0
  38. package/lib/IBoundParent.d.ts +61 -0
  39. package/lib/IBoundParent.js +3 -0
  40. package/lib/IBoundParent.js.map +1 -0
  41. package/lib/IBoundParentStatus.d.ts +14 -0
  42. package/lib/IBoundParentStatus.js +3 -0
  43. package/lib/IBoundParentStatus.js.map +1 -0
  44. package/lib/ICreateResult.d.ts +27 -0
  45. package/lib/ICreateResult.js +3 -0
  46. package/lib/ICreateResult.js.map +1 -0
  47. package/lib/IScaffoldCompletedFilePublicationOutcome.d.ts +16 -0
  48. package/lib/IScaffoldCompletedFilePublicationOutcome.js +3 -0
  49. package/lib/IScaffoldCompletedFilePublicationOutcome.js.map +1 -0
  50. package/lib/IScaffoldCompletedPublication.d.ts +15 -0
  51. package/lib/IScaffoldCompletedPublication.js +3 -0
  52. package/lib/IScaffoldCompletedPublication.js.map +1 -0
  53. package/lib/IScaffoldFileSnapshot.d.ts +24 -0
  54. package/lib/IScaffoldFileSnapshot.js +3 -0
  55. package/lib/IScaffoldFileSnapshot.js.map +1 -0
  56. package/lib/IScaffoldParentPublicationRequest.d.ts +26 -0
  57. package/lib/IScaffoldParentPublicationRequest.js +3 -0
  58. package/lib/IScaffoldParentPublicationRequest.js.map +1 -0
  59. package/lib/IScaffoldPartialFilePublicationOutcome.d.ts +22 -0
  60. package/lib/IScaffoldPartialFilePublicationOutcome.js +3 -0
  61. package/lib/IScaffoldPartialFilePublicationOutcome.js.map +1 -0
  62. package/lib/IScaffoldPhysicalDirectory.d.ts +20 -0
  63. package/lib/IScaffoldPhysicalDirectory.js +3 -0
  64. package/lib/IScaffoldPhysicalDirectory.js.map +1 -0
  65. package/lib/IScaffoldPosixConstants.d.ts +24 -0
  66. package/lib/IScaffoldPosixConstants.js +3 -0
  67. package/lib/IScaffoldPosixConstants.js.map +1 -0
  68. package/lib/IScaffoldPublicationEntry.d.ts +20 -0
  69. package/lib/IScaffoldPublicationEntry.js +3 -0
  70. package/lib/IScaffoldPublicationEntry.js.map +1 -0
  71. package/lib/IScaffoldPublicationFailure.d.ts +18 -0
  72. package/lib/IScaffoldPublicationFailure.js +3 -0
  73. package/lib/IScaffoldPublicationFailure.js.map +1 -0
  74. package/lib/IScaffoldPublicationOptions.d.ts +17 -0
  75. package/lib/IScaffoldPublicationOptions.js +3 -0
  76. package/lib/IScaffoldPublicationOptions.js.map +1 -0
  77. package/lib/IScaffoldPublicationReceipt.d.ts +25 -0
  78. package/lib/IScaffoldPublicationReceipt.js +3 -0
  79. package/lib/IScaffoldPublicationReceipt.js.map +1 -0
  80. package/lib/IScaffoldRefusedFilePublicationOutcome.d.ts +18 -0
  81. package/lib/IScaffoldRefusedFilePublicationOutcome.js +3 -0
  82. package/lib/IScaffoldRefusedFilePublicationOutcome.js.map +1 -0
  83. package/lib/IScaffoldSyncPlan.d.ts +25 -0
  84. package/lib/IScaffoldSyncPlan.js +3 -0
  85. package/lib/IScaffoldSyncPlan.js.map +1 -0
  86. package/lib/IScaffoldSyncProps.d.ts +16 -0
  87. package/lib/IScaffoldSyncProps.js +3 -0
  88. package/lib/IScaffoldSyncProps.js.map +1 -0
  89. package/lib/IWindowsFileInformation.d.ts +20 -0
  90. package/lib/IWindowsFileInformation.js +3 -0
  91. package/lib/IWindowsFileInformation.js.map +1 -0
  92. package/lib/IWindowsLibrary.d.ts +127 -0
  93. package/lib/IWindowsLibrary.js +3 -0
  94. package/lib/IWindowsLibrary.js.map +1 -0
  95. package/lib/SCAFFOLD_SYNC_STATE_FILE.d.ts +4 -0
  96. package/lib/SCAFFOLD_SYNC_STATE_FILE.js +8 -0
  97. package/lib/SCAFFOLD_SYNC_STATE_FILE.js.map +1 -0
  98. package/lib/ScaffoldFilePublicationOutcome.d.ts +14 -0
  99. package/lib/ScaffoldFilePublicationOutcome.js +3 -0
  100. package/lib/ScaffoldFilePublicationOutcome.js.map +1 -0
  101. package/lib/ScaffoldParentChangedError.d.ts +11 -0
  102. package/lib/ScaffoldParentChangedError.js +19 -0
  103. package/lib/ScaffoldParentChangedError.js.map +1 -0
  104. package/lib/ScaffoldPublicationError.d.ts +17 -0
  105. package/lib/ScaffoldPublicationError.js +46 -0
  106. package/lib/ScaffoldPublicationError.js.map +1 -0
  107. package/lib/assertOrdinaryFile.d.ts +13 -0
  108. package/lib/assertOrdinaryFile.js +20 -0
  109. package/lib/assertOrdinaryFile.js.map +1 -0
  110. package/lib/assertOrdinarySingleLinkFile.d.ts +13 -0
  111. package/lib/assertOrdinarySingleLinkFile.js +22 -0
  112. package/lib/assertOrdinarySingleLinkFile.js.map +1 -0
  113. package/lib/assertScaffoldOwnership.d.ts +13 -0
  114. package/lib/assertScaffoldOwnership.js +24 -0
  115. package/lib/assertScaffoldOwnership.js.map +1 -0
  116. package/lib/assertScaffoldPhysicalDirectory.d.ts +16 -0
  117. package/lib/assertScaffoldPhysicalDirectory.js +26 -0
  118. package/lib/assertScaffoldPhysicalDirectory.js.map +1 -0
  119. package/lib/assertScaffoldProjectName.d.ts +18 -0
  120. package/lib/assertScaffoldProjectName.js +34 -0
  121. package/lib/assertScaffoldProjectName.js.map +1 -0
  122. package/lib/attachScaffoldSyncState.d.ts +18 -0
  123. package/lib/attachScaffoldSyncState.js +30 -0
  124. package/lib/attachScaffoldSyncState.js.map +1 -0
  125. package/lib/captureEmptyScaffoldPhysicalDirectory.d.ts +13 -0
  126. package/lib/captureEmptyScaffoldPhysicalDirectory.js +69 -0
  127. package/lib/captureEmptyScaffoldPhysicalDirectory.js.map +1 -0
  128. package/lib/captureScaffoldFile.d.ts +13 -0
  129. package/lib/captureScaffoldFile.js +67 -0
  130. package/lib/captureScaffoldFile.js.map +1 -0
  131. package/lib/captureScaffoldPhysicalDirectory.d.ts +13 -0
  132. package/lib/captureScaffoldPhysicalDirectory.js +63 -0
  133. package/lib/captureScaffoldPhysicalDirectory.js.map +1 -0
  134. package/lib/combineScaffoldFailures.d.ts +19 -0
  135. package/lib/combineScaffoldFailures.js +32 -0
  136. package/lib/combineScaffoldFailures.js.map +1 -0
  137. package/lib/createAutoMovieCatalogVersionResolver.d.ts +17 -0
  138. package/lib/createAutoMovieCatalogVersionResolver.js +64 -0
  139. package/lib/createAutoMovieCatalogVersionResolver.js.map +1 -0
  140. package/lib/createScaffoldSyncState.d.ts +12 -0
  141. package/lib/createScaffoldSyncState.js +26 -0
  142. package/lib/createScaffoldSyncState.js.map +1 -0
  143. package/lib/createScaffoldVariables.d.ts +25 -0
  144. package/lib/createScaffoldVariables.js +41 -0
  145. package/lib/createScaffoldVariables.js.map +1 -0
  146. package/lib/ensureScaffoldBaseDirectory.d.ts +19 -0
  147. package/lib/ensureScaffoldBaseDirectory.js +89 -0
  148. package/lib/ensureScaffoldBaseDirectory.js.map +1 -0
  149. package/lib/ensureScaffoldFileDirectory.d.ts +25 -0
  150. package/lib/ensureScaffoldFileDirectory.js +103 -0
  151. package/lib/ensureScaffoldFileDirectory.js.map +1 -0
  152. package/lib/index.d.ts +47 -0
  153. package/lib/index.js +64 -0
  154. package/lib/index.js.map +1 -0
  155. package/lib/inside.d.ts +12 -0
  156. package/lib/inside.js +57 -0
  157. package/lib/inside.js.map +1 -0
  158. package/lib/isScaffoldInstruction.d.ts +12 -0
  159. package/lib/isScaffoldInstruction.js +29 -0
  160. package/lib/isScaffoldInstruction.js.map +1 -0
  161. package/lib/listAutoMovieScaffoldFiles.d.ts +17 -0
  162. package/lib/listAutoMovieScaffoldFiles.js +87 -0
  163. package/lib/listAutoMovieScaffoldFiles.js.map +1 -0
  164. package/lib/loadWindowsLibrary.d.ts +13 -0
  165. package/lib/loadWindowsLibrary.js +180 -0
  166. package/lib/loadWindowsLibrary.js.map +1 -0
  167. package/lib/mergeScaffoldFiles.d.ts +18 -0
  168. package/lib/mergeScaffoldFiles.js +37 -0
  169. package/lib/mergeScaffoldFiles.js.map +1 -0
  170. package/lib/missingPath.d.ts +12 -0
  171. package/lib/missingPath.js +18 -0
  172. package/lib/missingPath.js.map +1 -0
  173. package/lib/nativeError.d.ts +12 -0
  174. package/lib/nativeError.js +17 -0
  175. package/lib/nativeError.js.map +1 -0
  176. package/lib/openPosixParent.d.ts +13 -0
  177. package/lib/openPosixParent.js +135 -0
  178. package/lib/openPosixParent.js.map +1 -0
  179. package/lib/openWindowsParent.d.ts +13 -0
  180. package/lib/openWindowsParent.js +224 -0
  181. package/lib/openWindowsParent.js.map +1 -0
  182. package/lib/overwriteScaffoldFile.d.ts +22 -0
  183. package/lib/overwriteScaffoldFile.js +214 -0
  184. package/lib/overwriteScaffoldFile.js.map +1 -0
  185. package/lib/physicalDirectoryIdentity.d.ts +15 -0
  186. package/lib/physicalDirectoryIdentity.js +65 -0
  187. package/lib/physicalDirectoryIdentity.js.map +1 -0
  188. package/lib/physicalVersion.d.ts +13 -0
  189. package/lib/physicalVersion.js +18 -0
  190. package/lib/physicalVersion.js.map +1 -0
  191. package/lib/planScaffoldPublication.d.ts +22 -0
  192. package/lib/planScaffoldPublication.js +100 -0
  193. package/lib/planScaffoldPublication.js.map +1 -0
  194. package/lib/planScaffoldSync.d.ts +14 -0
  195. package/lib/planScaffoldSync.js +102 -0
  196. package/lib/planScaffoldSync.js.map +1 -0
  197. package/lib/publishFiles.d.ts +23 -0
  198. package/lib/publishFiles.js +124 -0
  199. package/lib/publishFiles.js.map +1 -0
  200. package/lib/publishNativeScaffoldFile.d.ts +21 -0
  201. package/lib/publishNativeScaffoldFile.js +211 -0
  202. package/lib/publishNativeScaffoldFile.js.map +1 -0
  203. package/lib/publishScaffoldCandidate.d.ts +24 -0
  204. package/lib/publishScaffoldCandidate.js +70 -0
  205. package/lib/publishScaffoldCandidate.js.map +1 -0
  206. package/lib/readAutoMovieScaffoldSources.d.ts +20 -0
  207. package/lib/readAutoMovieScaffoldSources.js +103 -0
  208. package/lib/readAutoMovieScaffoldSources.js.map +1 -0
  209. package/lib/readScaffoldSyncFile.d.ts +16 -0
  210. package/lib/readScaffoldSyncFile.js +64 -0
  211. package/lib/readScaffoldSyncFile.js.map +1 -0
  212. package/lib/renderScaffold.d.ts +19 -0
  213. package/lib/renderScaffold.js +33 -0
  214. package/lib/renderScaffold.js.map +1 -0
  215. package/lib/renderScaffoldEntries.d.ts +20 -0
  216. package/lib/renderScaffoldEntries.js +106 -0
  217. package/lib/renderScaffoldEntries.js.map +1 -0
  218. package/lib/renderScaffoldInstructions.d.ts +17 -0
  219. package/lib/renderScaffoldInstructions.js +23 -0
  220. package/lib/renderScaffoldInstructions.js.map +1 -0
  221. package/lib/renderScaffoldLayer.d.ts +20 -0
  222. package/lib/renderScaffoldLayer.js +28 -0
  223. package/lib/renderScaffoldLayer.js.map +1 -0
  224. package/lib/renderTemplate.d.ts +19 -0
  225. package/lib/renderTemplate.js +56 -0
  226. package/lib/renderTemplate.js.map +1 -0
  227. package/lib/renderWorkspaceProductionScaffold.d.ts +19 -0
  228. package/lib/renderWorkspaceProductionScaffold.js +30 -0
  229. package/lib/renderWorkspaceProductionScaffold.js.map +1 -0
  230. package/lib/renderWorkspaceScaffold.d.ts +19 -0
  231. package/lib/renderWorkspaceScaffold.js +33 -0
  232. package/lib/renderWorkspaceScaffold.js.map +1 -0
  233. package/lib/replaceSharedScaffoldFile.d.ts +30 -0
  234. package/lib/replaceSharedScaffoldFile.js +106 -0
  235. package/lib/replaceSharedScaffoldFile.js.map +1 -0
  236. package/lib/resolveAutoMovieCatalogVersion.d.ts +19 -0
  237. package/lib/resolveAutoMovieCatalogVersion.js +24 -0
  238. package/lib/resolveAutoMovieCatalogVersion.js.map +1 -0
  239. package/lib/resolveAutoMovieTemplateDependencyVersions.d.ts +19 -0
  240. package/lib/resolveAutoMovieTemplateDependencyVersions.js +62 -0
  241. package/lib/resolveAutoMovieTemplateDependencyVersions.js.map +1 -0
  242. package/lib/resolveScaffoldPosixConstants.d.ts +13 -0
  243. package/lib/resolveScaffoldPosixConstants.js +44 -0
  244. package/lib/resolveScaffoldPosixConstants.js.map +1 -0
  245. package/lib/scaffoldAssetDirectory.d.ts +19 -0
  246. package/lib/scaffoldAssetDirectory.js +63 -0
  247. package/lib/scaffoldAssetDirectory.js.map +1 -0
  248. package/lib/scaffoldPhysicalIdentity.d.ts +18 -0
  249. package/lib/scaffoldPhysicalIdentity.js +22 -0
  250. package/lib/scaffoldPhysicalIdentity.js.map +1 -0
  251. package/lib/scaffoldSharedSkillDirectory.d.ts +17 -0
  252. package/lib/scaffoldSharedSkillDirectory.js +62 -0
  253. package/lib/scaffoldSharedSkillDirectory.js.map +1 -0
  254. package/lib/scaffoldSharedSkillPath.d.ts +17 -0
  255. package/lib/scaffoldSharedSkillPath.js +66 -0
  256. package/lib/scaffoldSharedSkillPath.js.map +1 -0
  257. package/lib/skills/3d-modeling/conditioning.md +82 -0
  258. package/lib/skills/3d-modeling/crafting.md +82 -0
  259. package/lib/skills/3d-modeling/diffusion.md +34 -0
  260. package/lib/skills/3d-modeling/inspection.md +54 -0
  261. package/lib/skills/3d-modeling/lofting.md +43 -0
  262. package/lib/skills/3d-modeling/modularization.md +31 -0
  263. package/lib/skills/3d-modeling/recovery.md +29 -0
  264. package/lib/skills/3d-modeling/rigging.md +97 -0
  265. package/lib/skills/3d-modeling/sources.md +29 -0
  266. package/lib/skills/contracts/development/common.md +13 -0
  267. package/lib/skills/contracts/development/design.md +28 -0
  268. package/lib/skills/contracts/development/implementation.md +49 -0
  269. package/lib/skills/contracts/development/testing.md +27 -0
  270. package/lib/skills/development/repair.md +13 -0
  271. package/lib/skills/documentation/SKILL.md +25 -0
  272. package/lib/skills/documentation/writing.md +51 -0
  273. package/lib/skills/motion/authoring.md +51 -0
  274. package/lib/skills/motion/contacts.md +39 -0
  275. package/lib/skills/motion/laws.md +23 -0
  276. package/lib/skills/motion/layers.md +7 -0
  277. package/lib/skills/motion/transitions.md +27 -0
  278. package/lib/skills/motion/variation.md +23 -0
  279. package/lib/skills/motion/verification.md +36 -0
  280. package/lib/skills/prompting/SKILL.md +80 -0
  281. package/lib/skills/visual-debugging/capture.md +60 -0
  282. package/lib/skills/visual-debugging/comparison.md +35 -0
  283. package/lib/skills/visual-debugging/correction-rounds.md +34 -0
  284. package/lib/skills/visual-debugging/passes.md +29 -0
  285. package/lib/skills/visual-debugging/rendering-cost.md +5 -0
  286. package/lib/syncScaffold.d.ts +19 -0
  287. package/lib/syncScaffold.js +28 -0
  288. package/lib/syncScaffold.js.map +1 -0
  289. package/lib/writeFiles.d.ts +20 -0
  290. package/lib/writeFiles.js +33 -0
  291. package/lib/writeFiles.js.map +1 -0
  292. package/lib/writeScaffoldFile.d.ts +35 -0
  293. package/lib/writeScaffoldFile.js +107 -0
  294. package/lib/writeScaffoldFile.js.map +1 -0
  295. package/lib/writtenVersion.d.ts +13 -0
  296. package/lib/writtenVersion.js +18 -0
  297. package/lib/writtenVersion.js.map +1 -0
  298. package/package.json +59 -3
  299. package/scaffold/instructions/.agents/skills/$documentation +0 -0
  300. package/scaffold/instructions/.agents/skills/$prompting +0 -0
  301. package/scaffold/instructions/.agents/skills/3d-modeling/$conditioning.md +0 -0
  302. package/scaffold/instructions/.agents/skills/3d-modeling/$crafting.md +0 -0
  303. package/scaffold/instructions/.agents/skills/3d-modeling/$diffusion.md +0 -0
  304. package/scaffold/instructions/.agents/skills/3d-modeling/$inspection.md +0 -0
  305. package/scaffold/instructions/.agents/skills/3d-modeling/$lofting.md +0 -0
  306. package/scaffold/instructions/.agents/skills/3d-modeling/$modularization.md +0 -0
  307. package/scaffold/instructions/.agents/skills/3d-modeling/$recovery.md +0 -0
  308. package/scaffold/instructions/.agents/skills/3d-modeling/$rigging.md +0 -0
  309. package/scaffold/instructions/.agents/skills/3d-modeling/$sources.md +0 -0
  310. package/scaffold/instructions/.agents/skills/3d-modeling/SKILL.md +32 -0
  311. package/scaffold/instructions/.agents/skills/3d-modeling/coarse-forms.md +25 -0
  312. package/scaffold/instructions/.agents/skills/audio/SKILL.md +28 -0
  313. package/scaffold/instructions/.agents/skills/audio/acquisition.md +25 -0
  314. package/scaffold/instructions/.agents/skills/audio/local-speech.md +11 -0
  315. package/scaffold/instructions/.agents/skills/audio/sound-effects.md +29 -0
  316. package/scaffold/instructions/.agents/skills/contracts/SKILL.md +41 -0
  317. package/scaffold/instructions/.agents/skills/contracts/development/$common.md +0 -0
  318. package/scaffold/instructions/.agents/skills/contracts/development/$design.md +0 -0
  319. package/scaffold/instructions/.agents/skills/contracts/development/$implementation.md +0 -0
  320. package/scaffold/instructions/.agents/skills/contracts/development/$testing.md +0 -0
  321. package/scaffold/instructions/.agents/skills/contracts/development/SKILL.md +22 -0
  322. package/scaffold/instructions/.agents/skills/contracts/development/behaviors.md +25 -0
  323. package/scaffold/instructions/.agents/skills/contracts/development/composition.md +29 -0
  324. package/scaffold/instructions/.agents/skills/contracts/development/entities.md +27 -0
  325. package/scaffold/instructions/.agents/skills/contracts/development/statements/behaviors.md +42 -0
  326. package/scaffold/instructions/.agents/skills/contracts/development/statements/composition.md +32 -0
  327. package/scaffold/instructions/.agents/skills/contracts/development/statements/entities.md +34 -0
  328. package/scaffold/instructions/.agents/skills/contracts/story/SKILL.md +44 -0
  329. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/brief.md +9 -0
  330. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/common.md +9 -0
  331. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/narratives.md +9 -0
  332. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/screenplay.md +9 -0
  333. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/scripts.md +9 -0
  334. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/settings.md +9 -0
  335. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/treatments.md +9 -0
  336. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/common.md +17 -0
  337. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/common.md +9 -0
  338. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/realized.md +9 -0
  339. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/screenplay.md +9 -0
  340. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/scripts.md +9 -0
  341. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/realized.md +9 -0
  342. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/screenplay.md +13 -0
  343. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/scripts.md +9 -0
  344. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/brief.md +9 -0
  345. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/common.md +13 -0
  346. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/index.md +13 -0
  347. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/narratives.md +13 -0
  348. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/review.md +13 -0
  349. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/screenplay.md +13 -0
  350. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/scripts.md +13 -0
  351. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/settings.md +13 -0
  352. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/treatments.md +13 -0
  353. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/brief.md +13 -0
  354. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/common.md +13 -0
  355. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/index.md +13 -0
  356. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/narratives.md +13 -0
  357. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/realized.md +13 -0
  358. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/research.md +13 -0
  359. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/review.md +13 -0
  360. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/screenplay.md +17 -0
  361. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/scripts.md +13 -0
  362. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/settings.md +13 -0
  363. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/treatments.md +13 -0
  364. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/brief.md +21 -0
  365. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/common.md +42 -0
  366. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/narratives.md +8 -0
  367. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/screenplay.md +15 -0
  368. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/scripts.md +11 -0
  369. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/settings.md +25 -0
  370. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/treatments.md +9 -0
  371. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/common.md +94 -0
  372. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/common.md +20 -0
  373. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/realized.md +15 -0
  374. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/screenplay.md +11 -0
  375. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/scripts.md +17 -0
  376. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/realized.md +19 -0
  377. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/screenplay.md +25 -0
  378. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/scripts.md +19 -0
  379. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/brief.md +17 -0
  380. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/common.md +31 -0
  381. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/index.md +15 -0
  382. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/narratives.md +43 -0
  383. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/review.md +37 -0
  384. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/screenplay.md +26 -0
  385. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/scripts.md +26 -0
  386. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/settings.md +38 -0
  387. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/treatments.md +31 -0
  388. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/brief.md +21 -0
  389. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/common.md +15 -0
  390. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/index.md +17 -0
  391. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/narratives.md +41 -0
  392. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/realized.md +17 -0
  393. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/research.md +34 -0
  394. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/review.md +37 -0
  395. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/screenplay.md +82 -0
  396. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/scripts.md +45 -0
  397. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/settings.md +34 -0
  398. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/treatments.md +27 -0
  399. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/upstream/screenplay.md +14 -0
  400. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/upstream/scripts.md +12 -0
  401. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/upstream/treatments.md +10 -0
  402. package/scaffold/instructions/.agents/skills/contracts/story/shared/upstream/screenplay.md +9 -0
  403. package/scaffold/instructions/.agents/skills/contracts/story/shared/upstream/scripts.md +9 -0
  404. package/scaffold/instructions/.agents/skills/contracts/story/shared/upstream/treatments.md +9 -0
  405. package/scaffold/instructions/.agents/skills/development/$repair.md +0 -0
  406. package/scaffold/instructions/.agents/skills/development/SKILL.md +33 -0
  407. package/scaffold/instructions/.agents/skills/development/entities.md +43 -0
  408. package/scaffold/instructions/.agents/skills/development/reuse.md +47 -0
  409. package/scaffold/instructions/.agents/skills/development/source-layout.md +69 -0
  410. package/scaffold/instructions/.agents/skills/development/testing.md +27 -0
  411. package/scaffold/instructions/.agents/skills/evidence/SKILL.md +16 -0
  412. package/scaffold/instructions/.agents/skills/evidence/adoption.md +11 -0
  413. package/scaffold/instructions/.agents/skills/evidence/answering.md +11 -0
  414. package/scaffold/instructions/.agents/skills/evidence/configuration.md +23 -0
  415. package/scaffold/instructions/.agents/skills/image/SKILL.md +69 -0
  416. package/scaffold/instructions/.agents/skills/motion/$authoring.md +0 -0
  417. package/scaffold/instructions/.agents/skills/motion/$contacts.md +0 -0
  418. package/scaffold/instructions/.agents/skills/motion/$laws.md +0 -0
  419. package/scaffold/instructions/.agents/skills/motion/$layers.md +0 -0
  420. package/scaffold/instructions/.agents/skills/motion/$transitions.md +0 -0
  421. package/scaffold/instructions/.agents/skills/motion/$variation.md +0 -0
  422. package/scaffold/instructions/.agents/skills/motion/$verification.md +0 -0
  423. package/scaffold/instructions/.agents/skills/motion/SKILL.md +55 -0
  424. package/scaffold/instructions/.agents/skills/motion/catalog-cases.md +11 -0
  425. package/scaffold/instructions/.agents/skills/motion/control-channels.md +19 -0
  426. package/scaffold/instructions/.agents/skills/motion/frame-evaluation.md +25 -0
  427. package/scaffold/instructions/.agents/skills/motion/method-references.md +23 -0
  428. package/scaffold/instructions/.agents/skills/motion/physical-feedback.md +31 -0
  429. package/scaffold/instructions/.agents/skills/motion/retargeting.md +23 -0
  430. package/scaffold/instructions/.agents/skills/motion/segment-review.md +17 -0
  431. package/scaffold/instructions/.agents/skills/motion/staging.md +29 -0
  432. package/scaffold/instructions/.agents/skills/production/SKILL.md +45 -0
  433. package/scaffold/instructions/.agents/skills/production/assembly.md +30 -0
  434. package/scaffold/instructions/.agents/skills/production/media-records.md +29 -0
  435. package/scaffold/instructions/.agents/skills/production/project-context.md +25 -0
  436. package/scaffold/instructions/.agents/skills/production/stage-caches.md +30 -0
  437. package/scaffold/instructions/.agents/skills/production/sustained-runs.md +21 -0
  438. package/scaffold/instructions/.agents/skills/production/sync-and-reorganization.md +21 -0
  439. package/scaffold/instructions/.agents/skills/review/SKILL.md +24 -0
  440. package/scaffold/instructions/.agents/skills/review/delivery-review.md +65 -0
  441. package/scaffold/instructions/.agents/skills/review/estimation.md +48 -0
  442. package/scaffold/instructions/.agents/skills/review/independent-reading.md +39 -0
  443. package/scaffold/instructions/.agents/skills/review/narrative-rounds.md +53 -0
  444. package/scaffold/instructions/.agents/skills/review/source-review.md +31 -0
  445. package/scaffold/instructions/.agents/skills/story/SKILL.md +20 -0
  446. package/scaffold/instructions/.agents/skills/story/correction/SKILL.md +13 -0
  447. package/scaffold/instructions/.agents/skills/story/correction/inspection.md +29 -0
  448. package/scaffold/instructions/.agents/skills/story/correction/repair.md +35 -0
  449. package/scaffold/instructions/.agents/skills/story/document-layout.md +38 -0
  450. package/scaffold/instructions/.agents/skills/story/evidence/SKILL.md +13 -0
  451. package/scaffold/instructions/.agents/skills/story/evidence/answer-placement.md +13 -0
  452. package/scaffold/instructions/.agents/skills/story/evidence/answer-writing.md +23 -0
  453. package/scaffold/instructions/.agents/skills/story/layers/SKILL.md +17 -0
  454. package/scaffold/instructions/.agents/skills/story/layers/brief.md +29 -0
  455. package/scaffold/instructions/.agents/skills/story/layers/notation.md +34 -0
  456. package/scaffold/instructions/.agents/skills/story/layers/screenplay.md +15 -0
  457. package/scaffold/instructions/.agents/skills/story/layers/scripts.md +11 -0
  458. package/scaffold/instructions/.agents/skills/story/layers/settings.md +39 -0
  459. package/scaffold/instructions/.agents/skills/story/layers/treatments.md +9 -0
  460. package/scaffold/instructions/.agents/skills/story/naturalness/SKILL.md +13 -0
  461. package/scaffold/instructions/.agents/skills/story/naturalness/rewriting.md +17 -0
  462. package/scaffold/instructions/.agents/skills/story/naturalness/transfer.md +11 -0
  463. package/scaffold/instructions/.agents/skills/story/planning/SKILL.md +15 -0
  464. package/scaffold/instructions/.agents/skills/story/planning/direction.md +14 -0
  465. package/scaffold/instructions/.agents/skills/story/planning/discovery.md +20 -0
  466. package/scaffold/instructions/.agents/skills/story/planning/requirements.md +25 -0
  467. package/scaffold/instructions/.agents/skills/story/planning/research.md +25 -0
  468. package/scaffold/instructions/.agents/skills/story/workflow.md +61 -0
  469. package/scaffold/instructions/.agents/skills/video/SKILL.md +29 -0
  470. package/scaffold/instructions/.agents/skills/video/diffusion.md +33 -0
  471. package/scaffold/instructions/.agents/skills/video/generation.md +27 -0
  472. package/scaffold/instructions/.agents/skills/video/prompts.md +51 -0
  473. package/scaffold/instructions/.agents/skills/visual-debugging/$capture.md +0 -0
  474. package/scaffold/instructions/.agents/skills/visual-debugging/$comparison.md +0 -0
  475. package/scaffold/instructions/.agents/skills/visual-debugging/$correction-rounds.md +0 -0
  476. package/scaffold/instructions/.agents/skills/visual-debugging/$passes.md +0 -0
  477. package/scaffold/instructions/.agents/skills/visual-debugging/$rendering-cost.md +0 -0
  478. package/scaffold/instructions/.agents/skills/visual-debugging/SKILL.md +30 -0
  479. package/scaffold/instructions/AGENTS.md +96 -0
  480. package/scaffold/instructions/CLAUDE.md +1 -0
  481. package/scaffold/production/PROJECT.md +3 -0
  482. package/scaffold/production/README.md +146 -0
  483. package/scaffold/production/_gitignore +20 -0
  484. package/scaffold/production/evidence.config.ts +12 -0
  485. package/scaffold/production/index.html +20 -0
  486. package/scaffold/production/lint.config.ts +46 -0
  487. package/scaffold/production/package.json +54 -0
  488. package/scaffold/production/src/IFilm.ts +41 -0
  489. package/scaffold/production/src/IFilmProduction.ts +80 -0
  490. package/scaffold/production/src/clampProductionSeconds.ts +21 -0
  491. package/scaffold/production/src/composition/films/index.ts +10 -0
  492. package/scaffold/production/src/composition/films/starter.ts +45 -0
  493. package/scaffold/production/src/executable/capture.ts +487 -0
  494. package/scaffold/production/src/executable/physics.ts +48 -0
  495. package/scaffold/production/src/executable/planCaptureStills.ts +65 -0
  496. package/scaffold/production/src/executable/recovery/node/artifact/archiveAutoMovieRecoveryModel.ts +171 -0
  497. package/scaffold/production/src/executable/recovery/node/artifact/createAutoMovieRecoveryArtifact.ts +268 -0
  498. package/scaffold/production/src/executable/recovery/node/artifact/index.ts +3 -0
  499. package/scaffold/production/src/executable/recovery/node/artifact/writeAutoMovieRecoveryArtifact.ts +303 -0
  500. package/scaffold/production/src/executable/recovery/node/cli.ts +12 -0
  501. package/scaffold/production/src/executable/recovery/node/index.ts +9 -0
  502. package/scaffold/production/src/executable/recovery/node/internal/IAutoMovieRecoveryMemoryUsage.ts +25 -0
  503. package/scaffold/production/src/executable/recovery/node/internal/RecoveryFileVectorTable.ts +95 -0
  504. package/scaffold/production/src/executable/recovery/node/internal/RecoveryFileVectorTableInput.ts +50 -0
  505. package/scaffold/production/src/executable/recovery/node/internal/createRecoveryFileVectorTable.ts +181 -0
  506. package/scaffold/production/src/executable/recovery/node/internal/observeRecoveryAtlas.ts +492 -0
  507. package/scaffold/production/src/executable/recovery/node/internal/readAutoMovieRecoveryBoundedFile.ts +57 -0
  508. package/scaffold/production/src/executable/recovery/node/internal/readRecoveryCameraImages.ts +80 -0
  509. package/scaffold/production/src/executable/recovery/node/internal/readRecoveryFixedReference.ts +26 -0
  510. package/scaffold/production/src/executable/recovery/node/internal/recovery.ts +272 -0
  511. package/scaffold/production/src/executable/recovery/node/internal/recoveryAtlas.ts +152 -0
  512. package/scaffold/production/src/executable/recovery/node/internal/recoveryCameraMap.ts +113 -0
  513. package/scaffold/production/src/executable/recovery/node/internal/recoveryCameraScene.ts +117 -0
  514. package/scaffold/production/src/executable/recovery/node/internal/recoveryCameras.ts +158 -0
  515. package/scaffold/production/src/executable/recovery/node/internal/recoveryContourPath.ts +185 -0
  516. package/scaffold/production/src/executable/recovery/node/internal/recoveryImages.ts +176 -0
  517. package/scaffold/production/src/executable/recovery/node/internal/recoveryLocal.ts +151 -0
  518. package/scaffold/production/src/executable/recovery/node/internal/recoveryOpen.ts +237 -0
  519. package/scaffold/production/src/executable/recovery/node/mesh/createAutoMovieRecoveryContourFileMesh.ts +265 -0
  520. package/scaffold/production/src/executable/recovery/node/mesh/createAutoMovieRecoveryMeshSpool.ts +252 -0
  521. package/scaffold/production/src/executable/recovery/node/mesh/index.ts +3 -0
  522. package/scaffold/production/src/executable/recovery/node/mesh/readAutoMovieRecoveryMeshFrontier.ts +239 -0
  523. package/scaffold/production/src/executable/recovery/node/publishAutoMovieRecoveryArtifact.ts +63 -0
  524. package/scaffold/production/src/executable/recovery/node/reconstruction/index.ts +1 -0
  525. package/scaffold/production/src/executable/recovery/node/reconstruction/reconstructAutoMovieRecoveryLocal.ts +473 -0
  526. package/scaffold/production/src/executable/recovery/node/runAutoMovieRecoveryCommand.ts +148 -0
  527. package/scaffold/production/src/executable/render/headlessCapture/AutoMovieHeadlessCaptureError.ts +1 -0
  528. package/scaffold/production/src/executable/render/headlessCapture/AutoMovieHeadlessCaptureErrorCode.ts +1 -0
  529. package/scaffold/production/src/executable/render/headlessCapture/AutoMovieHeadlessWaitUntil.ts +1 -0
  530. package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessCaptureOptions.ts +79 -0
  531. package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessCaptureSession.ts +39 -0
  532. package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessFrameWriter.ts +20 -0
  533. package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessLocator.ts +1 -0
  534. package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessPage.ts +1 -0
  535. package/scaffold/production/src/executable/render/headlessCapture/createHeadlessCaptureAdapter.ts +92 -0
  536. package/scaffold/production/src/executable/render/headlessCapture/index.ts +9 -0
  537. package/scaffold/production/src/executable/render/node/IAutoMovieViewerVideoOptions.ts +128 -0
  538. package/scaffold/production/src/executable/render/node/IAutoMovieViewerVideoResult.ts +43 -0
  539. package/scaffold/production/src/executable/render/node/IProductionRenditionClip.ts +44 -0
  540. package/scaffold/production/src/executable/render/node/acquireViewerBrowser.ts +24 -0
  541. package/scaffold/production/src/executable/render/node/addProductionMp4Sample.ts +89 -0
  542. package/scaffold/production/src/executable/render/node/appendLosslessVideoClip.ts +62 -0
  543. package/scaffold/production/src/executable/render/node/assembleProductionChunkVideoMp4.ts +167 -0
  544. package/scaffold/production/src/executable/render/node/assertProductionFeatureUsesRenditionClips.ts +184 -0
  545. package/scaffold/production/src/executable/render/node/assertProductionFeatureUsesRenditionVideo.ts +127 -0
  546. package/scaffold/production/src/executable/render/node/assertProductionRenditionClipDelivery.ts +102 -0
  547. package/scaffold/production/src/executable/render/node/cache/IAutoMovieDirectoryArtifactStore.ts +59 -0
  548. package/scaffold/production/src/executable/render/node/cache/IAutoMovieViewerFrameCacheReport.ts +30 -0
  549. package/scaffold/production/src/executable/render/node/cache/cacheViewerCaptureSession.ts +187 -0
  550. package/scaffold/production/src/executable/render/node/cache/composeViewerFrameKeys.ts +55 -0
  551. package/scaffold/production/src/executable/render/node/cache/createAutoMovieArtifactMiddleware.ts +107 -0
  552. package/scaffold/production/src/executable/render/node/cache/createAutoMovieDirectoryArtifactStore.ts +203 -0
  553. package/scaffold/production/src/executable/render/node/cache/digestAutoMovieSourceTree.ts +66 -0
  554. package/scaffold/production/src/executable/render/node/cache/readViewerFrameStates.ts +95 -0
  555. package/scaffold/production/src/executable/render/node/capture/DEFAULT_CHROME_EXECUTABLE.ts +11 -0
  556. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageOperationFailure.ts +13 -0
  557. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageRenderAndSeeArtifact.ts +30 -0
  558. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageRenderAndSeeOptions.ts +51 -0
  559. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageSequenceMetadata.ts +27 -0
  560. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageSequenceRenderArtifact.ts +44 -0
  561. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageSequenceRenderOptions.ts +43 -0
  562. package/scaffold/production/src/executable/render/node/capture/IAutoMovieSequenceDissolvePixelCheck.ts +39 -0
  563. package/scaffold/production/src/executable/render/node/capture/captureRenderAndSee.ts +233 -0
  564. package/scaffold/production/src/executable/render/node/capture/captureSequenceRenderAndSee.ts +377 -0
  565. package/scaffold/production/src/executable/render/node/capture/index.ts +14 -0
  566. package/scaffold/production/src/executable/render/node/capture/preserveCleanupFailure.ts +34 -0
  567. package/scaffold/production/src/executable/render/node/capture/renderAndSeeCommand.ts +169 -0
  568. package/scaffold/production/src/executable/render/node/capture/renderSequenceAndSeeCommand.ts +165 -0
  569. package/scaffold/production/src/executable/render/node/capture/verifySequenceDissolvePixels.ts +179 -0
  570. package/scaffold/production/src/executable/render/node/conformProductionRenditionVideoMp4.ts +86 -0
  571. package/scaffold/production/src/executable/render/node/conformProductionVisualDeliveryVideoMp4.ts +230 -0
  572. package/scaffold/production/src/executable/render/node/decodeAutoMovieDelivery.ts +253 -0
  573. package/scaffold/production/src/executable/render/node/equalRational.ts +36 -0
  574. package/scaffold/production/src/executable/render/node/exactProductionClockProduct.ts +26 -0
  575. package/scaffold/production/src/executable/render/node/exportModelToGLB.ts +267 -0
  576. package/scaffold/production/src/executable/render/node/index.ts +27 -0
  577. package/scaffold/production/src/executable/render/node/loadModelGltfCore.ts +18 -0
  578. package/scaffold/production/src/executable/render/node/mixAutoMovieAudioCues.ts +74 -0
  579. package/scaffold/production/src/executable/render/node/muxProductionFeatureMp4.ts +170 -0
  580. package/scaffold/production/src/executable/render/node/neutralTrackPresentation.ts +59 -0
  581. package/scaffold/production/src/executable/render/node/normalizeProductionH264Mp4.ts +110 -0
  582. package/scaffold/production/src/executable/render/node/openLosslessVideoTrack.ts +81 -0
  583. package/scaffold/production/src/executable/render/node/parseMp4.ts +46 -0
  584. package/scaffold/production/src/executable/render/node/parseProductionMp4Output.ts +70 -0
  585. package/scaffold/production/src/executable/render/node/parseProductionRenditionClip.ts +92 -0
  586. package/scaffold/production/src/executable/render/node/planViewerVideo.ts +140 -0
  587. package/scaffold/production/src/executable/render/node/probeParsedProductionVideoMp4.ts +48 -0
  588. package/scaffold/production/src/executable/render/node/probeProductionPngPicture.ts +223 -0
  589. package/scaffold/production/src/executable/render/node/probeProductionRenderedMedia.ts +355 -0
  590. package/scaffold/production/src/executable/render/node/probeProductionVideoMp4.ts +27 -0
  591. package/scaffold/production/src/executable/render/node/probeVideoTrack.ts +220 -0
  592. package/scaffold/production/src/executable/render/node/productionRenditionVideoPlan.ts +149 -0
  593. package/scaffold/production/src/executable/render/node/recordViewerPlayback.ts +137 -0
  594. package/scaffold/production/src/executable/render/node/renderViewerFrames.ts +139 -0
  595. package/scaffold/production/src/executable/render/node/renderViewerVideo.ts +301 -0
  596. package/scaffold/production/src/executable/render/node/renderViewerVideoSession.ts +75 -0
  597. package/scaffold/production/src/executable/render/node/residentMp4Box.ts +36 -0
  598. package/scaffold/production/src/executable/render/node/residentPngJs.ts +26 -0
  599. package/scaffold/production/src/executable/render/node/runViewerVideoEncoder.ts +58 -0
  600. package/scaffold/production/src/executable/render/node/sameSampleDescription.ts +43 -0
  601. package/scaffold/production/src/executable/render/node/sameSampleFlags.ts +28 -0
  602. package/scaffold/production/src/executable/render/node/sampleBytes.ts +46 -0
  603. package/scaffold/production/src/executable/render/node/sampleDescription.ts +40 -0
  604. package/scaffold/production/src/executable/render/node/sampleOptions.ts +37 -0
  605. package/scaffold/production/src/executable/render/node/serializeDescriptionBox.ts +29 -0
  606. package/scaffold/production/src/executable/render/node/trimProductionAudioPresentation.ts +115 -0
  607. package/scaffold/production/src/executable/render/node/verifySampleStorage.ts +86 -0
  608. package/scaffold/production/src/executable/render/node/writeViewerFrameSheet.ts +101 -0
  609. package/scaffold/production/src/executable/render.ts +92 -0
  610. package/scaffold/production/src/executable/review.ts +54 -0
  611. package/scaffold/production/src/executable/viewer/inspection/createViewerDiskSource.ts +119 -0
  612. package/scaffold/production/src/executable/viewer/inspection/readViewerMaintainedSourceFiles.ts +64 -0
  613. package/scaffold/production/src/executable/viewer/node/capture/AutoMovieHeadlessCaptureError.ts +41 -0
  614. package/scaffold/production/src/executable/viewer/node/capture/AutoMovieHeadlessCaptureErrorCode.ts +22 -0
  615. package/scaffold/production/src/executable/viewer/node/capture/AutoMovieHeadlessWaitUntil.ts +18 -0
  616. package/scaffold/production/src/executable/viewer/node/capture/IAutoMovieHeadlessLocator.ts +32 -0
  617. package/scaffold/production/src/executable/viewer/node/capture/IAutoMovieHeadlessPage.ts +130 -0
  618. package/scaffold/production/src/executable/viewer/node/capture/IViewerCaptureOptions.ts +38 -0
  619. package/scaffold/production/src/executable/viewer/node/capture/IViewerCaptureSession.ts +41 -0
  620. package/scaffold/production/src/executable/viewer/node/capture/createViewerCaptureSession.ts +154 -0
  621. package/scaffold/production/src/executable/viewer/node/capture/index.ts +8 -0
  622. package/scaffold/production/src/executable/viewer/node/index.ts +2 -0
  623. package/scaffold/production/src/executable/viewer/node/raster/AutoMovieRasterLighting.ts +221 -0
  624. package/scaffold/production/src/executable/viewer/node/raster/AutoMovieRasterSheet.ts +175 -0
  625. package/scaffold/production/src/executable/viewer/node/raster/AutoMovieRasterTarget.ts +282 -0
  626. package/scaffold/production/src/executable/viewer/node/raster/IAutoMovieSceneRaster.ts +62 -0
  627. package/scaffold/production/src/executable/viewer/node/raster/IRasterizeAutoMovieSceneProps.ts +34 -0
  628. package/scaffold/production/src/executable/viewer/node/raster/encodeAutoMovieRasterPng.ts +77 -0
  629. package/scaffold/production/src/executable/viewer/node/raster/index.ts +8 -0
  630. package/scaffold/production/src/executable/viewer/node/raster/rasterizeAutoMovieScene.ts +594 -0
  631. package/scaffold/production/src/executable/viewer/node/raster/stampAutoMovieRasterLabel.ts +120 -0
  632. package/scaffold/production/src/executable/viewer/process/ProcessOwnership.ts +102 -0
  633. package/scaffold/production/src/executable/viewer/process/internal/IProcessChildObservation.ts +18 -0
  634. package/scaffold/production/src/executable/viewer/process/internal/IProcessOwnershipHost.ts +70 -0
  635. package/scaffold/production/src/executable/viewer/process/internal/ProcessOwnershipController.ts +125 -0
  636. package/scaffold/production/src/executable/viewer/process/internal/WindowsProcessOwnershipPrograms.ts +52 -0
  637. package/scaffold/production/src/executable/viewer/process/internal/createNodeProcessOwnershipHost.ts +41 -0
  638. package/scaffold/production/src/executable/viewer/process/internal/decodeLinuxProcessIdentity.ts +22 -0
  639. package/scaffold/production/src/executable/viewer/process/internal/decodePosixProcessIdentity.ts +24 -0
  640. package/scaffold/production/src/executable/viewer/process/internal/decodeWindowsProcessResult.ts +24 -0
  641. package/scaffold/production/src/executable/viewer/process/internal/readNativeProcessIdentity.ts +45 -0
  642. package/scaffold/production/src/executable/viewer/process/internal/requireProcessId.ts +15 -0
  643. package/scaffold/production/src/executable/viewer/process/internal/resolveProcessIdentityReadError.ts +15 -0
  644. package/scaffold/production/src/executable/viewer/process/internal/runWindowsProcessOperation.ts +41 -0
  645. package/scaffold/production/src/executable/viewer/process/internal/selectProcessOwnershipTree.ts +68 -0
  646. package/scaffold/production/src/main.ts +197 -0
  647. package/scaffold/production/src/selectFilm.ts +34 -0
  648. package/scaffold/production/test/features/executable/test_plan_capture_stills.ts +75 -0
  649. package/scaffold/production/test/features/test_clamp_production_seconds.ts +39 -0
  650. package/scaffold/production/test/features/test_select_film.ts +59 -0
  651. package/scaffold/production/test/features/testing/test_test_execution.ts +57 -0
  652. package/scaffold/production/test/features/testing/test_test_selection.ts +78 -0
  653. package/scaffold/production/test/helpers/assessTestExecution.ts +22 -0
  654. package/scaffold/production/test/helpers/selectTestFiles.ts +79 -0
  655. package/scaffold/production/test/index.ts +64 -0
  656. package/scaffold/production/test/tsconfig.json +6 -0
  657. package/scaffold/production/tsconfig.json +34 -0
  658. package/scaffold/production/tsconfig.test.json +9 -0
  659. package/scaffold/production/vite.config.ts +35 -0
  660. package/scaffold/workspace/README.md +42 -0
  661. package/scaffold/workspace/_gitignore +9 -0
  662. package/scaffold/workspace/package.json +19 -0
  663. package/scaffold/workspace/pnpm-workspace.yaml +46 -0
  664. package/src/AUTOMOVIE_TEMPLATE_CATALOGS.ts +48 -0
  665. package/src/AUTOMOVIE_TEMPLATE_VERSIONS.ts +39 -0
  666. package/src/AutoMovieScaffoldLayer.ts +18 -0
  667. package/src/FILE_ATTRIBUTE_DIRECTORY.ts +2 -0
  668. package/src/IAutoMovieCatalogVersionProps.ts +18 -0
  669. package/src/IAutoMovieScaffoldProps.ts +14 -0
  670. package/src/IAutoMovieScaffoldSourceEntry.ts +19 -0
  671. package/src/IAutoMovieTemplateDependencyVersionsProps.ts +19 -0
  672. package/src/IAutoMovieWorkspacePackageVersions.ts +44 -0
  673. package/src/IBoundChild.ts +86 -0
  674. package/src/IBoundChildStatus.ts +24 -0
  675. package/src/IBoundParent.ts +65 -0
  676. package/src/IBoundParentStatus.ts +15 -0
  677. package/src/ICreateResult.ts +35 -0
  678. package/src/IScaffoldCompletedFilePublicationOutcome.ts +17 -0
  679. package/src/IScaffoldCompletedPublication.ts +17 -0
  680. package/src/IScaffoldFileSnapshot.ts +28 -0
  681. package/src/IScaffoldParentPublicationRequest.ts +29 -0
  682. package/src/IScaffoldPartialFilePublicationOutcome.ts +25 -0
  683. package/src/IScaffoldPhysicalDirectory.ts +22 -0
  684. package/src/IScaffoldPosixConstants.ts +30 -0
  685. package/src/IScaffoldPublicationEntry.ts +22 -0
  686. package/src/IScaffoldPublicationFailure.ts +18 -0
  687. package/src/IScaffoldPublicationOptions.ts +19 -0
  688. package/src/IScaffoldPublicationReceipt.ts +29 -0
  689. package/src/IScaffoldRefusedFilePublicationOutcome.ts +20 -0
  690. package/src/IScaffoldSyncPlan.ts +26 -0
  691. package/src/IScaffoldSyncProps.ts +16 -0
  692. package/src/IWindowsFileInformation.ts +24 -0
  693. package/src/IWindowsLibrary.ts +148 -0
  694. package/src/SCAFFOLD_SYNC_STATE_FILE.ts +5 -0
  695. package/src/ScaffoldFilePublicationOutcome.ts +18 -0
  696. package/src/ScaffoldParentChangedError.ts +14 -0
  697. package/src/ScaffoldPublicationError.ts +58 -0
  698. package/src/assertOrdinaryFile.ts +20 -0
  699. package/src/assertOrdinarySingleLinkFile.ts +26 -0
  700. package/src/assertScaffoldOwnership.ts +29 -0
  701. package/src/assertScaffoldPhysicalDirectory.ts +29 -0
  702. package/src/assertScaffoldProjectName.ts +34 -0
  703. package/src/attachScaffoldSyncState.ts +30 -0
  704. package/src/captureEmptyScaffoldPhysicalDirectory.ts +45 -0
  705. package/src/captureScaffoldFile.ts +34 -0
  706. package/src/captureScaffoldPhysicalDirectory.ts +34 -0
  707. package/src/combineScaffoldFailures.ts +35 -0
  708. package/src/createAutoMovieCatalogVersionResolver.ts +117 -0
  709. package/src/createScaffoldSyncState.ts +33 -0
  710. package/src/createScaffoldVariables.ts +50 -0
  711. package/src/ensureScaffoldBaseDirectory.ts +55 -0
  712. package/src/ensureScaffoldFileDirectory.ts +75 -0
  713. package/src/index.ts +48 -0
  714. package/src/inside.ts +25 -0
  715. package/src/isScaffoldInstruction.ts +29 -0
  716. package/src/listAutoMovieScaffoldFiles.ts +56 -0
  717. package/src/loadWindowsLibrary.ts +277 -0
  718. package/src/mergeScaffoldFiles.ts +39 -0
  719. package/src/missingPath.ts +16 -0
  720. package/src/nativeError.ts +15 -0
  721. package/src/openPosixParent.ts +155 -0
  722. package/src/openWindowsParent.ts +305 -0
  723. package/src/overwriteScaffoldFile.ts +262 -0
  724. package/src/physicalDirectoryIdentity.ts +33 -0
  725. package/src/physicalVersion.ts +18 -0
  726. package/src/planScaffoldPublication.ts +100 -0
  727. package/src/planScaffoldSync.ts +122 -0
  728. package/src/publishFiles.ts +120 -0
  729. package/src/publishNativeScaffoldFile.ts +287 -0
  730. package/src/publishScaffoldCandidate.ts +94 -0
  731. package/src/readAutoMovieScaffoldSources.ts +82 -0
  732. package/src/readScaffoldSyncFile.ts +66 -0
  733. package/src/renderScaffold.ts +43 -0
  734. package/src/renderScaffoldEntries.ts +110 -0
  735. package/src/renderScaffoldInstructions.ts +22 -0
  736. package/src/renderScaffoldLayer.ts +38 -0
  737. package/src/renderTemplate.ts +62 -0
  738. package/src/renderWorkspaceProductionScaffold.ts +35 -0
  739. package/src/renderWorkspaceScaffold.ts +43 -0
  740. package/src/replaceSharedScaffoldFile.ts +88 -0
  741. package/src/resolveAutoMovieCatalogVersion.ts +27 -0
  742. package/src/resolveAutoMovieTemplateDependencyVersions.ts +70 -0
  743. package/src/resolveScaffoldPosixConstants.ts +50 -0
  744. package/src/scaffoldAssetDirectory.ts +30 -0
  745. package/src/scaffoldPhysicalIdentity.ts +21 -0
  746. package/src/scaffoldSharedSkillDirectory.ts +25 -0
  747. package/src/scaffoldSharedSkillPath.ts +31 -0
  748. package/src/syncScaffold.ts +38 -0
  749. package/src/writeFiles.ts +48 -0
  750. package/src/writeScaffoldFile.ts +88 -0
  751. package/src/writtenVersion.ts +19 -0
@@ -0,0 +1,22 @@
1
+ import { type IScaffoldPublicationEntry } from "./IScaffoldPublicationEntry";
2
+ /**
3
+ * Validate a rendered file map and freeze it as a publication candidate, before any directory or file is touched.
4
+ *
5
+ * Throws when a value is not a string, a key contains NUL, a target resolves to the root or outside it, or two targets collide. Targets are compared after lower-casing, so `A.txt` and `a.txt` collide on every platform, and a file also collides with any file below it, such as `a` and `a/b`. Lower-casing approximates the case folding of Windows and macOS file systems and does not apply Unicode normalization.
6
+ *
7
+ * @param props.files UTF-8 text keyed by paths resolved against `root`; absolute keys are admitted when their targets remain below it.
8
+ * @param props.root Directory the candidate is published under.
9
+ * @returns Frozen entries in the map's insertion order.
10
+ *
11
+ * @evidence contracts/development/implementation.md#principled-implementation Containment and the ancestor walk's root boundary both use `path.relative`, preserving Windows case-equivalent root spellings instead of looping at the drive root; empty, parent and absolute remainders refuse. Lower-cased target keys detect exact and file-ancestor collisions, approximating case-insensitive file systems without Unicode normalization.
12
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure This owner validates and encodes with one private collision walk; publishFiles coordinates mutation, ensureScaffoldFileDirectory captures descendant directories, and writeScaffoldFile owns target admission.
13
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No path or file name is special-cased; case-only collisions are refused consistently on every platform without claiming complete filesystem-name validation. The runtime string check rejects non-text input from untyped callers rather than selecting a fixture.
14
+ * @evidence contracts/development/common.md#meaningful-documentation The comment lists every refusal, the case-folding rule and its limits, the parameters' meaning, and that entries keep insertion order.
15
+ * @evidence contracts/development/implementation.md#efficient-algorithms Encoding visits total content bytes; collision checks use one map lookup per file and per ancestor below the root, with path-relative, dirname, lower-casing and string-key costs driven by the visited path lengths. The local map holds one entry per file, and there is no pairwise file scan.
16
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The planner runs once per call over its own input and has no completed or in-flight work from another caller that could stand in for it.
17
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned candidate retains each file's bytes as a frozen array owned by the caller; the collision map is local and released on return, and no handle is opened.
18
+ */
19
+ export declare const planScaffoldPublication: (props: {
20
+ files: Readonly<Record<string, string>>;
21
+ root: string;
22
+ }) => readonly IScaffoldPublicationEntry[];
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.planScaffoldPublication = void 0;
37
+ const path = __importStar(require("node:path"));
38
+ /**
39
+ * Validate a rendered file map and freeze it as a publication candidate, before any directory or file is touched.
40
+ *
41
+ * Throws when a value is not a string, a key contains NUL, a target resolves to the root or outside it, or two targets collide. Targets are compared after lower-casing, so `A.txt` and `a.txt` collide on every platform, and a file also collides with any file below it, such as `a` and `a/b`. Lower-casing approximates the case folding of Windows and macOS file systems and does not apply Unicode normalization.
42
+ *
43
+ * @param props.files UTF-8 text keyed by paths resolved against `root`; absolute keys are admitted when their targets remain below it.
44
+ * @param props.root Directory the candidate is published under.
45
+ * @returns Frozen entries in the map's insertion order.
46
+ *
47
+ * @evidence contracts/development/implementation.md#principled-implementation Containment and the ancestor walk's root boundary both use `path.relative`, preserving Windows case-equivalent root spellings instead of looping at the drive root; empty, parent and absolute remainders refuse. Lower-cased target keys detect exact and file-ancestor collisions, approximating case-insensitive file systems without Unicode normalization.
48
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure This owner validates and encodes with one private collision walk; publishFiles coordinates mutation, ensureScaffoldFileDirectory captures descendant directories, and writeScaffoldFile owns target admission.
49
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No path or file name is special-cased; case-only collisions are refused consistently on every platform without claiming complete filesystem-name validation. The runtime string check rejects non-text input from untyped callers rather than selecting a fixture.
50
+ * @evidence contracts/development/common.md#meaningful-documentation The comment lists every refusal, the case-folding rule and its limits, the parameters' meaning, and that entries keep insertion order.
51
+ * @evidence contracts/development/implementation.md#efficient-algorithms Encoding visits total content bytes; collision checks use one map lookup per file and per ancestor below the root, with path-relative, dirname, lower-casing and string-key costs driven by the visited path lengths. The local map holds one entry per file, and there is no pairwise file scan.
52
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The planner runs once per call over its own input and has no completed or in-flight work from another caller that could stand in for it.
53
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned candidate retains each file's bytes as a frozen array owned by the caller; the collision map is local and released on return, and no handle is opened.
54
+ */
55
+ const planScaffoldPublication = (props) => {
56
+ const root = path.resolve(props.root);
57
+ const entries = Object.entries(props.files).map(([relative, content]) => {
58
+ if (typeof content !== "string")
59
+ throw new Error(`scaffold content is not text: ${relative}`);
60
+ if (relative.includes("\0"))
61
+ throw new Error(`refusing invalid scaffold path: ${relative}`);
62
+ const target = path.resolve(root, relative);
63
+ const inside = path.relative(root, target);
64
+ if (inside.length === 0 ||
65
+ inside === ".." ||
66
+ inside.startsWith(`..${path.sep}`) ||
67
+ path.isAbsolute(inside))
68
+ throw new Error(`refusing to write outside "${root}": ${relative}`);
69
+ return Object.freeze({
70
+ bytes: Object.freeze(Array.from(Buffer.from(content, "utf8"))),
71
+ relative,
72
+ target,
73
+ });
74
+ });
75
+ assertDistinctScaffoldTargets(root, entries);
76
+ return Object.freeze(entries);
77
+ };
78
+ exports.planScaffoldPublication = planScaffoldPublication;
79
+ /**
80
+ * Throw when two entries name the same target, ignoring case, or when one entry's target is an ancestor directory of another's.
81
+ */
82
+ const assertDistinctScaffoldTargets = (root, entries) => {
83
+ const owners = new Map();
84
+ for (const entry of entries) {
85
+ const key = canonicalScaffoldPath(entry.target);
86
+ const previous = owners.get(key);
87
+ if (previous !== undefined)
88
+ throw scaffoldPathCollision(previous, entry);
89
+ owners.set(key, entry);
90
+ }
91
+ for (const entry of entries)
92
+ for (let directory = path.dirname(entry.target); path.relative(root, directory).length !== 0; directory = path.dirname(directory)) {
93
+ const ancestor = owners.get(canonicalScaffoldPath(directory));
94
+ if (ancestor !== undefined)
95
+ throw scaffoldPathCollision(ancestor, entry);
96
+ }
97
+ };
98
+ const scaffoldPathCollision = (first, second) => new Error(`scaffold paths collide: ${first.relative}, ${second.relative}`);
99
+ const canonicalScaffoldPath = (value) => value.toLowerCase();
100
+ //# sourceMappingURL=planScaffoldPublication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planScaffoldPublication.js","sourceRoot":"","sources":["../src/planScaffoldPublication.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,IAAI,sCAAkB;AAIlC;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,uBAAuB,GAGS,CAAC,KAG7C,EAAwC,EAAE;IACzC,MAAM,IAAI,GAAW,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAgC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAC1E,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAmB,EAA6B,EAAE;QACnE,IAAI,OAAO,OAAO,KAAK,QAAQ;YAC7B,MAAM,IAAI,KAAK,CAAC,iCAAiC,QAAQ,EAAE,CAAC,CAAC;QAC/D,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC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AAC;QACzE,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,OAAO;QACzB,KACE,IAAI,SAAS,GAAW,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAClD,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC,EAC3C,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EACnC,CAAC;YACD,MAAM,QAAQ,GAA0C,MAAM,CAAC,GAAG,CAChE,qBAAqB,CAAC,SAAS,CAAC,CACjC,CAAC;YACF,IAAI,QAAQ,KAAK,SAAS;gBAAE,MAAM,qBAAqB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC3E,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAGd,CACX,KAAgC,EAChC,MAAiC,EAC1B,EAAE,CACT,IAAI,KAAK,CAAC,2BAA2B,KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAE7E,MAAM,qBAAqB,GAA8B,CACvD,KAAa,EACL,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { IScaffoldSyncPlan } from "./IScaffoldSyncPlan";
2
+ import type { IScaffoldSyncProps } from "./IScaffoldSyncProps";
3
+ /**
4
+ * Plans a complete instruction sync without changing the production.
5
+ *
6
+ * @evidence contracts/development/implementation.md#principled-implementation Current LF digests are compared with desired content and the prior baseline: an explicit baseline root's copy governs, else the stored digest; all conflicts are collected before publication.
7
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The planner owns three-way comparison while rendering owns bundled inputs and publication owns writes.
8
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No contracts, canon, reviews, project/configuration files or custom skills absent from the bundle are overwritten. Unknown legacy differences conflict instead of becoming guessed generated bytes.
9
+ * @evidence contracts/development/common.md#meaningful-documentation The plan records changed/unchanged/conflicting/retired paths, exact write preconditions and a state file placed last.
10
+ * @evidence contracts/development/implementation.md#efficient-algorithms Rendering and per-file reads/hash scans scale with bundle and existing instruction bytes, plus deterministic path ordering; no whole production body is scanned.
11
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Each file observation and digest is reused inside the plan; returned plans are not accepted as later filesystem proof by a separate apply API.
12
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The plan owns candidate text and snapshots; input reads close synchronously, and no background work or cross-call cache is retained.
13
+ */
14
+ export declare function planScaffoldSync(props: IScaffoldSyncProps): IScaffoldSyncPlan;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.planScaffoldSync = planScaffoldSync;
7
+ const node_crypto_1 = require("node:crypto");
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const SCAFFOLD_SYNC_STATE_FILE_1 = require("./SCAFFOLD_SYNC_STATE_FILE");
10
+ const isScaffoldInstruction_1 = require("./isScaffoldInstruction");
11
+ const readScaffoldSyncFile_1 = require("./readScaffoldSyncFile");
12
+ const renderScaffoldInstructions_1 = require("./renderScaffoldInstructions");
13
+ /**
14
+ * Plans a complete instruction sync without changing the production.
15
+ *
16
+ * @evidence contracts/development/implementation.md#principled-implementation Current LF digests are compared with desired content and the prior baseline: an explicit baseline root's copy governs, else the stored digest; all conflicts are collected before publication.
17
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The planner owns three-way comparison while rendering owns bundled inputs and publication owns writes.
18
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No contracts, canon, reviews, project/configuration files or custom skills absent from the bundle are overwritten. Unknown legacy differences conflict instead of becoming guessed generated bytes.
19
+ * @evidence contracts/development/common.md#meaningful-documentation The plan records changed/unchanged/conflicting/retired paths, exact write preconditions and a state file placed last.
20
+ * @evidence contracts/development/implementation.md#efficient-algorithms Rendering and per-file reads/hash scans scale with bundle and existing instruction bytes, plus deterministic path ordering; no whole production body is scanned.
21
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Each file observation and digest is reused inside the plan; returned plans are not accepted as later filesystem proof by a separate apply API.
22
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The plan owns candidate text and snapshots; input reads close synchronously, and no background work or cross-call cache is retained.
23
+ */
24
+ function planScaffoldSync(props) {
25
+ const location = node_path_1.default.resolve(props.location);
26
+ const bundle = (0, renderScaffoldInstructions_1.renderScaffoldInstructions)();
27
+ const state = (0, readScaffoldSyncFile_1.readScaffoldSyncFile)(location, SCAFFOLD_SYNC_STATE_FILE_1.SCAFFOLD_SYNC_STATE_FILE);
28
+ const previous = state === undefined ? {} : parseState(state.text);
29
+ const plan = {
30
+ location,
31
+ files: {},
32
+ expected: {},
33
+ changed: [],
34
+ unchanged: [],
35
+ conflicts: [],
36
+ retired: [],
37
+ };
38
+ const desired = {};
39
+ for (const [relative, content] of Object.entries(bundle)) {
40
+ if (!(0, isScaffoldInstruction_1.isScaffoldInstruction)(relative))
41
+ continue;
42
+ desired[relative] = digest(content);
43
+ const current = (0, readScaffoldSyncFile_1.readScaffoldSyncFile)(location, relative);
44
+ if (current !== undefined && digest(current.text) === desired[relative]) {
45
+ plan.unchanged.push(relative);
46
+ continue;
47
+ }
48
+ // An explicit baseline is the caller's assertion of the edition each supplied file came from, so it governs over the stored record; the record still covers every file the baseline lacks.
49
+ const baseline = (props.baseline === undefined
50
+ ? undefined
51
+ : priorDigest(props.baseline, relative)) ?? previous[relative];
52
+ if (current !== undefined && digest(current.text) !== baseline) {
53
+ plan.conflicts.push(relative);
54
+ continue;
55
+ }
56
+ plan.changed.push(relative);
57
+ plan.files[relative] = content;
58
+ plan.expected[relative] = current?.snapshot ?? null;
59
+ }
60
+ plan.retired = Object.keys(previous).filter((relative) => !(relative in desired));
61
+ const next = JSON.stringify({ version: 1, files: { ...previous, ...desired } }, null, 2) + "\n";
62
+ // State is last: a stopped content publication must not advance its baseline.
63
+ if (state?.text !== next) {
64
+ plan.files[SCAFFOLD_SYNC_STATE_FILE_1.SCAFFOLD_SYNC_STATE_FILE] = next;
65
+ plan.expected[SCAFFOLD_SYNC_STATE_FILE_1.SCAFFOLD_SYNC_STATE_FILE] = state?.snapshot ?? null;
66
+ }
67
+ return plan;
68
+ }
69
+ /** Canonical line endings avoid treating checkout conversion as a local edit. */
70
+ function digest(text) {
71
+ return (0, node_crypto_1.createHash)("sha256")
72
+ .update(text.replaceAll("\r\n", "\n"))
73
+ .digest("hex");
74
+ }
75
+ /** Read the caller's explicit prior adopted instruction file without changing it. */
76
+ function priorDigest(root, relative) {
77
+ const source = (0, readScaffoldSyncFile_1.readScaffoldSyncFile)(root, relative);
78
+ return source === undefined ? undefined : digest(source.text);
79
+ }
80
+ /** Refuse malformed state and any path outside the generated instruction surface. */
81
+ function parseState(text) {
82
+ const state = JSON.parse(text);
83
+ if (typeof state !== "object" ||
84
+ state === null ||
85
+ !("version" in state) ||
86
+ state.version !== 1 ||
87
+ !("files" in state) ||
88
+ typeof state.files !== "object" ||
89
+ state.files === null ||
90
+ Array.isArray(state.files))
91
+ throw new Error("Invalid scaffold sync state.");
92
+ const files = {};
93
+ for (const [relative, value] of Object.entries(state.files)) {
94
+ if (!(0, isScaffoldInstruction_1.isScaffoldInstruction)(relative) ||
95
+ typeof value !== "string" ||
96
+ !/^[0-9a-f]{64}$/u.test(value))
97
+ throw new Error("Invalid scaffold sync baseline: " + relative);
98
+ files[relative] = value;
99
+ }
100
+ return files;
101
+ }
102
+ //# sourceMappingURL=planScaffoldSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planScaffoldSync.js","sourceRoot":"","sources":["../src/planScaffoldSync.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAyC;AACzC,0DAA6B;AAI7B,yEAAsE;AACtE,mEAAgE;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AAK,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;IAC1B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type IScaffoldPublicationOptions } from "./IScaffoldPublicationOptions";
2
+ import { type IScaffoldPublicationReceipt } from "./IScaffoldPublicationReceipt";
3
+ /**
4
+ * Write a path-to-text map under `location` and return a receipt naming every completed file and the first entry that did not complete.
5
+ *
6
+ * The whole map is validated by {@link planScaffoldPublication} before the directory is created. Without `force`, a directory that already has an entry refuses the first file, so nothing is written. New files are created exclusively relative to captured parent directory handles, refusing linked parent directories; with `force`, existing ordinary single-link files are rewritten in place through verified descriptors. Optional expected generations bind each candidate to its inspected ordinary-file identity and written state, or require absence. Publication stops at the first refusal or partial slot, and nothing is deleted. Directories created while preparing a failed entry can remain even when the receipt is refused.
7
+ *
8
+ * Every error thrown while preparing directories or before a file is written becomes a `create-failed` refusal for that file. Invalid input and an outcome that breaks the publication contract still throw.
9
+ *
10
+ * @param location Target directory, resolved against the working directory.
11
+ * @param files UTF-8 text keyed by paths resolved against `location`; absolute keys are admitted when their targets remain below it.
12
+ * @param options `force` admits a populated directory and in-place replacement.
13
+ * @returns Frozen receipt of the attempt.
14
+ *
15
+ * @evidence contracts/development/implementation.md#principled-implementation Physical directory captures authorize new handle-relative file creation and forced descriptor-based replacement through writeScaffoldFile; the no-force emptiness probe reads one entry and revalidates the captured root, while prepared directories can remain after a later refusal.
16
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure This function owns the root, emptiness and directory cache; publishScaffoldCandidate owns order and receipt status, ensureScaffoldFileDirectory owns descendant captures, and writeScaffoldFile dispatches create or replacement.
17
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The catch maps any thrown error to a `create-failed` refusal, which is truthful because directory preparation creates no file, `writeScaffoldFile` documents that it throws only before any write, and `publishNativeScaffoldFile` returns its failures; no error is retried or hidden.
18
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states validation before mutation, the non-empty refusal, parent-handle creation, the stop rule, the no-delete rule, how thrown errors are reported, and each parameter.
19
+ * @evidence contracts/development/implementation.md#efficient-algorithms Planning encodes all content and checks each target and ancestor key with costs driven by bytes, path lengths and depths. Publishing performs a constant number of directory captures per traversed segment and writes and reads back each attempted file once; the no-force emptiness probe reads one entry rather than listing the root.
20
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Directory captures are cached per absolute path for this call only, and a cached directory is revalidated by identity before each use, so a replaced directory is refused rather than reused; captures are never shared across calls.
21
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The call-local cache contains one capture per candidate directory; the emptiness probe attempts close in finally, while file adapters attempt every acquired handle's release and report failures. No close-error outcome proves release, and the receipt retains candidate bytes for its caller.
22
+ */
23
+ export declare const publishFiles: (location: string, files: Record<string, string>, options?: IScaffoldPublicationOptions) => IScaffoldPublicationReceipt;
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.publishFiles = void 0;
37
+ const fs = __importStar(require("node:fs"));
38
+ const path = __importStar(require("node:path"));
39
+ const assertScaffoldPhysicalDirectory_1 = require("./assertScaffoldPhysicalDirectory");
40
+ const ensureScaffoldBaseDirectory_1 = require("./ensureScaffoldBaseDirectory");
41
+ const ensureScaffoldFileDirectory_1 = require("./ensureScaffoldFileDirectory");
42
+ const planScaffoldPublication_1 = require("./planScaffoldPublication");
43
+ const publishScaffoldCandidate_1 = require("./publishScaffoldCandidate");
44
+ const writeScaffoldFile_1 = require("./writeScaffoldFile");
45
+ /**
46
+ * Write a path-to-text map under `location` and return a receipt naming every completed file and the first entry that did not complete.
47
+ *
48
+ * The whole map is validated by {@link planScaffoldPublication} before the directory is created. Without `force`, a directory that already has an entry refuses the first file, so nothing is written. New files are created exclusively relative to captured parent directory handles, refusing linked parent directories; with `force`, existing ordinary single-link files are rewritten in place through verified descriptors. Optional expected generations bind each candidate to its inspected ordinary-file identity and written state, or require absence. Publication stops at the first refusal or partial slot, and nothing is deleted. Directories created while preparing a failed entry can remain even when the receipt is refused.
49
+ *
50
+ * Every error thrown while preparing directories or before a file is written becomes a `create-failed` refusal for that file. Invalid input and an outcome that breaks the publication contract still throw.
51
+ *
52
+ * @param location Target directory, resolved against the working directory.
53
+ * @param files UTF-8 text keyed by paths resolved against `location`; absolute keys are admitted when their targets remain below it.
54
+ * @param options `force` admits a populated directory and in-place replacement.
55
+ * @returns Frozen receipt of the attempt.
56
+ *
57
+ * @evidence contracts/development/implementation.md#principled-implementation Physical directory captures authorize new handle-relative file creation and forced descriptor-based replacement through writeScaffoldFile; the no-force emptiness probe reads one entry and revalidates the captured root, while prepared directories can remain after a later refusal.
58
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure This function owns the root, emptiness and directory cache; publishScaffoldCandidate owns order and receipt status, ensureScaffoldFileDirectory owns descendant captures, and writeScaffoldFile dispatches create or replacement.
59
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The catch maps any thrown error to a `create-failed` refusal, which is truthful because directory preparation creates no file, `writeScaffoldFile` documents that it throws only before any write, and `publishNativeScaffoldFile` returns its failures; no error is retried or hidden.
60
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states validation before mutation, the non-empty refusal, parent-handle creation, the stop rule, the no-delete rule, how thrown errors are reported, and each parameter.
61
+ * @evidence contracts/development/implementation.md#efficient-algorithms Planning encodes all content and checks each target and ancestor key with costs driven by bytes, path lengths and depths. Publishing performs a constant number of directory captures per traversed segment and writes and reads back each attempted file once; the no-force emptiness probe reads one entry rather than listing the root.
62
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Directory captures are cached per absolute path for this call only, and a cached directory is revalidated by identity before each use, so a replaced directory is refused rather than reused; captures are never shared across calls.
63
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The call-local cache contains one capture per candidate directory; the emptiness probe attempts close in finally, while file adapters attempt every acquired handle's release and report failures. No close-error outcome proves release, and the receipt retains candidate bytes for its caller.
64
+ */
65
+ const publishFiles = (location, files, options) => {
66
+ const root = path.resolve(location);
67
+ const candidate = (0, planScaffoldPublication_1.planScaffoldPublication)({ files, root });
68
+ const force = options?.force === true;
69
+ let session;
70
+ return (0, publishScaffoldCandidate_1.publishScaffoldCandidate)({
71
+ candidate,
72
+ publish: (entry) => {
73
+ try {
74
+ session ??= openScaffoldPublicationSession(root, force);
75
+ const parent = (0, ensureScaffoldFileDirectory_1.ensureScaffoldFileDirectory)({
76
+ base: session.base,
77
+ cache: session.directories,
78
+ directory: path.dirname(entry.target),
79
+ });
80
+ return (0, writeScaffoldFile_1.writeScaffoldFile)({
81
+ base: session.base,
82
+ bytes: Uint8Array.from(entry.bytes),
83
+ force,
84
+ expected: options?.expected?.[entry.relative],
85
+ parent,
86
+ target: entry.target,
87
+ });
88
+ }
89
+ catch (error) {
90
+ return Object.freeze({
91
+ error,
92
+ reason: "create-failed",
93
+ status: "refused",
94
+ });
95
+ }
96
+ },
97
+ });
98
+ };
99
+ exports.publishFiles = publishFiles;
100
+ /**
101
+ * Create or capture the root and, without `force`, refuse one that already has an entry. Runs on the first file so an empty candidate touches nothing.
102
+ */
103
+ const openScaffoldPublicationSession = (root, force) => {
104
+ const base = (0, ensureScaffoldBaseDirectory_1.ensureScaffoldBaseDirectory)(root);
105
+ if (force === false) {
106
+ if (hasDirectoryEntry(base.path))
107
+ throw new Error(`target directory is not empty: ${base.path}; pass --force to scaffold into it anyway`);
108
+ (0, assertScaffoldPhysicalDirectory_1.assertScaffoldPhysicalDirectory)(base);
109
+ }
110
+ return {
111
+ base,
112
+ directories: new Map(),
113
+ };
114
+ };
115
+ const hasDirectoryEntry = (directory) => {
116
+ const listing = fs.opendirSync(directory);
117
+ try {
118
+ return listing.readSync() !== null;
119
+ }
120
+ finally {
121
+ listing.closeSync();
122
+ }
123
+ };
124
+ //# sourceMappingURL=publishFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishFiles.js","sourceRoot":"","sources":["../src/publishFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,EAAE,oCAAgB;AAC9B,MAAY,IAAI,sCAAkB;AAOlC,uFAAoF;AACpF,+EAA4E;AAC5E,+EAA4E;AAC5E,uEAAoE;AACpE,yEAAsE;AACtE,2DAAwD;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,YAAY,GAIU,CACjC,QAAgB,EAChB,KAA6B,EAC7B,OAAqC,EACR,EAAE;IAC/B,MAAM,IAAI,GAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,SAAS,GACb,IAAA,iD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AK,KAAK,EAAE,CAAC;QACpB,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,kCAAkC,IAAI,CAAC,IAAI,2CAA2C,CACvF,CAAC;QACJ,IAAA,iEAA+B,EAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IACD,OAAO;QACL,IAAI;QACJ,WAAW,EAAE,IAAI,GAAG,EAAsC;KAC3D,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAmC,CACxD,SAAiB,EACR,EAAE;IACX,MAAM,OAAO,GAAW,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAClD,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC;IACrC,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,SAAS,EAAE,CAAC;IACtB,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type IScaffoldParentPublicationRequest } from "./IScaffoldParentPublicationRequest";
2
+ import { type ScaffoldFilePublicationOutcome } from "./ScaffoldFilePublicationOutcome";
3
+ /**
4
+ * Create one new scaffold file relative to a held parent directory handle and report the effect.
5
+ *
6
+ * POSIX opens the parent with `open(O_DIRECTORY | O_NOFOLLOW)` and creates the child with `openat(O_CREAT | O_EXCL | O_NOFOLLOW)`. Windows opens the parent with `CreateFileW` without following a reparse point and creates the child with `NtCreateFile(FILE_CREATE)` using `OBJECT_ATTRIBUTES.RootDirectory`. The parent must report `expectedParentIdentity` before the create. The new file is written, flushed, read back, and checked to be one ordinary single-link file of the exact size, then reopened relative to the same held parent, before and after its own handle closes, to prove the name still holds that file.
7
+ *
8
+ * The function returns rather than throws. `refused` means no slot was created: the request was malformed, the parent could not be opened or changed, or the create failed or met an existing entry (`target-competitor`). `partial` means a slot exists that did not pass every check, with the bytes written so far; the adapter never deletes it and never retries through an absolute child path. `completed` carries the captured parent's identity.
9
+ *
10
+ * @param request Parent path, its expected identity, the child segment, and the bytes.
11
+ * @returns The frozen outcome.
12
+ *
13
+ * @evidence contracts/development/implementation.md#principled-implementation The method is the documented handle-relative create of each platform, `openat` with `O_EXCL | O_NOFOLLOW` and `NtCreateFile` with a root directory handle and `FILE_CREATE`, both of which fail rather than follow an existing entry or a link; its premises are that the parent handle is held for the whole call and that required native flags are resolved before opening. `resolveScaffoldPosixConstants` supplies the documented Linux/Android and Darwin close-on-exec bits when Node omits them and refuses unknown missing ABI values.
14
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The publication sequence is shared through internal IBoundParent and IBoundChild contracts; POSIX and Windows own their native opening and transfer, and Koffi bindings initialize lazily on first use.
15
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Every failure after the create becomes `partial` with the byte count instead of a cleanup or a pathname retry, and no foreign method or global is replaced; Win32 and NT values are named constants from the Windows SDK headers.
16
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states both platform methods, the identity precondition, each verification step, and the meaning of each outcome, including that a partial slot is left in place.
17
+ * @evidence contracts/development/implementation.md#efficient-algorithms Work is linear in the file size: one write pass, one flush, one readback pass into a buffer of the same size, and a constant number of handle opens and status reads; the request bytes are viewed, not copied.
18
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call is an exclusive create whose effect must not be shared; only the loaded Koffi library bindings are kept, and they are stateless function handles.
19
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The function owns at most three native handles, the parent, the created child, and one resident reopen; each receives a close attempt on success and on every failure path before return, and a failed close is reported with the earlier failure rather than claiming release; the readback buffer is released with the call, and the module keeps only one lazily loaded binding set per platform.
20
+ */
21
+ export declare const publishNativeScaffoldFile: (request: IScaffoldParentPublicationRequest) => ScaffoldFilePublicationOutcome;