make-mp-data 3.0.1 → 3.0.2

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 (50) hide show
  1. package/dungeons/adspend.js +35 -1
  2. package/dungeons/anon.js +25 -1
  3. package/dungeons/{array-of-object-loopup.js → array-of-object-lookup.js} +28 -8
  4. package/dungeons/benchmark-heavy.js +2 -2
  5. package/dungeons/benchmark-light.js +2 -2
  6. package/dungeons/big.js +2 -2
  7. package/dungeons/business.js +59 -12
  8. package/dungeons/complex.js +34 -1
  9. package/dungeons/copilot.js +1 -1
  10. package/dungeons/{harness/harness-education.js → education.js} +29 -12
  11. package/dungeons/experiments.js +15 -2
  12. package/dungeons/{harness/harness-fintech.js → fintech.js} +8 -8
  13. package/dungeons/foobar.js +33 -1
  14. package/dungeons/{harness/harness-food.js → food.js} +7 -4
  15. package/dungeons/funnels.js +38 -1
  16. package/dungeons/gaming.js +25 -5
  17. package/dungeons/media.js +861 -271
  18. package/dungeons/mil.js +29 -2
  19. package/dungeons/mirror.js +33 -1
  20. package/dungeons/{kurby.js → retention-cadence.js} +1 -1
  21. package/dungeons/{harness/harness-gaming.js → rpg.js} +5 -5
  22. package/dungeons/sanity.js +31 -2
  23. package/dungeons/{harness/harness-sass.js → sass.js} +2 -2
  24. package/dungeons/scd.js +46 -1
  25. package/dungeons/simple.js +1 -1
  26. package/dungeons/{harness/harness-social.js → social.js} +2 -2
  27. package/dungeons/streaming.js +373 -0
  28. package/dungeons/strict-event-test.js +1 -1
  29. package/dungeons/student-teacher.js +18 -5
  30. package/dungeons/text-generation.js +38 -1
  31. package/dungeons/too-big-events.js +38 -1
  32. package/dungeons/{userAgent.js → user-agent.js} +21 -1
  33. package/entry.js +5 -4
  34. package/lib/utils/logger.js +0 -4
  35. package/package.json +1 -4
  36. package/dungeons/ai-chat-analytics-ed.js +0 -275
  37. package/dungeons/clinch-agi.js +0 -632
  38. package/dungeons/ecommerce-store.js +0 -0
  39. package/dungeons/harness/harness-media.js +0 -961
  40. package/dungeons/money2020-ed-also.js +0 -277
  41. package/dungeons/money2020-ed.js +0 -580
  42. package/dungeons/uday-schema.json +0 -220
  43. package/lib/templates/funnels-instructions.txt +0 -272
  44. package/lib/templates/hook-examples.json +0 -187
  45. package/lib/templates/hooks-instructions.txt +0 -721
  46. package/lib/templates/refine-instructions.txt +0 -485
  47. package/lib/templates/schema-instructions.txt +0 -285
  48. package/lib/utils/ai.js +0 -896
  49. package/lib/utils/mixpanel.js +0 -101
  50. package/lib/utils/project.js +0 -167
@@ -1,632 +0,0 @@
1
-
2
- import dayjs from "dayjs";
3
- import utc from "dayjs/plugin/utc.js";
4
- import "dotenv/config";
5
- import { weighNumRange, pickAWinner, initChance, integer, decimal } from "../lib/utils/utils.js";
6
- import { uid } from "ak-tools";
7
-
8
- const SEED = "clinch-agi-cpo-demo";
9
- dayjs.extend(utc);
10
- const chance = initChance(SEED);
11
- const num_users = 5_000;
12
- const days = 95;
13
-
14
- /** @typedef {import("../types.js").Dungeon} Config */
15
-
16
- /**
17
- * CLINCH AGI — AI-Native Sales & GTM Workflow Platform
18
- *
19
- * Models an AI-powered platform where AI agents operate as virtual team members
20
- * for sales/GTM teams: joining meetings, summarizing calls, drafting follow-ups,
21
- * updating CRM, monitoring pipeline, and coaching reps.
22
- *
23
- * Built for a CPO interview demo with Uday Chakravarthi (founder of Clinch AGI).
24
- * Designed to showcase Mixpanel's analysis features against a realistic B2B SaaS dataset.
25
- *
26
- * Core product loop:
27
- * Meeting → AI Summary → Follow-up Draft → Send → CRM Auto-Update → Pipeline Insight
28
- *
29
- * Monetization: Tiered SaaS (starter / growth / enterprise)
30
- *
31
- * ═══════════════════════════════════════════════════════════════════
32
- * HOOKED INSIGHTS — WHAT'S HIDDEN IN THE DATA
33
- * ═══════════════════════════════════════════════════════════════════
34
- *
35
- * 1. THE AI GOT SMARTER — About 60 days ago, meeting summary quality jumped
36
- * dramatically. The old model scored 50-72; the new one hits 75-95+. You
37
- * can see the inflection point clearly in a line chart of quality_score.
38
- *
39
- * 2. PERSONALIZATION PAYS OFF — Follow-up emails with high personalization
40
- * scores get 3x more replies and clicks than generic ones. The AI's effort
41
- * in crafting personal messages directly drives better sales outcomes.
42
- *
43
- * 3. AI WORKS WEEKENDS — On Saturdays and Sundays, CRM updates are almost
44
- * entirely autonomous (no human in the loop), and the AI updates more
45
- * fields per record. The agents truly operate as "always-on" team members.
46
- *
47
- * 4. ENTERPRISE DEALS MOVE FASTER — Enterprise-tier users see deals progress
48
- * through pipeline stages 2x faster than starter-tier users. The platform
49
- * delivers disproportionate value to larger teams.
50
- *
51
- * 5. INTEGRATIONS PREDICT SUCCESS — Users who connect 5+ integrations are
52
- * tagged as "high" data completeness and overwhelmingly become champions.
53
- * Fewer integrations correlates with at-risk status.
54
- *
55
- * 6. TIER DRIVES ACTIVATION — Enterprise users convert through every funnel
56
- * at 1.3x the base rate; starter users convert at 0.7x. Onboarding,
57
- * meeting-to-action, pipeline management — all show the same pattern.
58
- *
59
- * 7. EARLY ADOPTION = RETENTION — Users who deploy 3+ agents and join 5+
60
- * meetings in their first 30 days hit a "power user milestone" and retain
61
- * at dramatically higher rates. Users with zero agent deploys get flagged
62
- * as churn risks — and they do churn.
63
- *
64
- * 8. BAD FEEDBACK PREDICTS CHURN — Users who give 3+ negative ratings
65
- * (1 or 2 stars) to AI agents show a steep engagement dropoff in the
66
- * second half of their lifecycle. Their event volume falls by ~60%.
67
- *
68
- * ═══════════════════════════════════════════════════════════════════
69
- */
70
-
71
- /** @type {Config} */
72
- const config = {
73
- token: "ff821702cde57664bd2b50eb12ead0bf",
74
- seed: SEED,
75
- numDays: days,
76
- numEvents: num_users * 120,
77
- numUsers: num_users,
78
- hasAnonIds: false,
79
- hasSessionIds: true,
80
- format: "json",
81
- gzip: true,
82
- alsoInferFunnels: false,
83
- hasLocation: true,
84
- hasAndroidDevices: true,
85
- hasIOSDevices: true,
86
- hasDesktopDevices: true,
87
- hasBrowser: false,
88
- hasCampaigns: false,
89
- isAnonymous: false,
90
- hasAdSpend: false,
91
- percentUsersBornInDataset: 35,
92
- hasAvatar: true,
93
- makeChart: false,
94
- batchSize: 2_500_000,
95
- concurrency: 1,
96
- writeToDisk: false,
97
- scdProps: {},
98
- mirrorProps: {},
99
- lookupTables: [],
100
-
101
- // ──────────────────────────────────────────────
102
- // EVENTS (18)
103
- // ──────────────────────────────────────────────
104
- events: [
105
- {
106
- event: "account created",
107
- weight: 0,
108
- isFirstEvent: true,
109
- properties: {
110
- signup_source: ["organic", "referral", "demo_request", "product_hunt", "g2_review"],
111
- initial_plan: ["free_trial", "free_trial", "free_trial", "growth", "enterprise"],
112
- },
113
- },
114
- {
115
- event: "agent deployed",
116
- weight: 3,
117
- properties: {
118
- agent_type: pickAWinner(["pre_call_researcher", "meeting_assistant", "follow_up_writer", "crm_updater", "pipeline_monitor", "outreach_agent"]),
119
- configuration_time_min: weighNumRange(2, 45, 0.4),
120
- },
121
- },
122
- {
123
- event: "meeting joined",
124
- weight: 5,
125
- properties: {
126
- meeting_platform: ["zoom", "zoom", "google_meet", "google_meet", "teams", "webex"],
127
- meeting_type: ["discovery", "demo", "negotiation", "check_in", "onboarding", "qbr"],
128
- participants: weighNumRange(2, 12, 0.5),
129
- duration_min: weighNumRange(10, 90, 0.3),
130
- },
131
- },
132
- {
133
- event: "meeting summary generated",
134
- weight: 5,
135
- properties: {
136
- summary_length_words: weighNumRange(100, 800, 0.3),
137
- action_items_count: weighNumRange(0, 8, 0.5),
138
- quality_score: weighNumRange(50, 95, 0.4), // Hook 1 overrides this
139
- },
140
- },
141
- {
142
- event: "crm auto-updated",
143
- weight: 8,
144
- properties: {
145
- crm_platform: ["hubspot", "hubspot", "salesforce", "salesforce", "pipedrive"],
146
- fields_updated: weighNumRange(1, 6, 0.5),
147
- update_type: ["contact_info", "deal_stage", "activity_log", "meeting_notes", "next_steps"],
148
- },
149
- },
150
- {
151
- event: "follow-up drafted",
152
- weight: 4,
153
- properties: {
154
- personalization_score: weighNumRange(30, 98, 0.3),
155
- template_used: ["post_meeting", "deal_nudge", "re_engagement", "intro", "proposal"],
156
- word_count: weighNumRange(50, 400, 0.4),
157
- },
158
- },
159
- {
160
- event: "follow-up sent",
161
- weight: 3,
162
- properties: {
163
- channel: ["email", "email", "email", "linkedin", "slack"],
164
- personalization_score: weighNumRange(30, 98, 0.3),
165
- time_to_send_hr: weighNumRange(0, 48, 0.5),
166
- email_outcome: ["pending", "pending", "pending", "opened", "opened", "clicked", "bounced", "replied"], // Hook 2 overrides
167
- },
168
- },
169
- {
170
- event: "pipeline alert received",
171
- weight: 4,
172
- properties: {
173
- alert_type: ["deal_stalling", "champion_left", "competitor_mentioned", "no_activity", "budget_risk"],
174
- severity: pickAWinner(["low", "medium", "high", "critical"]),
175
- deal_value: weighNumRange(5000, 500000, 0.2),
176
- },
177
- },
178
- {
179
- event: "deal stage changed",
180
- weight: 5,
181
- properties: {
182
- from_stage: ["lead", "qualified", "proposal", "negotiation", "verbal_commit"],
183
- to_stage: ["qualified", "proposal", "negotiation", "verbal_commit", "closed_won", "closed_lost"],
184
- days_in_previous_stage: weighNumRange(1, 60, 0.3), // Hook 4 modifies
185
- },
186
- },
187
- {
188
- event: "insight generated",
189
- weight: 6,
190
- properties: {
191
- insight_type: pickAWinner(["deal_risk", "buyer_intent", "competitive_intel", "engagement_trend", "revenue_forecast", "coaching_opportunity"]),
192
- confidence_score: weighNumRange(55, 98, 0.4),
193
- data_sources_used: weighNumRange(1, 5, 0.5),
194
- },
195
- },
196
- {
197
- event: "agent feedback",
198
- weight: 4,
199
- properties: {
200
- rating: [1, 2, 3, 3, 4, 4, 4, 5, 5, 5],
201
- feedback_type: ["accuracy", "relevance", "timeliness", "completeness", "tone"],
202
- agent_type: pickAWinner(["meeting_assistant", "follow_up_writer", "crm_updater", "pre_call_researcher"]),
203
- },
204
- },
205
- {
206
- event: "dashboard viewed",
207
- weight: 7,
208
- properties: {
209
- dashboard_type: ["pipeline_overview", "team_performance", "ai_agent_stats", "revenue_forecast", "activity_feed"],
210
- time_spent_sec: weighNumRange(10, 300, 0.3),
211
- },
212
- },
213
- {
214
- event: "integration connected",
215
- weight: 1,
216
- properties: {
217
- integration_name: pickAWinner(["hubspot", "salesforce", "slack", "google_calendar", "zoom", "linkedin", "gmail", "outlook"]),
218
- setup_time_min: weighNumRange(2, 30, 0.5),
219
- },
220
- },
221
- {
222
- event: "search performed",
223
- weight: 3,
224
- properties: {
225
- search_type: ["deals", "contacts", "meetings", "insights", "activities"],
226
- results_count: weighNumRange(0, 50, 0.4),
227
- clicked_result: [true, true, true, false],
228
- },
229
- },
230
- {
231
- event: "workflow created",
232
- weight: 2,
233
- properties: {
234
- workflow_type: ["meeting_prep", "post_meeting", "deal_update", "weekly_digest", "pipeline_review"],
235
- steps_count: weighNumRange(2, 8, 0.5),
236
- trigger_type: ["time_based", "event_based", "manual"],
237
- },
238
- },
239
- {
240
- event: "contact enriched",
241
- weight: 5,
242
- properties: {
243
- enrichment_source: ["linkedin", "company_website", "crm_history", "email_threads", "meeting_notes"],
244
- fields_enriched: weighNumRange(2, 12, 0.4),
245
- confidence_level: ["high", "high", "medium", "medium", "low"],
246
- },
247
- },
248
- {
249
- event: "deal created",
250
- weight: 2,
251
- properties: {
252
- deal_source: ["inbound", "outbound", "referral", "upsell", "expansion"],
253
- estimated_value: weighNumRange(5000, 250000, 0.2),
254
- close_date_days: weighNumRange(14, 120, 0.3),
255
- },
256
- },
257
- {
258
- event: "coaching tip viewed",
259
- weight: 3,
260
- properties: {
261
- tip_category: ["objection_handling", "discovery_questions", "closing_techniques", "rapport_building", "negotiation"],
262
- tip_relevance_score: weighNumRange(40, 98, 0.4),
263
- applied: [true, false, false, false],
264
- },
265
- },
266
- ],
267
-
268
- // ──────────────────────────────────────────────
269
- // FUNNELS (5)
270
- // ──────────────────────────────────────────────
271
- funnels: [
272
- {
273
- name: "Onboarding",
274
- sequence: ["account created", "integration connected", "agent deployed", "meeting joined"],
275
- isFirstFunnel: true,
276
- conversionRate: 65,
277
- timeToConvert: 48,
278
- order: "sequential",
279
- weight: 1,
280
- },
281
- {
282
- name: "Meeting to Action",
283
- sequence: ["meeting joined", "meeting summary generated", "follow-up drafted", "follow-up sent"],
284
- conversionRate: 70,
285
- timeToConvert: 4,
286
- order: "sequential",
287
- weight: 8,
288
- },
289
- {
290
- name: "Pipeline Management",
291
- sequence: ["pipeline alert received", "dashboard viewed", "deal stage changed"],
292
- conversionRate: 45,
293
- timeToConvert: 24,
294
- order: "sequential",
295
- weight: 5,
296
- },
297
- {
298
- name: "AI Adoption",
299
- sequence: ["agent deployed", "insight generated", "agent feedback"],
300
- conversionRate: 55,
301
- timeToConvert: 72,
302
- order: "sequential",
303
- weight: 4,
304
- },
305
- {
306
- name: "Value Realization",
307
- sequence: ["dashboard viewed", "workflow created", "agent deployed"],
308
- conversionRate: 40,
309
- timeToConvert: 96,
310
- order: "sequential",
311
- weight: 3,
312
- },
313
- ],
314
-
315
- // ──────────────────────────────────────────────
316
- // SUPER PROPS (3) — on every event
317
- // ──────────────────────────────────────────────
318
- superProps: {
319
- subscription_tier: pickAWinner(["starter", "growth", "growth", "enterprise"]),
320
- team_role: pickAWinner(["sales_rep", "sales_rep", "sales_rep", "sales_manager", "rev_ops", "marketing"]),
321
- ai_agent_version: ["v1.0", "v1.0", "v1.5", "v1.5", "v1.5", "v2.0", "v2.0", "v2.0"],
322
- },
323
-
324
- // ──────────────────────────────────────────────
325
- // USER PROPS (5)
326
- // ──────────────────────────────────────────────
327
- userProps: {
328
- company_size: pickAWinner(["SMB", "mid_market", "enterprise"]),
329
- industry: pickAWinner(["SaaS", "fintech", "healthcare", "e_commerce", "consulting", "manufacturing"]),
330
- deals_in_pipeline: weighNumRange(2, 50, 0.3),
331
- onboarding_cohort: ["Q1_2025", "Q2_2025", "Q3_2025", "Q4_2025"],
332
- integrations_connected: weighNumRange(1, 8, 0.4),
333
- },
334
-
335
- // ──────────────────────────────────────────────
336
- // GROUPS (1 group key)
337
- // ──────────────────────────────────────────────
338
- groupKeys: [
339
- ["company_id", 500],
340
- ],
341
-
342
- groupProps: {
343
- company_id: {
344
- name: () => chance.company(),
345
- industry: pickAWinner(["SaaS", "fintech", "healthcare", "e_commerce", "consulting", "manufacturing"]),
346
- segment: ["SMB", "mid_market", "enterprise"],
347
- arr: weighNumRange(10000, 500000, 0.2),
348
- csm: () => chance.pickone(["Sarah Chen", "Marcus Johnson", "Priya Patel", "Alex Rivera", "Jordan Kim"]),
349
- },
350
- },
351
-
352
- // ──────────────────────────────────────────────
353
- // HOOK FUNCTION (8 hooks)
354
- // ──────────────────────────────────────────────
355
- hook: function (record, type, meta) {
356
- const NOW = dayjs();
357
-
358
- // ════════════════════════════════════════════
359
- // HOOK 1 — AI Model Quality Evolution (EVENT)
360
- // Meeting summary quality improves after day 60
361
- // ════════════════════════════════════════════
362
- // HOOK 2 — Personalization Drives Outcomes (EVENT)
363
- // Higher personalization → better email outcomes
364
- // ════════════════════════════════════════════
365
- // HOOK 3 — Weekend Autonomous Agents (EVENT)
366
- // AI works autonomously on weekends
367
- // ════════════════════════════════════════════
368
- // HOOK 4 — Deal Velocity by Tier (EVENT)
369
- // Enterprise deals move faster through pipeline
370
- // ════════════════════════════════════════════
371
- if (type === "event") {
372
- const EVENT_TIME = dayjs(record.time);
373
- const QUALITY_INFLECTION = NOW.subtract(60, "day");
374
-
375
- // Hook 1: AI Model Quality Evolution
376
- if (record.event === "meeting summary generated") {
377
- if (EVENT_TIME.isBefore(QUALITY_INFLECTION)) {
378
- record.quality_score = Math.round(decimal(50, 72) * 10) / 10;
379
- record.ai_model = "v1_base";
380
- } else {
381
- const daysSinceInflection = Math.min(60, EVENT_TIME.diff(QUALITY_INFLECTION, "day"));
382
- const improvement = (daysSinceInflection / 60) * 0.15;
383
- record.quality_score = Math.min(98, Math.round(decimal(75, 95) * (1 + improvement) * 10) / 10);
384
- record.ai_model = "v2_enhanced";
385
- }
386
- }
387
-
388
- // Hook 2: Personalization Drives Outcomes
389
- if (record.event === "follow-up sent") {
390
- const persScore = record.personalization_score || 50;
391
- if (persScore > 70) {
392
- record.email_outcome = chance.pickone(["opened", "opened", "opened", "clicked", "clicked", "replied", "replied"]);
393
- record.personalization_level = "high";
394
- } else if (persScore > 50) {
395
- record.email_outcome = chance.pickone(["pending", "opened", "opened", "clicked", "bounced"]);
396
- record.personalization_level = "medium";
397
- } else {
398
- record.email_outcome = chance.pickone(["pending", "pending", "bounced", "bounced", "opened"]);
399
- record.personalization_level = "low";
400
- }
401
- }
402
-
403
- // Hook 3: Weekend Autonomous Agents
404
- if (record.event === "crm auto-updated") {
405
- const eventDay = EVENT_TIME.day(); // 0=Sun, 6=Sat
406
- if (eventDay === 0 || eventDay === 6) {
407
- record.update_source = "ai_autonomous";
408
- record.fields_updated = Math.max(record.fields_updated || 1, integer(3, 8));
409
- } else {
410
- record.update_source = chance.pickone(["ai_assisted", "ai_assisted", "ai_assisted", "ai_autonomous"]);
411
- }
412
- }
413
-
414
- // Hook 4: Deal Velocity by Tier
415
- if (record.event === "deal stage changed") {
416
- const tier = record.subscription_tier;
417
- if (tier === "enterprise") {
418
- record.days_in_previous_stage = Math.max(1, Math.round((record.days_in_previous_stage || 15) * decimal(0.5, 0.8)));
419
- record.velocity_category = "fast";
420
- } else if (tier === "starter") {
421
- record.days_in_previous_stage = Math.round((record.days_in_previous_stage || 15) * decimal(1.3, 2.0));
422
- record.velocity_category = "slow";
423
- } else {
424
- record.velocity_category = "normal";
425
- }
426
- }
427
- }
428
-
429
- // ════════════════════════════════════════════
430
- // HOOK 5 — Power User + Integration Depth (USER)
431
- // Tags users with engagement segments
432
- // ════════════════════════════════════════════
433
- if (type === "user") {
434
- const intCount = record.integrations_connected || 1;
435
- if (intCount >= 5) {
436
- record.data_completeness_tier = "high";
437
- } else if (intCount >= 3) {
438
- record.data_completeness_tier = "medium";
439
- } else {
440
- record.data_completeness_tier = "low";
441
- }
442
-
443
- const tier = record.subscription_tier;
444
- if (tier === "enterprise") {
445
- record.user_segment = chance.pickone(["champion", "champion", "champion", "power_user", "standard"]);
446
- } else if (tier === "growth") {
447
- record.user_segment = chance.pickone(["champion", "power_user", "power_user", "standard", "standard"]);
448
- } else {
449
- record.user_segment = chance.pickone(["explorer", "explorer", "standard", "standard", "at_risk"]);
450
- }
451
- }
452
-
453
- // ════════════════════════════════════════════
454
- // HOOK 6 — Tier-Based Conversion (FUNNEL-PRE)
455
- // Enterprise converts better, starter struggles
456
- // ════════════════════════════════════════════
457
- if (type === "funnel-pre") {
458
- const tier = meta?.profile?.subscription_tier;
459
- if (tier === "enterprise") {
460
- record.conversionRate = Math.min(99, Math.round(record.conversionRate * decimal(1.2, 1.4)));
461
- } else if (tier === "starter") {
462
- record.conversionRate = Math.max(5, Math.round(record.conversionRate * decimal(0.6, 0.8)));
463
- }
464
- }
465
-
466
- // ════════════════════════════════════════════
467
- // HOOK 7 — Agent Adoption → Power Users (EVERYTHING)
468
- // Early agent adoption predicts retention
469
- // ════════════════════════════════════════════
470
- // HOOK 8 — Negative Feedback → Disengagement (EVERYTHING)
471
- // Repeated bad feedback predicts churn
472
- // ════════════════════════════════════════════
473
- if (type === "everything") {
474
- if (!record.length) return record;
475
- const userId = record[0].user_id || record[0].device_id;
476
- if (!userId) return record;
477
-
478
- // Hook 7: Agent Adoption → Power Users
479
- const times = record.map(e => new Date(e.time).getTime()).filter(t => !isNaN(t));
480
- if (times.length) {
481
- const firstEventTime = dayjs(Math.min(...times));
482
- const thirtyDayMark = firstEventTime.add(30, "day");
483
-
484
- const earlyAgentDeploys = record.filter(e =>
485
- e.event === "agent deployed" && dayjs(e.time).isBefore(thirtyDayMark)
486
- ).length;
487
- const earlyMeetings = record.filter(e =>
488
- e.event === "meeting joined" && dayjs(e.time).isBefore(thirtyDayMark)
489
- ).length;
490
-
491
- if (earlyAgentDeploys >= 3 && earlyMeetings >= 5) {
492
- record.push({
493
- event: "power user milestone",
494
- time: thirtyDayMark.add(integer(1, 48), "hour").toISOString(),
495
- user_id: userId,
496
- insert_id: uid(12),
497
- milestone_type: "early_adopter",
498
- agents_deployed: earlyAgentDeploys,
499
- meetings_recorded: earlyMeetings,
500
- });
501
- } else if (earlyAgentDeploys < 1) {
502
- record.push({
503
- event: "churn risk flagged",
504
- time: thirtyDayMark.add(integer(1, 72), "hour").toISOString(),
505
- user_id: userId,
506
- insert_id: uid(12),
507
- risk_reason: "low_agent_adoption",
508
- agents_deployed: earlyAgentDeploys,
509
- });
510
- }
511
- }
512
-
513
- // Hook 8: Negative Feedback → Disengagement
514
- const negativeFeedbacks = record.filter(e =>
515
- e.event === "agent feedback" && (e.rating === 1 || e.rating === 2)
516
- ).length;
517
-
518
- if (negativeFeedbacks >= 3) {
519
- const sortedByTime = [...record].sort((a, b) => new Date(a.time) - new Date(b.time));
520
- const midpoint = Math.floor(sortedByTime.length * 0.6);
521
- const cutoffTime = sortedByTime[midpoint]?.time;
522
-
523
- if (cutoffTime) {
524
- const filtered = record.filter(e => {
525
- if (new Date(e.time) > new Date(cutoffTime)) {
526
- return chance.bool({ likelihood: 40 });
527
- }
528
- return true;
529
- });
530
- record.length = 0;
531
- record.push(...filtered);
532
- }
533
- }
534
- }
535
-
536
- return record;
537
- },
538
- };
539
-
540
- export default config;
541
-
542
- /**
543
- * ═══════════════════════════════════════════════════════════════════
544
- * CLINCH AGI — DATASET DOCUMENTATION
545
- * ═══════════════════════════════════════════════════════════════════
546
- *
547
- * OVERVIEW
548
- * --------
549
- * This dungeon generates ~120,000 events across 1,000 users over 120 days,
550
- * simulating Clinch AGI — an AI-native workflow automation platform for
551
- * sales and go-to-market teams. The data models core product behaviors:
552
- * AI meeting assistants, automated CRM updates, pipeline intelligence,
553
- * personalized outreach, and AI coaching.
554
- *
555
- * 200 companies are generated as group analytics entities.
556
- *
557
- * HOOKS — 8 DELIBERATELY ARCHITECTED ANALYTICS PATTERNS
558
- * ─────────────────────────────────────────────────────
559
- *
560
- * ┌──────┬────────────────────────────────┬────────────┬─────────────────────────────────────────────────┐
561
- * │ Hook │ Name │ Type │ How to Find It in Mixpanel │
562
- * ├──────┼────────────────────────────────┼────────────┼─────────────────────────────────────────────────┤
563
- * │ 1 │ AI Model Quality Evolution │ event │ Insights → Line chart: avg(quality_score) on │
564
- * │ │ │ │ "meeting summary generated" over time. │
565
- * │ │ │ │ Clear inflection ~60 days ago. Breakdown by │
566
- * │ │ │ │ ai_model shows v1_base vs v2_enhanced. │
567
- * │ │ Real-world: Model improvement │ │ │
568
- * │ │ after training data refinement │ │ │
569
- * ├──────┼────────────────────────────────┼────────────┼─────────────────────────────────────────────────┤
570
- * │ 2 │ Personalization Drives Results │ event │ Insights → Bar chart: "follow-up sent" broken │
571
- * │ │ │ │ down by email_outcome, filtered by │
572
- * │ │ │ │ personalization_level. High personalization has │
573
- * │ │ │ │ 3x more replies vs low. │
574
- * │ │ Real-world: AI effort → ROI │ │ │
575
- * ├──────┼────────────────────────────────┼────────────┼─────────────────────────────────────────────────┤
576
- * │ 3 │ Weekend Autonomous Agents │ event │ Insights → "crm auto-updated" broken down by │
577
- * │ │ │ │ update_source, viewed by day of week. Weekends │
578
- * │ │ │ │ are nearly 100% ai_autonomous with higher │
579
- * │ │ │ │ fields_updated. AI works when humans rest. │
580
- * │ │ Real-world: 24/7 AI coverage │ │ │
581
- * ├──────┼────────────────────────────────┼────────────┼─────────────────────────────────────────────────┤
582
- * │ 4 │ Deal Velocity by Tier │ event │ Insights → avg(days_in_previous_stage) on │
583
- * │ │ │ │ "deal stage changed", broken down by │
584
- * │ │ │ │ subscription_tier. Enterprise is 2x faster. │
585
- * │ │ │ │ Also see velocity_category breakdown. │
586
- * │ │ Real-world: Tier-driven ROI │ │ │
587
- * ├──────┼────────────────────────────────┼────────────┼─────────────────────────────────────────────────┤
588
- * │ 5 │ Power User + Integration Depth │ user │ Users → Breakdown by user_segment shows │
589
- * │ │ │ │ champion/power_user/standard/explorer/at_risk. │
590
- * │ │ │ │ Cross with data_completeness_tier to see │
591
- * │ │ │ │ integration depth correlates with user quality. │
592
- * │ │ Real-world: PQL scoring model │ │ │
593
- * ├──────┼────────────────────────────────┼────────────┼─────────────────────────────────────────────────┤
594
- * │ 6 │ Tier-Based Conversion │ funnel-pre │ Funnels → Any funnel broken down by │
595
- * │ │ │ │ subscription_tier. Enterprise converts 1.3x │
596
- * │ │ │ │ better; starter converts 0.7x worse. │
597
- * │ │ Real-world: Segment activation │ │ │
598
- * ├──────┼────────────────────────────────┼────────────┼─────────────────────────────────────────────────┤
599
- * │ 7 │ Agent Adoption → Power Users │ everything │ Retention → Cohort by "power user milestone" │
600
- * │ │ │ │ vs "churn risk flagged". Milestone users retain │
601
- * │ │ │ │ at 3x the rate. Filter by agents_deployed to │
602
- * │ │ │ │ see the adoption threshold. │
603
- * │ │ Real-world: Aha moment │ │ │
604
- * ├──────┼────────────────────────────────┼────────────┼─────────────────────────────────────────────────┤
605
- * │ 8 │ Negative Feedback → Churn │ everything │ Retention → Segment by users who did │
606
- * │ │ │ │ "agent feedback" with rating 1 or 2, >=3 times. │
607
- * │ │ │ │ These users show steep engagement dropoff in │
608
- * │ │ │ │ second half of their lifecycle. │
609
- * │ │ Real-world: Churn prediction │ │ │
610
- * └──────┴────────────────────────────────┴────────────┴─────────────────────────────────────────────────┘
611
- *
612
- * EXPECTED METRICS SUMMARY
613
- * ────────────────────────
614
- * │ Metric │ Expected Range │
615
- * │ Total events │ ~120,000 │
616
- * │ Unique users │ ~1,000 │
617
- * │ Companies (groups) │ 200 │
618
- * │ Avg quality_score (early) │ 50-72 │
619
- * │ Avg quality_score (recent) │ 78-95 │
620
- * │ Enterprise deal velocity │ 2-24 days avg │
621
- * │ Starter deal velocity │ 15-120 days avg │
622
- * │ Onboarding funnel conversion │ ~65% (enterprise ~85%) │
623
- * │ Power user milestone rate │ ~15-25% of users │
624
- * │ Churn risk flagged rate │ ~30-40% of users │
625
- *
626
- * CROSS-HOOK ANALYSIS IDEAS
627
- * ─────────────────────────
628
- * - Do power users (Hook 7) also have high data_completeness_tier (Hook 5)?
629
- * - Does AI model improvement (Hook 1) correlate with better email outcomes (Hook 2)?
630
- * - Do enterprise tier users (Hook 4, 6) generate more positive agent feedback (Hook 8)?
631
- * - Is weekend autonomous behavior (Hook 3) more common for growth/enterprise tiers?
632
- */
File without changes