semantifold 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/README.md +61 -15
  2. package/build/index.d.ts +52 -2
  3. package/build/index.d.ts.map +1 -1
  4. package/build/index.js +60 -8
  5. package/build/src/artifact-path.d.ts +23 -1
  6. package/build/src/artifact-path.d.ts.map +1 -1
  7. package/build/src/artifact-path.js +45 -3
  8. package/build/src/artifacts.d.ts.map +1 -1
  9. package/build/src/artifacts.js +66 -1
  10. package/build/src/backends/android.d.ts +49 -0
  11. package/build/src/backends/android.d.ts.map +1 -0
  12. package/build/src/backends/android.js +1274 -0
  13. package/build/src/backends/c-validation.d.ts.map +1 -1
  14. package/build/src/backends/c-validation.js +7 -3
  15. package/build/src/backends/cpp-validation.d.ts.map +1 -1
  16. package/build/src/backends/cpp-validation.js +7 -3
  17. package/build/src/backends/csharp.js +7 -1
  18. package/build/src/backends/dart-runtime.d.ts +2 -0
  19. package/build/src/backends/dart-runtime.d.ts.map +1 -0
  20. package/build/src/backends/dart-runtime.js +41 -0
  21. package/build/src/backends/dart.d.ts +20 -0
  22. package/build/src/backends/dart.d.ts.map +1 -0
  23. package/build/src/backends/dart.js +321 -0
  24. package/build/src/backends/effects.d.ts +60 -0
  25. package/build/src/backends/effects.d.ts.map +1 -0
  26. package/build/src/backends/effects.js +746 -0
  27. package/build/src/backends/go.js +18 -4
  28. package/build/src/backends/identifiers.d.ts +36 -4
  29. package/build/src/backends/identifiers.d.ts.map +1 -1
  30. package/build/src/backends/identifiers.js +160 -10
  31. package/build/src/backends/index.d.ts.map +1 -1
  32. package/build/src/backends/index.js +27 -4
  33. package/build/src/backends/ios.d.ts +68 -0
  34. package/build/src/backends/ios.d.ts.map +1 -0
  35. package/build/src/backends/ios.js +1503 -0
  36. package/build/src/backends/java.d.ts.map +1 -1
  37. package/build/src/backends/java.js +429 -36
  38. package/build/src/backends/javascript.d.ts +6 -0
  39. package/build/src/backends/javascript.d.ts.map +1 -1
  40. package/build/src/backends/javascript.js +380 -24
  41. package/build/src/backends/kotlin-runtime.d.ts +3 -0
  42. package/build/src/backends/kotlin-runtime.d.ts.map +1 -0
  43. package/build/src/backends/kotlin-runtime.js +29 -0
  44. package/build/src/backends/kotlin.d.ts +33 -0
  45. package/build/src/backends/kotlin.d.ts.map +1 -0
  46. package/build/src/backends/kotlin.js +138 -0
  47. package/build/src/backends/native-validation.d.ts +2 -2
  48. package/build/src/backends/native-validation.d.ts.map +1 -1
  49. package/build/src/backends/native-validation.js +2 -2
  50. package/build/src/backends/ordered-expressions.d.ts.map +1 -1
  51. package/build/src/backends/ordered-expressions.js +39 -7
  52. package/build/src/backends/php-stdlib-support.d.ts +19 -0
  53. package/build/src/backends/php-stdlib-support.d.ts.map +1 -0
  54. package/build/src/backends/php-stdlib-support.js +227 -0
  55. package/build/src/backends/php.d.ts.map +1 -1
  56. package/build/src/backends/php.js +448 -33
  57. package/build/src/backends/program.d.ts +83 -0
  58. package/build/src/backends/program.d.ts.map +1 -0
  59. package/build/src/backends/program.js +1309 -0
  60. package/build/src/backends/python.js +7 -1
  61. package/build/src/backends/ruby.d.ts.map +1 -1
  62. package/build/src/backends/ruby.js +310 -24
  63. package/build/src/backends/rust-runtime.d.ts +7 -0
  64. package/build/src/backends/rust-runtime.d.ts.map +1 -0
  65. package/build/src/backends/rust-runtime.js +32 -0
  66. package/build/src/backends/rust-validation.d.ts +9 -0
  67. package/build/src/backends/rust-validation.d.ts.map +1 -0
  68. package/build/src/backends/rust-validation.js +78 -0
  69. package/build/src/backends/rust.d.ts +24 -0
  70. package/build/src/backends/rust.d.ts.map +1 -0
  71. package/build/src/backends/rust.js +344 -0
  72. package/build/src/backends/scalars.d.ts +14 -6
  73. package/build/src/backends/scalars.d.ts.map +1 -1
  74. package/build/src/backends/scalars.js +167 -17
  75. package/build/src/backends/shared.d.ts +23 -4
  76. package/build/src/backends/shared.d.ts.map +1 -1
  77. package/build/src/backends/shared.js +2174 -62
  78. package/build/src/backends/stdlib-support.d.ts +14 -0
  79. package/build/src/backends/stdlib-support.d.ts.map +1 -0
  80. package/build/src/backends/stdlib-support.js +237 -0
  81. package/build/src/backends/swift-runtime.d.ts +3 -0
  82. package/build/src/backends/swift-runtime.d.ts.map +1 -0
  83. package/build/src/backends/swift-runtime.js +14 -0
  84. package/build/src/backends/swift.d.ts +8 -0
  85. package/build/src/backends/swift.d.ts.map +1 -0
  86. package/build/src/backends/swift.js +127 -0
  87. package/build/src/backends/typescript.d.ts.map +1 -1
  88. package/build/src/backends/typescript.js +344 -24
  89. package/build/src/backends/wasm.d.ts +43 -0
  90. package/build/src/backends/wasm.d.ts.map +1 -0
  91. package/build/src/backends/wasm.js +2164 -0
  92. package/build/src/backends/writer.d.ts +255 -4
  93. package/build/src/backends/writer.d.ts.map +1 -1
  94. package/build/src/backends/writer.js +491 -3
  95. package/build/src/diagnostic.d.ts +4 -3
  96. package/build/src/diagnostic.d.ts.map +1 -1
  97. package/build/src/diagnostic.js +5 -3
  98. package/build/src/frontends/c.d.ts.map +1 -1
  99. package/build/src/frontends/c.js +5 -3
  100. package/build/src/frontends/cpp.d.ts.map +1 -1
  101. package/build/src/frontends/cpp.js +5 -3
  102. package/build/src/frontends/csharp.d.ts.map +1 -1
  103. package/build/src/frontends/csharp.js +7 -3
  104. package/build/src/frontends/dart.d.ts +10 -0
  105. package/build/src/frontends/dart.d.ts.map +1 -0
  106. package/build/src/frontends/dart.js +913 -0
  107. package/build/src/frontends/index.d.ts +3 -1
  108. package/build/src/frontends/index.d.ts.map +1 -1
  109. package/build/src/frontends/index.js +15 -5
  110. package/build/src/frontends/java.d.ts +110 -1
  111. package/build/src/frontends/java.d.ts.map +1 -1
  112. package/build/src/frontends/java.js +1725 -70
  113. package/build/src/frontends/javascript-typescript.d.ts +69 -1
  114. package/build/src/frontends/javascript-typescript.d.ts.map +1 -1
  115. package/build/src/frontends/javascript-typescript.js +1825 -93
  116. package/build/src/frontends/kotlin.d.ts +10 -0
  117. package/build/src/frontends/kotlin.d.ts.map +1 -0
  118. package/build/src/frontends/kotlin.js +685 -0
  119. package/build/src/frontends/php.d.ts +118 -1
  120. package/build/src/frontends/php.d.ts.map +1 -1
  121. package/build/src/frontends/php.js +1583 -76
  122. package/build/src/frontends/program.d.ts +74 -0
  123. package/build/src/frontends/program.d.ts.map +1 -0
  124. package/build/src/frontends/program.js +989 -0
  125. package/build/src/frontends/ruby.d.ts +68 -1
  126. package/build/src/frontends/ruby.d.ts.map +1 -1
  127. package/build/src/frontends/ruby.js +1446 -101
  128. package/build/src/frontends/rust-parser.d.ts +11 -0
  129. package/build/src/frontends/rust-parser.d.ts.map +1 -0
  130. package/build/src/frontends/rust-parser.js +15 -0
  131. package/build/src/frontends/rust.d.ts +14 -0
  132. package/build/src/frontends/rust.d.ts.map +1 -0
  133. package/build/src/frontends/rust.js +715 -0
  134. package/build/src/frontends/scalars.d.ts +10 -0
  135. package/build/src/frontends/scalars.d.ts.map +1 -1
  136. package/build/src/frontends/scalars.js +28 -2
  137. package/build/src/frontends/swift.d.ts +10 -0
  138. package/build/src/frontends/swift.d.ts.map +1 -0
  139. package/build/src/frontends/swift.js +860 -0
  140. package/build/src/frontends/types.d.ts +186 -0
  141. package/build/src/frontends/types.d.ts.map +1 -0
  142. package/build/src/frontends/types.js +634 -0
  143. package/build/src/language-registry.d.ts +46 -4
  144. package/build/src/language-registry.d.ts.map +1 -1
  145. package/build/src/language-registry.js +177 -13
  146. package/build/src/mapping.d.ts +2 -2
  147. package/build/src/mapping.d.ts.map +1 -1
  148. package/build/src/mapping.js +31 -10
  149. package/build/src/semantic/capabilities.d.ts +66 -0
  150. package/build/src/semantic/capabilities.d.ts.map +1 -0
  151. package/build/src/semantic/capabilities.js +649 -0
  152. package/build/src/semantic/effects.d.ts +26 -0
  153. package/build/src/semantic/effects.d.ts.map +1 -0
  154. package/build/src/semantic/effects.js +764 -0
  155. package/build/src/semantic/generics.d.ts +23 -0
  156. package/build/src/semantic/generics.d.ts.map +1 -0
  157. package/build/src/semantic/generics.js +61 -0
  158. package/build/src/semantic/lifetime.d.ts +37 -0
  159. package/build/src/semantic/lifetime.d.ts.map +1 -0
  160. package/build/src/semantic/lifetime.js +527 -0
  161. package/build/src/semantic/provenance.d.ts +9 -2
  162. package/build/src/semantic/provenance.d.ts.map +1 -1
  163. package/build/src/semantic/provenance.js +462 -20
  164. package/build/src/semantic/scalars.d.ts +11 -0
  165. package/build/src/semantic/scalars.d.ts.map +1 -1
  166. package/build/src/semantic/scalars.js +16 -1
  167. package/build/src/semantic/stdlib.d.ts +254 -0
  168. package/build/src/semantic/stdlib.d.ts.map +1 -0
  169. package/build/src/semantic/stdlib.js +880 -0
  170. package/build/src/semantic/types.d.ts +3108 -178
  171. package/build/src/semantic/types.d.ts.map +1 -1
  172. package/build/src/semantic/types.js +730 -15
  173. package/build/src/semantic/validate.d.ts +85 -5
  174. package/build/src/semantic/validate.d.ts.map +1 -1
  175. package/build/src/semantic/validate.js +2576 -98
  176. package/build/src/stdlib-facades.d.ts +304 -0
  177. package/build/src/stdlib-facades.d.ts.map +1 -0
  178. package/build/src/stdlib-facades.js +1167 -0
  179. package/build/src/stdlib-negotiation.d.ts +69 -0
  180. package/build/src/stdlib-negotiation.d.ts.map +1 -0
  181. package/build/src/stdlib-negotiation.js +403 -0
  182. package/build/src/stdlib-providers.d.ts +72 -0
  183. package/build/src/stdlib-providers.d.ts.map +1 -0
  184. package/build/src/stdlib-providers.js +339 -0
  185. package/build/src/toolchains.d.ts +55 -1
  186. package/build/src/toolchains.d.ts.map +1 -1
  187. package/build/src/toolchains.js +15 -4
  188. package/docs/android.md +79 -0
  189. package/docs/architecture.md +47 -13
  190. package/docs/dart.md +60 -0
  191. package/docs/goals.md +3 -3
  192. package/docs/ios.md +121 -0
  193. package/docs/kotlin.md +42 -0
  194. package/docs/language-support.md +238 -26
  195. package/docs/multi-file-modules.md +52 -0
  196. package/docs/parser-qualification.md +121 -8
  197. package/docs/plans/2026-09-05-standard-library-portability.md +10 -10
  198. package/docs/rust.md +88 -0
  199. package/docs/source-maps.md +17 -7
  200. package/docs/specification.md +5 -0
  201. package/docs/standard-library-portability.md +39 -8
  202. package/docs/swift.md +44 -0
  203. package/docs/testing.md +381 -4
  204. package/docs/webassembly.md +52 -0
  205. package/index.js +66 -8
  206. package/node_modules/semantifold-tree-sitter-legacy-internal/README.md +2 -2
  207. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/LICENSE +21 -0
  208. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/README.md +45 -0
  209. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/binding.gyp +30 -0
  210. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/bindings/node/binding.cc +20 -0
  211. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/bindings/node/binding_test.js +9 -0
  212. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/bindings/node/index.d.ts +28 -0
  213. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/bindings/node/index.js +11 -0
  214. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/grammar.js +1630 -0
  215. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/package.json +64 -0
  216. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/prebuilds/darwin-arm64/tree-sitter-rust.node +0 -0
  217. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/prebuilds/darwin-x64/tree-sitter-rust.node +0 -0
  218. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/prebuilds/linux-arm64/tree-sitter-rust.node +0 -0
  219. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/prebuilds/linux-x64/tree-sitter-rust.node +0 -0
  220. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/prebuilds/win32-arm64/tree-sitter-rust.node +0 -0
  221. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/prebuilds/win32-x64/tree-sitter-rust.node +0 -0
  222. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/queries/highlights.scm +159 -0
  223. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/queries/injections.scm +9 -0
  224. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/queries/tags.scm +60 -0
  225. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/src/grammar.json +9405 -0
  226. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/src/node-types.json +5399 -0
  227. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/src/parser.c +192569 -0
  228. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/src/scanner.c +393 -0
  229. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/src/tree_sitter/alloc.h +54 -0
  230. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/src/tree_sitter/array.h +290 -0
  231. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/src/tree_sitter/parser.h +266 -0
  232. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/tree-sitter-rust.wasm +0 -0
  233. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-rust/tree-sitter.json +53 -0
  234. package/node_modules/semantifold-tree-sitter-legacy-internal/package.json +3 -2
  235. package/node_modules/semantifold-tree-sitter-legacy-internal/src/c.js +5 -4
  236. package/package.json +5 -2
  237. package/src/artifact-path.js +47 -2
  238. package/src/artifacts.js +67 -0
  239. package/src/backends/android.js +1370 -0
  240. package/src/backends/c-validation.js +6 -1
  241. package/src/backends/cpp-validation.js +6 -1
  242. package/src/backends/csharp.js +3 -0
  243. package/src/backends/dart-runtime.js +41 -0
  244. package/src/backends/dart.js +326 -0
  245. package/src/backends/effects.js +705 -0
  246. package/src/backends/go.js +14 -2
  247. package/src/backends/identifiers.js +166 -9
  248. package/src/backends/index.js +27 -2
  249. package/src/backends/ios.js +1612 -0
  250. package/src/backends/java.js +454 -36
  251. package/src/backends/javascript.js +389 -23
  252. package/src/backends/kotlin-runtime.js +29 -0
  253. package/src/backends/kotlin.js +144 -0
  254. package/src/backends/native-validation.js +1 -1
  255. package/src/backends/ordered-expressions.js +40 -6
  256. package/src/backends/php-stdlib-support.js +239 -0
  257. package/src/backends/php.js +469 -32
  258. package/src/backends/program.js +1408 -0
  259. package/src/backends/python.js +3 -0
  260. package/src/backends/ruby.js +326 -23
  261. package/src/backends/rust-runtime.js +34 -0
  262. package/src/backends/rust-validation.js +75 -0
  263. package/src/backends/rust.js +335 -0
  264. package/src/backends/scalars.js +141 -16
  265. package/src/backends/shared.js +2314 -115
  266. package/src/backends/stdlib-support.js +234 -0
  267. package/src/backends/swift-runtime.js +14 -0
  268. package/src/backends/swift.js +132 -0
  269. package/src/backends/typescript.js +349 -23
  270. package/src/backends/wasm.js +2208 -0
  271. package/src/backends/writer.js +545 -2
  272. package/src/diagnostic.js +4 -2
  273. package/src/frontends/c.js +4 -2
  274. package/src/frontends/cpp.js +4 -2
  275. package/src/frontends/csharp.js +4 -2
  276. package/src/frontends/dart.js +963 -0
  277. package/src/frontends/index.js +14 -4
  278. package/src/frontends/java.js +1977 -69
  279. package/src/frontends/javascript-typescript.js +2046 -102
  280. package/src/frontends/kotlin.js +713 -0
  281. package/src/frontends/php.js +1725 -79
  282. package/src/frontends/program.js +1062 -0
  283. package/src/frontends/ruby.js +1624 -98
  284. package/src/frontends/rust-parser.js +18 -0
  285. package/src/frontends/rust.js +714 -0
  286. package/src/frontends/scalars.js +31 -1
  287. package/src/frontends/swift.js +893 -0
  288. package/src/frontends/types.js +750 -0
  289. package/src/language-registry.js +182 -12
  290. package/src/mapping.js +33 -9
  291. package/src/semantic/capabilities.js +671 -0
  292. package/src/semantic/effects.js +737 -0
  293. package/src/semantic/generics.js +58 -0
  294. package/src/semantic/lifetime.js +517 -0
  295. package/src/semantic/provenance.js +412 -19
  296. package/src/semantic/scalars.js +17 -0
  297. package/src/semantic/stdlib.js +921 -0
  298. package/src/semantic/types.js +810 -14
  299. package/src/semantic/validate.js +2934 -209
  300. package/src/stdlib-facades.js +1211 -0
  301. package/src/stdlib-negotiation.js +446 -0
  302. package/src/stdlib-providers.js +377 -0
  303. package/src/toolchains.js +16 -3
package/docs/dart.md ADDED
@@ -0,0 +1,60 @@
1
+ # Dart source and target
2
+
3
+ Task 029 adds `dart` as Semantifold's fourteenth parser-native source/text language. It round-trips the Tasks 001–005 semantic profile through a deterministic dependency-free Dart VM/native package. The implementation and exact Dart 3.13.3 local acceptance are complete; independent review, exact-head TensorBuzz CI, merge, and post-merge verification remain pending.
4
+
5
+ ## Source profile
6
+
7
+ The frontend accepts one directive-free compilation unit containing synchronous top-level functions followed by exactly one `void main()`. Functions use explicit `int`, `bool`, `String`, or `void` returns and zero or more explicitly typed required positional parameters. Statements are initialized `final Type name = value;` or mutable `Type name = value;` locals, simple identifier assignment, strict-Boolean `if`/`else if`/`else`, explicit value or bare returns, resolved void-call expression statements, and exact `print(value);`. Expressions are scalar literals, identifiers, parentheses, direct resolved calls, and the Tasks 001–005 unary/binary operations. Strings are ordinary noninterpolated quoted strings with the implemented escapes and valid Unicode scalar values.
8
+
9
+ Every named, anonymous, extra, field, error, and missing CST edge is traversed. Parser recovery is `PARSE_ERROR`; missing explicit types use `MISSING_TYPE`; valid Dart outside the profile uses located `UNSUPPORTED_SYNTAX`. Ordinary comments may be ignored only after complete traversal. Parser trees stay inside `src/frontends/dart.js`.
10
+
11
+ Inference, `var`, inferred `final`, `const`, `late`, `dynamic`, `Object`, `num`, `double`, user `BigInt`, nullability, named/optional/default parameters or arguments, generics, methods/classes/mixins/extensions/enums/records, closures/tear-offs, casts/type tests, interpolation, raw/multiline strings, collections, loops/switch/assert, exceptions, async/futures/streams/isolates, directives/imports, annotations, external/operator/getter/setter declarations, cascades, and null-aware syntax are rejected. Exact `_` is a Dart 3 wildcard rather than a binding and is rejected for semantic function, parameter, and local names; ordinary identifiers such as `_value` remain available. Exact lowercase `// dart format off` and `// dart format on` comments are rejected as formatter directives, while case or spacing near-misses remain ordinary comments. Flutter and browser/JavaScript Dart are separate work.
12
+
13
+ ## Qualified parser
14
+
15
+ The exact dependency is public registry `tree-sitter-dart-orchard@0.7.0`, tarball `https://registry.npmjs.org/tree-sitter-dart-orchard/-/tree-sitter-dart-orchard-0.7.0.tgz`, integrity `sha512-dO4hyC6eCz7tnXNWk7ZZ/CVzorvWQKRhxRYUT/uwAnA50m+4Jbogd1Oh33lPcj1/bP9wG1pS3TWQEfs1W3LFbg==`, and MIT license. Immutable annotated tag `v0.7.0` peels to commit/npm `gitHead` `9322cd5e1266c60983ae0ff921fbb4e77e903781`. Its ABI 14 language object, typed 359-entry node metadata, local native source, lifecycle, signatures, complete corpus traversal, recovery, coordinates, clean ordinary install/`npm ci`, and credential-free packed-consumer behavior pass with Node 24 and exact root `tree-sitter@0.25.1`.
16
+
17
+ Unscoped `tree-sitter-dart@1.0.0` is rejected because its language object is incompatible with the root binding. `@driftlog/tree-sitter-dart@1.0.4` is rejected because a clean install leaves undeclared extraneous `@driftlog/node-addon-api` residue. No cleanup hook, Git/archive dependency, copied or vendored parser, source-text fallback, compiler-output AST, or private package replaces either failure. See [parser qualification](parser-qualification.md#task-029-dart-grammar-qualification--2026-09-15).
18
+
19
+ ## Generated package and public API
20
+
21
+ Use `generateArtifactSet({language: "dart", module})`. The ordered result is exactly:
22
+
23
+ 1. `pubspec.yaml` — `manifest`, `application/yaml`, synthetic configuration provenance;
24
+ 2. `pubspec.lock` — `manifest`, `application/yaml`, deterministic synthetic provenance;
25
+ 3. `bin/program.dart` — sole `entry`, `text/x-dart`, rich mapping and Source Map v3 provenance.
26
+
27
+ The fixed package is named `semantifold_generated`, has `publish_to: none`, declares exact SDK `3.13.3`, has no dependencies, and emits the deterministic empty-package lockfile. `.dart_tool/`, SDK files, caches, and compiled executables are never artifacts. Omitted `filename` selects `bin/program.dart`; any other filename or any map-directive/source-map filename option fails transactionally with `UNSUPPORTED_CAPABILITY`. Because Dart is multi-artifact, `generate()` and `generateArtifact()` reject it with `UNSUPPORTED_ROLE`.
28
+
29
+ Generation validates the whole module before writer allocation, including types, required arity, complete call resolutions, identifiers, compiler-owned name collisions, safe known arithmetic, graph bounds, and Task 006+ exclusions. Over-width signatures use Dart 3.13.3's canonical one-parameter-per-line form with a trailing comma while preserving parameter type/name mappings. Repeated generation is byte-identical across paths, contents, mappings, Source Map v3, and metadata.
30
+
31
+ ## Safe integers and generated support
32
+
33
+ Semantic integers remain within `[-9007199254740991, 9007199254740991]`. Literals and statically known arithmetic outside that range fail before artifact allocation. Dynamic integer add, subtract, multiply, and negate use exact private compiler-owned helpers that calculate in `BigInt`, range-check, and convert to `int`. A private Boolean identity helper prevents Dart analyzer constant folding from reporting valid short-circuit branches as dead code; it does not change left-to-right or short-circuit evaluation. When an accepted initialized local has no semantic read, generation preserves its declaration and initializer effects, then emits one synthetic private no-op read so fatal Dart analysis remains clean.
34
+
35
+ The frontend recognizes these calls only after recursively matching the complete canonical runtime CST—node type, named/extra state, child count, field names, and leaf text. Partial, reordered, renamed, duplicated, or token-modified support fails. The exact no-op local read is removed only when it immediately follows its matching declaration behind that authenticated prefix, so generated reparse reconstructs the original semantic block. User source cannot name the helpers, `BigInt`, `RangeError`, or runtime constants. Formatter-required trailing commas in generated formal parameter and call lists are accepted only behind this authenticated generated-runtime route.
36
+
37
+ ## Mappings
38
+
39
+ `bin/program.dart` maps function names, parameter/local types and names, assignments, operators, calls and arguments, literals, print, returns, and entry statements to semantic/source origins. Formatting, the runtime prefix, manifest content, lockfile content, and fixed main shell are explicitly synthetic with related origins. Its embedded Source Map v3 names `bin/program.dart`; Dart emits no source-map directive or `.map` artifact. See [source provenance and mappings](source-maps.md).
40
+
41
+ ## Exact toolchain and offline acceptance
42
+
43
+ The canonical Docker and TensorBuzz lanes install the official stable Linux x64 Dart SDK 3.13.3 ZIP under `/opt/dart-sdk-3.13.3`, verify SHA-256 `549c182cffbdc6864df7509c16fec646c73fe6cb8a18c2cb572db1292f300cd7`, and require:
44
+
45
+ ```text
46
+ Dart SDK version: 3.13.3 (stable) (Tue Sep 1 01:07:17 2026 -0700) on "linux_x64"
47
+ ```
48
+
49
+ `SEMANTIFOLD_DART` may select only an executable matching that identity. Each acceptance run owns fresh absolute HOME, PUB_CACHE, project, native-output, and TMPDIR paths; sets `CI=true`, `DART_SUPPRESS_ANALYTICS=true`, `LANG=C.UTF-8`, `LC_ALL=C.UTF-8`, and `TZ=UTC`; and points `PUB_HOSTED_URL` at an unreachable loopback endpoint. It runs without credentials or ambient Dart/pub configuration:
50
+
51
+ ```sh
52
+ dart pub get --offline --no-precompile
53
+ dart format --output=none --set-exit-if-changed bin/program.dart
54
+ dart analyze --fatal-infos --fatal-warnings
55
+ dart run bin/program.dart
56
+ dart compile exe bin/program.dart -o semantifold-dart
57
+ ./semantifold-dart
58
+ ```
59
+
60
+ All three generated artifact hashes remain unchanged after every command; only disposable `.dart_tool/` state and the native executable appear. The six Tasks 001–005 Dart fixtures translate to every compatible target and execute identically on Dart VM/native. Representative PHP, Ruby, JavaScript, TypeScript, and Java fixtures translate into Dart. Additional acceptance proves Unicode, eager argument ordering, direct recursion, void calls, Boolean short-circuiting, and the safe-integer boundary with exact empty stderr and identical VM/native stdout.
package/docs/goals.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Semantifold's long-term goal is a language-neutral toolkit for understanding, transforming, generating, and eventually executing programs through a shared high-level semantic representation. The representation should make types, control flow, calls, declarations, diagnostics, and source provenance understandable without exposing a language parser's private tree.
4
4
 
5
- The current source tree proves one minimal Tasks 001–004 vertical slice across nine registered languages: PHP, Ruby, JavaScript, TypeScript, Java, strictly annotated Python, canonical C#, bounded Go, and C17. It includes versioned source provenance, deterministic semantic node/symbol identity, range-based generated mappings, Source Map v3 interop, composition, and diagnostic remapping across that slice. The published `semantifold@0.2.0` release predates the C#, Go, and C additions. Neither the source tree nor that release provides a general analyzer, transformation API, interpreter, optimizer, project graph, debugger integration, coverage remapping, or lossless formatter.
5
+ The current source tree proves one minimal Tasks 001–004 vertical slice across fourteen registered source languages: PHP, Ruby, JavaScript, TypeScript, Java, Kotlin/JVM, strictly annotated Python, canonical C#, bounded Go, C17, C++20, Rust edition 2021, Swift, and Dart. Dart additionally implements the bounded Task 005 required-function/call profile; the original five retain the delivered Task 013 acceptance gate for the combined Tasks 001–008 profile, Task 009 nominal closed records, Task 010 explicit acyclic multi-source semantic programs, Task 011 exact nominal typed unchecked errors, and Task 012 invariant unbounded function/record type parameters with closed applications and argument-only first-order call inference. Task 014 is delivered through PR #41, Task 032 through PR #42, Task 033 through PR #43, and Task 034 through PR #44. Task 035 is delivered through PR #45 and merge commit `a2aad9d4932bfc6087adc4ff8bca43678c92413c`, with versioned canonical standard-library contracts, target host providers and protected native bindings, capability negotiation, and program-mode provider linking. Task 036 is delivered through PR #46 and merge `9aba48f9d48bcef4fd4c9275aec14bfcc4f0904c`; it adds bounded versioned executable qualification facades and exact parser-backed native identity resolution for the original five. Task 037 adds only the first concrete Ruby-source-to-PHP-target blocking TCP/line-output slice on those foundations. The source tree includes versioned source provenance, deterministic semantic node/symbol identity, range-based generated mappings, Source Map v3 interop, composition, and diagnostic remapping across those bounded profiles. The published `semantifold@0.3.0` release predates these additions. Neither the source tree nor that release provides a general analyzer, transformation API, interpreter, optimizer, implicit project/package discovery, debugger integration, coverage remapping, or lossless formatter.
6
6
 
7
- The long-term product direction includes bounded standard-library portability through [language compatibility stdlib/facades, canonical Semantifold stdlib contracts/capabilities, and target host providers/native bindings](standard-library-portability.md). That direction is incremental and versioned; it does not promise arbitrary standard-library coverage or arbitrary-application translation. The `0.2.0` release has no imports, classes or methods, loops, optional values, typed errors, resources, host APIs, or stdlib portability.
7
+ The long-term product direction includes bounded standard-library portability through [language compatibility stdlib/facades, canonical Semantifold stdlib contracts/capabilities, and target host providers/native bindings](standard-library-portability.md). That direction is incremental and versioned; it does not promise arbitrary standard-library coverage or arbitrary-application translation. The `0.3.0` release has no imports, classes or methods, loops, optional values, typed errors, resources, host APIs, or stdlib portability.
8
8
 
9
- Other roadmap candidates include a versioned fuller semantic schema, more scalar and compound types, expressions and statements, user-authored transformations, richer backend capability negotiation, multi-file modules, cross-language stack/coverage presentation, and a semantic interpreter. LLVM, Wasm, JVM bytecode, package publication automation, and production TensorBuzz changes remain outside the current release.
9
+ Other roadmap candidates include a versioned fuller semantic schema, more scalar and compound types, expressions and statements, user-authored transformations, richer backend capability negotiation, cross-language stack/coverage presentation, and a semantic interpreter. Task 014 owns the only observable ordered-map iteration profile; Task 032 owns exact condition-controlled loops; Task 033 owns only the closed single-module reference-class profile; and Task 034 owns the bounded effect/ownership/close foundation. Task 035 supplies the delivered canonical/provider hub, and Task 036 supplies the delivered neutral qualification facades with exact identity evidence, ordinary compilation, collision-safe aliases, and protected same-language isolation. Task 037's concrete profile is only literal Ruby `require "socket"`, genuine `TCPSocket.new`/`gets`/`close`, and one-string `puts` compiled to protected PHP 8.2 core-stream providers; other sources, targets, networking APIs, output forms, timeouts, async behavior, and pair-specific rewrites remain outside it. LLVM, general Wasm source support, JVM bytecode, package-manager resolution, package publication automation, and production TensorBuzz changes remain outside the current release.
package/docs/ios.md ADDED
@@ -0,0 +1,121 @@
1
+ # iOS application target
2
+
3
+ Task 026 has an implemented Linux-qualified deterministic generation/provenance slice, with materialization and Apple-platform acceptance explicitly deferred. The registered `ios` identity is a target-only application backend: it has no frontend, text backend, binary-backend route, interoperability bridge, provider role, source-discovery behavior, filesystem writer, or entry in `supportedLanguages`. Real Xcode, Apple SDK, XCTest, XCUIAutomation, and iOS Simulator proof has not been run, so the task is not delivered and the generated Xcode model is not yet platform-qualified.
4
+
5
+ ## Public route
6
+
7
+ Callers parse source normally, build an explicit Task 010 program, and request the application role. Omitting `role` retains ordinary text generation. Generation is pure and performs no filesystem access.
8
+
9
+ ```js
10
+ import {generateProgramArtifactSet, parseProgram} from "semantifold"
11
+
12
+ const program = parseProgram({
13
+ entryModule: "main",
14
+ sources: [{
15
+ filename: "main.rb",
16
+ id: "main",
17
+ language: "ruby",
18
+ source: "module Main\n puts 7\nend\n"
19
+ }]
20
+ })
21
+
22
+ const artifactSet = generateProgramArtifactSet({
23
+ configuration: {
24
+ bundleIdentifier: "com.example.semantifold",
25
+ deploymentTarget: "18.0",
26
+ displayName: "Semantifold",
27
+ moduleName: "SemantifoldApp",
28
+ organizationPrefix: "com.example",
29
+ productName: "SemantifoldApp"
30
+ },
31
+ language: "ios",
32
+ program,
33
+ role: "application"
34
+ })
35
+ ```
36
+
37
+ `generateArtifactSet` accepts the same application fields for one semantic module and normalizes it to one project module. Both routes validate the entire semantic graph before rendering. The source registry accepts provenance from every registered frontend language, including compatible Dart modules, while the supported semantics remain exactly the Tasks 001–004 Swift subset from Task 022: typed scalar values, typed locals/assignment, the closed scalar operators, nested statement blocks/conditionals, exact two-argument scalar-return functions, resolved calls, and deterministic text output. Task 010 owns project modules, source ownership, imports, exports, and dependency order. iOS adds no parser rule or semantic node for SwiftUI, application lifecycle, capture, configuration, resources, signing, or Apple APIs.
38
+
39
+ Program-shaped application dispatch is limited to program-capable application targets, currently `ios` and `android`. The separate Wasm application backend remains available through the single-module `generateArtifactSet` route and is rejected with `UNSUPPORTED_ROLE` when requested through `generateProgramArtifactSet`; a program object is never passed to that module backend.
40
+
41
+ Unsupported source or caller-supplied IR produces a located `SemantifoldDiagnostic` with `UNSUPPORTED_CAPABILITY` and target `ios`. The backend never embeds Ruby, invokes a Ruby runtime from the app, translates through JavaScript, emulates dynamic Ruby behavior, or discovers sources/packages.
42
+
43
+ ## Closed configuration and assets
44
+
45
+ The required configuration fields are `productName`, `moduleName`, `organizationPrefix`, `bundleIdentifier`, `deploymentTarget`, and `displayName`. They are caller-owned; no account, team, certificate, provisioning profile, installed SDK, or host path supplies a default. Product and module names are ASCII upper-camel identifiers. Organization and bundle identities are canonical lowercase reverse DNS, and the bundle must extend the organization prefix. Deployment is a canonical caller-supplied `major.minor` string.
46
+
47
+ The only defaults are:
48
+
49
+ | Field | Exact value |
50
+ | --- | --- |
51
+ | `sourceRoot` | `Sources` |
52
+ | `resourceRoot` | `Assets.xcassets` |
53
+ | `lifecycle` | `swiftui` |
54
+ | `infoPlist` | empty object |
55
+ | `permissions` | empty array |
56
+ | `entitlements` | empty array |
57
+ | `privacyDeclarations` | empty array |
58
+ | `capabilities` | empty array |
59
+
60
+ The schema is closed. Unknown fields, any nonempty plist extension/capability set, alternate lifecycle/root, or invalid identity fails before emission. The baseline creates no entitlements file and does not synthesize an icon.
61
+
62
+ Every asset is explicit `{path, content, mediaType, sha256}` input. Its path must use only ASCII letters, digits, `.`, `_`, and `-` in nonempty relative POSIX components below `Assets.xcassets`; this closed alphabet has complete ASCII case-fold comparison. Sharp-S, sigma, composed/decomposed non-ASCII names, traversal, duplicates, case-fold collisions, and file/directory-prefix collisions fail at input validation before an artifact set is returned. This path restriction does not alter Unicode semantic source filenames, source text, string values, or generated Swift content. Asset content is a nonempty exact string or `Uint8Array`, and its lowercase SHA-256 must match the exact UTF-8 text or bytes. Assets are defensively copied and sorted.
63
+
64
+ ## Deterministic artifact contract
65
+
66
+ Generation returns one ordered `GeneratedArtifactSet` with exactly one `entry`, `Sources/Application/App.swift`. The fixed categories are:
67
+
68
+ 1. `<Product>.xcodeproj/project.pbxproj` and its shared scheme;
69
+ 2. `Configuration/Base.xcconfig` and `Configuration/Info.plist`;
70
+ 3. the shared semantic runtime and one namespace-owned Swift file per project module;
71
+ 4. `App.swift`, `SemantifoldBridge.swift`, and `SemantifoldOutputView.swift`;
72
+ 5. base `Assets.xcassets/Contents.json` and exact caller assets;
73
+ 6. pure-logic XCTest and accessibility-route XCUI test sources;
74
+ 7. `semantifold-project.json`.
75
+
76
+ The semantic renderer uses one shared reference-type `SemantifoldOutputSink`. Nested calls receive that same sink, preserving exact evaluation/output order. The semantic entry returns `[String]`; the bridge invokes it; the SwiftUI view joins with one LF and assigns accessibility identifier `semantifold-output`. Per-module Swift lives in deterministic `SemantifoldModule…` namespaces.
77
+
78
+ Xcode object IDs are the uppercase first 24 hexadecimal digits of built-in SHA-256 over normalized, collision-checked full identities. Project sections, groups, build phases, build settings, paths, configuration JSON, and assets have canonical ordering; text uses LF and relative paths. Signing is disabled and no entitlement/team/account/certificate/provision data is emitted. Two generations from the same validated input return byte-identical artifacts. The generated Xcode source/project syntax is deterministic but remains platform-unqualified.
79
+
80
+ ## Manifest and provenance
81
+
82
+ `semantifold-project.json` is `SemantifoldIosProject` version 1. It records generator identity/version, target, the complete normalized configuration, caller source and asset hashes, exact ordered owned paths, explicit excluded path patterns, and Apple tool requirements whose status is `deferred`. Its `SemantifoldIosSemanticProgram` version 1 section preserves caller-order source IDs, filenames, hashes and ownership; dependency-order caller module IDs and import dependencies; source-to-module ownership links; generated namespaces/artifacts; and the selected entry module, generated function, bridge, and application artifact linkage.
83
+
84
+ Mapped semantic Swift retains rich UTF-16 range provenance and Source Map v3 projection through every originating module, including Ruby and Dart. Synthetic runtime, SwiftUI, project, configuration, asset-catalog base metadata, and test scaffolding carry explicit synthetic provenance. Each owning renderer records causal configuration spans while emitting a specific field-derived token; the manifest groups only those ranges with their JSON pointers and never reconstructs ownership through substring scans. Equal module/product values, an organization prefix embedded in a bundle ID, and synthetic text matching the display name therefore cannot create false citations. Exact assets record path, media type, representation, and SHA-256; binary artifact provenance spans every byte.
85
+
86
+ Build products, `DerivedData`, Xcode user data, code signatures, and caller files outside the owned path list are excluded. The manifest is an ownership description, not a filesystem mutation or permission to overwrite or adopt a project.
87
+
88
+ ## Deferred filesystem publication
89
+
90
+ Materialization is deferred and this release exposes no public project writer. Node's public filesystem API does not provide the combination required by the accepted contract: genuine atomic no-replace publication of a complete directory plus descriptor-relative no-follow anchoring for staging, publication, and cleanup. A path preflight followed by ordinary rename can replace a raced empty directory or follow an exchanged ancestor, so it is not retained as best effort.
91
+
92
+ A future materializer requires a separately authorized, reviewed, and platform-qualified native boundary. Until then, generation returns only an immutable in-memory artifact set; no transactional filesystem, regeneration, adoption, merge, or overwrite claim is made.
93
+
94
+ ## Acceptance status
95
+
96
+ | Criterion | Status | Evidence or remaining boundary |
97
+ | --- | --- | --- |
98
+ | AC01 | implemented | Complete Task 010 graph preflight and Tasks 001–004 lowering are focused-spec covered. |
99
+ | AC02 | partial | SwiftUI shell/bridge/view and capture are generated; real Apple compilation is deferred. |
100
+ | AC03 | implemented | Closed caller configuration and identity validation are covered. |
101
+ | AC04 | implemented | Empty capabilities, exact hashed assets, and the complete portable ASCII path boundary are covered. |
102
+ | AC05 | partial | Canonical project, IDs, paths, LF, and double generation are covered; `xcodebuild` validation is deferred. |
103
+ | AC06 | partial | Unit/UI sources and Linux semantic execution exist; real XCTest/XCUI execution is deferred. |
104
+ | AC07 | deferred | No public materializer ships; atomic no-replace plus descriptor-relative no-follow publication requires a separately authorized native boundary. |
105
+ | AC08 | implemented | Ruby/Dart/Swift mapping, renderer-owned configuration spans, stable semantic program identities/linkage, ownership, and asset provenance are covered. |
106
+ | AC09 | partial | Located capability and stable application diagnostics are covered; filesystem safety diagnostics remain deferred with materialization. |
107
+ | AC10 | implemented | Real Ruby output equals generated Swift output in debug and optimized Linux execution. |
108
+ | AC11 | implemented | No VM, runtime emulation, credentials, entitlements, dependencies, signing, or host leakage is emitted. |
109
+ | AC12 | deferred | No qualified macOS/Xcode/Apple SDK/Swift compiler lane has listed or built the project. |
110
+ | AC13 | deferred | No named iOS Simulator has been booted, installed to, or launched. |
111
+ | AC14 | deferred | No XCTest/XCUIAutomation run has observed exact `semantifold-output` text. |
112
+ | AC15 | implemented locally for generator scope | Focused generation and packed-generator proofs are required; materializer/Apple proof and coordinator CI remain deferred or external. |
113
+ | AC16 | implemented for this reduced scope | Public generator contract, provenance, path boundary, deferrals, testing, changelog, task, and roadmap are documented without claiming delivery. |
114
+
115
+ Linux acceptance runs real Ruby and exact Swift 6.3.3 on x86_64 Linux. Generated semantic Swift is typechecked, compiled, and run in debug and optimized modes with exact Unicode/output assertions. The packed proof uses a fresh cache, empty npm configurations, explicit public registry, default `install-links=false`, ordinary install and clean `npm ci`, full dependency listings, repeated deterministic generation/manifest checks, strict type consumption, and proof that no materializer implementation/declaration is shipped. Missing Ruby or Swift commands fail.
116
+
117
+ Kasper separately selected “Defer the materializer and ship the generator/provenance scope,” so AC07 remains deferred without weakening its transaction guarantee. Per Kasper's 2026-09-14 direction to skip OSX work for now, no `xcodebuild`, Apple SDK, signing, runtime download, simulator, XCTest, or XCUIAutomation command was run, and TensorBuzz configuration was not changed to manufacture a lane. AC12–AC14 also remain deferred. Task 026 and its roadmap row therefore remain in progress rather than delivered.
118
+
119
+ ## Non-goals
120
+
121
+ The profile does not support arbitrary Ruby or Swift, UIKit parity, storyboards, platform APIs, storage, networking, concurrency, background modes, package dependencies, CocoaPods/SwiftPM resolution, non-iOS Apple targets, Objective-C/Objective-C++/Metal bridges, signing, physical devices, archives/export, TestFlight, App Store submission, deployment, release, or publication.
package/docs/kotlin.md ADDED
@@ -0,0 +1,42 @@
1
+ # Kotlin/JVM source and target
2
+
3
+ Task023 adds `kotlin` as a frontend and deterministic single-file Kotlin/JVM text backend for exactly the Tasks001–004 semantic subset. It does not claim Android, Gradle, Kotlin/Native, Kotlin/JS, Wasm, multiplatform projects, compiler plugins, package resolution, or Java interoperability beyond executing the generated JVM bytecode. Android application packaging and lifecycle remain Task028.
4
+
5
+ ## Parser route
6
+
7
+ The frontend uses root `tree-sitter@0.25.1` with the MIT-licensed `tree-sitter-kotlin@0.4.0` grammar from the Semantifold packaging fork. The exact dependency is the full-SHA source archive `https://github.com/kaspernj/tree-sitter-kotlin/archive/57c35ad1a80ccd2a0ebd8fffe852f0d13a20acd0.tar.gz`, and the lock records that HTTPS URL with SHA-512 integrity. The commit is also tagged `v0.4.0-semantifold.1`. The fork keeps grammar ABI 14, declares optional peer `tree-sitter@^0.25.1`, ships typed `nodeTypeInfo`, generated parser/scanner sources and the `node-gyp-build` binding, and has no install-time downloader.
8
+
9
+ The root tarball does not bundle the grammar. A credential-free consumer resolves the immutable archive over HTTPS and verifies its lock integrity, while root `acceptDependencies` remains restricted to the exact private legacy-runtime payload. The packed-consumer proof uses empty user/global npm configuration, a fresh cache, the public registry, default `install-links=false`, full dependency listing, ordinary install, clean `npm ci`, strict public API typing, parser loading, and real Kotlin/JVM execution without SSH or credentials.
10
+
11
+ The adapter exhaustively visits every named, anonymous, extra, error, and missing child, verifies parser indexes through the shared UTF-8-byte-to-UTF-16 converter, rejects lone surrogates and recovery, and never scans source text to recover rejected syntax. The parser route, five fixture hashes, CST corpus, coordinates, lifecycle, package boundary, and exact `kotlinc` differential are recorded in [parser qualification](parser-qualification.md).
12
+
13
+ ## Source profile
14
+
15
+ Source consists of one or more top-level semantic `fun` declarations followed by exactly one `fun main()`. A semantic function has exactly two ordinary parameters and explicit `Long`, `Boolean`, or `String` parameter and return types. Calls are direct, positional, and have exactly two arguments. `main` has no parameters or return annotation and contains the sequenced entry statements; printing is direct one-argument `println(...)`.
16
+
17
+ Locals require `val|var name: Long|Boolean|String = expression`. `val` is immutable and `var` is mutable under the shared assignment rules; targets are plain local identifiers. Conditions require semantic `Boolean`. Braced nested and one-armed `if`, `else`, and fallthrough normalize to semantic blocks. Returns are explicit on every reachable function path.
18
+
19
+ The profile accepts safe canonical decimal integers with an optional uppercase `L`, ordinary noninterpolated strings, Boolean literals, identifiers, calls, integer add/subtract/multiply/negate and ordering, Boolean not/short-circuit and/or, same-type scalar equality/inequality, and string concatenation. Ordinary unescaped identifiers follow the qualified grammar's letters/decimal-digits/underscore profile and NFC requirement; unsupported Unicode identifier forms reject before emission rather than failing generated reparse. Types remain exact: there is no numeric widening, conversion, inference, nullable/platform type, unsigned/arbitrary-width number, boxing, or `null` mapping.
20
+
21
+ Packages, imports, annotations, classes/interfaces/data/value classes, objects/companions, extensions, overloads, generics, lambdas, local functions, delegation, casts, smart casts, referential equality, arrays/collections, indexing, ranges, loops, `when`, exceptions, reflection, coroutines/`suspend`, interpolation, raw strings, qualified calls, arbitrary APIs, and locale-dependent formatting are outside the profile. Parser recovery uses `PARSE_ERROR`; omitted required types use `MISSING_TYPE`; other parsed Kotlin outside the profile uses located `UNSUPPORTED_SYNTAX`.
22
+
23
+ ## Generated program
24
+
25
+ The backend emits exactly one LF-normalized `Program.kt`. It preserves explicit scalar types and `val`/`var`, emits uppercase-`L` integer literals, and uses ordinary Kotlin/JVM scalar equality. Native eager operands and call arguments retain left-to-right order, while `&&` and `||` retain native short-circuiting. Private target-only helpers wrap `Math.addExact`, `subtractExact`, `multiplyExact`, and `negateExact`, then check the result against `-9007199254740991L...9007199254740991L`; dynamic overflow therefore cannot silently wrap outside the semantic safe-integer range. Only the complete byte-for-byte helper CST prefix authorizes helper-call collapse during generated reparse. Caller identifiers cannot enter the helper namespace or capture Kotlin/JVM scaffolding.
26
+
27
+ Rich mappings and Source Map v3 cover semantic names, types, literals, callees, and operators. Runtime helpers, separators, braces, `main`, and `println` plumbing are synthetic and related to semantic origins. Generation validates malformed/cyclic/excessively expanded graphs, types, names, literals, known arithmetic bounds, mutability, and the fixed filename transactionally, then reparses the final source through the registered Kotlin frontend before returning it. Only omitted filenames or exact `Program.kt` are accepted; map directives and alternate map names reject with `UNSUPPORTED_CAPABILITY`.
28
+
29
+ `generateArtifactSet()` returns one `text/x-kotlin` entry plus detached immutable metadata. Its declared build and run recipe is:
30
+
31
+ ```sh
32
+ kotlinc -language-version 2.4 -api-version 2.4 -jvm-target 25 -Werror -include-runtime Program.kt -d Program.jar
33
+ java -jar Program.jar
34
+ ```
35
+
36
+ No Gradle files or downloaded project dependencies are generated.
37
+
38
+ ## Compiler contract
39
+
40
+ `kotlinc` discovery accepts only Kotlin/JVM 2.4.20 on the exact OpenJDK 25.0.4+7 Ubuntu builds: `info: kotlinc-jvm 2.4.20 (JRE 25.0.4+7-1-26.04-Ubuntu)` in the Ubuntu26.04 development image or the corresponding `...-1-24.04-Ubuntu` identity in Ubuntu24.04 TensorBuzz. The canonical command is `kotlinc`; `SEMANTIFOLD_KOTLINC` may provide an absolute executable override. Kotlin execution uses the separate `java25` contract, which invokes `java` through `SEMANTIFOLD_JAVA` and accepts only the complete matching OpenJDK25.0.4 runtime and 64-bit Server VM output for one of those two Ubuntu revisions; the broader Java-language `java` contract remains JRE17-29. Missing, ambiguous, non-executable, wrong-compiler, wrong-Kotlin, or wrong-JRE identities fail loudly.
41
+
42
+ The Dockerfile and TensorBuzz download only the official Kotlin `2.4.20` compiler ZIP from JetBrains and verify SHA-256 `59e9ca74c7904ef2c122b12114937673ccce68de820a663f0ed66ccf8799e0b7` before installation at `/opt/kotlinc`. The development image pins `openjdk-25-jdk-headless=25.0.4+7-1~26.04`; Noble TensorBuzz pins the repository-compatible `25.0.4+7-1~24.04` build. Their bootstrap probes require the complete Kotlin/JVM 2.4.20 and JRE 25.0.4+7 identity while admitting only the known Ubuntu 24.04 or 26.04 packaging suffix. They expose `/opt/kotlinc/bin/kotlinc` through `SEMANTIFOLD_KOTLINC` without shadowing `PATH`. Runtime tests materialize fresh directories, compile original and generated five-profile sources with the exact metadata arguments, execute runnable JARs through the discovered Java25 contract, assert status/stderr/exact UTF-8 stdout bytes, and remove all temporary artifacts.