Skip to content

Main content

Random Configuration Override Chain Fixture Generator

Permute supplied flat configuration layers and retain first- or last-wins results, explicit null deletion and per-key winning-layer provenance.

Loading tool…

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

  1. Supply layers, policy, nullPolicy in the field shapes below. Set seed when you need an explicit replay.
  2. 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.
  3. 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 fieldMeaning and unitsAccepted input
layersLayersRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 8.
layers[].nameNameRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
layers[].entriesEntriesRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 16.
layers[].entries[].keyKeyRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
layers[].entries[].valueValueRequired. Text; maximum UTF-16 length 65536. or Finite number. or Boolean. or Null.
policyPolicyRequired. Text; one of "first", "last".
nullPolicyNull PolicyRequired. Text; one of "value", "delete".
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
layerOrderLayer OrderRequired. Array of Text; maximum UTF-16 length 65536.; minimum items 1; maximum items 8.
mergedMergedRequired. Object.
winnersWinnersRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 128.
winners[].keyKeyRequired. Text; maximum UTF-16 length 65536.
winners[].layerLayerRequired. Text; maximum UTF-16 length 65536.
winners[].deletedDeletedRequired. Boolean.
prettyPrettyRequired. Text; maximum UTF-16 length 65536.
randomnessReplay source and normalized 32-bit seed, or null seed for an advancing context source.Required. Object; no unknown keys.
randomness.seedOptional safe-integer replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. 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.

json
{
  "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

  1. Tool behavior and example: Random Configuration Override Chain Fixture Generator — tool.io

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.