@ttsc/unplugin 0.34.0 → 0.34.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 (262) hide show
  1. package/README.md +1 -0
  2. package/lib/api.js +4 -0
  3. package/lib/api.js.map +1 -1
  4. package/lib/api.mjs +2 -0
  5. package/lib/api.mjs.map +1 -1
  6. package/lib/core/bridge/TtscProjectRecord.d.cts +4 -1
  7. package/lib/core/bridge/TtscProjectRecord.d.mts +4 -1
  8. package/lib/core/bridge/TtscProjectRecord.d.ts +4 -1
  9. package/lib/core/bridge/projectRecordArgumentsMatch.d.cts +18 -0
  10. package/lib/core/bridge/projectRecordArgumentsMatch.d.mts +18 -0
  11. package/lib/core/bridge/projectRecordArgumentsMatch.d.ts +18 -0
  12. package/lib/core/bridge/projectRecordArgumentsMatch.js +36 -0
  13. package/lib/core/bridge/projectRecordArgumentsMatch.js.map +1 -0
  14. package/lib/core/bridge/projectRecordArgumentsMatch.mjs +34 -0
  15. package/lib/core/bridge/projectRecordArgumentsMatch.mjs.map +1 -0
  16. package/lib/core/bridge/projectRecordMoved.d.cts +14 -12
  17. package/lib/core/bridge/projectRecordMoved.d.mts +14 -12
  18. package/lib/core/bridge/projectRecordMoved.d.ts +14 -12
  19. package/lib/core/bridge/projectRecordMoved.js +17 -12
  20. package/lib/core/bridge/projectRecordMoved.js.map +1 -1
  21. package/lib/core/bridge/projectRecordMoved.mjs +17 -12
  22. package/lib/core/bridge/projectRecordMoved.mjs.map +1 -1
  23. package/lib/core/bridge/readProjectRecordFile.d.cts +4 -3
  24. package/lib/core/bridge/readProjectRecordFile.d.mts +4 -3
  25. package/lib/core/bridge/readProjectRecordFile.d.ts +4 -3
  26. package/lib/core/bridge/readProjectRecordFile.js +26 -3
  27. package/lib/core/bridge/readProjectRecordFile.js.map +1 -1
  28. package/lib/core/bridge/readProjectRecordFile.mjs +26 -3
  29. package/lib/core/bridge/readProjectRecordFile.mjs.map +1 -1
  30. package/lib/core/bridge/refreshProjectRecordFile.d.cts +3 -2
  31. package/lib/core/bridge/refreshProjectRecordFile.d.mts +3 -2
  32. package/lib/core/bridge/refreshProjectRecordFile.d.ts +3 -2
  33. package/lib/core/bridge/refreshProjectRecordFile.js +9 -3
  34. package/lib/core/bridge/refreshProjectRecordFile.js.map +1 -1
  35. package/lib/core/bridge/refreshProjectRecordFile.mjs +9 -3
  36. package/lib/core/bridge/refreshProjectRecordFile.mjs.map +1 -1
  37. package/lib/core/bridge/refreshProjectRecordFiles.d.cts +1 -1
  38. package/lib/core/bridge/refreshProjectRecordFiles.d.mts +1 -1
  39. package/lib/core/bridge/refreshProjectRecordFiles.d.ts +1 -1
  40. package/lib/core/bridge/refreshProjectRecordFiles.js +2 -2
  41. package/lib/core/bridge/refreshProjectRecordFiles.js.map +1 -1
  42. package/lib/core/bridge/refreshProjectRecordFiles.mjs +2 -2
  43. package/lib/core/bridge/refreshProjectRecordFiles.mjs.map +1 -1
  44. package/lib/core/index.d.cts +2 -0
  45. package/lib/core/index.d.mts +2 -0
  46. package/lib/core/index.d.ts +2 -0
  47. package/lib/core/index.js +4 -0
  48. package/lib/core/index.js.map +1 -1
  49. package/lib/core/index.mjs +2 -0
  50. package/lib/core/index.mjs.map +1 -1
  51. package/lib/core/next/next.js +5 -2
  52. package/lib/core/next/next.js.map +1 -1
  53. package/lib/core/next/next.mjs +5 -2
  54. package/lib/core/next/next.mjs.map +1 -1
  55. package/lib/core/options/ResolvedTtscUnpluginOptions.d.cts +2 -0
  56. package/lib/core/options/ResolvedTtscUnpluginOptions.d.mts +2 -0
  57. package/lib/core/options/ResolvedTtscUnpluginOptions.d.ts +2 -0
  58. package/lib/core/options/TtscUnpluginOptions.d.cts +8 -0
  59. package/lib/core/options/TtscUnpluginOptions.d.mts +8 -0
  60. package/lib/core/options/TtscUnpluginOptions.d.ts +8 -0
  61. package/lib/core/options/resolveOptions.d.cts +4 -3
  62. package/lib/core/options/resolveOptions.d.mts +4 -3
  63. package/lib/core/options/resolveOptions.d.ts +4 -3
  64. package/lib/core/options/resolveOptions.js +5 -3
  65. package/lib/core/options/resolveOptions.js.map +1 -1
  66. package/lib/core/options/resolveOptions.mjs +5 -3
  67. package/lib/core/options/resolveOptions.mjs.map +1 -1
  68. package/lib/core/rollup/rollupDeliveryOptions.d.cts +6 -6
  69. package/lib/core/rollup/rollupDeliveryOptions.d.mts +6 -6
  70. package/lib/core/rollup/rollupDeliveryOptions.d.ts +6 -6
  71. package/lib/core/rollup/rollupDeliveryOptions.js +9 -6
  72. package/lib/core/rollup/rollupDeliveryOptions.js.map +1 -1
  73. package/lib/core/rollup/rollupDeliveryOptions.mjs +9 -6
  74. package/lib/core/rollup/rollupDeliveryOptions.mjs.map +1 -1
  75. package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.d.cts +10 -0
  76. package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.d.mts +10 -0
  77. package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.d.ts +10 -0
  78. package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.js +13 -0
  79. package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.js.map +1 -0
  80. package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.mjs +11 -0
  81. package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.mjs.map +1 -0
  82. package/lib/core/transform/cache/TtscCachedProjectTransform.d.cts +6 -0
  83. package/lib/core/transform/cache/TtscCachedProjectTransform.d.mts +6 -0
  84. package/lib/core/transform/cache/TtscCachedProjectTransform.d.ts +6 -0
  85. package/lib/core/transform/cache/createTransformCacheKey.d.cts +11 -8
  86. package/lib/core/transform/cache/createTransformCacheKey.d.mts +11 -8
  87. package/lib/core/transform/cache/createTransformCacheKey.d.ts +11 -8
  88. package/lib/core/transform/cache/createTransformCacheKey.js +11 -8
  89. package/lib/core/transform/cache/createTransformCacheKey.js.map +1 -1
  90. package/lib/core/transform/cache/createTransformCacheKey.mjs +11 -8
  91. package/lib/core/transform/cache/createTransformCacheKey.mjs.map +1 -1
  92. package/lib/core/transform/generation/TtscCompilerMembershipHint.d.cts +20 -0
  93. package/lib/core/transform/generation/TtscCompilerMembershipHint.d.mts +20 -0
  94. package/lib/core/transform/generation/TtscCompilerMembershipHint.d.ts +20 -0
  95. package/lib/core/transform/generation/applyCompilerMembership.d.cts +15 -0
  96. package/lib/core/transform/generation/applyCompilerMembership.d.mts +15 -0
  97. package/lib/core/transform/generation/applyCompilerMembership.d.ts +15 -0
  98. package/lib/core/transform/generation/applyCompilerMembership.js +41 -0
  99. package/lib/core/transform/generation/applyCompilerMembership.js.map +1 -0
  100. package/lib/core/transform/generation/applyCompilerMembership.mjs +39 -0
  101. package/lib/core/transform/generation/applyCompilerMembership.mjs.map +1 -0
  102. package/lib/core/transform/generation/captureTransformGeneration.d.cts +7 -0
  103. package/lib/core/transform/generation/captureTransformGeneration.d.mts +7 -0
  104. package/lib/core/transform/generation/captureTransformGeneration.d.ts +7 -0
  105. package/lib/core/transform/generation/captureTransformGeneration.js +20 -7
  106. package/lib/core/transform/generation/captureTransformGeneration.js.map +1 -1
  107. package/lib/core/transform/generation/captureTransformGeneration.mjs +20 -7
  108. package/lib/core/transform/generation/captureTransformGeneration.mjs.map +1 -1
  109. package/lib/core/transform/generation/onlyLearnedCompileFacts.d.cts +5 -5
  110. package/lib/core/transform/generation/onlyLearnedCompileFacts.d.mts +5 -5
  111. package/lib/core/transform/generation/onlyLearnedCompileFacts.d.ts +5 -5
  112. package/lib/core/transform/generation/onlyLearnedCompileFacts.js +7 -5
  113. package/lib/core/transform/generation/onlyLearnedCompileFacts.js.map +1 -1
  114. package/lib/core/transform/generation/onlyLearnedCompileFacts.mjs +7 -5
  115. package/lib/core/transform/generation/onlyLearnedCompileFacts.mjs.map +1 -1
  116. package/lib/core/transform/generation/primeCompilerMembership.d.cts +22 -0
  117. package/lib/core/transform/generation/primeCompilerMembership.d.mts +22 -0
  118. package/lib/core/transform/generation/primeCompilerMembership.d.ts +22 -0
  119. package/lib/core/transform/generation/primeCompilerMembership.js +32 -0
  120. package/lib/core/transform/generation/primeCompilerMembership.js.map +1 -0
  121. package/lib/core/transform/generation/primeCompilerMembership.mjs +30 -0
  122. package/lib/core/transform/generation/primeCompilerMembership.mjs.map +1 -0
  123. package/lib/core/transform/generation/selectReportedMembershipPolicy.d.cts +7 -7
  124. package/lib/core/transform/generation/selectReportedMembershipPolicy.d.mts +7 -7
  125. package/lib/core/transform/generation/selectReportedMembershipPolicy.d.ts +7 -7
  126. package/lib/core/transform/generation/selectReportedMembershipPolicy.js +43 -9
  127. package/lib/core/transform/generation/selectReportedMembershipPolicy.js.map +1 -1
  128. package/lib/core/transform/generation/selectReportedMembershipPolicy.mjs +43 -9
  129. package/lib/core/transform/generation/selectReportedMembershipPolicy.mjs.map +1 -1
  130. package/lib/core/transform/generation/transformProject.d.cts +7 -0
  131. package/lib/core/transform/generation/transformProject.d.mts +7 -0
  132. package/lib/core/transform/generation/transformProject.d.ts +7 -0
  133. package/lib/core/transform/generation/transformProject.js +3 -0
  134. package/lib/core/transform/generation/transformProject.js.map +1 -1
  135. package/lib/core/transform/generation/transformProject.mjs +3 -0
  136. package/lib/core/transform/generation/transformProject.mjs.map +1 -1
  137. package/lib/core/transform/project/isPossibleProgramFileName.d.cts +13 -11
  138. package/lib/core/transform/project/isPossibleProgramFileName.d.mts +13 -11
  139. package/lib/core/transform/project/isPossibleProgramFileName.d.ts +13 -11
  140. package/lib/core/transform/project/isPossibleProgramFileName.js +21 -13
  141. package/lib/core/transform/project/isPossibleProgramFileName.js.map +1 -1
  142. package/lib/core/transform/project/isPossibleProgramFileName.mjs +21 -13
  143. package/lib/core/transform/project/isPossibleProgramFileName.mjs.map +1 -1
  144. package/lib/core/transform/session/sharedCompileIdentity.d.cts +8 -5
  145. package/lib/core/transform/session/sharedCompileIdentity.d.mts +8 -5
  146. package/lib/core/transform/session/sharedCompileIdentity.d.ts +8 -5
  147. package/lib/core/transform/session/sharedCompileIdentity.js +8 -5
  148. package/lib/core/transform/session/sharedCompileIdentity.js.map +1 -1
  149. package/lib/core/transform/session/sharedCompileIdentity.mjs +8 -5
  150. package/lib/core/transform/session/sharedCompileIdentity.mjs.map +1 -1
  151. package/lib/core/transform/transformTtsc.js +18 -0
  152. package/lib/core/transform/transformTtsc.js.map +1 -1
  153. package/lib/core/transform/transformTtsc.mjs +18 -0
  154. package/lib/core/transform/transformTtsc.mjs.map +1 -1
  155. package/lib/core/transform/tsconfig/TtscCompilerArgumentsWitness.d.cts +19 -0
  156. package/lib/core/transform/tsconfig/TtscCompilerArgumentsWitness.d.mts +19 -0
  157. package/lib/core/transform/tsconfig/TtscCompilerArgumentsWitness.d.ts +19 -0
  158. package/lib/core/transform/tsconfig/captureCompilerArguments.d.cts +14 -0
  159. package/lib/core/transform/tsconfig/captureCompilerArguments.d.mts +14 -0
  160. package/lib/core/transform/tsconfig/captureCompilerArguments.d.ts +14 -0
  161. package/lib/core/transform/tsconfig/captureCompilerArguments.js +26 -0
  162. package/lib/core/transform/tsconfig/captureCompilerArguments.js.map +1 -0
  163. package/lib/core/transform/tsconfig/captureCompilerArguments.mjs +24 -0
  164. package/lib/core/transform/tsconfig/captureCompilerArguments.mjs.map +1 -0
  165. package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.d.cts +13 -0
  166. package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.d.mts +13 -0
  167. package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.d.ts +13 -0
  168. package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.js +23 -0
  169. package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.js.map +1 -0
  170. package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.mjs +21 -0
  171. package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.mjs.map +1 -0
  172. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.cts +17 -0
  173. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.mts +17 -0
  174. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.ts +17 -0
  175. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.js +57 -0
  176. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.js.map +1 -0
  177. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.mjs +55 -0
  178. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.mjs.map +1 -0
  179. package/lib/core/transform/tsconfig/transformScratchEnvironment.d.cts +6 -6
  180. package/lib/core/transform/tsconfig/transformScratchEnvironment.d.mts +6 -6
  181. package/lib/core/transform/tsconfig/transformScratchEnvironment.d.ts +6 -6
  182. package/lib/core/transform/tsconfig/transformScratchEnvironment.js +7 -7
  183. package/lib/core/transform/tsconfig/transformScratchEnvironment.js.map +1 -1
  184. package/lib/core/transform/tsconfig/transformScratchEnvironment.mjs +7 -7
  185. package/lib/core/transform/tsconfig/transformScratchEnvironment.mjs.map +1 -1
  186. package/lib/core/transform/watch/notifyProjectRecord.js +3 -0
  187. package/lib/core/transform/watch/notifyProjectRecord.js.map +1 -1
  188. package/lib/core/transform/watch/notifyProjectRecord.mjs +3 -0
  189. package/lib/core/transform/watch/notifyProjectRecord.mjs.map +1 -1
  190. package/lib/core/tsconfig/ITtscProjectMembershipPolicy.d.cts +14 -1
  191. package/lib/core/tsconfig/ITtscProjectMembershipPolicy.d.mts +14 -1
  192. package/lib/core/tsconfig/ITtscProjectMembershipPolicy.d.ts +14 -1
  193. package/lib/core/tsconfig/mergeMembershipPolicyOverlay.d.cts +4 -3
  194. package/lib/core/tsconfig/mergeMembershipPolicyOverlay.d.mts +4 -3
  195. package/lib/core/tsconfig/mergeMembershipPolicyOverlay.d.ts +4 -3
  196. package/lib/core/tsconfig/mergeMembershipPolicyOverlay.js +36 -6
  197. package/lib/core/tsconfig/mergeMembershipPolicyOverlay.js.map +1 -1
  198. package/lib/core/tsconfig/mergeMembershipPolicyOverlay.mjs +36 -6
  199. package/lib/core/tsconfig/mergeMembershipPolicyOverlay.mjs.map +1 -1
  200. package/lib/core/tsconfig/readProjectMembershipPolicy.d.cts +3 -2
  201. package/lib/core/tsconfig/readProjectMembershipPolicy.d.mts +3 -2
  202. package/lib/core/tsconfig/readProjectMembershipPolicy.d.ts +3 -2
  203. package/lib/core/tsconfig/readProjectMembershipPolicy.js +49 -15
  204. package/lib/core/tsconfig/readProjectMembershipPolicy.js.map +1 -1
  205. package/lib/core/tsconfig/readProjectMembershipPolicy.mjs +49 -15
  206. package/lib/core/tsconfig/readProjectMembershipPolicy.mjs.map +1 -1
  207. package/lib/core/tsconfig/resolveMembershipInputExtensions.d.cts +16 -0
  208. package/lib/core/tsconfig/resolveMembershipInputExtensions.d.mts +16 -0
  209. package/lib/core/tsconfig/resolveMembershipInputExtensions.d.ts +16 -0
  210. package/lib/core/tsconfig/resolveMembershipInputExtensions.js +45 -0
  211. package/lib/core/tsconfig/resolveMembershipInputExtensions.js.map +1 -0
  212. package/lib/core/tsconfig/resolveMembershipInputExtensions.mjs +43 -0
  213. package/lib/core/tsconfig/resolveMembershipInputExtensions.mjs.map +1 -0
  214. package/lib/core/turbopack/turbopack.d.cts +2 -2
  215. package/lib/core/turbopack/turbopack.d.mts +2 -2
  216. package/lib/core/turbopack/turbopack.d.ts +2 -2
  217. package/lib/core/turbopack/turbopack.js +15 -7
  218. package/lib/core/turbopack/turbopack.js.map +1 -1
  219. package/lib/core/turbopack/turbopack.mjs +15 -7
  220. package/lib/core/turbopack/turbopack.mjs.map +1 -1
  221. package/lib/core/unplugin.js +21 -8
  222. package/lib/core/unplugin.js.map +1 -1
  223. package/lib/core/unplugin.mjs +21 -8
  224. package/lib/core/unplugin.mjs.map +1 -1
  225. package/package.json +3 -3
  226. package/src/core/bridge/TtscProjectRecord.ts +4 -1
  227. package/src/core/bridge/projectRecordArgumentsMatch.ts +37 -0
  228. package/src/core/bridge/projectRecordMoved.ts +17 -11
  229. package/src/core/bridge/readProjectRecordFile.ts +39 -3
  230. package/src/core/bridge/refreshProjectRecordFile.ts +9 -2
  231. package/src/core/bridge/refreshProjectRecordFiles.ts +7 -1
  232. package/src/core/index.ts +2 -0
  233. package/src/core/next/next.ts +18 -2
  234. package/src/core/options/ResolvedTtscUnpluginOptions.ts +3 -0
  235. package/src/core/options/TtscUnpluginOptions.ts +9 -0
  236. package/src/core/options/resolveOptions.ts +5 -3
  237. package/src/core/rollup/rollupDeliveryOptions.ts +9 -5
  238. package/src/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.ts +14 -0
  239. package/src/core/transform/cache/TtscCachedProjectTransform.ts +7 -0
  240. package/src/core/transform/cache/createTransformCacheKey.ts +13 -8
  241. package/src/core/transform/generation/TtscCompilerMembershipHint.ts +24 -0
  242. package/src/core/transform/generation/applyCompilerMembership.ts +44 -0
  243. package/src/core/transform/generation/captureTransformGeneration.ts +43 -10
  244. package/src/core/transform/generation/onlyLearnedCompileFacts.ts +7 -5
  245. package/src/core/transform/generation/primeCompilerMembership.ts +39 -0
  246. package/src/core/transform/generation/selectReportedMembershipPolicy.ts +59 -13
  247. package/src/core/transform/generation/transformProject.ts +12 -0
  248. package/src/core/transform/project/isPossibleProgramFileName.ts +28 -15
  249. package/src/core/transform/session/sharedCompileIdentity.ts +10 -5
  250. package/src/core/transform/transformTtsc.ts +21 -0
  251. package/src/core/transform/tsconfig/TtscCompilerArgumentsWitness.ts +19 -0
  252. package/src/core/transform/tsconfig/captureCompilerArguments.ts +25 -0
  253. package/src/core/transform/tsconfig/compilerEnvironmentIdentity.ts +20 -0
  254. package/src/core/transform/tsconfig/resolveCompilerEnvironment.ts +61 -0
  255. package/src/core/transform/tsconfig/transformScratchEnvironment.ts +7 -6
  256. package/src/core/transform/watch/notifyProjectRecord.ts +3 -0
  257. package/src/core/tsconfig/ITtscProjectMembershipPolicy.ts +15 -1
  258. package/src/core/tsconfig/mergeMembershipPolicyOverlay.ts +31 -6
  259. package/src/core/tsconfig/readProjectMembershipPolicy.ts +61 -17
  260. package/src/core/tsconfig/resolveMembershipInputExtensions.ts +45 -0
  261. package/src/core/turbopack/turbopack.ts +27 -7
  262. package/src/core/unplugin.ts +34 -9
@@ -1,27 +1,27 @@
1
1
  import type { ITtscCompilerTransformation } from "ttsc";
2
2
  import type { ITtscProjectMembershipPolicy } from "../../tsconfig/ITtscProjectMembershipPolicy";
3
3
  /**
4
- * Replace a capture's provisional compiler comparison rule with its report.
4
+ * Replace provisional root settings and comparison rules with native reports.
5
5
  *
6
6
  * Capture supplies an explicit priming answer before walking. An exception or
7
- * an envelope without a case report leaves that same policy intact. A differing
7
+ * an envelope without reports leaves that same policy intact. A differing
8
8
  * report marks the old walk for refusal; this operation neither performs the
9
9
  * walk nor establishes that a predicted answer matched the native compiler.
10
10
  *
11
- * @evidence contracts/common.md#principled-implementation An available compiler boolean, including false, overrides the explicit priming answer; equality determines whether the capture learned a different rule. Missing reports retain the original policy identity.
11
+ * @evidence contracts/common.md#principled-implementation Native case, suffix and output settings replace provisional answers; set equality determines whether a fresh walk is needed. Missing reports preserve the original policy identity and explicit excludes retain authored provenance.
12
12
  * @evidence contracts/common.md#clear-and-simple-design One report-selection operation returns the policy and changed-rule fact; capture retains ownership of enumeration authority and proof refusal.
13
13
  * @evidence contracts/common.md#prohibited-implementation-shortcuts No OS label or filesystem probe substitutes for a compiler report, and no report supplies missing walk evidence.
14
14
  * @evidence contracts/common.md#meaningful-documentation Native prose states the explicit primer requirement, missing-report identity and changed-policy refusal boundary.
15
- * @evidence contracts/portability.md#os-neutral-implementation The compiler's reported comparison policy wins independently of host path grammar; the explicit primer remains provisional and native prediction or probing is outside this operation.
16
- * @evidence contracts/performance.md#efficient-algorithms Missing reports return the borrowed policy; an available report shallow-copies its own fields once. Work and temporary object space follow policy field count, without traversing nested specifications.
15
+ * @evidence contracts/portability.md#os-neutral-implementation Native path grammar resolves directory spelling; component-boundary prefixes map only observed project root aliases to a shared anchor. Insensitive reports permit ASCII case equivalence, while non-ASCII spellings stay conservatively distinct instead of colliding through full lowercasing or Windows path.relative.
16
+ * @evidence contracts/performance.md#efficient-algorithms Available settings copy extension/exclusion populations; Set comparisons visit their text. At most three observed anchors are resolved once and each exclusion compares their component-boundary prefixes. Temporary storage follows those populations and path lengths; no filesystem query runs here.
17
17
  * @evidenceExclude contracts/performance.md#reuse-equivalent-work Selects this envelope's reported rule without retaining a memo or certifying reuse of the primed walk.
18
18
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Borrows the primer or returns a shallow policy object; capture owns retained policy and observer lifetimes, with no handle or historical state acquired here.
19
19
  */
20
20
  export declare function selectReportedMembershipPolicy(primed: ITtscProjectMembershipPolicy & {
21
21
  useCaseSensitiveFileNames: boolean;
22
22
  }, result: ITtscCompilerTransformation): {
23
- /** Borrowed primer or reported-case overlay for this capture's validators. */
23
+ /** Borrowed primer or native settings overlay for this capture's validators. */
24
24
  membershipPolicy: ITtscProjectMembershipPolicy;
25
25
  /** Whether the primed walk used a different rule from this compiler report. */
26
- casePolicyLearned: boolean;
26
+ membershipPolicyLearned: boolean;
27
27
  };
@@ -1,19 +1,22 @@
1
1
  'use strict';
2
2
 
3
+ var path = require('node:path');
4
+ var applyCompilerMembership = require('./applyCompilerMembership.js');
5
+
3
6
  /**
4
- * Replace a capture's provisional compiler comparison rule with its report.
7
+ * Replace provisional root settings and comparison rules with native reports.
5
8
  *
6
9
  * Capture supplies an explicit priming answer before walking. An exception or
7
- * an envelope without a case report leaves that same policy intact. A differing
10
+ * an envelope without reports leaves that same policy intact. A differing
8
11
  * report marks the old walk for refusal; this operation neither performs the
9
12
  * walk nor establishes that a predicted answer matched the native compiler.
10
13
  *
11
- * @evidence contracts/common.md#principled-implementation An available compiler boolean, including false, overrides the explicit priming answer; equality determines whether the capture learned a different rule. Missing reports retain the original policy identity.
14
+ * @evidence contracts/common.md#principled-implementation Native case, suffix and output settings replace provisional answers; set equality determines whether a fresh walk is needed. Missing reports preserve the original policy identity and explicit excludes retain authored provenance.
12
15
  * @evidence contracts/common.md#clear-and-simple-design One report-selection operation returns the policy and changed-rule fact; capture retains ownership of enumeration authority and proof refusal.
13
16
  * @evidence contracts/common.md#prohibited-implementation-shortcuts No OS label or filesystem probe substitutes for a compiler report, and no report supplies missing walk evidence.
14
17
  * @evidence contracts/common.md#meaningful-documentation Native prose states the explicit primer requirement, missing-report identity and changed-policy refusal boundary.
15
- * @evidence contracts/portability.md#os-neutral-implementation The compiler's reported comparison policy wins independently of host path grammar; the explicit primer remains provisional and native prediction or probing is outside this operation.
16
- * @evidence contracts/performance.md#efficient-algorithms Missing reports return the borrowed policy; an available report shallow-copies its own fields once. Work and temporary object space follow policy field count, without traversing nested specifications.
18
+ * @evidence contracts/portability.md#os-neutral-implementation Native path grammar resolves directory spelling; component-boundary prefixes map only observed project root aliases to a shared anchor. Insensitive reports permit ASCII case equivalence, while non-ASCII spellings stay conservatively distinct instead of colliding through full lowercasing or Windows path.relative.
19
+ * @evidence contracts/performance.md#efficient-algorithms Available settings copy extension/exclusion populations; Set comparisons visit their text. At most three observed anchors are resolved once and each exclusion compares their component-boundary prefixes. Temporary storage follows those populations and path lengths; no filesystem query runs here.
17
20
  * @evidenceExclude contracts/performance.md#reuse-equivalent-work Selects this envelope's reported rule without retaining a memo or certifying reuse of the primed walk.
18
21
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Borrows the primer or returns a shallow policy object; capture owns retained policy and observer lifetimes, with no handle or historical state acquired here.
19
22
  */
@@ -21,11 +24,42 @@ function selectReportedMembershipPolicy(primed, result) {
21
24
  const reported = result.type === "exception"
22
25
  ? undefined
23
26
  : result.graph?.useCaseSensitiveFileNames;
27
+ const rootReport = result.type === "exception" ? undefined : result.graph?.membership;
28
+ const policy = applyCompilerMembership.applyCompilerMembership(reported === undefined
29
+ ? primed
30
+ : { ...primed, useCaseSensitiveFileNames: reported }, rootReport);
31
+ // ASCII equivalence cannot introduce Unicode expansion collisions. Other
32
+ // spelling changes conservatively require a fresh walk under the report.
33
+ const asciiFold = (value) => value.replace(/[A-Z]/g, (character) => character.toLowerCase());
34
+ const canonical = (value) => policy.useCaseSensitiveFileNames === false ? asciiFold(value) : value;
35
+ const root = primed.rootFileSpecs?.root;
36
+ const anchors = root === undefined
37
+ ? []
38
+ : [root.path, root.realpath, root.nativepath]
39
+ .filter((anchor) => anchor !== undefined)
40
+ .map((anchor) => canonical(path.resolve(anchor)));
41
+ const directoryKey = (directory) => {
42
+ const target = canonical(path.resolve(directory));
43
+ for (const anchor of anchors) {
44
+ if (target === anchor)
45
+ return "root:";
46
+ const prefix = anchor.endsWith(path.sep) ? anchor : anchor + path.sep;
47
+ if (target.startsWith(prefix))
48
+ return "root:" + target.slice(prefix.length);
49
+ }
50
+ return "absolute:" + target;
51
+ };
52
+ const sameSet = (left, right, key) => {
53
+ const a = new Set(left.map(key));
54
+ const b = new Set(right.map(key));
55
+ return a.size === b.size && [...a].every((entry) => b.has(entry));
56
+ };
24
57
  return {
25
- membershipPolicy: reported === undefined
26
- ? primed
27
- : { ...primed, useCaseSensitiveFileNames: reported },
28
- casePolicyLearned: reported !== undefined && reported !== primed.useCaseSensitiveFileNames,
58
+ membershipPolicy: policy,
59
+ membershipPolicyLearned: (reported !== undefined &&
60
+ reported !== primed.useCaseSensitiveFileNames) ||
61
+ !sameSet(primed.inputExtensions, policy.inputExtensions, asciiFold) ||
62
+ !sameSet(primed.excludedDirectories, policy.excludedDirectories, directoryKey),
29
63
  };
30
64
  }
31
65
 
@@ -1 +1 @@
1
- {"version":3,"file":"selectReportedMembershipPolicy.js","sources":["../../../../src/core/transform/generation/selectReportedMembershipPolicy.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,8BAA8B,CAC5C,MAA6E,EAC7E,MAAmC,EAAA;AAQnC,IAAA,MAAM,QAAQ,GACZ,MAAM,CAAC,IAAI,KAAK;AACd,UAAE;AACF,UAAE,MAAM,CAAC,KAAK,EAAE,yBAAyB;IAC7C,OAAO;QACL,gBAAgB,EACd,QAAQ,KAAK;AACX,cAAE;cACA,EAAE,GAAG,MAAM,EAAE,yBAAyB,EAAE,QAAQ,EAAE;QACxD,iBAAiB,EACf,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,MAAM,CAAC,yBAAyB;KAC1E;AACH;;;;"}
1
+ {"version":3,"file":"selectReportedMembershipPolicy.js","sources":["../../../../src/core/transform/generation/selectReportedMembershipPolicy.ts"],"sourcesContent":[null],"names":["applyCompilerMembership"],"mappings":";;;;;AAMA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,8BAA8B,CAC5C,MAA6E,EAC7E,MAAmC,EAAA;AAQnC,IAAA,MAAM,QAAQ,GACZ,MAAM,CAAC,IAAI,KAAK;AACd,UAAE;AACF,UAAE,MAAM,CAAC,KAAK,EAAE,yBAAyB;AAC7C,IAAA,MAAM,UAAU,GACd,MAAM,CAAC,IAAI,KAAK,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,UAAU;AACpE,IAAA,MAAM,MAAM,GAAGA,+CAAuB,CACpC,QAAQ,KAAK;AACX,UAAE;AACF,UAAE,EAAE,GAAG,MAAM,EAAE,yBAAyB,EAAE,QAAQ,EAAE,EACtD,UAAU,CACX;;;IAGD,MAAM,SAAS,GAAG,CAAC,KAAa,KAC9B,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,SAAS,KAAK,SAAS,CAAC,WAAW,EAAE,CAAC;IACjE,MAAM,SAAS,GAAG,CAAC,KAAa,KAC9B,MAAM,CAAC,yBAAyB,KAAK,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK;AACvE,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa,EAAE,IAAI;AACvC,IAAA,MAAM,OAAO,GACX,IAAI,KAAK;AACP,UAAE;AACF,UAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,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,KAAK,SAAS;AACrB,YAAA,QAAQ,KAAK,MAAM,CAAC,yBAAyB;YAC/C,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,SAAS,CAAC;YACnE,CAAC,OAAO,CACN,MAAM,CAAC,mBAAmB,EAC1B,MAAM,CAAC,mBAAmB,EAC1B,YAAY,CACb;KACJ;AACH;;;;"}
@@ -1,17 +1,20 @@
1
+ import path from 'node:path';
2
+ import { applyCompilerMembership } from './applyCompilerMembership.mjs';
3
+
1
4
  /**
2
- * Replace a capture's provisional compiler comparison rule with its report.
5
+ * Replace provisional root settings and comparison rules with native reports.
3
6
  *
4
7
  * Capture supplies an explicit priming answer before walking. An exception or
5
- * an envelope without a case report leaves that same policy intact. A differing
8
+ * an envelope without reports leaves that same policy intact. A differing
6
9
  * report marks the old walk for refusal; this operation neither performs the
7
10
  * walk nor establishes that a predicted answer matched the native compiler.
8
11
  *
9
- * @evidence contracts/common.md#principled-implementation An available compiler boolean, including false, overrides the explicit priming answer; equality determines whether the capture learned a different rule. Missing reports retain the original policy identity.
12
+ * @evidence contracts/common.md#principled-implementation Native case, suffix and output settings replace provisional answers; set equality determines whether a fresh walk is needed. Missing reports preserve the original policy identity and explicit excludes retain authored provenance.
10
13
  * @evidence contracts/common.md#clear-and-simple-design One report-selection operation returns the policy and changed-rule fact; capture retains ownership of enumeration authority and proof refusal.
11
14
  * @evidence contracts/common.md#prohibited-implementation-shortcuts No OS label or filesystem probe substitutes for a compiler report, and no report supplies missing walk evidence.
12
15
  * @evidence contracts/common.md#meaningful-documentation Native prose states the explicit primer requirement, missing-report identity and changed-policy refusal boundary.
13
- * @evidence contracts/portability.md#os-neutral-implementation The compiler's reported comparison policy wins independently of host path grammar; the explicit primer remains provisional and native prediction or probing is outside this operation.
14
- * @evidence contracts/performance.md#efficient-algorithms Missing reports return the borrowed policy; an available report shallow-copies its own fields once. Work and temporary object space follow policy field count, without traversing nested specifications.
16
+ * @evidence contracts/portability.md#os-neutral-implementation Native path grammar resolves directory spelling; component-boundary prefixes map only observed project root aliases to a shared anchor. Insensitive reports permit ASCII case equivalence, while non-ASCII spellings stay conservatively distinct instead of colliding through full lowercasing or Windows path.relative.
17
+ * @evidence contracts/performance.md#efficient-algorithms Available settings copy extension/exclusion populations; Set comparisons visit their text. At most three observed anchors are resolved once and each exclusion compares their component-boundary prefixes. Temporary storage follows those populations and path lengths; no filesystem query runs here.
15
18
  * @evidenceExclude contracts/performance.md#reuse-equivalent-work Selects this envelope's reported rule without retaining a memo or certifying reuse of the primed walk.
16
19
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Borrows the primer or returns a shallow policy object; capture owns retained policy and observer lifetimes, with no handle or historical state acquired here.
17
20
  */
@@ -19,11 +22,42 @@ function selectReportedMembershipPolicy(primed, result) {
19
22
  const reported = result.type === "exception"
20
23
  ? undefined
21
24
  : result.graph?.useCaseSensitiveFileNames;
25
+ const rootReport = result.type === "exception" ? undefined : result.graph?.membership;
26
+ const policy = applyCompilerMembership(reported === undefined
27
+ ? primed
28
+ : { ...primed, useCaseSensitiveFileNames: reported }, rootReport);
29
+ // ASCII equivalence cannot introduce Unicode expansion collisions. Other
30
+ // spelling changes conservatively require a fresh walk under the report.
31
+ const asciiFold = (value) => value.replace(/[A-Z]/g, (character) => character.toLowerCase());
32
+ const canonical = (value) => policy.useCaseSensitiveFileNames === false ? asciiFold(value) : value;
33
+ const root = primed.rootFileSpecs?.root;
34
+ const anchors = root === undefined
35
+ ? []
36
+ : [root.path, root.realpath, root.nativepath]
37
+ .filter((anchor) => anchor !== undefined)
38
+ .map((anchor) => canonical(path.resolve(anchor)));
39
+ const directoryKey = (directory) => {
40
+ const target = canonical(path.resolve(directory));
41
+ for (const anchor of anchors) {
42
+ if (target === anchor)
43
+ return "root:";
44
+ const prefix = anchor.endsWith(path.sep) ? anchor : anchor + path.sep;
45
+ if (target.startsWith(prefix))
46
+ return "root:" + target.slice(prefix.length);
47
+ }
48
+ return "absolute:" + target;
49
+ };
50
+ const sameSet = (left, right, key) => {
51
+ const a = new Set(left.map(key));
52
+ const b = new Set(right.map(key));
53
+ return a.size === b.size && [...a].every((entry) => b.has(entry));
54
+ };
22
55
  return {
23
- membershipPolicy: reported === undefined
24
- ? primed
25
- : { ...primed, useCaseSensitiveFileNames: reported },
26
- casePolicyLearned: reported !== undefined && reported !== primed.useCaseSensitiveFileNames,
56
+ membershipPolicy: policy,
57
+ membershipPolicyLearned: (reported !== undefined &&
58
+ reported !== primed.useCaseSensitiveFileNames) ||
59
+ !sameSet(primed.inputExtensions, policy.inputExtensions, asciiFold) ||
60
+ !sameSet(primed.excludedDirectories, policy.excludedDirectories, directoryKey),
27
61
  };
28
62
  }
29
63
 
@@ -1 +1 @@
1
- {"version":3,"file":"selectReportedMembershipPolicy.mjs","sources":["../../../../src/core/transform/generation/selectReportedMembershipPolicy.ts"],"sourcesContent":[null],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,8BAA8B,CAC5C,MAA6E,EAC7E,MAAmC,EAAA;AAQnC,IAAA,MAAM,QAAQ,GACZ,MAAM,CAAC,IAAI,KAAK;AACd,UAAE;AACF,UAAE,MAAM,CAAC,KAAK,EAAE,yBAAyB;IAC7C,OAAO;QACL,gBAAgB,EACd,QAAQ,KAAK;AACX,cAAE;cACA,EAAE,GAAG,MAAM,EAAE,yBAAyB,EAAE,QAAQ,EAAE;QACxD,iBAAiB,EACf,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,MAAM,CAAC,yBAAyB;KAC1E;AACH;;;;"}
1
+ {"version":3,"file":"selectReportedMembershipPolicy.mjs","sources":["../../../../src/core/transform/generation/selectReportedMembershipPolicy.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAMA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,8BAA8B,CAC5C,MAA6E,EAC7E,MAAmC,EAAA;AAQnC,IAAA,MAAM,QAAQ,GACZ,MAAM,CAAC,IAAI,KA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M,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG;AACrE,YAAA,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC;gBAC3B,OAAO,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;QAChD;QACA,OAAO,WAAW,GAAG,MAAM;AAC7B,IAAA,CAAC;IACD,MAAM,OAAO,GAAG,CACd,IAAuB,EACvB,KAAwB,EACxB,GAA8B,KACnB;AACX,QAAA,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAChC,QAAA,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACnE,IAAA,CAAC;IACD,OAAO;AACL,QAAA,gBAAgB,EAAE,MAAM;AACxB,QAAA,uBAAuB,EACrB,CAAC,QAAQ,KAAK,SAAS;AACrB,YAAA,QAAQ,KAAK,MAAM,CAAC,yBAAyB;YAC/C,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,SAAS,CAAC;YACnE,CAAC,OAAO,CACN,MAAM,CAAC,mBAAmB,EAC1B,MAAM,CAAC,mBAAmB,EAC1B,YAAY,CACb;KACJ;AACH;;;;"}
@@ -1,6 +1,7 @@
1
1
  import type { ResolvedTtscUnpluginOptions } from "../../options/ResolvedTtscUnpluginOptions.cjs";
2
2
  import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform.cjs";
3
3
  import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransformFilesystemOperations.cjs";
4
+ import type { TtscCompilerMembershipHint } from "./TtscCompilerMembershipHint.cjs";
4
5
  /**
5
6
  * Compile one whole project generation, retrying within a bound while its proof
6
7
  * is lost to a filesystem race.
@@ -76,6 +77,12 @@ export declare function transformProject(props: {
76
77
  aliasPaths: Record<string, string[]>;
77
78
  /** Compiler-option overlay, preserving the underlying config semantics. */
78
79
  compilerOptions: Record<string, unknown>;
80
+ /** Detached environment selected before this generation's cache lookup. */
81
+ compilerEnvironment?: NodeJS.ProcessEnv;
82
+ /** Explicit override retained with persisted invocation proof. */
83
+ runExternalCode?: boolean;
84
+ /** Previous native root policy; the new compiler report can refute it. */
85
+ compilerMembership?: TtscCompilerMembershipHint;
79
86
  /** Native path of the module whose delivery initiated this capture. */
80
87
  currentFile: string;
81
88
  /** Delivered module text compared against the compiler's disk observation. */
@@ -1,6 +1,7 @@
1
1
  import type { ResolvedTtscUnpluginOptions } from "../../options/ResolvedTtscUnpluginOptions.mjs";
2
2
  import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform.mjs";
3
3
  import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransformFilesystemOperations.mjs";
4
+ import type { TtscCompilerMembershipHint } from "./TtscCompilerMembershipHint.mjs";
4
5
  /**
5
6
  * Compile one whole project generation, retrying within a bound while its proof
6
7
  * is lost to a filesystem race.
@@ -76,6 +77,12 @@ export declare function transformProject(props: {
76
77
  aliasPaths: Record<string, string[]>;
77
78
  /** Compiler-option overlay, preserving the underlying config semantics. */
78
79
  compilerOptions: Record<string, unknown>;
80
+ /** Detached environment selected before this generation's cache lookup. */
81
+ compilerEnvironment?: NodeJS.ProcessEnv;
82
+ /** Explicit override retained with persisted invocation proof. */
83
+ runExternalCode?: boolean;
84
+ /** Previous native root policy; the new compiler report can refute it. */
85
+ compilerMembership?: TtscCompilerMembershipHint;
79
86
  /** Native path of the module whose delivery initiated this capture. */
80
87
  currentFile: string;
81
88
  /** Delivered module text compared against the compiler's disk observation. */
@@ -1,6 +1,7 @@
1
1
  import type { ResolvedTtscUnpluginOptions } from "../../options/ResolvedTtscUnpluginOptions";
2
2
  import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform";
3
3
  import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransformFilesystemOperations";
4
+ import type { TtscCompilerMembershipHint } from "./TtscCompilerMembershipHint";
4
5
  /**
5
6
  * Compile one whole project generation, retrying within a bound while its proof
6
7
  * is lost to a filesystem race.
@@ -76,6 +77,12 @@ export declare function transformProject(props: {
76
77
  aliasPaths: Record<string, string[]>;
77
78
  /** Compiler-option overlay, preserving the underlying config semantics. */
78
79
  compilerOptions: Record<string, unknown>;
80
+ /** Detached environment selected before this generation's cache lookup. */
81
+ compilerEnvironment?: NodeJS.ProcessEnv;
82
+ /** Explicit override retained with persisted invocation proof. */
83
+ runExternalCode?: boolean;
84
+ /** Previous native root policy; the new compiler report can refute it. */
85
+ compilerMembership?: TtscCompilerMembershipHint;
79
86
  /** Native path of the module whose delivery initiated this capture. */
80
87
  currentFile: string;
81
88
  /** Delivered module text compared against the compiler's disk observation. */
@@ -88,9 +88,11 @@ async function transformProject(props) {
88
88
  let moved = 0;
89
89
  let witnessed = new Set(props.witnessedDependencies);
90
90
  let useCaseSensitiveFileNames = props.useCaseSensitiveFileNames;
91
+ let compilerMembership = props.compilerMembership;
91
92
  for (let attempt = 0;; attempt += 1) {
92
93
  const cached = await captureTransformGeneration.captureTransformGeneration({
93
94
  ...props,
95
+ compilerMembership,
94
96
  rejected,
95
97
  useCaseSensitiveFileNames,
96
98
  witnessedDependencies: [...witnessed],
@@ -144,6 +146,7 @@ async function transformProject(props) {
144
146
  const nextInputs = carryTransformAttemptInputs.carryTransformAttemptInputs(witnessed, useCaseSensitiveFileNames, cached);
145
147
  witnessed = nextInputs.witnessed;
146
148
  useCaseSensitiveFileNames = nextInputs.useCaseSensitiveFileNames;
149
+ compilerMembership = cached.compilerMembership;
147
150
  // A publication refuted here would be found again by a retry for the same
148
151
  // state, which therefore compiles and replaces it. A retry whose project
149
152
  // moved to another state claims that state's publication, and adopts it:
@@ -1 +1 @@
1
- {"version":3,"file":"transformProject.js","sources":["../../../../src/core/transform/generation/transformProject.ts"],"sourcesContent":[null],"names":["traceInvocation","captureTransformGeneration","selectTransformAttemptDisposition","TRANSFORM_GENERATION_FAILURES","TRANSFORM_ADOPTED_RESULTS","carryTransformAttemptInputs","TRANSFORM_FAILED_GENERATION_VALIDATIONS","disposeCachedTransform","createUnstableGenerationError"],"mappings":";;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEG;AACI,eAAe,gBAAgB,CAAC,KAqEtC,EAAA;AACC,IAAA,MAAM,YAAY,GAAGA,+BAAe,EAAE;IACtC,MAAM,QAAQ,GAAkC,EAAE;AAClD,IAAA,IAAI,QAA4B;IAChC,IAAI,KAAK,GAAG,CAAC;IACb,IAAI,SAAS,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC;AACpD,IAAA,IAAI,yBAAyB,GAAG,KAAK,CAAC,yBAAyB;IAC/D,KAAK,IAAI,OAAO,GAAG,CAAC,GAAI,OAAO,IAAI,CAAC,EAAE;AACpC,QAAA,MAAM,MAAM,GAAG,MAAMC,qDAA0B,CAAC;AAC9C,YAAA,GAAG,KAAK;YACR,QAAQ;YACR,yBAAyB;AACzB,YAAA,qBAAqB,EAAE,CAAC,GAAG,SAAS,CAAC;AACtC,SAAA,CAAC;QACF,MAAM,WAAW,GAAGC,mEAAiC,CAAC;AACpD,YAAA,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;YAC9B,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;YAC/C,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;YACvD,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;AACzC,YAAA,oBAAoB,EAClB,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK;AACrB,kBAAE,MAAM,CAAC,MAAM,CAAC;AAChB,kBAAE,SAAS;AAC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W,CAAC,IAAI,KAAK,UAAU,IAAI,WAAW,CAAC,IAAI,KAAK,YAAY,EAAE;AACxE,YAAA,OAAO,MAAM;QACf;AACA,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;QACnC,MAAM,UAAU,GAAGC,uDAA2B,CAC5C,SAAS,EACT,yBAAyB,EACzB,MAAM,CACP;AACD,QAAA,SAAS,GAAG,UAAU,CAAC,SAAS;AAChC,QAAA,yBAAyB,GAAG,UAAU,CAAC,yBAAyB;;;;;;;;AAQhE,QAAA,QAAQ,GAAG,WAAW,CAAC,QAAQ;AAC/B,QAAA,KAAK,GAAG,WAAW,CAAC,KAAK;;;AAGzB,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,YAAY,EAAE;AACrC,YAAA,OAAO,MAAM;QACf;AACA,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,UAAU,EAAE;YACnC,MAAM,UAAU,GAAGC,+EAAuC,CAAC,GAAG,CAC5D,MAAM,CAAC,MAAM,CACd;AACD,YAAA,IAAI,UAAU,KAAK,SAAS,EAAE;gBAC5BC,6CAAsB,CAAC,MAAM,CAAC;AAC9B,gBAAA,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE;YACH;AACA,YAAA,MAAMC,2DAA6B,CACjC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EACjD,QAAQ,EACR,UAAU,CACX;QACH;QACAD,6CAAsB,CAAC,MAAM,CAAC;IAChC;AACF;;;;"}
1
+ {"version":3,"file":"transformProject.js","sources":["../../../../src/core/transform/generation/transformProject.ts"],"sourcesContent":[null],"names":["traceInvocation","captureTransformGeneration","selectTransformAttemptDisposition","TRANSFORM_GENERATION_FAILURES","TRANSFORM_ADOPTED_RESULTS","carryTransformAttemptInputs","TRANSFORM_FAILED_GENERATION_VALIDATIONS","disposeCachedTransform","createUnstableGenerationError"],"mappings":";;;;;;;;;;;;;AAiBA;;;;;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BAAyB,EACzB,MAAM,CACP;AACD,QAAA,SAAS,GAAG,UAAU,CAAC,SAAS;AAChC,QAAA,yBAAyB,GAAG,UAAU,CAAC,yBAAyB;AAChE,QAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB;;;;;;;;AAQ9C,QAAA,QAAQ,GAAG,WAAW,CAAC,QAAQ;AAC/B,QAAA,KAAK,GAAG,WAAW,CAAC,KAAK;;;AAGzB,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,YAAY,EAAE;AACrC,YAAA,OAAO,MAAM;QACf;AACA,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,UAAU,EAAE;YACnC,MAAM,UAAU,GAAGC,+EAAuC,CAAC,GAAG,CAC5D,MAAM,CAAC,MAAM,CACd;AACD,YAAA,IAAI,UAAU,KAAK,SAAS,EAAE;gBAC5BC,6CAAsB,CAAC,MAAM,CAAC;AAC9B,gBAAA,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE;YACH;AACA,YAAA,MAAMC,2DAA6B,CACjC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EACjD,QAAQ,EACR,UAAU,CACX;QACH;QACAD,6CAAsB,CAAC,MAAM,CAAC;IAChC;AACF;;;;"}
@@ -86,9 +86,11 @@ async function transformProject(props) {
86
86
  let moved = 0;
87
87
  let witnessed = new Set(props.witnessedDependencies);
88
88
  let useCaseSensitiveFileNames = props.useCaseSensitiveFileNames;
89
+ let compilerMembership = props.compilerMembership;
89
90
  for (let attempt = 0;; attempt += 1) {
90
91
  const cached = await captureTransformGeneration({
91
92
  ...props,
93
+ compilerMembership,
92
94
  rejected,
93
95
  useCaseSensitiveFileNames,
94
96
  witnessedDependencies: [...witnessed],
@@ -142,6 +144,7 @@ async function transformProject(props) {
142
144
  const nextInputs = carryTransformAttemptInputs(witnessed, useCaseSensitiveFileNames, cached);
143
145
  witnessed = nextInputs.witnessed;
144
146
  useCaseSensitiveFileNames = nextInputs.useCaseSensitiveFileNames;
147
+ compilerMembership = cached.compilerMembership;
145
148
  // A publication refuted here would be found again by a retry for the same
146
149
  // state, which therefore compiles and replaces it. A retry whose project
147
150
  // moved to another state claims that state's publication, and adopts it:
@@ -1 +1 @@
1
- {"version":3,"file":"transformProject.mjs","sources":["../../../../src/core/transform/generation/transformProject.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEG;AACI,eAAe,gBAAgB,CAAC,KAqEtC,EAAA;AACC,IAAA,MAAM,YAAY,GAAG,eAAe,EAAE;IACtC,MAAM,QAAQ,GAAkC,EAAE;AAClD,IAAA,IAAI,QAA4B;IAChC,IAAI,KAAK,GAAG,CAAC;IACb,IAAI,SAAS,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC;AACpD,IAAA,IAAI,yBAAyB,GAAG,KAAK,CAAC,yBAAyB;IAC/D,KAAK,IAAI,OAAO,GAAG,CAAC,GAAI,OAAO,IAAI,CAAC,EAAE;AACpC,QAAA,MAAM,MAAM,GAAG,MAAM,0BAA0B,CAAC;AAC9C,YAAA,GAAG,KAAK;YACR,QAAQ;YACR,yBAAyB;AACzB,YAAA,qBAAqB,EAAE,CAAC,GAAG,SAAS,CAAC;AACtC,SAAA,CAAC;QACF,MAAM,WAAW,GAAG,iCAAiC,CAAC;AACpD,YAAA,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;YAC9B,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;YAC/C,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;YACvD,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;AACzC,YAAA,oBAAoB,EAClB,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK;AACrB,kBAAE,MAAM,CAAC,MAAM,CAAC;AAChB,kBAAE,SAAS;AACf,YAAA,0BAA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AAK,UAAU,IAAI,WAAW,CAAC,IAAI,KAAK,YAAY,EAAE;AACxE,YAAA,OAAO,MAAM;QACf;AACA,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;QACnC,MAAM,UAAU,GAAG,2BAA2B,CAC5C,SAAS,EACT,yBAAyB,EACzB,MAAM,CACP;AACD,QAAA,SAAS,GAAG,UAAU,CAAC,SAAS;AAChC,QAAA,yBAAyB,GAAG,UAAU,CAAC,yBAAyB;;;;;;;;AAQhE,QAAA,QAAQ,GAAG,WAAW,CAAC,QAAQ;AAC/B,QAAA,KAAK,GAAG,WAAW,CAAC,KAAK;;;AAGzB,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,YAAY,EAAE;AACrC,YAAA,OAAO,MAAM;QACf;AACA,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,UAAU,EAAE;YACnC,MAAM,UAAU,GAAG,uCAAuC,CAAC,GAAG,CAC5D,MAAM,CAAC,MAAM,CACd;AACD,YAAA,IAAI,UAAU,KAAK,SAAS,EAAE;gBAC5B,sBAAsB,CAAC,MAAM,CAAC;AAC9B,gBAAA,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE;YACH;AACA,YAAA,MAAM,6BAA6B,CACjC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EACjD,QAAQ,EACR,UAAU,CACX;QACH;QACA,sBAAsB,CAAC,MAAM,CAAC;IAChC;AACF;;;;"}
1
+ {"version":3,"file":"transformProject.mjs","sources":["../../../../src/core/transform/generation/transformProject.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEG;AACI,eAAe,gBAAgB,CAAC,KA6EtC,EAAA;AACC,IAAA,MAAM,YAAY,GAAG,eAAe,EAAE;IACtC,MAAM,QAAQ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AG,WAAW,CAAC,QAAQ;AAC/B,QAAA,KAAK,GAAG,WAAW,CAAC,KAAK;;;AAGzB,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,YAAY,EAAE;AACrC,YAAA,OAAO,MAAM;QACf;AACA,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,UAAU,EAAE;YACnC,MAAM,UAAU,GAAG,uCAAuC,CAAC,GAAG,CAC5D,MAAM,CAAC,MAAM,CACd;AACD,YAAA,IAAI,UAAU,KAAK,SAAS,EAAE;gBAC5B,sBAAsB,CAAC,MAAM,CAAC;AAC9B,gBAAA,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE;YACH;AACA,YAAA,MAAM,6BAA6B,CACjC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EACjD,QAAQ,EACR,UAAU,CACX;QACH;QACA,sBAAsB,CAAC,MAAM,CAAC;IAChC;AACF;;;;"}
@@ -2,19 +2,21 @@ import type { ITtscProjectMembershipPolicy } from "../../tsconfig/ITtscProjectMe
2
2
  /**
3
3
  * Whether a bare filename has an extension admitted by the project policy.
4
4
  *
5
- * @evidence contracts/common.md#principled-implementation Case-normalized suffix matching applies the policy's admitted extension list; this is an eligibility approximation, not filesystem path identity.
6
- * @evidence contracts/common.md#clear-and-simple-design One lowercased name and an early-terminating suffix scan represent the extension rule without performing filesystem work.
5
+ * Literal expressions preserve Unicode simple case folding without expanding or
6
+ * contextually lowercasing either operand. This remains conservative root
7
+ * eligibility, independently of filesystem identity or compiler enumeration.
8
+ *
9
+ * @evidence contracts/common.md#principled-implementation Escaped literal suffixes use Unicode simple folding and a strict end boundary; this preserves dotted I and contextual sigma without treating mapper punctuation as regex grammar.
10
+ * @evidence contracts/common.md#clear-and-simple-design One weakly owned expression list per immutable policy serves an early-terminating suffix scan without filesystem work.
7
11
  * @evidence contracts/common.md#prohibited-implementation-shortcuts The predicate uses compiler-derived extension policy rather than selected test filenames or bundler output-directory exceptions.
8
12
  * @evidence contracts/common.md#meaningful-documentation The native comment states the bare-name input and policy boundary, avoiding an ambiguous reference to another helper's question.
9
- * @evidenceExclude contracts/portability.md#os-neutral-implementation Compares a lowercased basename suffix with the policy's extensions; it reads no filesystem.
13
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation Compares basename text using literal Unicode suffixes; it reads no filesystem or OS-name policy.
10
14
  * @evidence contracts/performance.md#efficient-algorithms
11
- * Lowercasing scans the filename and allocates its normalized text once.
12
- * The early-terminating scan checks the supplied extension population, with
13
- * suffix comparison cost following the extension text. No filename or
14
- * extension index is rebuilt inside the scan.
15
- * @evidenceExclude contracts/performance.md#reuse-equivalent-work
16
- * Keeps no cache of its own and computes each value once.
17
- * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
18
- * Acquires no handle, timer or retained state of its own.
15
+ * A cold policy compiles its suffix text once. Queries scan the supplied
16
+ * expressions until a match, with literal search work following filename
17
+ * length and suffix text; no authored wildcard or repeated pattern activates
18
+ * backtracking partitions. Retained expression text follows the suffix list.
19
+ * @evidence contracts/performance.md#reuse-equivalent-work Compiled literal expressions are shared only by the same immutable policy identity; changing its suffix list requires a new policy, as other membership matchers require.
20
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The WeakMap retains expressions while their policy remains reachable and does not pin discarded policies; there are no filename histories, handles or timers.
19
21
  */
20
22
  export declare function isPossibleProgramFileName(name: string, policy: ITtscProjectMembershipPolicy): boolean;
@@ -2,19 +2,21 @@ import type { ITtscProjectMembershipPolicy } from "../../tsconfig/ITtscProjectMe
2
2
  /**
3
3
  * Whether a bare filename has an extension admitted by the project policy.
4
4
  *
5
- * @evidence contracts/common.md#principled-implementation Case-normalized suffix matching applies the policy's admitted extension list; this is an eligibility approximation, not filesystem path identity.
6
- * @evidence contracts/common.md#clear-and-simple-design One lowercased name and an early-terminating suffix scan represent the extension rule without performing filesystem work.
5
+ * Literal expressions preserve Unicode simple case folding without expanding or
6
+ * contextually lowercasing either operand. This remains conservative root
7
+ * eligibility, independently of filesystem identity or compiler enumeration.
8
+ *
9
+ * @evidence contracts/common.md#principled-implementation Escaped literal suffixes use Unicode simple folding and a strict end boundary; this preserves dotted I and contextual sigma without treating mapper punctuation as regex grammar.
10
+ * @evidence contracts/common.md#clear-and-simple-design One weakly owned expression list per immutable policy serves an early-terminating suffix scan without filesystem work.
7
11
  * @evidence contracts/common.md#prohibited-implementation-shortcuts The predicate uses compiler-derived extension policy rather than selected test filenames or bundler output-directory exceptions.
8
12
  * @evidence contracts/common.md#meaningful-documentation The native comment states the bare-name input and policy boundary, avoiding an ambiguous reference to another helper's question.
9
- * @evidenceExclude contracts/portability.md#os-neutral-implementation Compares a lowercased basename suffix with the policy's extensions; it reads no filesystem.
13
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation Compares basename text using literal Unicode suffixes; it reads no filesystem or OS-name policy.
10
14
  * @evidence contracts/performance.md#efficient-algorithms
11
- * Lowercasing scans the filename and allocates its normalized text once.
12
- * The early-terminating scan checks the supplied extension population, with
13
- * suffix comparison cost following the extension text. No filename or
14
- * extension index is rebuilt inside the scan.
15
- * @evidenceExclude contracts/performance.md#reuse-equivalent-work
16
- * Keeps no cache of its own and computes each value once.
17
- * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
18
- * Acquires no handle, timer or retained state of its own.
15
+ * A cold policy compiles its suffix text once. Queries scan the supplied
16
+ * expressions until a match, with literal search work following filename
17
+ * length and suffix text; no authored wildcard or repeated pattern activates
18
+ * backtracking partitions. Retained expression text follows the suffix list.
19
+ * @evidence contracts/performance.md#reuse-equivalent-work Compiled literal expressions are shared only by the same immutable policy identity; changing its suffix list requires a new policy, as other membership matchers require.
20
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The WeakMap retains expressions while their policy remains reachable and does not pin discarded policies; there are no filename histories, handles or timers.
19
21
  */
20
22
  export declare function isPossibleProgramFileName(name: string, policy: ITtscProjectMembershipPolicy): boolean;
@@ -2,19 +2,21 @@ import type { ITtscProjectMembershipPolicy } from "../../tsconfig/ITtscProjectMe
2
2
  /**
3
3
  * Whether a bare filename has an extension admitted by the project policy.
4
4
  *
5
- * @evidence contracts/common.md#principled-implementation Case-normalized suffix matching applies the policy's admitted extension list; this is an eligibility approximation, not filesystem path identity.
6
- * @evidence contracts/common.md#clear-and-simple-design One lowercased name and an early-terminating suffix scan represent the extension rule without performing filesystem work.
5
+ * Literal expressions preserve Unicode simple case folding without expanding or
6
+ * contextually lowercasing either operand. This remains conservative root
7
+ * eligibility, independently of filesystem identity or compiler enumeration.
8
+ *
9
+ * @evidence contracts/common.md#principled-implementation Escaped literal suffixes use Unicode simple folding and a strict end boundary; this preserves dotted I and contextual sigma without treating mapper punctuation as regex grammar.
10
+ * @evidence contracts/common.md#clear-and-simple-design One weakly owned expression list per immutable policy serves an early-terminating suffix scan without filesystem work.
7
11
  * @evidence contracts/common.md#prohibited-implementation-shortcuts The predicate uses compiler-derived extension policy rather than selected test filenames or bundler output-directory exceptions.
8
12
  * @evidence contracts/common.md#meaningful-documentation The native comment states the bare-name input and policy boundary, avoiding an ambiguous reference to another helper's question.
9
- * @evidenceExclude contracts/portability.md#os-neutral-implementation Compares a lowercased basename suffix with the policy's extensions; it reads no filesystem.
13
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation Compares basename text using literal Unicode suffixes; it reads no filesystem or OS-name policy.
10
14
  * @evidence contracts/performance.md#efficient-algorithms
11
- * Lowercasing scans the filename and allocates its normalized text once.
12
- * The early-terminating scan checks the supplied extension population, with
13
- * suffix comparison cost following the extension text. No filename or
14
- * extension index is rebuilt inside the scan.
15
- * @evidenceExclude contracts/performance.md#reuse-equivalent-work
16
- * Keeps no cache of its own and computes each value once.
17
- * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
18
- * Acquires no handle, timer or retained state of its own.
15
+ * A cold policy compiles its suffix text once. Queries scan the supplied
16
+ * expressions until a match, with literal search work following filename
17
+ * length and suffix text; no authored wildcard or repeated pattern activates
18
+ * backtracking partitions. Retained expression text follows the suffix list.
19
+ * @evidence contracts/performance.md#reuse-equivalent-work Compiled literal expressions are shared only by the same immutable policy identity; changing its suffix list requires a new policy, as other membership matchers require.
20
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The WeakMap retains expressions while their policy remains reachable and does not pin discarded policies; there are no filename histories, handles or timers.
19
21
  */
20
22
  export declare function isPossibleProgramFileName(name: string, policy: ITtscProjectMembershipPolicy): boolean;
@@ -3,25 +3,33 @@
3
3
  /**
4
4
  * Whether a bare filename has an extension admitted by the project policy.
5
5
  *
6
- * @evidence contracts/common.md#principled-implementation Case-normalized suffix matching applies the policy's admitted extension list; this is an eligibility approximation, not filesystem path identity.
7
- * @evidence contracts/common.md#clear-and-simple-design One lowercased name and an early-terminating suffix scan represent the extension rule without performing filesystem work.
6
+ * Literal expressions preserve Unicode simple case folding without expanding or
7
+ * contextually lowercasing either operand. This remains conservative root
8
+ * eligibility, independently of filesystem identity or compiler enumeration.
9
+ *
10
+ * @evidence contracts/common.md#principled-implementation Escaped literal suffixes use Unicode simple folding and a strict end boundary; this preserves dotted I and contextual sigma without treating mapper punctuation as regex grammar.
11
+ * @evidence contracts/common.md#clear-and-simple-design One weakly owned expression list per immutable policy serves an early-terminating suffix scan without filesystem work.
8
12
  * @evidence contracts/common.md#prohibited-implementation-shortcuts The predicate uses compiler-derived extension policy rather than selected test filenames or bundler output-directory exceptions.
9
13
  * @evidence contracts/common.md#meaningful-documentation The native comment states the bare-name input and policy boundary, avoiding an ambiguous reference to another helper's question.
10
- * @evidenceExclude contracts/portability.md#os-neutral-implementation Compares a lowercased basename suffix with the policy's extensions; it reads no filesystem.
14
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation Compares basename text using literal Unicode suffixes; it reads no filesystem or OS-name policy.
11
15
  * @evidence contracts/performance.md#efficient-algorithms
12
- * Lowercasing scans the filename and allocates its normalized text once.
13
- * The early-terminating scan checks the supplied extension population, with
14
- * suffix comparison cost following the extension text. No filename or
15
- * extension index is rebuilt inside the scan.
16
- * @evidenceExclude contracts/performance.md#reuse-equivalent-work
17
- * Keeps no cache of its own and computes each value once.
18
- * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
19
- * Acquires no handle, timer or retained state of its own.
16
+ * A cold policy compiles its suffix text once. Queries scan the supplied
17
+ * expressions until a match, with literal search work following filename
18
+ * length and suffix text; no authored wildcard or repeated pattern activates
19
+ * backtracking partitions. Retained expression text follows the suffix list.
20
+ * @evidence contracts/performance.md#reuse-equivalent-work Compiled literal expressions are shared only by the same immutable policy identity; changing its suffix list requires a new policy, as other membership matchers require.
21
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The WeakMap retains expressions while their policy remains reachable and does not pin discarded policies; there are no filename histories, handles or timers.
20
22
  */
21
23
  function isPossibleProgramFileName(name, policy) {
22
- const lowered = name.toLowerCase();
23
- return policy.inputExtensions.some((extension) => lowered.endsWith(extension));
24
+ let patterns = compiled.get(policy);
25
+ if (patterns === undefined) {
26
+ patterns = policy.inputExtensions.map((extension) => new RegExp(`${extension.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&")}(?![\\s\\S])`, "iu"));
27
+ compiled.set(policy, patterns);
28
+ }
29
+ return patterns.some((pattern) => pattern.test(name));
24
30
  }
31
+ /** Literal suffix expressions owned weakly by immutable membership policy. */
32
+ const compiled = new WeakMap();
25
33
 
26
34
  exports.isPossibleProgramFileName = isPossibleProgramFileName;
27
35
  //# sourceMappingURL=isPossibleProgramFileName.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPossibleProgramFileName.js","sources":["../../../../src/core/transform/project/isPossibleProgramFileName.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;AAiBG;AACG,SAAU,yBAAyB,CACvC,IAAY,EACZ,MAAoC,EAAA;AAEpC,IAAA,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE;AAClC,IAAA,OAAO,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,SAAS,KAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAC5B;AACH;;;;"}
1
+ {"version":3,"file":"isPossibleProgramFileName.js","sources":["../../../../src/core/transform/project/isPossibleProgramFileName.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;AAmBG;AACG,SAAU,yBAAyB,CACvC,IAAY,EACZ,MAAoC,EAAA;IAEpC,IAAI,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;AACnC,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AAC1B,QAAA,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,GAAG,CACnC,CAAC,SAAS,KACR,IAAI,MAAM,CACR,CAAA,EAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA,YAAA,CAAc,EACjE,IAAI,CACL,CACJ;AACD,QAAA,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC;IAChC;AACA,IAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvD;AAEA;AACA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAmD;;;;"}
@@ -1,25 +1,33 @@
1
1
  /**
2
2
  * Whether a bare filename has an extension admitted by the project policy.
3
3
  *
4
- * @evidence contracts/common.md#principled-implementation Case-normalized suffix matching applies the policy's admitted extension list; this is an eligibility approximation, not filesystem path identity.
5
- * @evidence contracts/common.md#clear-and-simple-design One lowercased name and an early-terminating suffix scan represent the extension rule without performing filesystem work.
4
+ * Literal expressions preserve Unicode simple case folding without expanding or
5
+ * contextually lowercasing either operand. This remains conservative root
6
+ * eligibility, independently of filesystem identity or compiler enumeration.
7
+ *
8
+ * @evidence contracts/common.md#principled-implementation Escaped literal suffixes use Unicode simple folding and a strict end boundary; this preserves dotted I and contextual sigma without treating mapper punctuation as regex grammar.
9
+ * @evidence contracts/common.md#clear-and-simple-design One weakly owned expression list per immutable policy serves an early-terminating suffix scan without filesystem work.
6
10
  * @evidence contracts/common.md#prohibited-implementation-shortcuts The predicate uses compiler-derived extension policy rather than selected test filenames or bundler output-directory exceptions.
7
11
  * @evidence contracts/common.md#meaningful-documentation The native comment states the bare-name input and policy boundary, avoiding an ambiguous reference to another helper's question.
8
- * @evidenceExclude contracts/portability.md#os-neutral-implementation Compares a lowercased basename suffix with the policy's extensions; it reads no filesystem.
12
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation Compares basename text using literal Unicode suffixes; it reads no filesystem or OS-name policy.
9
13
  * @evidence contracts/performance.md#efficient-algorithms
10
- * Lowercasing scans the filename and allocates its normalized text once.
11
- * The early-terminating scan checks the supplied extension population, with
12
- * suffix comparison cost following the extension text. No filename or
13
- * extension index is rebuilt inside the scan.
14
- * @evidenceExclude contracts/performance.md#reuse-equivalent-work
15
- * Keeps no cache of its own and computes each value once.
16
- * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
17
- * Acquires no handle, timer or retained state of its own.
14
+ * A cold policy compiles its suffix text once. Queries scan the supplied
15
+ * expressions until a match, with literal search work following filename
16
+ * length and suffix text; no authored wildcard or repeated pattern activates
17
+ * backtracking partitions. Retained expression text follows the suffix list.
18
+ * @evidence contracts/performance.md#reuse-equivalent-work Compiled literal expressions are shared only by the same immutable policy identity; changing its suffix list requires a new policy, as other membership matchers require.
19
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The WeakMap retains expressions while their policy remains reachable and does not pin discarded policies; there are no filename histories, handles or timers.
18
20
  */
19
21
  function isPossibleProgramFileName(name, policy) {
20
- const lowered = name.toLowerCase();
21
- return policy.inputExtensions.some((extension) => lowered.endsWith(extension));
22
+ let patterns = compiled.get(policy);
23
+ if (patterns === undefined) {
24
+ patterns = policy.inputExtensions.map((extension) => new RegExp(`${extension.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&")}(?![\\s\\S])`, "iu"));
25
+ compiled.set(policy, patterns);
26
+ }
27
+ return patterns.some((pattern) => pattern.test(name));
22
28
  }
29
+ /** Literal suffix expressions owned weakly by immutable membership policy. */
30
+ const compiled = new WeakMap();
23
31
 
24
32
  export { isPossibleProgramFileName };
25
33
  //# sourceMappingURL=isPossibleProgramFileName.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPossibleProgramFileName.mjs","sources":["../../../../src/core/transform/project/isPossibleProgramFileName.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;AAiBG;AACG,SAAU,yBAAyB,CACvC,IAAY,EACZ,MAAoC,EAAA;AAEpC,IAAA,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE;AAClC,IAAA,OAAO,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,SAAS,KAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAC5B;AACH;;;;"}
1
+ {"version":3,"file":"isPossibleProgramFileName.mjs","sources":["../../../../src/core/transform/project/isPossibleProgramFileName.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;AAmBG;AACG,SAAU,yBAAyB,CACvC,IAAY,EACZ,MAAoC,EAAA;IAEpC,IAAI,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;AACnC,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AAC1B,QAAA,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,GAAG,CACnC,CAAC,SAAS,KACR,IAAI,MAAM,CACR,CAAA,EAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA,YAAA,CAAc,EACjE,IAAI,CACL,CACJ;AACD,QAAA,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC;IAChC;AACA,IAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvD;AAEA;AACA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAmD;;;;"}