@voxgig/sdkgen 4.8.2 → 4.9.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 (407) 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/model/target/zig.aon +9 -0
  33. package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
  34. package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
  35. package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
  36. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
  37. package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
  38. package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
  39. package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
  40. package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
  41. package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
  42. package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
  43. package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
  44. package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
  45. package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
  46. package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
  47. package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
  48. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
  49. package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
  50. package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
  51. package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
  52. package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
  53. package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
  54. package/project/.sdk/src/cmp/zig/Package_zig.ts +15 -11
  55. package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +3 -3
  56. package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +3 -3
  57. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +3 -3
  58. package/project/.sdk/src/cmp/zig/utility_zig.ts +50 -1
  59. package/project/.sdk/tm/c/Makefile +38 -3
  60. package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
  61. package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
  62. package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
  63. package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
  64. package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
  65. package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
  66. package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
  67. package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
  68. package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
  69. package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
  70. package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
  71. package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
  72. package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
  73. package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
  74. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
  75. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
  76. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
  77. package/project/.sdk/tm/cpp/Makefile +5 -1
  78. package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
  79. package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
  80. package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
  81. package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
  82. package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
  83. package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
  84. package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
  85. package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
  86. package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
  87. package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
  88. package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
  89. package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
  90. package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
  91. package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
  92. package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
  93. package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
  94. package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
  95. package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
  96. package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
  97. package/project/.sdk/tm/dart/test/omni.dart +520 -0
  98. package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
  99. package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
  100. package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
  101. package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
  102. package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
  103. package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
  104. package/project/.sdk/tm/elixir/Makefile +11 -3
  105. package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
  106. package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
  107. package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
  108. package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
  109. package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
  110. package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
  111. package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
  112. package/project/.sdk/tm/go/core/context.go +32 -16
  113. package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
  114. package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
  115. package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
  116. package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
  117. package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
  118. package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
  119. package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
  120. package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
  121. package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
  122. package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
  123. package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
  124. package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
  125. package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
  126. package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
  127. package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
  128. package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
  129. package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
  130. package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
  131. package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
  132. package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
  133. package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
  134. package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +208 -0
  135. package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
  136. package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +150 -0
  137. package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
  138. package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
  139. package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
  140. package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +442 -0
  141. package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +714 -0
  142. package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
  143. package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
  144. package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
  145. package/project/.sdk/tm/go/test/omni/omni.go +902 -0
  146. package/project/.sdk/tm/go/test/omni/util.go +381 -0
  147. package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
  148. package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
  149. package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
  150. package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
  151. package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
  152. package/project/.sdk/tm/go/utility/make_options.go +8 -1
  153. package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
  154. package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
  155. package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
  156. package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
  157. package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
  158. package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
  159. package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
  160. package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
  161. package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
  162. package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
  163. package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
  164. package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
  165. package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
  166. package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
  167. package/project/.sdk/tm/js/test/omni.js +251 -0
  168. package/project/.sdk/tm/js/test/omni.test.js +105 -0
  169. package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
  170. package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
  171. package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
  172. package/project/.sdk/tm/js/test/vendor/omni/runner.js +628 -0
  173. package/project/.sdk/tm/js/test/vendor/omni/util.js +229 -0
  174. package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
  175. package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
  176. package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
  177. package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
  178. package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
  179. package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
  180. package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
  181. package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
  182. package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
  183. package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
  184. package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
  185. package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
  186. package/project/.sdk/tm/lean/Makefile +12 -5
  187. package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
  188. package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
  189. package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
  190. package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
  191. package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
  192. package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
  193. package/project/.sdk/tm/lua/test/omni.lua +456 -0
  194. package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
  195. package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
  196. package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
  197. package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
  198. package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
  199. package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
  200. package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
  201. package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
  202. package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
  203. package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
  204. package/project/.sdk/tm/ocaml/Makefile +37 -12
  205. package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
  206. package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
  207. package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
  208. package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
  209. package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
  210. package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
  211. package/project/.sdk/tm/perl/t/omni.pm +647 -0
  212. package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
  213. package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
  214. package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
  215. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
  216. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
  217. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
  218. package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
  219. package/project/.sdk/tm/php/test/Omni.php +691 -0
  220. package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
  221. package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
  222. package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
  223. package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
  224. package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
  225. package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
  226. package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
  227. package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
  228. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
  229. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
  230. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
  231. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
  232. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
  233. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
  234. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
  235. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
  236. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
  237. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
  238. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
  239. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
  240. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
  241. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
  242. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
  243. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +76 -0
  244. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
  245. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
  246. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
  247. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
  248. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
  249. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
  250. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +151 -0
  251. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
  252. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +90 -0
  253. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
  254. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
  255. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
  256. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
  257. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +475 -0
  258. package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
  259. package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
  260. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
  261. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
  262. package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
  263. package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
  264. package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
  265. package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
  266. package/project/.sdk/tm/py/test/omni.py +415 -0
  267. package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
  268. package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
  269. package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
  270. package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
  271. package/project/.sdk/tm/py/test/voxgig_omni/runner.py +580 -0
  272. package/project/.sdk/tm/py/test/voxgig_omni/util.py +252 -0
  273. package/project/.sdk/tm/rb/test/omni.rb +505 -0
  274. package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
  275. package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
  276. package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
  277. package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
  278. package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
  279. package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
  280. package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
  281. package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
  282. package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
  283. package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
  284. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
  285. package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
  286. package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
  287. package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
  288. package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
  289. package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
  290. package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
  291. package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
  292. package/project/.sdk/tm/scala/Makefile +16 -6
  293. package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
  294. package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
  295. package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
  296. package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
  297. package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
  298. package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
  299. package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
  300. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
  301. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
  302. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
  303. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
  304. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
  305. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
  306. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
  307. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
  308. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
  309. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
  310. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
  311. package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
  312. package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
  313. package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
  314. package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
  315. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
  316. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
  317. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
  318. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
  319. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
  320. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
  321. package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
  322. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
  323. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
  324. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
  325. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
  326. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
  327. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
  328. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
  329. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
  330. package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
  331. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
  332. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
  333. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
  334. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
  335. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
  336. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
  337. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
  338. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
  339. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
  340. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
  341. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
  342. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
  343. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
  344. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
  345. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
  346. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
  347. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
  348. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
  349. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
  350. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
  351. package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
  352. package/project/.sdk/tm/ts/test/omni.ts +104 -32
  353. package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
  354. package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
  355. package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
  356. package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
  357. package/project/.sdk/tm/zig/Makefile +15 -1
  358. package/project/.sdk/tm/zig/build.zig +23 -5
  359. package/project/.sdk/tm/zig/core/helpers.zig +52 -11
  360. package/project/.sdk/tm/zig/core/mem.zig +17 -1
  361. package/project/.sdk/tm/zig/core/utility.zig +23 -19
  362. package/project/.sdk/tm/zig/feature/audit.zig +2 -2
  363. package/project/.sdk/tm/zig/feature/cache.zig +2 -2
  364. package/project/.sdk/tm/zig/feature/debug.zig +5 -5
  365. package/project/.sdk/tm/zig/feature/netsim.zig +2 -2
  366. package/project/.sdk/tm/zig/feature/paging.zig +2 -2
  367. package/project/.sdk/tm/zig/feature/proxy.zig +15 -8
  368. package/project/.sdk/tm/zig/feature/streaming.zig +5 -5
  369. package/project/.sdk/tm/zig/feature/support.zig +3 -3
  370. package/project/.sdk/tm/zig/feature/telemetry.zig +5 -5
  371. package/project/.sdk/tm/zig/feature/test.zig +10 -5
  372. package/project/.sdk/tm/zig/test/fh.zig +10 -10
  373. package/project/.sdk/tm/zig/test/gotcha_test.zig +5 -5
  374. package/project/.sdk/tm/zig/test/omniresolver.zig +515 -0
  375. package/project/.sdk/tm/zig/test/omnismoke_test.zig +284 -0
  376. package/project/.sdk/tm/zig/test/pipeline_test.zig +8 -8
  377. package/project/.sdk/tm/zig/test/primary_utility_test.zig +145 -155
  378. package/project/.sdk/tm/zig/test/struct_corpus.zig +264 -187
  379. package/project/.sdk/tm/zig/test/vendor/omni/omni.zig +1314 -0
  380. package/project/.sdk/tm/zig/test/vendor/omni/regex.zig +446 -0
  381. package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +7 -4
  382. package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +356 -157
  383. package/project/sdkgen-package.json +1 -1
  384. package/src/action/doctor.ts +66 -2
  385. package/src/helpers/naming.ts +4 -2
  386. package/project/.sdk/tm/c/tests/runner.h +0 -274
  387. package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
  388. package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
  389. package/project/.sdk/tm/dart/test/runner.dart +0 -406
  390. package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
  391. package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
  392. package/project/.sdk/tm/go/test/runner_test.go +0 -629
  393. package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
  394. package/project/.sdk/tm/java/test/StructRunner.java +0 -281
  395. package/project/.sdk/tm/js/test/runner.js +0 -387
  396. package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
  397. package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
  398. package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
  399. package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
  400. package/project/.sdk/tm/php/test/StructRunner.php +0 -275
  401. package/project/.sdk/tm/py/test/struct_runner.py +0 -411
  402. package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
  403. package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
  404. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
  405. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
  406. package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
  407. package/project/.sdk/tm/zig/test/struct_runner.zig +0 -464
@@ -4,7 +4,7 @@
4
4
  (:require [sdk.core :as core]
5
5
  [sdk.client :as client]
6
6
  [sdk.testutil :as t]
7
- [sdk.test.struct-corpus :as corpus]
7
+ [sdk.test.omni :as omni]
8
8
  [voxgig.struct :as vs]
9
9
  [clojure.string :as str])
10
10
  (:import [java.util Map]))
@@ -19,9 +19,6 @@
19
19
 
20
20
  (def ^:private CORPUS "../.sdk/test/test.json")
21
21
 
22
- (defn- getspec [root & path]
23
- (reduce (fn [acc k] (when acc (.get ^Map acc k))) root path))
24
-
25
22
  (defn- lower-headers [m]
26
23
  ;; Header names arrive in any case and the contract is lowercase; the SDK
27
24
  ;; copies them verbatim, so the driver normalises, as the lua reference does.
@@ -143,16 +140,24 @@
143
140
  (t/is-true (str/includes? (str (vs/getprop fetchdef "url")) "/api/items/item01") "url includes")))))
144
141
  nil))
145
142
 
146
-
147
143
  (defn run-corpus
148
- "Drive every primary section of the shared corpus through this SDK."
144
+ "Drive every primary section of the shared corpus through this SDK.
145
+
146
+ The engine is the VENDORED omni runner (sdk.test.omni), not a hand-written
147
+ entry loop: each section names its corpus node and the subject that drives
148
+ it, and omni decides whether the result, the match and the error
149
+ expectations hold. omni raises on the first failing entry of a set, so a
150
+ green section counts its whole set - counted at the SUBJECT, from
151
+ sdk.test.omni's execution counter, and failed when it disagrees with the
152
+ set handed over, so the number cannot survive a stopped engine."
149
153
  [rec]
150
- (let [sdk (client/test-sdk nil nil)
154
+ (let [alltests (omni/load-spec CORPUS)
155
+ primary (get alltests "primary")
156
+ sdk (client/test-sdk nil nil)
157
+ mkrunner (omni/make-runner alltests sdk)
151
158
  utility (core/get-utility sdk)
152
159
  u (fn [k] (get (deref utility) k))
153
- alltests (core/json-parse (slurp CORPUS))
154
- primary (.get ^Map alltests "primary")
155
- setup-of (fn [nm] (getspec primary nm "DEF" "setup" "a"))
160
+ setup-of (fn [nm] (omni/->struct (get-in primary [nm "DEF" "setup" "a"])))
156
161
  client-for (fn [nm] (let [su (setup-of nm)]
157
162
  (if (vs/ismap su) (client/test-sdk nil su) sdk)))
158
163
  ;; make-spec and prepare-auth read defaults off the CLIENT, as the ts
@@ -161,62 +166,91 @@
161
166
  spec-sdk (client-for "makeSpec")
162
167
  auth-sdk (client-for "prepareAuth")
163
168
  ran (atom 0)
169
+ npass (atom 0)
170
+ fails (atom [])
164
171
  ;; One section, driven with a ctx built from the corpus entry.
165
172
  runset (fn [nm cl f]
166
- (let [node (getspec primary nm "basic")]
167
- (when (nil? node)
168
- (throw (ex-info (str "corpus section missing: " nm) {})))
169
- (swap! ran inc)
170
- ;; run-set APPLIES the resolved args, so an args-style entry
171
- ;; calls the subject with more than one — variadic, and the
172
- ;; extra arg reaches the section through `more`.
173
- (corpus/run-set nm node
174
- (fn [& as]
175
- (let [ctxmap (first as)
176
- more (second as)
177
- ctx (corpus-ctx cl (core/get-utility cl) ctxmap)
178
- out (f ctx ctxmap more)]
179
- (publish-ctx ctxmap ctx)
180
- out)))))
173
+ (let [node (get-in primary [nm "basic"])]
174
+ (when (nil? node)
175
+ (throw (ex-info (str "corpus section missing: " nm) {})))
176
+ (swap! ran inc)
177
+ (let [rp (mkrunner nm)
178
+ testset (get node "set")
179
+ n (count testset)]
180
+ ;; A section whose `set` is present but empty runs nothing
181
+ ;; and raises nothing - no passes, and green. omni refuses
182
+ ;; that under a versioned spec (`checkset`, with an
183
+ ;; `empty: true` opt-out); the shared corpus is lenient v0,
184
+ ;; so it is refused here. A section with no `set` at all is
185
+ ;; left to omni, whose message for it is the better one.
186
+ (if (and (sequential? testset) (zero? n)
187
+ (not (true? (get node "empty"))))
188
+ (swap! fails conj [nm "corpus section has an empty set"])
189
+ (try
190
+ ;; omni APPLIES the resolved args, so an args-style entry
191
+ ;; calls the subject with more than one - variadic, and the
192
+ ;; extra arg reaches the section through `more`.
193
+ ;;
194
+ ;; `executed` is the engine's own count for this set
195
+ ;; (sdk.test.omni counts inside the subject wrapper),
196
+ ;; NOT the section's declared size: a number derived
197
+ ;; from the spec prints the same whether the engine ran
198
+ ;; or was never called, so it could never show a
199
+ ;; stoppage.
200
+ (let [executed (long (or ((:runsetflags rp) node {:name nm}
201
+ (fn [& as]
202
+ (let [ctxmap (first as)
203
+ more (second as)
204
+ ctx (corpus-ctx cl (core/get-utility cl) ctxmap)
205
+ out (f ctx ctxmap more)]
206
+ ;; ctxmap is the LIVE map behind omni's
207
+ ;; ctx view, so this write is what
208
+ ;; `match: {ctx: ...}` reads.
209
+ (publish-ctx ctxmap ctx)
210
+ out)))
211
+ 0))]
212
+ (if (not= executed n)
213
+ (swap! fails conj
214
+ [nm (str "the engine ran " executed " of the section's "
215
+ n " entries")])
216
+ (swap! npass + executed)))
217
+ (catch Throwable err
218
+ (swap! fails conj [nm (or (ex-message err) (str err))])))))))
181
219
  argof (fn [ctxmap k] (vs/getprop ctxmap k))]
182
220
 
183
221
  (t/run-check rec "primary-corpus"
184
222
  (fn []
185
- (binding [corpus/*results* (atom {:pass [] :fail []})]
186
- (runset "done" sdk (fn [c _ _2] ((u :done) c)))
187
- (runset "makeUrl" sdk (fn [c _ _2] (first ((u :make-url) c))))
188
- (runset "makeRequest" sdk (fn [c _ _2] (first ((u :make-request) c))))
189
- (runset "makeResponse" sdk (fn [c _ _2] (first ((u :make-response) c))))
190
- (runset "makeSpec" spec-sdk (fn [c _ _2] (first ((u :make-spec) c))))
191
- (runset "prepareAuth" auth-sdk (fn [c _ _2] (first ((u :prepare-auth) c))))
192
- (runset "prepareBody" sdk (fn [c _ _2] ((u :prepare-body) c)))
193
- (runset "prepareHeaders" sdk (fn [c _ _2] ((u :prepare-headers) c)))
194
- (runset "prepareMethod" sdk (fn [c _ _2] ((u :prepare-method) c)))
195
- (runset "prepareParams" sdk (fn [c _ _2] ((u :prepare-params) c)))
196
- (runset "preparePath" sdk (fn [c _ _2] ((u :prepare-path) c)))
197
- (runset "prepareQuery" sdk (fn [c _ _2] ((u :prepare-query) c)))
198
- (runset "resultBasic" sdk (fn [c _ _2] (neutral ((u :result-basic) c))))
199
- (runset "resultBody" sdk (fn [c _ _2] (neutral ((u :result-body) c))))
200
- (runset "resultHeaders" sdk (fn [c _ _2] (neutral ((u :result-headers) c))))
201
- (runset "transformRequest" sdk (fn [c _ _2] ((u :transform-request) c)))
202
- (runset "transformResponse" sdk (fn [c _ _2] ((u :transform-response) c)))
203
- (runset "makeOptions" sdk (fn [c m _2]
223
+ (runset "done" sdk (fn [c _ _2] ((u :done) c)))
224
+ (runset "makeUrl" sdk (fn [c _ _2] (first ((u :make-url) c))))
225
+ (runset "makeRequest" sdk (fn [c _ _2] (first ((u :make-request) c))))
226
+ (runset "makeResponse" sdk (fn [c _ _2] (first ((u :make-response) c))))
227
+ (runset "makeSpec" spec-sdk (fn [c _ _2] (first ((u :make-spec) c))))
228
+ (runset "prepareAuth" auth-sdk (fn [c _ _2] (first ((u :prepare-auth) c))))
229
+ (runset "prepareBody" sdk (fn [c _ _2] ((u :prepare-body) c)))
230
+ (runset "prepareHeaders" sdk (fn [c _ _2] ((u :prepare-headers) c)))
231
+ (runset "prepareMethod" sdk (fn [c _ _2] ((u :prepare-method) c)))
232
+ (runset "prepareParams" sdk (fn [c _ _2] ((u :prepare-params) c)))
233
+ (runset "preparePath" sdk (fn [c _ _2] ((u :prepare-path) c)))
234
+ (runset "prepareQuery" sdk (fn [c _ _2] ((u :prepare-query) c)))
235
+ (runset "resultBasic" sdk (fn [c _ _2] (neutral ((u :result-basic) c))))
236
+ (runset "resultBody" sdk (fn [c _ _2] (neutral ((u :result-body) c))))
237
+ (runset "resultHeaders" sdk (fn [c _ _2] (neutral ((u :result-headers) c))))
238
+ (runset "transformRequest" sdk (fn [c _ _2] ((u :transform-request) c)))
239
+ (runset "transformResponse" sdk (fn [c _ _2] ((u :transform-response) c)))
240
+ (runset "makeOptions" sdk (fn [c m _2]
204
241
  (core/oset! c :config (argof m "config"))
205
242
  (core/oset! c :options (argof m "options"))
206
243
  ((u :make-options) c)))
207
- (runset "makeContext" sdk (fn [c _ _2]
244
+ (runset "makeContext" sdk (fn [c _ _2]
208
245
  (let [op (core/oget c :op)]
209
246
  (vs/jm "op" (neutral op)))))
210
- (runset "makeError" sdk (fn [c _ err] (first ((u :make-error) c err))))
211
- (runset "operator" sdk (fn [_ m _2] (neutral (core/make-operation m))))
212
- (runset "param" sdk (fn [c _ pd] ((u :param) c pd)))
213
-
214
- (let [r @corpus/*results*
215
- np (count (:pass r))
216
- nf (count (:fail r))]
217
- (doseq [f (:fail r)]
218
- (println "PRIMARY-FAIL" (:group f) (:name f) "-" (:msg f)))
219
- (println "PRIMARY CORPUS: PASS" np " FAIL" nf)
220
- (t/is-true (< 0 @ran) "the primary corpus executed no sections")
221
- (t/is-true (< 0 np) "the primary corpus executed no cases")
222
- (t/is-true (= 0 nf) (str nf " primary corpus failures"))))))))
247
+ (runset "makeError" sdk (fn [c _ err] (first ((u :make-error) c err))))
248
+ (runset "operator" sdk (fn [_ m _2] (neutral (core/make-operation m))))
249
+ (runset "param" sdk (fn [c _ pd] ((u :param) c pd)))
250
+
251
+ (let [np @npass nf (count @fails)]
252
+ (doseq [[nm msg] @fails] (println "PRIMARY-FAIL" nm "-" msg))
253
+ (println "PRIMARY CORPUS: PASS" np " FAIL" nf)
254
+ (t/is-true (< 0 @ran) "the primary corpus executed no sections")
255
+ (t/is-true (< 0 np) "the primary corpus executed no cases")
256
+ (t/is-true (= 0 nf) (str nf " primary corpus failures")))))))
@@ -1,155 +1,124 @@
1
- ;; ProjectName SDK vendored voxgig/struct corpus runner.
2
- ;; Runs the shared JSON corpus (.sdk/test/test.json "struct" section) through
3
- ;; the vendored voxgig.struct port exposed by the SDK utility. Adapted from the
4
- ;; canonical clojure struct test runner.
1
+ ;; ProjectName SDK - the shared struct corpus, driven by the VENDORED
2
+ ;; @voxgig/omni engine.
3
+ ;;
4
+ ;; The corpus wiring (`run-all` and the walk subjects below) is unchanged: it
5
+ ;; names each section of .sdk/test/test.json "struct" and hands omni the
6
+ ;; subject that drives it through this SDK's own vendored voxgig.struct. What
7
+ ;; changed is the ENGINE underneath - the hand-written entry loop, matcher and
8
+ ;; error handling that used to live in this file are gone, replaced by the
9
+ ;; vendored runner reached through sdk.test.omni. A hand-written matcher can
10
+ ;; only ever check what its author thought of; the shared one is the same code
11
+ ;; every other port is held to.
12
+ ;;
13
+ ;; Counting: omni raises on the first failing entry in a set rather than
14
+ ;; recording per-entry results, so a green section counts its whole set and a
15
+ ;; red one counts one failure and names the entry omni rejected.
16
+ ;;
17
+ ;; The count is what the ENGINE RAN, never the section's declared `set` size.
18
+ ;; sdk.test.omni increments a counter inside the subject wrapper - the one
19
+ ;; place only the engine reaches - and its `runsetflags` returns the delta
20
+ ;; across the set; `run-set` records that many passes, and fails the section
21
+ ;; outright when the delta does not match the set it handed over. A count
22
+ ;; taken from the spec instead would print the same number for a working
23
+ ;; engine and for one that was never called, which is worse than no number:
24
+ ;; it reads as evidence. So an all-green run reports exactly the corpus's own
25
+ ;; entry count BECAUSE the engine executed exactly those entries - if the
26
+ ;; number falls, the corpus stopped running, which is the one thing this
27
+ ;; suite exists to notice.
5
28
  (ns sdk.test.struct-corpus
6
29
  (:require [voxgig.struct :as s]
7
- [sdk.core :as core]
30
+ [sdk.test.omni :as omni]
8
31
  [clojure.string :as str])
9
32
  (:import [java.util LinkedHashMap ArrayList List Map]))
10
33
 
11
- (def NULLMARK "__NULL__")
12
- (def UNDEFMARK "__UNDEF__")
13
- (def EXISTSMARK "__EXISTS__")
14
-
15
- (defn fix-json [v flag-null]
16
- (cond
17
- (nil? v) (if flag-null NULLMARK nil)
18
- (s/ismap v) (let [o (LinkedHashMap.)]
19
- (doseq [k (.keySet ^Map v)] (.put o (str k) (fix-json (.get ^Map v k) flag-null)))
20
- o)
21
- (s/islist v) (let [a (ArrayList.)]
22
- (doseq [x v] (.add a (fix-json x flag-null)))
23
- a)
24
- :else v))
25
-
26
- (defn canon [v]
27
- (cond
28
- (s/ismap v) (into (sorted-map) (map (fn [k] [(str k) (canon (.get ^Map v k))]) (.keySet ^Map v)))
29
- (s/islist v) (mapv canon (vec v))
30
- :else v))
31
-
32
- (defn eqv [a b] (= (canon a) (canon b)))
33
-
34
- (defn matchval [check base]
35
- (let [check (if (or (= check UNDEFMARK) (= check NULLMARK)) nil check)]
36
- (cond
37
- (eqv check base) true
38
- (string? check)
39
- (let [basestr (s/stringify base)
40
- m (re-matches #"^/(.+)/$" check)]
41
- (if m
42
- (boolean (re-find (re-pattern (second m)) basestr))
43
- (str/includes? (str/lower-case basestr) (str/lower-case (s/stringify check)))))
44
- (s/isfunc check) true
45
- :else false)))
46
-
47
- (defn- omap [& kvs]
48
- (let [m (LinkedHashMap.)]
49
- (doseq [[k v] (partition 2 kvs)] (.put m k v))
50
- m))
51
-
52
- (defn do-match [check base]
53
- (let [base (s/clone base)]
54
- (s/walk check
55
- (fn [_k val _p path]
56
- (when-not (s/isnode val)
57
- (let [baseval (s/getpath base path)]
58
- (cond
59
- (eqv baseval val) nil
60
- (and (= val UNDEFMARK) (nil? baseval)) nil
61
- (and (= val EXISTSMARK) (some? baseval)) nil
62
- (not (matchval val baseval))
63
- (throw (AssertionError.
64
- (str "MATCH: " (str/join "." (vec path)) ": ["
65
- (s/stringify val) "] <=> [" (s/stringify baseval) "]"))))))
66
- val))))
67
-
68
- (defn- resolve-args [^Map entry subject]
69
- (cond
70
- (.containsKey entry "ctx") [(.get entry "ctx")]
71
- (.containsKey entry "args")
72
- (let [args (vec (.get entry "args"))]
73
- ;; ts's resolveArgs writes the live first arg back as entry.ctx, so a
74
- ;; `match: {ctx: ...}` resolves for args-style entries too. Without it
75
- ;; every such assertion reads null and silently passes nothing.
76
- (when (and (seq args) (s/ismap (first args)))
77
- (.put entry "ctx" (first args)))
78
- args)
79
- (.containsKey entry "in") [(s/clone (.get entry "in"))]
80
- :else []))
81
-
82
- (defn- safe-call [subject args]
83
- (if (empty? args)
84
- (try (subject) (catch clojure.lang.ArityException _ (subject nil)))
85
- (apply subject args)))
86
-
87
- (defn check-result [^Map entry args res]
88
- (let [matched (atom false)]
89
- (when (.containsKey entry "match")
90
- (do-match (.get entry "match")
91
- (omap "in" (.get entry "in") "args" (s/clone (ArrayList. ^java.util.Collection args))
92
- "out" (.get entry "res") "ctx" (.get entry "ctx")))
93
- (reset! matched true))
94
- (let [out (.get entry "out")]
95
- (cond
96
- (eqv out res) nil
97
- (and @matched (or (= out NULLMARK) (nil? out))) nil
98
- :else (throw (AssertionError. (str "Expected: " (s/stringify out) ", got: " (s/stringify res))))))))
99
-
100
- (defn handle-error [^Map entry err]
101
- (let [entry-err (when (.containsKey entry "err") (.get entry "err"))
102
- msg (or (.getMessage ^Throwable err) (str err))]
103
- (if (.containsKey entry "err")
104
- (if (or (= entry-err true) (matchval entry-err msg))
105
- (when (.containsKey entry "match")
106
- (do-match (.get entry "match")
107
- (omap "in" (.get entry "in") "out" (.get entry "res")
108
- ;; The ts runner hands do-match the ERROR OBJECT, so a
109
- ;; corpus `match: {err: {message: ...}}` resolves. This
110
- ;; port passed the bare message string, where err.message
111
- ;; walks into a string and reads null.
112
- "ctx" (.get entry "ctx") "err" (omap "message" msg))))
113
- (throw (AssertionError. (str "ERROR MATCH: [" (s/stringify entry-err) "] <=> [" msg "]"))))
114
- (throw (if (instance? AssertionError err) err (AssertionError. (str err)))))))
34
+ (def NULLMARK omni/NULLMARK)
35
+ (def UNDEFMARK omni/UNDEFMARK)
36
+ (def EXISTSMARK omni/EXISTSMARK)
115
37
 
116
38
  (def ^:dynamic *results* nil)
117
39
 
40
+ ;; The omni runpack for the section being driven, bound by run-corpus (and by
41
+ ;; the primary suite, which shares this recording shape).
42
+ (def ^:dynamic *runner* nil)
43
+
118
44
  (defn- record! [group name ok? msg]
119
45
  (swap! *results* update (if ok? :pass :fail) (fnil conj []) {:group group :name name :msg msg}))
120
46
 
47
+ (defn- setsize [node]
48
+ (let [testset (when (s/ismap node) (.get ^Map node "set"))]
49
+ (if (s/islist testset) (.size ^List testset) 0)))
50
+
51
+ ;; A section whose `set` is PRESENT but empty runs nothing and raises nothing:
52
+ ;; it would record no passes and leave the suite green, which is the same
53
+ ;; silent stoppage wearing corpus clothes. omni's own strict mode refuses it
54
+ ;; (`checkset`), with an `empty: true` opt-out for a section that means it;
55
+ ;; the shared corpus declares no OMNI version, so it is lenient v0 and that
56
+ ;; check never fires - the rule is applied here instead. A section with no
57
+ ;; `set` at all is left to omni, whose message for it is the better one.
58
+ (defn- empty-set? [node]
59
+ (let [testset (when (s/ismap node) (.get ^Map node "set"))]
60
+ (boolean (and (s/islist testset)
61
+ (zero? (.size ^List testset))
62
+ (not (true? (.get ^Map node "empty")))))))
63
+
64
+ ;; Drive one corpus section through the vendored engine.
65
+ ;;
66
+ ;; `flags` is the corpus-facing spelling ({"null" false}); omni's own is
67
+ ;; keyword-keyed, and it takes the section label there too, so a failure names
68
+ ;; the section rather than the runner.
121
69
  (defn run-set
122
70
  ([group node subject] (run-set group node {} subject))
123
71
  ([group node flags subject]
124
- (when (s/ismap node)
125
- (let [flag-null (get flags "null" true)
126
- fixed (fix-json node flag-null)
127
- testset (.get ^Map fixed "set")]
128
- (doseq [^Map entry testset]
129
- (try
130
- (when (and (not (.containsKey entry "out")) flag-null)
131
- (.put entry "out" NULLMARK))
132
- (let [args (resolve-args entry subject)
133
- res (fix-json (safe-call subject args) flag-null)]
134
- (.put entry "res" res)
135
- (check-result entry args res))
136
- (record! group (str (.get entry "name")) true nil)
137
- (catch Throwable err
138
- (try
139
- (handle-error entry err)
140
- (record! group (str (.get entry "name")) true nil)
141
- (catch Throwable e2
142
- (record! group (str (.get entry "name")) false (.getMessage e2)))))))))))
72
+ (cond
73
+ (nil? *runner*)
74
+ (record! group "section" false "no omni runner bound")
75
+
76
+ (not (s/ismap node))
77
+ ;; A missing section used to be skipped in silence, which is how a
78
+ ;; renamed corpus section becomes a suite that tests nothing.
79
+ (record! group "section" false "corpus section missing")
143
80
 
81
+ (empty-set? node)
82
+ (record! group "entries" false "corpus section has an empty set")
83
+
84
+ :else
85
+ (let [omniflags (cond-> {:name group}
86
+ (contains? flags "null") (assoc :null (boolean (get flags "null"))))
87
+ n (setsize node)]
88
+ (try
89
+ ;; `ran` is the engine's own execution count for this set, not the
90
+ ;; corpus's declared size: a section that reports fewer (or, with a
91
+ ;; disconnected engine, none) fails here instead of counting the
92
+ ;; entries nobody ran.
93
+ (let [ran (long (or ((:runsetflags *runner*) node omniflags subject) 0))]
94
+ (if (not= ran n)
95
+ (record! group "entries" false
96
+ (str "the engine ran " ran " of the section's " n " entries"))
97
+ (dotimes [_ ran] (record! group "entry" true nil))))
98
+ (catch Throwable err
99
+ (record! group "entry" false (or (ex-message err) (str err)))))))))
100
+
101
+ ;; A section that is one case rather than a `set`: `in` in, `out` expected.
102
+ ;; omni has no entry point for these, so the comparison is its own
103
+ ;; `deepequal`, on values converted back into its model.
144
104
  (defn run-single [group node actual-fn]
145
- (when (s/ismap node)
105
+ (if-not (s/ismap node)
106
+ (record! group "single" false "corpus section missing")
146
107
  (try
147
108
  (let [expected (.get ^Map node "out")
148
- actual (actual-fn (.get ^Map node "in"))]
149
- (if (eqv expected actual)
109
+ actual (omni/->omni (actual-fn (omni/->struct (.get ^Map node "in"))))]
110
+ (if (omni/deep-equal? expected actual)
150
111
  (record! group "single" true nil)
151
- (record! group "single" false (str "Expected: " (s/stringify expected) ", got: " (s/stringify actual)))))
152
- (catch Throwable e (record! group "single" false (.getMessage e))))))
112
+ (record! group "single" false
113
+ (str "Expected: " (omni/stringify expected) ", got: " (omni/stringify actual)))))
114
+ (catch Throwable e (record! group "single" false (or (ex-message e) (str e)))))))
115
+
116
+ ;; A struct-model map literal, for the inject/transform sections that build a
117
+ ;; store or an injection descriptor by hand.
118
+ (defn- omap [& kvs]
119
+ (let [m (LinkedHashMap.)]
120
+ (doseq [[k v] (partition 2 kvs)] (.put m k v))
121
+ m))
153
122
 
154
123
  (defn- gp [^Map m & ks] (reduce (fn [acc k] (when (s/ismap acc) (.get ^Map acc k))) m ks))
155
124
  (defn- vget [vin k] (when (s/ismap vin) (.get ^Map vin k)))
@@ -157,10 +126,7 @@
157
126
 
158
127
  (declare run-walk-log walk-copy-subject walk-depth-subject)
159
128
 
160
- (defn null-modifier [val key parent & _]
161
- (cond
162
- (= val NULLMARK) (s/setprop parent key nil)
163
- (string? val) (s/setprop parent key (str/replace val NULLMARK "null"))))
129
+ (def null-modifier omni/null-modifier)
164
130
 
165
131
  (defn run-all [spec]
166
132
  (let [minor (gp spec "minor") walk (gp spec "walk") mergeS (gp spec "merge")
@@ -285,23 +251,30 @@
285
251
  (run-set (str "select." g) (gp selectS g)
286
252
  (fn [vin] (s/select (vget vin "obj") (vget vin "query")))))))
287
253
 
254
+
255
+ ;; `walk.log` is a single case whose expectation is the log the walk emits.
256
+ ;; The node arrives in omni's model, so it is converted before the vendored
257
+ ;; struct walks it, and the log converted back before omni compares.
288
258
  (defn run-walk-log [group node]
289
- (when (s/ismap node)
259
+ (if-not (s/ismap node)
260
+ (record! group "log" false "corpus section missing")
290
261
  (try
291
- (let [test-data (s/clone node)
262
+ (let [test-data (omni/->struct node)
292
263
  log (ArrayList.)
293
264
  walklog (fn [key val parent path]
294
265
  (.add log (str "k=" (if (nil? key) (s/stringify) (s/stringify key))
295
266
  ", v=" (s/stringify val)
296
267
  ", p=" (if (nil? parent) (s/stringify) (s/stringify parent))
297
268
  ", t=" (s/pathify path)))
298
- val)]
269
+ val)
270
+ expected (gp node "out" "after")]
299
271
  (s/walk (.get ^Map test-data "in") walklog)
300
- (if (eqv (s/getprop (.get ^Map test-data "out") "after") log)
272
+ (if (omni/deep-equal? expected (omni/->omni log))
301
273
  (record! group "log" true nil)
302
- (record! group "log" false (str "Expected: " (s/stringify (s/getprop (.get ^Map test-data "out") "after"))
303
- ", got: " (s/stringify log)))))
304
- (catch Throwable e (record! group "log" false (.getMessage e))))))
274
+ (record! group "log" false
275
+ (str "Expected: " (omni/stringify expected)
276
+ ", got: " (omni/stringify (omni/->omni log))))))
277
+ (catch Throwable e (record! group "log" false (or (ex-message e) (str e)))))))
305
278
 
306
279
  (defn walk-copy-subject [vin]
307
280
  (let [cur (atom (doto (ArrayList.) (.add nil)))]
@@ -336,13 +309,13 @@
336
309
  (s/walk (vget vin "src") {:before copy :maxdepth (vget vin "maxdepth")})
337
310
  (:top @state))))
338
311
 
312
+
339
313
  ;; Returns [pass fail failures]. Prints each failure.
340
314
  (defn run-corpus [testfile]
341
- (let [raw (slurp testfile)
342
- alltests (core/json-parse raw)
343
- spec (.get ^Map alltests "struct")]
344
- (binding [*results* (atom {:pass [] :fail []})]
345
- (run-all spec)
315
+ (let [runpack ((omni/make-runner testfile) "struct")]
316
+ (binding [*results* (atom {:pass [] :fail []})
317
+ *runner* runpack]
318
+ (run-all (:spec runpack))
346
319
  (let [r @*results* np (count (:pass r)) nf (count (:fail r))]
347
320
  (doseq [f (:fail r)] (println "STRUCT-FAIL" (:group f) (:name f) "-" (:msg f)))
348
321
  [np nf (:fail r)]))))
@@ -1,13 +1,15 @@
1
1
  ;; ProjectName SDK test runner (tools.deps main entry point).
2
- ;; Runs the API-agnostic suites (primary utility, pipeline, features, netsim),
3
- ;; the generated API-specific suite, and the vendored struct corpus, then
4
- ;; reports counts and exits non-zero on any failure.
2
+ ;; Runs the vendored omni runner's smoke test, the API-agnostic suites
3
+ ;; (primary utility, pipeline, features, netsim), the generated API-specific
4
+ ;; suite, and the vendored struct corpus, then reports counts and exits
5
+ ;; non-zero on any failure.
5
6
  (ns sdk.test-runner
6
7
  (:require [sdk.test.primary :as primary]
7
8
  [sdk.test.pipeline :as pipeline]
8
9
  [sdk.test.feature :as feature]
9
10
  [sdk.test.netsim :as netsim]
10
11
  [sdk.test.struct-corpus :as corpus]
12
+ [sdk.test.omni-smoke :as omnismoke]
11
13
  [sdk.gentest :as gentest]))
12
14
 
13
15
  (defn- find-corpus-file []
@@ -17,6 +19,9 @@
17
19
  (defn -main [& _args]
18
20
  (let [results (atom [])
19
21
  rec (fn [name ok? msg] (swap! results conj {:name name :ok ok? :msg msg}))]
22
+ ;; The vendored engine's own smoke test runs FIRST: if the runner cannot
23
+ ;; fail a bad entry, every corpus count below it is meaningless.
24
+ (omnismoke/run rec)
20
25
  (primary/run rec)
21
26
  ;; The shared corpus, driven through this SDK's utilities.
22
27
  (primary/run-corpus rec)