semantifold 0.5.0 → 0.6.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 (182) hide show
  1. package/README.md +10 -7
  2. package/build/src/backends/android.js +7 -3
  3. package/build/src/backends/identifiers.d.ts +6 -0
  4. package/build/src/backends/identifiers.d.ts.map +1 -1
  5. package/build/src/backends/identifiers.js +24 -1
  6. package/build/src/backends/ios.js +2 -2
  7. package/build/src/backends/native-validation.d.ts +2 -2
  8. package/build/src/backends/native-validation.d.ts.map +1 -1
  9. package/build/src/backends/native-validation.js +2 -2
  10. package/build/src/backends/scalars.d.ts.map +1 -1
  11. package/build/src/backends/scalars.js +2 -1
  12. package/build/src/backends/shared.js +4 -4
  13. package/build/src/backends/zig-runtime.d.ts +5 -0
  14. package/build/src/backends/zig-runtime.d.ts.map +1 -0
  15. package/build/src/backends/zig-runtime.js +92 -0
  16. package/build/src/backends/zig-validation.d.ts +9 -0
  17. package/build/src/backends/zig-validation.d.ts.map +1 -0
  18. package/build/src/backends/zig-validation.js +73 -0
  19. package/build/src/backends/zig.d.ts +42 -0
  20. package/build/src/backends/zig.d.ts.map +1 -0
  21. package/build/src/backends/zig.js +584 -0
  22. package/build/src/frontends/scalars.d.ts.map +1 -1
  23. package/build/src/frontends/scalars.js +2 -1
  24. package/build/src/frontends/zig-parser.d.ts +31 -0
  25. package/build/src/frontends/zig-parser.d.ts.map +1 -0
  26. package/build/src/frontends/zig-parser.js +17 -0
  27. package/build/src/frontends/zig.d.ts +14 -0
  28. package/build/src/frontends/zig.d.ts.map +1 -0
  29. package/build/src/frontends/zig.js +970 -0
  30. package/build/src/language-registry.d.ts.map +1 -1
  31. package/build/src/language-registry.js +30 -1
  32. package/build/src/mapping.js +2 -2
  33. package/build/src/semantic/provenance.js +3 -3
  34. package/build/src/semantic/types.d.ts +2 -2
  35. package/build/src/semantic/types.d.ts.map +1 -1
  36. package/build/src/semantic/types.js +2 -2
  37. package/build/src/semantic/validate.js +2 -2
  38. package/build/src/toolchains.d.ts +6 -0
  39. package/build/src/toolchains.d.ts.map +1 -1
  40. package/build/src/toolchains.js +2 -1
  41. package/build/src/zig-bindings.d.ts +10 -0
  42. package/build/src/zig-bindings.d.ts.map +1 -0
  43. package/build/src/zig-bindings.js +54 -0
  44. package/docs/android.md +2 -2
  45. package/docs/architecture.md +11 -5
  46. package/docs/goals.md +1 -1
  47. package/docs/language-support.md +8 -4
  48. package/docs/parser-qualification.md +31 -1
  49. package/docs/source-maps.md +5 -3
  50. package/docs/testing.md +26 -4
  51. package/docs/zig.md +33 -0
  52. package/node_modules/semantifold-tree-sitter-zig-internal/LICENSE +15 -0
  53. package/node_modules/semantifold-tree-sitter-zig-internal/README.md +5 -0
  54. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/LICENSE +21 -0
  55. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/README.md +21 -0
  56. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/binding.gyp +29 -0
  57. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/bindings/node/binding.cc +20 -0
  58. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/bindings/node/binding_test.js +9 -0
  59. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/bindings/node/index.d.ts +28 -0
  60. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/bindings/node/index.js +11 -0
  61. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/grammar.js +900 -0
  62. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/package.json +57 -0
  63. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/darwin-arm64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
  64. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/darwin-x64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
  65. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/linux-arm64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
  66. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/linux-x64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
  67. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/win32-arm64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
  68. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/win32-x64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
  69. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/queries/folds.scm +23 -0
  70. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/queries/highlights.scm +291 -0
  71. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/queries/indents.scm +22 -0
  72. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/queries/injections.scm +10 -0
  73. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/grammar.json +6570 -0
  74. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/node-types.json +3178 -0
  75. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/parser.c +169829 -0
  76. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/tree_sitter/alloc.h +54 -0
  77. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/tree_sitter/array.h +291 -0
  78. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/tree_sitter/parser.h +266 -0
  79. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/tree-sitter-zig.wasm +0 -0
  80. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/tree-sitter.json +38 -0
  81. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/LICENSE +21 -0
  82. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/README.md +128 -0
  83. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/binding.gyp +80 -0
  84. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/index.js +916 -0
  85. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/package.json +76 -0
  86. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
  87. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
  88. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/linux-arm64/tree-sitter.node +0 -0
  89. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
  90. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/win32-arm64/tree-sitter.node +0 -0
  91. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
  92. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/addon_data.h +47 -0
  93. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/binding.cc +35 -0
  94. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/conversions.cc +140 -0
  95. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/conversions.h +22 -0
  96. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/language.cc +106 -0
  97. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/language.h +17 -0
  98. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/logger.cc +70 -0
  99. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/logger.h +19 -0
  100. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
  101. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
  102. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/node.cc +1088 -0
  103. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/node.h +30 -0
  104. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/parser.cc +306 -0
  105. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/parser.h +35 -0
  106. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/query.cc +397 -0
  107. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/query.h +40 -0
  108. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/tree.cc +316 -0
  109. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/tree.h +45 -0
  110. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
  111. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/tree_cursor.h +52 -0
  112. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/tree-sitter.d.ts +1042 -0
  113. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1318 -0
  114. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
  115. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
  116. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +291 -0
  117. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
  118. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
  119. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
  120. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +501 -0
  121. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
  122. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
  123. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +223 -0
  124. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +297 -0
  125. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
  126. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +435 -0
  127. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +49 -0
  128. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +12 -0
  129. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +920 -0
  130. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2165 -0
  131. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +266 -0
  132. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +62 -0
  133. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/portable/endian.h +206 -0
  134. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4187 -0
  135. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
  136. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
  137. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +899 -0
  138. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +130 -0
  139. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1066 -0
  140. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +399 -0
  141. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +170 -0
  142. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
  143. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +712 -0
  144. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
  145. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/ts_assert.h +11 -0
  146. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
  147. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
  148. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
  149. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
  150. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
  151. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
  152. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
  153. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
  154. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
  155. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +83 -0
  156. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +24 -0
  157. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +109 -0
  158. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1302 -0
  159. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1859 -0
  160. package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
  161. package/node_modules/semantifold-tree-sitter-zig-internal/package.json +21 -0
  162. package/node_modules/semantifold-tree-sitter-zig-internal/src/zig.js +134 -0
  163. package/package.json +11 -6
  164. package/src/backends/android.js +6 -2
  165. package/src/backends/identifiers.js +24 -0
  166. package/src/backends/ios.js +1 -1
  167. package/src/backends/native-validation.js +1 -1
  168. package/src/backends/scalars.js +1 -0
  169. package/src/backends/shared.js +3 -3
  170. package/src/backends/zig-runtime.js +93 -0
  171. package/src/backends/zig-validation.js +68 -0
  172. package/src/backends/zig.js +579 -0
  173. package/src/frontends/scalars.js +1 -0
  174. package/src/frontends/zig-parser.js +20 -0
  175. package/src/frontends/zig.js +994 -0
  176. package/src/language-registry.js +30 -0
  177. package/src/mapping.js +1 -1
  178. package/src/semantic/provenance.js +2 -2
  179. package/src/semantic/types.js +1 -1
  180. package/src/semantic/validate.js +1 -1
  181. package/src/toolchains.js +1 -0
  182. package/src/zig-bindings.js +46 -0
@@ -35,7 +35,7 @@ All Tree-sitter languages use the official `tree-sitter` Node binding. The langu
35
35
  | 023 | Kotlin/JVM | community grammar through the exact Semantifold packaging fork plus differential `kotlinc` checks | passed for immutable tag `v0.4.0-semantifold.1`, commit `57c35ad1a80ccd2a0ebd8fffe852f0d13a20acd0`, ABI 14, Node24, and Kotlin/JVM 2.4.20; see below |
36
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 | exact public registry grammar plus differential Dart SDK checks | passed for `tree-sitter-dart-orchard@0.7.0`, Node 24/Tree-sitter 0.25.1, packed consumers, and exact Dart 3.13.3 Linux x64 format/analyze/VM/native acceptance |
38
- | 031 | Zig | candidate selected and qualified by Task 031 | intentionally deferred |
38
+ | 031 | Zig | exact public registry grammar in a private compatible runtime plus official Zig differential | passed for `@tree-sitter-grammars/tree-sitter-zig@1.1.2`, isolated Tree-sitter 0.22.4, Node 24/ABI 14, packed consumers, and exact Zig 0.15.2 Linux x86-64 |
39
39
 
40
40
  Swift or Kotlin qualification failure leaves Task 022 or 023 blocked until its roadmap/source decision is explicitly revised. Parser archives produced by CI or release pages are not an alternative dependency route. Tasks022 and 023 record narrow amendments: the selected registry packages lack the required install-safe Node24 contract, so Semantifold uses full-SHA GitHub source archives from its public packaging forks rather than generated release assets or mutable Git references.
41
41
 
@@ -80,6 +80,36 @@ The retained corpus SHA-256 values are:
80
80
 
81
81
  Run `npx velocious-test spec/dart-parser-qualification.spec.js` for retained Node/CST evidence, `npx velocious-test spec/tree-sitter-legacy-packed-consumer.spec.js` for ordinary-install plus clean-`npm ci` packed-consumer proof, and the individual `spec/dart-cross-language-acceptance.spec.js` and `spec/dart-native-execution.spec.js` files for the real SDK differential. All pass in the rebuilt canonical lane; review, exact-head CI, merge, and post-merge verification remain separate delivery gates.
82
82
 
83
+ ## Task 031 Zig grammar qualification — 2026-09-16
84
+
85
+ The Task 031 hard gate completed in an isolated scratch installation before the feature branch or tracked-file mutation. Exact `@tree-sitter-grammars/tree-sitter-zig@1.1.2` is a real maintained native Node grammar, but its optional peer requires Tree-sitter `^0.22.1`; root 0.25.1 cannot satisfy that contract. The selected route therefore uses an ordinary private `file:` production dependency with its own exact Tree-sitter 0.22.4 subtree, following the established runtime-isolation boundary without exposing a parser package publicly. No force/legacy-peer override, mutable source dependency, compiler-output AST, `zig ast-check`, source scan, runtime fetch, or vendored parser payload is used.
86
+
87
+ | Evidence | Qualified result |
88
+ | --- | --- |
89
+ | npm distribution | Exact registry package `@tree-sitter-grammars/tree-sitter-zig@1.1.2`, tarball `https://registry.npmjs.org/@tree-sitter-grammars/tree-sitter-zig/-/tree-sitter-zig-1.1.2.tgz`, integrity `sha512-J0L31HZ2isy3F5zb2g5QWQOv2r/pbruQNL9ADhuQv2pn5BQOzxt80WcEJaYXBeuJ8GHxVT42slpCna8k1c8LOw==`. Its exact compatible binding is registry `tree-sitter@0.22.4`, integrity `sha512-usbHZP9/oxNsUY65MQUsduGRqDHQOou1cagUSwjhoSYAmSahjQDAVsh9s+SlZkn8X8+O1FULRGwHu7AFP3kjzg==`. Both are bundled only beneath the private runtime. |
90
+ | upstream identity | Authoritative [`tree-sitter-grammars/tree-sitter-zig`](https://github.com/tree-sitter-grammars/tree-sitter-zig) lightweight tag `v1.1.2` resolves to full commit `b670c8df85a1568f498aa5c8cae42f51a90473c0`. The package repository metadata names that upstream. Registry signature/provenance verification passed during the credential-free scratch audit. |
91
+ | legal and lifecycle | Grammar and binding declare MIT and retain their licenses. Each native package uses the standard local `node-gyp-build` install route with shipped prebuilds/source fallback; load/install code contains no tool or package downloader. Semantifold ships only the npm-installed dependency payload inside its root bundle, not a copied archive or hand-built native binary. |
92
+ | ABI and typed Node API | The generated parser declares grammar ABI 14; Tree-sitter 0.22.4 accepts and loads it on Node 24. The grammar declaration exports its language handle and 242 typed node descriptions. `Parser#setLanguage`, parse, indexed child access, and `fieldNameForChild` work through one narrow grammar-handle assertion contained entirely inside the private package; public code receives only frozen plain data. |
93
+ | corpus and traversal | Seven checked-in fixtures cover Tasks 001–005 function/parameter/void forms, exact scalar/slice types, typed `const`/`var`, assignment, calls, returns, output/helper shapes, all operators, nested/fallthrough branches, comments, support builtins/fields/indexing, unused/unmutated scaffolds, Unicode, escapes, and CRLF. Every named/anonymous/extra node and field-bearing edge is serialized; malformed braces, parameters, imports, and calls preserve explicit error/missing/propagated recovery state. |
94
+ | coordinates and bounds | The boundary normalizes native parser offsets/points to UTF-16 and independently verifies every UTF-8 byte boundary. An astral comment plus CRLF places the following declaration at UTF-16 offset 7 while nine UTF-8 bytes precede it. Lone surrogates reject before adaptation. The product owns a 1,000,000-UTF-16 source limit and a 512-level CST traversal limit rather than inferring capacity from compiler acceptance. |
95
+ | syntax version and compiler differential | The grammar release parses the complete selected Zig 0.15.2 Task-031 corpus. Upstream has later open Zig 0.16 grammar work, so the implementation does not claim moving 0.16 coverage. The official exact compiler reports `0.15.2`; generated projects pass canonical format, test, build, and execution in Debug, ReleaseSafe, and ReleaseFast with identical status/output/overflow boundaries. Compiler diagnostics are acceptance evidence only and never supply syntax trees or semantic recovery. |
96
+ | official tool distribution | Official Linux x86-64 archive `https://ziglang.org/download/0.15.2/zig-x86_64-linux-0.15.2.tar.xz`, size `53733924`, SHA-256 `02aa270f183da276e5b5920b1dac44a63f1a49e55050ebde3aecc9eb82f93239`; qualified executable SHA-256 `2858dc89dbbfdd08cceda1b841e7fd0a793a1a67b49f150bc3d0d1de44ed7f51`. Docker and TensorBuzz verify those values and install source-independently; tests use isolated caches and never fetch a compiler or package. |
97
+ | package/consumer boundary | Root scripts build and typecheck the private workspace, compare every installed shipped byte with its `file:` source, and bundle the complete isolated dependency subtree. The credential-free packed consumer proves default `install-links=false`, ordinary install, full dependency listing, clean `npm ci`, simultaneous root/legacy/Zig binding loading, strict public typing, frozen Zig parsing, and Zig frontend/backend round trip. |
98
+
99
+ Retained corpus hashes are:
100
+
101
+ | Corpus path | SHA-256 |
102
+ | --- | --- |
103
+ | `spec/fixtures/zig-qualification/base.zig` | `5394714b6b08f1352cf93aa12c5e94ab4270f51c864bb9e3c5f1c0e9a43d313a` |
104
+ | `spec/fixtures/zig-qualification/scalars.zig` | `f5a9a9a17df3c8597ba5510f638226d3703ce72d4ea704740c30dea36c31ea08` |
105
+ | `spec/fixtures/zig-qualification/locals.zig` | `ee7dd618a362945de52529258945e3205f33e9060cfbbb483e3aa8e05d94d489` |
106
+ | `spec/fixtures/zig-qualification/operators.zig` | `cd3c11c84bdc49abb453c8eb9fd5110f19f309d2248f311121c081491745ee9d` |
107
+ | `spec/fixtures/zig-qualification/statements.zig` | `b39c89b2c414f7dfdb7221c1ccf788dc3d68e47f75095840f7e9bc05539d874f` |
108
+ | `spec/fixtures/zig-qualification/scaffolds.zig` | `d2db6d9059e25a431fe6491bb192b3d0a6f94846c85689e6d64f5e6b1cec0825` |
109
+ | `spec/fixtures/zig-qualification/coordinates.zig` | `59ea9c03ec5b50c9c246354fa44f2283ed2b2af86f49e5d94768474ffe87c68f` |
110
+
111
+ Run `npx velocious-test spec/zig-parser-qualification.spec.js` for the retained package/ABI/CST/coordinate proof and exact `zig fmt --check` plus `zig test` acceptance of every corpus file, `npx velocious-test spec/tree-sitter-zig-install-consistency.spec.js` and the packed-consumer spec for the distribution boundary, and the Zig native/cross-language specs for generated-project compiler execution.
112
+
83
113
  ## Task 016 Python qualification
84
114
 
85
115
  Qualification passed on the canonical Node `v24.18.1`, npm `11.16.0`, Linux lane with Python `3.14.4`. Task 016 therefore uses exact registry dependencies `tree-sitter@0.25.1` and the official `tree-sitter-python@0.25.0`; neither dependency is a Git URL, tarball path, copied archive, or vendored repository artifact.
@@ -70,7 +70,7 @@ artifact.sourceMap // encoded Source Map v3 object
70
70
  artifact.sourceMapFilename
71
71
  ```
72
72
 
73
- Default filenames for single-text targets include `program.php`, `program.rb`, `program.js`, `program.ts`, `Main.java`, `Program.kt`, `program.py`, `program.cpp`, and `program.swift`. 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`. Kotlin is stricter: its only accepted path is exact `Program.kt`, matching the runnable-JAR recipe; alternate filenames, map directives, and alternate map names are located `UNSUPPORTED_CAPABILITY` diagnostics. Python artifacts may include directories but retain `program.py`. 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 fixed synthetic `Semantifold.csproj` second. Go likewise returns fixed synthetic `go.mod` before mapped `main.go`. Dart returns fixed synthetic `pubspec.yaml` and `pubspec.lock` before mapped `bin/program.dart`; it accepts only that exact entry path and no map-directive or map-filename override. `sources` may supply exact content for legacy or caller-assembled multi-source IR:
73
+ Default filenames for single-text targets include `program.php`, `program.rb`, `program.js`, `program.ts`, `Main.java`, `Program.kt`, `program.py`, `program.cpp`, and `program.swift`. 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`. Kotlin is stricter: its only accepted path is exact `Program.kt`, matching the runnable-JAR recipe; alternate filenames, map directives, and alternate map names are located `UNSUPPORTED_CAPABILITY` diagnostics. Python artifacts may include directories but retain `program.py`. 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 fixed synthetic `Semantifold.csproj` second. Go likewise returns fixed synthetic `go.mod` before mapped `main.go`. Dart returns fixed synthetic `pubspec.yaml` and `pubspec.lock` before mapped `bin/program.dart`; it accepts only that exact entry path and no map-directive or map-filename override. Zig returns synthetic `build.zig` before mapped `src/main.zig`; it likewise accepts only its exact entry path and no mapping override. `sources` may supply exact content for legacy or caller-assembled multi-source IR:
74
74
 
75
75
  ```js
76
76
  generateArtifact({
@@ -83,7 +83,7 @@ generateArtifact({
83
83
  })
84
84
  ```
85
85
 
86
- `generateArtifactSet()` wraps every single-text result in one generated entry artifact, plus the referenced serialized mapping artifact when an external JavaScript-family directive is requested. Kotlin's set additionally carries deeply frozen compiler/run metadata for exact Kotlin 2.4, API 2.4, JVM target 25, `-Werror`, runnable `Program.jar`, and `java -jar`; the metadata is configuration, not another generated file. For C#, the set contains mapped `Program.cs` and synthetic `Semantifold.csproj`; Go returns `go.mod` before `main.go`; Dart returns its two manifests before `bin/program.dart`. `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.
86
+ `generateArtifactSet()` wraps every single-text result in one generated entry artifact, plus the referenced serialized mapping artifact when an external JavaScript-family directive is requested. Kotlin's set additionally carries deeply frozen compiler/run metadata for exact Kotlin 2.4, API 2.4, JVM target 25, `-Werror`, runnable `Program.jar`, and `java -jar`; the metadata is configuration, not another generated file. For C#, the set contains mapped `Program.cs` and synthetic `Semantifold.csproj`; Go returns `go.mod` before `main.go`; Dart returns its two manifests before `bin/program.dart`; Zig returns synthetic `build.zig` before mapped `src/main.zig`. `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.
87
87
 
88
88
  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:
89
89
 
@@ -124,6 +124,8 @@ Text artifact provenance embeds the validated rich mapping and Source Map v3 pro
124
124
 
125
125
  Dart's `bin/program.dart` maps function names, parameter and local types/names, assignments, operators, calls/arguments, print, literals, returns, and entry statements through the same exact/anchor/synthetic span model. The complete safe-integer and analyzer-stability runtime prefix plus fixed `main` shell are synthetic with related semantic origins. Both manifest artifacts use artifact-level synthetic configuration provenance. The embedded Source Map v3 `file` is `bin/program.dart`; no `.map` artifact or Dart source directive is emitted.
126
126
 
127
+ Zig's `src/main.zig` maps function names, parameter and local types/names, assignments, operators/helper calls, calls/arguments, output, literals, returns, conditions, and entry statements through that same model. The exact arena/UTF-8/output/checked-arithmetic runtime, necessary unused-binding scaffolds, punctuation, and fixed `main` shell are synthetic with related semantic origins. `build.zig` uses artifact-level synthetic configuration provenance. The embedded Source Map v3 `file` is `src/main.zig`; no `.map` artifact or Zig source directive is emitted.
128
+
127
129
  The iOS project manifest adds an application-specific provenance index without widening the generic mapping schemas. Mapped per-module semantic Swift retains the ordinary rich/v3 chain to its original Task 010 sources, including Ruby. Synthetic project, SwiftUI, runtime, test, configuration, and base asset-catalog files carry explicit source-free reasons. `SemantifoldIosProject` version 1 records renderer-owned configuration-field citations by manifest pointer and causal output ranges, exact caller asset representation/media type/SHA-256, source hashes and participating Swift artifacts, complete ordered owned paths, and exclusions. Its nested `SemantifoldIosSemanticProgram` version 1 section preserves caller-order source identities/ownership/hashes, dependency-order module IDs and dependencies, generated namespaces/artifacts, and the selected entry module/function linkage. Binary assets retain byte provenance across their exact full content. See [iOS application target](ios.md).
128
130
 
129
131
  The Android project uses the same separation without sharing platform syntax with iOS. Every per-module semantic Kotlin artifact has authoritative rich/v3 mappings to all Task 010 source identities and filenames. Gradle, manifest, Activity, lifecycle, layout, resources, runtime, and test artifacts are synthetic or configuration-derived. `SemantifoldAndroidProject` version 1 records field-owned output ranges, exact input and output hashes, fixed-root ownership/exclusions, semantic module/dependency/source/entry linkage, and exact toolchain pins. Binary caller inputs retain full byte provenance. See [Android application target](android.md).
@@ -139,7 +141,7 @@ generateArtifact({language: "javascript", module, mapDirective: "external"})
139
141
  generateArtifact({language: "typescript", module, mapDirective: "inline"})
140
142
  ```
141
143
 
142
- `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#, Go, and Dart 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, Go compiler source-map integration, and Dart VM service mapping would require compiler-artifact integration and are not part of v1.
144
+ `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#, Go, Dart, and Zig 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, Go compiler source-map integration, and Dart/Zig compiler integration would require compiler-artifact integration and are not part of v1.
143
145
 
144
146
  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.
145
147
 
package/docs/testing.md CHANGED
@@ -326,11 +326,11 @@ The unchanged legacy parser has a measured 32,767-UTF-16-code-unit source limit
326
326
 
327
327
  The five C Tasks 001–004 fixtures generate/reparse/execute all original-five targets using real PHP, Ruby, Node, TypeScript/Node and Java compiler/runtime commands. One original-five source rotates through each C profile. Rich/v3 tests verify token origins, synthetic context, shared occurrences, stale metadata and UTF-16 coordinates. Negative corpora cover parser recovery, preprocessing/declarators, ownership/pointers, collisions, malformed IR and every ordered-region boundary. [The C profile](c.md) specifies the exact source, memory and overflow contracts.
328
328
 
329
- For these deliveries, local testing is restricted to explicitly named changed/affected files. Aggregate `npm test`, directories and shards run only in TensorBuzz, whose end-to-end label includes fourteen source languages, Kotlin/JVM, Dart VM/native, Rust debug/release and mandatory C/CPP O0/O2 sanitizers. Existing generic aggregate examples below describe that CI gate. Coordinator-owned independent review, exact-head CI and merge remain separate from local implementation delivery; publication/version/tag/release is not part of the language candidates.
329
+ For these earlier deliveries, local testing was restricted to explicitly named changed/affected files. The current aggregate `npm test` gate covers fifteen source languages and includes Zig Debug/ReleaseSafe/ReleaseFast, Kotlin/JVM, Dart VM/native, Rust debug/release, and mandatory C/CPP O0/O2 sanitizers. Existing generic aggregate examples below describe that CI gate. Coordinator-owned independent review, exact-head CI and merge remain separate from local implementation delivery; publication/version/tag/release is not part of the language candidates.
330
330
 
331
331
  Specs use the released `@velocious/testing@0.0.0` framework and standalone `velocious-test` runner with one top-level `describe` per file. Direct value checks use the framework's `expect` API where it improves clarity; predicate-rich diagnostic assertions retain `node:assert/strict`. Frontend tests load real fixtures through Babel, php-parser, Prism, Lezer, and the qualified official Tree-sitter Python/C#/Go routes and compare modeled meaning after removing source locations and the separately tested provenance index. They separately assert normalized annotations, complete named/anonymous/comment/directive traversal, parser recovery rejection, and exact UTF-16 locations.
332
332
 
333
- The private `packages/tree-sitter-legacy` workspace owns source checking and parser-neutral declaration generation for the internal legacy runtime; neither package is independently publishable. Its direct spec asserts the versioned frozen plain-data C/CPP/Rust CST, ordered field-bearing children, error/missing/extra state, UTF-16 indices and positions, and a declaration surface without native types. Its distribution spec runs the root package's real `prepack` from a disposable copy of the package inputs and installed dependencies, so its clean build cannot replace shared workspace declarations while another spec reads them. It checks that the root tarball physically contains root `tree-sitter@0.25.1` and the internal package's isolated `tree-sitter@0.21.1` plus `tree-sitter-c@0.23.2`, `tree-sitter-cpp@0.23.4` and `tree-sitter-rust@0.23.1` subtree, including licenses, platform prebuilds, and source fallbacks. It installs only that root tarball into a consumer with cleaned npm configuration and a fresh npm cache, resolves exact `tree-sitter-kotlin@0.4.0` from its integrity-locked full-SHA HTTPS archive, verifies the installed lock and full npm tree, compiles a root API type consumer, and runs modern Kotlin/Go beside legacy C/CPP/Rust in one Node24 process. The temporary package copy, tarball, cache, lockfile, dependencies, and consumer are always removed; no packed archive or dependency build is committed.
333
+ The private `packages/tree-sitter-legacy` and `packages/tree-sitter-zig` workspaces own source checking and parser-neutral declaration generation for their internal runtimes; none of those packages is independently publishable. Direct specs assert versioned frozen plain-data C/CPP/Rust/Zig CSTs, ordered field-bearing children, error/missing/extra state, UTF-16 indices and positions, and declaration surfaces without native types. The distribution spec runs the root package's real `prepack` from a disposable copy of package inputs and installed dependencies, so a clean build cannot replace shared workspace declarations while another spec reads them. It checks that the root tarball physically contains root `tree-sitter@0.25.1`, the legacy package's isolated exact `tree-sitter@0.21.1` with C/CPP/Rust grammars, and the Zig package's isolated exact `tree-sitter@0.22.4` with grammar 1.1.2, including licenses, platform prebuilds, and source fallbacks. It installs only that root tarball into a consumer with cleaned npm configuration and a fresh npm cache, resolves exact `tree-sitter-kotlin@0.4.0` from its integrity-locked full-SHA HTTPS archive, verifies the installed lock and full npm tree, compiles a root API type consumer, and runs modern Kotlin/Go beside legacy C/CPP/Rust and isolated Zig in one Node24 process. The temporary package copy, tarball, cache, lockfile, dependencies, and consumer are always removed; no packed archive or dependency build is committed.
334
334
 
335
335
  `tree-sitter-legacy-install-consistency.spec.js` reproduces source edits after `npm ci` in unique isolated npm fixtures, using the real pretest/prepack hooks and a semantic change to the serializer. Each shipped file must cause a stale-payload rejection until ordinary `npm ci` refreshes the installed copy; real tar extraction proves that subsequent packs contain the edited bytes. The shared gate uses npm's source pack inventory, checks the complete installed payload except its dependency subtree, and compares bytes before runtime specs, lint, and packing. The consumer spec independently compares every bundled internal file with source. Its configuration regression uses only synthetic registry and credential settings, removes all inherited `npm_config_*` inputs and token/module-path variables case-insensitively, isolates both user and global configuration files, and checks npm's effective public registry/config/cache settings before the real fresh-cache installation.
336
336
 
@@ -408,7 +408,7 @@ Run `npx velocious-test spec/repository-contract.spec.js` for the focused reposi
408
408
 
409
409
  ## Task019 CPP acceptance
410
410
 
411
- The CPP lane selects `/usr/bin/clang++-21` through `SEMANTIFOLD_CLANGPP`; C retains `SEMANTIFOLD_CLANG`. The development image pins libstdc++-15-dev 15.2.0-16ubuntu1 and already obtains clang++ from the exact clang-21 package. Noble TensorBuzz reuses the signed LLVM21 setup above, explicitly installs g++-13/libstdc++ headers, probes clang++ and libstdc++, and runs framework-native discovery of all fourteen source languages. [The CPP profile](cpp.md) lists every compile/link, encoding, warning, exception/RTTI and sanitizer flag. Local validation uses explicit named spec files only; full-suite discovery belongs to TensorBuzz.
411
+ The CPP lane selects `/usr/bin/clang++-21` through `SEMANTIFOLD_CLANGPP`; C retains `SEMANTIFOLD_CLANG`. The development image pins libstdc++-15-dev 15.2.0-16ubuntu1 and already obtains clang++ from the exact clang-21 package. Noble TensorBuzz reuses the signed LLVM21 setup above, explicitly installs g++-13/libstdc++ headers, probes clang++ and libstdc++, and runs framework-native discovery of all fifteen source languages. [The CPP profile](cpp.md) lists every compile/link, encoding, warning, exception/RTTI and sanitizer flag. Full-suite discovery is repeated by TensorBuzz for the exact candidate head.
412
412
 
413
413
  ```sh
414
414
  export SEMANTIFOLD_CLANG=/usr/bin/clang-21
@@ -452,6 +452,28 @@ The packed-consumer test installs the single root tarball, retains only plain fr
452
452
 
453
453
  Required local gates remain runtime consistency, focused named specs, lint, root/workspace strict typecheck and build, high-severity audit, production/all dependency listings, pack dry-run and diff check. TensorBuzz alone owns full/native aggregate discovery for the exact candidate head. Review, external package boundary, CI, merge and post-merge evidence remain coordinator-owned.
454
454
 
455
+ ## Task031 Zig acceptance
456
+
457
+ The parser qualification fixes `@tree-sitter-grammars/tree-sitter-zig@1.1.2` and its isolated compatible `tree-sitter@0.22.4` runtime inside the private Zig workspace. The qualification spec proves package integrity/license/provenance, Node24 loading, ABI-14 typed metadata, full frozen child/field snapshots, recovery flags, UTF-16 coordinates, and exact Zig 0.15.2 `fmt --check` plus `zig test` acceptance of every retained syntax-corpus file under isolated caches. Runtime consistency and the packed-consumer proof cover both the source workspace and the installed/bundled ordinary `file:` payload; no separately published adapter or parser object enters the public API.
458
+
459
+ Run the focused Zig files with the exact qualified `SEMANTIFOLD_ZIG` executable when it is not already the canonical PATH command:
460
+
461
+ ```sh
462
+ npx velocious-test spec/zig-parser-qualification.spec.js
463
+ npx velocious-test spec/zig-registry-toolchain.spec.js
464
+ npx velocious-test spec/zig-frontend-validation.spec.js
465
+ npx velocious-test spec/zig-backend-validation.spec.js
466
+ npx velocious-test spec/zig-native-execution.spec.js
467
+ npx velocious-test spec/zig-provenance.spec.js
468
+ npx velocious-test spec/zig-cross-language-acceptance.spec.js
469
+ npx velocious-test spec/tree-sitter-zig-install-consistency.spec.js
470
+ npx velocious-test spec/tree-sitter-legacy-packed-consumer.spec.js
471
+ ```
472
+
473
+ Native acceptance creates a fresh project for every case, blocks package/network proxy variables, assigns distinct empty local and global caches to Debug, ReleaseSafe, and ReleaseFast, and runs `zig fmt --check src/main.zig build.zig`, `zig build test`, `zig build`, and the installed executable in each mode. It requires exact stdout/stderr/status, byte-stable input artifacts, canonical generated reparse, Unicode and embedded NUL strings, lifetime-sensitive call chains, arbitrary required arity/void calls, all scalar operators, signed-64-bit extrema, and status 70 for add/subtract/multiply/negate overflow in every mode. Focused frontend differentials prove that exact Zig rejects invalid native slice operators before Semantifold rejects the same operator/helper substitution at its source occurrence. Backend and native regressions require complete signed ordered-expression regions, typed left-to-right eager temporaries, nested call and helper ordering, first-failure ordering, and conditional right-hand evaluation for `and` and `or`; malformed or partial scaffolds are rejected. Crossings exercise managed semantics through Zig and Zig-derived semantics through real C, Rust, and Java toolchains. Compiler or formatter rejection is a backend failure; tests never install or download Zig or packages.
474
+
475
+ The complete repository gate remains `LANG=C.UTF-8 LC_ALL=C.UTF-8 npm test`, lint, root and workspace typecheck/build, high-severity audit, both dependency trees, pack dry-run/manifest, and `git diff --check`. TensorBuzz repeats the aggregate at the exact candidate head with the source-independent checksum-pinned Zig installation. Independent review, exact-head CI, merge, and any release remain coordinator-owned.
476
+
455
477
  ## Task026 iOS application generation acceptance
456
478
 
457
479
  Task 026's implemented Linux generation/provenance scope is kept in two focused files. Run them individually and sequentially; do not replace them with local spec-directory discovery or a broad suite:
@@ -482,7 +504,7 @@ npx velocious-test spec/android-packed-consumer.spec.js
482
504
 
483
505
  Generation coverage validates multi-module/Unicode capture, mappings, configuration causality, deterministic fixed-root ownership, manifest/UI/dependency shape, resources/assets, collisions, and preflight diagnostics. Materialization is repository-private acceptance support: it requires an empty mode-0700 non-symlink directory, creates files exclusively, verifies checksum readback, and is neither exported nor packed. The packed proof uses clean public-registry npm install/ci and strict TypeScript consumption.
484
506
 
485
- TensorBuzz's Android lane runs `scripts/bootstrap-android.sh` online to checksum and prefetch only the qualified official toolchain/cache, including the exact Kotlin 2.2.10 compiler distribution used as a compile-only tool input while the Gradle stdlib dependency stays disabled. `scripts/accept-android.sh` then creates a fresh project and runs lint, JUnit, application/instrumentation assembly, dependency inspection, and APK leakage checks with `--offline`. It requires an empty application runtime graph; the unit-test graph must contain exactly non-transitive JUnit 4.13.2 at implementation scope and Hamcrest Core 1.3 at runtime scope because the JUnit runner loads Hamcrest before test code. Neither dependency nor Kotlin runtime implementation namespaces may appear in the app APK. `scripts/android-emulator-acceptance.sh` requires usable `/dev/kvm`, forces acceleration, installs/launches/asserts exact base64-encoded UTF-8 output through platform instrumentation, captures UI XML/screenshots, destroys the emulator, and repeats on a fresh boot. Missing tools/cache/KVM are infrastructure failures, never skips. Do not run this emulator script locally without KVM or substitute software emulation.
507
+ TensorBuzz's Android lane runs `scripts/bootstrap-android.sh` online to checksum and prefetch only the qualified official toolchain/cache, including the exact Kotlin 2.2.10 compiler distribution used as a direct compiler input while implicit Gradle stdlib resolution stays disabled. The same pinned stdlib file is the sole Kotlin runtime packaged into the generated instrumentation APK. `scripts/accept-android.sh` then creates a fresh project and runs lint, JUnit, application/instrumentation assembly, dependency inspection, and APK leakage checks with `--offline`. It requires an empty application runtime graph; the unit-test graph must contain exactly non-transitive JUnit 4.13.2 at implementation scope and Hamcrest Core 1.3 at runtime scope because the JUnit runner loads Hamcrest before test code. Neither unit-test dependency nor Kotlin runtime implementation namespaces may appear in the app APK, while the instrumentation APK must contain `kotlin.jvm.internal.Intrinsics`. `scripts/android-emulator-acceptance.sh` requires usable `/dev/kvm`, forces acceleration, installs/launches/asserts exact base64-encoded UTF-8 output through platform instrumentation, captures UI XML/screenshots, destroys the emulator, and repeats on a fresh boot. Missing tools/cache/KVM are infrastructure failures, never skips. Do not run this emulator script locally without KVM or substitute software emulation.
486
508
 
487
509
  ## Task022 Swift acceptance
488
510
 
package/docs/zig.md ADDED
@@ -0,0 +1,33 @@
1
+ # Zig source and target
2
+
3
+ Task 031 adds `zig` as a first-class source and deterministic native-project target for Tasks 001–005. It is one registry/backend spoke over the shared semantic model: there is no Zig-to-language adapter, source scan, compiler-diagnostic parser, or Zig-specific public IR.
4
+
5
+ ## Qualified parser and compiler
6
+
7
+ The private `packages/tree-sitter-zig` boundary owns exact `@tree-sitter-grammars/tree-sitter-zig@1.1.2` (MIT, npm integrity `sha512-J0L31HZ2isy3F5zb2g5QWQOv2r/pbruQNL9ADhuQv2pn5BQOzxt80WcEJaYXBeuJ8GHxVT42slpCna8k1c8LOw==`) with its compatible isolated `tree-sitter@0.22.4`. The grammar release corresponds to authoritative upstream `tree-sitter-grammars/tree-sitter-zig` tag `v1.1.2` and commit `b670c8df85a1568f498aa5c8cae42f51a90473c0`. Node 24 loads its ABI-14 native grammar. Only schema-1, deeply frozen, parser-neutral CST data crosses the private runtime boundary; the one native grammar-handle assertion stays inside that boundary.
8
+
9
+ Qualification covers ordered field-bearing children, anonymous tokens, extras, error/missing/recovery state, typed node metadata, UTF-8 byte to UTF-16 conversion including CRLF and astral scalars, and the Task-031 syntax corpus. The adapter recursively accounts for every edge and rejects parser recovery, doc/container-directive comments, or unmodeled nodes. The grammar's tracked Zig 0.16 work is not part of release 1.1.2, so this profile deliberately selects exact Zig 0.15.2 rather than claiming moving-language coverage.
10
+
11
+ The canonical Linux x86-64 compiler is the official `zig-x86_64-linux-0.15.2.tar.xz`, size `53733924`, SHA-256 `02aa270f183da276e5b5920b1dac44a63f1a49e55050ebde3aecc9eb82f93239`; its qualified `zig` executable hashes to `2858dc89dbbfdd08cceda1b841e7fd0a793a1a67b49f150bc3d0d1de44ed7f51`. Docker and TensorBuzz require AMD64, fetch that source-independent archive during environment preparation, verify all metadata, install `/opt/zig-0.15.2/zig`, and require `zig version` to equal `0.15.2`. Runtime tests neither fetch nor install anything. `SEMANTIFOLD_ZIG` may select only an absolute executable that passes exact 0.15.2 discovery; the canonical Docker/TensorBuzz installation separately owns the Linux x86-64 architecture and archive-integrity proof.
12
+
13
+ ## Exact source subset
14
+
15
+ The source is a complete canonical `src/main.zig` entry: the exact Semantifold-owned standard-library support prelude, the generated profile marker, zero or more top-level `fn` declarations, and one exact `pub fn main() void` shell with arena cleanup. Every semantic statement is enclosed by a deterministic signed ordered-expression region. Those regions bind effectful eager operands and call arguments to typed temporaries in semantic left-to-right order; `and` and `or` instead place their right-hand regions inside the generated conditional branch. Semantic functions accept any number of required positional parameters, including zero, and return `i64`, `bool`, `[]const u8`, or `void`. Parameters and initialized locals are explicitly typed; locals use `const` or `var`; only mutable locals may be assigned. A void function may fall through or use bare `return`, while non-void functions require explicit path-complete returns. Direct calls, void expression statements, strict-Boolean `if`/`else`, and scalar output are accepted.
16
+
17
+ Integer literals retain the semantic safe-integer source bound. Operations are checked `i64` add, subtract, multiply, and negate plus integer comparisons; Booleans support equality, inequality, `!`, `and`, and `or`; strings support concatenation, equality, and inequality. The frontend retains each source operator or helper occurrence through type resolution: native operators must be valid for the resolved Zig types, and every generated helper must exactly match its normalized operation and signature. Cross-family helper substitutions and native slice arithmetic or equality are rejected at the substituted source occurrence instead of being normalized into valid semantics. Evaluation is left-to-right at the semantic boundary and Boolean operators short-circuit. String literals are Unicode scalar text with canonical escapes, including embedded NUL. Identifiers must be ordinary non-reserved Zig names and cannot enter the `semantifold_` helper namespace.
18
+
19
+ Inference, optional/default/rest parameters, overloading, methods, containers, imports beyond the exact generated `std` import, user builtins, `comptime`, `anytype`, generics, optionals, error unions/sets, `try`/`catch`, `defer`/`errdefer`, wrapping or saturating arithmetic, casts, pointers, user slices/arrays/structs/unions/enums, allocators, C imports/FFI, assembly, reflection, async/concurrency, undefined values, and `unreachable` are rejected with parser-backed locations. Inputs with lone surrogates, more than 1,000,000 UTF-16 code units, or CST nesting beyond 512 also fail. No compiler message or text pattern repairs rejected syntax.
20
+
21
+ ## Project, lifetime, and failures
22
+
23
+ `generateArtifactSet({language: "zig"})` returns exactly two ordered LF artifacts: synthetic `build.zig`, then rich-mapped sole-entry `src/main.zig`. Zig 0.15.2 needs no `build.zig.zon` for this dependency-free standard-library-only native-host build. Generation validates the full semantic graph, names, types, calls, flow, mutability, known integer/string bounds, source size/depth, fixed paths/options, complete ordered-expression plan, final CST, and complete artifact set before anything is returned. The frontend regenerates the canonical project and compares the complete significant CST so a missing, reordered, retyped, or partially copied ordering scaffold cannot be accepted. Generation performs no filesystem, compiler, cache, package-manager, or network operation.
24
+
25
+ Strings are immutable `[]const u8`. Literals borrow static storage; concatenation allocates into one generated global arena; the exact `main` defer releases that arena only after every semantic statement completes. No semantic operation observes pointer identity, sentinel termination, capacity, mutation, allocation ownership, or transfer. Allocation and output failures write a fixed diagnostic and exit 70. Checked arithmetic uses Zig overflow intrinsics and exits 70 with `semantifold: integer overflow\n`; Debug, ReleaseSafe, and ReleaseFast therefore have identical observable overflow boundaries and never rely on target overflow or undefined behavior.
26
+
27
+ `build.zig` exposes only Zig's standard optimization option and the host target. Acceptance copies validated artifacts to a fresh temporary project, uses distinct empty local/global caches per mode, blocks proxy/package-fetch variables, runs `zig fmt --check src/main.zig build.zig`, `zig build test`, `zig build`, and the installed executable in Debug, ReleaseSafe, and ReleaseFast, and verifies that input artifact hashes never change. Cross-compilation and package dependencies are outside this profile.
28
+
29
+ ## Provenance and diagnostics
30
+
31
+ Function, parameter, local, type, assignment, operator/helper, callee, argument, literal, return, condition, output, and entry-statement occurrences retain exact or anchored semantic provenance in `src/main.zig`. The runtime, arena, output helpers, punctuation, ordered-region markers and signatures, typed ordering temporaries, conditional-right-hand plumbing, necessary unused/unmutated binding scaffolds, and entry shell are synthetic with related semantic origins. `build.zig` has artifact-level synthetic configuration provenance. The embedded Source Map v3 names `src/main.zig`; Zig source-map directives and alternate filenames are rejected.
32
+
33
+ Recovery uses `PARSE_ERROR`; missing or inferred types use `MISSING_TYPE`; excluded source syntax uses located `UNSUPPORTED_SYNTAX`; ordinary shared resolution/type/flow diagnostics remain unchanged. Backend graph, target, option, bound, or artifact failures use `UNSUPPORTED_CAPABILITY` transactionally. `generate()` and `generateArtifact()` report `UNSUPPORTED_ROLE` because Zig is deliberately a multi-artifact backend.
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026 Semantifold contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,5 @@
1
+ # Semantifold internal Zig Tree-sitter runtime
2
+
3
+ This private implementation package is bundled only inside the root Semantifold distribution. It is not published or exported.
4
+
5
+ `parseCst(source)` serializes the exact `@tree-sitter-grammars/tree-sitter-zig@1.1.2` grammar through isolated `tree-sitter@0.22.4` into recursively frozen `semantifold.parser-cst` version 1 data with UTF-16 indices and positions. Parser, tree, syntax-node, and language handles never leave this package.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Amaan Qureshi <amaanq12@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ # tree-sitter-zig
2
+
3
+ [![CI][ci]](https://github.com/tree-sitter-grammars/tree-sitter-zig/actions/workflows/ci.yml)
4
+ [![discord][discord]](https://discord.gg/w7nTvsVJhm)
5
+ [![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
6
+ [![crates][crates]](https://crates.io/crates/tree-sitter-zig)
7
+ [![npm][npm]](https://www.npmjs.com/package/@tree-sitter-grammars/tree-sitter-zig)
8
+ [![pypi][pypi]](https://pypi.org/project/tree-sitter-zig)
9
+
10
+ Zig grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
11
+
12
+ ## References
13
+
14
+ - [Zig Grammar](https://github.com/ziglang/zig-spec/blob/master/grammar/grammar.y)
15
+
16
+ [ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter-grammars/tree-sitter-zig/ci.yml?logo=github&label=CI
17
+ [discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
18
+ [matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
19
+ [npm]: https://img.shields.io/npm/v/@tree-sitter-grammars/tree-sitter-zig?logo=npm
20
+ [crates]: https://img.shields.io/crates/v/tree-sitter-zig?logo=rust
21
+ [pypi]: https://img.shields.io/pypi/v/tree-sitter-zig?logo=pypi&logoColor=ffd242
@@ -0,0 +1,29 @@
1
+ {
2
+ "targets": [
3
+ {
4
+ "target_name": "tree_sitter_zig_binding",
5
+ "dependencies": [
6
+ "<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
7
+ ],
8
+ "include_dirs": [
9
+ "src",
10
+ ],
11
+ "sources": [
12
+ "bindings/node/binding.cc",
13
+ "src/parser.c",
14
+ ],
15
+ "conditions": [
16
+ ["OS!='win'", {
17
+ "cflags_c": [
18
+ "-std=c11",
19
+ ],
20
+ }, { # OS == "win"
21
+ "cflags_c": [
22
+ "/std:c11",
23
+ "/utf-8",
24
+ ],
25
+ }],
26
+ ],
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,20 @@
1
+ #include <napi.h>
2
+
3
+ typedef struct TSLanguage TSLanguage;
4
+
5
+ extern "C" TSLanguage *tree_sitter_zig();
6
+
7
+ // "tree-sitter", "language" hashed with BLAKE2
8
+ const napi_type_tag LANGUAGE_TYPE_TAG = {
9
+ 0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16
10
+ };
11
+
12
+ Napi::Object Init(Napi::Env env, Napi::Object exports) {
13
+ exports["name"] = Napi::String::New(env, "zig");
14
+ auto language = Napi::External<TSLanguage>::New(env, tree_sitter_zig());
15
+ language.TypeTag(&LANGUAGE_TYPE_TAG);
16
+ exports["language"] = language;
17
+ return exports;
18
+ }
19
+
20
+ NODE_API_MODULE(tree_sitter_zig_binding, Init)
@@ -0,0 +1,9 @@
1
+ const assert = require("node:assert");
2
+ const { test } = require("node:test");
3
+
4
+ const Parser = require("tree-sitter");
5
+
6
+ test("can load grammar", () => {
7
+ const parser = new Parser();
8
+ assert.doesNotThrow(() => parser.setLanguage(require(".")));
9
+ });
@@ -0,0 +1,28 @@
1
+ type BaseNode = {
2
+ type: string;
3
+ named: boolean;
4
+ };
5
+
6
+ type ChildNode = {
7
+ multiple: boolean;
8
+ required: boolean;
9
+ types: BaseNode[];
10
+ };
11
+
12
+ type NodeInfo =
13
+ | (BaseNode & {
14
+ subtypes: BaseNode[];
15
+ })
16
+ | (BaseNode & {
17
+ fields: { [name: string]: ChildNode };
18
+ children: ChildNode[];
19
+ });
20
+
21
+ type Language = {
22
+ name: string;
23
+ language: unknown;
24
+ nodeTypeInfo: NodeInfo[];
25
+ };
26
+
27
+ declare const language: Language;
28
+ export = language;
@@ -0,0 +1,11 @@
1
+ const root = require("path").join(__dirname, "..", "..");
2
+
3
+ module.exports =
4
+ typeof process.versions.bun === "string"
5
+ // Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time
6
+ ? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-zig.node`)
7
+ : require("node-gyp-build")(root);
8
+
9
+ try {
10
+ module.exports.nodeTypeInfo = require("../../src/node-types.json");
11
+ } catch (_) {}