@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
@@ -10,6 +10,7 @@ import { pathIdentityKey } from "../filesystem/pathIdentityKey";
10
10
  import { hostInputStateHash } from "../inputs/hostInputStateHash";
11
11
  import { toProjectKey } from "../project/toProjectKey";
12
12
  import { hashText } from "../utils/hashText";
13
+ import { TtscGenerationProof } from "./TtscGenerationProof";
13
14
  import { matchesCompleteInputSnapshot } from "./matchesCompleteInputSnapshot";
14
15
  import { matchesNarrowPersistentInputs } from "./matchesNarrowPersistentInputs";
15
16
  import { nativeInputPredicatesHold } from "./nativeInputPredicatesHold";
@@ -24,17 +25,19 @@ import { notificationsProveProgramUnchanged } from "./notificationsProveProgramU
24
25
  * no source comparison. A cache with a delivery epoch can use that comparison
25
26
  * alone for a stable generation's first delivery of each module in the current
26
27
  * pass, once the pass's own first delivery has proven the whole generation
27
- * still matches the filesystem. An incomplete generation may not take this
28
- * shortcut: otherwise a sibling output captured during a filesystem race could
29
- * still be served once. Later graph-bearing requests validate the file's
30
- * derived input set and project membership. A failed result is a diagnostic of
31
- * the whole loaded program, so its repair cannot be proved by one delivered
32
- * output's dependency closure. Failed and graph-free envelopes conservatively
33
- * validate the complete project and out-of-walk snapshots, reusing qualified
34
- * signatures. A mismatch rejects this generation for the delivery; its caller
35
- * chooses replacement or capture. Delivered text that differs while the disk
36
- * still holds the bytes the generation compiled is not one: it is reported and
37
- * served, since the compile read the disk (samchon/ttsc#1394).
28
+ * still matches the filesystem. Incomplete generations cannot claim complete
29
+ * proof. A coherent local success admitted only because its observer was
30
+ * unavailable may share first deliveries in its exact nonwatching pass through
31
+ * TtscGenerationProof; it cannot cross passes or earn persistent authority.
32
+ * Later graph-bearing requests validate the file's derived input set and
33
+ * project membership. A failed result is a diagnostic of the whole loaded
34
+ * program, so its repair cannot be proved by one delivered output's dependency
35
+ * closure. Failed and graph-free envelopes conservatively validate the complete
36
+ * project and out-of-walk snapshots, reusing qualified signatures. A mismatch
37
+ * rejects this generation for the delivery; its caller chooses replacement or
38
+ * capture. Delivered text that differs while the disk still holds the bytes the
39
+ * generation compiled is not one: it is reported and served, since the compile
40
+ * read the disk (samchon/ttsc#1394).
38
41
  *
39
42
  * Its place in the adapter's invalidation model, and the units beside it, are
40
43
  * mapped in the maintainer page
@@ -42,7 +45,7 @@ import { notificationsProveProgramUnchanged } from "./notificationsProveProgramU
42
45
  *
43
46
  * @evidence contracts/common.md#principled-implementation Delivered source, generation completeness, pass identity and notification authority choose between first-delivery proof, derived-input validation and complete snapshots; divergent editor text never substitutes for compiler disk inputs.
44
47
  * @evidence contracts/common.md#clear-and-simple-design This admission boundary chooses the required proof while dedicated validators own membership, universal inputs and content comparisons.
45
- * @evidence contracts/common.md#prohibited-implementation-shortcuts An incomplete generation cannot earn a first-delivery shortcut; inherited object members cannot invent a project baseline, and losing watcher proof falls back to recorded-state validation.
48
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts An incomplete generation cannot claim complete snapshot authority; only separately admitted coherent local success can share first deliveries of its exact nonwatching pass; inherited object members cannot invent a project baseline, and losing watcher proof falls back to recorded-state validation.
46
49
  * @evidence contracts/common.md#meaningful-documentation Separate native paragraphs explain disk-versus-delivered authority, epoch qualification, fallback and related maintainer guidance before tags.
47
50
  * @evidence contracts/portability.md#os-neutral-implementation Project membership and path identity use recorded compiler case policy and injected native operations; OS names do not certify case sensitivity or watcher capabilities.
48
51
  * @evidence contracts/performance.md#bound-retention-and-release-resources
@@ -52,13 +55,13 @@ import { notificationsProveProgramUnchanged } from "./notificationsProveProgramU
52
55
  * while validators replace current signature/directory witnesses. No new
53
56
  * independent handle or historical epoch collection is acquired here.
54
57
  * @evidence contracts/performance.md#efficient-algorithms Every admission first replays all generation-owned typed config predicates; this mandatory cost includes native queries, file bytes or directory membership independently of watcher/epoch qualification.
55
- * Fresh-only rejection precedes native identity work. Baseline-bearing paths
58
+ * Unsupported fresh-only rejection precedes source baseline work. Baseline-bearing paths
56
59
  * hash delivered text and divergent paths read/hash host bytes; unrelated
57
60
  * absent outputs can return before that hash after an initial K-output index.
58
61
  * Epoch-qualified first checkpoints share the complete proof. Other paths
59
62
  * pay derived-input or complete project/external/universal proof costs,
60
63
  * including path/byte populations, native observations and clock refresh.
61
- * @evidence contracts/performance.md#reuse-equivalent-work Typed config predicate replay is not cached by this coordinator and remains mandatory even when the following existing shortcut shares other proof. A complete generation earns one whole-snapshot proof per new delivery epoch; later first deliveries share it, while repeated or persistent deliveries revalidate their authoritative dependency scope.
64
+ * @evidence contracts/performance.md#reuse-equivalent-work Typed config predicate replay remains mandatory for every delivery and shares only the current synchronous transaction with nested validators; immutable membership is indexed separately. A complete generation earns one whole-snapshot proof per new delivery epoch; later first deliveries share it, while repeated or persistent deliveries revalidate their authoritative dependency scope.
62
65
  */
63
66
  export function matchesCachedSource(
64
67
  /** Generation retaining recorded baselines and distinct proof authority. */
@@ -69,9 +72,11 @@ export function matchesCachedSource(
69
72
  source: string,
70
73
  /** Current host pass, or undefined for persistent input validation. */
71
74
  epoch: number | undefined,
75
+ proof?: TtscGenerationProof.Transaction,
72
76
  ): boolean {
73
- if (!nativeInputPredicatesHold(cached)) return false;
74
- if (cached.freshDeliveryOnly === true) return false;
77
+ if (!nativeInputPredicatesHold(cached, proof)) return false;
78
+ const pass = TtscGenerationProof.sharesPass(cached, file, epoch);
79
+ if (cached.freshDeliveryOnly === true && !pass) return false;
75
80
  const identities = envelopeDerivation(cached).identityContext;
76
81
  const currentKey = toProjectKey(cached.projectRoot, file, identities);
77
82
  const identity = pathIdentityKey(file, identities);
@@ -102,7 +107,7 @@ export function matchesCachedSource(
102
107
  if (!outputs.has(identity)) {
103
108
  // While the watchers prove the program unchanged, the module is still
104
109
  // outside it, and no walk is needed to say so (samchon/ttsc#1398).
105
- if (notificationsProveProgramUnchanged(cached)) {
110
+ if (notificationsProveProgramUnchanged(cached, proof)) {
106
111
  return true;
107
112
  }
108
113
  // Root discovery deliberately never hashed this unrelated module. Its
@@ -113,7 +118,7 @@ export function matchesCachedSource(
113
118
  TRANSFORM_CLOCK_REFERENCE_DIRECTORIES.get(cached),
114
119
  resultFilesystem(cached.result),
115
120
  );
116
- return matchesCompleteInputSnapshot(cached);
121
+ return matchesCompleteInputSnapshot(cached, proof);
117
122
  }
118
123
  }
119
124
  if (expected !== hashText(source)) {
@@ -130,6 +135,7 @@ export function matchesCachedSource(
130
135
  }
131
136
  reportDivergentDelivery(cached, file);
132
137
  }
138
+ if (pass) return true;
133
139
  if (epoch !== undefined && cached.projectSnapshotComplete === true) {
134
140
  if (cached.deliveryEpoch !== epoch) {
135
141
  // The pass's first delivery. The generation was settled against an
@@ -142,7 +148,7 @@ export function matchesCachedSource(
142
148
  TRANSFORM_CLOCK_REFERENCE_DIRECTORIES.get(cached),
143
149
  resultFilesystem(cached.result),
144
150
  );
145
- if (!matchesCompleteInputSnapshot(cached)) {
151
+ if (!matchesCompleteInputSnapshot(cached, proof)) {
146
152
  return false;
147
153
  }
148
154
  cached.deliveryEpoch = epoch;
@@ -165,7 +171,7 @@ export function matchesCachedSource(
165
171
  cached.projectMutationTracker !== undefined &&
166
172
  cached.hostInputMutationTracker !== undefined
167
173
  ) {
168
- const narrow = matchesNarrowPersistentInputs(cached, file);
174
+ const narrow = matchesNarrowPersistentInputs(cached, file, proof);
169
175
  if (narrow !== undefined) {
170
176
  return narrow;
171
177
  }
@@ -173,5 +179,5 @@ export function matchesCachedSource(
173
179
  // produced. Losing the proof is not evidence of a change, so fall through
174
180
  // to the snapshot the entry still carries.
175
181
  }
176
- return matchesCompleteInputSnapshot(cached);
182
+ return matchesCompleteInputSnapshot(cached, proof);
177
183
  }
@@ -3,6 +3,7 @@ import { resultFilesystem } from "../cache/resultFilesystem";
3
3
  import { declaredProjectInputKeys } from "../envelope/declaredProjectInputKeys";
4
4
  import { envelopeDerivation } from "../envelope/envelopeDerivation";
5
5
  import { collectProjectInputSnapshot } from "../project/collectProjectInputSnapshot";
6
+ import type { TtscGenerationProof } from "./TtscGenerationProof";
6
7
  import { matchesCachedExternalInputs } from "./matchesCachedExternalInputs";
7
8
  import { matchesExternalInputRealpaths } from "./matchesExternalInputRealpaths";
8
9
  import { matchesUniversalHostInputEntries } from "./matchesUniversalHostInputEntries";
@@ -43,7 +44,7 @@ import { walkSnapshotComplete } from "./walkSnapshotComplete";
43
44
  * target scans, signature entry materialization/adoption and native identity
44
45
  * work add population/path/digit costs; unresolved content and predicate
45
46
  * replay add bytes/listings. Early rejection skips subsequent domains.
46
- * @evidence contracts/performance.md#reuse-equivalent-work Typed config predicate replay is not cached by this coordinator and remains mandatory even when the following existing shortcut shares other proof. Qualified separable signatures avoid repeated content reads under the caller's refreshed clock. Successful aggregate proof adopts earned project/external signatures and clears unverified flags; it neither clears recorded changes/failed flags nor makes later quiet notifications sufficient without their other admission conditions.
47
+ * @evidence contracts/performance.md#reuse-equivalent-work Typed config predicates remain mandatory on every delivery. An exact-generation synchronous transaction may share their current replay across nested validators, but no pass or notification shortcut authorizes a later delivery to skip them. Qualified separable signatures avoid repeated content reads under the caller's refreshed clock. Successful aggregate proof adopts earned project/external signatures and clears unverified flags; it neither clears recorded changes/failed flags nor makes later quiet notifications sufficient without their other admission conditions.
47
48
  */
48
49
  export function matchesCompleteInputSnapshot(
49
50
  /**
@@ -51,8 +52,9 @@ export function matchesCompleteInputSnapshot(
51
52
  * proof.
52
53
  */
53
54
  cached: TtscCachedProjectTransform,
55
+ proof?: TtscGenerationProof.Transaction,
54
56
  ): boolean {
55
- if (!nativeInputPredicatesHold(cached)) return false;
57
+ if (!nativeInputPredicatesHold(cached, proof)) return false;
56
58
  if (
57
59
  cached.projectSnapshotComplete !== true ||
58
60
  cached.projectDirectories === undefined
@@ -72,7 +74,7 @@ export function matchesCompleteInputSnapshot(
72
74
  hostValidation === undefined ||
73
75
  !matchesUniversalHostInputEntries(cached, hostValidation) ||
74
76
  !matchesUniversalHostInputProbes(cached, hostValidation) ||
75
- !matchesUniversalHostInputTrees(cached, hostValidation)
77
+ !matchesUniversalHostInputTrees(cached, hostValidation, proof)
76
78
  ) {
77
79
  return false;
78
80
  }
@@ -5,6 +5,7 @@ import { envelopeDerivation } from "../envelope/envelopeDerivation";
5
5
  import { selectWatchInputs } from "../envelope/selectWatchInputs";
6
6
  import { notificationsProveMembership } from "../tracker/notificationsProveMembership";
7
7
  import { reportsMembershipChange } from "../tracker/reportsMembershipChange";
8
+ import type { TtscGenerationProof } from "./TtscGenerationProof";
8
9
  import { matchesProvenInput } from "./matchesProvenInput";
9
10
  import { matchesUniversalHostInputs } from "./matchesUniversalHostInputs";
10
11
 
@@ -49,6 +50,7 @@ export function matchesNarrowPersistentInputs(
49
50
  cached: TtscCachedProjectTransform,
50
51
  /** Delivered file spelling selecting this envelope's dependency closure. */
51
52
  file: string,
53
+ proof?: TtscGenerationProof.Transaction,
52
54
  ): boolean | undefined {
53
55
  if (reportsMembershipChange(cached)) {
54
56
  return false;
@@ -61,7 +63,7 @@ export function matchesNarrowPersistentInputs(
61
63
  if (hostValidation === undefined) {
62
64
  return undefined;
63
65
  }
64
- if (!matchesUniversalHostInputs(cached, hostValidation)) {
66
+ if (!matchesUniversalHostInputs(cached, hostValidation, proof)) {
65
67
  return false;
66
68
  }
67
69
  const inputs = selectWatchInputs({
@@ -7,6 +7,7 @@ import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTrans
7
7
  import { resultFilesystem } from "../cache/resultFilesystem";
8
8
  import { pluginSourceHolds } from "../inputs/pluginSourceHolds";
9
9
  import { usesPreparedPluginBuildEnvironments } from "../inputs/preparePluginBuildEnvironments";
10
+ import type { TtscGenerationProof } from "./TtscGenerationProof";
10
11
  import type { TtscHostInputValidation } from "./TtscHostInputValidation";
11
12
  import { trackerProvesInputUnchanged } from "./trackerProvesInputUnchanged";
12
13
 
@@ -41,20 +42,23 @@ import { trackerProvesInputUnchanged } from "./trackerProvesInputUnchanged";
41
42
  * @evidence contracts/common.md#meaningful-documentation Native paragraphs distinguish source notification, environment authority and metadata-qualified digest reuse before param tags.
42
43
  * @evidence contracts/portability.md#os-neutral-implementation Supported plugin-source APIs and capability-qualified native trackers own source/toolchain observation without OS-wide watcher assumptions.
43
44
  * @evidence contracts/performance.md#bound-retention-and-release-resources One environment witness per current manifest tree is replaced in place; no delivery history is retained.
44
- * @evidence contracts/performance.md#efficient-algorithms Each tree first pays the shared environment reader's variable-key construction and native dependency qualification. Qualified silent sources avoid enumeration; other trees enumerate and sort the selected file population, inspect metadata and hash source bytes whenever population, metadata or clock evidence cannot qualify reuse. The synchronous owner can also refresh native environment authority after a mismatch.
45
+ * @evidence contracts/performance.md#efficient-algorithms An exact-generation synchronous transaction supplies one current batched environment qualification; otherwise each tree pays the shared environment reader's variable-key construction and native dependency qualification. Qualified silent sources avoid enumeration; other trees enumerate and sort the selected file population, inspect metadata and hash source bytes whenever population, metadata or clock evidence cannot qualify reuse. The synchronous owner can also refresh native environment authority after a mismatch.
45
46
  * @evidence contracts/performance.md#reuse-equivalent-work Generation environment witnesses and the owning digest cache share prior proof only while source and toolchain identities remain valid.
46
47
  */
47
48
  export function matchesUniversalHostInputTrees(
48
49
  cached: TtscCachedProjectTransform,
49
50
  validation: TtscHostInputValidation,
51
+ proof?: TtscGenerationProof.Transaction,
50
52
  ): boolean {
51
53
  for (const [directory, digest] of validation.trees) {
52
54
  // Read before any proof, so the environment recorded below is one the
53
55
  // proof saw or older, never a newer one it did not prove.
54
56
  const prepared = usesPreparedPluginBuildEnvironments(cached.result);
55
57
  const environment = prepared
56
- ? PluginBuildEnvironmentReadings.cached(directory)
57
- : processPluginBuildEnvironment(directory);
58
+ ? proof?.cached === cached && proof.environments !== undefined
59
+ ? proof.environments.get(directory)
60
+ : PluginBuildEnvironmentReadings.cached(directory)
61
+ : processPluginBuildEnvironment(directory, false, cached.projectRoot);
58
62
  if (environment === undefined) return false;
59
63
  if (
60
64
  trackerProvesInputUnchanged(cached.hostInputMutationTracker, directory) &&
@@ -67,6 +71,7 @@ export function matchesUniversalHostInputTrees(
67
71
  digest,
68
72
  resultFilesystem(cached.result),
69
73
  prepared ? { environment } : undefined,
74
+ cached.projectRoot,
70
75
  )
71
76
  )
72
77
  return false;
@@ -1,4 +1,5 @@
1
1
  import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform";
2
+ import type { TtscGenerationProof } from "./TtscGenerationProof";
2
3
  import type { TtscHostInputValidation } from "./TtscHostInputValidation";
3
4
  import { matchesUniversalHostInputEntries } from "./matchesUniversalHostInputEntries";
4
5
  import { matchesUniversalHostInputProbes } from "./matchesUniversalHostInputProbes";
@@ -29,13 +30,14 @@ import { trackerProvesInputUnchanged } from "./trackerProvesInputUnchanged";
29
30
  * @evidence contracts/portability.md#os-neutral-implementation Filesystem-aware validators use actual tracker delivery capability and exact lexical coverage rather than platform-wide assumptions.
30
31
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The coordinator borrows generation manifests and trackers without retaining a result or acquiring a handle.
31
32
  * @evidence contracts/performance.md#efficient-algorithms Every admission first replays all generation-owned typed config predicates; this mandatory cost includes native queries, file bytes or directory membership independently of watcher/epoch qualification. The coverage scan stops at the first unproved input. Each coverage query checks overlapping unproven scopes and sampled events with native path comparisons; fallback adds unresolved bytes, native candidate probes and plugin tree enumeration. Mandatory environment qualification pays its owning dependency and environment-key costs on either route.
32
- * @evidence contracts/performance.md#reuse-equivalent-work Typed config predicate replay is not cached by this coordinator and remains mandatory even when the following existing shortcut shares other proof. Shared manifests and qualified silent sources avoid repeated content reads only while the owning tree validator also proves unchanged build environment.
33
+ * @evidence contracts/performance.md#reuse-equivalent-work Typed config predicates remain mandatory on every delivery. An exact-generation synchronous transaction may share their current replay across nested validators, but no pass or notification shortcut authorizes a later delivery to skip them. Shared manifests and qualified silent sources avoid repeated content reads only while the owning tree validator also proves unchanged build environment.
33
34
  */
34
35
  export function matchesUniversalHostInputs(
35
36
  cached: TtscCachedProjectTransform,
36
37
  validation: TtscHostInputValidation,
38
+ proof?: TtscGenerationProof.Transaction,
37
39
  ): boolean {
38
- if (!nativeInputPredicatesHold(cached)) return false;
40
+ if (!nativeInputPredicatesHold(cached, proof)) return false;
39
41
  let notificationsProveAll = true;
40
42
  for (const input of validation.covered) {
41
43
  if (!trackerProvesInputUnchanged(cached.hostInputMutationTracker, input)) {
@@ -44,10 +46,10 @@ export function matchesUniversalHostInputs(
44
46
  }
45
47
  }
46
48
  if (notificationsProveAll)
47
- return matchesUniversalHostInputTrees(cached, validation);
49
+ return matchesUniversalHostInputTrees(cached, validation, proof);
48
50
  return (
49
51
  matchesUniversalHostInputEntries(cached, validation) &&
50
52
  matchesUniversalHostInputProbes(cached, validation) &&
51
- matchesUniversalHostInputTrees(cached, validation)
53
+ matchesUniversalHostInputTrees(cached, validation, proof)
52
54
  );
53
55
  }
@@ -1,9 +1,19 @@
1
1
  import path from "node:path";
2
+ import type { ITtscCompilerTransformation } from "ttsc";
2
3
 
3
4
  import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform";
4
5
  import { resultFilesystem } from "../cache/resultFilesystem";
5
6
  import { envelopeDerivation } from "../envelope/envelopeDerivation";
6
7
  import { nativeInputPredicateMatches } from "../inputs/nativeInputPredicateMatches";
8
+ import type { TtscGenerationProof } from "./TtscGenerationProof";
9
+
10
+ // Weakly owned by immutable observation membership, never by current verdict.
11
+ // Keeping this separate from native path derivation also preserves the empty
12
+ // predicate gate's promise to perform no native identity observations.
13
+ const predicateInputs = new WeakMap<
14
+ object,
15
+ Array<[string, ITtscCompilerTransformation.IInputObservation]>
16
+ >();
7
17
 
8
18
  /**
9
19
  * Validate every generation-owned native config predicate before cache reuse.
@@ -16,25 +26,37 @@ import { nativeInputPredicateMatches } from "../inputs/nativeInputPredicateMatch
16
26
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Metadata and notification shortcuts cannot omit typed config predicates or repair an unstable producer witness.
17
27
  * @evidence contracts/common.md#meaningful-documentation The comment identifies generation ownership and the admission shortcuts that must retain this gate.
18
28
  * @evidence contracts/portability.md#os-neutral-implementation Relative names are resolved against the recorded project with the filesystem view's path dialect; native identity and encoding belong to the replay operation.
19
- * @evidence contracts/performance.md#efficient-algorithms The initial observation scan detects whether native replay is required without resolving a root or performing filesystem queries. Nonempty populations add a second linear traversal plus native replay and path-byte costs, stopping at the first refusal; empty and legacy-only populations require no replay context.
20
- * @evidenceExclude contracts/performance.md#reuse-equivalent-work This admission gate stores no separate cache and checks the recorded generation supplied by its caller.
21
- * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Per-call enumeration owns no handle or watcher; the cached envelope owns retained predicates.
29
+ * @evidence contracts/performance.md#efficient-algorithms Immutable observation membership is indexed once, including an empty population. Each new synchronous admission replays only indexed native predicates and stops at the first refusal; nested validators share its verdict without another scan or native query. Empty populations require no native replay context.
30
+ * @evidence contracts/performance.md#reuse-equivalent-work A weak observation index shares immutable membership. Current verdicts belong only to an exact-owner synchronous transaction, never the next delivery or an await.
31
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The weak index follows immutable observation lifetime; synchronous verdicts and native queries acquire no handle or history.
22
32
  */
23
33
  export function nativeInputPredicatesHold(
24
34
  cached: TtscCachedProjectTransform,
35
+ proof?: TtscGenerationProof.Transaction,
25
36
  ): boolean {
26
37
  if (cached.result.type === "exception") return false;
27
- const observations = cached.result.graph?.inputObservations ?? {};
28
- if (
29
- !Object.values(observations).some(
30
- (observation) => (observation.nativePredicates?.length ?? 0) !== 0,
31
- )
32
- )
33
- return true;
38
+ if (proof?.cached === cached && proof.nativePredicates !== undefined)
39
+ return proof.nativePredicates;
40
+ // Membership is immutable generation data. A positive native verdict is
41
+ // current observation: share it only with nested synchronous validators,
42
+ // never the next delivery, pass or await (#1714).
43
+ const finish = (matches: boolean): boolean => {
44
+ if (proof?.cached === cached) proof.nativePredicates = matches;
45
+ return matches;
46
+ };
47
+ const observations = cached.result.graph?.inputObservations;
48
+ if (observations === undefined) return finish(true);
49
+ let inputs = predicateInputs.get(observations);
50
+ if (inputs === undefined) {
51
+ inputs = Object.entries(observations).filter(
52
+ ([, observation]) => (observation.nativePredicates?.length ?? 0) !== 0,
53
+ );
54
+ predicateInputs.set(observations, inputs);
55
+ }
56
+ if (inputs.length === 0) return finish(true);
34
57
  const filesystem = resultFilesystem(cached.result);
35
58
  const identities = envelopeDerivation(cached).identityContext;
36
- for (const [name, observation] of Object.entries(observations)) {
37
- if ((observation.nativePredicates?.length ?? 0) === 0) continue;
59
+ for (const [name, observation] of inputs) {
38
60
  const file = (
39
61
  (filesystem.platform ?? process.platform) === "win32"
40
62
  ? path.win32
@@ -42,7 +64,7 @@ export function nativeInputPredicatesHold(
42
64
  ).resolve(cached.projectRoot, name);
43
65
  for (const predicate of observation.nativePredicates ?? [])
44
66
  if (!nativeInputPredicateMatches(file, predicate, filesystem, identities))
45
- return false;
67
+ return finish(false);
46
68
  }
47
- return true;
69
+ return finish(true);
48
70
  }
@@ -4,6 +4,7 @@ import { TRANSFORM_CLOCK_REFERENCE_DIRECTORIES } from "../clock/TRANSFORM_CLOCK_
4
4
  import { refreshFilesystemClockReference } from "../clock/refreshFilesystemClockReference";
5
5
  import { isProjectWalkPath } from "../project/isProjectWalkPath";
6
6
  import { notificationsProveMembership } from "../tracker/notificationsProveMembership";
7
+ import type { TtscGenerationProof } from "./TtscGenerationProof";
7
8
  import { matchesUniversalHostInputs } from "./matchesUniversalHostInputs";
8
9
 
9
10
  /**
@@ -42,6 +43,7 @@ export function notificationsProveProgramUnchanged(
42
43
  * proof.
43
44
  */
44
45
  cached: TtscCachedProjectTransform,
46
+ proof?: TtscGenerationProof.Transaction,
45
47
  ): boolean {
46
48
  if (!notificationsProveMembership(cached)) return false;
47
49
  for (const tracker of [
@@ -88,5 +90,5 @@ export function notificationsProveProgramUnchanged(
88
90
  TRANSFORM_CLOCK_REFERENCE_DIRECTORIES.get(cached),
89
91
  resultFilesystem(cached.result),
90
92
  );
91
- return matchesUniversalHostInputs(cached, cached.hostInputValidation);
93
+ return matchesUniversalHostInputs(cached, cached.hostInputValidation, proof);
92
94
  }
@@ -15,6 +15,9 @@ import { captureWatchInputBaselines } from "./captureWatchInputBaselines";
15
15
  * a recorded predicate. Unrequested listings are not enumerated.
16
16
  * @param options.nativePredicates Native version-one codec kinds requested by
17
17
  * recorded inputs. Raw native listings are independent of compiler listings.
18
+ * @param options.projectRoot Project whose plugin cache records prove a plugin
19
+ * tree, so a new process does not read its sources and SDK again
20
+ * (samchon/ttsc#1725).
18
21
  * @evidence contracts/common.md#principled-implementation Two independently captured codec facts must agree before a baseline is returned; equality detects observed changes but cannot establish absence of intervening unobserved changes.
19
22
  * @evidence contracts/common.md#clear-and-simple-design The singleton delegates to the batch owner, which assembles codec facts and owns independent observations and failure handling.
20
23
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Unavailable reads retain their explicit codec markers and predicates; a mismatch or escaping exception declines capture without supplying expected state or retrying until a desired answer appears.
@@ -33,6 +36,7 @@ export function captureWatchInputBaseline(
33
36
  nativePredicates?: readonly (keyof NonNullable<
34
37
  TtscWatchInputBaseline["nativePredicates"]
35
38
  >)[];
39
+ projectRoot?: string;
36
40
  } = {},
37
41
  ): TtscWatchInputBaseline | undefined {
38
42
  return captureWatchInputBaselines([file], filesystem, options).get(file);
@@ -48,6 +48,8 @@ export function captureWatchInputBaselines(
48
48
  nativePredicates?: readonly (keyof NonNullable<
49
49
  TtscWatchInputBaseline["nativePredicates"]
50
50
  >)[];
51
+ /** Project whose plugin cache records prove a plugin tree (#1725). */
52
+ projectRoot?: string;
51
53
  } = {},
52
54
  ): Map<string, TtscWatchInputBaseline | undefined> {
53
55
  const selected = [...new Set(files)];
@@ -89,6 +91,8 @@ function capture(
89
91
  nativePredicates?: readonly (keyof NonNullable<
90
92
  TtscWatchInputBaseline["nativePredicates"]
91
93
  >)[];
94
+ /** Project whose plugin cache records prove a plugin tree (#1725). */
95
+ projectRoot?: string;
92
96
  },
93
97
  ): TtscWatchInputBaseline {
94
98
  const stat = compilerStatKind(file, filesystem);
@@ -141,6 +145,8 @@ function capture(
141
145
  identity: pathIdentityKey(file, identities),
142
146
  realpath: compilerInputRealpathObservation(file, filesystem),
143
147
  stat,
144
- ...(options.tree === true ? { tree: pluginSourceState(file) } : {}),
148
+ ...(options.tree === true
149
+ ? { tree: pluginSourceState(file, undefined, options.projectRoot) }
150
+ : {}),
145
151
  };
146
152
  }
@@ -64,6 +64,9 @@ export function notifyWatchInputs(
64
64
  // so no persistent cache may keep it.
65
65
  if (
66
66
  hooks.project !== undefined &&
67
+ // Common delivery already withdrew this host cache. Incomplete local
68
+ // output cannot write a record, so avoid a second withdrawal callback.
69
+ cached.freshDeliveryOnly !== true &&
67
70
  !notifyProjectRecord(
68
71
  hooks.project,
69
72
  cached,
@@ -20,7 +20,10 @@ import type { TtscWatchInputEvidence } from "./TtscWatchInputEvidence";
20
20
  * a graph input by its state hash and physical target; a host input by the host
21
21
  * bytes' hash. The root-file membership is a walk over many paths and never
22
22
  * stands for one, so its evidence matches nothing here; the record holds it
23
- * apart. Evidence without a state proves nothing and does not match.
23
+ * apart. Evidence without a state proves nothing and does not match. A plugin
24
+ * tree is proven through the plugin cache records of the project the caller
25
+ * names, so a new process does not read its sources and SDK again
26
+ * (samchon/ttsc#1725).
24
27
  *
25
28
  * @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.
26
29
  * @evidence contracts/common.md#clear-and-simple-design Discriminant branches delegate each observation to the codec owner and expose one conservative boolean comparison.
@@ -35,12 +38,19 @@ export function watchInputEvidenceMatchesDisk(
35
38
  file: string,
36
39
  evidence: TtscWatchInputEvidence,
37
40
  filesystem: TtscTransformFilesystemOperations = DEFAULT_FILESYSTEM_OPERATIONS,
41
+ projectRoot?: string,
38
42
  ): boolean {
39
43
  const state = evidence.state;
40
44
  if (state === undefined || state.codec === "membership") return false;
41
45
  try {
42
46
  if (state.codec === "tree") {
43
- return pluginSourceHolds(file, state.digest, filesystem);
47
+ return pluginSourceHolds(
48
+ file,
49
+ state.digest,
50
+ filesystem,
51
+ undefined,
52
+ projectRoot,
53
+ );
44
54
  }
45
55
  if (state.codec === "predicates") {
46
56
  return matchesGraphInputObservation(
@@ -171,6 +171,7 @@ export function turbopack(
171
171
  }
172
172
  const hooks: TtscTransformHooks = {
173
173
  exactPath: true,
174
+ watching,
174
175
  ...(addDependency === undefined
175
176
  ? {}
176
177
  : {
@@ -186,7 +187,7 @@ export function turbopack(
186
187
  toolDirectory,
187
188
  // Turbopack takes no record outside its root, so a watching worker
188
189
  // refuses a module it could hand none (samchon/ttsc#1480).
189
- watching: bridge !== undefined,
190
+ watching,
190
191
  },
191
192
  }),
192
193
  ...(bindings.markVolatile === undefined