Generator gallery
Each example defines a generator (the JSON) and invokes it — the output is exactly what the engine produced. A generator is defined once and called N times; there are no tables or scenarios here. Because generation is deterministic, the same seed always yields these rows.
All cases use seed 42 and a frozen reference instant of 2024-06-01T00:00:00Z. Model generators are trained on small sample word lists, so the novel names they invent are short and stylised. See Generators in depth for every parameter.
The core generators
1. Logic — int_between
A pure algorithm. Each invocation draws an independent value.
{
"algorithm": "int_between",
"params": {
"max": 80,
"min": 18
},
"type": "logic"
}Output — 5 invocations (seed 42):
[
64,
73,
53,
73,
64
]2. Logic — sequence (keys off the invocation index)
sequence is a pure function of the invocation ordinal: start + index*step.
{
"algorithm": "sequence",
"params": {
"start": 1,
"step": 1
},
"type": "logic"
}Output — 5 invocations (seed 42):
[
1,
2,
3,
4,
5
]3. List — weighted inline set
Pick from a finite set by weight.
{
"source": "inline",
"type": "list",
"values": [
{
"value": "free",
"weight": 60
},
{
"value": "pro",
"weight": 30
},
{
"value": "enterprise",
"weight": 10
}
]
}Output — 6 invocations (seed 42):
[
"free",
"free",
"free",
"free",
"free",
"free"
]4. List — multilingual asset (tr_TR)
Resolves the geo.cities asset through the active locale chain.
{
"source": "geo.cities",
"type": "list"
}Output — 4 invocations (seed 42):
[
"Ankara",
"Ankara",
"İstanbul",
"Bursa"
]5. Model — N-gram word
Novel, locale-flavoured values from a trained model (here tr_TR).
{
"generation": {
"mode": "word"
},
"source": "person.first_names",
"type": "model"
}Output — 5 invocations (seed 42):
[
"Ayşe",
"Mustafa",
"Merve",
"Emir",
"Cansu"
]6. Statistical — weighted categorical
A frequency-preserving categorical draw.
{
"mode": "categorical",
"type": "statistical",
"values": [
{
"value": "completed",
"weight": 70
},
{
"value": "pending",
"weight": 30
}
]
}Output — 6 invocations (seed 42):
[
"completed",
"completed",
"completed",
"completed",
"completed",
"completed"
]7. Statistical — normal, clamped
A continuous distribution, resampled into [min, max].
{
"constraints": {
"max": 80,
"min": 18
},
"distribution": "normal",
"mode": "continuous",
"params": {
"mean": 35,
"stddev": 10
},
"type": "statistical"
}Output — 5 invocations (seed 42):
[
34.581818,
22.84168,
30.726369,
30.154532,
21.270311
]8. List — coherent record (asset of objects)
Picking from an asset of objects returns one whole record, so its fields always agree — you never get "Ankara, Japan".
{
"source": "geo.locations",
"type": "list"
}Output — 3 invocations (seed 42):
[
{
"city": "Ankara",
"country": "TR",
"postal": "06000"
},
{
"city": "Ankara",
"country": "TR",
"postal": "06000"
},
{
"city": "İzmir",
"country": "TR",
"postal": "35000"
}
]9. Event Sequence — chronological, probabilistic
A base event plus delayed follow-ups; an event may not fire (null).
{
"events": [
{
"base": true,
"name": "created_at",
"range": {
"end": "2024-06-01T00:00:00Z",
"start": "2024-01-01T00:00:00Z"
}
},
{
"after": "created_at",
"delay": {
"max": "48h",
"min": "0h"
},
"name": "paid_at",
"probability": 0.8
}
],
"type": "event_sequence"
}Output — 4 invocations (seed 42):
[
{
"created_at": "2024-05-30T10:11:33Z",
"paid_at": null
},
{
"created_at": "2024-02-06T15:29:30Z",
"paid_at": "2024-02-07T13:28:53Z"
},
{
"created_at": "2024-02-08T15:56:22Z",
"paid_at": "2024-02-08T23:46:53Z"
},
{
"created_at": "2024-03-08T05:45:31Z",
"paid_at": "2024-03-09T08:27:53Z"
}
]Cross-cutting modifiers
10. unique — distinct across the run
An integer in a range only 5 wide, invoked 5 times: re-rolled until distinct.
{
"algorithm": "int_between",
"params": {
"max": 5,
"min": 1
},
"type": "logic",
"unique": true
}Output — 5 invocations (seed 42):
[
3,
5,
4,
2,
1
]11. nullable — probabilistic NULLs
About half the invocations yield null, on a dedicated sub-stream.
{
"algorithm": "int_between",
"nullable": 0.5,
"params": {
"max": 1000,
"min": 1
},
"type": "logic"
}Output — 8 invocations (seed 42):
[
null,
450,
null,
null,
804,
933,
null,
null
]12. transform — a PEL post-op
A PEL expression over the produced value.
{
"algorithm": "int_between",
"params": {
"max": 100,
"min": 0
},
"transform": "if(value >= 50, 'pass', 'fail')",
"type": "logic"
}Output — 5 invocations (seed 42):
[
"fail",
"pass",
"fail",
"pass",
"pass"
]Composition — generators made of generators
13. A composition that draws a model and builds an email
@demo:email (registered below) draws a first name in a let, then builds the value; a reference to first reads that one bound value.
{
"use": "@demo:email"
}Output — 4 invocations (seed 42):
[
"ayşe@example.com",
"elif@example.com",
"zeynep@example.com",
"mustafa@example.com"
]14. A composition threading a param into another
@demo:banner uses @demo:tag in a let, threading its word param through; referencing the tagged let twice reads the one bound value.
{
"params": {
"word": "hi"
},
"use": "@demo:banner"
}Output — 1 invocations (seed 42):
[
"[HI][HI]"
]15. A body of only inline forms
@demo:inline has no let steps — just a body template with inline generators. (This is what the old template type did.)
{
"use": "@demo:inline"
}Output — 4 invocations (seed 42):
[
"115-ag",
"353-cs",
"683-kx",
"940-vL"
]16. Weighted variants — a choice of bodies
@demo:sku picks one of several body templates by weight. (The one feature carried over from the old template variants.)
{
"use": "@demo:sku"
}Output — 5 invocations (seed 42):
[
"SKU-2815",
"SKU-3953",
"SKU-8783",
"PROMO-MyK",
"PROMO-uhL"
]17. An output object of coherent fields
@demo:financials computes salary, then bonus and net over it, and emits an object — coherent by construction. (This is what the old linked rules did.)
{
"use": "@demo:financials"
}Output — 3 invocations (seed 42):
[
{
"bonus": 7684.38,
"net": 58913.56,
"salary": 51229.179618
},
{
"bonus": 6784.11,
"net": 52011.51,
"salary": 45227.402448
},
{
"bonus": 7845.63,
"net": 60149.84,
"salary": 52304.208047
}
]Locale resolution — one generator, many locales
The generator is fixed; only the active locale chain changes.
18. A model under tr_TR
Resolves the Turkish person.first_names model.
{
"generation": {
"mode": "word"
},
"source": "person.first_names",
"type": "model"
}Output — 4 invocations (seed 42):
[
"Ayşe",
"Mustafa",
"Merve",
"Emir"
]19. The same model under en_US
Byte-for-byte the same definition; only the resolution chain changed.
{
"generation": {
"mode": "word"
},
"source": "person.first_names",
"type": "model"
}Output — 4 invocations (seed 42):
[
"David",
"Robert",
"Patricia",
"John"
]Packages
Pattern C — dataless generator package (a composition, no assets):
{
"generators": [
{
"body": "{{ net + tax }}",
"let": {
"tax": {
"computed": "round(net * rate, 2)"
}
},
"name": "@demo/finance:gross",
"params": {
"net": {
"default": 100,
"type": "number"
},
"rate": {
"default": 0.2,
"type": "number"
}
}
}
],
"name": "@demo/finance",
"version": "0.1.0"
}20. Using the packaged generator
@demo/finance:gross came from the package above — usable like a built-in.
{
"params": {
"net": 250,
"rate": 0.18
},
"use": "@demo/finance:gross"
}Output — 3 invocations (seed 42):
[
"295",
"295",
"295"
]Pattern E — data-only locale contribution (adds az_AZ to an asset defined elsewhere):
{
"assets": {
"lists": {
"geo.cities": {
"az_AZ": [
"Bakı",
"Gəncə",
"Sumqayıt",
"Mingəçevir"
]
}
}
},
"name": "@aziz/az-cities",
"version": "0.1.0"
}21. The same city generator under az_AZ
Same geo.cities generator; the contribution comes from the data-only package.
{
"source": "geo.cities",
"type": "list"
}Output — 3 invocations (seed 42):
[
"Gəncə",
"Gəncə",
"Bakı"
]Coverage vs. the design matrix
How this gallery maps onto the spec's generator × asset matrix, and what isn't built yet.
| Matrix claim | Status | Shown above |
|---|---|---|
| Logic — all 14 algorithms | ✅ built | Logic |
| List — simple · weighted · object-metadata · asset · coherent record | ✅ built | List |
| Model — 7 generation modes | ✅ built | Model |
| Statistical — categorical · continuous (7 distributions) · multivariate · DP | ✅ built | Statistical |
| Event Sequence — base · after · delay · probability | ✅ built | Event Sequence |
| Composition — body · weighted variants · output object · nested | ✅ built | Composition |
Modifiers — unique · nullable · transform | ✅ built | Cross-cutting modifiers |
Locale resolution — domain > locale > base chain | ✅ built | Locale resolution |
| Packages — generators (C) · data-only locale (E) | ✅ built | Packages |
template / linked types | 🔀 folded into composition + list | Composition |
Statistical algebraic mode | 🔀 use a composition let | Composition |
Event-seq condition; DP exponential | ⚠️ deferred | — |
| Tables · relationships · scenarios (the dataset/sync layer) | ☁️ the cloud product, not PGDL | — |
The ✅ rows are exercised by the live output above; ⚠️/🔀 rows are notes on the target in the spec.