@ak--47/dungeon-master 1.0.0 → 1.1.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.
Files changed (103) hide show
  1. package/README.md +7 -7
  2. package/dungeons/technical/ad-spend-schema.json +128 -0
  3. package/dungeons/technical/ad-spend.js +116 -0
  4. package/dungeons/technical/anonymous-users-schema.json +91 -0
  5. package/dungeons/technical/anonymous-users.js +102 -0
  6. package/dungeons/technical/array-of-object-lookup-schema.json +191 -0
  7. package/dungeons/{array-of-object-lookup.js → technical/array-of-object-lookup.js} +11 -4
  8. package/dungeons/technical/experiments-schema.json +197 -0
  9. package/dungeons/technical/experiments.js +168 -0
  10. package/dungeons/technical/foobar-schema.json +362 -0
  11. package/dungeons/{foobar.js → technical/foobar.js} +2 -2
  12. package/dungeons/technical/group-analytics-schema.json +149 -0
  13. package/dungeons/technical/group-analytics.js +151 -0
  14. package/dungeons/technical/mirror-strategies-schema.json +84 -0
  15. package/dungeons/technical/mirror-strategies.js +126 -0
  16. package/dungeons/technical/nested-objects-schema.json +145 -0
  17. package/dungeons/technical/nested-objects.js +207 -0
  18. package/dungeons/technical/retention-cadence-schema.json +37 -0
  19. package/dungeons/{retention-cadence.js → technical/retention-cadence.js} +1 -1
  20. package/dungeons/technical/sanity-schema.json +185 -0
  21. package/dungeons/{sanity.js → technical/sanity.js} +3 -2
  22. package/dungeons/technical/scale-test-schema.json +70 -0
  23. package/dungeons/technical/scale-test.js +90 -0
  24. package/dungeons/technical/scd-schema.json +270 -0
  25. package/dungeons/{scd.js → technical/scd.js} +19 -10
  26. package/dungeons/technical/simple-schema.json +278 -0
  27. package/dungeons/{simple.js → technical/simple.js} +6 -6
  28. package/dungeons/technical/simplest-schema.json +635 -0
  29. package/dungeons/{simplest.js → technical/simplest.js} +6 -6
  30. package/dungeons/technical/text-generation-schema.json +1059 -0
  31. package/dungeons/{text-generation.js → technical/text-generation.js} +23 -9
  32. package/dungeons/vertical/community-schema.json +557 -0
  33. package/dungeons/vertical/community.js +788 -0
  34. package/dungeons/vertical/devtools-schema.json +580 -0
  35. package/dungeons/vertical/devtools.js +837 -0
  36. package/dungeons/vertical/ecommerce-schema.json +586 -0
  37. package/dungeons/{ecommerce.js → vertical/ecommerce.js} +34 -3
  38. package/dungeons/vertical/education-schema.json +697 -0
  39. package/dungeons/{education.js → vertical/education.js} +54 -36
  40. package/dungeons/vertical/fintech-schema.json +563 -0
  41. package/dungeons/{fintech.js → vertical/fintech.js} +91 -53
  42. package/dungeons/vertical/fitness-schema.json +508 -0
  43. package/dungeons/vertical/fitness.js +802 -0
  44. package/dungeons/vertical/food-delivery-schema.json +678 -0
  45. package/dungeons/{food.js → vertical/food-delivery.js} +51 -23
  46. package/dungeons/vertical/gaming-schema.json +394 -0
  47. package/dungeons/{gaming.js → vertical/gaming.js} +9 -7
  48. package/dungeons/vertical/healthcare-schema.json +527 -0
  49. package/dungeons/vertical/healthcare.js +769 -0
  50. package/dungeons/vertical/insurance-application-schema.json +466 -0
  51. package/dungeons/{insurance-application.js → vertical/insurance-application.js} +33 -29
  52. package/dungeons/vertical/logistics-schema.json +552 -0
  53. package/dungeons/vertical/logistics.js +793 -0
  54. package/dungeons/vertical/marketplace-schema.json +511 -0
  55. package/dungeons/vertical/marketplace.js +844 -0
  56. package/dungeons/vertical/media-schema.json +787 -0
  57. package/dungeons/{media.js → vertical/media.js} +94 -16
  58. package/dungeons/vertical/rpg-schema.json +654 -0
  59. package/dungeons/{rpg.js → vertical/rpg.js} +78 -57
  60. package/dungeons/vertical/sass-schema.json +653 -0
  61. package/dungeons/{sass.js → vertical/sass.js} +49 -23
  62. package/dungeons/vertical/social-schema.json +552 -0
  63. package/dungeons/{social.js → vertical/social.js} +60 -14
  64. package/dungeons/vertical/travel-schema.json +558 -0
  65. package/dungeons/vertical/travel.js +736 -0
  66. package/index.js +19 -15
  67. package/lib/core/config-validator.js +286 -1
  68. package/lib/core/context.js +7 -5
  69. package/lib/generators/adspend.js +3 -3
  70. package/lib/generators/events.js +141 -14
  71. package/lib/generators/funnels.js +67 -7
  72. package/lib/generators/text.js +2 -2
  73. package/lib/orchestrators/user-loop.js +441 -22
  74. package/lib/templates/soup-presets.js +2 -2
  75. package/lib/utils/utils.js +4 -5
  76. package/package.json +4 -3
  77. package/scripts/dungeon-to-json.mjs +163 -0
  78. package/scripts/extract-dungeon-schema.mjs +297 -0
  79. package/scripts/json-to-dungeon.mjs +200 -0
  80. package/scripts/run-dungeon.mjs +76 -0
  81. package/scripts/run-many.mjs +118 -0
  82. package/scripts/verify-runner.mjs +42 -0
  83. package/types.d.ts +313 -1
  84. package/dungeons/array-of-object-lookup-schema.json +0 -327
  85. package/dungeons/ecommerce-schema.json +0 -462
  86. package/dungeons/education-schema.json +0 -2409
  87. package/dungeons/fintech-schema.json +0 -14034
  88. package/dungeons/foobar-schema.json +0 -403
  89. package/dungeons/food-delivery-schema.json +0 -192
  90. package/dungeons/food-delivery.js +0 -602
  91. package/dungeons/food-schema.json +0 -1152
  92. package/dungeons/gaming-schema.json +0 -1270
  93. package/dungeons/insurance-application-schema.json +0 -204
  94. package/dungeons/media-schema.json +0 -906
  95. package/dungeons/retention-cadence-schema.json +0 -78
  96. package/dungeons/rpg-schema.json +0 -4526
  97. package/dungeons/sanity-schema.json +0 -255
  98. package/dungeons/sass-schema.json +0 -1291
  99. package/dungeons/scd-schema.json +0 -919
  100. package/dungeons/simple-schema.json +0 -608
  101. package/dungeons/simplest-schema.json +0 -1418
  102. package/dungeons/social-schema.json +0 -1118
  103. package/dungeons/text-generation-schema.json +0 -3096
@@ -0,0 +1,185 @@
1
+ {
2
+ "events": [
3
+ {
4
+ "event": "foo",
5
+ "weight": 10
6
+ },
7
+ {
8
+ "event": "bar",
9
+ "weight": 9,
10
+ "isFirstEvent": true
11
+ },
12
+ {
13
+ "event": "baz",
14
+ "weight": 8
15
+ },
16
+ {
17
+ "event": "qux",
18
+ "weight": 7
19
+ },
20
+ {
21
+ "event": "garply",
22
+ "weight": 6
23
+ },
24
+ {
25
+ "event": "durtle",
26
+ "weight": 5
27
+ },
28
+ {
29
+ "event": "linny",
30
+ "weight": 4
31
+ },
32
+ {
33
+ "event": "fonk",
34
+ "weight": 3
35
+ },
36
+ {
37
+ "event": "crumn",
38
+ "weight": 2
39
+ },
40
+ {
41
+ "event": "yak"
42
+ }
43
+ ],
44
+ "superProps": {
45
+ "color": [
46
+ "red",
47
+ "orange",
48
+ "yellow",
49
+ "green",
50
+ "blue",
51
+ "indigo",
52
+ "violet"
53
+ ],
54
+ "number": {
55
+ "$type": "number"
56
+ },
57
+ "engagement_score": [
58
+ 0
59
+ ]
60
+ },
61
+ "userProps": {
62
+ "title": {
63
+ "$type": "string"
64
+ },
65
+ "luckyNumber": {
66
+ "$range": [
67
+ 90,
68
+ 380
69
+ ]
70
+ },
71
+ "userTier": [
72
+ "regular"
73
+ ],
74
+ "spiritAnimal": [
75
+ "duck",
76
+ "dog",
77
+ "otter",
78
+ "penguin",
79
+ "cat",
80
+ "elephant",
81
+ "lion",
82
+ "cheetah",
83
+ "giraffe",
84
+ "zebra",
85
+ "rhino",
86
+ "hippo",
87
+ "whale",
88
+ "dolphin",
89
+ "shark",
90
+ "octopus",
91
+ "squid",
92
+ "jellyfish",
93
+ "starfish",
94
+ "seahorse",
95
+ "crab",
96
+ "lobster",
97
+ "shrimp",
98
+ "clam",
99
+ "snail",
100
+ "slug",
101
+ "butterfly",
102
+ "moth",
103
+ "bee",
104
+ "wasp",
105
+ "ant",
106
+ "beetle",
107
+ "ladybug",
108
+ "caterpillar",
109
+ "centipede",
110
+ "millipede",
111
+ "scorpion",
112
+ "spider",
113
+ "tarantula",
114
+ "tick",
115
+ "mite",
116
+ "mosquito",
117
+ "fly",
118
+ "dragonfly",
119
+ "damselfly",
120
+ "grasshopper",
121
+ "cricket",
122
+ "locust",
123
+ "mantis",
124
+ "cockroach",
125
+ "termite",
126
+ "praying mantis",
127
+ "walking stick",
128
+ "stick bug",
129
+ "leaf insect",
130
+ "lacewing",
131
+ "aphid",
132
+ "cicada",
133
+ "thrips",
134
+ "psyllid",
135
+ "scale insect",
136
+ "whitefly",
137
+ "mealybug",
138
+ "planthopper",
139
+ "leafhopper",
140
+ "treehopper",
141
+ "flea",
142
+ "louse",
143
+ "bedbug",
144
+ "flea beetle",
145
+ "weevil",
146
+ "longhorn beetle",
147
+ "leaf beetle",
148
+ "tiger beetle",
149
+ "ground beetle",
150
+ "lady beetle",
151
+ "firefly",
152
+ "click beetle",
153
+ "rove beetle",
154
+ "scarab beetle",
155
+ "dung beetle",
156
+ "stag beetle",
157
+ "rhinoceros beetle",
158
+ "hercules beetle",
159
+ "goliath beetle",
160
+ "jewel beetle",
161
+ "tortoise beetle"
162
+ ]
163
+ },
164
+ "funnels": [
165
+ {
166
+ "sequence": [
167
+ "qux",
168
+ "garply",
169
+ "durtle",
170
+ "linny",
171
+ "fonk",
172
+ "crumn",
173
+ "yak"
174
+ ]
175
+ },
176
+ {
177
+ "sequence": [
178
+ "foo",
179
+ "bar",
180
+ "baz"
181
+ ],
182
+ "isFirstFunnel": true
183
+ }
184
+ ]
185
+ }
@@ -3,7 +3,7 @@ const chance = new Chance();
3
3
  import dayjs from 'dayjs';
4
4
  import utc from 'dayjs/plugin/utc.js';
5
5
  dayjs.extend(utc);
6
- import { weighNumRange, integer } from "../lib/utils/utils.js";
6
+ import { weighNumRange, integer } from "../../lib/utils/utils.js";
7
7
 
8
8
  /**
9
9
  * ═══════════════════════════════════════════════════════════════
@@ -106,11 +106,12 @@ const config = {
106
106
  superProps: {
107
107
  color: ["red", "orange", "yellow", "green", "blue", "indigo", "violet"],
108
108
  number: integer,
109
-
109
+ engagement_score: [0],
110
110
  },
111
111
  userProps: {
112
112
  title: chance.profession.bind(chance),
113
113
  luckyNumber: weighNumRange(42, 420),
114
+ userTier: ["regular"],
114
115
  spiritAnimal: ["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"]
115
116
  },
116
117
  hook: function (record, type, meta) {
@@ -0,0 +1,70 @@
1
+ {
2
+ "events": [
3
+ {
4
+ "event": "page view",
5
+ "weight": 10,
6
+ "properties": {
7
+ "page": [
8
+ "/",
9
+ "/home",
10
+ "/about",
11
+ "/pricing",
12
+ "/docs"
13
+ ]
14
+ }
15
+ },
16
+ {
17
+ "event": "click",
18
+ "weight": 8,
19
+ "properties": {
20
+ "element": [
21
+ "button",
22
+ "link",
23
+ "card",
24
+ "nav",
25
+ "tab"
26
+ ],
27
+ "label": [
28
+ "submit",
29
+ "cancel",
30
+ "next",
31
+ "back",
32
+ "learn more"
33
+ ]
34
+ }
35
+ },
36
+ {
37
+ "event": "api call",
38
+ "weight": 6,
39
+ "properties": {
40
+ "endpoint": [
41
+ "/api/users",
42
+ "/api/data",
43
+ "/api/auth",
44
+ "/api/events"
45
+ ],
46
+ "status": [
47
+ 200,
48
+ 201,
49
+ 301,
50
+ 400,
51
+ 404,
52
+ 500
53
+ ],
54
+ "latency_ms": {
55
+ "$range": [
56
+ 408,
57
+ 1563
58
+ ]
59
+ }
60
+ }
61
+ }
62
+ ],
63
+ "userProps": {
64
+ "plan": [
65
+ "free",
66
+ "pro",
67
+ "enterprise"
68
+ ]
69
+ }
70
+ }
@@ -0,0 +1,90 @@
1
+ import Chance from 'chance';
2
+ let chance = new Chance();
3
+ import dayjs from "dayjs";
4
+ import utc from "dayjs/plugin/utc.js";
5
+ dayjs.extend(utc);
6
+ import { uid, comma } from 'ak-tools';
7
+ import { weighNumRange, date, integer, weighChoices } from "../../lib/utils/utils.js";
8
+
9
+ /**
10
+ * ═══════════════════════════════════════════════════════════════
11
+ * TECHNICAL TEST: Scale & Performance
12
+ * ═══════════════════════════════════════════════════════════════
13
+ *
14
+ * Tests high-volume generation, batch sizing, gzip compression.
15
+ * - 10,000 users, 500K events, 365 days (1 year)
16
+ * - gzip enabled, large batch size
17
+ * - Minimal event schema (3 events, few properties)
18
+ * - No hooks, no funnels, no extras
19
+ *
20
+ * Explicitly for performance benchmarking and verifying
21
+ * large file output + batch splitting behavior.
22
+ */
23
+
24
+ /** @type {import('../../types').Dungeon} */
25
+ const config = {
26
+ seed: "scale test",
27
+ name: "scale-test",
28
+ numDays: 365,
29
+ numEvents: 500_000,
30
+ numUsers: 10_000,
31
+ format: 'json',
32
+ gzip: true,
33
+ batchSize: 500_000,
34
+ concurrency: 1,
35
+ region: "US",
36
+ hasAnonIds: false,
37
+ hasSessionIds: false,
38
+ hasAdSpend: false,
39
+ hasLocation: false,
40
+ hasAndroidDevices: false,
41
+ hasIOSDevices: false,
42
+ hasDesktopDevices: false,
43
+ hasBrowser: false,
44
+ hasCampaigns: false,
45
+ isAnonymous: false,
46
+ alsoInferFunnels: false,
47
+ writeToDisk: false,
48
+
49
+ events: [
50
+ {
51
+ event: "page view",
52
+ weight: 10,
53
+ properties: {
54
+ page: ["/", "/home", "/about", "/pricing", "/docs"],
55
+ }
56
+ },
57
+ {
58
+ event: "click",
59
+ weight: 8,
60
+ properties: {
61
+ element: ["button", "link", "card", "nav", "tab"],
62
+ label: ["submit", "cancel", "next", "back", "learn more"],
63
+ }
64
+ },
65
+ {
66
+ event: "api call",
67
+ weight: 6,
68
+ properties: {
69
+ endpoint: ["/api/users", "/api/data", "/api/auth", "/api/events"],
70
+ status: [200, 200, 200, 200, 201, 301, 400, 404, 500],
71
+ latency_ms: weighNumRange(10, 2000, .25),
72
+ }
73
+ },
74
+ ],
75
+ funnels: [],
76
+ superProps: {},
77
+ userProps: {
78
+ plan: ["free", "pro", "enterprise"],
79
+ },
80
+ scdProps: {},
81
+ mirrorProps: {},
82
+ groupKeys: [],
83
+ groupProps: {},
84
+ lookupTables: [],
85
+ hook: function (record, type, meta) {
86
+ return record;
87
+ }
88
+ };
89
+
90
+ export default config;
@@ -0,0 +1,270 @@
1
+ {
2
+ "events": [
3
+ {
4
+ "event": "checkout",
5
+ "weight": 2,
6
+ "properties": {
7
+ "amount": {
8
+ "$range": [
9
+ 104,
10
+ 391
11
+ ]
12
+ },
13
+ "currency": [
14
+ "USD",
15
+ "CAD",
16
+ "EUR",
17
+ "BTC",
18
+ "ETH",
19
+ "JPY"
20
+ ],
21
+ "coupon": [
22
+ "none",
23
+ "10%OFF",
24
+ "20%OFF",
25
+ "30%OFF",
26
+ "40%OFF",
27
+ "50%OFF"
28
+ ],
29
+ "numItems": {
30
+ "$range": [
31
+ 2,
32
+ 9
33
+ ]
34
+ },
35
+ "discount_applied": [
36
+ false
37
+ ]
38
+ }
39
+ },
40
+ {
41
+ "event": "add to cart",
42
+ "weight": 4,
43
+ "properties": {
44
+ "amount": {
45
+ "$range": [
46
+ 110,
47
+ 395
48
+ ]
49
+ },
50
+ "rating": {
51
+ "$range": [
52
+ 1,
53
+ 5
54
+ ]
55
+ },
56
+ "reviews": {
57
+ "$range": [
58
+ 1,
59
+ 35
60
+ ]
61
+ },
62
+ "isFeaturedItem": [
63
+ true,
64
+ false
65
+ ],
66
+ "itemCategory": [
67
+ "Art",
68
+ "Pet",
69
+ "Handmade",
70
+ "Garden",
71
+ "Beauty",
72
+ "Baby",
73
+ "Movies"
74
+ ],
75
+ "dateItemListed": {
76
+ "$type": "string"
77
+ }
78
+ }
79
+ },
80
+ {
81
+ "event": "page view",
82
+ "weight": 10,
83
+ "properties": {
84
+ "page": [
85
+ "/watch",
86
+ "/product",
87
+ "/",
88
+ "/help",
89
+ "/listen"
90
+ ],
91
+ "utm_source": [
92
+ "linkedin",
93
+ "$organic",
94
+ "facebook",
95
+ "google"
96
+ ]
97
+ }
98
+ },
99
+ {
100
+ "event": "watch video",
101
+ "weight": 8,
102
+ "properties": {
103
+ "videoCategory": [
104
+ "travel",
105
+ "DIY",
106
+ "gaming",
107
+ "funny",
108
+ "news",
109
+ "educational"
110
+ ],
111
+ "isFeaturedItem": [
112
+ true,
113
+ false
114
+ ],
115
+ "watchTimeSec": {
116
+ "$range": [
117
+ 130,
118
+ 469
119
+ ]
120
+ },
121
+ "quality": [
122
+ "2160p",
123
+ "1440p",
124
+ "1080p",
125
+ "720p",
126
+ "480p",
127
+ "360p",
128
+ "240p"
129
+ ],
130
+ "format": [
131
+ "mp4",
132
+ "avi",
133
+ "mov",
134
+ "mpg"
135
+ ],
136
+ "uploader_id": {
137
+ "$type": "string"
138
+ },
139
+ "is_weekend": [
140
+ false
141
+ ]
142
+ }
143
+ },
144
+ {
145
+ "event": "view item",
146
+ "weight": 8,
147
+ "properties": {
148
+ "isFeaturedItem": [
149
+ true,
150
+ false
151
+ ],
152
+ "itemCategory": [
153
+ "Games",
154
+ "Handmade",
155
+ "Electronics",
156
+ "Music",
157
+ "Books",
158
+ "Movies"
159
+ ],
160
+ "dateItemListed": {
161
+ "$type": "string"
162
+ }
163
+ }
164
+ },
165
+ {
166
+ "event": "save item",
167
+ "weight": 5,
168
+ "properties": {
169
+ "isFeaturedItem": [
170
+ true,
171
+ false
172
+ ],
173
+ "itemCategory": [
174
+ "Food",
175
+ "Movies",
176
+ "Handmade",
177
+ "Art",
178
+ "Electronics",
179
+ "Kids",
180
+ "Baby"
181
+ ],
182
+ "dateItemListed": {
183
+ "$type": "string"
184
+ }
185
+ }
186
+ },
187
+ {
188
+ "event": "sign up",
189
+ "isFirstEvent": true,
190
+ "properties": {
191
+ "variants": [
192
+ "A",
193
+ "B",
194
+ "C",
195
+ "Control"
196
+ ],
197
+ "flows": [
198
+ "new",
199
+ "existing",
200
+ "loyal",
201
+ "churned"
202
+ ],
203
+ "flags": [
204
+ "on",
205
+ "off"
206
+ ],
207
+ "experiment_ids": [
208
+ "1234",
209
+ "5678",
210
+ "9012",
211
+ "3456",
212
+ "7890"
213
+ ],
214
+ "multiVariate": [
215
+ true,
216
+ false
217
+ ]
218
+ }
219
+ },
220
+ {
221
+ "event": "cart_abandoned",
222
+ "properties": {
223
+ "amount": {
224
+ "$range": [
225
+ 110,
226
+ 397
227
+ ]
228
+ }
229
+ }
230
+ }
231
+ ],
232
+ "superProps": {
233
+ "platform": [
234
+ "web",
235
+ "mobile",
236
+ "kiosk",
237
+ "smartTV"
238
+ ],
239
+ "currentTheme": [
240
+ "light",
241
+ "dark",
242
+ "custom"
243
+ ]
244
+ },
245
+ "userProps": {
246
+ "title": {
247
+ "$type": "string"
248
+ },
249
+ "luckyNumber": {
250
+ "$range": [
251
+ 117,
252
+ 344
253
+ ]
254
+ },
255
+ "spiritAnimal": [
256
+ "bee",
257
+ "octopus",
258
+ "moth",
259
+ "butterfly",
260
+ "aphid",
261
+ "dragonfly",
262
+ "ant",
263
+ "lobster",
264
+ "slug"
265
+ ],
266
+ "spendTier": [
267
+ "budget"
268
+ ]
269
+ }
270
+ }