Description
Permute supplied flat configuration layers and retain first- or last-wins results, explicit null deletion and per-key winning-layer provenance.
A parser corpus pairs literal input spellings or structured documents with observable parser results or explicitly constructed expectations. Successful parsing, semantic validity, and exact round-trip preservation are separate properties, so test records retain the relevant evidence.
Permute supplied flat configuration layers and retain first- or last-wins results, explicit null deletion and per-key winning-layer provenance.
When to use this tool
Use this generator to create reproducible configuration override chain fixture cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply layers, policy, nullPolicy in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read layerOrder, merged, winners, pretty. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Shuffle named configuration layers and merge their flat entries under first- or last-wins policy. Optionally treat null as deletion, recording the winning layer and deletion flag for every encountered key.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| layers | Layers | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 8. |
| layers[].name | Name | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128. |
| layers[].entries | Entries | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 16. |
| layers[].entries[].key | Key | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128. |
| layers[].entries[].value | Value | Required. Text; maximum UTF-16 length 65536. or Finite number. or Boolean. or Null. |
| policy | Policy | Required. Text; one of "first", "last". |
| nullPolicy | Null Policy | Required. Text; one of "value", "delete". |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| layerOrder | Layer Order | Required. Array of Text; maximum UTF-16 length 65536.; minimum items 1; maximum items 8. |
| merged | Merged | Required. Object. |
| winners | Winners | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 128. |
| winners[].key | Key | Required. Text; maximum UTF-16 length 65536. |
| winners[].layer | Layer | Required. Text; maximum UTF-16 length 65536. |
| winners[].deleted | Deleted | Required. Boolean. |
| pretty | Pretty | Required. Text; maximum UTF-16 length 65536. |
| randomness | Replay source and normalized 32-bit seed, or null seed for an advancing context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional safe-integer replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"layers": [
{
"name": "base",
"entries": [
{
"key": "theme",
"value": "light"
},
{
"key": "size",
"value": 2
}
]
},
{
"name": "env",
"entries": [
{
"key": "theme",
"value": "dark"
}
]
}
],
"policy": "last",
"nullPolicy": "value",
"seed": 42
},
"output": {
"layerOrder": [
"env",
"base"
],
"merged": {
"theme": "light",
"size": 2
},
"winners": [
{
"key": "theme",
"layer": "base",
"deleted": false
},
{
"key": "size",
"layer": "base",
"deleted": false
}
],
"pretty": "{\n \"theme\": \"light\",\n \"size\": 2\n}\n",
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Under first-wins, a deletion still claims the key and prevents later layers from restoring it. This is a flat scalar precedence fixture, not recursive merging, environment evaluation, or deployment of configuration.
- A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Sequential Pattern Mining Tool
Mine bounded frequent ordered subsequences of single-event string sequences using prefix projection, allowing arbitrary gaps and repeated events and counting each source sequence at most once per pattern.
- Random CSV Aggregate Reconciliation Exercise Generator
Generate synthetic grouped integer observations, plant one declared subtotal discrepancy and retain exact decimal-string subtotal, grand-total and checksum-row reconciliation answers.