@ttsc/unplugin 0.31.0 → 0.31.2

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 (291) hide show
  1. package/lib/core/bridge/projectRecordMoved.js +1 -1
  2. package/lib/core/bridge/projectRecordMoved.js.map +1 -1
  3. package/lib/core/bridge/projectRecordMoved.mjs +1 -1
  4. package/lib/core/bridge/projectRecordMoved.mjs.map +1 -1
  5. package/lib/core/bun/bun.d.cts +3 -2
  6. package/lib/core/bun/bun.d.mts +3 -2
  7. package/lib/core/bun/bun.d.ts +3 -2
  8. package/lib/core/bun/bun.js +8 -4
  9. package/lib/core/bun/bun.js.map +1 -1
  10. package/lib/core/bun/bun.mjs +8 -4
  11. package/lib/core/bun/bun.mjs.map +1 -1
  12. package/lib/core/observer/createInputObserver.js +7 -6
  13. package/lib/core/observer/createInputObserver.js.map +1 -1
  14. package/lib/core/observer/createInputObserver.mjs +7 -6
  15. package/lib/core/observer/createInputObserver.mjs.map +1 -1
  16. package/lib/core/observer/openIsolatedRecursiveWatch.d.cts +11 -12
  17. package/lib/core/observer/openIsolatedRecursiveWatch.d.mts +11 -12
  18. package/lib/core/observer/openIsolatedRecursiveWatch.d.ts +11 -12
  19. package/lib/core/observer/openIsolatedRecursiveWatch.js +11 -12
  20. package/lib/core/observer/openIsolatedRecursiveWatch.js.map +1 -1
  21. package/lib/core/observer/openIsolatedRecursiveWatch.mjs +11 -12
  22. package/lib/core/observer/openIsolatedRecursiveWatch.mjs.map +1 -1
  23. package/lib/core/transform/cache/TtscCachedProjectTransform.d.cts +12 -3
  24. package/lib/core/transform/cache/TtscCachedProjectTransform.d.mts +12 -3
  25. package/lib/core/transform/cache/TtscCachedProjectTransform.d.ts +12 -3
  26. package/lib/core/transform/cache/selectCachedGenerationAction.d.cts +2 -0
  27. package/lib/core/transform/cache/selectCachedGenerationAction.d.mts +2 -0
  28. package/lib/core/transform/cache/selectCachedGenerationAction.d.ts +2 -0
  29. package/lib/core/transform/cache/selectCachedGenerationAction.js +1 -1
  30. package/lib/core/transform/cache/selectCachedGenerationAction.js.map +1 -1
  31. package/lib/core/transform/cache/selectCachedGenerationAction.mjs +1 -1
  32. package/lib/core/transform/cache/selectCachedGenerationAction.mjs.map +1 -1
  33. package/lib/core/transform/deliverCachedTransform.d.cts +36 -0
  34. package/lib/core/transform/deliverCachedTransform.d.mts +36 -0
  35. package/lib/core/transform/deliverCachedTransform.d.ts +36 -0
  36. package/lib/core/transform/deliverCachedTransform.js +73 -0
  37. package/lib/core/transform/deliverCachedTransform.js.map +1 -0
  38. package/lib/core/transform/deliverCachedTransform.mjs +71 -0
  39. package/lib/core/transform/deliverCachedTransform.mjs.map +1 -0
  40. package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.d.cts +2 -2
  41. package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.d.mts +2 -2
  42. package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.d.ts +2 -2
  43. package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.js +6 -2
  44. package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.js.map +1 -1
  45. package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.mjs +6 -2
  46. package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.mjs.map +1 -1
  47. package/lib/core/transform/envelope/selectExternalInputPaths.d.cts +3 -5
  48. package/lib/core/transform/envelope/selectExternalInputPaths.d.mts +3 -5
  49. package/lib/core/transform/envelope/selectExternalInputPaths.d.ts +3 -5
  50. package/lib/core/transform/envelope/selectExternalInputPaths.js +8 -7
  51. package/lib/core/transform/envelope/selectExternalInputPaths.js.map +1 -1
  52. package/lib/core/transform/envelope/selectExternalInputPaths.mjs +8 -7
  53. package/lib/core/transform/envelope/selectExternalInputPaths.mjs.map +1 -1
  54. package/lib/core/transform/filesystem/TtscTransformFilesystemOperations.d.cts +15 -12
  55. package/lib/core/transform/filesystem/TtscTransformFilesystemOperations.d.mts +15 -12
  56. package/lib/core/transform/filesystem/TtscTransformFilesystemOperations.d.ts +15 -12
  57. package/lib/core/transform/generation/captureFailedGenerationInputStates.js +1 -1
  58. package/lib/core/transform/generation/captureFailedGenerationInputStates.js.map +1 -1
  59. package/lib/core/transform/generation/captureFailedGenerationInputStates.mjs +1 -1
  60. package/lib/core/transform/generation/captureFailedGenerationInputStates.mjs.map +1 -1
  61. package/lib/core/transform/generation/captureTransformGeneration.js +1 -1
  62. package/lib/core/transform/generation/captureTransformGeneration.js.map +1 -1
  63. package/lib/core/transform/generation/captureTransformGeneration.mjs +1 -1
  64. package/lib/core/transform/generation/captureTransformGeneration.mjs.map +1 -1
  65. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.js +2 -2
  66. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.js.map +1 -1
  67. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.mjs +2 -2
  68. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.mjs.map +1 -1
  69. package/lib/core/transform/generation/selectTransformAttemptDisposition.d.cts +3 -1
  70. package/lib/core/transform/generation/selectTransformAttemptDisposition.d.mts +3 -1
  71. package/lib/core/transform/generation/selectTransformAttemptDisposition.d.ts +3 -1
  72. package/lib/core/transform/generation/selectTransformAttemptDisposition.js +3 -1
  73. package/lib/core/transform/generation/selectTransformAttemptDisposition.js.map +1 -1
  74. package/lib/core/transform/generation/selectTransformAttemptDisposition.mjs +3 -1
  75. package/lib/core/transform/generation/selectTransformAttemptDisposition.mjs.map +1 -1
  76. package/lib/core/transform/generation/transformProject.d.cts +9 -7
  77. package/lib/core/transform/generation/transformProject.d.mts +9 -7
  78. package/lib/core/transform/generation/transformProject.d.ts +9 -7
  79. package/lib/core/transform/generation/transformProject.js +14 -9
  80. package/lib/core/transform/generation/transformProject.js.map +1 -1
  81. package/lib/core/transform/generation/transformProject.mjs +14 -9
  82. package/lib/core/transform/generation/transformProject.mjs.map +1 -1
  83. package/lib/core/transform/inputs/pluginSourceFilesDigest.d.cts +9 -3
  84. package/lib/core/transform/inputs/pluginSourceFilesDigest.d.mts +9 -3
  85. package/lib/core/transform/inputs/pluginSourceFilesDigest.d.ts +9 -3
  86. package/lib/core/transform/inputs/pluginSourceFilesDigest.js +10 -4
  87. package/lib/core/transform/inputs/pluginSourceFilesDigest.js.map +1 -1
  88. package/lib/core/transform/inputs/pluginSourceFilesDigest.mjs +11 -5
  89. package/lib/core/transform/inputs/pluginSourceFilesDigest.mjs.map +1 -1
  90. package/lib/core/transform/inputs/pluginSourceHolds.d.cts +4 -2
  91. package/lib/core/transform/inputs/pluginSourceHolds.d.mts +4 -2
  92. package/lib/core/transform/inputs/pluginSourceHolds.d.ts +4 -2
  93. package/lib/core/transform/inputs/pluginSourceHolds.js +9 -4
  94. package/lib/core/transform/inputs/pluginSourceHolds.js.map +1 -1
  95. package/lib/core/transform/inputs/pluginSourceHolds.mjs +9 -4
  96. package/lib/core/transform/inputs/pluginSourceHolds.mjs.map +1 -1
  97. package/lib/core/transform/inputs/pluginSourceState.d.cts +3 -1
  98. package/lib/core/transform/inputs/pluginSourceState.d.mts +3 -1
  99. package/lib/core/transform/inputs/pluginSourceState.d.ts +3 -1
  100. package/lib/core/transform/inputs/pluginSourceState.js +8 -3
  101. package/lib/core/transform/inputs/pluginSourceState.js.map +1 -1
  102. package/lib/core/transform/inputs/pluginSourceState.mjs +8 -3
  103. package/lib/core/transform/inputs/pluginSourceState.mjs.map +1 -1
  104. package/lib/core/transform/inputs/preparePluginBuildEnvironments.d.cts +18 -5
  105. package/lib/core/transform/inputs/preparePluginBuildEnvironments.d.mts +18 -5
  106. package/lib/core/transform/inputs/preparePluginBuildEnvironments.d.ts +18 -5
  107. package/lib/core/transform/inputs/preparePluginBuildEnvironments.js +53 -12
  108. package/lib/core/transform/inputs/preparePluginBuildEnvironments.js.map +1 -1
  109. package/lib/core/transform/inputs/preparePluginBuildEnvironments.mjs +53 -12
  110. package/lib/core/transform/inputs/preparePluginBuildEnvironments.mjs.map +1 -1
  111. package/lib/core/transform/tracker/broker/WatchBroker.d.cts +14 -4
  112. package/lib/core/transform/tracker/broker/WatchBroker.d.mts +14 -4
  113. package/lib/core/transform/tracker/broker/WatchBroker.d.ts +14 -4
  114. package/lib/core/transform/tracker/broker/WatchBrokerTransport.d.cts +63 -0
  115. package/lib/core/transform/tracker/broker/WatchBrokerTransport.d.mts +63 -0
  116. package/lib/core/transform/tracker/broker/WatchBrokerTransport.d.ts +63 -0
  117. package/lib/core/transform/tracker/broker/WatchBrokerTransport.js +89 -0
  118. package/lib/core/transform/tracker/broker/WatchBrokerTransport.js.map +1 -0
  119. package/lib/core/transform/tracker/broker/WatchBrokerTransport.mjs +89 -0
  120. package/lib/core/transform/tracker/broker/WatchBrokerTransport.mjs.map +1 -0
  121. package/lib/core/transform/tracker/broker/drainWatchBroker.d.cts +8 -8
  122. package/lib/core/transform/tracker/broker/drainWatchBroker.d.mts +8 -8
  123. package/lib/core/transform/tracker/broker/drainWatchBroker.d.ts +8 -8
  124. package/lib/core/transform/tracker/broker/drainWatchBroker.js +12 -13
  125. package/lib/core/transform/tracker/broker/drainWatchBroker.js.map +1 -1
  126. package/lib/core/transform/tracker/broker/drainWatchBroker.mjs +12 -13
  127. package/lib/core/transform/tracker/broker/drainWatchBroker.mjs.map +1 -1
  128. package/lib/core/transform/tracker/broker/getWatchBroker.d.cts +18 -15
  129. package/lib/core/transform/tracker/broker/getWatchBroker.d.mts +18 -15
  130. package/lib/core/transform/tracker/broker/getWatchBroker.d.ts +18 -15
  131. package/lib/core/transform/tracker/broker/getWatchBroker.js +87 -17
  132. package/lib/core/transform/tracker/broker/getWatchBroker.js.map +1 -1
  133. package/lib/core/transform/tracker/broker/getWatchBroker.mjs +87 -17
  134. package/lib/core/transform/tracker/broker/getWatchBroker.mjs.map +1 -1
  135. package/lib/core/transform/tracker/broker/openBrokeredWatch.d.cts +5 -5
  136. package/lib/core/transform/tracker/broker/openBrokeredWatch.d.mts +5 -5
  137. package/lib/core/transform/tracker/broker/openBrokeredWatch.d.ts +5 -5
  138. package/lib/core/transform/tracker/broker/openBrokeredWatch.js +11 -14
  139. package/lib/core/transform/tracker/broker/openBrokeredWatch.js.map +1 -1
  140. package/lib/core/transform/tracker/broker/openBrokeredWatch.mjs +11 -14
  141. package/lib/core/transform/tracker/broker/openBrokeredWatch.mjs.map +1 -1
  142. package/lib/core/transform/tracker/broker/usesWatchBroker.d.cts +7 -7
  143. package/lib/core/transform/tracker/broker/usesWatchBroker.d.mts +7 -7
  144. package/lib/core/transform/tracker/broker/usesWatchBroker.d.ts +7 -7
  145. package/lib/core/transform/tracker/broker/usesWatchBroker.js +7 -7
  146. package/lib/core/transform/tracker/broker/usesWatchBroker.mjs +7 -7
  147. package/lib/core/transform/tracker/broker/watchBrokerSource.d.cts +9 -10
  148. package/lib/core/transform/tracker/broker/watchBrokerSource.d.mts +9 -10
  149. package/lib/core/transform/tracker/broker/watchBrokerSource.d.ts +9 -10
  150. package/lib/core/transform/tracker/broker/watchBrokerSource.js +10 -11
  151. package/lib/core/transform/tracker/broker/watchBrokerSource.js.map +1 -1
  152. package/lib/core/transform/tracker/broker/watchBrokerSource.mjs +10 -11
  153. package/lib/core/transform/tracker/broker/watchBrokerSource.mjs.map +1 -1
  154. package/lib/core/transform/transformTtsc.d.cts +7 -4
  155. package/lib/core/transform/transformTtsc.d.mts +7 -4
  156. package/lib/core/transform/transformTtsc.d.ts +7 -4
  157. package/lib/core/transform/transformTtsc.js +38 -93
  158. package/lib/core/transform/transformTtsc.js.map +1 -1
  159. package/lib/core/transform/transformTtsc.mjs +38 -93
  160. package/lib/core/transform/transformTtsc.mjs.map +1 -1
  161. package/lib/core/transform/validation/TtscGenerationProof.d.cts +105 -0
  162. package/lib/core/transform/validation/TtscGenerationProof.d.mts +105 -0
  163. package/lib/core/transform/validation/TtscGenerationProof.d.ts +105 -0
  164. package/lib/core/transform/validation/TtscGenerationProof.js +149 -0
  165. package/lib/core/transform/validation/TtscGenerationProof.js.map +1 -0
  166. package/lib/core/transform/validation/TtscGenerationProof.mjs +149 -0
  167. package/lib/core/transform/validation/TtscGenerationProof.mjs.map +1 -0
  168. package/lib/core/transform/validation/captureUniversalHostInputValidation.js +2 -2
  169. package/lib/core/transform/validation/captureUniversalHostInputValidation.js.map +1 -1
  170. package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs +2 -2
  171. package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs.map +1 -1
  172. package/lib/core/transform/validation/matchesCachedSource.d.cts +18 -15
  173. package/lib/core/transform/validation/matchesCachedSource.d.mts +18 -15
  174. package/lib/core/transform/validation/matchesCachedSource.d.ts +18 -15
  175. package/lib/core/transform/validation/matchesCachedSource.js +28 -22
  176. package/lib/core/transform/validation/matchesCachedSource.js.map +1 -1
  177. package/lib/core/transform/validation/matchesCachedSource.mjs +28 -22
  178. package/lib/core/transform/validation/matchesCachedSource.mjs.map +1 -1
  179. package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.cts +3 -2
  180. package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.mts +3 -2
  181. package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.ts +3 -2
  182. package/lib/core/transform/validation/matchesCompleteInputSnapshot.js +4 -4
  183. package/lib/core/transform/validation/matchesCompleteInputSnapshot.js.map +1 -1
  184. package/lib/core/transform/validation/matchesCompleteInputSnapshot.mjs +4 -4
  185. package/lib/core/transform/validation/matchesCompleteInputSnapshot.mjs.map +1 -1
  186. package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.cts +2 -1
  187. package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.mts +2 -1
  188. package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.ts +2 -1
  189. package/lib/core/transform/validation/matchesNarrowPersistentInputs.js +2 -2
  190. package/lib/core/transform/validation/matchesNarrowPersistentInputs.js.map +1 -1
  191. package/lib/core/transform/validation/matchesNarrowPersistentInputs.mjs +2 -2
  192. package/lib/core/transform/validation/matchesNarrowPersistentInputs.mjs.map +1 -1
  193. package/lib/core/transform/validation/matchesUniversalHostInputTrees.d.cts +3 -2
  194. package/lib/core/transform/validation/matchesUniversalHostInputTrees.d.mts +3 -2
  195. package/lib/core/transform/validation/matchesUniversalHostInputTrees.d.ts +3 -2
  196. package/lib/core/transform/validation/matchesUniversalHostInputTrees.js +7 -5
  197. package/lib/core/transform/validation/matchesUniversalHostInputTrees.js.map +1 -1
  198. package/lib/core/transform/validation/matchesUniversalHostInputTrees.mjs +7 -5
  199. package/lib/core/transform/validation/matchesUniversalHostInputTrees.mjs.map +1 -1
  200. package/lib/core/transform/validation/matchesUniversalHostInputs.d.cts +3 -2
  201. package/lib/core/transform/validation/matchesUniversalHostInputs.d.mts +3 -2
  202. package/lib/core/transform/validation/matchesUniversalHostInputs.d.ts +3 -2
  203. package/lib/core/transform/validation/matchesUniversalHostInputs.js +5 -5
  204. package/lib/core/transform/validation/matchesUniversalHostInputs.js.map +1 -1
  205. package/lib/core/transform/validation/matchesUniversalHostInputs.mjs +5 -5
  206. package/lib/core/transform/validation/matchesUniversalHostInputs.mjs.map +1 -1
  207. package/lib/core/transform/validation/nativeInputPredicatesHold.d.cts +5 -4
  208. package/lib/core/transform/validation/nativeInputPredicatesHold.d.mts +5 -4
  209. package/lib/core/transform/validation/nativeInputPredicatesHold.d.ts +5 -4
  210. package/lib/core/transform/validation/nativeInputPredicatesHold.js +31 -12
  211. package/lib/core/transform/validation/nativeInputPredicatesHold.js.map +1 -1
  212. package/lib/core/transform/validation/nativeInputPredicatesHold.mjs +31 -12
  213. package/lib/core/transform/validation/nativeInputPredicatesHold.mjs.map +1 -1
  214. package/lib/core/transform/validation/notificationsProveProgramUnchanged.d.cts +2 -1
  215. package/lib/core/transform/validation/notificationsProveProgramUnchanged.d.mts +2 -1
  216. package/lib/core/transform/validation/notificationsProveProgramUnchanged.d.ts +2 -1
  217. package/lib/core/transform/validation/notificationsProveProgramUnchanged.js +2 -2
  218. package/lib/core/transform/validation/notificationsProveProgramUnchanged.js.map +1 -1
  219. package/lib/core/transform/validation/notificationsProveProgramUnchanged.mjs +2 -2
  220. package/lib/core/transform/validation/notificationsProveProgramUnchanged.mjs.map +1 -1
  221. package/lib/core/transform/watch/captureWatchInputBaseline.d.cts +4 -0
  222. package/lib/core/transform/watch/captureWatchInputBaseline.d.mts +4 -0
  223. package/lib/core/transform/watch/captureWatchInputBaseline.d.ts +4 -0
  224. package/lib/core/transform/watch/captureWatchInputBaseline.js +3 -0
  225. package/lib/core/transform/watch/captureWatchInputBaseline.js.map +1 -1
  226. package/lib/core/transform/watch/captureWatchInputBaseline.mjs +3 -0
  227. package/lib/core/transform/watch/captureWatchInputBaseline.mjs.map +1 -1
  228. package/lib/core/transform/watch/captureWatchInputBaselines.d.cts +2 -0
  229. package/lib/core/transform/watch/captureWatchInputBaselines.d.mts +2 -0
  230. package/lib/core/transform/watch/captureWatchInputBaselines.d.ts +2 -0
  231. package/lib/core/transform/watch/captureWatchInputBaselines.js +3 -1
  232. package/lib/core/transform/watch/captureWatchInputBaselines.js.map +1 -1
  233. package/lib/core/transform/watch/captureWatchInputBaselines.mjs +3 -1
  234. package/lib/core/transform/watch/captureWatchInputBaselines.mjs.map +1 -1
  235. package/lib/core/transform/watch/notifyWatchInputs.js +3 -0
  236. package/lib/core/transform/watch/notifyWatchInputs.js.map +1 -1
  237. package/lib/core/transform/watch/notifyWatchInputs.mjs +3 -0
  238. package/lib/core/transform/watch/notifyWatchInputs.mjs.map +1 -1
  239. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.d.cts +5 -2
  240. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.d.mts +5 -2
  241. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.d.ts +5 -2
  242. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.js +6 -3
  243. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.js.map +1 -1
  244. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.mjs +6 -3
  245. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.mjs.map +1 -1
  246. package/lib/core/turbopack/turbopack.js +2 -1
  247. package/lib/core/turbopack/turbopack.js.map +1 -1
  248. package/lib/core/turbopack/turbopack.mjs +2 -1
  249. package/lib/core/turbopack/turbopack.mjs.map +1 -1
  250. package/package.json +3 -3
  251. package/src/core/bridge/projectRecordMoved.ts +3 -1
  252. package/src/core/bun/bun.ts +8 -4
  253. package/src/core/observer/createInputObserver.ts +8 -5
  254. package/src/core/observer/openIsolatedRecursiveWatch.ts +11 -12
  255. package/src/core/transform/cache/TtscCachedProjectTransform.ts +13 -3
  256. package/src/core/transform/cache/selectCachedGenerationAction.ts +9 -1
  257. package/src/core/transform/deliverCachedTransform.ts +97 -0
  258. package/src/core/transform/envelope/selectDeclaredProjectInputKeys.ts +5 -2
  259. package/src/core/transform/envelope/selectExternalInputPaths.ts +7 -7
  260. package/src/core/transform/filesystem/TtscTransformFilesystemOperations.ts +15 -12
  261. package/src/core/transform/generation/captureFailedGenerationInputStates.ts +1 -0
  262. package/src/core/transform/generation/captureTransformGeneration.ts +6 -1
  263. package/src/core/transform/generation/failedGenerationEnvironmentChanged.ts +12 -2
  264. package/src/core/transform/generation/selectTransformAttemptDisposition.ts +3 -1
  265. package/src/core/transform/generation/transformProject.ts +13 -9
  266. package/src/core/transform/inputs/pluginSourceFilesDigest.ts +11 -4
  267. package/src/core/transform/inputs/pluginSourceHolds.ts +13 -3
  268. package/src/core/transform/inputs/pluginSourceState.ts +8 -2
  269. package/src/core/transform/inputs/preparePluginBuildEnvironments.ts +64 -11
  270. package/src/core/transform/tracker/broker/WatchBroker.ts +15 -4
  271. package/src/core/transform/tracker/broker/WatchBrokerTransport.ts +82 -0
  272. package/src/core/transform/tracker/broker/drainWatchBroker.ts +12 -13
  273. package/src/core/transform/tracker/broker/getWatchBroker.ts +89 -18
  274. package/src/core/transform/tracker/broker/openBrokeredWatch.ts +11 -14
  275. package/src/core/transform/tracker/broker/usesWatchBroker.ts +7 -7
  276. package/src/core/transform/tracker/broker/watchBrokerSource.ts +10 -11
  277. package/src/core/transform/transformTtsc.ts +38 -92
  278. package/src/core/transform/validation/TtscGenerationProof.ts +201 -0
  279. package/src/core/transform/validation/captureUniversalHostInputValidation.ts +2 -1
  280. package/src/core/transform/validation/matchesCachedSource.ts +27 -21
  281. package/src/core/transform/validation/matchesCompleteInputSnapshot.ts +5 -3
  282. package/src/core/transform/validation/matchesNarrowPersistentInputs.ts +3 -1
  283. package/src/core/transform/validation/matchesUniversalHostInputTrees.ts +8 -3
  284. package/src/core/transform/validation/matchesUniversalHostInputs.ts +6 -4
  285. package/src/core/transform/validation/nativeInputPredicatesHold.ts +36 -14
  286. package/src/core/transform/validation/notificationsProveProgramUnchanged.ts +3 -1
  287. package/src/core/transform/watch/captureWatchInputBaseline.ts +4 -0
  288. package/src/core/transform/watch/captureWatchInputBaselines.ts +7 -1
  289. package/src/core/transform/watch/notifyWatchInputs.ts +3 -0
  290. package/src/core/transform/watch/watchInputEvidenceMatchesDisk.ts +12 -2
  291. package/src/core/turbopack/turbopack.ts +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"watchInputEvidenceMatchesDisk.js","sources":["../../../../src/core/transform/watch/watchInputEvidenceMatchesDisk.ts"],"sourcesContent":[null],"names":["DEFAULT_FILESYSTEM_OPERATIONS","pluginSourceHolds","matchesGraphInputObservation","createHostPathIdentityContext","sameHostInputRealpath","hostInputRealpath","graphInputStateHash","MISSING_INPUT_STATE","hostInputStateHash"],"mappings":";;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAU,6BAA6B,CAC3C,IAAY,EACZ,QAAgC,EAChC,aAAgDA,2DAA6B,EAAA;AAE7E,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK;IAC5B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY;AAAE,QAAA,OAAO,KAAK;AACrE,IAAA,IAAI;AACF,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE;YAC1B,OAAOC,mCAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC;QAC1D;AACA,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY,EAAE;AAChC,YAAA,OAAOC,yDAA4B,CACjC,IAAI,EACJ,KAAK,CAAC,WAAW,EACjB,UAAU,EACVC,2DAA6B,CAAC,UAAU,CAAC,CAC1C;QACH;AACA,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,OAAO,EAAE;AAC3B,YAAA,QACEC,2CAAqB,CACnB,KAAK,CAAC,QAAQ,EACdC,mCAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,EACnCF,2DAA6B,CAAC,UAAU,CAAC,CAC1C;AACD,gBAAA,KAAK,CAAC,IAAI;qBACPG,uCAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAIC,uCAAmB,CAAC;QAEpE;QACA,QACE,KAAK,CAAC,IAAI;aACTC,qCAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAID,uCAAmB,CAAC;IAEjE;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,KAAK;IACd;AACF;;;;"}
1
+ {"version":3,"file":"watchInputEvidenceMatchesDisk.js","sources":["../../../../src/core/transform/watch/watchInputEvidenceMatchesDisk.ts"],"sourcesContent":[null],"names":["DEFAULT_FILESYSTEM_OPERATIONS","pluginSourceHolds","matchesGraphInputObservation","createHostPathIdentityContext","sameHostInputRealpath","hostInputRealpath","graphInputStateHash","MISSING_INPUT_STATE","hostInputStateHash"],"mappings":";;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACG,SAAU,6BAA6B,CAC3C,IAAY,EACZ,QAAgC,EAChC,UAAA,GAAgDA,2DAA6B,EAC7E,WAAoB,EAAA;AAEpB,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK;IAC5B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY;AAAE,QAAA,OAAO,KAAK;AACrE,IAAA,IAAI;AACF,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE;AAC1B,YAAA,OAAOC,mCAAiB,CACtB,IAAI,EACJ,KAAK,CAAC,MAAM,EACZ,UAAU,EACV,SAAS,EACT,WAAW,CACZ;QACH;AACA,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY,EAAE;AAChC,YAAA,OAAOC,yDAA4B,CACjC,IAAI,EACJ,KAAK,CAAC,WAAW,EACjB,UAAU,EACVC,2DAA6B,CAAC,UAAU,CAAC,CAC1C;QACH;AACA,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,OAAO,EAAE;AAC3B,YAAA,QACEC,2CAAqB,CACnB,KAAK,CAAC,QAAQ,EACdC,mCAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,EACnCF,2DAA6B,CAAC,UAAU,CAAC,CAC1C;AACD,gBAAA,KAAK,CAAC,IAAI;qBACPG,uCAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAIC,uCAAmB,CAAC;QAEpE;QACA,QACE,KAAK,CAAC,IAAI;aACTC,qCAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAID,uCAAmB,CAAC;IAEjE;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,KAAK;IACd;AACF;;;;"}
@@ -18,7 +18,10 @@ import { MISSING_INPUT_STATE } from '../validation/MISSING_INPUT_STATE.mjs';
18
18
  * a graph input by its state hash and physical target; a host input by the host
19
19
  * bytes' hash. The root-file membership is a walk over many paths and never
20
20
  * stands for one, so its evidence matches nothing here; the record holds it
21
- * apart. Evidence without a state proves nothing and does not match.
21
+ * apart. Evidence without a state proves nothing and does not match. A plugin
22
+ * tree is proven through the plugin cache records of the project the caller
23
+ * names, so a new process does not read its sources and SDK again
24
+ * (samchon/ttsc#1725).
22
25
  *
23
26
  * @evidence contracts/common.md#principled-implementation Each codec replays its recorded meaning: complete predicates, graph hash plus physical target, raw host hash or plugin-tree state; membership and absent state cannot establish one-path agreement.
24
27
  * @evidence contracts/common.md#clear-and-simple-design Discriminant branches delegate each observation to the codec owner and expose one conservative boolean comparison.
@@ -29,13 +32,13 @@ import { MISSING_INPUT_STATE } from '../validation/MISSING_INPUT_STATE.mjs';
29
32
  * @evidenceExclude contracts/performance.md#reuse-equivalent-work This asks whether current disk observations match a record; observer and plugin-tree owners establish any valid reuse, rather than caching this boolean without change witnesses.
30
33
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Comparison contexts and observed buffers are call-local; retained tree caches and active watchers have separate owners.
31
34
  */
32
- function watchInputEvidenceMatchesDisk(file, evidence, filesystem = DEFAULT_FILESYSTEM_OPERATIONS) {
35
+ function watchInputEvidenceMatchesDisk(file, evidence, filesystem = DEFAULT_FILESYSTEM_OPERATIONS, projectRoot) {
33
36
  const state = evidence.state;
34
37
  if (state === undefined || state.codec === "membership")
35
38
  return false;
36
39
  try {
37
40
  if (state.codec === "tree") {
38
- return pluginSourceHolds(file, state.digest, filesystem);
41
+ return pluginSourceHolds(file, state.digest, filesystem, undefined, projectRoot);
39
42
  }
40
43
  if (state.codec === "predicates") {
41
44
  return matchesGraphInputObservation(file, state.observation, filesystem, createHostPathIdentityContext(filesystem));
@@ -1 +1 @@
1
- {"version":3,"file":"watchInputEvidenceMatchesDisk.mjs","sources":["../../../../src/core/transform/watch/watchInputEvidenceMatchesDisk.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAU,6BAA6B,CAC3C,IAAY,EACZ,QAAgC,EAChC,aAAgD,6BAA6B,EAAA;AAE7E,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK;IAC5B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY;AAAE,QAAA,OAAO,KAAK;AACrE,IAAA,IAAI;AACF,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE;YAC1B,OAAO,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC;QAC1D;AACA,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY,EAAE;AAChC,YAAA,OAAO,4BAA4B,CACjC,IAAI,EACJ,KAAK,CAAC,WAAW,EACjB,UAAU,EACV,6BAA6B,CAAC,UAAU,CAAC,CAC1C;QACH;AACA,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,OAAO,EAAE;AAC3B,YAAA,QACE,qBAAqB,CACnB,KAAK,CAAC,QAAQ,EACd,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,EACnC,6BAA6B,CAAC,UAAU,CAAC,CAC1C;AACD,gBAAA,KAAK,CAAC,IAAI;qBACP,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,mBAAmB,CAAC;QAEpE;QACA,QACE,KAAK,CAAC,IAAI;aACT,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,mBAAmB,CAAC;IAEjE;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,KAAK;IACd;AACF;;;;"}
1
+ {"version":3,"file":"watchInputEvidenceMatchesDisk.mjs","sources":["../../../../src/core/transform/watch/watchInputEvidenceMatchesDisk.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACG,SAAU,6BAA6B,CAC3C,IAAY,EACZ,QAAgC,EAChC,UAAA,GAAgD,6BAA6B,EAC7E,WAAoB,EAAA;AAEpB,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK;IAC5B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY;AAAE,QAAA,OAAO,KAAK;AACrE,IAAA,IAAI;AACF,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE;AAC1B,YAAA,OAAO,iBAAiB,CACtB,IAAI,EACJ,KAAK,CAAC,MAAM,EACZ,UAAU,EACV,SAAS,EACT,WAAW,CACZ;QACH;AACA,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY,EAAE;AAChC,YAAA,OAAO,4BAA4B,CACjC,IAAI,EACJ,KAAK,CAAC,WAAW,EACjB,UAAU,EACV,6BAA6B,CAAC,UAAU,CAAC,CAC1C;QACH;AACA,QAAA,IAAI,KAAK,CAAC,KAAK,KAAK,OAAO,EAAE;AAC3B,YAAA,QACE,qBAAqB,CACnB,KAAK,CAAC,QAAQ,EACd,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,EACnC,6BAA6B,CAAC,UAAU,CAAC,CAC1C;AACD,gBAAA,KAAK,CAAC,IAAI;qBACP,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,mBAAmB,CAAC;QAEpE;QACA,QACE,KAAK,CAAC,IAAI;aACT,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,mBAAmB,CAAC;IAEjE;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,KAAK;IACd;AACF;;;;"}
@@ -164,6 +164,7 @@ function turbopack(source) {
164
164
  }
165
165
  const hooks = {
166
166
  exactPath: true,
167
+ watching,
167
168
  ...(addDependency === undefined
168
169
  ? {}
169
170
  : {
@@ -178,7 +179,7 @@ function turbopack(source) {
178
179
  toolDirectory,
179
180
  // Turbopack takes no record outside its root, so a watching worker
180
181
  // refuses a module it could hand none (samchon/ttsc#1480).
181
- watching: bridge !== undefined,
182
+ watching,
182
183
  },
183
184
  }),
184
185
  ...(bindings.markVolatile === undefined
@@ -1 +1 @@
1
- {"version":3,"file":"turbopack.js","sources":["../../../src/core/turbopack/turbopack.ts"],"sourcesContent":[null],"names":["createTtscTransformCache","shareTtscTransformCache","readTtscTransformSession","isTransformTarget","createTurbopackLoaderBindings","hostToolDirectory","openHostWatchBridge","refreshProjectRecordFiles","registerProjectRecord","transformTtsc","resolveOptions","TtscCompileFailureError","failedModuleSource"],"mappings":";;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,IACE,CAAC,QAAQ;AACT,YAAA,SAAS,KAAK,SAAS;AACvB,YAAA,EAAE,KAAK,YAAYC,+CAAuB,CAAC,EAC3C;YACA,QAAQ,CAAC,KAAK,CAAC;YACf;QACF;QACA,SAAS,CAAC,KAAK,CAAC;QAChB,QAAQ,CAAC,SAAS,EAAEC,qCAAkB,CAAC,KAAK,CAAC,CAAC;AAChD,IAAA,CAAC,CACF;AACH;;;;"}
1
+ {"version":3,"file":"turbopack.js","sources":["../../../src/core/turbopack/turbopack.ts"],"sourcesContent":[null],"names":["createTtscTransformCache","shareTtscTransformCache","readTtscTransformSession","isTransformTarget","createTurbopackLoaderBindings","hostToolDirectory","openHostWatchBridge","refreshProjectRecordFiles","registerProjectRecord","transformTtsc","resolveOptions","TtscCompileFailureError","failedModuleSource"],"mappings":";;;;;;;;;;;;;;;;AAkBA;;;;;;;;AAQG;AACH,MAAM,cAAc,GAAGA,iDAAwB,EAAE;AACjDC,+CAAuB,CAAC,cAAc,EAAEC,iDAAwB,EAAE,CAAC;AAEnE;;;;AAIG;AACH,IAAI,MAAmC;AAEvC;;;AAGG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEG;AACG,SAAU,SAAS,CAEvB,MAAc,EAAA;AAEd,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE;;;AAG7B,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY;;;;;;AAM9B,IAAA,IAAI,CAACC,mCAAiB,CAAC,IAAI,CAAC,EAAE;AAC5B,QAAA,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B;IACF;;;;;;;;;;;;;;;;;;;AAmBA,IAAA,MAAM,QAAQ,GAAGC,2DAA6B,CAAC,IAAI,CAAC;AACpD,IAAA,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,QAAQ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cAAE;cACA,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC;KAC7C;AACD,IAAAC,2BAAa,CACX,IAAI,EACJ,MAAM,EACNC,6BAAc,CAAC,aAAa,CAAC,EAC7B,SAAS,EACT,cAAc,EACd,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,SAAS,GAAG,KAAK,CACpD,CAAC,IAAI,CACJ,CAAC,MAAM,KACL,MAAM,KAAK;AACT,UAAE,QAAQ,CAAC,SAAS,EAAE,MAAM;AAC5B,UAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,EAClD,CAAC,KAAK,KAAI;;;;;;;;;;;;;;;;;AAiBR,QAAA,IACE,CAAC,QAAQ;AACT,YAAA,SAAS,KAAK,SAAS;AACvB,YAAA,EAAE,KAAK,YAAYC,+CAAuB,CAAC,EAC3C;YACA,QAAQ,CAAC,KAAK,CAAC;YACf;QACF;QACA,SAAS,CAAC,KAAK,CAAC;QAChB,QAAQ,CAAC,SAAS,EAAEC,qCAAkB,CAAC,KAAK,CAAC,CAAC;AAChD,IAAA,CAAC,CACF;AACH;;;;"}
@@ -162,6 +162,7 @@ function turbopack(source) {
162
162
  }
163
163
  const hooks = {
164
164
  exactPath: true,
165
+ watching,
165
166
  ...(addDependency === undefined
166
167
  ? {}
167
168
  : {
@@ -176,7 +177,7 @@ function turbopack(source) {
176
177
  toolDirectory,
177
178
  // Turbopack takes no record outside its root, so a watching worker
178
179
  // refuses a module it could hand none (samchon/ttsc#1480).
179
- watching: bridge !== undefined,
180
+ watching,
180
181
  },
181
182
  }),
182
183
  ...(bindings.markVolatile === undefined
@@ -1 +1 @@
1
- {"version":3,"file":"turbopack.mjs","sources":["../../../src/core/turbopack/turbopack.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;AAkBA;;;;;;;;AAQG;AACH,MAAM,cAAc,GAAG,wBA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K,CACpD,CAAC,IAAI,CACJ,CAAC,MAAM,KACL,MAAM,KAAK;AACT,UAAE,QAAQ,CAAC,SAAS,EAAE,MAAM;AAC5B,UAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,EAClD,CAAC,KAAK,KAAI;;;;;;;;;;;;;;;;;AAiBR,QAAA,IACE,CAAC,QAAQ;AACT,YAAA,SAAS,KAAK,SAAS;AACvB,YAAA,EAAE,KAAK,YAAY,uBAAuB,CAAC,EAC3C;YACA,QAAQ,CAAC,KAAK,CAAC;YACf;QACF;QACA,SAAS,CAAC,KAAK,CAAC;QAChB,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAChD,IAAA,CAAC,CACF;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttsc/unplugin",
3
- "version": "0.31.0",
3
+ "version": "0.31.2",
4
4
  "description": "Bundler adapters for ttsc plugins.",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
@@ -202,7 +202,7 @@
202
202
  "fsevents": "^2.3.3"
203
203
  },
204
204
  "peerDependencies": {
205
- "ttsc": "^0.31.0"
205
+ "ttsc": "^0.31.2"
206
206
  },
207
207
  "devDependencies": {
208
208
  "@wrtnlabs/evidence": "^0.3.1",
@@ -217,7 +217,7 @@
217
217
  "tslib": "^2.8.1",
218
218
  "typescript": "^7.0.2",
219
219
  "vite": "^7.3.5",
220
- "ttsc": "0.31.0"
220
+ "ttsc": "0.31.2"
221
221
  },
222
222
  "repository": {
223
223
  "type": "git",
@@ -61,7 +61,9 @@ export function projectRecordMoved(
61
61
  refreshProcessClockReference(record.root, filesystem);
62
62
  for (const [input, evidence] of Object.entries(record.inputs)) {
63
63
  if (evidence === null || typeof evidence !== "object") return input;
64
- if (!watchInputEvidenceMatchesDisk(input, evidence, filesystem))
64
+ if (
65
+ !watchInputEvidenceMatchesDisk(input, evidence, filesystem, record.root)
66
+ )
65
67
  return input;
66
68
  }
67
69
  if (record.membership === null) return undefined;
@@ -8,7 +8,6 @@ import { typescriptTransformBunLoader } from "../source/typescriptTransformBunLo
8
8
  import { beginTtscTransformBuild } from "../transform/cache/beginTtscTransformBuild";
9
9
  import { createTtscTransformCache } from "../transform/cache/createTtscTransformCache";
10
10
  import { resetTtscTransformCache } from "../transform/cache/resetTtscTransformCache";
11
- import { withdrawTtscTransformGenerations } from "../transform/cache/withdrawTtscTransformGenerations";
12
11
  import { transformTtsc } from "../transform/transformTtsc";
13
12
  import { inlineSourceMap } from "../transform/utils/inlineSourceMap";
14
13
  import type { BunLikeBuild } from "./BunLikeBuild";
@@ -74,8 +73,9 @@ function resolveBunOptions(
74
73
  * The first included transformable load resolves options once. One cache shares a validated
75
74
  * project generation across deliveries; bundler start/end boundaries reset
76
75
  * delivery proof, while a runtime retains its immutable module-load session.
77
- * An incomplete observation withdraws the adapter's entire generation cache;
78
- * only the newly compiled delivery is returned within this nonwatching session.
76
+ * Coherent local output with unavailable observation shares first deliveries
77
+ * only inside this nonwatching pass through the common proof owner; no
78
+ * persistent host cache or shared publication can retain it.
79
79
  * Setup snapshots the in-memory key population; changing host files/options
80
80
  * is not authorized merely by an unchanged path or previously quiet callback.
81
81
  * @evidence contracts/performance.md#bound-retention-and-release-resources
@@ -141,7 +141,11 @@ export function bun(options?: TtscBunOptions): BunLikePlugin {
141
141
  // The path this loader just read from disk is the file's own.
142
142
  exactPath: true,
143
143
  watching: false,
144
- markVolatile: () => withdrawTtscTransformGenerations(cache),
144
+ // Bun has no reusable host module cache inside this immutable
145
+ // build/runtime session. The common core owns generation eviction
146
+ // and pass-only reuse; withdrawing it here recompiles every module
147
+ // when Bun cannot supply synchronous observation (#1712, #1713).
148
+ markVolatile: () => {},
145
149
  },
146
150
  );
147
151
  if (result !== undefined) {
@@ -217,11 +217,12 @@ export function createInputObserver(
217
217
  let poller: { close(): void } | undefined;
218
218
  let flushTimer: NodeJS.Timeout | undefined;
219
219
 
220
- // Windows and macOS run every native observer in the isolated watch broker:
221
- // Windows so an abort in Node's fs-event backend cannot take the host process
222
- // down with it (samchon/ttsc#1411), and macOS so each scope is its own
223
- // FSEventStream, whose dropped events are reported instead of lost
224
- // (samchon/ttsc#1418, samchon/ttsc#1425).
220
+ // Windows uses ttsc's native completion-port helper, excluding access-only
221
+ // notifications without opening Node fs-event handles (samchon/ttsc#1719).
222
+ // Do not restore fs.watch here: reads can invalidate an unchanged generation,
223
+ // and deleting a watched temporary tree can abort Node (samchon/ttsc#1411).
224
+ // macOS keeps each scope in its own brokered FSEventStream, whose dropped
225
+ // events are reported instead of lost (samchon/ttsc#1418, samchon/ttsc#1425).
225
226
  const open =
226
227
  operations.watch ??
227
228
  (process.platform === "win32" || process.platform === "darwin"
@@ -531,6 +532,8 @@ export function createInputObserver(
531
532
  entry.file,
532
533
  state.digest,
533
534
  DEFAULT_FILESYSTEM_OPERATIONS,
535
+ undefined,
536
+ projectRoot,
534
537
  );
535
538
  } else if (state?.codec === "predicates") {
536
539
  changed =
@@ -7,18 +7,17 @@ import { openBrokeredWatch } from "../transform/tracker/broker/openBrokeredWatch
7
7
  * Open one recursive observer inside the transform core's isolated watch broker
8
8
  * instead of the host process.
9
9
  *
10
- * On Windows, Node's fs-event backend can abort the process that owns a watch,
11
- * for instance with `Assertion failed: !_wcsnicmp(filename, dir, dirlen)` in
12
- * `src\win\fs-event.c` (samchon/ttsc#1411). On macOS, libuv serves every
13
- * directory watch of a loop through one FSEventStream and re-creates it
14
- * whenever any watch opens or closes, losing the events in between
15
- * (samchon/ttsc#1418), where the broker opens one stream per watch. The
16
- * observer's scopes get the isolation the transform core's trackers have,
17
- * through the same registration (`openBrokeredWatch`) with a sink of their own
18
- * that forwards events (samchon/ttsc#1485). Attributed events reach `listener`
19
- * with a joined caller-directory path; unattributed events use null. A failed
20
- * registration reaches `onError`, which hands the scope's entries to the
21
- * bounded poll.
10
+ * On Windows, ttsc's direct native helper excludes access-only notifications
11
+ * and reports actual mutation, loss and failure through the same broker sink.
12
+ * On macOS, libuv serves every directory watch of a loop through one
13
+ * FSEventStream and re-creates it whenever any watch opens or closes, losing
14
+ * the events in between (samchon/ttsc#1418), where the broker opens one stream
15
+ * per watch. The observer's scopes get the isolation the transform core's
16
+ * trackers have, through the same registration (`openBrokeredWatch`) with a
17
+ * sink of their own that forwards events (samchon/ttsc#1485). Attributed events
18
+ * reach `listener` with a joined caller-directory path; unattributed events use
19
+ * null. A failed registration reaches `onError`, which hands the scope's
20
+ * entries to the bounded poll.
22
21
  *
23
22
  * Registration completes asynchronously, and FSEvents can later drop events
24
23
  * (samchon/ttsc#1425). Until the broker confirms the watch, and whenever it
@@ -232,12 +232,22 @@ export interface TtscCachedProjectTransform {
232
232
 
233
233
  /**
234
234
  * A locally admitted answer with incomplete host observations cannot be
235
- * retained for resident, shared or persistent reuse. Successful answers need
236
- * only explicit unavailable observations; diagnostic admission keeps its
237
- * existing current-verdict policy. This flag never grants admission itself.
235
+ * retained for shared or persistent reuse. A separately admitted coherent
236
+ * local success may share first deliveries only in its explicit nonwatching
237
+ * pass (passDeliveryOnly). Successful answers need only explicit unavailable
238
+ * observations; diagnostic admission keeps its existing current-verdict
239
+ * policy. This flag never grants admission itself.
238
240
  */
239
241
  freshDeliveryOnly?: boolean;
240
242
 
243
+ /**
244
+ * Coherent local success whose only missing authority is host observation.
245
+ * WARNING (#1713): this grants neither persistent nor pooled reuse. The
246
+ * common proof owner requires an explicit nonwatching pass, a recorded
247
+ * source, first delivery and actual host-cache withdrawal on every delivery.
248
+ */
249
+ passDeliveryOnly?: boolean;
250
+
241
251
  /** Absolute path to the directory that owns the tsconfig. */
242
252
  projectRoot: string;
243
253
 
@@ -1,5 +1,6 @@
1
1
  import { envelopeDerivation } from "../envelope/envelopeDerivation";
2
2
  import { isVolatileFile } from "../envelope/isVolatileFile";
3
+ import type { TtscGenerationProof } from "../validation/TtscGenerationProof";
3
4
  import { matchesCachedSource } from "../validation/matchesCachedSource";
4
5
  import type { TtscCachedProjectTransform } from "./TtscCachedProjectTransform";
5
6
  import type { TtscTransformCache } from "./TtscTransformCache";
@@ -42,6 +43,7 @@ export function selectCachedGenerationAction(props: {
42
43
  generation: Promise<TtscCachedProjectTransform>;
43
44
  key: string;
44
45
  source: string;
46
+ proof?: TtscGenerationProof.Transaction;
45
47
  }): "serve" | "retry" | "capture" {
46
48
  if (
47
49
  !isVolatileFile(envelopeDerivation(props.cached), {
@@ -49,7 +51,13 @@ export function selectCachedGenerationAction(props: {
49
51
  projectRoot: props.cached.projectRoot,
50
52
  result: props.cached.result,
51
53
  }) &&
52
- matchesCachedSource(props.cached, props.file, props.source, props.epoch)
54
+ matchesCachedSource(
55
+ props.cached,
56
+ props.file,
57
+ props.source,
58
+ props.epoch,
59
+ props.proof,
60
+ )
53
61
  ) {
54
62
  return "serve";
55
63
  }
@@ -0,0 +1,97 @@
1
+ import type { TtscCachedProjectTransform } from "./cache/TtscCachedProjectTransform";
2
+ import type { TtscTransformCache } from "./cache/TtscTransformCache";
3
+ import { evictGeneration } from "./cache/evictGeneration";
4
+ import { selectOrEvict } from "./cache/selectOrEvict";
5
+ import { reportMissingProgramOutput } from "./diagnostics/reportMissingProgramOutput";
6
+ import { reportSuccessDiagnostics } from "./diagnostics/reportSuccessDiagnostics";
7
+ import { TtscMissingProgramOutputError } from "./errors/TtscMissingProgramOutputError";
8
+ import { createTransformResult } from "./utils/createTransformResult";
9
+ import { TtscGenerationProof } from "./validation/TtscGenerationProof";
10
+ import { markCachedSourceServed } from "./validation/markCachedSourceServed";
11
+ import type { TtscTransformHooks } from "./watch/TtscTransformHooks";
12
+ import type { TtscWatchSelection } from "./watch/TtscWatchSelection";
13
+ import { notifyFailedGenerationInputs } from "./watch/notifyFailedGenerationInputs";
14
+ import { notifyVolatileDelivery } from "./watch/notifyVolatileDelivery";
15
+ import { notifyWatchInputs } from "./watch/notifyWatchInputs";
16
+
17
+ /**
18
+ * Deliver both captured and reused generations through one failure boundary.
19
+ *
20
+ * WARNING (#1713): host capabilities and callbacks apply to every delivery,
21
+ * including cache hits. Incomplete local results must never survive a failed
22
+ * handoff or acquire a persistent record. Stable ordinary generations retain
23
+ * their existing callback-failure recovery policy.
24
+ *
25
+ * A missing program output is an admitted absence: notify the same selection
26
+ * inputs and return control to the host. Compile failure retains its existing
27
+ * terminal policy through selectOrEvict and reports repair inputs.
28
+ *
29
+ * @evidence contracts/common.md#principled-implementation Captured and reused results share lifecycle admission, output selection, diagnostics and host handoff; incomplete ownership is evicted on any failed delivery effect, while missing output remains a host fallthrough.
30
+ * @evidence contracts/common.md#clear-and-simple-design One synchronous boundary removes duplicate initial/cache-hit delivery paths and their divergent callback and cleanup rules.
31
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Missing outputs never manufacture transformed bytes or reusable observation authority; incomplete handoff failure cannot leave an owner for a sibling.
32
+ * @evidence contracts/common.md#meaningful-documentation Native prose states per-delivery capability, callback failure, missing-output and compile-failure responsibilities.
33
+ * @evidence contracts/portability.md#os-neutral-implementation Native identities and host spellings remain delegated to the generation's existing output/watch owners.
34
+ * @evidence contracts/performance.md#efficient-algorithms Selection uses generation indexes; diagnostics, output/map work and current host callbacks remain necessary per delivery. Watch input and record derivation retain their owning population costs.
35
+ * @evidence contracts/performance.md#reuse-equivalent-work Initial and reused answers share the exact same operation, while generation-owned indexes and the pass-qualified compiled result retain their separate validity premises.
36
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Fresh-only admission releases capture resources; failed incomplete delivery evicts only its exact Promise. Ordinary selection/terminal and host lifecycle owners retain their established resource policy.
37
+ */
38
+ export function deliverCachedTransform(props: {
39
+ cache: TtscTransformCache | undefined;
40
+ cached: TtscCachedProjectTransform;
41
+ generation: Promise<TtscCachedProjectTransform>;
42
+ key: string;
43
+ epoch: number | undefined;
44
+ file: string;
45
+ source: string;
46
+ hooks: TtscTransformHooks | undefined;
47
+ selection: TtscWatchSelection;
48
+ }) {
49
+ const {
50
+ cache,
51
+ cached,
52
+ generation,
53
+ key,
54
+ epoch,
55
+ file,
56
+ source,
57
+ hooks,
58
+ selection,
59
+ } = props;
60
+ try {
61
+ TtscGenerationProof.admitFreshOnly(
62
+ cached,
63
+ cache,
64
+ key,
65
+ generation,
66
+ epoch,
67
+ hooks,
68
+ );
69
+ reportSuccessDiagnostics(cached, epoch);
70
+ let output;
71
+ try {
72
+ output = selectOrEvict(cache, key, generation, epoch, {
73
+ file,
74
+ projectRoot: cached.projectRoot,
75
+ result: cached.result,
76
+ tsconfig: cached.tsconfig,
77
+ });
78
+ } catch (error) {
79
+ if (!(error instanceof TtscMissingProgramOutputError)) {
80
+ notifyFailedGenerationInputs(hooks, cached, file, selection);
81
+ throw error;
82
+ }
83
+ reportMissingProgramOutput(cached, error, epoch);
84
+ notifyWatchInputs(hooks, cached, file, selection);
85
+ markCachedSourceServed(cached, file);
86
+ return undefined;
87
+ }
88
+ notifyWatchInputs(hooks, cached, file, selection);
89
+ markCachedSourceServed(cached, file);
90
+ notifyVolatileDelivery(hooks, cached, file);
91
+ return createTransformResult(file, source, output);
92
+ } catch (error) {
93
+ if (cached.freshDeliveryOnly === true)
94
+ evictGeneration(cache, key, generation);
95
+ throw error;
96
+ }
97
+ }
@@ -26,8 +26,8 @@ import { isTransformScratchInput } from "../tsconfig/isTransformScratchInput";
26
26
  * Visits each reported occurrence in graph endpoints/globals/configs,
27
27
  * candidates, host inputs and dependency arrays. Native resolve, scratch
28
28
  * checks, project-key identity/ancestor/case observations and text hashing
29
- * precede each own-key membership test; duplicate declarations still pay
30
- * those queries, with native answers shared by the supplied context. Entry
29
+ * precede each own-key membership test after lexical deduplication; repeated
30
+ * declarations pay resolution but no repeated native classification. Entry
31
31
  * arrays from Object.entries/Object.values follow producer populations,
32
32
  * while the returned set cannot exceed keys present in the project snapshot.
33
33
  * @evidenceExclude contracts/performance.md#reuse-equivalent-work
@@ -49,9 +49,12 @@ export function selectDeclaredProjectInputKeys(props: {
49
49
  }
50
50
  const graph = props.result.graph;
51
51
  const keys = new Set<string>();
52
+ const seen = new Set<string>();
52
53
  const add = (entry: unknown): void => {
53
54
  if (typeof entry !== "string" || entry.length === 0) return;
54
55
  const absolute = path.resolve(props.projectRoot, entry);
56
+ if (seen.has(absolute)) return;
57
+ seen.add(absolute);
55
58
  if (isTransformScratchInput(absolute, props.scratchDirectory)) return;
56
59
  const key = toProjectKey(props.projectRoot, absolute, props.identities);
57
60
  if (Object.prototype.hasOwnProperty.call(props.projectInputHashes, key)) {
@@ -36,17 +36,15 @@ import { envelopeGraphIndexes } from "./envelopeGraphIndexes";
36
36
  * @evidence contracts/performance.md#efficient-algorithms
37
37
  * Cold graph index construction precedes separate scans of output, graph,
38
38
  * candidate, dependency and host lists, followed by every collected member's
39
- * filter pass. Duplicate occurrences still pay path/identity and candidate
40
- * observations before seen rejection; rejected walk members are not added to
41
- * seen. Native path/ancestor/case, existence and walk policy/component checks
39
+ * filter pass. Lexical deduplication precedes native identity/candidate/walk
40
+ * observations, including rejected members; distinct aliases stay separate. Native path/ancestor/case, existence and walk policy/component checks
42
41
  * add costs to list/key text. Collected members, candidate/seen sets and
43
42
  * output allocate population-sized storage; final string sorting adds output
44
43
  * comparison work.
45
44
  * @evidence contracts/performance.md#reuse-equivalent-work
46
45
  * Generation state shares completed graph parsing, while this call's native
47
46
  * identity context reuses its qualified path observations. The sets dedupe
48
- * emitted lexical names and mark candidate membership; they do not suppress
49
- * every repeated classification. Supplied filesystem, producer-derived state
47
+ * every lexical classification and mark candidate membership. Supplied filesystem, producer-derived state
50
48
  * and membership policy must represent the same stable generation view.
51
49
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
52
50
  * Its collections are local to the call and released on return; only the
@@ -144,6 +142,10 @@ export function selectExternalInputPaths(props: {
144
142
  }
145
143
  const absolute = path.resolve(props.projectRoot, member);
146
144
  const spelling = path.resolve(absolute);
145
+ // Classify each lexical address once, including rejected walk members.
146
+ // Physical aliases remain distinct so retargeting is still observable.
147
+ if (seen.has(spelling)) continue;
148
+ seen.add(spelling);
147
149
  const identity = pathIdentityKey(absolute, identities);
148
150
  const observation = graphIndexes.inputObservations.get(spelling);
149
151
  const missingCandidate =
@@ -153,7 +155,6 @@ export function selectExternalInputPaths(props: {
153
155
  if (
154
156
  identity === excluded ||
155
157
  isTransformScratchInput(absolute, props.scratchDirectory) ||
156
- seen.has(spelling) ||
157
158
  (!missingCandidate &&
158
159
  isProjectWalkPath(
159
160
  props.projectRoot,
@@ -167,7 +168,6 @@ export function selectExternalInputPaths(props: {
167
168
  }
168
169
  // Preserve distinct lexical aliases even when they currently select the
169
170
  // same physical file. A later retarget must validate the alias itself.
170
- seen.add(spelling);
171
171
  output.push(absolute);
172
172
  }
173
173
  output.sort();
@@ -198,23 +198,26 @@ export interface TtscTransformFilesystemOperations {
198
198
  * Open one directory's change notification, or throw when the observed
199
199
  * filesystem cannot provide one.
200
200
  *
201
- * Left undefined, generations watch the host filesystem: in process on Linux,
202
- * and through an isolated broker process on Windows and macOS. An embedder
203
- * observing another filesystem supplies its own; a generation whose watch
204
- * cannot be opened keeps validating from recorded state instead of losing its
205
- * cache.
201
+ * Left undefined, generations watch the host filesystem through the native
202
+ * Linux helper, the native Windows completion-port helper, or the macOS
203
+ * FSEvents broker. An embedder observing another filesystem supplies its own;
204
+ * a generation whose watch cannot be opened keeps validating from recorded
205
+ * state instead of losing its cache.
206
206
  *
207
- * Supplying one replaces the broker as well, so an embedder that wraps Node's
208
- * own `fs.watch` gives up what the broker provides: on Windows, containing
209
- * the native abort Node's fs-event backend can raise when a watched temporary
210
- * tree is deleted, and on macOS, one FSEventStream per watch whose dropped
211
- * events are reported rather than lost silently.
207
+ * Supplying one bypasses these native owners. Wrapping Node's `fs.watch`
208
+ * reintroduces Windows access-only notifications that invalidate unchanged
209
+ * inputs, and the native abort its fs-event backend can raise when a watched
210
+ * temporary tree is deleted. It also gives up explicit notification-loss
211
+ * reporting from the Linux helper and macOS's per-watch FSEventStream.
212
+ * Preserve mutation and loss reporting when implementing this capability;
213
+ * timestamps or identical current bytes cannot discard an actual A-B-A
214
+ * event.
212
215
  *
213
216
  * @evidence contracts/common.md#principled-implementation The watch capability reports actual directory changes and failure; its absence or failure cannot certify silence as unchanged inputs.
214
217
  * @evidence contracts/common.md#clear-and-simple-design One optional native operation exposes observation and a close handle, leaving broker selection and retained-generation proof in their owners.
215
218
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Injected watches are explicit capabilities rather than patched fs methods, and errors require recorded-state validation instead of synthetic live coverage.
216
- * @evidence contracts/common.md#meaningful-documentation The native paragraphs explain absent overrides, failed watches, broker bypass, and the Windows/macOS capability lost when wrapping fs.watch directly.
217
- * @evidence contracts/portability.md#os-neutral-implementation OS-neutral watching requires the observed filesystem's capability and accounts for backend-specific abort isolation and dropped-stream reporting rather than assuming recursive notifications are interchangeable.
219
+ * @evidence contracts/common.md#meaningful-documentation The native paragraphs explain default owners, failed watches, explicit override authority, access-only noise, native aborts and mutation/loss reporting that a direct fs.watch wrapper cannot supply.
220
+ * @evidence contracts/portability.md#os-neutral-implementation OS-neutral watching requires the observed filesystem's capability and accounts for native Windows mutation filtering and Linux/macOS loss reporting rather than assuming recursive notifications are interchangeable.
218
221
  * @evidenceExclude contracts/performance.md#efficient-algorithms
219
222
  * Only the signature of watch is declared here; the cost belongs to its
220
223
  * implementation.
@@ -70,6 +70,7 @@ export function captureFailedGenerationInputStates(
70
70
  environment: PluginBuildEnvironmentReadings.cached(input),
71
71
  }
72
72
  : undefined,
73
+ cached.projectRoot,
73
74
  ) ?? MISSING_INPUT_STATE,
74
75
  tree: true,
75
76
  },
@@ -422,7 +422,12 @@ export async function captureTransformGeneration(props: {
422
422
  // Prepare native toolchain authority before post-compile admission. Its
423
423
  // cold subprocess and SDK reads stay off this host's event loop, and the
424
424
  // config/walk/notification checks below include that asynchronous window.
425
- await preparePluginBuildEnvironments(result, props.filesystem);
425
+ await preparePluginBuildEnvironments(
426
+ result,
427
+ props.filesystem,
428
+ undefined,
429
+ projectRoot,
430
+ );
426
431
  const { membershipPolicy, casePolicyLearned } =
427
432
  selectReportedMembershipPolicy(primedPolicy, result);
428
433
  TRANSFORM_RESULT_MEMBERSHIP.set(result, {
@@ -150,8 +150,18 @@ function environmentChanged(
150
150
  : undefined;
151
151
  if (
152
152
  recorded.state === MISSING_INPUT_STATE
153
- ? pluginSourceState(input, prepared) !== null
154
- : !pluginSourceHolds(input, recorded.state, filesystem, prepared)
153
+ ? pluginSourceState(
154
+ input,
155
+ prepared,
156
+ validation.cached.projectRoot,
157
+ ) !== null
158
+ : !pluginSourceHolds(
159
+ input,
160
+ recorded.state,
161
+ filesystem,
162
+ prepared,
163
+ validation.cached.projectRoot,
164
+ )
155
165
  )
156
166
  return true;
157
167
  continue;
@@ -8,7 +8,9 @@ import { onlyLearnedCompileFacts } from "./onlyLearnedCompileFacts";
8
8
  * facts describe the capture; this policy performs no capture or native proof.
9
9
  *
10
10
  * Coherent results return first. A local, lossless host-observation refusal can
11
- * transfer one fresh success without reuse authority. Rejected attempts spend
11
+ * transfer an incomplete local success. TtscGenerationProof owns any sharing of
12
+ * its first module deliveries inside an explicit nonwatching pass; this policy
13
+ * grants no independent native or persistent proof. Rejected attempts spend
12
14
  * movement only when they neither refute a publication nor solely learn facts.
13
15
  * Two movements or four captures stop retrying, retaining a current diagnostic
14
16
  * rather than a terminal instability verdict when its config is not refuted.