Description
Construct declarative synthetic set/remove entity events and retain before/after snapshots and final state without evaluating supplied code.
A protocol fixture is local test data representing headers, messages, identifiers, or request decisions. Serialization and parsing can be checked without contacting a server, while authentication, delivery, and actual client behavior require separate tests.
Construct declarative synthetic set/remove entity events and retain before/after snapshots and final state without evaluating supplied code.
When to use this tool
Use this generator to create reproducible event sourcing replay 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 entities, fields, values, operations, eventCount 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 events, snapshots, pretty. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Start every supplied entity with an empty object and sample set/remove events for declared fields. Retain ordered before/after snapshots, deleting keys for remove even though the event's value field is null. Return final entity states and serialized snapshots.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| entities | Entities | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 128.; minimum items 1; maximum items 8. |
| fields | Fields | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 128.; minimum items 1; maximum items 8. |
| values | Values | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 16. |
| values[].value | Value | Required. Text; maximum UTF-16 length 65536. or Finite number. or Boolean. or Null. |
| operations | Operations | Required. Array of Text; one of "set", "remove".; minimum items 1; maximum items 2. |
| eventCount | Event Count | Required. Safe integer; minimum 1; maximum 32. |
| 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 |
|---|---|---|
| events | Events | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 32. |
| events[].sequence | Sequence | Required. Safe integer; minimum 1; maximum 32. |
| events[].entity | Entity | Required. Text; maximum UTF-16 length 65536. |
| events[].field | Field | Required. Text; maximum UTF-16 length 65536. |
| events[].operation | Operation | Required. Text; maximum UTF-16 length 65536. |
| events[].value | Value | Required. Text; maximum UTF-16 length 65536. or Finite number. or Boolean. or Null. |
| events[].before | Before | Required. Object. |
| events[].after | After | Required. Object. |
| snapshots | Snapshots | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 8. |
| snapshots[].entity | Entity | Required. Text; maximum UTF-16 length 65536. |
| snapshots[].state | State | Required. Object. |
| 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": {
"entities": [
"item"
],
"fields": [
"count"
],
"values": [
{
"value": 3
},
{
"value": 7
}
],
"operations": [
"set",
"remove"
],
"eventCount": 2,
"seed": 42
},
"output": {
"events": [
{
"sequence": 1,
"entity": "item",
"field": "count",
"operation": "remove",
"value": null,
"before": {},
"after": {}
},
{
"sequence": 2,
"entity": "item",
"field": "count",
"operation": "set",
"value": 7,
"before": {},
"after": {
"count": 7
}
}
],
"snapshots": [
{
"entity": "item",
"state": {
"count": 7
}
}
],
"pretty": "[\n {\n \"entity\": \"item\",\n \"state\": {\n \"count\": 7\n }\n }\n]\n",
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Removing an absent field can be a no-op. Setting null differs from deletion. The generated trace has no database, network, persistence, concurrency, or automatic event-delivery guarantees.
- 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
- Random Barcode Label Sheet Generator
Generate seeded synthetic EAN-13 or UPC-A data under an optional digit prefix, delegate check digits and SVG symbols, and return bounded zero-based label-grid positions for an app-rendered sheet; optional uniqueness applies to identifiers, while assignment, physical scanner readiness, print layout and export are not claimed.
- Random CSS Custom Property Fallback Corpus Generator
Compose nested var fallback expressions and literal bindings, then lower their acyclic fallback paths to the supported core resolver.