semantifold 0.2.0 → 0.3.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 (356) hide show
  1. package/README.md +37 -12
  2. package/build/index.js +2 -2
  3. package/build/src/acceptance.d.ts +10 -0
  4. package/build/src/acceptance.d.ts.map +1 -1
  5. package/build/src/acceptance.js +24 -5
  6. package/build/src/backends/c-runtime.d.ts +3 -0
  7. package/build/src/backends/c-runtime.d.ts.map +1 -0
  8. package/build/src/backends/c-runtime.js +151 -0
  9. package/build/src/backends/c-validation.d.ts +12 -0
  10. package/build/src/backends/c-validation.d.ts.map +1 -0
  11. package/build/src/backends/c-validation.js +85 -0
  12. package/build/src/backends/c.d.ts +31 -0
  13. package/build/src/backends/c.d.ts.map +1 -0
  14. package/build/src/backends/c.js +308 -0
  15. package/build/src/backends/cpp-runtime.d.ts +3 -0
  16. package/build/src/backends/cpp-runtime.d.ts.map +1 -0
  17. package/build/src/backends/cpp-runtime.js +99 -0
  18. package/build/src/backends/cpp-validation.d.ts +9 -0
  19. package/build/src/backends/cpp-validation.d.ts.map +1 -0
  20. package/build/src/backends/cpp-validation.js +74 -0
  21. package/build/src/backends/cpp.d.ts +16 -0
  22. package/build/src/backends/cpp.d.ts.map +1 -0
  23. package/build/src/backends/cpp.js +285 -0
  24. package/build/src/backends/csharp.d.ts +20 -0
  25. package/build/src/backends/csharp.d.ts.map +1 -0
  26. package/build/src/backends/csharp.js +259 -0
  27. package/build/src/backends/go.d.ts +20 -0
  28. package/build/src/backends/go.d.ts.map +1 -0
  29. package/build/src/backends/go.js +374 -0
  30. package/build/src/backends/identifiers.d.ts +12 -0
  31. package/build/src/backends/identifiers.d.ts.map +1 -1
  32. package/build/src/backends/identifiers.js +71 -2
  33. package/build/src/backends/index.d.ts.map +1 -1
  34. package/build/src/backends/index.js +9 -1
  35. package/build/src/backends/native-validation.d.ts +9 -0
  36. package/build/src/backends/native-validation.d.ts.map +1 -0
  37. package/build/src/backends/native-validation.js +59 -0
  38. package/build/src/backends/ordered-expressions.d.ts +74 -0
  39. package/build/src/backends/ordered-expressions.d.ts.map +1 -0
  40. package/build/src/backends/ordered-expressions.js +159 -0
  41. package/build/src/backends/scalars.d.ts.map +1 -1
  42. package/build/src/backends/scalars.js +7 -2
  43. package/build/src/backends/shared.d.ts.map +1 -1
  44. package/build/src/backends/shared.js +59 -14
  45. package/build/src/frontends/c-parser.d.ts +20 -0
  46. package/build/src/frontends/c-parser.d.ts.map +1 -0
  47. package/build/src/frontends/c-parser.js +14 -0
  48. package/build/src/frontends/c.d.ts +220 -0
  49. package/build/src/frontends/c.d.ts.map +1 -0
  50. package/build/src/frontends/c.js +750 -0
  51. package/build/src/frontends/cpp-parser.d.ts +11 -0
  52. package/build/src/frontends/cpp-parser.d.ts.map +1 -0
  53. package/build/src/frontends/cpp-parser.js +15 -0
  54. package/build/src/frontends/cpp.d.ts +227 -0
  55. package/build/src/frontends/cpp.d.ts.map +1 -0
  56. package/build/src/frontends/cpp.js +784 -0
  57. package/build/src/frontends/csharp.d.ts +14 -0
  58. package/build/src/frontends/csharp.d.ts.map +1 -0
  59. package/build/src/frontends/csharp.js +708 -0
  60. package/build/src/frontends/go.d.ts +15 -0
  61. package/build/src/frontends/go.d.ts.map +1 -0
  62. package/build/src/frontends/go.js +712 -0
  63. package/build/src/frontends/scalars.d.ts.map +1 -1
  64. package/build/src/frontends/scalars.js +16 -1
  65. package/build/src/language-registry.d.ts.map +1 -1
  66. package/build/src/language-registry.js +51 -2
  67. package/build/src/mapping.js +2 -2
  68. package/build/src/semantic/provenance.js +3 -3
  69. package/build/src/semantic/types.d.ts +4 -4
  70. package/build/src/semantic/types.d.ts.map +1 -1
  71. package/build/src/semantic/types.js +3 -3
  72. package/build/src/subprocess.d.ts +10 -1
  73. package/build/src/subprocess.d.ts.map +1 -1
  74. package/build/src/subprocess.js +29 -3
  75. package/build/src/toolchains.d.ts +24 -0
  76. package/build/src/toolchains.d.ts.map +1 -1
  77. package/build/src/toolchains.js +6 -2
  78. package/docs/architecture.md +20 -6
  79. package/docs/c.md +60 -0
  80. package/docs/cpp.md +61 -0
  81. package/docs/goals.md +4 -2
  82. package/docs/language-support.md +27 -8
  83. package/docs/parser-qualification.md +153 -4
  84. package/docs/plans/2026-09-05-standard-library-portability.md +46 -0
  85. package/docs/source-maps.md +11 -5
  86. package/docs/standard-library-portability.md +190 -0
  87. package/docs/testing.md +113 -4
  88. package/index.js +1 -1
  89. package/node_modules/node-addon-api/LICENSE.md +9 -0
  90. package/node_modules/node-addon-api/README.md +95 -0
  91. package/node_modules/node-addon-api/common.gypi +21 -0
  92. package/node_modules/node-addon-api/except.gypi +25 -0
  93. package/node_modules/node-addon-api/index.js +14 -0
  94. package/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
  95. package/node_modules/node-addon-api/napi-inl.h +7250 -0
  96. package/node_modules/node-addon-api/napi.h +3463 -0
  97. package/node_modules/node-addon-api/node_addon_api.gyp +42 -0
  98. package/node_modules/node-addon-api/node_api.gyp +9 -0
  99. package/node_modules/node-addon-api/noexcept.gypi +26 -0
  100. package/node_modules/node-addon-api/nothing.c +0 -0
  101. package/node_modules/node-addon-api/package-support.json +21 -0
  102. package/node_modules/node-addon-api/package.json +481 -0
  103. package/node_modules/node-addon-api/tools/README.md +73 -0
  104. package/node_modules/node-addon-api/tools/check-napi.js +99 -0
  105. package/node_modules/node-addon-api/tools/clang-format.js +71 -0
  106. package/node_modules/node-addon-api/tools/conversion.js +301 -0
  107. package/node_modules/node-gyp-build/LICENSE +21 -0
  108. package/node_modules/node-gyp-build/README.md +58 -0
  109. package/node_modules/node-gyp-build/SECURITY.md +5 -0
  110. package/node_modules/node-gyp-build/bin.js +84 -0
  111. package/node_modules/node-gyp-build/build-test.js +19 -0
  112. package/node_modules/node-gyp-build/index.js +6 -0
  113. package/node_modules/node-gyp-build/node-gyp-build.js +207 -0
  114. package/node_modules/node-gyp-build/optional.js +7 -0
  115. package/node_modules/node-gyp-build/package.json +43 -0
  116. package/node_modules/semantifold-tree-sitter-legacy-internal/LICENSE +15 -0
  117. package/node_modules/semantifold-tree-sitter-legacy-internal/README.md +7 -0
  118. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/LICENSE +21 -0
  119. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/README.md +90 -0
  120. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/binding.gyp +79 -0
  121. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/index.js +895 -0
  122. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/package.json +62 -0
  123. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
  124. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
  125. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
  126. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
  127. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/addon_data.h +47 -0
  128. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/binding.cc +35 -0
  129. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/conversions.cc +140 -0
  130. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/conversions.h +22 -0
  131. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/language.cc +106 -0
  132. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/language.h +17 -0
  133. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/logger.cc +70 -0
  134. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/logger.h +19 -0
  135. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
  136. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
  137. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/node.cc +1056 -0
  138. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/node.h +30 -0
  139. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/parser.cc +298 -0
  140. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/parser.h +35 -0
  141. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/query.cc +383 -0
  142. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/query.h +39 -0
  143. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/tree.cc +307 -0
  144. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/tree.h +45 -0
  145. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
  146. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/tree_cursor.h +52 -0
  147. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/tree-sitter.d.ts +211 -0
  148. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1266 -0
  149. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
  150. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
  151. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +290 -0
  152. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
  153. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
  154. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
  155. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +501 -0
  156. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
  157. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
  158. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +221 -0
  159. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +299 -0
  160. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
  161. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +419 -0
  162. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +49 -0
  163. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +14 -0
  164. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +774 -0
  165. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2151 -0
  166. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +230 -0
  167. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +62 -0
  168. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4134 -0
  169. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
  170. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
  171. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +899 -0
  172. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +133 -0
  173. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1060 -0
  174. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +382 -0
  175. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +165 -0
  176. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
  177. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +714 -0
  178. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
  179. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
  180. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
  181. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
  182. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
  183. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
  184. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
  185. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
  186. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
  187. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
  188. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +50 -0
  189. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +23 -0
  190. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +109 -0
  191. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1294 -0
  192. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1823 -0
  193. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
  194. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/LICENSE +21 -0
  195. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/README.md +18 -0
  196. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/binding.gyp +29 -0
  197. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/bindings/node/binding.cc +20 -0
  198. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/bindings/node/binding_test.js +9 -0
  199. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/bindings/node/index.d.ts +28 -0
  200. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/bindings/node/index.js +11 -0
  201. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/grammar.js +1470 -0
  202. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/package.json +60 -0
  203. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/darwin-arm64/tree-sitter-c.node +0 -0
  204. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/darwin-x64/tree-sitter-c.node +0 -0
  205. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/linux-arm64/tree-sitter-c.node +0 -0
  206. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/linux-x64/tree-sitter-c.node +0 -0
  207. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/win32-arm64/tree-sitter-c.node +0 -0
  208. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/win32-x64/tree-sitter-c.node +0 -0
  209. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/queries/highlights.scm +81 -0
  210. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/queries/tags.scm +9 -0
  211. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/grammar.json +9735 -0
  212. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/node-types.json +4614 -0
  213. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/parser.c +119615 -0
  214. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/tree_sitter/alloc.h +54 -0
  215. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/tree_sitter/array.h +290 -0
  216. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/tree_sitter/parser.h +266 -0
  217. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/tree-sitter-c.wasm +0 -0
  218. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/tree-sitter.json +43 -0
  219. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/LICENSE +21 -0
  220. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/README.md +22 -0
  221. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/binding.gyp +30 -0
  222. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/bindings/node/binding.cc +20 -0
  223. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/bindings/node/binding_test.js +9 -0
  224. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/bindings/node/index.d.ts +28 -0
  225. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/bindings/node/index.js +11 -0
  226. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/grammar.js +1436 -0
  227. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/package.json +61 -0
  228. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/darwin-arm64/tree-sitter-cpp.node +0 -0
  229. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/darwin-x64/tree-sitter-cpp.node +0 -0
  230. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/linux-arm64/tree-sitter-cpp.node +0 -0
  231. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/linux-x64/tree-sitter-cpp.node +0 -0
  232. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/win32-arm64/tree-sitter-cpp.node +0 -0
  233. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/win32-x64/tree-sitter-cpp.node +0 -0
  234. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/queries/highlights.scm +70 -0
  235. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/queries/injections.scm +3 -0
  236. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/queries/tags.scm +15 -0
  237. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/grammar.json +17084 -0
  238. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/node-types.json +7997 -0
  239. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/parser.c +530368 -0
  240. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/scanner.c +148 -0
  241. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/tree_sitter/alloc.h +54 -0
  242. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/tree_sitter/array.h +290 -0
  243. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/tree_sitter/parser.h +266 -0
  244. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/tree-sitter-cpp.wasm +0 -0
  245. package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/tree-sitter.json +55 -0
  246. package/node_modules/semantifold-tree-sitter-legacy-internal/package.json +22 -0
  247. package/node_modules/semantifold-tree-sitter-legacy-internal/src/c.js +152 -0
  248. package/node_modules/tree-sitter/LICENSE +21 -0
  249. package/node_modules/tree-sitter/README.md +128 -0
  250. package/node_modules/tree-sitter/binding.gyp +88 -0
  251. package/node_modules/tree-sitter/index.js +950 -0
  252. package/node_modules/tree-sitter/package.json +76 -0
  253. package/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
  254. package/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
  255. package/node_modules/tree-sitter/prebuilds/linux-arm64/tree-sitter.node +0 -0
  256. package/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
  257. package/node_modules/tree-sitter/prebuilds/win32-arm64/tree-sitter.node +0 -0
  258. package/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
  259. package/node_modules/tree-sitter/src/addon_data.h +47 -0
  260. package/node_modules/tree-sitter/src/binding.cc +35 -0
  261. package/node_modules/tree-sitter/src/conversions.cc +140 -0
  262. package/node_modules/tree-sitter/src/conversions.h +22 -0
  263. package/node_modules/tree-sitter/src/language.cc +105 -0
  264. package/node_modules/tree-sitter/src/language.h +17 -0
  265. package/node_modules/tree-sitter/src/logger.cc +70 -0
  266. package/node_modules/tree-sitter/src/logger.h +19 -0
  267. package/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
  268. package/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
  269. package/node_modules/tree-sitter/src/node.cc +1088 -0
  270. package/node_modules/tree-sitter/src/node.h +30 -0
  271. package/node_modules/tree-sitter/src/parser.cc +332 -0
  272. package/node_modules/tree-sitter/src/parser.h +35 -0
  273. package/node_modules/tree-sitter/src/query.cc +425 -0
  274. package/node_modules/tree-sitter/src/query.h +40 -0
  275. package/node_modules/tree-sitter/src/tree.cc +316 -0
  276. package/node_modules/tree-sitter/src/tree.h +45 -0
  277. package/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
  278. package/node_modules/tree-sitter/src/tree_cursor.h +52 -0
  279. package/node_modules/tree-sitter/tree-sitter.d.ts +1083 -0
  280. package/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1478 -0
  281. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
  282. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
  283. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +291 -0
  284. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
  285. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
  286. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
  287. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +523 -0
  288. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
  289. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
  290. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +293 -0
  291. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +293 -0
  292. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
  293. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +483 -0
  294. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +54 -0
  295. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +12 -0
  296. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +875 -0
  297. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2297 -0
  298. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +286 -0
  299. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +48 -0
  300. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/portable/endian.h +241 -0
  301. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4347 -0
  302. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
  303. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
  304. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +912 -0
  305. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +133 -0
  306. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1034 -0
  307. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +399 -0
  308. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +170 -0
  309. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
  310. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +716 -0
  311. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
  312. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/ts_assert.h +11 -0
  313. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
  314. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
  315. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
  316. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
  317. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
  318. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
  319. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
  320. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
  321. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
  322. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +75 -0
  323. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +24 -0
  324. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +137 -0
  325. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1314 -0
  326. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1937 -0
  327. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
  328. package/package.json +21 -5
  329. package/src/acceptance.js +25 -4
  330. package/src/backends/c-runtime.js +151 -0
  331. package/src/backends/c-validation.js +83 -0
  332. package/src/backends/c.js +308 -0
  333. package/src/backends/cpp-runtime.js +99 -0
  334. package/src/backends/cpp-validation.js +70 -0
  335. package/src/backends/cpp.js +285 -0
  336. package/src/backends/csharp.js +270 -0
  337. package/src/backends/go.js +383 -0
  338. package/src/backends/identifiers.js +72 -1
  339. package/src/backends/index.js +7 -0
  340. package/src/backends/native-validation.js +64 -0
  341. package/src/backends/ordered-expressions.js +161 -0
  342. package/src/backends/scalars.js +7 -1
  343. package/src/backends/shared.js +56 -12
  344. package/src/frontends/c-parser.js +17 -0
  345. package/src/frontends/c.js +780 -0
  346. package/src/frontends/cpp-parser.js +18 -0
  347. package/src/frontends/cpp.js +816 -0
  348. package/src/frontends/csharp.js +759 -0
  349. package/src/frontends/go.js +770 -0
  350. package/src/frontends/scalars.js +15 -0
  351. package/src/language-registry.js +52 -1
  352. package/src/mapping.js +1 -1
  353. package/src/semantic/provenance.js +2 -2
  354. package/src/semantic/types.js +2 -2
  355. package/src/subprocess.js +31 -2
  356. package/src/toolchains.js +5 -1
package/docs/cpp.md ADDED
@@ -0,0 +1,61 @@
1
+ # C++ source and target profile
2
+
3
+ `cpp` is an independent frontend and single-text native backend for Tasks 001–004. The official `tree-sitter-cpp@0.23.4` grammar runs inside the existing private, root-bundled Tree-sitter 0.21.1 boundary. C uses its own grammar and profile. No compiler, preprocessor, source-mode guess or source-text recovery supplies semantic meaning.
4
+
5
+ ## Toolchain and artifacts
6
+
7
+ Generation returns exactly `program.cpp`, including fixed inline scalar support. `generate`, `generateArtifact` and `generateArtifactSet` all support CPP. Rich and Source Map v3 data accompany the artifact; no map directive, alternate map filename, header, build file, dependency project or additional semantic module is emitted. The filename must be exactly `program.cpp`; map metadata uses `program.cpp.map` and the directive is `none`.
8
+
9
+ The selected profile is C++20, Ubuntu Clang 21.1.8, Linux x86-64 (`x86_64-pc-linux-gnu`), eight-bit bytes, 64-bit int64/size/ptrdiff, and libstdc++ with its C++11 owned-string ABI (`_GLIBCXX_USE_CXX11_ABI == 1`). The canonical development lane supplies libstdc++-15-dev 15.2.0-16ubuntu1. The Noble CI lane explicitly installs g++-13 and its libstdc++-13 headers and records the installed version. These are the two image-owned library builds of the same selected standard-library/ABI profile; libc++ and the old libstdc++ string ABI are excluded. Static assertions reject incompatible native byte/ABI settings. Local execution qualifies the development build; exact-head TensorBuzz must qualify the checked-in Noble lane.
10
+
11
+ Discovery ID `clangpp` uses canonical `clang++` or the absolute `SEMANTIFOLD_CLANGPP` override. In the development container use `/usr/bin/clang++-21`; the C lane retains `SEMANTIFOLD_CLANG=/usr/bin/clang-21`. Discovery resolves real paths, so compile and link both explicitly pass `--driver-mode=g++`; this preserves C++ driver semantics when clang++ is a symlink to clang. Discovery never installs or substitutes a tool.
12
+
13
+ Compile flags, in addition to `-O0` or `-O2`, are:
14
+
15
+ ```text
16
+ --no-default-config --driver-mode=g++ -std=c++20 -stdlib=libstdc++
17
+ -Wall -Wextra -Werror -pedantic-errors -Wconversion -Wsign-conversion -Wshadow -Wformat=2
18
+ -fno-exceptions -fno-rtti -ftrapv -finput-charset=UTF-8 -fexec-charset=UTF-8 -fno-color-diagnostics
19
+ ```
20
+
21
+ Compilation (`-c program.cpp -o program.o`), linking (`--no-default-config --driver-mode=g++ -stdlib=libstdc++ -O0 program.o -o program`) and execution are separate stages. All stages run in a fresh directory with fixed `LANG=C.UTF-8`, `LC_ALL=C.UTF-8`, `TZ=UTC`, captured output and bounded execution. Both optimizations also run with `-g -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer` at compile and link, plus `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1:allocator_may_return_null=1` and `UBSAN_OPTIONS=halt_on_error=1`. Missing compilers, runtime libraries, sanitizer support, failed stages and failed cleanup are failures.
22
+
23
+ ## Scalar values and errors
24
+
25
+ | Semantic value | Exact CPP form | Behavior |
26
+ | --- | --- | --- |
27
+ | integer | `std::int64_t` | JavaScript-safe nonnegative literal magnitude, explicit semantic negation, checked signed-64 arithmetic |
28
+ | boolean | `bool` | Exact true/false, strict typed conditions, Boolean short circuit |
29
+ | string | owned `std::string` | UTF-8 bytes, by-value locals/arguments/returns, scalar value equality |
30
+
31
+ Integer literals use exact `std::int64_t(123)` construction. Bare native integers, suffixes, deduction and arbitrary casts are rejected, so a source expression cannot silently perform narrower `int` arithmetic. String literals use exact `std::string("bytes", byteCount)` construction: an ordinary parser-owned literal and a matching canonical decimal UTF-8 byte count. Raw UTF-8, supported simple byte escapes and bounded octal/hex byte escapes are decoded strictly; concatenated/prefixed/raw literals, universal escapes, invalid UTF-8 and parser-split hexadecimal escapes are rejected. Generated literals use three-digit octal bytes, preserving Unicode and embedded NUL independently of source encoding or locale. The byte count belongs only to the exact literal scaffold, not to semantic user size/pointer operations.
32
+
33
+ Raw CR or LF inside an ordinary literal is rejected at its parser-owned content node, including the bare CR that the official grammar accepts as `string_content`. Clang treats that CR as a source line break. Escaped `\r`/`\n`, Unicode/NUL values, LF/CRLF source lines and CR whitespace between declarations retain their supported behavior.
34
+
35
+ Add, subtract, multiply and negate use checked helpers. Known literal-only results outside signed int64 fail before artifacts; dynamic overflow writes exactly `semantifold: integer overflow\n` to stderr and exits 70. No generated arithmetic relies on signed-overflow undefined behavior. `-ftrapv` additionally protects raw caller arithmetic in the selected compiler profile; caller code needing the generated status-70 policy uses the exact checked helper forms. There is no promise to normalize native traps from arbitrary raw source execution into semantic exceptions.
36
+
37
+ Strings are owned values: copying, concatenating, assigning, passing and returning them cannot expose alias identity, moved-from state, references or lifetime effects. No explicit move/borrow is generated. Fixed helpers receive by-value scalars; compiler copy elision/moves are permitted only by normal as-if semantics. String concatenation checks its native maximum size; known impossible object lengths reject before generation. Byte-counted `std::fwrite` output preserves NUL and UTF-8. Integer formatting uses unsigned magnitude and ASCII digits, including both signed extrema; Boolean output is ASCII `true`/`false`, followed by one newline. Output failure and checked string-size failure exit 70 with the corresponding fixed diagnostic.
38
+
39
+ The support contains no `throw`, `try` or `catch`. Exceptions and RTTI are disabled. Library allocation exhaustion, failed allocation during value copying, stack exhaustion, library termination and external process termination are host-resource failures; they do not become portable user exceptions or semantic RAII cleanup effects. Normal successful scope exit destroys native string storage. Fatal process termination is not an unwinding contract. ASan/UBSan/leak executions cover long strings, copies, reassignment, concatenation, returns and all arithmetic fatal paths.
40
+
41
+ ## Accepted source and exact scaffolds
42
+
43
+ A source translation unit contains the exact generated inline support, followed by namespace-scope semantic functions and one canonical final `int main() { ... return 0; }`. Each semantic function has a unique non-overloaded name, exactly two required by-value scalar parameters, explicit scalar result type and explicit returns on every path. Locals are initialized with an explicit scalar type; `const` records semantic immutability. Plain assignment, supported typed operators, exact print helper calls, braced nested/empty/fallthrough branches and `else if` normalization are supported. Caller functions must be defined before calls, apart from self-recursion. Generated exact prototypes support forward calls and mutual recursion. Namespace-scope function-address discards are unnecessary in CPP and are not emitted; unused parameters/locals use exact inert generated discards.
44
+
45
+ The frontend traverses every named, anonymous, comment and field-bearing child and rejects error, missing and recovered nodes. Only complete CPP child shapes collapse: qualified `std::int64_t`/`std::string`, the precise include/support prefix, literal construction, print helpers, generated prototypes, main and ordered regions. Qualified names are resolved through CPP `scope`/`name` edges and `::`; conditions use CPP `condition_clause` nodes. Ordinary comments/whitespace may vary, but preprocessing-sensitive comments and unrecognized scaffold comments reject.
46
+
47
+ The shared backend-only occurrence planner leaves semantic IR unchanged. It plans every initializer, assignment, return, print argument, call argument and condition; eager operands and arguments execute left to right. Each nontrivial occurrence gets a six-digit `semantifold_ordered_` name with exact `std::int64_t`, `bool` or owned `std::string` type. Short-circuit RHS steps stay in the corresponding conditional block.
48
+
49
+ Each statement has paired `semantifold:ordered-expression:cpp:v1` comments with a deterministic statement number and semantic signature. The CPP frontend reconstructs candidate expressions, requires linear temporary consumption and exact conditional/final-consumer shapes, resolves semantic types, then compares every significant original CPP node, field and token against a newly parsed canonical CPP plan. The digest supplements this structural proof. Partial, forged, reordered, duplicate, wrong-type, wrong-number, wrong-dependency, wrong-consumer, escaping, colliding and C-tagged regions reject. Caller-authored semantic or scalar-helper calls nested in operands/arguments remain rejected; ordinary CPP syntax does not establish the portable evaluation order. Literal construction alone is pure and may nest.
50
+
51
+ No templates/concepts, deduction/auto, user overloads/operators/conversions, references, pointers, arrays, classes/records/enums, constructors/destructors, inheritance/virtuals, namespaces/using outside exact support, exceptions/specifications, RTTI, casts outside exact literal/support scaffolds, initializer lists, lambdas, coroutines, ranges, user literals, macros, general standard-library calls, C compatibility mode or user build system enters semantic IR. The protected `semantifold_` namespace, implementation-reserved names/double underscores, CPP keywords and included C library names/macros are unavailable to user declarations. Standard implementation internals in exact support are not portable code or an extension of the planned stdlib architecture.
52
+
53
+ CPP additionally reserves `WEOF` and `wint_t`, introduced by the qualified libstdc++ `<string>` include chain as a macro and global typedef. Functions, parameters and locals with these exact names fail target validation before any artifact is returned. This protection belongs to CPP's header environment; C keeps its existing identifier contract, and ordinary CPP names such as `WEOFValue` and `wint_type` remain valid.
54
+
55
+ ## Bounds, diagnostics and provenance
56
+
57
+ The qualified binding accepts at most 32,767 UTF-16 code units, including all inline support, comments and whitespace. Frontend input and an exact private backend size preflight enforce that limit. Semantic graph cycles, depth above 512 and expanded occurrence counts above 999,999 reject before recursive validation/provenance; CPP CST depth is also bounded at 512. Native parser failures retain a source-file range when no finer node exists. Statically known owned string sizes above the qualified signed-64 object limit reject; native `std::string::max_size()` remains checked for runtime concatenation. This lane does not inherit C17's 4,095-byte literal limit.
58
+
59
+ Malformed IR, unsupported target options/identifiers/types and unrepresentable integer/string/source bounds use `UNSUPPORTED_CAPABILITY` before any artifact. Unsupported source forms use located frontend diagnostics; malformed generated regions normalize semantic/capability failures to `UNSUPPORTED_SYNTAX`. Parser recovery uses `PARSE_ERROR`.
60
+
61
+ Original operators, call targets, types and statement consumers retain rich/v3 provenance. Runtime code, prototypes, discards, marker comments, temporary declarations/uses and short-circuit control have explicit synthetic origins related to semantic occurrences. Generation/reparse is deterministic, including shared semantic objects, Unicode/CRLF source positions, serialized maps and stale-provenance rebuilding. Tests use the complete C distinguishable-call matrix, five CPP fixture profiles, original-five crossings and real native execution; expanded language-cohort matrices remain Task025 work.
package/docs/goals.md CHANGED
@@ -2,6 +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 release candidate proves one minimal vertical slice across PHP, Ruby, JavaScript, TypeScript, and Java. 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. It does not yet provide 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 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.
6
6
 
7
- Roadmap candidates include a versioned full 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 are explicitly outside this candidate.
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.
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.
@@ -12,8 +12,12 @@ The immutable registry is authoritative for both dispatch and discovery:
12
12
  | `typescript` | yes | yes | no | no | no | single | yes | rich + v3 | parse, generate, compile, execute (`tsc`, `node`) |
13
13
  | `java` | yes | yes | no | no | no | single | yes | rich + v3 | parse, generate, compile, execute (`javac`, `java`) |
14
14
  | `python` | yes | yes | no | no | no | single | yes | rich + v3 | parse, generate, compile, execute (`python3`) |
15
+ | `csharp` | yes | yes | no | no | no | multiple | yes | rich + v3 | parse, generate, restore, compile, execute (`dotnet`) |
16
+ | `go` | yes | yes | no | no | no | multiple | yes | rich + v3 | parse, generate, compile, validate, execute (`go`) |
17
+ | `cpp` | yes | yes | no | no | no | single | yes | rich + v3 | parse, generate, compile, link, execute (`clangpp`, native executable) |
18
+ | `c` | yes | yes | no | no | no | multiple | yes | rich + v3 | parse, generate, compile, link, execute (`clang`, native executable) |
15
19
 
16
- `languageCapabilities` exposes this information as frozen data. A role is not inferred from the presence of another role: a future browser binary target need not have a frontend, and a future interoperability bridge need not be a general backend. `supportedLanguages` is the derived list of all six records with both frontend and text generation.
20
+ `languageCapabilities` exposes this information as frozen data. A role is not inferred from the presence of another role: a future browser binary target need not have a frontend, and a future interoperability bridge need not be a general backend. `supportedLanguages` is the derived list of all ten records with both frontend and text generation. C#, Go, and C are two-artifact text backends, so callers use `generateArtifactSet()`; the legacy single-artifact APIs reject them with `UNSUPPORTED_ROLE`.
17
21
 
18
22
  ## Implemented subset
19
23
 
@@ -25,6 +29,11 @@ The immutable registry is authoritative for both dispatch and discovery:
25
29
  | TypeScript | exact `number`, `boolean`, and `string` keyword annotations on synchronous, non-generator functions and locals | `console.log(…)` |
26
30
  | Java | primitive `int`/`boolean` and exact `String` or `java.lang.String` declarations, plus a sequenced `public static void main` | `System.out.println(…)` in `Main` |
27
31
  | Python | exact `int`/`bool`/`str` annotations on every parameter, return, and initialized local | direct top-level `print(…)` in `program.py` |
32
+ | C# | exact `long`/`System.Int64`, `bool`/`System.Boolean`, and non-null `string`/`System.String` declarations | `System.Console.WriteLine(…)` in zero-argument `private static void Main()` |
33
+ | Go | exact `int64`, `bool`, and `string` declarations on every parameter, result, and initialized local | `fmt.Println(…)` in final zero-argument `func main()` |
34
+ | C | exact `int64_t`, `bool`, and immutable UTF-8 `SemantifoldString`; local `const` means immutable | scalar print helpers in canonical `int main(void)` with arena cleanup |
35
+
36
+ C uses the unchanged private root-bundled legacy CST boundary and the [complete C17 profile](c.md). It generates deterministic `program.c` plus `semantifold_runtime.h`, checks signed integer arithmetic and arena sizes, and sequences every call and nontrivial expression through exact versioned regions. Caller-authored nested calls with unspecified C order are rejected. Generated regions reparse only after whole-CST comparison verifies types, numbering, uses, order, consumers, prototypes and cleanup. No user pointer, ownership, preprocessing, general FFI or C++ behavior enters semantic IR. Real Clang O0/O2 execution and ASan/UBSan/leak checks are mandatory on the qualified Linux lane.
28
37
 
29
38
  Across every language, a module contains at least one function with exactly two required parameters and a scalar return. Function bodies, entry points, and conditional branches are ordered lexical blocks. They may contain supported local declarations, plain assignments, nested conditionals, explicit returns, and prints in source order. Conditions require semantic `boolean`. An alternate is optional, and source `else if`/`elsif`/`elseif` normalizes to one nested conditional inside the alternate block. Non-void functions must explicitly return on every reachable path; an optional alternate is therefore accepted only when a later statement completes the fallthrough path. A statement following an unconditional return or an exhaustive returning conditional in the same block is unreachable and rejected. Entry points cannot return values.
30
39
 
@@ -35,6 +44,8 @@ Frontend conditional forms remain deliberately bounded:
35
44
  - Ruby accepts ordinary `if`/`elsif`/`else` with explicit `return`; modifier conditionals, `unless`, `case`, implicit method returns, and truthy conditions are rejected.
36
45
  - Java requires braced ordinary branches while accepting a direct `else if`; switch forms, labels, assertions, synchronized blocks, local classes, and recovered grammar nodes are rejected.
37
46
  - Python accepts ordinary indented `if`/`elif`/`else`, with `pass` only as the source/backend representation of an otherwise empty semantic block. Truthiness, match, loops, exceptions, context managers, async/generators, nested declarations, and recovered grammar nodes are rejected.
47
+ - C# requires braced ordinary branches and accepts a direct `else if`. Its file must have exact `#nullable enable`, file-scoped `namespace Semantifold.Generated;`, and `internal static class Program`; semantic methods are ordered synchronous `private static` methods and `Main` is the final member. Attributes, using directives, fields, properties, constructors, nested types, extra members, nullable context changes, loops, exceptions, patterns, and recovered grammar are rejected.
48
+ - Go requires `package main`, zero or one exact unaliased `import "fmt"`, one or more ordinary top-level semantic functions, and a final zero-argument `func main()`. It accepts braced branches and direct `else if`; build directives, `init`, methods, top-level data/type declarations, user imports, loops, switches, concurrency, panic/recover, and recovered grammar nodes are rejected.
38
49
 
39
50
  Every local is an explicitly typed simple identifier with an initializer. Parameters are immutable. Initializers are checked before their new binding becomes visible; assignment right-hand expressions are checked before the target update. Exact scalar types are preserved. Lexical function, branch, and entry scopes reject duplicate declarations, use before declaration, unresolved reads/writes, assignment to immutable bindings, type mismatch, and all shadowing or repeated local spellings in this initial capability. Module function names participate in the same no-shadowing contract, so no parameter or local may capture a callable name. Destructuring, multiple/uninitialized declarations, inferred types, arbitrary lvalues, compound/update assignment, globals/fields/constants, and parameter reassignment are unsupported.
40
51
 
@@ -55,10 +66,12 @@ $name = "value";
55
66
  ```
56
67
 
57
68
  - Python requires `name: int|bool|str = expression`. Locals default to mutable; an immutable declaration has the exact immediately preceding, equally indented `# @semantifold-immutable` carrier.
69
+ - C# requires one initialized scalar local declarator with an explicit accepted type. Locals default to mutable; an immutable declaration has exactly one immediately adjacent `// @semantifold-immutable` carrier. `const`, `var`, multiple/uninitialized declarations, and other comment carriers are rejected.
70
+ - Go requires `var name int64|bool|string = expression`. A local is mutable only when the accepted syntax contains an assignment occurrence to that binding; otherwise it is immutable and generated Go carries the exact adjacent `// @semantifold-immutable` marker. Short declarations, inferred/uninitialized/multiple declarations, `const`, and malformed marker placement are rejected.
58
71
 
59
72
  The Ruby/PHP tags are Semantifold source-profile metadata, not native runtime immutability. Their adapters validate the exact tag shape, semantic validation rejects later writes, and generators reproduce the metadata so mutability round-trips.
60
73
 
61
- Expressions contain parameter/local identifiers, scalar literals, two-argument unqualified calls, and the following typed operations. Every operation node records its result type, and identifier/call operands are resolved before an operation is selected.
74
+ Expressions contain parameter/local identifiers, scalar literals, two-argument unqualified calls, and the following typed operations. Every operation node records its result type, and identifier/call operands are resolved before an operation is selected. C# generation escapes NEL (`U+0085`) as well as the other Unicode source line terminators so every semantic string remains one compilable regular string-literal token.
62
75
 
63
76
  | Meaning | Ruby | JavaScript / TypeScript | PHP | Java |
64
77
  | --- | --- | --- | --- | --- |
@@ -69,22 +82,28 @@ Expressions contain parameter/local identifiers, scalar literals, two-argument u
69
82
  | Integer ordering | `<`, `<=`, `>`, `>=` | `<`, `<=`, `>`, `>=` | `<`, `<=`, `>`, `>=` | `<`, `<=`, `>`, `>=` |
70
83
  | String concatenation | `+` | `+` | `.` | `+` |
71
84
 
72
- Python uses `+`, `-`, `*`, unary `-`, `not`, `and`, `or`, `==`, `!=`, and integer ordering with explicit generated parentheses. The same-type semantic checker distinguishes Boolean from integer even though CPython makes `bool` a runtime subclass of `int`.
85
+ Python uses `+`, `-`, `*`, unary `-`, `not`, `and`, `or`, `==`, `!=`, and integer ordering with explicit generated parentheses. The same-type semantic checker distinguishes Boolean from integer even though CPython makes `bool` a runtime subclass of `int`. C# uses the ordinary scalar operators, including value `==`/`!=` for all three supported scalar types, but requires exactly one `checked(...)` wrapper around every integer add, subtract, multiply, and negate. Go uses its ordinary `int64`/Boolean/string operators with explicit generated parentheses except where `gofmt` removes a redundant condition wrapper. Division, remainder, bitwise, shifts, conversions, indexing, and updates remain unsupported.
73
86
 
74
87
  Operands evaluate left to right, and Boolean and/or short-circuit. Conditions require semantic `boolean`; Ruby, PHP, and JavaScript truthiness is not normalized. Equality is scalar value equality only, requires matching operand types, and never coerces. Java reference `==`/`!=` on strings is rejected; generated Java uses `.equals`. Return values, call arguments, initializers, assignments, and explicit operation result types must exactly match their declared scalar types. Generated operations are parenthesized so reparsing preserves the expression tree rather than relying on coincident target precedence.
75
88
 
76
- Integer literals are restricted to JavaScript's safe integer range, `Number.MIN_SAFE_INTEGER` through `Number.MAX_SAFE_INTEGER`, and semantic integers have one unsigned mathematical zero. JavaScript and TypeScript can form IEEE-754 `-0` through negation or multiplication, so generated modules containing either operation stringify their scalar print argument to render both zero signs as `0`; the parser recognizes and removes only this exact entry-point scaffold during reparse. Supported operations cannot otherwise observe a zero sign, and the semantic expression tree is neither rewritten nor folded. Java generation additionally requires primitive-`int` literals and rejects compile-time-known add/subtract/multiply/negate results outside `-2147483648` through `2147483647`. This validation uses exact arithmetic without replacing the semantic expression tree. Runtime arithmetic overflow for non-literal expressions is not a portable guarantee.
89
+ Integer literals are restricted to JavaScript's safe integer range, `Number.MIN_SAFE_INTEGER` through `Number.MAX_SAFE_INTEGER`, and semantic integers have one unsigned mathematical zero. JavaScript and TypeScript can form IEEE-754 `-0` through negation or multiplication, so generated modules containing either operation stringify their scalar print argument to render both zero signs as `0`; the parser recognizes and removes only this exact entry-point scaffold during reparse. Supported operations cannot otherwise observe a zero sign, and the semantic expression tree is neither rewritten nor folded. Java generation additionally requires primitive-`int` literals and rejects compile-time-known add/subtract/multiply/negate results outside `-2147483648` through `2147483647`. C# source requires canonical decimal `long` literals with `L`; generation rejects known integer operation trees outside signed 64-bit and emits checked arithmetic. Go source uses canonical decimal `int64`-representable literals; generation rejects compile-time-known operation trees outside signed 64-bit. These checks use exact arithmetic without replacing the semantic expression tree. Runtime arithmetic overflow for non-literal expressions is not a portable result guarantee: C# raises its native checked failure, while Go retains native `int64` wrap behavior.
77
90
 
78
91
  String literals normalize to their parser-decoded Unicode scalar value. Original quotes and escapes are not retained. PHP and Ruby interpolation, JavaScript/TypeScript template substitution, Java text blocks, PHP heredoc/nowdoc, invalid source encodings, and lone surrogate values are rejected. Backends use target-specific escaping for quotes, backslashes, controls, Unicode, and interpolation introducers. Generated source reparses to the same value.
79
92
 
80
- Ruby accepts exactly two required positional parameters. Optional, rest, post, keyword, keyword-rest, and block parameters remain unsupported. Its three annotation comments must form the contiguous block immediately before their function. PHP rejects every `declare` form other than one optional exact `declare(strict_types=1)`. Python rejects default, positional-only, keyword-only, variadic, keyword, and starred parameters/calls, quoted or compound annotations, bytes/f-strings/raw/triple/implicitly concatenated strings, decorators, imports, classes, comprehensions, lambdas, attributes, subscripts, and every other dynamic form. Java calls remain unqualified and `main` may not contain ignored statements.
93
+ Ruby accepts exactly two required positional parameters. Optional, rest, post, keyword, keyword-rest, and block parameters remain unsupported. Its three annotation comments must form the contiguous block immediately before their function. PHP rejects every `declare` form other than one optional exact `declare(strict_types=1)`. Python rejects default, positional-only, keyword-only, variadic, keyword, and starred parameters/calls, quoted or compound annotations, bytes/f-strings/raw/triple/implicitly concatenated strings, decorators, imports, classes, comprehensions, lambdas, attributes, subscripts, and every other dynamic form. Java calls remain unqualified and `main` may not contain ignored statements. C# rejects ref/out/in/scoped/params/default parameters, named/ref arguments, generics, overloads, instance/qualified calls, lambdas/delegates, async/iterators, unsafe code, casts, interpolation/raw/verbatim strings, boxing, `dynamic`, LINQ, and every form outside the exact direct two-argument call and recognized print scaffold. Go rejects variadics, named/multiple/missing results, generic parameters, methods/receivers, qualified or non-two-argument calls, closures, raw/rune/imaginary/float literals, arrays/slices/maps/structs/interfaces/channels/pointers, `defer`, `go`, `select`, conversions, assertions, selectors, indexing, reflection, cgo, and `unsafe`.
81
94
 
82
- Backends reject target reserved words for function names, parameter names, local declarations, assignment targets, call targets, and identifier references before emission. Bindings are never renamed. Python accepts Unicode XID spelling but rejects hard/soft keywords and the annotation/entry capture hazards `_`, `match`, `case`, `type`, `int`, `bool`, `str`, and `print`. TypeScript rejects `arguments` and `eval` for function, parameter, local-declaration, and assignment-target bindings because generated modules are strict mode. PHP rejects exact `GLOBALS`, `_SERVER`, `_GET`, `_POST`, `_FILES`, `_COOKIE`, `_SESSION`, `_REQUEST`, `_ENV`, and `this` parameter bindings; only exact `GLOBALS` and `this` are also rejected for local declarations and assignment targets. PHP function/call names, lowercase near-collisions, assignable non-`GLOBALS` superglobals, and ordinary predefined variables retain their legal roles. Ruby rejects exact `_1` through `_9` function, parameter, local-declaration, and assignment-target bindings while retaining `_10`; references and callees keep their general target identifier policy. JavaScript and other targets retain their own identifier policies. Names owned by generated scaffolding are role-specific: entry locals cannot be `console` in JavaScript/TypeScript or `args`/`System` in Java; function parameters and locals cannot be the generated print receiver `console` in JavaScript/TypeScript or `System` in Java; and module functions cannot be `console` in JavaScript/TypeScript or `puts` in Ruby. Ruby locals named `puts` and PHP locals named `PHP_EOL` remain valid because the generated print forms do not resolve them as local bindings. Java method names and PHP function names occupy namespaces that do not capture their entry scaffolding. PHP boolean printing differs from the other targets; the cross-language execution contract therefore compares a string result rather than claiming portable boolean display formatting.
95
+ Backends reject target reserved words for function names, parameter names, local declarations, assignment targets, call targets, and identifier references before emission. Bindings are never renamed. C# uses a conservative ASCII identifier profile, rejects all C# 14 reserved/contextual words (including the intrinsic `__arglist`, `__makeref`, `__reftype`, and `__refvalue` spellings) and verbatim/normalization-sensitive spellings, reserves semantic method names `Main`, `Program`, and `System`, and forbids parameter/local capture of `System`; ordinary `args` remains legal outside the fixed zero-argument entry scaffold. `System` is also a method collision because the native compiler resolves generated `System.Console` against that member and reports CS0119. C# semantic function names also cannot hide inherited `object` members: `Equals`, `Finalize`, `GetHashCode`, `GetType`, `MemberwiseClone`, `ReferenceEquals`, and `ToString` are rejected before warnings-as-errors compilation. This inherited-member restriction is function-specific, so those spellings remain valid for parameters and locals. Go uses a conservative ASCII identifier profile, rejects all Go keywords plus `_`, and reserves `main`, `fmt`, `int64`, `bool`, `string`, and `true`/`false` where generated scaffolding or predeclared identities would be captured. Python accepts Unicode XID spelling but rejects hard/soft keywords and the annotation/entry capture hazards `_`, `match`, `case`, `type`, `int`, `bool`, `str`, and `print`. TypeScript rejects `arguments` and `eval` for function, parameter, local-declaration, and assignment-target bindings because generated modules are strict mode. PHP rejects exact `GLOBALS`, `_SERVER`, `_GET`, `_POST`, `_FILES`, `_COOKIE`, `_SESSION`, `_REQUEST`, `_ENV`, and `this` parameter bindings; only exact `GLOBALS` and `this` are also rejected for local declarations and assignment targets. PHP function/call names, lowercase near-collisions, assignable non-`GLOBALS` superglobals, and ordinary predefined variables retain their legal roles. Ruby rejects exact `_1` through `_9` function, parameter, local-declaration, and assignment-target bindings while retaining `_10`; references and callees keep their general target identifier policy. JavaScript and other targets retain their own identifier policies. Names owned by generated scaffolding are role-specific: entry locals cannot be `console` in JavaScript/TypeScript or `args`/`System` in Java; function parameters and locals cannot be the generated print receiver `console` in JavaScript/TypeScript or `System` in Java/C#; and module functions cannot be `console` in JavaScript/TypeScript, `puts` in Ruby, `main`/`fmt` in Go, or the C# method/scaffolding collisions listed above. Ruby locals named `puts` and PHP locals named `PHP_EOL` remain valid because the generated print forms do not resolve them as local bindings. Java method names and PHP function names occupy namespaces that do not capture their entry scaffolding. PHP and C# Boolean printing are target-native; cross-language assertions therefore use integer/string results rather than claiming portable Boolean display formatting.
83
96
 
84
97
  ## Diagnostics and limitations
85
98
 
86
- All six frontends preserve exact input content and parser-backed semantic token ranges in module provenance. All 36 input-to-output combinations produce range-based rich maps and Source Map v3 sidecars with UTF-16 coordinates and symbol names. Output code uses LF deterministically. Only JavaScript and TypeScript may opt into inline or external `sourceMappingURL` directives; other targets consume sidecars through Semantifold APIs. Mapping does not imply lossless formatting or support for syntax outside the semantic subset. See [source provenance and mappings](source-maps.md).
99
+ ### Current standard-library limitation and future direction
100
+
101
+ The registered language roles cover only the semantic subset documented above. `semantifold@0.2.0` does not resolve imports or map any language's native standard library; it also lacks the classes/methods, loops, optionals, typed errors, resources, and host operations required for that work. Planned portability uses a language compatibility stdlib/facade, canonical Semantifold stdlib contract/capability, and target host provider/native binding rather than pairwise library rewrites. See the [standard-library portability design](standard-library-portability.md) and [dependency-ordered implementation plan](plans/2026-09-05-standard-library-portability.md).
87
102
 
88
- `UNSUPPORTED_LANGUAGE` is exclusive to unknown or misspelled IDs. `UNSUPPORTED_ROLE` reports a known ID without the requested frontend, text/binary/application backend, artifact, or interoperability role. `UNSUPPORTED_CAPABILITY` reports a role that exists but cannot represent the requested semantic module or target feature. `UNSUPPORTED_SYNTAX` reports parsed constructs outside the subset with the best parser-provided source location. Python uses `MISSING_TYPE` only when a parameter, return, or first-local annotation is absent; a present annotation other than exact `int`, `bool`, or `str` is `UNSUPPORTED_SYNTAX` at that annotation. Parser failures use `PARSE_ERROR`. Semantic resolution/type failures use `DUPLICATE_BINDING`, `UNRESOLVED_BINDING`, `USE_BEFORE_DECLARATION`, `IMMUTABLE_ASSIGNMENT`, and `TYPE_MISMATCH`; flow failures use `NON_BOOLEAN_CONDITION`, `MISSING_RETURN`, `UNREACHABLE_STATEMENT`, `ILLEGAL_RETURN_CONTEXT`, and `UNSUPPORTED_STATEMENT`. Backends validate complete recursive block shape, flow, scalar payloads, binding/type agreement, mutability, identifiers, target bounds, and Java's fixed `Main.java` artifact basename before emission. Missing or structurally invalid blocks, statement arrays/elements, declaration names, mutability, type references, initializers, assignment targets/names, assigned expressions, conditional branches, and call-expression fields in caller-supplied IR use their nearest owning node location and report `UNSUPPORTED_CAPABILITY` rather than leaking a native error or producing partial source. A non-`Main.java` Java basename uses the same located capability diagnostic contract. Artifact-set generation requires a non-empty string language/target ID and accepts only the explicit `text`, `binary`, and `application` backend-role strings; malformed IDs or roles report `INVALID_ARTIFACT_SET` without coercing caller input, while an unknown string ID reports `UNSUPPORTED_LANGUAGE` and a valid role absent from a known registry record reports `UNSUPPORTED_ROLE`. Optional registry roles and backend metadata may be omitted with `undefined`; present malformed values, including `null`, report `INVALID_REGISTRY`. Invalid registry, artifact-set, byte-map, discovery, and runner inputs have their own normalized diagnostics rather than leaking native type or subprocess errors.
103
+ All ten frontends preserve exact input content and parser-backed semantic token ranges in module provenance. The original-six 36-combination matrix remains byte-characterized; Tasks 017–019 and 024 add their own native/managed and original-five crossing coverage. Go's `main.go` has complete range-based rich/v3 mappings; manifest-first `go.mod` has synthetic configuration provenance related to the module root. CPP's `program.cpp` maps original occurrences and synthetic inline support/ordered regions. Output text uses LF deterministically. Only JavaScript and TypeScript may opt into inline or external `sourceMappingURL` directives; C#, Go, C and CPP reject unsupported mapping directive/filename options instead of silently dropping them. Mapping does not imply lossless formatting or support for syntax outside the semantic subset. See [source provenance and mappings](source-maps.md).
104
+
105
+ `UNSUPPORTED_LANGUAGE` is exclusive to unknown or misspelled IDs. `UNSUPPORTED_ROLE` reports a known ID without the requested frontend, text/binary/application backend, artifact, or interoperability role, including C#, Go, and C through a legacy single-artifact API. `UNSUPPORTED_CAPABILITY` reports a role that exists but cannot represent the requested semantic module or target feature. `UNSUPPORTED_SYNTAX` reports parsed constructs outside the subset with the best parser-provided source location. Python, C#, and Go use `MISSING_TYPE` for well-formed missing/inferred explicit types; a present unsupported type is `UNSUPPORTED_SYNTAX` at that annotation. Parser failures use `PARSE_ERROR`. Semantic resolution/type failures use `DUPLICATE_BINDING`, `UNRESOLVED_BINDING`, `USE_BEFORE_DECLARATION`, `IMMUTABLE_ASSIGNMENT`, and `TYPE_MISMATCH`; flow failures use `NON_BOOLEAN_CONDITION`, `MISSING_RETURN`, `UNREACHABLE_STATEMENT`, `ILLEGAL_RETURN_CONTEXT`, and `UNSUPPORTED_STATEMENT`. Backends validate complete recursive block shape, flow, scalar payloads, binding/type agreement, mutability, identifiers, target bounds, and fixed artifact contracts before emission. Missing or structurally invalid caller IR reports located `UNSUPPORTED_CAPABILITY` rather than leaking a native error or producing partial source. A non-`Main.java` Java basename, non-`Program.cs` C# filename, non-`main.go` Go filename, or non-`program.c` C filename uses that same contract. Artifact-set generation requires a non-empty string language/target ID and accepts only the explicit `text`, `binary`, and `application` backend-role strings; malformed IDs or roles report `INVALID_ARTIFACT_SET` without coercing caller input, while an unknown string ID reports `UNSUPPORTED_LANGUAGE` and a valid role absent from a known registry record reports `UNSUPPORTED_ROLE`. Optional registry roles and backend metadata may be omitted with `undefined`; present malformed values, including `null`, report `INVALID_REGISTRY`. Invalid registry, artifact-set, byte-map, discovery, and runner inputs have their own normalized diagnostics rather than leaking native type or subprocess errors.
89
106
 
90
107
  Boxed or coercive types, inferred public types, TypeScript literal/enum/`any`/`unknown`/union types, PHP aliases/nullable declarations, Ruby `boolish`, Java `Boolean`/`char`, null values, floating point, decimal, bigint, symbols, regex values, byte strings, and interpolation are unsupported. Division, remainder, exponentiation, bitwise/shift/update/compound operations, Ruby/PHP `and`/`or`, loose equality, ternary/nullish forms, optional/safe navigation, ranges, casts/assertions, collection/object equality, operator overloading, implicit coercion, and constant folding are also excluded. There is no truthiness, implicit-return or statement-value model, void call statement (roadmap task 005), optional-value model, async/generator model, qualified calls other than Java string `.equals`, classes in the semantic representation, imports, loops, switches, exceptions, overloads, generics, packages, or source-format preservation. Ruby type comments remain a bounded RBS-style convention rather than a full signature parser, and Java generation retains the fixed `Main.java` contract.
108
+
109
+ CPP uses its own [C++20 scalar and scaffold profile](cpp.md), official CPP grammar, one `program.cpp`, by-value owned strings and checked arithmetic. The shared native occurrence planner is backend-only; CPP owns its exact marker and CST recognizer. Native O0/O2 and ASan/UBSan/leak execution are mandatory.
@@ -27,13 +27,13 @@ All Tree-sitter languages use the official `tree-sitter` Node binding. The langu
27
27
  | Owning task | Language | Required upstream route | Qualification state before owner starts |
28
28
  | --- | --- | --- | --- |
29
29
  | 016 | Python | official [`tree-sitter/tree-sitter-python`](https://github.com/tree-sitter/tree-sitter-python) grammar package | blocked until the exact release record above passes |
30
- | 017 | C# | official [`tree-sitter/tree-sitter-c-sharp`](https://github.com/tree-sitter/tree-sitter-c-sharp) grammar package | blocked until the exact release record above passes |
31
- | 018 | C | official [`tree-sitter/tree-sitter-c`](https://github.com/tree-sitter/tree-sitter-c) grammar package | blocked until the exact release record above passes |
32
- | 019 | C++ | official [`tree-sitter/tree-sitter-cpp`](https://github.com/tree-sitter/tree-sitter-cpp) grammar package | blocked until the exact release record above passes |
30
+ | 017 | C# | official [`tree-sitter/tree-sitter-c-sharp`](https://github.com/tree-sitter/tree-sitter-c-sharp) grammar package | passed for exact `tree-sitter-c-sharp@0.23.5`; see the checked-in record below |
31
+ | 018 | C | official [`tree-sitter/tree-sitter-c`](https://github.com/tree-sitter/tree-sitter-c) grammar package | legacy pair qualified inside the bundled root distribution below; source/target work remains blocked until that packaging correction is reviewed, green, merged, and verified |
32
+ | 019 | C++ | official [`tree-sitter/tree-sitter-cpp`](https://github.com/tree-sitter/tree-sitter-cpp) grammar package | exact 0.23.4 qualified with the existing isolated 0.21.1 runtime; see Task 019 record below |
33
33
  | 020 | Rust | official [`tree-sitter/tree-sitter-rust`](https://github.com/tree-sitter/tree-sitter-rust) grammar package | blocked until the exact release record above passes |
34
34
  | 022 | Swift | community [`alex-pinkus/tree-sitter-swift`](https://github.com/alex-pinkus/tree-sitter-swift) candidate plus differential `swiftc` checks | candidate only; blocked until exact release and differential record pass |
35
35
  | 023 | Kotlin/JVM | community [`fwcd/tree-sitter-kotlin`](https://github.com/fwcd/tree-sitter-kotlin) candidate plus differential `kotlinc` checks | candidate only; blocked until exact release and differential record pass |
36
- | 024 | Go | official [`tree-sitter/tree-sitter-go`](https://github.com/tree-sitter/tree-sitter-go) grammar package | blocked until the exact release record above passes |
36
+ | 024 | Go | official [`tree-sitter/tree-sitter-go`](https://github.com/tree-sitter/tree-sitter-go) grammar package | passed for exact `tree-sitter-go@0.25.0`; see the checked-in record below |
37
37
  | 029 | Dart | candidate selected and qualified by Task 029 | intentionally deferred |
38
38
  | 031 | Zig | candidate selected and qualified by Task 031 | intentionally deferred |
39
39
 
@@ -68,3 +68,152 @@ npm pack tree-sitter-python@0.25.0 --dry-run --json
68
68
  ```
69
69
 
70
70
  The accepted Python corpus is `spec/fixtures/{program.py,scalars/program.py,locals/program.py,operators/program.py,statements/program.py}` with SHA-256 values, in that order: `045ac897756dde15066878b56e40c84ee1aabdbd6fd32bddb9d0058ad512972a`, `b4acdda8c4c096ef7d76f83aec7dc148e049a0cd33583c55a79fd18ab1d6f6a6`, `123bb06c0833786168722ad7dfdcb47b95d37b502f6240fde4c12cd60f8e6715`, `35dce1aef96e5dc381baa1b2c39b58232d76b9e14350f0e81c4dd296da77df1e`, and `4907b25568006f65ce749f4c57b4b1eb9c7e6f655ad6be6e014d94c84885ada4`. Run `PYTHONPYCACHEPREFIX="$(mktemp -d)" python3 -m py_compile` over those paths so bytecode remains outside the checkout.
71
+
72
+ ## Task 017 C# qualification
73
+
74
+ Qualification passed in a credential-free empty `/tmp` package on canonical Node `v24.18.1`, npm `11.16.0`, Linux x64, and .NET SDK `10.0.111` (runtime/`Microsoft.NETCore.App` `10.0.11`, RID `ubuntu.26.04-x64`, `Microsoft.NETCore.App.Ref`/`Microsoft.AspNetCore.App.Ref` targeting packs `10.0.11`). Task 017 therefore uses the existing exact `tree-sitter@0.25.1` binding with official registry grammar `tree-sitter-c-sharp@0.23.5`; neither dependency is a Git/archive path or vendored artifact.
75
+
76
+ | Evidence | Qualified result |
77
+ | --- | --- |
78
+ | npm distribution | `tree-sitter-c-sharp@0.23.5`, resolved from `https://registry.npmjs.org/tree-sitter-c-sharp/-/tree-sitter-c-sharp-0.23.5.tgz` with integrity `sha512-xJGOeXPMmld0nES5+080N/06yY6LQi+KWGWV4LfZaZe6srJPtUtfhIbRSN7EZN6IaauzW28v6W4QHFwmeUW6HQ==`; exact peer `tree-sitter@^0.25.0` is satisfied by `0.25.1`. |
79
+ | upstream identity | Official [`tree-sitter/tree-sitter-c-sharp`](https://github.com/tree-sitter/tree-sitter-c-sharp) annotated tag `v0.23.5` (tag object `173c15453b733ccde654032fec7103705b5ad04f`), peeled commit and npm `gitHead` `cac6d5fb595f5811a076336682d5d595ac1c9e85`. |
80
+ | legal and registry provenance | The grammar declares MIT. In the clean exact installation, `npm audit signatures` verified all four installed-package registry signatures and two attestations. The grammar's registry signature, tag/commit identity, package contents, and lockfile integrity were checked; no credential was exposed or requested. |
81
+ | clean Node 24 install/load | With npm auth/token environment variables removed, exact installation and `npm ls --all` passed with zero vulnerabilities. The package has no Node engine declaration, so compatibility was proven empirically: its explicit Node binding import loaded, `Parser#setLanguage` succeeded, and all fixtures parsed through the native binding. |
82
+ | ABI, typing, lifecycle, and package inputs | The grammar declares ABI `15`; `tree-sitter@0.25.1` supports ABI `13`–`15`. The grammar ships typed `bindings/node/index.d.ts`, Linux x64/arm64 prebuilds, grammar C source fallback, and only `install: node-gyp-build`; no runtime downloader is declared. Dry-run packs showed normal registry package contents. No tarball, parser source copy, prebuild, `node_modules`, NuGet cache, `bin`, or `obj` entered the repository. |
83
+ | coordinates and recovery | `child(index)` traversal covered every named, anonymous, comment, nullable directive, error, and missing node. The Node binding exposes UTF-16 code-unit indexes for JavaScript strings despite Tree-sitter's byte-oriented native contract; astral text before an identifier and CRLF probes separated UTF-16 and UTF-8 offsets. The adapter rejects lone surrogates and verifies every boundary through the shared UTF-8-byte-to-UTF-16 converter. Malformed braces, operands, and missing semicolons produced explicit or propagated `hasError`/`isError`/`isMissing`; propagated ancestor error state is rejected even where no distinct `ERROR` child exists. |
84
+ | Tasks 001–004 grammar shapes | The five fixtures proved exact shapes for `preproc_nullable`, file-scoped namespace, class/modifiers, methods/parameters/types, blocks, declarations, carrier comments, assignments, calls/arguments, print member access, checked expressions, all scalar literals/operators, returns, and `if`/`else if`/`else`. Adapter specs retain field and token ranges and reject every unmodeled present child. |
85
+ | official compiler comparison | All five fixture projects restored without external packages, built under .NET 10/C# 14 with warnings as errors and no warning output, and executed with exact expected stdout. Restore, build, and execution were separate; the isolated `NUGET_PACKAGES` path was resolved to an absolute path because the SDK rejects a relative global packages folder. The official grammar needs no community-grammar differential exception. |
86
+
87
+ Reproduce the registry qualification in an empty temporary directory with:
88
+
89
+ ```sh
90
+ npm init -y
91
+ env -u NODE_AUTH_TOKEN -u NPM_TOKEN -u npm_config__auth -u npm_config_token \
92
+ npm install --save-exact tree-sitter@0.25.1 tree-sitter-c-sharp@0.23.5
93
+ npm audit signatures
94
+ npm ls --all
95
+ npm pack tree-sitter@0.25.1 --dry-run --json
96
+ npm pack tree-sitter-c-sharp@0.23.5 --dry-run --json
97
+ ```
98
+
99
+ The accepted C# corpus is `spec/fixtures/{Program.cs,scalars/Program.cs,locals/Program.cs,operators/Program.cs,statements/Program.cs}` with SHA-256 values, in that order: `5ca661d09dff2d775094df99b40e5c5604796c9bff4c32c1da11fa1b4c564a00`, `9cefd6d01c5855480629829489945f2f43338b84879c7a26043963151a8439da`, `ee775fea59ee812212ce325152e4e4cb79c20e699aba081bf39cc698b324444d`, `7137f4acc88dbdc1d0bafd6bb8eb57bed9386daf3e6b11c6fbae3831abceae18`, and `ba63cb72490605437e1efaa7d69ce0abdbfbb07c076aec787bc025e7a277468f`.
100
+
101
+ ## Task 018 legacy C parser boundary qualification
102
+
103
+ The C grammar's compatible published runtime line cannot share Semantifold's root Tree-sitter instance. The one root `semantifold@0.2.0` distribution therefore explicitly bundles root `tree-sitter@0.25.1` for its modern grammars and a private internal package with an isolated exact `tree-sitter@0.21.1` plus `tree-sitter-c@0.23.2` subtree, whose peer range and grammar ABI agree. The renamed private workspace owns source checking and declaration generation but has no export, publication metadata, or release gate. A separately tested `tree-sitter@0.22.4` plus `tree-sitter-c@0.24.1` install was rejected because `Parser#setLanguage` failed with an undefined `nodeTypeNamesById`; an installable graph alone is not qualification.
104
+
105
+ | Evidence | Qualified boundary result |
106
+ | --- | --- |
107
+ | npm distribution | `tree-sitter@0.21.1`, integrity `sha512-7dxoA6kYvtgWw80265MyqJlkRl4yawIjO7S5MigytjELkX43fV2WsAXzsNfO7sBpPPCF5Gp0+XzHk0DwLCq3xQ==`; `tree-sitter-c@0.23.2`, integrity `sha512-9kADOx31AF94DHcrsMGW0zM/2LS6v7wFkPHPVm7RQU+vYVVZMKZ2FJ9e99pm5feqsAcjUzB9CarqDLgRT1Fe/w==`. npm's supported `file:` dependency plus repository-local `install-links=true` materializes the private internal package, and root `bundleDependencies` includes both that package and modern `tree-sitter`. Root `acceptDependencies` accepts only the exact private `0.1.0` payload already in the bundle, so consumers use ordinary `install-links=false`. No alias, override, forced peer, archive dependency, copied binding, or custom materialization stage is used. |
108
+ | upstream identity | Official [`tree-sitter/node-tree-sitter`](https://github.com/tree-sitter/node-tree-sitter) tag/commit `v0.21.1` / `bbdba663dc0b8487f1212524a83a7c39e8a5c3ca`; official [`tree-sitter/tree-sitter-c`](https://github.com/tree-sitter/tree-sitter-c) tag/commit and npm `gitHead` `v0.23.2` / `6a4ae2e08916fd08e5739250bb64a14392b01c99`. |
109
+ | legal and registry provenance | Both upstream packages declare MIT and publish registry signatures. Their exact registry URLs and integrities are recorded in `package-lock.json`; the repository gate verifies installed-package signatures and audits the ordinary dependency graph. The private internal package uses ISC and has no public registry identity. All three dependency licenses remain in the root tarball. |
110
+ | ABI and API | `tree-sitter-c@0.23.2` declares language ABI 14; `tree-sitter@0.21.1` accepts ABI 13–14 and the grammar's peer is `^0.21.1`. The legacy binding provides `child(index)` and `fieldNameForChild(index)` but not the newer `fieldNameForNamedChild` convenience API. The adapter therefore traverses every ordered named and anonymous child and copies field names without exposing binding types. |
111
+ | runtime isolation | A real root tarball installed into a credential-free consumer with a fresh npm cache resolves modern `tree-sitter@0.25.1` at the root and legacy `tree-sitter@0.21.1` plus `tree-sitter-c@0.23.2` below the private internal package at distinct paths. No workspace is present in the consumer and no registry publication of the internal name is required. One Node `v24.18.1` Linux x64 process parses modern Go and legacy C without a native-module collision. Ordinary npm install and peer resolution are mandatory. |
112
+ | private boundary | The internal `parseCst(source)` returns only a recursively frozen `semantifold.parser-cst` version 1 envelope and is absent from Semantifold's public exports. Nodes contain plain scalar state, UTF-16 indices/row-column positions, and ordered frozen `{field, node}` edges. Parser, tree, syntax-node, language, method, function, parent, circular, and source-text values do not cross the boundary. The caller retains source ownership and can slice it by the normalized offsets. |
113
+ | recovery and coordinates | Astral text before a later definition plus CRLF separates UTF-8 bytes from UTF-16 code units; the snapshot retains exact UTF-16 indices and row/column positions. Comments remain visible as extra nodes. A missing closing brace propagates `hasError` and preserves the missing node rather than recovering through source text. |
114
+ | lifecycle and package inputs | The native dependencies use only `install: node-gyp-build` and have no runtime downloader. The root tarball retains licenses, `binding.gyp`, and native source fallback for both Tree-sitter bindings plus the C grammar's `binding.gyp` and generated parser source. Modern `tree-sitter@0.25.1` includes Darwin, Linux, and Windows x64/arm64 prebuilds; legacy `tree-sitter@0.21.1` includes Darwin arm64/x64, Linux x64, and Windows x64 prebuilds; `tree-sitter-c@0.23.2` includes Darwin, Linux, and Windows x64/arm64 prebuilds. Only Linux x64 native loading and execution were tested. Other listed platforms rely on upstream prebuild selection or source compilation and are packaging-presence claims, not execution claims. Source fallback additionally requires a compatible compiler toolchain and consumer npm policy permitting the upstream `node-gyp-build` install scripts; fallback compilation was not executed here. Accidental `build/Debug` or `build/Release` output is rejected from the pack proof. |
115
+ | task boundary | This record qualifies only the runtime/package boundary. It does not implement or claim the Task 018 C frontend, semantic normalization, backend, registry, toolchain, compiler comparison, or Tasks 001–004 C corpus. That prerequisite was completed through https://github.com/kaspernj/semantifold/pull/19 at `9184660a21820b429138f0632c89df956a2e350f`; Task 018 implementation and native acceptance are recorded separately below. No package publication is part of that prerequisite. |
116
+
117
+ Reproduce the repository-owned proof on Node 24 with:
118
+
119
+ ```sh
120
+ npm ci
121
+ npx velocious-test spec/tree-sitter-legacy-adapter.spec.js
122
+ npx velocious-test spec/tree-sitter-legacy-packed-consumer.spec.js
123
+ npm ls --all
124
+ npm pack --dry-run --json
125
+ ```
126
+
127
+ The packed-consumer spec creates the root tarball, fresh cache, and consumer only under unique temporary directories. It removes all inherited npm configuration and token variables case-insensitively, uses empty user/global npm config files and explicit `https://registry.npmjs.org/`, and asserts default `install-links=false` even when supplied synthetic alternate configuration. Before packing, the source/installed consistency gate rejects stale local-package copies; normal root `npm ci` is the recovery after shipped source edits. The spec compares bundled internal files with source and runs default `npm install` followed by default `npm ci`. After each it checks the complete installed lock/tree and real runtime paths, compiles a root API type consumer, and executes both parsers in one process. Cache inspection rejects internal or retired registry lookups; `finally` removes the fixture. Publication is intentionally excluded from this qualification.
128
+
129
+ The dependency declaration follows npm's implemented [acceptDependencies contract](https://github.com/npm/rfcs/blob/main/implemented/0023-acceptDependencies.md): an already-present exact package can satisfy the edge, but new resolution uses only `dependencies`, here the local `file:` source. It does not relax either native runtime or grammar version and is not an override. With npm 11.16.0, a direct private-workspace fixture packed the legacy bindings under `packages/internal/node_modules` while placing the workspace payload under `node_modules`, leaving the installed boundary unresolved. The materialized local dependency instead packs the complete subtree under its real module directory; the source-byte gate and default-consumer proof protect both halves of that contract.
130
+
131
+ ## Task 024 Go qualification
132
+
133
+ Qualification passed in a credential-free empty `/tmp` package on canonical Node `v24.18.1`, npm `11.16.0`, Linux x64, and Go `go1.26.0 linux/amd64` with GOROOT `/usr/lib/go-1.26`. Task 024 therefore uses the existing exact `tree-sitter@0.25.1` binding with official registry grammar `tree-sitter-go@0.25.0`; neither dependency is a Git/archive path or vendored artifact.
134
+
135
+ | Evidence | Qualified result |
136
+ | --- | --- |
137
+ | npm distribution | `tree-sitter-go@0.25.0`, resolved from `https://registry.npmjs.org/tree-sitter-go/-/tree-sitter-go-0.25.0.tgz` with integrity `sha512-APBc/Dq3xz/e35Xpkhb1blu5UgW+2E3RyGWawZSCNcbGwa7jhSQPS8KsUupuzBla8PCo8+lz9W/JDJjmfRa2tw==`; peer `tree-sitter@^0.25.0` is satisfied by exact `tree-sitter@0.25.1` with integrity `sha512-mrcEdkYtHfrK1A6fs3O6FxkBo0Qig5XUXqHhxUOQu0bmPo00QF4XaSx4edpazdHwxnSCjlGKGgIqWdaN4dvTLA==`. |
138
+ | upstream identity | Official [`tree-sitter/tree-sitter-go`](https://github.com/tree-sitter/tree-sitter-go) annotated tag `v0.25.0` (tag object `6048bfc6e5238eaf062c2221bd934489c39fbb61`), peeled commit and npm `gitHead` `1547678a9da59885853f5f5cc8a99cc203fa2e2c`. The binding is official tag `v0.25.1`, npm `gitHead` `75a0eccfedc491e26843bd744bb6806f8a8bfff4`. |
139
+ | legal and registry provenance | Both packages declare MIT. `npm audit signatures` verified all four installed-package registry signatures and two attestations with no invalid or missing signature. The binding publishes npm SLSA provenance; the grammar has a verified registry signature but did not advertise an npm attestation, so tag/commit identity and registry integrity were checked independently. |
140
+ | clean install/load | With npm auth/token environment variables removed, `npm install --save-exact tree-sitter@0.25.1 tree-sitter-go@0.25.0` succeeded from the registry in a fresh package with zero vulnerabilities. `npm ls --all` resolved only `node-addon-api@8.9.2`, `node-gyp-build@4.8.4`, the exact binding, and the exact grammar. The explicit ESM import loaded on Node 24, `Parser#setLanguage` succeeded, and typed `nodeTypeInfo` exposed 188 grammar entries. |
141
+ | ABI, typing, lifecycle, and package inputs | The shipped grammar declares ABI `15`; `tree-sitter@0.25.1` accepts ABI `13` through `15`. The grammar declaration exposes its language handle and `NodeInfo[]` metadata. Both packages use only `install: node-gyp-build`, with no downloader URL or extra lifecycle dependency. Dry-run packs contained 80 binding files (1,594,590-byte archive) and 25 grammar files (558,540-byte archive), including declarations, licenses, platform prebuilds, and source fallback. No archive, prebuild, generated parser, native binary, `node_modules`, or qualification output entered Semantifold. |
142
+ | coordinates, comments, and recovery | The Node binding exposed UTF-16 code-unit indexes: after astral text and CRLF, one literal occupied indexes 61–65 while raw UTF-8 byte boundaries were 63–69; both round-tripped through `utf8ByteOffsetToUtf16Offset()`. Lone surrogates were rejected before parsing. Ordinary and `//go:`, `// +build`, and `//line` directive comments remained visible nodes. Malformed package clauses, parameter lists, missing operands, braces, semicolons, and incomplete strings all exposed `hasError`, `isError`, or `isMissing`. |
143
+ | Tasks 001–004 tree corpus | Exhaustive `child(index)` traversal covered every named and anonymous child, token, comment, and `fieldNameForChild` edge in all five fixtures. Observed shapes include the exact package/import/function/parameter/type/result/block scaffold; variable declarations/specs; assignment/expression lists; returns, calls, arguments, and selectors; parentheses; every accepted scalar/operator node; and nested `if`/`else if`/`else`. No source scan supplied missing structure. |
144
+ | official-tool differential | Matching `/usr/lib/go-1.26/bin/gofmt -d` produced no diff for all five fixtures. In separate dependency-free modules with fixed `go.mod`, every fixture passed offline/local, cgo-disabled `go build`, mandatory `go vet`, and `go run` with exact output. A no-import sample passed `go tool compile`. All six malformed samples were rejected by both `gofmt` and `go tool compile`. A slice/range/short-declaration sample parsed, formatted, built, vetted, and ran under official Go, establishing the intentional valid-but-`UNSUPPORTED_SYNTAX` differential boundary. No `go.sum`, `go.work`, vendor tree, or source mutation appeared. |
145
+ | toolchain isolation | Every Go process used `GOTOOLCHAIN=local`, `GOPROXY=off`, `GOSUMDB=off`, `GOVCS=off`, `CGO_ENABLED=0`, `GOENV=off`, `GOWORK=off`, `GOOS=linux`, `GOARCH=amd64`, and separate absolute cache/module/GOPATH/temp/home paths. `/usr/bin/gofmt` resolved to `/usr/lib/go-1.26/bin/gofmt`, the same verified GOROOT as `go`. |
146
+
147
+ Reproduce the registry qualification in a fresh empty temporary directory with:
148
+
149
+ ```sh
150
+ npm init -y
151
+ env -u NODE_AUTH_TOKEN -u NPM_TOKEN -u npm_config__auth -u npm_config_token \
152
+ npm install --save-exact tree-sitter@0.25.1 tree-sitter-go@0.25.0
153
+ npm audit signatures
154
+ npm ls --all
155
+ npm pack tree-sitter@0.25.1 --dry-run --json
156
+ npm pack tree-sitter-go@0.25.0 --dry-run --json
157
+ ```
158
+
159
+ The accepted Go corpus is `spec/fixtures/{program.go,scalars/program.go,locals/program.go,operators/program.go,statements/program.go}` with SHA-256 values, in that order: `5f4ad40a233d8728c90ca885d4bfe6f018f1d7a5e6f2e2cfb97b4b9db4887f1c`, `6d4251def8b1bccdff177df901bf9fe109a8a01ae1514cb8d5aaf364298669b9`, `a7b6eb2f5eae0a20d7cd4982e4d26cc6653760ad03e8b21ff5c360239861dd6f`, `4a263413830a41a59b6d8326a78067826853e3491e65d52559e5acea0d9cf56c`, and `d64f083d70697d25d2ea7f5c7a44cada0ab13a878640fd10bc547df185fa7bba`.
160
+
161
+ ## Task 018 C integration
162
+
163
+ The C frontend consumes the unchanged frozen parser-neutral legacy boundary qualified above. It adds no native dependency, archive, copied parser, workspace identity, consumer flag or override. Complete C child/field/token traversal, recovery rejection, exact generated-region reconstruction and full canonical-CST comparison are covered by `spec/c-frontend-validation.spec.js` and `spec/c-ordered-expressions.spec.js`. The five checked-in `program.c` fixture profiles pass generated-source round trips and original-five bidirectional execution. Unicode/NUL, every operation/consumer, eager/short-circuit effects and arena/fatal paths run through real separate Clang compile/link/native execution at O0/O2, ordinary and sanitized. The ordinary packed-root consumer now additionally exercises public C parse/generate/reparse and C API typing after both default install and clean npm ci; it preserves the existing credential-free configuration and cache proof. This is implementation regression coverage, not another packaging review. See [C semantics and scaffolds](c.md), [toolchain qualification](testing.md) and [the delivery record](../todo/018-c-source-and-target.md).
164
+
165
+ ## Task 019 C++ grammar qualification — 2026-09-08
166
+
167
+ This record precedes the dependency manifest change. The official C++ grammar is selected explicitly inside the existing private runtime; the C grammar is not a C++ parser. The root distribution and both existing Tree-sitter versions remain unchanged.
168
+
169
+ | Evidence | Qualified result |
170
+ | --- | --- |
171
+ | Official npm release | `tree-sitter-cpp@0.23.4`, registry URL `https://registry.npmjs.org/tree-sitter-cpp/-/tree-sitter-cpp-0.23.4.tgz`, integrity `sha512-qR5qUDyhZ5jJ6V8/umiBxokRbe89bCGmcq/dk94wI4kN86qfdV8k0GHIUEKaqWgcu42wKal5E97LKpLeVW8sKw==`. Latest registry tag at qualification was 0.23.4. |
172
+ | Upstream identity and license | Official [tree-sitter/tree-sitter-cpp](https://github.com/tree-sitter/tree-sitter-cpp/tree/v0.23.4), tag `v0.23.4` and npm gitHead both `f41e1a044c8a84ea9fa8577fdd2eab92ec96de02`; MIT license present in the registry package. `git ls-remote` verified the tag. |
173
+ | Ordinary peer graph | Optional peer `tree-sitter@^0.21.1`, grammar ABI 14; exact existing binding 0.21.1 accepts ABI 13–14. Grammar dependency `tree-sitter-c@^0.23.1` dedupes to the existing exact 0.23.2. Clean install and `npm ls --all` resolved these three packages plus node-addon-api 8.9.2 and node-gyp-build 4.8.4, without overrides, force, peer bypass, aliases or a third runtime. |
174
+ | Node and supply chain | Node v24.18.1, npm 11.16.0, Linux x64 as UID1000. Fresh run-local package/cache, empty user/global npm configuration, explicit public registry, inherited npm configuration/token variables removed. Ordinary exact installation succeeded with zero vulnerabilities. `npm audit signatures` verified five registry signatures and one attestation. |
175
+ | Native and typed API | Actual ESM import, `new Parser()`, `setLanguage(CPP)`, parse and exhaustive `child(index)` / `fieldNameForChild(index)` traversal passed beside C in the same process. The declaration's `setLanguage` returns void and fields are nullable; a strict NodeNext typed consumer passed without casts or skipLibCheck, using the repository's Node types. The grammar includes typed `nodeTypeInfo`. |
176
+ | Corpus and coordinates | Five source probes traversed 390 named/anonymous/comment nodes, including qualified scalar types, initialized const/mutable locals, assignment, returns, calls, literals, typed operators, nested/fallthrough branches and main. CPP uses `condition_clause`, independently of C's shape. Astral comment plus CRLF put the next definition at UTF-16 index 10 / UTF-8 byte 12, row 1 column 0. Comments remain explicit extras. |
177
+ | Malformed input and limits | Missing brace and operand produce missing nodes; malformed parameters/string produce ERROR nodes; all four propagate hasError. CPP rejects the same source through the C grammar while CPP accepts it. The binding accepts 32767 UTF-16 units and throws at 32768; adapters must preflight this limit. |
178
+ | Lifecycle and packaged inputs | Only install lifecycle is `node-gyp-build`; no runtime network downloader. Dry-run registry pack reports 27 files, 3,208,986 compressed / 42,392,814 unpacked bytes, including MIT license, declarations, grammar source, native source fallback, Darwin/Linux/Windows x64/arm64 prebuilds and upstream WASM. Only Linux x64 native loading was executed. No archive, vendored grammar/binary or additional publication identity is added to this repository. |
179
+
180
+ Reproduce in an empty temporary package using Node24 and credential-free public npm configuration:
181
+
182
+ ```sh
183
+ npm init -y
184
+ npm install --save-exact tree-sitter@0.21.1 tree-sitter-c@0.23.2 tree-sitter-cpp@0.23.4
185
+ npm ls --all
186
+ npm audit signatures
187
+ npm pack tree-sitter-cpp@0.23.4 --dry-run --json
188
+ node --input-type=module - <<'JS'
189
+ import Parser from 'tree-sitter'
190
+ import CPP from 'tree-sitter-cpp'
191
+ const parser = new Parser()
192
+ parser.setLanguage(CPP)
193
+ const source = '/* 😀 */\r\nstd::string copy(std::string a, std::string b) { return a; }\n'
194
+ const root = parser.parse(source).rootNode
195
+ function visit(node) {
196
+ if (node.hasError || node.isError || node.isMissing) throw new Error(node.type)
197
+ for (let i = 0; i < node.childCount; i++) {
198
+ console.log(node.fieldNameForChild(i), node.child(i).type)
199
+ visit(node.child(i))
200
+ }
201
+ }
202
+ visit(root)
203
+ console.log(root.namedChildren[1].startIndex, root.namedChildren[1].startPosition)
204
+ JS
205
+ ```
206
+
207
+ The complete initial corpus, source SHA-256 values, typed consumer, tree/ABI/package inventory and command logs are retained in the Task019 implementation run's `qualification/` and `evidence/` directories. The repository's private-boundary and CPP behavior specs retain executable regression coverage. Grammar qualification does not claim frontend/backend acceptance, packed-consumer success or CI completion.
208
+
209
+ The initial qualification corpus is now retained verbatim in the repository (these hashes were recorded before dependency edits):
210
+
211
+ | Corpus path | SHA-256 |
212
+ | --- | --- |
213
+ | `spec/fixtures/cpp-qualification/corpus-1.cpp` | `6e5763ff158809f0c750011765421c688978e755598cf1c738bd6e9863ccb6e5` |
214
+ | `spec/fixtures/cpp-qualification/corpus-2.cpp` | `0a57ddb7fa84e7f1522452f520898d8e3d99ced6857e85b00d4e6dd327c15835` |
215
+ | `spec/fixtures/cpp-qualification/corpus-3.cpp` | `b9be8da90243dbd9bdcebe3ee9569f2933ba24ddae38b342220183f6c72cf3e7` |
216
+ | `spec/fixtures/cpp-qualification/corpus-4.cpp` | `ec88c7a47a7167b0ad4d2d07744e8d71404551b91a9db927c8d476f6de23a110` |
217
+ | `spec/fixtures/cpp-qualification/corpus-5.cpp` | `a7524580af4881083d2fbf95f9a7b9f940320c2d2c35d3b188094598cca27f59` |
218
+
219
+ Reproduce exhaustive frozen-edge traversal, coordinate and recovery checks with `npx velocious-test spec/cpp-parser-qualification.spec.js`. The generated Tasks001–004 fixtures are independently accepted by `spec/cpp-cross-language-acceptance.spec.js`; the small grammar probes above qualify CST coverage, not semantic acceptance or native compilation of a complete supported program.
@@ -0,0 +1,46 @@
1
+ # Standard-library portability implementation plan
2
+
3
+ Date: 2026-09-05
4
+
5
+ Status: dependency-ordered future plan; no implementation is claimed.
6
+
7
+ ## Goal and architecture reference
8
+
9
+ Deliver the first bounded proof of the [standard-library portability architecture](../standard-library-portability.md): language compatibility stdlib/facades and target host providers/native bindings meet only through versioned canonical Semantifold stdlib contracts/capabilities. Pair-specific adapters and direct behavior-changing rewrites are excluded.
10
+
11
+ ## Why semantic prerequisites come first
12
+
13
+ The current `semantifold@0.2.0` IR cannot express imports, general signatures, receiver calls, classes, loops, optional EOF, typed failures, resource identities, ownership, or close effects. Encoding a socket facade before those meanings exist would push language behavior into parser adapters, emitters, or handwritten source-to-target bridges. That would make evaluation order, EOF, failure, and lifetime accidental and prevent other facades/providers from sharing the work.
14
+
15
+ The sequence therefore establishes general language semantics first, then defines capability/provider infrastructure, and only then adds a facade and concrete network slice. Numerical task order records this dependency flow; it is not a promise that the work is complete or immediately scheduled.
16
+
17
+ ## Dependency-ordered sequence
18
+
19
+ 1. Complete existing prerequisites [Task 004](../../todo/004-statement-sequencing-and-conditionals.md) and [Task 005](../../todo/005-general-function-signatures-and-calls.md), then add [Task 032 — condition-controlled loops and break/continue](../../todo/032-condition-controlled-loops-and-break.md). This supplies a general strict-Boolean loop model without recognizing stdlib-specific read-loop idioms.
20
+ 2. Complete [Task 009](../../todo/009-closed-records-and-member-access.md), then add [Task 033 — reference classes, methods, and constructors](../../todo/033-reference-classes-methods-and-constructors.md). Executable facades need bounded nominal reference identity, private state, construction, and receiver calls; immutable records alone are insufficient.
21
+ 3. Build on optionals, typed failures, and reference classes with [Task 034 — effectful capabilities and resource lifetime](../../todo/034-effectful-capabilities-and-resource-lifetime.md). It defines explicit host effects, resource ownership, deterministic close, and typed failure boundaries without claiming async, concurrency, `finally`, or RAII.
22
+ 4. Build project/module and effect foundations into [Task 035 — versioned standard-library contracts and provider linking](../../todo/035-versioned-standard-library-contracts-and-provider-linking.md). This owns canonical capability modules, provider registry/negotiation, protected native bindings, transactional linking, and tree-shaking.
23
+ 5. Add [Task 036 — language compatibility stdlib/facades](../../todo/036-language-compatibility-stdlib-facades.md). It owns proved stdlib identity, executable source-language facades, collision-safe target names, and same-language recursion isolation.
24
+ 6. Combine the loop and facade branches in [Task 037 — blocking TCP client stdlib vertical slice](../../todo/037-blocking-tcp-client-stdlib-vertical-slice.md). This is the first concrete proof, not a general networking or all-language milestone.
25
+
26
+ The direct dependency chain is also recorded in the [roadmap graph and task index](../../todo/README.md). Phase S stays non-blocking until its prerequisite tasks are delivered; it must not distort the existing language/platform lanes.
27
+
28
+ ## First end-to-end proof
29
+
30
+ Task 037 provides only these initial integrations:
31
+
32
+ - canonical versioned blocking `SocketClient`, text-stream line-read, output, and resource-close capabilities;
33
+ - Ruby language compatibility stdlib/facades preserving the supported `TCPSocket.new(host, port)`, `gets`, and `close` shape plus bounded one-string `puts(string)`/`Kernel.puts(string)`;
34
+ - a canonical output operation that writes the string once and appends LF only when it does not already end in LF;
35
+ - a PHP target host provider/native binding implemented with genuine `fsockopen`, `fgets`, and `fclose` for socket operations plus native stdout output without a duplicate LF; and
36
+ - generated PHP that can retain `TCPSocket` and the bounded `puts` function in a collision-safe compatibility namespace/import alias while they call canonical provider operations.
37
+
38
+ Acceptance starts a real local ephemeral TCP server controlled by the test. Generated PHP runs with the real PHP CLI and must prove exact output, retained input newlines, one appended LF for a final unterminated string, no duplicate LF, an absent result only at clean EOF, normalized connection error before a usable resource escapes, deterministic successful close, the specified repeated-close result, and a typed use-after-close failure. The server and client tests use bounded timeouts so blocking behavior cannot hang the lane.
39
+
40
+ Negative acceptance covers unresolved or shadowed `TCPSocket` or `puts`, monkey-patching/reopening, dynamic require/lookup, unsupported APIs/options, excluded multi-argument/array/coercive/custom-separator `puts` behavior, missing provider capabilities, namespace collisions, version mismatch, and late provider/link failure. Every failure occurs before partial artifact exposure.
41
+
42
+ ## Delivery discipline for future implementation
43
+
44
+ Each behavior task must add focused specs, exact public contracts, documentation, and a changelog fragment. Runtime-generation coverage must invoke the real required tools and a real local socket; source snapshots are insufficient. Implementations must validate and return deterministic complete artifact sets, retain semantic/synthetic provenance, and fail if a required tool is unavailable.
45
+
46
+ This planning change itself adds no compiler/runtime behavior, dependency, generated output, spec, or changelog fragment. It does not trigger release, CI topology, external task mutation, or implementation of the listed tasks.
@@ -1,12 +1,14 @@
1
1
  # Source provenance and mappings
2
2
 
3
+ C `program.c` uses the same rich/v3 contracts. Original operator, callee, literal, binding and final-consumer tokens retain their parser origins, including after exact ordered-region reconstruction. Generated temporary declarations/names, short-circuit control, markers, prototypes, unused-binding uses and cleanup are synthetic with related semantic origins. Shared semantic objects have separate occurrence paths and temporaries. `semantifold_runtime.h` is a synthetic support artifact related to the module root. C accepts no source-map directive or alternate map filename; use `generateArtifactSet()` and its mapped entry provenance. See the [C profile](c.md).
4
+
3
5
  Semantifold keeps one authoritative, language-neutral provenance chain:
4
6
 
5
7
  ```text
6
8
  generated UTF-16 range -> semantic node/symbol -> original UTF-16 range
7
9
  ```
8
10
 
9
- This works for PHP, Ruby, JavaScript, TypeScript, and Java inputs and outputs. It is not limited to JavaScript `sourceMappingURL` comments. `SemantifoldMapping` v1 is the authoritative range model; every generated artifact also includes an ECMA-426/Source Map v3 projection for existing tooling.
11
+ This works for PHP, Ruby, JavaScript, TypeScript, Java, Python, C#, and Go inputs and mapped text outputs. It is not limited to JavaScript `sourceMappingURL` comments. `SemantifoldMapping` v1 is the authoritative range model; every generated program artifact also includes an ECMA-426/Source Map v3 projection for existing tooling.
10
12
 
11
13
  ## Parsing and semantic provenance
12
14
 
@@ -66,7 +68,7 @@ artifact.sourceMap // encoded Source Map v3 object
66
68
  artifact.sourceMapFilename
67
69
  ```
68
70
 
69
- Default filenames are `program.php`, `program.rb`, `program.js`, `program.ts`, `Main.java`, and `program.py`. Defaults apply only when `filename` or `sourceMapFilename` is omitted (`undefined`); an explicitly supplied `null` remains invalid. Java artifacts may include directories but must retain the basename `Main.java`, matching the generated public class and making the returned filename directly compilable; any other basename is a located `UNSUPPORTED_CAPABILITY` diagnostic for the Java backend. Python artifacts likewise may include directories but retain the deterministic basename `program.py`; Python adds no package, environment, requirements, or dependency metadata. `sources` may supply exact content for legacy or caller-assembled multi-source IR:
71
+ Default filenames for single-text targets are `program.php`, `program.rb`, `program.js`, `program.ts`, `Main.java`, and `program.py`. Defaults apply only when `filename` or `sourceMapFilename` is omitted (`undefined`); an explicitly supplied `null` remains invalid. Java artifacts may include directories but must retain the basename `Main.java`, matching the generated public class and making the returned filename directly compilable; any other basename is a located `UNSUPPORTED_CAPABILITY` diagnostic for the Java backend. Python artifacts likewise may include directories but retain the deterministic basename `program.py`; Python adds no package, environment, requirements, or dependency metadata. C# is available only through `generateArtifactSet()`: `filename` must be omitted or exact `Program.cs`, and `mapDirective`/`sourceMapFilename` must be omitted. It returns mapped `Program.cs` first and a fixed synthetic `Semantifold.csproj` manifest second. Go also requires `generateArtifactSet()`: `filename` must be omitted or exact `main.go`, mapping options must be omitted, and generation returns fixed synthetic `go.mod` first followed by mapped `main.go`. `sources` may supply exact content for legacy or caller-assembled multi-source IR:
70
72
 
71
73
  ```js
72
74
  generateArtifact({
@@ -79,7 +81,7 @@ generateArtifact({
79
81
  })
80
82
  ```
81
83
 
82
- `generateArtifactSet()` wraps this exact result for original-five single-text targets and supplies one generated entry artifact, plus the referenced serialized mapping artifact when an external JavaScript-family directive is requested. `createGeneratedArtifactSet()` validates other single-module target shapes without introducing Task 010's source-project semantics. Its dense artifact array preserves caller/backend order and requires unique safe relative POSIX paths without file/directory prefix collisions, non-empty text or bytes, media types, one of `entry`/`source`/`manifest`/`support`/`mapping`/`resource`/`loader`, generated ownership, provenance, and exactly one entry. Binary storage remains private and every `content` read returns a detached `Uint8Array`, so mutations cannot alter the validated artifact or drift from byte provenance. Backends return no iterable or partial files: the complete set is validated before it becomes observable. Generation and set construction never write files.
84
+ `generateArtifactSet()` wraps this exact result for the six single-text targets and supplies one generated entry artifact, plus the referenced serialized mapping artifact when an external JavaScript-family directive is requested. For C#, it transactionally returns exactly `Program.cs` (role `entry`, `text/x-csharp`, rich/v3 text provenance) and `Semantifold.csproj` (role `manifest`, `application/xml`, synthetic provenance with the module's canonical root origin as a related origin). For Go it transactionally returns `go.mod` (role `manifest`, `text/plain`) before `main.go` (role `entry`, `text/x-go`, rich/v3 text provenance). The manifest is the exact LF-terminated module `example.com/semantifold/generated` with `go 1.26.0`; its source-free configuration provenance relates back to the module root, and the dependency-free module needs and produces no `go.sum`. `createGeneratedArtifactSet()` validates these and other single-module target shapes without introducing Task 010's source-project semantics. Its dense artifact array preserves caller/backend order and requires unique safe relative POSIX paths without file/directory prefix collisions, non-empty text or bytes, media types, one of `entry`/`source`/`manifest`/`support`/`mapping`/`resource`/`loader`, generated ownership, provenance, and exactly one entry. Binary storage remains private and every `content` read returns a detached `Uint8Array`, so mutations cannot alter the validated artifact or drift from byte provenance. Backends return no iterable or partial files: the complete set is validated before it becomes observable. Generation and set construction never write files.
83
85
 
84
86
  All outputs have deterministic LF newlines. Returned rich mappings are detached from caller-owned semantic locations and provenance before they are deeply frozen and internally indexed after trust-boundary validation. Freezing an artifact mapping therefore never freezes the mutable semantic module used to generate it. The rich map's `generated.content` is the exact returned code and its ordered, non-empty spans cover every UTF-16 code unit without gaps or overlaps:
85
87
 
@@ -118,7 +120,7 @@ Text artifact provenance embeds the validated rich mapping and Source Map v3 pro
118
120
 
119
121
  ## Source Map v3 and directives
120
122
 
121
- `artifact.sourceMap` exists for all six text targets and is generated with `@jridgewell/gen-mapping`; lookup, import, and artifact-set validation use `@jridgewell/trace-mapping`. Semantifold does not hand-code VLQ or tracing. Artifact-set validation requires dense `sources`, `names`, and optional `sourcesContent` arrays, decodes and canonically re-encodes the mapping payload, requires standard one-, four-, or five-field segments, rejects source or name indices outside their declared arrays, and requires the complete v3 value to equal the existing `toSourceMapV3()` projection of the accepted rich mapping. That projection comparison covers generated and original positions, source and name indexes, content, and the documented trailing unmapped directive span without a second encoder. The v3 map contains deterministic `file`, `sources`, `sourcesContent`, `names`, and `mappings` fields.
123
+ `artifact.sourceMap` exists for all six single-text target artifacts, C#'s `Program.cs`, and Go's `main.go`; it is generated with `@jridgewell/gen-mapping`. Lookup, import, and artifact-set validation use `@jridgewell/trace-mapping`. Semantifold does not hand-code VLQ or tracing. Artifact-set validation requires dense `sources`, `names`, and optional `sourcesContent` arrays, decodes and canonically re-encodes the mapping payload, requires standard one-, four-, or five-field segments, rejects source or name indices outside their declared arrays, and requires the complete v3 value to equal the existing `toSourceMapV3()` projection of the accepted rich mapping. That projection comparison covers generated and original positions, source and name indexes, content, and the documented trailing unmapped directive span without a second encoder. The v3 map contains deterministic `file`, `sources`, `sourcesContent`, `names`, and `mappings` fields.
122
124
 
123
125
  Directives are opt-in and only valid for JavaScript and TypeScript:
124
126
 
@@ -127,7 +129,7 @@ generateArtifact({language: "javascript", module, mapDirective: "external"})
127
129
  generateArtifact({language: "typescript", module, mapDirective: "inline"})
128
130
  ```
129
131
 
130
- `external` appends `//# sourceMappingURL=<relative-map-url>`. `artifact.sourceMapFilename` remains the map artifact's literal logical filename, while the directive is relative to `artifact.filename`'s directory and URL-encodes each filesystem path segment without encoding structural slashes. Both logical paths resolve against one synthetic artifact root before relativization, so mixed leading-parent depths do not become false common segments; for example, generated `../../dist/out.js` and map `../maps/out.js.map` emit `../maps/out.js.map`. `dist/program.js` still advertises `dist/program.js.map` and emits `sourceMappingURL=program.js.map`; a literal `#` or `?` in the sidecar filename is emitted as `%23` or `%3F`. Names containing any ECMAScript line terminator—LF, CR, U+2028, or U+2029—are rejected before emission. `generateArtifactSet()` makes that reference materializable by adding the LF-terminated deterministic JSON serialization of `artifact.sourceMap` at the advertised safe path with role `mapping`; `generateArtifact()` retains its existing sidecar-object contract. `inline` appends a UTF-8 base64 data URL. The default is `none`. PHP, Ruby, and Java still receive sidecar map objects but never receive non-native map comments. Native Java debugger mapping such as JSR-45 would require class-file/toolchain integration and is not part of v1.
132
+ `external` appends `//# sourceMappingURL=<relative-map-url>`. `artifact.sourceMapFilename` remains the map artifact's literal logical filename, while the directive is relative to `artifact.filename`'s directory and URL-encodes each filesystem path segment without encoding structural slashes. Both logical paths resolve against one synthetic artifact root before relativization, so mixed leading-parent depths do not become false common segments; for example, generated `../../dist/out.js` and map `../maps/out.js.map` emit `../maps/out.js.map`. `dist/program.js` still advertises `dist/program.js.map` and emits `sourceMappingURL=program.js.map`; a literal `#` or `?` in the sidecar filename is emitted as `%23` or `%3F`. Names containing any ECMAScript line terminator—LF, CR, U+2028, or U+2029—are rejected before emission. `generateArtifactSet()` makes that reference materializable by adding the LF-terminated deterministic JSON serialization of `artifact.sourceMap` at the advertised safe path with role `mapping`; `generateArtifact()` retains its existing sidecar-object contract. `inline` appends a UTF-8 base64 data URL. The default is `none`. PHP, Ruby, Java, and Python still receive sidecar map objects but never receive non-native map comments. C# and Go reject even an explicitly supplied `none`, because multi-backend options must not be silently consumed and their fixed multi-artifact projects have no source-map directive contract. Native Java debugger mapping, C# portable-PDB integration, and Go compiler source-map integration would require compiler-artifact integration and are not part of v1.
131
133
 
132
134
  The directive itself is an unmapped synthetic rich-map span. `artifact.sourceMap` is computed for the program before that self-referential comment is appended; this is required for a stable inline data URL and is the conventional v3 behavior. Use the rich mapping when the directive span itself matters. Rich registries may distinguish same-named sources by `sourceId`; Source Map v3 identifies sources by filename, so callers should use unique filenames when exporting such an assembled registry to v3.
133
135
 
@@ -159,3 +161,7 @@ Validation constructs source line starts once, verifies ranges in linear passes,
159
161
  The feature is source-compatible and additive: `generate()` bytes are characterized for both existing fixture profiles, legacy semantic modules remain valid, and existing `location` fields are unchanged. Parsed modules now serialize an additional enumerable `provenance` property, so consumers that compare or persist entire module JSON should consciously include or omit it.
160
162
 
161
163
  Semantifold is pre-1.0. The recommended release is a minor bump from `0.1.x` to `0.2.0`, with no npm publication as part of this implementation. A future incompatible provenance or mapping representation must use a new schema version rather than reinterpret version 1.
164
+
165
+ ## CPP text provenance
166
+
167
+ The `cpp` lane emits one `program.cpp` with deterministic rich and Source Map v3 data. Original CPP operator/callee/type/consumer tokens remain mapped through exact ordered-region reconstruction. Inline runtime support, prototypes, temporary declarations/uses, discards, paired markers and short-circuit control are synthetic ranges related to original semantic occurrences. The six-digit occurrence namespace is shared with C’s planning algorithm; CPP marker language and CST validation are independent. No header or map artifact is added. See [CPP semantics and bounds](cpp.md).