@voxgig/sdkgen 4.8.2 → 4.8.3

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 (376) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/action/doctor.d.ts +1 -0
  3. package/dist/action/doctor.js +50 -2
  4. package/dist/action/doctor.js.map +1 -1
  5. package/dist/helpers/naming.js +4 -2
  6. package/dist/helpers/naming.js.map +1 -1
  7. package/dist/tsconfig.tsbuildinfo +1 -1
  8. package/model/sdkgen.aon +21 -0
  9. package/package.json +1 -1
  10. package/project/.sdk/model/feature/secrets.aon +120 -18
  11. package/project/.sdk/model/target/c.aon +10 -0
  12. package/project/.sdk/model/target/clojure.aon +13 -0
  13. package/project/.sdk/model/target/cpp.aon +10 -0
  14. package/project/.sdk/model/target/csharp.aon +9 -0
  15. package/project/.sdk/model/target/dart.aon +10 -0
  16. package/project/.sdk/model/target/elixir.aon +9 -0
  17. package/project/.sdk/model/target/go.aon +13 -0
  18. package/project/.sdk/model/target/java.aon +9 -0
  19. package/project/.sdk/model/target/js.aon +7 -0
  20. package/project/.sdk/model/target/kotlin.aon +9 -0
  21. package/project/.sdk/model/target/lean.aon +17 -0
  22. package/project/.sdk/model/target/lua.aon +8 -0
  23. package/project/.sdk/model/target/ocaml.aon +9 -0
  24. package/project/.sdk/model/target/perl.aon +8 -0
  25. package/project/.sdk/model/target/php.aon +8 -0
  26. package/project/.sdk/model/target/py.aon +13 -0
  27. package/project/.sdk/model/target/rb.aon +8 -0
  28. package/project/.sdk/model/target/rust.aon +10 -0
  29. package/project/.sdk/model/target/scala.aon +21 -2
  30. package/project/.sdk/model/target/swift.aon +18 -0
  31. package/project/.sdk/model/target/ts.aon +13 -0
  32. package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
  33. package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
  34. package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
  35. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
  36. package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
  37. package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
  38. package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
  39. package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
  40. package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
  41. package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
  42. package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
  43. package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
  44. package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
  45. package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
  46. package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
  47. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
  48. package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
  49. package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
  50. package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
  51. package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
  52. package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
  53. package/project/.sdk/tm/c/Makefile +38 -3
  54. package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
  55. package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
  56. package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
  57. package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
  58. package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
  59. package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
  60. package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
  61. package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
  62. package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
  63. package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
  64. package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
  65. package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
  66. package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
  67. package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
  68. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
  69. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
  70. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
  71. package/project/.sdk/tm/cpp/Makefile +5 -1
  72. package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
  73. package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
  74. package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
  75. package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
  76. package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
  77. package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
  78. package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
  79. package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
  80. package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
  81. package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
  82. package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
  83. package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
  84. package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
  85. package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
  86. package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
  87. package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
  88. package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
  89. package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
  90. package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
  91. package/project/.sdk/tm/dart/test/omni.dart +520 -0
  92. package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
  93. package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
  94. package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
  95. package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
  96. package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
  97. package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
  98. package/project/.sdk/tm/elixir/Makefile +11 -3
  99. package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
  100. package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
  101. package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
  102. package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
  103. package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
  104. package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
  105. package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
  106. package/project/.sdk/tm/go/core/context.go +32 -16
  107. package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
  108. package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
  109. package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
  110. package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
  111. package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
  112. package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
  113. package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
  114. package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
  115. package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
  116. package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
  117. package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
  118. package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
  119. package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
  120. package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
  121. package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
  122. package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
  123. package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
  124. package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
  125. package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
  126. package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
  127. package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
  128. package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +209 -0
  129. package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
  130. package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +151 -0
  131. package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
  132. package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
  133. package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
  134. package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +439 -0
  135. package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +685 -0
  136. package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
  137. package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
  138. package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
  139. package/project/.sdk/tm/go/test/omni/omni.go +897 -0
  140. package/project/.sdk/tm/go/test/omni/util.go +360 -0
  141. package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
  142. package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
  143. package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
  144. package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
  145. package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
  146. package/project/.sdk/tm/go/utility/make_options.go +8 -1
  147. package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
  148. package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
  149. package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
  150. package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
  151. package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
  152. package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
  153. package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
  154. package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
  155. package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
  156. package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
  157. package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
  158. package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
  159. package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
  160. package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
  161. package/project/.sdk/tm/js/test/omni.js +251 -0
  162. package/project/.sdk/tm/js/test/omni.test.js +105 -0
  163. package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
  164. package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
  165. package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
  166. package/project/.sdk/tm/js/test/vendor/omni/runner.js +613 -0
  167. package/project/.sdk/tm/js/test/vendor/omni/util.js +212 -0
  168. package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
  169. package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
  170. package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
  171. package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
  172. package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
  173. package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
  174. package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
  175. package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
  176. package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
  177. package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
  178. package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
  179. package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
  180. package/project/.sdk/tm/lean/Makefile +12 -5
  181. package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
  182. package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
  183. package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
  184. package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
  185. package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
  186. package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
  187. package/project/.sdk/tm/lua/test/omni.lua +456 -0
  188. package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
  189. package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
  190. package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
  191. package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
  192. package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
  193. package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
  194. package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
  195. package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
  196. package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
  197. package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
  198. package/project/.sdk/tm/ocaml/Makefile +37 -12
  199. package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
  200. package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
  201. package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
  202. package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
  203. package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
  204. package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
  205. package/project/.sdk/tm/perl/t/omni.pm +647 -0
  206. package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
  207. package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
  208. package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
  209. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
  210. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
  211. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
  212. package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
  213. package/project/.sdk/tm/php/test/Omni.php +691 -0
  214. package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
  215. package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
  216. package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
  217. package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
  218. package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
  219. package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
  220. package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
  221. package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
  222. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
  223. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
  224. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
  225. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
  226. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
  227. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
  228. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
  229. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
  230. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
  231. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
  232. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
  233. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
  234. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
  235. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
  236. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
  237. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +74 -0
  238. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
  239. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
  240. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
  241. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
  242. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
  243. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
  244. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +152 -0
  245. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
  246. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +92 -0
  247. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
  248. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
  249. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
  250. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
  251. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +455 -0
  252. package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
  253. package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
  254. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
  255. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
  256. package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
  257. package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
  258. package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
  259. package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
  260. package/project/.sdk/tm/py/test/omni.py +415 -0
  261. package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
  262. package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
  263. package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
  264. package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
  265. package/project/.sdk/tm/py/test/voxgig_omni/runner.py +566 -0
  266. package/project/.sdk/tm/py/test/voxgig_omni/util.py +237 -0
  267. package/project/.sdk/tm/rb/test/omni.rb +505 -0
  268. package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
  269. package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
  270. package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
  271. package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
  272. package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
  273. package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
  274. package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
  275. package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
  276. package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
  277. package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
  278. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
  279. package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
  280. package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
  281. package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
  282. package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
  283. package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
  284. package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
  285. package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
  286. package/project/.sdk/tm/scala/Makefile +16 -6
  287. package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
  288. package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
  289. package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
  290. package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
  291. package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
  292. package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
  293. package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
  294. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
  295. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
  296. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
  297. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
  298. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
  299. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
  300. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
  301. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
  302. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
  303. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
  304. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
  305. package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
  306. package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
  307. package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
  308. package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
  309. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
  310. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
  311. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
  312. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
  313. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
  314. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
  315. package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
  316. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
  317. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
  318. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
  319. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
  320. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
  321. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
  322. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
  323. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
  324. package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
  325. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
  326. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
  327. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
  328. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
  329. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
  330. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
  331. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
  332. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
  333. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
  334. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
  335. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
  336. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
  337. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
  338. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
  339. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
  340. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
  341. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
  342. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
  343. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
  344. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
  345. package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
  346. package/project/.sdk/tm/ts/test/omni.ts +104 -32
  347. package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
  348. package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
  349. package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
  350. package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
  351. package/project/.sdk/tm/zig/test/primary_utility_test.zig +1 -1
  352. package/project/.sdk/tm/zig/test/struct_runner.zig +5 -4
  353. package/project/sdkgen-package.json +1 -1
  354. package/src/action/doctor.ts +66 -2
  355. package/src/helpers/naming.ts +4 -2
  356. package/project/.sdk/tm/c/tests/runner.h +0 -274
  357. package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
  358. package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
  359. package/project/.sdk/tm/dart/test/runner.dart +0 -406
  360. package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
  361. package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
  362. package/project/.sdk/tm/go/test/runner_test.go +0 -629
  363. package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
  364. package/project/.sdk/tm/java/test/StructRunner.java +0 -281
  365. package/project/.sdk/tm/js/test/runner.js +0 -387
  366. package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
  367. package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
  368. package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
  369. package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
  370. package/project/.sdk/tm/php/test/StructRunner.php +0 -275
  371. package/project/.sdk/tm/py/test/struct_runner.py +0 -411
  372. package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
  373. package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
  374. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
  375. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
  376. package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
@@ -1,340 +1,29 @@
1
- /- Struct corpus runner: drives the `struct` subtree of the shared
2
- ../.sdk/test/test.json (the project's own compiled corpus, same file the
3
- other targets read) against the vendored voxgig-struct port.
4
- Self-contained: an in-tree JSON reader builds the library's `Value` type
5
- directly, so the Lean port is exercised exactly as in production. -/
1
+ /- Struct corpus: drives the `struct` subtree of the shared
2
+ ../.sdk/test/test.json the project's own compiled corpus, the same file
3
+ every other target reads through the vendored voxgig/struct port, on the
4
+ vendored @voxgig/omni engine.
6
5
 
7
- import VoxgigStruct
8
-
9
- open VoxgigStruct
10
-
11
- def nullmark : String := "__NULL__"
12
- def undefmark : String := "__UNDEF__"
13
- def existsmark : String := "__EXISTS__"
14
-
15
- -- ---------------- JSON reader -> Value ----------------
16
-
17
- structure JState where
18
- src : Array Char
19
- pos : Nat
20
-
21
- partial def jPeek (s : JState) : Option Char := s.src[s.pos]?
22
-
23
- partial def jSkipWs (s : JState) : JState := Id.run do
24
- let mut p := s.pos
25
- while p < s.src.size &&
26
- (s.src[p]! == ' ' || s.src[p]! == '\t' || s.src[p]! == '\n' || s.src[p]! == '\r') do
27
- p := p + 1
28
- return { s with pos := p }
29
-
30
- partial def jStr (s0 : JState) : SIO (String × JState) := do
31
- -- assumes current char is '"'
32
- let src := s0.src
33
- let mut p := s0.pos + 1
34
- let mut b := ""
35
- repeat do
36
- if p >= src.size then break
37
- let c := src[p]!
38
- p := p + 1
39
- if c == '"' then break
40
- if c == '\\' then
41
- let e := src[p]!
42
- p := p + 1
43
- match e with
44
- | '"' => b := b.push '"'
45
- | '\\' => b := b.push '\\'
46
- | '/' => b := b.push '/'
47
- | 'n' => b := b.push '\n'
48
- | 't' => b := b.push '\t'
49
- | 'r' => b := b.push '\r'
50
- | 'b' => b := b.push '\x08'
51
- | 'f' => b := b.push '\x0c'
52
- | 'u' => do
53
- let mut code : Nat := 0
54
- for _ in [0:4] do
55
- let h := src[p]!
56
- p := p + 1
57
- let d :=
58
- if h >= '0' && h <= '9' then h.toNat - '0'.toNat
59
- else if h >= 'a' && h <= 'f' then 10 + h.toNat - 'a'.toNat
60
- else if h >= 'A' && h <= 'F' then 10 + h.toNat - 'A'.toNat
61
- else 0
62
- code := code * 16 + d
63
- b := b.push (Char.ofNat code)
64
- | c => b := b.push c
65
- else
66
- b := b.push c
67
- return (b, { s0 with pos := p })
68
-
69
- mutual
70
-
71
- partial def jVal (s0 : JState) : SIO (Value × JState) := do
72
- let s := jSkipWs s0
73
- match jPeek s with
74
- | some '{' => jObj s
75
- | some '[' => jArr s
76
- | some '"' => do
77
- let (str, s') ← jStr s
78
- pure (.str str, s')
79
- | some 't' => pure (.bool true, { s with pos := s.pos + 4 })
80
- | some 'f' => pure (.bool false, { s with pos := s.pos + 5 })
81
- | some 'n' => pure (.null, { s with pos := s.pos + 4 })
82
- | _ => jNum s
83
-
84
- partial def jObj (s0 : JState) : SIO (Value × JState) := do
85
- let s := jSkipWs { s0 with pos := s0.pos + 1 }
86
- if jPeek s == some '}' then
87
- pure (← emptyMap, { s with pos := s.pos + 1 })
88
- else do
89
- let m ← emptyMap
90
- let sRef ← IO.mkRef s
91
- repeat do
92
- let s1 := jSkipWs (← sRef.get)
93
- let (k, s2) ← jStr s1
94
- let s3 := jSkipWs s2
95
- let s4 := { s3 with pos := s3.pos + 1 } -- ':'
96
- let (v, s5) ← jVal s4
97
- let _ ← setprop m (.str k) v
98
- let s6 := jSkipWs s5
99
- let c := (jPeek s6).getD '}'
100
- sRef.set { s6 with pos := s6.pos + 1 }
101
- if c != ',' then break
102
- pure (m, ← sRef.get)
103
-
104
- partial def jArr (s0 : JState) : SIO (Value × JState) := do
105
- let s := jSkipWs { s0 with pos := s0.pos + 1 }
106
- if jPeek s == some ']' then
107
- pure (← emptyList, { s with pos := s.pos + 1 })
108
- else do
109
- let sRef ← IO.mkRef s
110
- let accRef ← IO.mkRef (#[] : Array Value)
111
- repeat do
112
- let (v, s1) ← jVal (← sRef.get)
113
- accRef.modify (·.push v)
114
- let s2 := jSkipWs s1
115
- let c := (jPeek s2).getD ']'
116
- sRef.set { s2 with pos := s2.pos + 1 }
117
- if c != ',' then break
118
- pure (← newList (← accRef.get), ← sRef.get)
119
-
120
- partial def jNum (s0 : JState) : SIO (Value × JState) := do
121
- let src := s0.src
122
- let mut p := s0.pos
123
- let start := p
124
- while p < src.size &&
125
- (let c := src[p]!
126
- (c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.' || c == 'e' || c == 'E') do
127
- p := p + 1
128
- let tok := String.ofList (src.extract start p).toList
129
- pure (.num ((parseFloatJS tok).getD 0.0), { s0 with pos := p })
130
-
131
- end
132
-
133
- def jsonRead (s : String) : SIO Value := do
134
- pure (← jVal { src := s.toList.toArray, pos := 0 }).1
135
-
136
- -- ---------------- fixJSON / equality ----------------
137
-
138
- partial def fixJson (v : Value) (flagNull : Bool) : SIO Value := do
139
- match v with
140
- | .noval | .null => if flagNull then pure (.str nullmark) else pure v
141
- | .map id => do
142
- let o ← emptyMap
143
- for (k, x) in (← mapEntries id) do
144
- let _ ← setprop o (.str k) (← fixJson x flagNull)
145
- pure o
146
- | .list id => do
147
- let mut out : Array Value := #[]
148
- for x in (← listItems id) do
149
- out := out.push (← fixJson x flagNull)
150
- newList out
151
- | _ => pure v
152
-
153
- /-- Order-independent deep equality for maps; sequence equality for lists. -/
154
- partial def eqv (a b : Value) : SIO Bool := do
155
- match a, b with
156
- | .noval, .noval | .noval, .null | .null, .noval | .null, .null => pure true
157
- | .bool x, .bool y => pure (x == y)
158
- | .num x, .num y => pure (x == y)
159
- | .str x, .str y => pure (x == y)
160
- | .list x, .list y => do
161
- let xs ← listItems x
162
- let ys ← listItems y
163
- if xs.size != ys.size then pure false
164
- else do
165
- for i in [0:xs.size] do
166
- if !(← eqv xs[i]! ys[i]!) then return false
167
- pure true
168
- | .map x, .map y => do
169
- let xes ← mapEntries x
170
- let yes ← mapEntries y
171
- if xes.size != yes.size then pure false
172
- else do
173
- for (k, v) in xes do
174
- match omapGet yes k with
175
- | some w =>
176
- if !(← eqv v w) then return false
177
- | none => return false
178
- pure true
179
- | _, _ => pure (a == b)
180
-
181
- -- ---------------- match support ----------------
182
-
183
- def strContainsSub (hay needle : String) : Bool := Id.run do
184
- let h := hay.toList.toArray
185
- let nd := needle.toList.toArray
186
- if nd.size == 0 then return true
187
- if nd.size > h.size then return false
188
- for i in [0:h.size - nd.size + 1] do
189
- let mut ok := true
190
- for j in [0:nd.size] do
191
- if h[i + j]! != nd[j]! then ok := false
192
- if ok then return true
193
- return false
194
-
195
- partial def matchval (check0 base : Value) : SIO Bool := do
196
- let check := if check0 == .str undefmark || check0 == .str nullmark then Value.noval
197
- else check0
198
- if ← eqv check base then pure true
199
- else match check with
200
- | .str cs => do
201
- let basestr ← stringify base
202
- let csArr := cs.toList.toArray
203
- if csArr.size >= 2 && csArr[0]! == '/' && csArr[csArr.size - 1]! == '/' then
204
- pure (Vregex.testStr (String.ofList (csArr.extract 1 (csArr.size - 1)).toList) basestr)
205
- else
206
- pure (strContainsSub basestr.toLower (← stringify check).toLower)
207
- | .func _ => pure true
208
- | _ => pure false
209
-
210
- partial def doMatch (check base0 : Value) : SIO Unit := do
211
- let base ← clone base0
212
- let _ ← walk check (before := some (fun _k v _p path => do
213
- if !(isnode v) then do
214
- let baseval ← getpath base path
215
- if ← eqv baseval v then pure ()
216
- else if v == .str undefmark && isNullish baseval then pure ()
217
- else if v == .str existsmark && !(isNullish baseval) then pure ()
218
- else if !(← matchval v baseval) then do
219
- let mut parts : List String := []
220
- for x in (← listItemsOf path) do
221
- parts := (← jsString x) :: parts
222
- throw (IO.userError ("MATCH: " ++ String.intercalate "." parts.reverse
223
- ++ ": [" ++ (← stringify v) ++ "] <=> [" ++ (← stringify baseval) ++ "]"))
224
- pure v))
225
- pure ()
226
-
227
- -- ---------------- result tracking ----------------
228
-
229
- initialize npass : IO.Ref Nat ← IO.mkRef 0
230
- initialize nfail : IO.Ref Nat ← IO.mkRef 0
231
- initialize failures : IO.Ref (List String) ← IO.mkRef []
232
-
233
- def record (group name : String) (ok : Bool) (msg : String) : IO Unit := do
234
- if ok then npass.modify (· + 1)
235
- else do
236
- nfail.modify (· + 1)
237
- failures.modify (("FAIL " ++ group ++ " " ++ name ++ " - " ++ msg) :: ·)
238
-
239
- -- ---------------- per-entry runner ----------------
240
-
241
- def omapV (kvs : List (String × Value)) : SIO Value := do
242
- let m ← emptyMap
243
- for (k, v) in kvs do
244
- let _ ← setprop m (.str k) v
245
- pure m
246
-
247
- def entryGet (e : Value) (k : String) : SIO Value := do
248
- match e with
249
- | .map id => pure ((omapGet (← mapEntries id) k).getD .noval)
250
- | _ => pure .noval
251
-
252
- def entryHas (e : Value) (k : String) : SIO Bool := do
253
- match e with
254
- | .map id => pure (omapHas (← mapEntries id) k)
255
- | _ => pure false
256
-
257
- def resolveArgs (entry : Value) : SIO (List Value) := do
258
- if ← entryHas entry "ctx" then pure [← entryGet entry "ctx"]
259
- else if ← entryHas entry "args" then pure (← listItemsOf (← entryGet entry "args")).toList
260
- else if ← entryHas entry "in" then pure [← clone (← entryGet entry "in")]
261
- else pure [.noval]
262
-
263
- def checkResult (entry : Value) (args : List Value) (res : Value) : SIO Unit := do
264
- let mut matched := false
265
- if ← entryHas entry "match" then do
266
- doMatch (← entryGet entry "match")
267
- (← omapV [("in", ← entryGet entry "in"), ("args", ← newList args.toArray),
268
- ("out", ← entryGet entry "res"), ("ctx", ← entryGet entry "ctx")])
269
- matched := true
270
- let out ← entryGet entry "out"
271
- if ← eqv out res then pure ()
272
- else if matched && (out == .str nullmark || isNullish out) then pure ()
273
- else
274
- throw (IO.userError ("Expected: " ++ (← stringify out) ++ ", got: " ++ (← stringify res)))
275
-
276
- def handleError (entry : Value) (err : IO.Error) : SIO Unit := do
277
- let msg := err.toString
278
- if ← entryHas entry "err" then do
279
- let entryErr ← entryGet entry "err"
280
- if entryErr == .bool true || (← matchval entryErr (.str msg)) then do
281
- if ← entryHas entry "match" then
282
- doMatch (← entryGet entry "match")
283
- (← omapV [("in", ← entryGet entry "in"), ("out", ← entryGet entry "res"),
284
- ("ctx", ← entryGet entry "ctx"), ("err", .str msg)])
285
- else
286
- throw (IO.userError ("ERROR MATCH: [" ++ (← stringify entryErr) ++ "] <=> [" ++ msg ++ "]"))
287
- else throw err
288
-
289
- def runSet (group : String) (node : Value) (subject : List Value → SIO Value)
290
- (flagNull : Bool := true) : SIO Unit := do
291
- let fixed ← fixJson node flagNull
292
- let testset ← listItemsOf (← getprop fixed (.str "set"))
293
- for entry in testset do
294
- let name ← jsString (← entryGet entry "name")
295
- try
296
- if !(← entryHas entry "out") && flagNull then
297
- let _ ← setprop entry (.str "out") (.str nullmark)
298
- let args ← resolveArgs entry
299
- let res ← fixJson (← subject args) flagNull
300
- let _ ← setprop entry (.str "res") res
301
- checkResult entry args res
302
- record group name true ""
303
- catch e =>
304
- try
305
- handleError entry e
306
- record group name true ""
307
- catch e2 =>
308
- record group name false e2.toString
309
-
310
- def getpropRawPub (e : Value) (k : String) : SIO Value := entryGet e k
311
-
312
- def runSingle (group : String) (node : Value) (actualFn : Value → SIO Value) : SIO Unit := do
313
- try
314
- let expected ← getpropRawPub node "out"
315
- let actual ← actualFn (← getpropRawPub node "in")
316
- if ← eqv expected actual then record group "single" true ""
317
- else
318
- record group "single" false
319
- ("Expected: " ++ (← stringify expected) ++ ", got: " ++ (← stringify actual))
320
- catch e => record group "single" false e.toString
6
+ The ENGINE is no longer in this file. It used to be: an in-tree JSON
7
+ reader, `fixJson`, `eqv`, `matchval`, `doMatch`, `resolveArgs`,
8
+ `checkResult`, `handleError` and `runSet` — this port's own copy of omni's
9
+ algorithm, drifting from it by construction. All of it is gone; every
10
+ group below is handed to omni through OmniResolver. What remains is what
11
+ actually belongs to this SDK: WHICH corpus group drives WHICH struct
12
+ function, and with which flags.
321
13
 
322
- -- ---------------- arg helpers ----------------
14
+ The file keeps its name (and the `structcorpus` executable keeps its
15
+ root), so no call site — Makefile, lakefile, CI — needed churn.
323
16
 
324
- def arg1 (f : Value → SIO Value) : List Value → SIO Value :=
325
- fun args => f (args.headD .noval)
17
+ Flags mirror canonical: typescript/test/utility/StructUtility.test.ts. -/
326
18
 
327
- def vget (vin : Value) (k : String) : SIO Value := do
328
- match vin with
329
- | .map id => pure ((omapGet (← mapEntries id) k).getD .noval)
330
- | _ => pure .noval
19
+ import VoxgigStruct
20
+ import Omni
21
+ import OmniResolver
331
22
 
332
- def vhas (vin : Value) (k : String) : SIO Bool := do
333
- match vin with
334
- | .map id => pure (omapHas (← mapEntries id) k)
335
- | _ => pure false
23
+ open VoxgigStruct
24
+ open OmniResolver
336
25
 
337
- -- ---------------- test groups ----------------
26
+ -- ---------------- subjects that need more than one expression ----------
338
27
 
339
28
  def nullModifier : ModifyFn := fun v key parent _inj => do
340
29
  if v == .str nullmark then
@@ -344,26 +33,22 @@ def nullModifier : ModifyFn := fun v key parent _inj => do
344
33
  let _ ← setprop parent key (.str (s.replace nullmark "null"))
345
34
  | _ => pure ()
346
35
 
347
- def runWalkLog (group : String) (node : Value) : SIO Unit := do
348
- try
349
- let testData clone node
350
- let log emptyList
351
- let walklog : WalkFn := fun key v parent path => do
352
- let ks if isNullish key then stringify .noval else stringify key
353
- let vs ← stringify v
354
- let psif isNullish parent then stringify .noval else stringify parent
355
- let tspathify path
356
- let nsize log
357
- let _setprop log (vInt n)
358
- (.str ("k=" ++ ks ++ ", v=" ++ vs ++ ", p=" ++ ps ++ ", t=" ++ ts))
359
- pure v
360
- let _ ← walk (← getpropRawPub testData "in") (after := some walklog)
361
- let expectedgetprop ( getpropRawPub testData "out") (.str "after")
362
- if ← eqv expected log then record group "log" true ""
363
- else
364
- record group "log" false
365
- ("Expected: " ++ (← stringify expected) ++ ", got: " ++ (← stringify log))
366
- catch e => record group "log" false e.toString
36
+ /-- walk/log is authored as one {in, out} pair whose `out.after` is the log of
37
+ an after-walk. The subject builds that log and returns it; the resolver's
38
+ `single (out := ["after"])` selects the half the corpus asserts on. -/
39
+ def walkLogSubject (vin : Value) : SIO Value := do
40
+ let log emptyList
41
+ let walklog : WalkFn := fun key v parent path => do
42
+ let ksif isNullish key then stringify .noval else stringify key
43
+ let vs ← stringify v
44
+ let psif isNullish parent then stringify .noval else stringify parent
45
+ let tspathify path
46
+ let nsize log
47
+ let _ setprop log (vInt n)
48
+ (.str ("k=" ++ ks ++ ", v=" ++ vs ++ ", p=" ++ ps ++ ", t=" ++ ts))
49
+ pure v
50
+ let _walk vin (after := some walklog)
51
+ pure log
367
52
 
368
53
  def walkCopySubject (vin : Value) : SIO Value := do
369
54
  let cur ← IO.mkRef (← newList #[.noval])
@@ -408,127 +93,129 @@ def walkDepthSubject (vin : Value) : SIO Value := do
408
93
  else
409
94
  let _ ← setprop (← curr.get) key v
410
95
  pure v
411
- let _ ← walk (← vget vin "src") (before := some copy) (maxdepth := ← vget vin "maxdepth")
96
+ let _ ← walk (← getp vin "src") (before := some copy) (maxdepth := ← getp vin "maxdepth")
412
97
  top.get
413
98
 
414
- def runAll (spec : Value) : SIO Unit := do
415
- let g := getpropRawPub spec
416
- let minor g "minor"
417
- let walks ← g "walk"
418
- let merges ← g "merge"
419
- let getpaths ← g "getpath"
420
- let injects ← g "inject"
421
- let transforms ← g "transform"
422
- let validates ← g "validate"
423
- let selects ← g "select"
424
- let sentinels ← g "sentinels"
425
- let mg := getpropRawPub minor
99
+ -- ---------------- test groups ------------------------------------------
100
+
101
+ def runAll (r : Run) : SIO Unit := do
426
102
 
427
103
  -- minor
428
- runSet "minor.isnode" ( mg "isnode") (arg1 (fun v => pure (.bool (isnode v))))
429
- runSet "minor.ismap" (← mg "ismap") (arg1 (fun v => pure (.bool (ismap v))))
430
- runSet "minor.islist" ( mg "islist") (arg1 (fun v => pure (.bool (islist v))))
431
- runSet "minor.iskey" (← mg "iskey") (arg1 (fun v => pure (.bool (iskey v))))
432
- (flagNull := false)
433
- runSet "minor.strkey" (← mg "strkey") (arg1 (fun v => pure (.str (strkey v))))
434
- (flagNull := false)
435
- runSet "minor.isempty" (← mg "isempty") (arg1 (fun v => do pure (.bool ( isempty v))))
436
- (flagNull := false)
437
- runSet "minor.isfunc" (← mg "isfunc") (arg1 (fun v => pure (.bool (isfunc v))))
438
- runSet "minor.clone" ( mg "clone") (arg1 clone) (flagNull := false)
439
- runSet "minor.escre" (← mg "escre") (arg1 escre)
440
- runSet "minor.escurl" ( mg "escurl") (arg1 escurl)
441
- runSet "minor.stringify" ( mg "stringify")
442
- (arg1 (fun vin => do
443
- if vhas vin "val" then
444
- pure (.str ( stringify (← vget vin "val") (maxlen := ← vget vin "max")))
104
+ runset r "minor.isnode" (getset r ["minor", "isnode"])
105
+ (fun v => pure (.bool (isnode v)))
106
+ runset r "minor.ismap" (getset r ["minor", "ismap"])
107
+ (fun v => pure (.bool (ismap v)))
108
+ runset r "minor.islist" (getset r ["minor", "islist"])
109
+ (fun v => pure (.bool (islist v)))
110
+ runset r "minor.iskey" (getset r ["minor", "iskey"])
111
+ (fun v => pure (.bool (iskey v))) (nullflag := false)
112
+ runset r "minor.strkey" (getset r ["minor", "strkey"])
113
+ (fun v => pure (.str (strkey v))) (nullflag := false)
114
+ runset r "minor.isempty" (getset r ["minor", "isempty"])
115
+ (fun v => do pure (.bool (← isempty v))) (nullflag := false)
116
+ runset r "minor.isfunc" (getset r ["minor", "isfunc"])
117
+ (fun v => pure (.bool (isfunc v)))
118
+ runset r "minor.clone" (getset r ["minor", "clone"]) clone (nullflag := false)
119
+ runset r "minor.escre" (getset r ["minor", "escre"]) escre
120
+ runset r "minor.escurl" (getset r ["minor", "escurl"]) escurl
121
+ runset r "minor.stringify" (getset r ["minor", "stringify"])
122
+ (fun vin => do
123
+ if ← hasp vin "val" then
124
+ pure (.str (← stringify (← getp vin "val") (maxlen := ← getp vin "max")))
445
125
  else
446
- pure (.str (← stringify .noval))))
447
- (flagNull := false)
448
- runSet "minor.jsonify" ( mg "jsonify")
449
- (arg1 (fun vin => do
450
- pure (.str (← jsonify (← vget vin "val") (flags := ← vget vin "flags")))))
451
- (flagNull := false)
452
- runSet "minor.getelem" (← mg "getelem")
453
- (arg1 (fun vin => do
454
- let alt vget vin "alt"
455
- if isNullish alt then getelem (← vget vin "val") (← vget vin "key")
456
- else getelem (← vget vin "val") (← vget vin "key") alt))
457
- (flagNull := false)
458
- runSet "minor.delprop" (← mg "delprop")
459
- (arg1 (fun vin => do delprop ( vget vin "parent") (← vget vin "key")))
460
- runSet "minor.size" (← mg "size") (arg1 (fun v => do pure (vInt (← size v))))
461
- (flagNull := false)
462
- runSet "minor.slice" (← mg "slice")
463
- (arg1 (fun vin => do
464
- slice ( vget vin "val") (start := ← vget vin "start") (stop := ← vget vin "end")))
465
- (flagNull := false)
466
- runSet "minor.pad" (← mg "pad")
467
- (arg1 (fun vin => do
468
- pure (.str (← pad (← vget vin "val") (padding := ← vget vin "pad")
469
- (padchar := vget vin "char")))))
470
- (flagNull := false)
471
- runSet "minor.pathify" (← mg "pathify")
472
- (arg1 (fun vin => do
473
- if vhas vin "path" then
474
- pure (.str (← pathify (← vget vin "path") (startin := ← vget vin "from")))
126
+ pure (.str (← stringify .noval)))
127
+ (nullflag := false)
128
+ runset r "minor.jsonify" (getset r ["minor", "jsonify"])
129
+ (fun vin => do
130
+ pure (.str (← jsonify (← getp vin "val") (flags := ← getp vin "flags"))))
131
+ (nullflag := false)
132
+ -- `alt` is read by NULLISHNESS here and by PRESENCE for getprop below.
133
+ -- That is canonical's own split: it omits getprop's alt only when the KEY
134
+ -- is missing (`undefined === vin.alt`), so a present `alt: null` still
135
+ -- goes through, while getelem's rule is the looser `null == vin.alt`.
136
+ -- `minor/getprop#50` and `#51` are the entries that separate them — and
137
+ -- the retired hand-written engine hid the difference, because its `eqv`
138
+ -- matched a no-value against a null. The vendored engine does not.
139
+ runset r "minor.getelem" (getset r ["minor", "getelem"])
140
+ (fun vin => do
141
+ let alt ← getp vin "alt"
142
+ if isNullish alt then getelem (← getp vin "val") (← getp vin "key")
143
+ else getelem ( getp vin "val") ( getp vin "key") alt)
144
+ (nullflag := false)
145
+ runset r "minor.delprop" (getset r ["minor", "delprop"])
146
+ (fun vin => do delprop (← getp vin "parent") (← getp vin "key"))
147
+ runset r "minor.size" (getset r ["minor", "size"])
148
+ (fun v => do pure (vInt (← size v))) (nullflag := false)
149
+ runset r "minor.slice" (getset r ["minor", "slice"])
150
+ (fun vin => do
151
+ slice (← getp vin "val") (start := getp vin "start") (stop := ← getp vin "end"))
152
+ (nullflag := false)
153
+ runset r "minor.pad" (getset r ["minor", "pad"])
154
+ (fun vin => do
155
+ pure (.str (← pad (← getp vin "val") (padding := ← getp vin "pad")
156
+ (padchar := ← getp vin "char"))))
157
+ (nullflag := false)
158
+ runset r "minor.pathify" (getset r ["minor", "pathify"])
159
+ (fun vin => do
160
+ if ← hasp vin "path" then
161
+ pure (.str (← pathify (← getp vin "path") (startin := ← getp vin "from")))
475
162
  else
476
- pure (.str (← pathify .noval (startin := ← vget vin "from") (absent := true)))))
477
- (flagNull := false)
478
- runSet "minor.items" ( mg "items") (arg1 items)
479
- runSet "minor.getprop" ( mg "getprop")
480
- (arg1 (fun vin => do
481
- let alt vget vin "alt"
482
- if isNullish alt then getprop (← vget vin "val") (← vget vin "key")
483
- else getprop (← vget vin "val") (← vget vin "key") alt))
484
- (flagNull := false)
485
- runSet "minor.setprop" ( mg "setprop")
486
- (arg1 (fun vin => do
487
- setprop (← vget vin "parent") (← vget vin "key") (← vget vin "val")))
488
- runSet "minor.haskey" ( mg "haskey")
489
- (arg1 (fun vin => do
490
- pure (.bool (← haskey (← vget vin "src") (← vget vin "key")))))
491
- (flagNull := false)
492
- runSet "minor.keysof" ( mg "keysof")
493
- (arg1 (fun v => do newList ((← keysof v).map (fun s => Value.str s))))
494
- runSet "minor.join" ( mg "join")
495
- (arg1 (fun vin => do
496
- let url := (← vget vin "url") == .bool true
497
- pure (.str (← join (← vget vin "val") (sep := ← vget vin "sep") (url := url)))))
498
- (flagNull := false)
499
- runSet "minor.typify" ( mg "typify")
500
- (arg1 (fun v => pure (vInt (typify v))))
501
- (flagNull := false)
502
- runSet "minor.setpath" (← mg "setpath")
503
- (arg1 (fun vin => do
504
- setpath ( vget vin "store") (← vget vin "path") (← vget vin "val")))
505
- (flagNull := false)
506
- runSet "minor.filter" (← mg "filter")
507
- (arg1 (fun vin => do
508
- let checkV ← vget vin "check"
163
+ pure (.str (← pathify .noval (startin := ← getp vin "from") (absent := true))))
164
+ (nullflag := false)
165
+ runset r "minor.items" (getset r ["minor", "items"]) items
166
+ runset r "minor.getprop" (getset r ["minor", "getprop"])
167
+ (fun vin => do
168
+ ifhasp vin "alt" then
169
+ getprop (← getp vin "val") (← getp vin "key") (← getp vin "alt")
170
+ else getprop (← getp vin "val") (← getp vin "key"))
171
+ (nullflag := false)
172
+ runset r "minor.setprop" (getset r ["minor", "setprop"])
173
+ (fun vin => do
174
+ setprop (← getp vin "parent") (← getp vin "key") (← getp vin "val"))
175
+ runset r "minor.haskey" (getset r ["minor", "haskey"])
176
+ (fun vin => do
177
+ pure (.bool (← haskey (← getp vin "src") (← getp vin "key"))))
178
+ (nullflag := false)
179
+ runset r "minor.keysof" (getset r ["minor", "keysof"])
180
+ (fun v => do newList ((← keysof v).map (fun s => Value.str s)))
181
+ runset r "minor.join" (getset r ["minor", "join"])
182
+ (fun vin => do
183
+ let url := (← getp vin "url") == .bool true
184
+ pure (.str (← join (← getp vin "val") (sep := ← getp vin "sep") (url := url))))
185
+ (nullflag := false)
186
+ runset r "minor.typify" (getset r ["minor", "typify"])
187
+ (fun v => pure (vInt (typify v))) (nullflag := false)
188
+ runset r "minor.setpath" (getset r ["minor", "setpath"])
189
+ (fun vin => do
190
+ setpath ( getp vin "store") ( getp vin "path") (← getp vin "val"))
191
+ (nullflag := false)
192
+ runset r "minor.filter" (getset r ["minor", "filter"])
193
+ (fun vin => do
194
+ let checkV ← getp vin "check"
509
195
  let check : (String × Value) → Bool :=
510
196
  if checkV == .str "gt3" then
511
197
  fun (_, x) => match x with | .num n => n > 3.0 | _ => false
512
198
  else if checkV == .str "lt3" then
513
199
  fun (_, x) => match x with | .num n => n < 3.0 | _ => false
514
200
  else fun _ => false
515
- filter (← vget vin "val") check))
516
- runSet "minor.typename" ( mg "typename")
517
- (arg1 (fun v => do
201
+ filter (← getp vin "val") check)
202
+ runset r "minor.typename" (getset r ["minor", "typename"])
203
+ (fun v => do
518
204
  let t : Int := match v with
519
205
  | .num n => fToInt n
520
206
  | _ => 0
521
- pure (.str (typename t))))
522
- runSet "minor.flatten" ( mg "flatten")
523
- (arg1 (fun vin => do
524
- match (← vget vin "depth") with
525
- | .num n => flatten (← vget vin "val") (depth := fToInt n)
526
- | _ => flatten (← vget vin "val")))
207
+ pure (.str (typename t)))
208
+ runset r "minor.flatten" (getset r ["minor", "flatten"])
209
+ (fun vin => do
210
+ match (← getp vin "depth") with
211
+ | .num n => flatten (← getp vin "val") (depth := fToInt n)
212
+ | _ => flatten (← getp vin "val"))
527
213
 
528
214
  -- walk
529
- runWalkLog "walk.log" ( getpropRawPub walks "log")
530
- runSet "walk.basic" (← getpropRawPub walks "basic")
531
- (arg1 (fun vin => do
215
+ runset r "walk.log" (single (getset r ["walk", "log"]) (out := ["after"]))
216
+ walkLogSubject
217
+ runset r "walk.basic" (getset r ["walk", "basic"])
218
+ (fun vin => do
532
219
  walk vin (after := some (fun _k v _p path => do
533
220
  match v with
534
221
  | .str s => do
@@ -536,162 +223,146 @@ def runAll (spec : Value) : SIO Unit := do
536
223
  for x in (← listItemsOf path) do
537
224
  parts := (← jsString x) :: parts
538
225
  pure (.str (s ++ "~" ++ String.intercalate "." parts.reverse))
539
- | _ => pure v))))
540
- runSet "walk.copy" ( getpropRawPub walks "copy") (arg1 walkCopySubject)
541
- runSet "walk.depth" ( getpropRawPub walks "depth") (arg1 walkDepthSubject)
542
- (flagNull := false)
226
+ | _ => pure v)))
227
+ runset r "walk.copy" (getset r ["walk", "copy"]) walkCopySubject
228
+ runset r "walk.depth" (getset r ["walk", "depth"]) walkDepthSubject
229
+ (nullflag := false)
543
230
 
544
231
  -- merge
545
- runSingle "merge.basic" ( getpropRawPub merges "basic")
232
+ runset r "merge.basic" (single (getset r ["merge", "basic"]))
546
233
  (fun vin => do merge (← clone vin))
547
- runSet "merge.cases" ( getpropRawPub merges "cases") (arg1 (fun v => merge v))
548
- runSet "merge.array" ( getpropRawPub merges "array") (arg1 (fun v => merge v))
549
- runSet "merge.integrity" ( getpropRawPub merges "integrity") (arg1 (fun v => merge v))
550
- runSet "merge.depth" ( getpropRawPub merges "depth")
551
- (arg1 (fun vin => do
552
- merge (← vget vin "val") (maxdepth := ← vget vin "depth")))
234
+ runset r "merge.cases" (getset r ["merge", "cases"]) (fun v => merge v)
235
+ runset r "merge.array" (getset r ["merge", "array"]) (fun v => merge v)
236
+ runset r "merge.integrity" (getset r ["merge", "integrity"]) (fun v => merge v)
237
+ runset r "merge.depth" (getset r ["merge", "depth"])
238
+ (fun vin => do merge (← getp vin "val") (maxdepth := ← getp vin "depth"))
553
239
 
554
240
  -- getpath
555
- runSet "getpath.basic" ( getpropRawPub getpaths "basic")
556
- (arg1 (fun vin => do getpath (← vget vin "store") (← vget vin "path")))
557
- runSet "getpath.relative" ( getpropRawPub getpaths "relative")
558
- (arg1 (fun vin => do
559
- let dpath ← match (← vget vin "dpath") with
241
+ runset r "getpath.basic" (getset r ["getpath", "basic"])
242
+ (fun vin => do getpath (← getp vin "store") (← getp vin "path"))
243
+ runset r "getpath.relative" (getset r ["getpath", "relative"])
244
+ (fun vin => do
245
+ let dpath ← match (← getp vin "dpath") with
560
246
  | .str s => newList ((s.splitOn ".").map (fun x => Value.str x)).toArray
561
247
  | _ => pure Value.noval
562
- let d : InjDef := { dDparent := ← vget vin "dparent", dDpath := dpath }
563
- getpath (← vget vin "store") (← vget vin "path") (.idef d)))
564
- runSet "getpath.special" ( getpropRawPub getpaths "special")
565
- (arg1 (fun vin => do
566
- let injm ← vget vin "inj"
248
+ let d : InjDef := { dDparent := ← getp vin "dparent", dDpath := dpath }
249
+ getpath (← getp vin "store") (← getp vin "path") (.idef d))
250
+ runset r "getpath.special" (getset r ["getpath", "special"])
251
+ (fun vin => do
252
+ let injm ← getp vin "inj"
567
253
  let d : InjDef := {
568
254
  dBase := ← getprop injm (.str "base"), dMeta := ← getprop injm (.str "meta"),
569
255
  dDparent := ← getprop injm (.str "dparent"), dDpath := ← getprop injm (.str "dpath"),
570
256
  dKey := ← getprop injm (.str "key") }
571
- getpath (← vget vin "store") (← vget vin "path")
572
- (if isNullish injm then .inone else .idef d)))
573
- runSet "getpath.handler" ( getpropRawPub getpaths "handler")
574
- (arg1 (fun vin => do
257
+ getpath (← getp vin "store") (← getp vin "path")
258
+ (if isNullish injm then .inone else .idef d))
259
+ runset r "getpath.handler" (getset r ["getpath", "handler"])
260
+ (fun vin => do
575
261
  let foo ← vFunc (fun _ _ _ _ => pure (.str "foo"))
576
- let store ← omapV [("$TOP", ← vget vin "store"), ("$FOO", foo)]
262
+ let store ← omapV [("$TOP", ← getp vin "store"), ("$FOO", foo)]
577
263
  let h ← registerFunc (fun _inj v _ref _store => do
578
264
  match v with
579
265
  | .func fid => callFunc fid (← getDummyInj) .noval "" .noval
580
266
  | _ => pure v)
581
267
  let d : InjDef := { dHandler := some h }
582
- getpath store (← vget vin "path") (.idef d)))
268
+ getpath store (← getp vin "path") (.idef d))
583
269
 
584
270
  -- inject
585
- runSingle "inject.basic" ( getpropRawPub injects "basic")
271
+ runset r "inject.basic" (single (getset r ["inject", "basic"]))
272
+ (fun vin => do
273
+ inject (← clone (← getp vin "val")) (← clone (← getp vin "store")))
274
+ runset r "inject.string" (getset r ["inject", "string"])
586
275
  (fun vin => do
587
- inject (← clone (← getpropRawPub vin "val")) (← clone (← getpropRawPub vin "store")))
588
- runSet "inject.string" (← getpropRawPub injects "string")
589
- (arg1 (fun vin => do
590
276
  let mid ← registerModify nullModifier
591
- let d : InjDef := { dModify := some mid, dExtra := ← vget vin "current" }
592
- inject (← vget vin "val") (← vget vin "store") (.idef d)))
593
- runSet "inject.deep" ( getpropRawPub injects "deep")
594
- (arg1 (fun vin => do inject (← vget vin "val") (← vget vin "store")))
277
+ let d : InjDef := { dModify := some mid, dExtra := ← getp vin "current" }
278
+ inject (← getp vin "val") (← getp vin "store") (.idef d))
279
+ runset r "inject.deep" (getset r ["inject", "deep"])
280
+ (fun vin => do inject (← getp vin "val") (← getp vin "store"))
595
281
 
596
282
  -- transform
597
- runSingle "transform.basic" ( getpropRawPub transforms "basic")
598
- (fun vin => do
599
- transform (← getpropRawPub vin "data") (← getpropRawPub vin "spec"))
283
+ runset r "transform.basic" (single (getset r ["transform", "basic"]))
284
+ (fun vin => do transform (← getp vin "data") (← getp vin "spec"))
600
285
  for gn in ["paths", "cmds", "each", "pack", "ref"] do
601
- runSet ("transform." ++ gn) ( getpropRawPub transforms gn)
602
- (arg1 (fun vin => do transform (← vget vin "data") (← vget vin "spec")))
603
- runSet "transform.modify" ( getpropRawPub transforms "modify")
604
- (arg1 (fun vin => do
286
+ runset r ("transform." ++ gn) (getset r ["transform", gn])
287
+ (fun vin => do transform (← getp vin "data") (← getp vin "spec"))
288
+ runset r "transform.modify" (getset r ["transform", "modify"])
289
+ (fun vin => do
605
290
  let mid ← registerModify (fun v key parent _inj => do
606
291
  match v with
607
292
  | .str s =>
608
293
  if !(isNullish key) && !(isNullish parent) then
609
294
  let _ ← setprop parent key (.str ("@" ++ s))
610
295
  | _ => pure ())
611
- let d : InjDef := { dModify := some mid, dExtra := ← vget vin "store" }
612
- transform (← vget vin "data") (← vget vin "spec") (.idef d)))
613
- runSet "transform.format" ( getpropRawPub transforms "format")
614
- (arg1 (fun vin => do transform (← vget vin "data") (← vget vin "spec")))
615
- (flagNull := false)
616
- runSet "transform.apply" ( getpropRawPub transforms "apply")
617
- (arg1 (fun vin => do transform (← vget vin "data") (← vget vin "spec")))
296
+ let d : InjDef := { dModify := some mid, dExtra := ← getp vin "store" }
297
+ transform (← getp vin "data") (← getp vin "spec") (.idef d))
298
+ runset r "transform.format" (getset r ["transform", "format"])
299
+ (fun vin => do transform (← getp vin "data") (← getp vin "spec"))
300
+ (nullflag := false)
301
+ runset r "transform.apply" (getset r ["transform", "apply"])
302
+ (fun vin => do transform (← getp vin "data") (← getp vin "spec"))
618
303
 
619
304
  -- validate
620
- runSet "validate.basic" ( getpropRawPub validates "basic")
621
- (arg1 (fun vin => do validate (← vget vin "data") (← vget vin "spec")))
622
- (flagNull := false)
305
+ runset r "validate.basic" (getset r ["validate", "basic"])
306
+ (fun vin => do validate (← getp vin "data") (← getp vin "spec"))
307
+ (nullflag := false)
623
308
  for gn in ["child", "one", "exact"] do
624
- runSet ("validate." ++ gn) ( getpropRawPub validates gn)
625
- (arg1 (fun vin => do validate (← vget vin "data") (← vget vin "spec")))
626
- runSet "validate.invalid" ( getpropRawPub validates "invalid")
627
- (arg1 (fun vin => do validate (← vget vin "data") (← vget vin "spec")))
628
- (flagNull := false)
629
- runSet "validate.special" ( getpropRawPub validates "special")
630
- (arg1 (fun vin => do
631
- let injm ← vget vin "inj"
309
+ runset r ("validate." ++ gn) (getset r ["validate", gn])
310
+ (fun vin => do validate (← getp vin "data") (← getp vin "spec"))
311
+ runset r "validate.invalid" (getset r ["validate", "invalid"])
312
+ (fun vin => do validate (← getp vin "data") (← getp vin "spec"))
313
+ (nullflag := false)
314
+ runset r "validate.special" (getset r ["validate", "special"])
315
+ (fun vin => do
316
+ let injm ← getp vin "inj"
632
317
  let d : InjDef := { dMeta := ← getprop injm (.str "meta") }
633
- validate (← vget vin "data") (← vget vin "spec")
634
- (if isNullish injm then .inone else .idef d)))
318
+ validate (← getp vin "data") (← getp vin "spec")
319
+ (if isNullish injm then .inone else .idef d))
635
320
 
636
321
  -- select
637
322
  for gn in ["basic", "operators", "edge", "alts"] do
638
- runSet ("select." ++ gn) ( getpropRawPub selects gn)
639
- (arg1 (fun vin => do select (← vget vin "obj") (← vget vin "query")))
640
-
641
- -- regex (parity floor: Go stdlib regexp see design/REGEX_API.md)
642
- let regexs g "regex"
643
- runSet "regex.test" (← getpropRawPub regexs "test")
644
- (arg1 (fun vin => do
645
- reTest (← vget vin "pattern") (← vget vin "input")))
646
- runSet "regex.find" ( getpropRawPub regexs "find")
647
- (arg1 (fun vin => do
648
- reFind (← vget vin "pattern") (← vget vin "input")))
649
- runSet "regex.find_all" (← getpropRawPub regexs "find_all")
650
- (arg1 (fun vin => do
651
- reFindAll (← vget vin "pattern") (← vget vin "input")))
652
- runSet "regex.replace" (← getpropRawPub regexs "replace")
653
- (arg1 (fun vin => do
654
- reReplace ( vget vin "pattern") (← vget vin "input") (← vget vin "replacement")))
655
- runSet "regex.escape" (getpropRawPub regexs "escape")
656
- (arg1 (fun vin => do
657
- reEscape (← vget vin "val")))
658
-
659
- -- sentinels
660
- runSet "sentinels.getprop_unify" ( getpropRawPub sentinels "getprop_unify")
661
- (arg1 (fun vin => do
662
- getprop (← vget vin "val") (← vget vin "key") (← vget vin "alt")))
663
- (flagNull := false)
664
- runSet "sentinels.getelem_absent" ( getpropRawPub sentinels "getelem_absent")
665
- (arg1 (fun vin => do
666
- getelem ( vget vin "val") (← vget vin "key") (← vget vin "alt")))
667
- (flagNull := false)
668
- runSet "sentinels.haskey_unify" ( getpropRawPub sentinels "haskey_unify")
669
- (arg1 (fun vin => do
670
- pure (.bool (← haskey (← vget vin "val") (← vget vin "key")))))
671
- (flagNull := false)
672
- runSet "sentinels.isempty_unify" ( getpropRawPub sentinels "isempty_unify")
673
- (arg1 (fun v => do pure (.bool (← isempty v))))
674
- (flagNull := false)
675
- runSet "sentinels.isnode_unify" (← getpropRawPub sentinels "isnode_unify")
676
- (arg1 (fun v => pure (.bool (isnode v))))
677
- (flagNull := false)
678
- runSet "sentinels.stringify_null" (← getpropRawPub sentinels "stringify_null")
679
- (arg1 (fun vin => do pure (.str (← stringify vin))))
680
- (flagNull := false)
323
+ runset r ("select." ++ gn) (getset r ["select", gn])
324
+ (fun vin => do select (← getp vin "obj") (← getp vin "query"))
325
+
326
+ -- nullsem: does a PRESENT key holding a JSON null read as "no value"?
327
+ -- Every group runs {null: false} — the whole point of the section is the
328
+ -- distinction the null flag would erase.
329
+ --
330
+ -- This section used to be looked up as `sentinels`, under six group names
331
+ -- (`getprop_unify`, `getelem_absent`, `haskey_unify`, `isempty_unify`,
332
+ -- `isnode_unify`, `stringify_null`) the shipped corpus has never carried —
333
+ -- alongside a `regex` section it has never carried either. All eleven
334
+ -- groups therefore ran ZERO cases, silently. The vendored engine names a
335
+ -- missing group out loud (`SKIP`), which is how that was found; the
336
+ -- regex groups are gone because this port's `reTest`/`reFind`/... have no
337
+ -- corpus to answer, and nullsem is driven under the name it actually has.
338
+ runset r "nullsem.getprop" (getset r ["nullsem", "getprop"])
339
+ (fun vin => do
340
+ ifhasp vin "alt" then
341
+ getprop ( getp vin "val") ( getp vin "key") (← getp vin "alt")
342
+ else getprop (← getp vin "val") (← getp vin "key"))
343
+ (nullflag := false)
344
+ runset r "nullsem.getelem" (getset r ["nullsem", "getelem"])
345
+ (fun vin => do
346
+ if hasp vin "alt" then
347
+ getelem (← getp vin "val") (← getp vin "key") (← getp vin "alt")
348
+ else getelem ( getp vin "val") (← getp vin "key"))
349
+ (nullflag := false)
350
+ runset r "nullsem.getpath" (getset r ["nullsem", "getpath"])
351
+ (fun vin => do getpath (← getp vin "store") (← getp vin "path"))
352
+ (nullflag := false)
353
+ runset r "nullsem.haskey" (getset r ["nullsem", "haskey"])
354
+ (fun vin => do
355
+ pure (.bool (← haskey (← getp vin "src") (← getp vin "key"))))
356
+ (nullflag := false)
357
+ runset r "nullsem.keysof" (getset r ["nullsem", "keysof"])
358
+ (fun v => do newList ((← keysof v).map (fun s => Value.str s)))
359
+ (nullflag := false)
681
360
 
682
- -- ---------------- main ----------------
361
+ -- ---------------- main --------------------------------------------------
683
362
 
684
363
  def main (argv : List String) : IO UInt32 := do
685
- let testfile := argv.headD "../.sdk/test/test.json"
686
- let rawIO.FS.readFile testfile
687
- let ctx ← mkCtx
688
- let go : SIO Unit := do
689
- let alltests jsonRead raw
690
- let spec ← getpropRawPub alltests "struct"
691
- runAll spec
692
- go.run ctx
693
- for f in (← failures.get).reverse do
694
- IO.println f
695
- IO.println ""
696
- IO.println ("PASS " ++ toString (← npass.get) ++ " FAIL " ++ toString (← nfail.get))
697
- if (← nfail.get) > 0 then return 1 else return 0
364
+ let testfile resolveSpecPath argv
365
+ let rmakeRun testfile "struct"
366
+ let sctx ← mkCtx
367
+ (runAll r).run sctx
368
+ report r "STRUCT CORPUS: "