@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.
- package/README.md +7 -7
- package/dungeons/technical/ad-spend-schema.json +128 -0
- package/dungeons/technical/ad-spend.js +116 -0
- package/dungeons/technical/anonymous-users-schema.json +91 -0
- package/dungeons/technical/anonymous-users.js +102 -0
- package/dungeons/technical/array-of-object-lookup-schema.json +191 -0
- package/dungeons/{array-of-object-lookup.js → technical/array-of-object-lookup.js} +11 -4
- package/dungeons/technical/experiments-schema.json +197 -0
- package/dungeons/technical/experiments.js +168 -0
- package/dungeons/technical/foobar-schema.json +362 -0
- package/dungeons/{foobar.js → technical/foobar.js} +2 -2
- package/dungeons/technical/group-analytics-schema.json +149 -0
- package/dungeons/technical/group-analytics.js +151 -0
- package/dungeons/technical/mirror-strategies-schema.json +84 -0
- package/dungeons/technical/mirror-strategies.js +126 -0
- package/dungeons/technical/nested-objects-schema.json +145 -0
- package/dungeons/technical/nested-objects.js +207 -0
- package/dungeons/technical/retention-cadence-schema.json +37 -0
- package/dungeons/{retention-cadence.js → technical/retention-cadence.js} +1 -1
- package/dungeons/technical/sanity-schema.json +185 -0
- package/dungeons/{sanity.js → technical/sanity.js} +3 -2
- package/dungeons/technical/scale-test-schema.json +70 -0
- package/dungeons/technical/scale-test.js +90 -0
- package/dungeons/technical/scd-schema.json +270 -0
- package/dungeons/{scd.js → technical/scd.js} +19 -10
- package/dungeons/technical/simple-schema.json +278 -0
- package/dungeons/{simple.js → technical/simple.js} +6 -6
- package/dungeons/technical/simplest-schema.json +635 -0
- package/dungeons/{simplest.js → technical/simplest.js} +6 -6
- package/dungeons/technical/text-generation-schema.json +1059 -0
- package/dungeons/{text-generation.js → technical/text-generation.js} +23 -9
- package/dungeons/vertical/community-schema.json +557 -0
- package/dungeons/vertical/community.js +788 -0
- package/dungeons/vertical/devtools-schema.json +580 -0
- package/dungeons/vertical/devtools.js +837 -0
- package/dungeons/vertical/ecommerce-schema.json +586 -0
- package/dungeons/{ecommerce.js → vertical/ecommerce.js} +34 -3
- package/dungeons/vertical/education-schema.json +697 -0
- package/dungeons/{education.js → vertical/education.js} +54 -36
- package/dungeons/vertical/fintech-schema.json +563 -0
- package/dungeons/{fintech.js → vertical/fintech.js} +91 -53
- package/dungeons/vertical/fitness-schema.json +508 -0
- package/dungeons/vertical/fitness.js +802 -0
- package/dungeons/vertical/food-delivery-schema.json +678 -0
- package/dungeons/{food.js → vertical/food-delivery.js} +51 -23
- package/dungeons/vertical/gaming-schema.json +394 -0
- package/dungeons/{gaming.js → vertical/gaming.js} +9 -7
- package/dungeons/vertical/healthcare-schema.json +527 -0
- package/dungeons/vertical/healthcare.js +769 -0
- package/dungeons/vertical/insurance-application-schema.json +466 -0
- package/dungeons/{insurance-application.js → vertical/insurance-application.js} +33 -29
- package/dungeons/vertical/logistics-schema.json +552 -0
- package/dungeons/vertical/logistics.js +793 -0
- package/dungeons/vertical/marketplace-schema.json +511 -0
- package/dungeons/vertical/marketplace.js +844 -0
- package/dungeons/vertical/media-schema.json +787 -0
- package/dungeons/{media.js → vertical/media.js} +94 -16
- package/dungeons/vertical/rpg-schema.json +654 -0
- package/dungeons/{rpg.js → vertical/rpg.js} +78 -57
- package/dungeons/vertical/sass-schema.json +653 -0
- package/dungeons/{sass.js → vertical/sass.js} +49 -23
- package/dungeons/vertical/social-schema.json +552 -0
- package/dungeons/{social.js → vertical/social.js} +60 -14
- package/dungeons/vertical/travel-schema.json +558 -0
- package/dungeons/vertical/travel.js +736 -0
- package/index.js +19 -15
- package/lib/core/config-validator.js +286 -1
- package/lib/core/context.js +7 -5
- package/lib/generators/adspend.js +3 -3
- package/lib/generators/events.js +141 -14
- package/lib/generators/funnels.js +67 -7
- package/lib/generators/text.js +2 -2
- package/lib/orchestrators/user-loop.js +441 -22
- package/lib/templates/soup-presets.js +2 -2
- package/lib/utils/utils.js +4 -5
- package/package.json +4 -3
- package/scripts/dungeon-to-json.mjs +163 -0
- package/scripts/extract-dungeon-schema.mjs +297 -0
- package/scripts/json-to-dungeon.mjs +200 -0
- package/scripts/run-dungeon.mjs +76 -0
- package/scripts/run-many.mjs +118 -0
- package/scripts/verify-runner.mjs +42 -0
- package/types.d.ts +313 -1
- package/dungeons/array-of-object-lookup-schema.json +0 -327
- package/dungeons/ecommerce-schema.json +0 -462
- package/dungeons/education-schema.json +0 -2409
- package/dungeons/fintech-schema.json +0 -14034
- package/dungeons/foobar-schema.json +0 -403
- package/dungeons/food-delivery-schema.json +0 -192
- package/dungeons/food-delivery.js +0 -602
- package/dungeons/food-schema.json +0 -1152
- package/dungeons/gaming-schema.json +0 -1270
- package/dungeons/insurance-application-schema.json +0 -204
- package/dungeons/media-schema.json +0 -906
- package/dungeons/retention-cadence-schema.json +0 -78
- package/dungeons/rpg-schema.json +0 -4526
- package/dungeons/sanity-schema.json +0 -255
- package/dungeons/sass-schema.json +0 -1291
- package/dungeons/scd-schema.json +0 -919
- package/dungeons/simple-schema.json +0 -608
- package/dungeons/simplest-schema.json +0 -1418
- package/dungeons/social-schema.json +0 -1118
- package/dungeons/text-generation-schema.json +0 -3096
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
2
|
import utc from "dayjs/plugin/utc.js";
|
|
3
3
|
import "dotenv/config";
|
|
4
|
-
import * as u from "
|
|
4
|
+
import * as u from "../../lib/utils/utils.js";
|
|
5
5
|
import * as v from "ak-tools";
|
|
6
6
|
|
|
7
7
|
const SEED = "harness-sass";
|
|
@@ -345,10 +345,11 @@ const config = {
|
|
|
345
345
|
event: "service deployed",
|
|
346
346
|
weight: 10,
|
|
347
347
|
properties: {
|
|
348
|
-
service_id:
|
|
348
|
+
service_id: serviceIds,
|
|
349
349
|
service_type: ["web_app", "api", "database", "cache", "queue", "ml_model"],
|
|
350
350
|
environment: ["production", "staging", "dev"],
|
|
351
351
|
cloud_provider: ["aws", "gcp", "azure"],
|
|
352
|
+
docs_informed: [false],
|
|
352
353
|
}
|
|
353
354
|
},
|
|
354
355
|
{
|
|
@@ -363,49 +364,66 @@ const config = {
|
|
|
363
364
|
event: "alert triggered",
|
|
364
365
|
weight: 12,
|
|
365
366
|
properties: {
|
|
366
|
-
alert_id:
|
|
367
|
+
alert_id: alertIds,
|
|
367
368
|
severity: ["info", "warning", "critical", "emergency"],
|
|
368
369
|
alert_type: ["cpu", "memory", "latency", "error_rate", "disk", "network"],
|
|
369
|
-
service_id:
|
|
370
|
+
service_id: serviceIds,
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
event: "incident created",
|
|
375
|
+
weight: 1,
|
|
376
|
+
properties: {
|
|
377
|
+
escalation_level: ["P1", "P2"],
|
|
378
|
+
teams_paged: u.weighNumRange(1, 5),
|
|
379
|
+
incident_id: () => `inc_${v.uid(8)}`,
|
|
380
|
+
original_severity: ["critical", "emergency"],
|
|
381
|
+
original_alert_type: ["cpu", "memory", "latency", "error_rate", "disk", "network"],
|
|
382
|
+
service_id: serviceIds,
|
|
383
|
+
auto_escalated: [true],
|
|
370
384
|
}
|
|
371
385
|
},
|
|
372
386
|
{
|
|
373
387
|
event: "alert acknowledged",
|
|
374
388
|
weight: 8,
|
|
375
389
|
properties: {
|
|
376
|
-
alert_id:
|
|
390
|
+
alert_id: alertIds,
|
|
377
391
|
response_time_mins: u.weighNumRange(1, 120),
|
|
378
392
|
acknowledged_by_role: ["engineer", "sre", "manager", "oncall"],
|
|
393
|
+
integrated_team: [false],
|
|
379
394
|
}
|
|
380
395
|
},
|
|
381
396
|
{
|
|
382
397
|
event: "alert resolved",
|
|
383
398
|
weight: 7,
|
|
384
399
|
properties: {
|
|
385
|
-
alert_id:
|
|
400
|
+
alert_id: alertIds,
|
|
386
401
|
resolution_time_mins: u.weighNumRange(5, 1440),
|
|
387
402
|
root_cause: ["config_change", "capacity", "bug", "dependency", "network"],
|
|
403
|
+
integrated_team: [false],
|
|
388
404
|
}
|
|
389
405
|
},
|
|
390
406
|
{
|
|
391
407
|
event: "deployment pipeline run",
|
|
392
408
|
weight: 9,
|
|
393
409
|
properties: {
|
|
394
|
-
pipeline_id:
|
|
410
|
+
pipeline_id: pipelineIds,
|
|
395
411
|
status: ["success", "failed", "cancelled"],
|
|
396
412
|
duration_sec: u.weighNumRange(30, 1800),
|
|
397
413
|
commit_count: u.weighNumRange(1, 20),
|
|
414
|
+
recovery_deployment: [false],
|
|
398
415
|
}
|
|
399
416
|
},
|
|
400
417
|
{
|
|
401
418
|
event: "infrastructure scaled",
|
|
402
419
|
weight: 5,
|
|
403
420
|
properties: {
|
|
404
|
-
service_id:
|
|
405
|
-
scale_direction:
|
|
421
|
+
service_id: serviceIds,
|
|
422
|
+
scale_direction: ["down", "down", "down", "down", "down", "down", "up"],
|
|
406
423
|
previous_capacity: u.weighNumRange(1, 100),
|
|
407
424
|
new_capacity: u.weighNumRange(1, 100),
|
|
408
|
-
auto_scaled:
|
|
425
|
+
auto_scaled: [false, false, false, false, false, false, true],
|
|
426
|
+
cost_reaction: [false],
|
|
409
427
|
}
|
|
410
428
|
},
|
|
411
429
|
{
|
|
@@ -415,6 +433,8 @@ const config = {
|
|
|
415
433
|
report_period: ["daily", "weekly", "monthly"],
|
|
416
434
|
total_cost: u.weighNumRange(100, 50000),
|
|
417
435
|
cost_change_percent: u.weighNumRange(-30, 50),
|
|
436
|
+
cost_alert: [false],
|
|
437
|
+
budget_exceeded: [false],
|
|
418
438
|
}
|
|
419
439
|
},
|
|
420
440
|
{
|
|
@@ -423,6 +443,8 @@ const config = {
|
|
|
423
443
|
properties: {
|
|
424
444
|
role: ["admin", "editor", "viewer", "billing"],
|
|
425
445
|
invitation_method: ["email", "sso", "slack"],
|
|
446
|
+
quarter_end_push: [false],
|
|
447
|
+
duplicate_invite: [false],
|
|
426
448
|
}
|
|
427
449
|
},
|
|
428
450
|
{
|
|
@@ -446,9 +468,9 @@ const config = {
|
|
|
446
468
|
event: "runbook executed",
|
|
447
469
|
weight: 3,
|
|
448
470
|
properties: {
|
|
449
|
-
runbook_id:
|
|
471
|
+
runbook_id: runbookIds,
|
|
450
472
|
trigger: ["manual", "automated", "alert_triggered"],
|
|
451
|
-
success:
|
|
473
|
+
success: [false, false, false, false, false, false, true],
|
|
452
474
|
}
|
|
453
475
|
},
|
|
454
476
|
{
|
|
@@ -457,6 +479,7 @@ const config = {
|
|
|
457
479
|
properties: {
|
|
458
480
|
event_type: ["invoice_generated", "payment_received", "payment_failed", "plan_upgraded", "plan_downgraded"],
|
|
459
481
|
amount: u.weighNumRange(99, 25000),
|
|
482
|
+
quarter_end_push: [false],
|
|
460
483
|
}
|
|
461
484
|
},
|
|
462
485
|
{
|
|
@@ -475,7 +498,7 @@ const config = {
|
|
|
475
498
|
endpoint: ["/deploy", "/status", "/metrics", "/alerts", "/config", "/billing"],
|
|
476
499
|
method: ["GET", "POST", "PUT", "DELETE"],
|
|
477
500
|
response_time_ms: u.weighNumRange(10, 5000),
|
|
478
|
-
status_code:
|
|
501
|
+
status_code: [200, 201, 400, 401, 403, 500, 503],
|
|
479
502
|
}
|
|
480
503
|
},
|
|
481
504
|
{
|
|
@@ -491,21 +514,26 @@ const config = {
|
|
|
491
514
|
weight: 4,
|
|
492
515
|
properties: {
|
|
493
516
|
flag_name: () => `flag_${chance.word()}`,
|
|
494
|
-
new_state:
|
|
517
|
+
new_state: ["disabled", "disabled", "disabled", "disabled", "disabled", "disabled", "enabled"],
|
|
495
518
|
environment: ["production", "staging", "dev"],
|
|
496
519
|
}
|
|
497
520
|
},
|
|
498
521
|
],
|
|
499
522
|
|
|
500
523
|
superProps: {
|
|
501
|
-
plan_tier:
|
|
524
|
+
plan_tier: ["free", "free", "team", "team", "business", "enterprise"],
|
|
502
525
|
cloud_provider: ["aws", "gcp", "azure", "multi_cloud"],
|
|
503
526
|
},
|
|
504
527
|
|
|
505
528
|
userProps: {
|
|
506
|
-
company_size:
|
|
529
|
+
company_size: ["startup", "startup", "smb", "mid_market", "enterprise"],
|
|
507
530
|
primary_role: ["engineer", "sre", "devops", "manager", "executive"],
|
|
508
531
|
team_name: ["Platform", "Backend", "Frontend", "Data", "Security", "Infrastructure"],
|
|
532
|
+
churned_account: [false],
|
|
533
|
+
seat_count: [1],
|
|
534
|
+
annual_contract_value: [0],
|
|
535
|
+
customer_success_manager: [false],
|
|
536
|
+
customer_health_score: u.weighNumRange(1, 100),
|
|
509
537
|
},
|
|
510
538
|
|
|
511
539
|
groupKeys: [
|
|
@@ -564,9 +592,8 @@ const config = {
|
|
|
564
592
|
// 50% of the time duplicate the invite event (hiring push)
|
|
565
593
|
if (chance.bool({ likelihood: 50 })) {
|
|
566
594
|
return {
|
|
567
|
-
|
|
595
|
+
...record,
|
|
568
596
|
time: EVENT_TIME.add(chance.integer({ min: 1, max: 60 }), "minutes").toISOString(),
|
|
569
|
-
user_id: record.user_id,
|
|
570
597
|
role: chance.pickone(["editor", "viewer"]),
|
|
571
598
|
invitation_method: chance.pickone(["email", "sso", "slack"]),
|
|
572
599
|
quarter_end_push: true,
|
|
@@ -589,15 +616,13 @@ const config = {
|
|
|
589
616
|
if ((severity === "critical" || severity === "emergency") && chance.bool({ likelihood: 30 })) {
|
|
590
617
|
// REPLACE the event entirely with an "incident created" event
|
|
591
618
|
return {
|
|
619
|
+
...record,
|
|
592
620
|
event: "incident created",
|
|
593
|
-
time: record.time,
|
|
594
|
-
user_id: record.user_id,
|
|
595
621
|
escalation_level: chance.pickone(["P1", "P2"]),
|
|
596
622
|
teams_paged: chance.integer({ min: 1, max: 5 }),
|
|
597
623
|
incident_id: `inc_${v.uid(8)}`,
|
|
598
624
|
original_severity: severity,
|
|
599
625
|
original_alert_type: record.alert_type,
|
|
600
|
-
service_id: record.service_id,
|
|
601
626
|
auto_escalated: true,
|
|
602
627
|
};
|
|
603
628
|
}
|
|
@@ -738,10 +763,11 @@ const config = {
|
|
|
738
763
|
if (bestPracticesCount >= 3) {
|
|
739
764
|
const extraDeploys = chance.integer({ min: 2, max: 3 });
|
|
740
765
|
const lastEvent = userEvents[userEvents.length - 1];
|
|
741
|
-
|
|
766
|
+
const deployTemplate = userEvents.find(e => e.event === "service deployed");
|
|
767
|
+
if (lastEvent && deployTemplate) {
|
|
742
768
|
for (let i = 0; i < extraDeploys; i++) {
|
|
743
769
|
const deployEvent = {
|
|
744
|
-
|
|
770
|
+
...deployTemplate,
|
|
745
771
|
time: dayjs(lastEvent.time).add(chance.integer({ min: 1, max: 48 }), "hours").toISOString(),
|
|
746
772
|
user_id: lastEvent.user_id,
|
|
747
773
|
service_id: chance.pickone(serviceIds),
|