@ak--47/dungeon-master 1.0.0 → 1.2.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 (104) 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 +92 -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} +12 -5
  8. package/dungeons/technical/experiments-schema.json +203 -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} +3 -3
  12. package/dungeons/technical/group-analytics-schema.json +241 -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} +2 -3
  20. package/dungeons/technical/sanity-schema.json +185 -0
  21. package/dungeons/{sanity.js → technical/sanity.js} +4 -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 +467 -0
  25. package/dungeons/{scd.js → technical/scd.js} +20 -10
  26. package/dungeons/technical/simple-schema.json +362 -0
  27. package/dungeons/{simple.js → technical/simple.js} +7 -7
  28. package/dungeons/technical/simplest-schema.json +724 -0
  29. package/dungeons/{simplest.js → technical/simplest.js} +7 -7
  30. package/dungeons/technical/text-generation-schema.json +1062 -0
  31. package/dungeons/{text-generation.js → technical/text-generation.js} +24 -11
  32. package/dungeons/vertical/community-schema.json +579 -0
  33. package/dungeons/vertical/community.js +794 -0
  34. package/dungeons/vertical/devtools-schema.json +601 -0
  35. package/dungeons/vertical/devtools.js +843 -0
  36. package/dungeons/vertical/ecommerce-schema.json +604 -0
  37. package/dungeons/{ecommerce.js → vertical/ecommerce.js} +43 -5
  38. package/dungeons/vertical/education-schema.json +5686 -0
  39. package/dungeons/{education.js → vertical/education.js} +70 -39
  40. package/dungeons/vertical/fintech-schema.json +630 -0
  41. package/dungeons/{fintech.js → vertical/fintech.js} +107 -56
  42. package/dungeons/vertical/fitness-schema.json +530 -0
  43. package/dungeons/vertical/fitness.js +808 -0
  44. package/dungeons/vertical/food-delivery-schema.json +36728 -0
  45. package/dungeons/{food.js → vertical/food-delivery.js} +67 -26
  46. package/dungeons/vertical/gaming-schema.json +438 -0
  47. package/dungeons/{gaming.js → vertical/gaming.js} +29 -16
  48. package/dungeons/vertical/healthcare-schema.json +549 -0
  49. package/dungeons/vertical/healthcare.js +775 -0
  50. package/dungeons/vertical/insurance-application-schema.json +485 -0
  51. package/dungeons/{insurance-application.js → vertical/insurance-application.js} +41 -31
  52. package/dungeons/vertical/logistics-schema.json +574 -0
  53. package/dungeons/vertical/logistics.js +799 -0
  54. package/dungeons/vertical/marketplace-schema.json +533 -0
  55. package/dungeons/vertical/marketplace.js +850 -0
  56. package/dungeons/vertical/media-schema.json +4749 -0
  57. package/dungeons/{media.js → vertical/media.js} +103 -19
  58. package/dungeons/vertical/rpg-schema.json +2491 -0
  59. package/dungeons/{rpg.js → vertical/rpg.js} +87 -60
  60. package/dungeons/vertical/sass-schema.json +3128 -0
  61. package/dungeons/{sass.js → vertical/sass.js} +65 -26
  62. package/dungeons/vertical/social-schema.json +620 -0
  63. package/dungeons/{social.js → vertical/social.js} +76 -17
  64. package/dungeons/vertical/travel-schema.json +580 -0
  65. package/dungeons/vertical/travel.js +742 -0
  66. package/index.js +20 -16
  67. package/lib/core/config-validator.js +286 -1
  68. package/lib/core/context.js +16 -5
  69. package/lib/core/storage.js +2 -0
  70. package/lib/generators/adspend.js +3 -3
  71. package/lib/generators/events.js +141 -14
  72. package/lib/generators/funnels.js +67 -7
  73. package/lib/generators/text.js +2 -2
  74. package/lib/orchestrators/user-loop.js +444 -22
  75. package/lib/templates/soup-presets.js +2 -2
  76. package/lib/utils/utils.js +4 -5
  77. package/package.json +4 -3
  78. package/scripts/dungeon-to-json.mjs +163 -0
  79. package/scripts/extract-dungeon-schema.mjs +343 -0
  80. package/scripts/json-to-dungeon.mjs +200 -0
  81. package/scripts/run-dungeon.mjs +76 -0
  82. package/scripts/run-many.mjs +118 -0
  83. package/scripts/verify-runner.mjs +42 -0
  84. package/types.d.ts +316 -1
  85. package/dungeons/array-of-object-lookup-schema.json +0 -327
  86. package/dungeons/ecommerce-schema.json +0 -462
  87. package/dungeons/education-schema.json +0 -2409
  88. package/dungeons/fintech-schema.json +0 -14034
  89. package/dungeons/foobar-schema.json +0 -403
  90. package/dungeons/food-delivery-schema.json +0 -192
  91. package/dungeons/food-delivery.js +0 -602
  92. package/dungeons/food-schema.json +0 -1152
  93. package/dungeons/gaming-schema.json +0 -1270
  94. package/dungeons/insurance-application-schema.json +0 -204
  95. package/dungeons/media-schema.json +0 -906
  96. package/dungeons/retention-cadence-schema.json +0 -78
  97. package/dungeons/rpg-schema.json +0 -4526
  98. package/dungeons/sanity-schema.json +0 -255
  99. package/dungeons/sass-schema.json +0 -1291
  100. package/dungeons/scd-schema.json +0 -919
  101. package/dungeons/simple-schema.json +0 -608
  102. package/dungeons/simplest-schema.json +0 -1418
  103. package/dungeons/social-schema.json +0 -1118
  104. package/dungeons/text-generation-schema.json +0 -3096
@@ -0,0 +1,37 @@
1
+ {
2
+ "events": [
3
+ {
4
+ "event": "first behavior",
5
+ "isFirstEvent": true
6
+ },
7
+ {
8
+ "event": "hourly behavior",
9
+ "weight": 40
10
+ },
11
+ {
12
+ "event": "daily behavior",
13
+ "weight": 30
14
+ },
15
+ {
16
+ "event": "weekly behavior",
17
+ "weight": 15
18
+ },
19
+ {
20
+ "event": "monthly behavior",
21
+ "weight": 10
22
+ },
23
+ {
24
+ "event": "placeholder",
25
+ "weight": 50
26
+ }
27
+ ],
28
+ "userProps": {
29
+ "favorite color": [
30
+ "red",
31
+ "blue",
32
+ "green",
33
+ "yellow",
34
+ "purple"
35
+ ]
36
+ }
37
+ }
@@ -2,14 +2,14 @@ const SEED = "kurby-retention";
2
2
  import dayjs from 'dayjs';
3
3
  import utc from 'dayjs/plugin/utc.js';
4
4
  dayjs.extend(utc);
5
- import * as u from "../lib/utils/utils.js";
5
+ import * as u from "../../lib/utils/utils.js";
6
6
  import * as v from 'ak-tools';
7
7
  const chance = u.initChance(SEED);
8
8
 
9
9
  const num_users = 100;
10
10
  const days = 360;
11
11
 
12
- /** @typedef {import("../types.js").Dungeon} Config */
12
+ /** @typedef {import("../../types").Dungeon} Config */
13
13
 
14
14
  /**
15
15
  * ═══════════════════════════════════════════════════════════════
@@ -119,7 +119,6 @@ const config = {
119
119
  isAnonymous: false,
120
120
  hasAdSpend: false,
121
121
  hasAvatar: false,
122
- batchSize: 5_500_000,
123
122
  concurrency: 1,
124
123
  writeToDisk: false,
125
124
  percentUsersBornInDataset: 100,
@@ -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
+ "funnels": [
45
+ {
46
+ "sequence": [
47
+ "qux",
48
+ "garply",
49
+ "durtle",
50
+ "linny",
51
+ "fonk",
52
+ "crumn",
53
+ "yak"
54
+ ]
55
+ },
56
+ {
57
+ "sequence": [
58
+ "foo",
59
+ "bar",
60
+ "baz"
61
+ ],
62
+ "isFirstFunnel": true
63
+ }
64
+ ],
65
+ "superProps": {
66
+ "color": [
67
+ "red",
68
+ "orange",
69
+ "yellow",
70
+ "green",
71
+ "blue",
72
+ "indigo",
73
+ "violet"
74
+ ],
75
+ "number": {
76
+ "$type": "number"
77
+ },
78
+ "engagement_score": [
79
+ 0
80
+ ]
81
+ },
82
+ "userProps": {
83
+ "title": {
84
+ "$type": "string"
85
+ },
86
+ "luckyNumber": {
87
+ "$range": [
88
+ 90,
89
+ 380
90
+ ]
91
+ },
92
+ "userTier": [
93
+ "regular"
94
+ ],
95
+ "spiritAnimal": [
96
+ "duck",
97
+ "dog",
98
+ "otter",
99
+ "penguin",
100
+ "cat",
101
+ "elephant",
102
+ "lion",
103
+ "cheetah",
104
+ "giraffe",
105
+ "zebra",
106
+ "rhino",
107
+ "hippo",
108
+ "whale",
109
+ "dolphin",
110
+ "shark",
111
+ "octopus",
112
+ "squid",
113
+ "jellyfish",
114
+ "starfish",
115
+ "seahorse",
116
+ "crab",
117
+ "lobster",
118
+ "shrimp",
119
+ "clam",
120
+ "snail",
121
+ "slug",
122
+ "butterfly",
123
+ "moth",
124
+ "bee",
125
+ "wasp",
126
+ "ant",
127
+ "beetle",
128
+ "ladybug",
129
+ "caterpillar",
130
+ "centipede",
131
+ "millipede",
132
+ "scorpion",
133
+ "spider",
134
+ "tarantula",
135
+ "tick",
136
+ "mite",
137
+ "mosquito",
138
+ "fly",
139
+ "dragonfly",
140
+ "damselfly",
141
+ "grasshopper",
142
+ "cricket",
143
+ "locust",
144
+ "mantis",
145
+ "cockroach",
146
+ "termite",
147
+ "praying mantis",
148
+ "walking stick",
149
+ "stick bug",
150
+ "leaf insect",
151
+ "lacewing",
152
+ "aphid",
153
+ "cicada",
154
+ "thrips",
155
+ "psyllid",
156
+ "scale insect",
157
+ "whitefly",
158
+ "mealybug",
159
+ "planthopper",
160
+ "leafhopper",
161
+ "treehopper",
162
+ "flea",
163
+ "louse",
164
+ "bedbug",
165
+ "flea beetle",
166
+ "weevil",
167
+ "longhorn beetle",
168
+ "leaf beetle",
169
+ "tiger beetle",
170
+ "ground beetle",
171
+ "lady beetle",
172
+ "firefly",
173
+ "click beetle",
174
+ "rove beetle",
175
+ "scarab beetle",
176
+ "dung beetle",
177
+ "stag beetle",
178
+ "rhinoceros beetle",
179
+ "hercules beetle",
180
+ "goliath beetle",
181
+ "jewel beetle",
182
+ "tortoise beetle"
183
+ ]
184
+ }
185
+ }
@@ -3,8 +3,9 @@ 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
+ /** @typedef {import("../../types").Dungeon} Config */
8
9
  /**
9
10
  * ═══════════════════════════════════════════════════════════════
10
11
  * DATASET OVERVIEW
@@ -106,11 +107,12 @@ const config = {
106
107
  superProps: {
107
108
  color: ["red", "orange", "yellow", "green", "blue", "indigo", "violet"],
108
109
  number: integer,
109
-
110
+ engagement_score: [0],
110
111
  },
111
112
  userProps: {
112
113
  title: chance.profession.bind(chance),
113
114
  luckyNumber: weighNumRange(42, 420),
115
+ userTier: ["regular"],
114
116
  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
117
  },
116
118
  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
+ /** @typedef {import("../../types").Dungeon} Config */
10
+ /**
11
+ * ═══════════════════════════════════════════════════════════════
12
+ * TECHNICAL TEST: Scale & Performance
13
+ * ═══════════════════════════════════════════════════════════════
14
+ *
15
+ * Tests high-volume generation, batch sizing, gzip compression.
16
+ * - 10,000 users, 500K events, 365 days (1 year)
17
+ * - gzip enabled, large batch size
18
+ * - Minimal event schema (3 events, few properties)
19
+ * - No hooks, no funnels, no extras
20
+ *
21
+ * Explicitly for performance benchmarking and verifying
22
+ * large file output + batch splitting behavior.
23
+ */
24
+
25
+ /** @type {import('../../types').Dungeon} */
26
+ const config = {
27
+ seed: "scale test",
28
+ name: "scale-test",
29
+ numDays: 365,
30
+ numEvents: 500_000,
31
+ numUsers: 10_000,
32
+ format: 'json',
33
+ gzip: true,
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;