@chaos-maker/core 0.3.0 → 0.5.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.
@@ -0,0 +1,32 @@
1
+ # Chaos Config JSON Schema — parity caveats
2
+
3
+ This file ships beside `chaos-config.schema.json`. The JSON Schema artifact is
4
+ generated from the canonical Zod schemas via `zod-to-json-schema`. Use it for:
5
+
6
+ - IDE autocomplete via `"$schema": "./chaos-config.schema.json"` in JSON
7
+ configs.
8
+ - External pre-commit linters that consume JSON Schema.
9
+ - Reference documentation for tools that cannot import a JS module.
10
+
11
+ **The runtime canonical validator is always `validateChaosConfig` from
12
+ `@chaos-maker/core`.** Do not use the JSON Schema as the sole validator
13
+ before injecting a config — Zod refinements that cannot translate to JSON
14
+ Schema will silently pass under JSON Schema and throw at runtime.
15
+
16
+ ## Refinements that do NOT translate
17
+
18
+ | Zod refinement | JSON Schema fate |
19
+ |---|---|
20
+ | `groupConfigList.superRefine` (duplicate group names after `.trim()`) | dropped — JSON Schema cannot express "duplicate after normalization". |
21
+ | `mutuallyExclusiveCounting` (`onNth` / `everyNth` / `afterN` mutual exclusion) | weakly approximated; some edge cases pass JSON Schema but fail Zod. |
22
+ | WebSocket close-code refinement (`1000` or `3000-4999`) | translated as ranges; verify with the runtime validator. |
23
+ | WebSocket `reason` UTF-8 byte length `<= 123` | dropped — JSON Schema string length counts code points, not UTF-8 bytes. |
24
+ | GraphQL operation RegExp `/g` / `/y` flag rejection | dropped — JSON Schema has no RegExp-flag introspection. |
25
+ | `graphqlOperation` accepting `RegExp` instances | rendered as `string` only; RegExp is not a JSON Schema type. |
26
+ | Preset-name `.trim()` deduplication (`presets` array transform) | dropped — schema represents input shape only. |
27
+
28
+ ## Recommended workflow
29
+
30
+ 1. Use the JSON Schema for IDE / `"$schema"` references and external linters.
31
+ 2. Use `validateChaosConfig` for actual gating in CI and at runtime.
32
+ 3. Treat any divergence as expected — fix the runtime, not the artifact.