@voxgig/sdkgen-langpack 0.0.1
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.
- package/.sdk/model/target/dart.aon +63 -0
- package/.sdk/model/target/haskell.aon +72 -0
- package/.sdk/model/target/lean.aon +91 -0
- package/.sdk/src/cmp/dart/Config_dart.ts +248 -0
- package/.sdk/src/cmp/dart/EntityBase_dart.ts +34 -0
- package/.sdk/src/cmp/dart/EntityOperation_dart.ts +43 -0
- package/.sdk/src/cmp/dart/EntityTypes_dart.ts +207 -0
- package/.sdk/src/cmp/dart/Entity_dart.ts +87 -0
- package/.sdk/src/cmp/dart/Gitignore_dart.ts +34 -0
- package/.sdk/src/cmp/dart/MainEntity_dart.ts +33 -0
- package/.sdk/src/cmp/dart/Main_dart.ts +178 -0
- package/.sdk/src/cmp/dart/Package_dart.ts +82 -0
- package/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +177 -0
- package/.sdk/src/cmp/dart/ReadmeExamplesTest_dart.ts +238 -0
- package/.sdk/src/cmp/dart/ReadmeExplanation_dart.ts +53 -0
- package/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +152 -0
- package/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +59 -0
- package/.sdk/src/cmp/dart/ReadmeIntro_dart.ts +65 -0
- package/.sdk/src/cmp/dart/ReadmeModel_dart.ts +151 -0
- package/.sdk/src/cmp/dart/ReadmeOptions_dart.ts +63 -0
- package/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +225 -0
- package/.sdk/src/cmp/dart/ReadmeRef_dart.ts +397 -0
- package/.sdk/src/cmp/dart/ReadmeTopHowto_dart.ts +24 -0
- package/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +106 -0
- package/.sdk/src/cmp/dart/ReadmeTopTest_dart.ts +78 -0
- package/.sdk/src/cmp/dart/SdkError_dart.ts +42 -0
- package/.sdk/src/cmp/dart/TestDirect_dart.ts +516 -0
- package/.sdk/src/cmp/dart/TestEntity_dart.ts +628 -0
- package/.sdk/src/cmp/dart/Test_dart.ts +138 -0
- package/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +98 -0
- package/.sdk/src/cmp/dart/fragment/Config.fragment.dart +70 -0
- package/.sdk/src/cmp/dart/fragment/Direct.test.fragment.dart +25 -0
- package/.sdk/src/cmp/dart/fragment/Entity.fragment.dart +29 -0
- package/.sdk/src/cmp/dart/fragment/Entity.test.fragment.dart +28 -0
- package/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +302 -0
- package/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +98 -0
- package/.sdk/src/cmp/dart/fragment/EntityListOp.fragment.dart +90 -0
- package/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +102 -0
- package/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +108 -0
- package/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +102 -0
- package/.sdk/src/cmp/dart/fragment/Main.fragment.dart +339 -0
- package/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +26 -0
- package/.sdk/src/cmp/dart/tsconfig.json +15 -0
- package/.sdk/src/cmp/dart/utility_dart.ts +155 -0
- package/.sdk/src/cmp/haskell/Config_haskell.ts +98 -0
- package/.sdk/src/cmp/haskell/Entity_haskell.ts +13 -0
- package/.sdk/src/cmp/haskell/Gitignore_haskell.ts +27 -0
- package/.sdk/src/cmp/haskell/Main_haskell.ts +123 -0
- package/.sdk/src/cmp/haskell/Package_haskell.ts +60 -0
- package/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +186 -0
- package/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +135 -0
- package/.sdk/src/cmp/haskell/ReadmeExplanation_haskell.ts +48 -0
- package/.sdk/src/cmp/haskell/ReadmeHowto_haskell.ts +168 -0
- package/.sdk/src/cmp/haskell/ReadmeInstall_haskell.ts +51 -0
- package/.sdk/src/cmp/haskell/ReadmeIntro_haskell.ts +67 -0
- package/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +162 -0
- package/.sdk/src/cmp/haskell/ReadmeOptions_haskell.ts +74 -0
- package/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +241 -0
- package/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +408 -0
- package/.sdk/src/cmp/haskell/ReadmeTopHowto_haskell.ts +31 -0
- package/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +104 -0
- package/.sdk/src/cmp/haskell/ReadmeTopTest_haskell.ts +80 -0
- package/.sdk/src/cmp/haskell/Test_haskell.ts +297 -0
- package/.sdk/src/cmp/haskell/tsconfig.json +15 -0
- package/.sdk/src/cmp/haskell/utility_haskell.ts +166 -0
- package/.sdk/src/cmp/lean/Config_lean.ts +93 -0
- package/.sdk/src/cmp/lean/Entity_lean.ts +9 -0
- package/.sdk/src/cmp/lean/Gitignore_lean.ts +18 -0
- package/.sdk/src/cmp/lean/Main_lean.ts +120 -0
- package/.sdk/src/cmp/lean/Package_lean.ts +93 -0
- package/.sdk/src/cmp/lean/ReadmeEntity_lean.ts +29 -0
- package/.sdk/src/cmp/lean/ReadmeExplanation_lean.ts +19 -0
- package/.sdk/src/cmp/lean/ReadmeHowto_lean.ts +25 -0
- package/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +39 -0
- package/.sdk/src/cmp/lean/ReadmeIntro_lean.ts +25 -0
- package/.sdk/src/cmp/lean/ReadmeModel_lean.ts +24 -0
- package/.sdk/src/cmp/lean/ReadmeOptions_lean.ts +22 -0
- package/.sdk/src/cmp/lean/ReadmeQuick_lean.ts +50 -0
- package/.sdk/src/cmp/lean/ReadmeRef_lean.ts +40 -0
- package/.sdk/src/cmp/lean/ReadmeTopHowto_lean.ts +16 -0
- package/.sdk/src/cmp/lean/ReadmeTopQuick_lean.ts +23 -0
- package/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +19 -0
- package/.sdk/src/cmp/lean/Test_lean.ts +261 -0
- package/.sdk/src/cmp/lean/utility_lean.ts +129 -0
- package/.sdk/tm/dart/LICENSE +22 -0
- package/.sdk/tm/dart/Makefile +50 -0
- package/.sdk/tm/dart/lib/Context.dart +150 -0
- package/.sdk/tm/dart/lib/Control.dart +15 -0
- package/.sdk/tm/dart/lib/Operation.dart +31 -0
- package/.sdk/tm/dart/lib/Point.dart +51 -0
- package/.sdk/tm/dart/lib/Response.dart +32 -0
- package/.sdk/tm/dart/lib/Result.dart +39 -0
- package/.sdk/tm/dart/lib/Spec.dart +49 -0
- package/.sdk/tm/dart/lib/feature/audit/AuditFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/base/BaseFeature.dart +76 -0
- package/.sdk/tm/dart/lib/feature/cache/CacheFeature.dart +152 -0
- package/.sdk/tm/dart/lib/feature/clienttrack/ClienttrackFeature.dart +104 -0
- package/.sdk/tm/dart/lib/feature/cost/CostFeature.dart +446 -0
- package/.sdk/tm/dart/lib/feature/debug/DebugFeature.dart +153 -0
- package/.sdk/tm/dart/lib/feature/idempotency/IdempotencyFeature.dart +92 -0
- package/.sdk/tm/dart/lib/feature/log/LogFeature.dart +85 -0
- package/.sdk/tm/dart/lib/feature/metrics/MetricsFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/netsim/NetsimFeature.dart +186 -0
- package/.sdk/tm/dart/lib/feature/paging/PagingFeature.dart +240 -0
- package/.sdk/tm/dart/lib/feature/proxy/ProxyFeature.dart +118 -0
- package/.sdk/tm/dart/lib/feature/ratelimit/RatelimitFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/rbac/RbacFeature.dart +121 -0
- package/.sdk/tm/dart/lib/feature/retry/RetryFeature.dart +155 -0
- package/.sdk/tm/dart/lib/feature/secrets/SecretsFeature.dart +649 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/capability.dart +105 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/catalog.dart +46 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/config.dart +297 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/depend.dart +198 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/env.dart +144 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/export.dart +58 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/graph.dart +160 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/host.dart +1067 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/order.dart +172 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/plugin.dart +23 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/point.dart +117 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/ref.dart +105 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/resolve.dart +58 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/types.dart +201 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/version.dart +116 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/aws.dart +285 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/azuresecrets.dart +178 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/boru.dart +145 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/crypto.dart +194 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/doppler.dart +101 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/gcpsecrets.dart +143 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/hashicorp.dart +190 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/httpjson.dart +363 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/infisical.dart +149 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/onepassword.dart +146 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/secretspec.dart +116 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/sigv4.dart +237 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/addr.dart +138 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/json.dart +276 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/provider.dart +31 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/providers.dart +243 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/sekreto.dart +730 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/spec.dart +200 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/support.dart +217 -0
- package/.sdk/tm/dart/lib/feature/streaming/StreamingFeature.dart +97 -0
- package/.sdk/tm/dart/lib/feature/telemetry/TelemetryFeature.dart +136 -0
- package/.sdk/tm/dart/lib/feature/test/TestFeature.dart +328 -0
- package/.sdk/tm/dart/lib/feature/timeout/TimeoutFeature.dart +104 -0
- package/.sdk/tm/dart/lib/utility/CleanUtility.dart +12 -0
- package/.sdk/tm/dart/lib/utility/DoneUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/ErrUtility.dart +46 -0
- package/.sdk/tm/dart/lib/utility/FeatureAddUtility.dart +35 -0
- package/.sdk/tm/dart/lib/utility/FeatureHookUtility.dart +20 -0
- package/.sdk/tm/dart/lib/utility/FeatureInitUtility.dart +9 -0
- package/.sdk/tm/dart/lib/utility/FetcherUtility.dart +104 -0
- package/.sdk/tm/dart/lib/utility/GraphqlUtility.dart +162 -0
- package/.sdk/tm/dart/lib/utility/MakeContextUtility.dart +6 -0
- package/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +71 -0
- package/.sdk/tm/dart/lib/utility/MakeFetchDefUtility.dart +42 -0
- package/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +233 -0
- package/.sdk/tm/dart/lib/utility/MakePointUtility.dart +130 -0
- package/.sdk/tm/dart/lib/utility/MakeRequestUtility.dart +66 -0
- package/.sdk/tm/dart/lib/utility/MakeResponseUtility.dart +59 -0
- package/.sdk/tm/dart/lib/utility/MakeResultUtility.dart +49 -0
- package/.sdk/tm/dart/lib/utility/MakeSpecUtility.dart +77 -0
- package/.sdk/tm/dart/lib/utility/MakeUrlUtility.dart +51 -0
- package/.sdk/tm/dart/lib/utility/ParamUtility.dart +56 -0
- package/.sdk/tm/dart/lib/utility/PrepareAuthUtility.dart +46 -0
- package/.sdk/tm/dart/lib/utility/PrepareBodyUtility.dart +19 -0
- package/.sdk/tm/dart/lib/utility/PrepareHeadersUtility.dart +11 -0
- package/.sdk/tm/dart/lib/utility/PrepareMethodUtility.dart +30 -0
- package/.sdk/tm/dart/lib/utility/PrepareParamsUtility.dart +23 -0
- package/.sdk/tm/dart/lib/utility/PreparePathUtility.dart +9 -0
- package/.sdk/tm/dart/lib/utility/PrepareQueryUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/ResultBasicUtility.dart +29 -0
- package/.sdk/tm/dart/lib/utility/ResultBodyUtility.dart +15 -0
- package/.sdk/tm/dart/lib/utility/ResultHeadersUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/StructUtility.dart +127 -0
- package/.sdk/tm/dart/lib/utility/TransformRequestUtility.dart +28 -0
- package/.sdk/tm/dart/lib/utility/TransformResponseUtility.dart +44 -0
- package/.sdk/tm/dart/lib/utility/Utility.dart +239 -0
- package/.sdk/tm/dart/lib/utility/voxgig_struct.dart +2462 -0
- package/.sdk/tm/dart/src/feature/README.md +3 -0
- package/.sdk/tm/dart/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/cost/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/secrets/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/dart/test/custom_test.dart +65 -0
- package/.sdk/tm/dart/test/exists_test.dart +12 -0
- package/.sdk/tm/dart/test/feature/harness.dart +347 -0
- package/.sdk/tm/dart/test/feature/secrets/secrets_test.dart +1107 -0
- package/.sdk/tm/dart/test/feature_test.dart +1193 -0
- package/.sdk/tm/dart/test/harness.dart +153 -0
- package/.sdk/tm/dart/test/netsim_test.dart +48 -0
- package/.sdk/tm/dart/test/omni.dart +520 -0
- package/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/.sdk/tm/dart/test/pipeline_test.dart +608 -0
- package/.sdk/tm/dart/test/primary_test.dart +476 -0
- package/.sdk/tm/dart/test/sdk-test-control.json +19 -0
- package/.sdk/tm/dart/test/struct_test.dart +468 -0
- package/.sdk/tm/dart/test/utility.dart +198 -0
- package/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/.sdk/tm/haskell/LICENSE +21 -0
- package/.sdk/tm/haskell/Makefile +22 -0
- package/.sdk/tm/haskell/VERSION +1 -0
- package/.sdk/tm/haskell/src/SdkFeatures.hs +1440 -0
- package/.sdk/tm/haskell/src/SdkHelpers.hs +337 -0
- package/.sdk/tm/haskell/src/SdkJson.hs +111 -0
- package/.sdk/tm/haskell/src/SdkRuntime.hs +1279 -0
- package/.sdk/tm/haskell/src/SdkTypes.hs +195 -0
- package/.sdk/tm/haskell/src/VoxgigStruct.hs +2299 -0
- package/.sdk/tm/haskell/src/Vregex.hs +237 -0
- package/.sdk/tm/haskell/src/feature/README.md +5 -0
- package/.sdk/tm/haskell/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/haskell/test/Harness.hs +281 -0
- package/.sdk/tm/haskell/test/OmniResolver.hs +252 -0
- package/.sdk/tm/haskell/test/Runner.hs +49 -0
- package/.sdk/tm/haskell/test/StructCorpus.hs +449 -0
- package/.sdk/tm/haskell/test/TCustomUtility.hs +38 -0
- package/.sdk/tm/haskell/test/TFeature.hs +794 -0
- package/.sdk/tm/haskell/test/TNetsim.hs +50 -0
- package/.sdk/tm/haskell/test/TPipeline.hs +334 -0
- package/.sdk/tm/haskell/test/TPrimaryCorpus.hs +263 -0
- package/.sdk/tm/haskell/test/TPrimaryUtility.hs +386 -0
- package/.sdk/tm/haskell/test/Testutil.hs +59 -0
- package/.sdk/tm/haskell/test/vendor/omni/Omni.hs +1147 -0
- package/.sdk/tm/lean/LICENSE +21 -0
- package/.sdk/tm/lean/Makefile +32 -0
- package/.sdk/tm/lean/VERSION +1 -0
- package/.sdk/tm/lean/src/SdkFeature.lean +171 -0
- package/.sdk/tm/lean/src/SdkFeatures.lean +787 -0
- package/.sdk/tm/lean/src/SdkJson.lean +134 -0
- package/.sdk/tm/lean/src/SdkRuntime.lean +374 -0
- package/.sdk/tm/lean/src/SdkUtility.lean +809 -0
- package/.sdk/tm/lean/src/VoxgigStruct.lean +2880 -0
- package/.sdk/tm/lean/src/Vregex.lean +412 -0
- package/.sdk/tm/lean/src/feature/README.md +5 -0
- package/.sdk/tm/lean/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/cost/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/.sdk/tm/lean/test/StructCorpus.lean +368 -0
- package/.sdk/tm/lean/test/TFeature.lean +281 -0
- package/.sdk/tm/lean/test/TPrimaryUtility.lean +227 -0
- package/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/LICENSE +21 -0
- package/README.md +104 -0
- package/package.json +78 -0
- package/sdkgen-package.json +22 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/- The corpus test runner: the VENDORED @voxgig/omni port (test/vendor/omni/
|
|
2
|
+
Omni.lean) driven through its NATIVE API (`Omni.makeRunnerSpec` /
|
|
3
|
+
`RunPack.runsetflagsargs`), presented to the corpus suites in the shape
|
|
4
|
+
they already use (`runspec`, `getset`, `runset`, `runsetArgs`, `report`).
|
|
5
|
+
|
|
6
|
+
No compat shim is vendored: the adapter below IS the whole bridge, per
|
|
7
|
+
language, per the vendor-tag rollout (docs/design/vendor-tag-rollout.md,
|
|
8
|
+
Decision 4). It is the Lean peer of tm/ocaml/test/omni_resolver.ml and
|
|
9
|
+
tm/java/test/OmniResolver.java — omni's provider is closure-based, so
|
|
10
|
+
nothing in omni ever has to name this SDK's types.
|
|
11
|
+
|
|
12
|
+
The engine used to live FUSED inside the two corpus suites: each carried
|
|
13
|
+
its own JSON reader, fixJson, deep equality, matchval/doMatch,
|
|
14
|
+
resolveArgs, checkResult, handleError and runSet. Both were rewritten in
|
|
15
|
+
place onto this file, so both KEEP THEIR NAMES and no emitted call site
|
|
16
|
+
needed churn — which is why nothing is listed as `superseded` for this
|
|
17
|
+
target.
|
|
18
|
+
|
|
19
|
+
Lean-specific decisions, each load-bearing:
|
|
20
|
+
|
|
21
|
+
1. omni IS PURE, THIS SDK IS NOT. omni's `Subject` is
|
|
22
|
+
`List Val → Except String Val`, a pure function; this SDK's struct port
|
|
23
|
+
keeps its nodes in a heap threaded through `SIO` (a `ReaderT Ctx IO`),
|
|
24
|
+
because Lean has no mutable value semantics. The subject callback is the
|
|
25
|
+
one place the two meet, so it runs the action with `unsafeIO` — the
|
|
26
|
+
escape hatch Lean provides for exactly this, and the same bridge
|
|
27
|
+
voxgig/struct's own Lean corpus runner uses. TEST CODE ONLY: nothing
|
|
28
|
+
under src/ names `runsio`.
|
|
29
|
+
|
|
30
|
+
2. TWO VALUE MODELS, ONE CONVERSION PAIR. `Omni.Val` (`Option Lean.Json`)
|
|
31
|
+
and `VoxgigStruct.Value` are different types, so every crossing is an
|
|
32
|
+
explicit `tostruct` / `toomni`. omni's `none` (ABSENT) becomes this
|
|
33
|
+
port's `.noval` and `Json.null` becomes `.null`, which keeps the two
|
|
34
|
+
no-value states the corpus distinguishes apart — and is why Lean needs
|
|
35
|
+
neither go's `novalargs` spec rewrite nor lua/php's compat shim for the
|
|
36
|
+
corpus's ZERO-ARGUMENT entries. An entry with no `in`/`args`/`ctx`
|
|
37
|
+
reaches the subject as one `Omni.Val` of `none`, which becomes exactly
|
|
38
|
+
this port's own no-value, so `typify` answers T_NOVAL where a null
|
|
39
|
+
would answer T_NULL.
|
|
40
|
+
|
|
41
|
+
3. ARGUMENTS ARE WRITTEN BACK. `Omni.SubjectArgs` is the channel omni
|
|
42
|
+
provides for a subject that MUTATES its arguments, which
|
|
43
|
+
`match: {args: ...}` then asserts on — `struct/minor/setpath` (7
|
|
44
|
+
entries here) and `struct/merge/integrity` (6) turn on it. Decision 2
|
|
45
|
+
hands the subject a CONVERTED COPY on this SDK's heap, and `Lean.Json`
|
|
46
|
+
is immutable, so every subject here runs through `runsetflagsargs` and
|
|
47
|
+
the wrapper converts the (possibly mutated) values back into omni's
|
|
48
|
+
own list after the call. A dynamic port's shim gets this free from
|
|
49
|
+
shared object identity; Lean cannot.
|
|
50
|
+
|
|
51
|
+
4. `match: {ctx: ...}` IS RETARGETED ONTO `match: {args: {"0": ...}}`.
|
|
52
|
+
A VALUE-SEMANTICS consequence, not a choice. omni's `drive` stores the
|
|
53
|
+
contextified first argument as `entry.ctx` AND as `args[0]` — two
|
|
54
|
+
copies of an immutable value — and `checkresult` reads `entry.ctx` for
|
|
55
|
+
the ctx base. A subject's post-call writes (decision 3) can never reach
|
|
56
|
+
that copy, and NINE `primary` entries assert exactly the post-call
|
|
57
|
+
state (makeRequest, makeResponse, makeSpec, param, prepareAuth,
|
|
58
|
+
resultBody, resultHeaders, transformRequest, transformResponse).
|
|
59
|
+
`args[0]` IS the ctx of a ctx entry (omni itself sets
|
|
60
|
+
`args = [entry.ctx]`), and the runner reads that list back after an
|
|
61
|
+
args-subject call — so moving the assertion from `ctx` to `args.0`
|
|
62
|
+
reads the SAME map, post-call, and preserves every leaf: nothing is
|
|
63
|
+
dropped, weakened or skipped. `retargetctx` below does that rewrite on
|
|
64
|
+
the spec handed to the engine. OCaml, Rust and Swift face the identical
|
|
65
|
+
problem and answer it identically; the upstream fix is for the port's
|
|
66
|
+
`drive` to re-point `entry.ctx` at the returned `args[0]`, the way JS
|
|
67
|
+
object identity does implicitly — a follow-up, never a hand-edit of a
|
|
68
|
+
vendored file.
|
|
69
|
+
|
|
70
|
+
5. KEY ORDER. omni's Lean port models a map as `Lean.Json.obj`, whose
|
|
71
|
+
container is key-SORTED (the vendored file says so itself), while this
|
|
72
|
+
SDK's `Value` map is insertion-ordered. Every map in the shipped corpus
|
|
73
|
+
is key-sorted, so the round trip is order-preserving in practice — and
|
|
74
|
+
`Omni.deepequal` compares maps order-independently in any case. A
|
|
75
|
+
corpus that ever ships an unsorted map would need the upstream fix
|
|
76
|
+
(omni's own value model), never a hand-edit here.
|
|
77
|
+
|
|
78
|
+
6. FAILURES ARE ACCUMULATED, NOT RAISED. omni stops a group at its first
|
|
79
|
+
bad entry and returns the message; the corpus suites report the whole
|
|
80
|
+
corpus in one run. `drive` records the message and carries on, so one
|
|
81
|
+
run still names every broken GROUP. A group that is ABSENT from the
|
|
82
|
+
corpus, or present with an empty set, is recorded in `skipped` and
|
|
83
|
+
printed by `report` — named out loud, never a silent vacuous pass. -/
|
|
84
|
+
|
|
85
|
+
import VoxgigStruct
|
|
86
|
+
import Omni
|
|
87
|
+
|
|
88
|
+
open VoxgigStruct
|
|
89
|
+
|
|
90
|
+
namespace OmniResolver
|
|
91
|
+
|
|
92
|
+
-- ---------------- the sentinels, under the corpus's own names ----------
|
|
93
|
+
|
|
94
|
+
def nullmark : String := Omni.nullmark
|
|
95
|
+
def undefmark : String := Omni.undefmark
|
|
96
|
+
def existsmark : String := Omni.existsmark
|
|
97
|
+
|
|
98
|
+
-- ---------------- decision 1: the SIO <-> pure bridge ------------------
|
|
99
|
+
|
|
100
|
+
unsafe def runsioImpl {α : Type} [Inhabited α] (ctx : Ctx) (act : SIO α)
|
|
101
|
+
: Except String α :=
|
|
102
|
+
match unsafeIO (act.run ctx) with
|
|
103
|
+
| .ok value => .ok value
|
|
104
|
+
| .error err => .error err.toString
|
|
105
|
+
|
|
106
|
+
@[implemented_by runsioImpl]
|
|
107
|
+
opaque runsio {α : Type} [Inhabited α] (ctx : Ctx) (act : SIO α) : Except String α
|
|
108
|
+
|
|
109
|
+
-- ---------------- decision 2: the value models -------------------------
|
|
110
|
+
|
|
111
|
+
/-- omni's model -> this SDK's. Nodes are built through `newList` /
|
|
112
|
+
`emptyMap`, so what a subject receives is a real heap node it may rewrite in
|
|
113
|
+
place (decision 3). -/
|
|
114
|
+
partial def tostruct (value : Omni.Val) : SIO Value := do
|
|
115
|
+
match value with
|
|
116
|
+
| none => pure .noval
|
|
117
|
+
| some .null => pure .null
|
|
118
|
+
| some (.bool flag) => pure (.bool flag)
|
|
119
|
+
| some (.num entry) => pure (.num entry.toFloat)
|
|
120
|
+
| some (.str text) => pure (.str text)
|
|
121
|
+
| some (.arr entries) => do
|
|
122
|
+
let mut out : Array Value := #[]
|
|
123
|
+
for entry in entries do
|
|
124
|
+
out := out.push (← tostruct (some entry))
|
|
125
|
+
newList out
|
|
126
|
+
| some (.obj kvs) => do
|
|
127
|
+
let m ← emptyMap
|
|
128
|
+
for kv in kvs.toArray do
|
|
129
|
+
let _ ← setprop m (.str kv.1) (← tostruct (some kv.2))
|
|
130
|
+
pure m
|
|
131
|
+
|
|
132
|
+
/-- This SDK's model -> omni's. A function or a sentinel has no JSON form and
|
|
133
|
+
omni only ever stringifies one, so it becomes its own rendering rather than
|
|
134
|
+
silently collapsing to null — an unexpected one then FAILS visibly instead of
|
|
135
|
+
vanishing. -/
|
|
136
|
+
partial def toomni (value : Value) : SIO Omni.Val := do
|
|
137
|
+
match value with
|
|
138
|
+
| .noval => pure none
|
|
139
|
+
| .null => pure (some Lean.Json.null)
|
|
140
|
+
| .bool flag => pure (some (Lean.Json.bool flag))
|
|
141
|
+
| .num n => pure (some (
|
|
142
|
+
-- Whole values keep their integer spelling; anything else goes through
|
|
143
|
+
-- the float constructor, which is the only lossless route Lean offers.
|
|
144
|
+
if n == n.floor && n.abs < 9007199254740992.0 then
|
|
145
|
+
Lean.Json.num (Lean.JsonNumber.fromInt (Int.ofNat n.abs.toUInt64.toNat
|
|
146
|
+
|> fun m => if n < 0.0 then -m else m))
|
|
147
|
+
else
|
|
148
|
+
match Lean.JsonNumber.fromFloat? n with
|
|
149
|
+
| .inr number => Lean.Json.num number
|
|
150
|
+
| .inl _ => Lean.Json.null))
|
|
151
|
+
| .str text => pure (some (Lean.Json.str text))
|
|
152
|
+
| .list id => do
|
|
153
|
+
let mut out : Array Lean.Json := #[]
|
|
154
|
+
for item in (← listItems id) do
|
|
155
|
+
out := out.push ((← toomni item).getD Lean.Json.null)
|
|
156
|
+
pure (some (Lean.Json.arr out))
|
|
157
|
+
| .map id => do
|
|
158
|
+
let mut out : List (String × Lean.Json) := []
|
|
159
|
+
for (k, v) in (← mapEntries id) do
|
|
160
|
+
out := (k, (← toomni v).getD Lean.Json.null) :: out
|
|
161
|
+
pure (some (Lean.Json.mkObj out.reverse))
|
|
162
|
+
| .func _ => pure (some (Lean.Json.str "[Function]"))
|
|
163
|
+
| .sentinel tag => pure (some (Lean.Json.str ("`$" ++ tag ++ "`")))
|
|
164
|
+
|
|
165
|
+
/-- Order-independent deep equality, through omni's own rule so a suite's
|
|
166
|
+
hand-written comparison matches the way every group is checked. -/
|
|
167
|
+
def eqv (a b : Value) : SIO Bool := do
|
|
168
|
+
pure (Omni.deepequal (← toomni a) (← toomni b))
|
|
169
|
+
|
|
170
|
+
-- ---------------- value helpers (re-homed from the fused runners) ------
|
|
171
|
+
|
|
172
|
+
/-- Raw property read: a stored `null` is preserved, an absent key answers
|
|
173
|
+
`.noval`. NOT `SdkUtility.gp`, which collapses the two. -/
|
|
174
|
+
def getp (value : Value) (key : String) : SIO Value := do
|
|
175
|
+
match value with
|
|
176
|
+
| .map id => pure ((omapGet (← mapEntries id) key).getD .noval)
|
|
177
|
+
| _ => pure .noval
|
|
178
|
+
|
|
179
|
+
def hasp (value : Value) (key : String) : SIO Bool := do
|
|
180
|
+
match value with
|
|
181
|
+
| .map id => pure (omapHas (← mapEntries id) key)
|
|
182
|
+
| _ => pure false
|
|
183
|
+
|
|
184
|
+
def omapV (pairs : List (String × Value)) : SIO Value := do
|
|
185
|
+
let m ← emptyMap
|
|
186
|
+
for (key, value) in pairs do
|
|
187
|
+
let _ ← setprop m (.str key) value
|
|
188
|
+
pure m
|
|
189
|
+
|
|
190
|
+
/-- One of omni's arguments, absent answering `.noval`. -/
|
|
191
|
+
def arg (args : Array Value) (index : Nat) : Value := args[index]?.getD .noval
|
|
192
|
+
|
|
193
|
+
-- ---------------- the run ----------------------------------------------
|
|
194
|
+
|
|
195
|
+
/-- One corpus run: the engine's pack, plus the accumulated tally
|
|
196
|
+
(decision 6). The counters are `IO.Ref`s because a Lean structure is
|
|
197
|
+
immutable and every suite drives dozens of groups in sequence. -/
|
|
198
|
+
structure Run where
|
|
199
|
+
pack : Omni.RunPack
|
|
200
|
+
pass : IO.Ref Nat
|
|
201
|
+
groups : IO.Ref Nat
|
|
202
|
+
failures : IO.Ref (Array String)
|
|
203
|
+
skipped : IO.Ref (Array String)
|
|
204
|
+
|
|
205
|
+
/-- Every provider hook is optional and this SDK needs none of them: subjects
|
|
206
|
+
are passed explicitly per group (so `subject` is unused), no suite builds a
|
|
207
|
+
client from a corpus `DEF.client` block (so `client` is unused), contexts stay
|
|
208
|
+
maps across the runner (decision 4, so `contextify` is unused), and no corpus
|
|
209
|
+
entry asserts on an error CODE, so omni's own {name,message} errify is exactly
|
|
210
|
+
right. -/
|
|
211
|
+
def provider : Omni.Provider := Omni.emptyProvider
|
|
212
|
+
|
|
213
|
+
def makeRunSpec (alltests : Lean.Json) (name : String) : IO Run := do
|
|
214
|
+
let pack ← match Omni.makeRunnerSpec alltests provider name with
|
|
215
|
+
| .ok pack => pure pack
|
|
216
|
+
| .error message => throw (IO.userError message)
|
|
217
|
+
let pass ← IO.mkRef 0
|
|
218
|
+
let groups ← IO.mkRef 0
|
|
219
|
+
let failures ← IO.mkRef (#[] : Array String)
|
|
220
|
+
let skipped ← IO.mkRef (#[] : Array String)
|
|
221
|
+
pure { pack, pass, groups, failures, skipped }
|
|
222
|
+
|
|
223
|
+
def makeRun (testfile : String) (name : String) : IO Run := do
|
|
224
|
+
makeRunSpec (← Omni.loadspec testfile) name
|
|
225
|
+
|
|
226
|
+
/-- Where the shared corpus lives: the first command-line argument, else
|
|
227
|
+
$SDK_TEST_SPEC, else the usual relative positions. The first candidate is the
|
|
228
|
+
fallback so a missing file is reported by name. -/
|
|
229
|
+
def specCandidates : Array String :=
|
|
230
|
+
#["../.sdk/test/test.json", ".sdk/test/test.json", "test/test.json"]
|
|
231
|
+
|
|
232
|
+
def resolveSpecPath (argv : List String) : IO String := do
|
|
233
|
+
match argv.head? with
|
|
234
|
+
| some given => pure given
|
|
235
|
+
| none =>
|
|
236
|
+
match (← IO.getEnv "SDK_TEST_SPEC") with
|
|
237
|
+
| some given => pure given
|
|
238
|
+
| none => do
|
|
239
|
+
for candidate in specCandidates do
|
|
240
|
+
if ← System.FilePath.pathExists candidate then
|
|
241
|
+
return candidate
|
|
242
|
+
pure specCandidates[0]!
|
|
243
|
+
|
|
244
|
+
/-- The resolved section of the spec (omni's `primary.<name>`, then `<name>`,
|
|
245
|
+
then the whole spec). -/
|
|
246
|
+
def runspec (r : Run) : Lean.Json := r.pack.spec
|
|
247
|
+
|
|
248
|
+
/-- A named group, by a path of keys from the resolved section. -/
|
|
249
|
+
def getset (r : Run) (keys : List String) : Omni.Val :=
|
|
250
|
+
keys.foldl (fun acc key => Omni.jget acc key) (some r.pack.spec)
|
|
251
|
+
|
|
252
|
+
/-- A corpus group authored as ONE `{in, out}` pair rather than a set —
|
|
253
|
+
`merge/basic`, `inject/basic`, `transform/basic`, `walk/log`. Wrapped into a
|
|
254
|
+
one-entry set so it runs through the SAME engine as everything else instead of
|
|
255
|
+
a bespoke code path beside it. `out` selects a sub-path of the authored `out`
|
|
256
|
+
(walk/log asserts only on `out.after`). -/
|
|
257
|
+
def single (node : Omni.Val) (out : List String := []) : Omni.Val :=
|
|
258
|
+
let expected := out.foldl (fun acc key => Omni.jget acc key) (Omni.jget node "out")
|
|
259
|
+
some (Omni.jmap [("set", Omni.jlist [
|
|
260
|
+
Omni.jmap [("in", (Omni.jget node "in").getD Lean.Json.null),
|
|
261
|
+
("out", expected.getD Lean.Json.null)]])])
|
|
262
|
+
|
|
263
|
+
-- ---------------- decision 4: retarget match.ctx -----------------------
|
|
264
|
+
|
|
265
|
+
def retargetctx (testspec : Lean.Json) : Lean.Json :=
|
|
266
|
+
match Omni.aslist (Omni.jget (some testspec) "set") with
|
|
267
|
+
| none => testspec
|
|
268
|
+
| some entries =>
|
|
269
|
+
let rewrite (raw : Lean.Json) : Lean.Json :=
|
|
270
|
+
let check := Omni.jget (some raw) "match"
|
|
271
|
+
if Omni.ismap (some raw) && Omni.ismap check && Omni.jhas check "ctx"
|
|
272
|
+
&& !Omni.jhas check "args"
|
|
273
|
+
&& (Omni.jhas (some raw) "ctx" || Omni.jhas (some raw) "args") then
|
|
274
|
+
-- Drop the original leaf: it would read the stale pre-call copy omni
|
|
275
|
+
-- keeps in `entry.ctx`.
|
|
276
|
+
let kept := ((Omni.asmap check).getD []).filter (fun kv => kv.1 != "ctx")
|
|
277
|
+
let leaf := (Omni.jget check "ctx").getD Lean.Json.null
|
|
278
|
+
Omni.jset raw "match"
|
|
279
|
+
(Omni.jmap (kept ++ [("args", Omni.jmap [("0", leaf)])]))
|
|
280
|
+
else raw
|
|
281
|
+
Omni.jset testspec "set" (Lean.Json.arr (entries.map rewrite))
|
|
282
|
+
|
|
283
|
+
-- ---------------- driving one group ------------------------------------
|
|
284
|
+
|
|
285
|
+
def entrycount (node : Omni.Val) : Int :=
|
|
286
|
+
match Omni.aslist (Omni.jget node "set") with
|
|
287
|
+
| some entries => (entries.size : Int)
|
|
288
|
+
| none => -1
|
|
289
|
+
|
|
290
|
+
def oneline (text : String) : String :=
|
|
291
|
+
String.intercalate " | " (text.splitOn "\n")
|
|
292
|
+
|
|
293
|
+
def drive (r : Run) (nullflag : Bool) (label : String) (node : Omni.Val)
|
|
294
|
+
(call : Omni.SubjectArgs) : IO Unit := do
|
|
295
|
+
let count := entrycount node
|
|
296
|
+
if count <= 0 then
|
|
297
|
+
-- Absent, malformed, or empty. NAMED, never silent: a group that stopped
|
|
298
|
+
-- running is the failure mode the vendored engine exists to prevent.
|
|
299
|
+
let why :=
|
|
300
|
+
if Omni.isabsent node then "absent from corpus"
|
|
301
|
+
else if count == 0 then "empty set" else "no set"
|
|
302
|
+
r.skipped.modify (·.push s!"{label} ({why})")
|
|
303
|
+
else do
|
|
304
|
+
r.groups.modify (· + 1)
|
|
305
|
+
match r.pack.runsetflagsargs (retargetctx (node.getD Lean.Json.null))
|
|
306
|
+
{ null := nullflag, name := some label } call with
|
|
307
|
+
| .ok () => r.pass.modify (· + count.toNat)
|
|
308
|
+
| .error message => r.failures.modify (·.push (oneline message))
|
|
309
|
+
|
|
310
|
+
/-- The subject wrapper: convert in, call, convert the (possibly mutated)
|
|
311
|
+
arguments and the result back out (decisions 1, 2 and 3). -/
|
|
312
|
+
def wrapArgs (ctx : Ctx) (subject : Array Value → SIO Value) : Omni.SubjectArgs :=
|
|
313
|
+
fun cells =>
|
|
314
|
+
runsio ctx (do
|
|
315
|
+
let mut vals : Array Value := #[]
|
|
316
|
+
for cell in cells do
|
|
317
|
+
vals := vals.push (← tostruct cell)
|
|
318
|
+
let res ← subject vals
|
|
319
|
+
let mut back : Array Omni.Val := #[]
|
|
320
|
+
for value in vals do
|
|
321
|
+
back := back.push (← toomni value)
|
|
322
|
+
pure (back.toList, ← toomni res))
|
|
323
|
+
|
|
324
|
+
/-- Run one group whose subject takes omni's whole argument list. This is the
|
|
325
|
+
shape the `primary` suite needs: a `ctx` entry arrives as `args[0]`, a MAP,
|
|
326
|
+
which the call site turns into a live context and writes the observable state
|
|
327
|
+
back into (decisions 3 and 4). -/
|
|
328
|
+
def runsetArgs (r : Run) (label : String) (node : Omni.Val)
|
|
329
|
+
(subject : Array Value → SIO Value) (nullflag : Bool := true) : SIO Unit := do
|
|
330
|
+
drive r nullflag label node (wrapArgs (← read) subject)
|
|
331
|
+
|
|
332
|
+
/-- Run one group whose subject takes the entry's single argument. -/
|
|
333
|
+
def runset (r : Run) (label : String) (node : Omni.Val)
|
|
334
|
+
(subject : Value → SIO Value) (nullflag : Bool := true) : SIO Unit :=
|
|
335
|
+
runsetArgs r label node (fun vals => subject (arg vals 0)) nullflag
|
|
336
|
+
|
|
337
|
+
-- ---------------- reporting --------------------------------------------
|
|
338
|
+
|
|
339
|
+
def report (r : Run) (heading : String) : IO UInt32 := do
|
|
340
|
+
for message in (← r.failures.get) do
|
|
341
|
+
IO.println ("FAIL " ++ message)
|
|
342
|
+
for note in (← r.skipped.get) do
|
|
343
|
+
IO.println ("SKIP " ++ note)
|
|
344
|
+
let passed ← r.pass.get
|
|
345
|
+
let grouped ← r.groups.get
|
|
346
|
+
let failed := (← r.failures.get).size
|
|
347
|
+
let skips := (← r.skipped.get).size
|
|
348
|
+
IO.println ""
|
|
349
|
+
IO.println s!"{heading}PASS {passed} FAIL {failed}"
|
|
350
|
+
IO.println s!"{heading}GROUPS {grouped} SKIPPED {skips}"
|
|
351
|
+
-- A run that executes nothing is not a pass.
|
|
352
|
+
if passed == 0 then do
|
|
353
|
+
IO.println (heading ++ "the corpus executed no cases")
|
|
354
|
+
return 1
|
|
355
|
+
if 0 < failed then return 1
|
|
356
|
+
return 0
|
|
357
|
+
|
|
358
|
+
end OmniResolver
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/- ProjectName SDK omni runner smoke test.
|
|
2
|
+
|
|
3
|
+
Smoke tests for the VENDORED @voxgig/omni engine itself
|
|
4
|
+
(test/vendor/omni/Omni.lean), and for the load-bearing decisions in
|
|
5
|
+
OmniResolver. A runner that cannot FAIL a bad entry would turn every
|
|
6
|
+
corpus suite vacuously green, so the FAILURE paths are pinned here, not
|
|
7
|
+
just the happy one. (Lean peer of ocaml's test/omni_smoke_test.ml, ts's
|
|
8
|
+
test/omni.test.ts and lua's test/omni_smoke_test.lua.)
|
|
9
|
+
|
|
10
|
+
The spec is built IN MEMORY, in omni's own value model — no fixture file,
|
|
11
|
+
and no OMNI block (lenient v0, like the shared corpus). -/
|
|
12
|
+
|
|
13
|
+
import VoxgigStruct
|
|
14
|
+
import Omni
|
|
15
|
+
import OmniResolver
|
|
16
|
+
|
|
17
|
+
open VoxgigStruct
|
|
18
|
+
open OmniResolver
|
|
19
|
+
|
|
20
|
+
-- ---------------- a tiny assertion harness ----------------
|
|
21
|
+
|
|
22
|
+
initialize npass : IO.Ref Nat ← IO.mkRef 0
|
|
23
|
+
initialize nfail : IO.Ref Nat ← IO.mkRef 0
|
|
24
|
+
|
|
25
|
+
def check (name : String) (cond : Bool) : IO Unit := do
|
|
26
|
+
if cond then npass.modify (· + 1)
|
|
27
|
+
else do
|
|
28
|
+
nfail.modify (· + 1)
|
|
29
|
+
IO.println ("FAIL " ++ name)
|
|
30
|
+
|
|
31
|
+
def contains (hay needle : String) : Bool :=
|
|
32
|
+
needle.isEmpty || 1 < (hay.splitOn needle).length
|
|
33
|
+
|
|
34
|
+
/-- Exactly one recorded failure, and it names `want`. -/
|
|
35
|
+
def onefailure (name : String) (r : Run) (want : String) : IO Unit := do
|
|
36
|
+
let msgs ← r.failures.get
|
|
37
|
+
if msgs.size == 1 then
|
|
38
|
+
check (name ++ ": failure mentions " ++ want) (contains (msgs[0]?.getD "") want)
|
|
39
|
+
else
|
|
40
|
+
check (name ++ ": expected exactly one failure, got " ++ toString msgs.size) false
|
|
41
|
+
|
|
42
|
+
-- ---------------- the in-memory spec ----------------
|
|
43
|
+
|
|
44
|
+
def num (n : Int) : Lean.Json := Omni.jnum n
|
|
45
|
+
|
|
46
|
+
def makespec : Lean.Json :=
|
|
47
|
+
Omni.jmap [("primary", Omni.jmap [("smoke", Omni.jmap [
|
|
48
|
+
|
|
49
|
+
("basic", Omni.jmap [("set", Omni.jlist [
|
|
50
|
+
Omni.jmap [("in", num 1), ("out", num 2)],
|
|
51
|
+
Omni.jmap [("in", num 41), ("out", num 42)]])]),
|
|
52
|
+
|
|
53
|
+
("bad", Omni.jmap [("set", Omni.jlist [
|
|
54
|
+
Omni.jmap [("in", num 1), ("out", num 999)]])]),
|
|
55
|
+
|
|
56
|
+
("err", Omni.jmap [("set", Omni.jlist [
|
|
57
|
+
Omni.jmap [("in", num 0), ("err", Omni.jstr "zero refused")]])]),
|
|
58
|
+
|
|
59
|
+
("empty", Omni.jmap [("set", Omni.jlist [])]),
|
|
60
|
+
|
|
61
|
+
-- Resolver decision 3: a subject that MUTATES its argument, which
|
|
62
|
+
-- `match.args` then asserts on. Without the write-back this passes
|
|
63
|
+
-- vacuously — the assertion would read the unmutated input.
|
|
64
|
+
("mutate", Omni.jmap [("set", Omni.jlist [
|
|
65
|
+
Omni.jmap [("in", Omni.jmap [("x", num 1)]),
|
|
66
|
+
("match", Omni.jmap [("args", Omni.jmap [("0", Omni.jmap [("x", num 2)])])]),
|
|
67
|
+
("out", num 2)]])]),
|
|
68
|
+
|
|
69
|
+
-- Resolver decision 4: `match: {ctx: ...}` must read the POST-call ctx.
|
|
70
|
+
-- omni's own `entry.ctx` is a pre-call copy, so without the retarget
|
|
71
|
+
-- this entry fails.
|
|
72
|
+
("ctx", Omni.jmap [("set", Omni.jlist [
|
|
73
|
+
Omni.jmap [("ctx", Omni.jmap [("a", num 1)]),
|
|
74
|
+
("match", Omni.jmap [("ctx", Omni.jmap [("b", num 2)])]),
|
|
75
|
+
("out", num 1)]])])
|
|
76
|
+
|
|
77
|
+
])])]
|
|
78
|
+
|
|
79
|
+
def pack : IO Run := makeRunSpec makespec "smoke"
|
|
80
|
+
|
|
81
|
+
-- ---------------- subjects ----------------
|
|
82
|
+
|
|
83
|
+
def inc (v : Value) : SIO Value := do
|
|
84
|
+
match v with
|
|
85
|
+
| .num n => if n == 0.0 then throw (IO.userError "smoke: zero refused")
|
|
86
|
+
else pure (.num (n + 1.0))
|
|
87
|
+
| other => pure other
|
|
88
|
+
|
|
89
|
+
def identity (v : Value) : SIO Value := pure v
|
|
90
|
+
|
|
91
|
+
/-- Mutates its argument in place and returns the new value. -/
|
|
92
|
+
def bump (v : Value) : SIO Value := do
|
|
93
|
+
let _ ← setprop v (.str "x") (.num 2.0)
|
|
94
|
+
pure (.num 2.0)
|
|
95
|
+
|
|
96
|
+
/-- Does NOT mutate: the negative control for decision 3. -/
|
|
97
|
+
def nobump (_v : Value) : SIO Value := pure (.num 2.0)
|
|
98
|
+
|
|
99
|
+
/-- Writes a key onto the ctx map AFTER it was handed over: the positive
|
|
100
|
+
control for decision 4. -/
|
|
101
|
+
def ctxwrite (args : Array Value) : SIO Value := do
|
|
102
|
+
let _ ← setprop (arg args 0) (.str "b") (.num 2.0)
|
|
103
|
+
pure (.num 1.0)
|
|
104
|
+
|
|
105
|
+
def ctxnowrite (_args : Array Value) : SIO Value := pure (.num 1.0)
|
|
106
|
+
|
|
107
|
+
-- ---------------- the tests ----------------
|
|
108
|
+
|
|
109
|
+
def main : IO UInt32 := do
|
|
110
|
+
let sctx ← mkCtx
|
|
111
|
+
|
|
112
|
+
-- A correct subject passes, and every case is counted.
|
|
113
|
+
let r ← pack
|
|
114
|
+
(runset r "basic" (getset r ["basic"]) inc).run sctx
|
|
115
|
+
check "basic: no failures" (← r.failures.get).isEmpty
|
|
116
|
+
check "basic: both cases ran" ((← r.pass.get) == 2)
|
|
117
|
+
check "basic: one group driven" ((← r.groups.get) == 1)
|
|
118
|
+
|
|
119
|
+
-- A wrong result FAILS, and the resolver records it rather than swallowing
|
|
120
|
+
-- it. This is the anti-vacuity check the whole rollout exists for.
|
|
121
|
+
let r ← pack
|
|
122
|
+
(runset r "bad" (getset r ["bad"]) inc).run sctx
|
|
123
|
+
onefailure "bad" r "result mismatch"
|
|
124
|
+
check "bad: no case counted as passing" ((← r.pass.get) == 0)
|
|
125
|
+
|
|
126
|
+
-- An expected error is matched.
|
|
127
|
+
let r ← pack
|
|
128
|
+
(runset r "err" (getset r ["err"]) inc).run sctx
|
|
129
|
+
check "err: expected error matched" (← r.failures.get).isEmpty
|
|
130
|
+
check "err: case counted" ((← r.pass.get) == 1)
|
|
131
|
+
|
|
132
|
+
-- An expected error that does NOT occur must fail.
|
|
133
|
+
let r ← pack
|
|
134
|
+
(runset r "err" (getset r ["err"]) identity).run sctx
|
|
135
|
+
onefailure "err-missing" r "expected error did not occur"
|
|
136
|
+
|
|
137
|
+
-- A group absent from the spec is NAMED, never a silent pass.
|
|
138
|
+
let r ← pack
|
|
139
|
+
(runset r "nosuch" (getset r ["nosuch"]) inc).run sctx
|
|
140
|
+
check "absent: no failures" (← r.failures.get).isEmpty
|
|
141
|
+
check "absent: nothing counted" ((← r.pass.get) == 0)
|
|
142
|
+
check "absent: named as skipped" ((← r.skipped.get).size == 1)
|
|
143
|
+
|
|
144
|
+
-- An EMPTY set is likewise named, not counted as a pass.
|
|
145
|
+
let r ← pack
|
|
146
|
+
(runset r "empty" (getset r ["empty"]) inc).run sctx
|
|
147
|
+
check "empty: nothing counted" ((← r.pass.get) == 0)
|
|
148
|
+
check "empty: named as skipped" ((← r.skipped.get).size == 1)
|
|
149
|
+
|
|
150
|
+
-- Decision 3: argument mutation reaches `match.args`.
|
|
151
|
+
let r ← pack
|
|
152
|
+
(runset r "mutate" (getset r ["mutate"]) bump).run sctx
|
|
153
|
+
check "mutate: write-back reaches match.args" (← r.failures.get).isEmpty
|
|
154
|
+
check "mutate: case counted" ((← r.pass.get) == 1)
|
|
155
|
+
|
|
156
|
+
let r ← pack
|
|
157
|
+
(runset r "mutate" (getset r ["mutate"]) nobump).run sctx
|
|
158
|
+
onefailure "mutate-missing" r "match failed at args.0.x"
|
|
159
|
+
|
|
160
|
+
-- Decision 4: `match.ctx` reads the POST-call ctx.
|
|
161
|
+
let r ← pack
|
|
162
|
+
(runsetArgs r "ctx" (getset r ["ctx"]) ctxwrite).run sctx
|
|
163
|
+
check "ctx: retarget reaches post-call ctx" (← r.failures.get).isEmpty
|
|
164
|
+
check "ctx: case counted" ((← r.pass.get) == 1)
|
|
165
|
+
|
|
166
|
+
let r ← pack
|
|
167
|
+
(runsetArgs r "ctx" (getset r ["ctx"]) ctxnowrite).run sctx
|
|
168
|
+
onefailure "ctx-missing" r "match failed at args.0.b"
|
|
169
|
+
|
|
170
|
+
let p ← npass.get
|
|
171
|
+
let f ← nfail.get
|
|
172
|
+
IO.println ""
|
|
173
|
+
IO.println s!"OMNI SMOKE: PASS {p} FAIL {f}"
|
|
174
|
+
if f > 0 then return 1 else return 0
|