@rlynjb/aptkit-core 0.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 +19 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.js +9 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/README.md +13 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/categories.d.ts +11 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/categories.js +100 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/fixture-provider.d.ts +10 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/fixture-provider.js +18 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/index.d.ts +6 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/index.js +6 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/monitoring-agent.d.ts +32 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/monitoring-agent.js +88 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/schema-summary.d.ts +2 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/schema-summary.js +7 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/types.d.ts +32 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/types.js +1 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/validate.d.ts +9 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/dist/src/validate.js +34 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/fixtures/promoted/sp-revenue-monitoring-fixture-promoted-2026-06-18-18-37-26.json +229 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/fixtures/sp-revenue-monitoring.json +136 -0
- package/node_modules/@aptkit/agent-anomaly-monitoring/package.json +33 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/README.md +11 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/diagnostic-agent.d.ts +27 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/diagnostic-agent.js +95 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/fixture-provider.d.ts +10 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/fixture-provider.js +18 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/index.d.ts +5 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/index.js +5 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/schema-summary.d.ts +1 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/schema-summary.js +1 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/types.d.ts +37 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/types.js +1 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/validate.d.ts +10 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/dist/src/validate.js +49 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/fixtures/promoted/sp-revenue-diagnostic-fixture-promoted-2026-06-18-19-04-28.json +230 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/fixtures/sp-revenue-diagnostic.json +148 -0
- package/node_modules/@aptkit/agent-diagnostic-investigation/package.json +33 -0
- package/node_modules/@aptkit/agent-query/README.md +11 -0
- package/node_modules/@aptkit/agent-query/dist/src/fixture-provider.d.ts +10 -0
- package/node_modules/@aptkit/agent-query/dist/src/fixture-provider.js +18 -0
- package/node_modules/@aptkit/agent-query/dist/src/index.d.ts +6 -0
- package/node_modules/@aptkit/agent-query/dist/src/index.js +6 -0
- package/node_modules/@aptkit/agent-query/dist/src/intent.d.ts +6 -0
- package/node_modules/@aptkit/agent-query/dist/src/intent.js +23 -0
- package/node_modules/@aptkit/agent-query/dist/src/query-agent.d.ts +27 -0
- package/node_modules/@aptkit/agent-query/dist/src/query-agent.js +81 -0
- package/node_modules/@aptkit/agent-query/dist/src/schema-summary.d.ts +1 -0
- package/node_modules/@aptkit/agent-query/dist/src/schema-summary.js +1 -0
- package/node_modules/@aptkit/agent-query/dist/src/types.d.ts +5 -0
- package/node_modules/@aptkit/agent-query/dist/src/types.js +1 -0
- package/node_modules/@aptkit/agent-query/dist/src/validate.d.ts +7 -0
- package/node_modules/@aptkit/agent-query/dist/src/validate.js +9 -0
- package/node_modules/@aptkit/agent-query/fixtures/promoted/revenue-by-state-query-fixture-promoted-2026-06-18-19-29-11.json +138 -0
- package/node_modules/@aptkit/agent-query/fixtures/revenue-by-state-query.json +79 -0
- package/node_modules/@aptkit/agent-query/package.json +33 -0
- package/node_modules/@aptkit/agent-recommendation/README.md +109 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/fixture-provider.d.ts +10 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/fixture-provider.js +18 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/index.d.ts +4 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/index.js +4 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/recommendation-agent.d.ts +30 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/recommendation-agent.js +85 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/schema-summary.d.ts +1 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/schema-summary.js +1 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/types.d.ts +68 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/types.js +3 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/validate.d.ts +3 -0
- package/node_modules/@aptkit/agent-recommendation/dist/src/validate.js +54 -0
- package/node_modules/@aptkit/agent-recommendation/fixtures/electronics-spike.json +84 -0
- package/node_modules/@aptkit/agent-recommendation/fixtures/promoted/voucher-dropoff-w10-on-openai-promoted-2026-06-18-16-53-02.json +166 -0
- package/node_modules/@aptkit/agent-recommendation/fixtures/promoted/voucher-dropoff-w10-on-openai-promoted-2026-06-18-17-20-55.json +157 -0
- package/node_modules/@aptkit/agent-recommendation/fixtures/sp-revenue-drop.json +83 -0
- package/node_modules/@aptkit/agent-recommendation/fixtures/voucher-dropoff.json +84 -0
- package/node_modules/@aptkit/agent-recommendation/package.json +34 -0
- package/node_modules/@aptkit/context/README.md +15 -0
- package/node_modules/@aptkit/context/dist/src/index.d.ts +2 -0
- package/node_modules/@aptkit/context/dist/src/index.js +2 -0
- package/node_modules/@aptkit/context/dist/src/workspace-descriptor.d.ts +25 -0
- package/node_modules/@aptkit/context/dist/src/workspace-descriptor.js +1 -0
- package/node_modules/@aptkit/context/dist/src/workspace-summary.d.ts +9 -0
- package/node_modules/@aptkit/context/dist/src/workspace-summary.js +38 -0
- package/node_modules/@aptkit/context/package.json +24 -0
- package/node_modules/@aptkit/evals/dist/src/assertions.d.ts +13 -0
- package/node_modules/@aptkit/evals/dist/src/assertions.js +351 -0
- package/node_modules/@aptkit/evals/dist/src/detection-scorer.d.ts +25 -0
- package/node_modules/@aptkit/evals/dist/src/detection-scorer.js +72 -0
- package/node_modules/@aptkit/evals/dist/src/index.d.ts +3 -0
- package/node_modules/@aptkit/evals/dist/src/index.js +3 -0
- package/node_modules/@aptkit/evals/dist/src/replay-runner.d.ts +29 -0
- package/node_modules/@aptkit/evals/dist/src/replay-runner.js +72 -0
- package/node_modules/@aptkit/evals/dist/src/structural-diff.d.ts +50 -0
- package/node_modules/@aptkit/evals/dist/src/structural-diff.js +143 -0
- package/node_modules/@aptkit/evals/package.json +27 -0
- package/node_modules/@aptkit/prompts/README.md +7 -0
- package/node_modules/@aptkit/prompts/dist/src/diagnostic.d.ts +3 -0
- package/node_modules/@aptkit/prompts/dist/src/diagnostic.js +85 -0
- package/node_modules/@aptkit/prompts/dist/src/index.d.ts +5 -0
- package/node_modules/@aptkit/prompts/dist/src/index.js +5 -0
- package/node_modules/@aptkit/prompts/dist/src/monitoring.d.ts +3 -0
- package/node_modules/@aptkit/prompts/dist/src/monitoring.js +57 -0
- package/node_modules/@aptkit/prompts/dist/src/query.d.ts +3 -0
- package/node_modules/@aptkit/prompts/dist/src/query.js +86 -0
- package/node_modules/@aptkit/prompts/dist/src/recommendation.d.ts +3 -0
- package/node_modules/@aptkit/prompts/dist/src/recommendation.js +110 -0
- package/node_modules/@aptkit/prompts/dist/src/types.d.ts +21 -0
- package/node_modules/@aptkit/prompts/dist/src/types.js +6 -0
- package/node_modules/@aptkit/prompts/package.json +24 -0
- package/node_modules/@aptkit/runtime/dist/src/events.d.ts +44 -0
- package/node_modules/@aptkit/runtime/dist/src/events.js +3 -0
- package/node_modules/@aptkit/runtime/dist/src/index.d.ts +6 -0
- package/node_modules/@aptkit/runtime/dist/src/index.js +6 -0
- package/node_modules/@aptkit/runtime/dist/src/json-output.d.ts +10 -0
- package/node_modules/@aptkit/runtime/dist/src/json-output.js +32 -0
- package/node_modules/@aptkit/runtime/dist/src/model-provider.d.ts +49 -0
- package/node_modules/@aptkit/runtime/dist/src/model-provider.js +1 -0
- package/node_modules/@aptkit/runtime/dist/src/ndjson-stream.d.ts +43 -0
- package/node_modules/@aptkit/runtime/dist/src/ndjson-stream.js +128 -0
- package/node_modules/@aptkit/runtime/dist/src/run-agent-loop.d.ts +42 -0
- package/node_modules/@aptkit/runtime/dist/src/run-agent-loop.js +138 -0
- package/node_modules/@aptkit/runtime/dist/src/usage-ledger.d.ts +29 -0
- package/node_modules/@aptkit/runtime/dist/src/usage-ledger.js +61 -0
- package/node_modules/@aptkit/runtime/package.json +23 -0
- package/node_modules/@aptkit/tools/dist/src/coverage-gate.d.ts +32 -0
- package/node_modules/@aptkit/tools/dist/src/coverage-gate.js +43 -0
- package/node_modules/@aptkit/tools/dist/src/index.d.ts +3 -0
- package/node_modules/@aptkit/tools/dist/src/index.js +3 -0
- package/node_modules/@aptkit/tools/dist/src/tool-policy.d.ts +9 -0
- package/node_modules/@aptkit/tools/dist/src/tool-policy.js +11 -0
- package/node_modules/@aptkit/tools/dist/src/tool-registry.d.ts +27 -0
- package/node_modules/@aptkit/tools/dist/src/tool-registry.js +25 -0
- package/node_modules/@aptkit/tools/package.json +26 -0
- package/package.json +53 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "electronics-spike-w2",
|
|
3
|
+
"description": "Fixture derived from Blooming Insights recommendation regression case 07-recommendation-electronics.",
|
|
4
|
+
"workspace": {
|
|
5
|
+
"projectId": "olist",
|
|
6
|
+
"projectName": "Olist Brazilian ecommerce fixture",
|
|
7
|
+
"events": [
|
|
8
|
+
{ "name": "order", "properties": ["state", "category", "purchase_ts", "price_brl"], "eventCount": 0 },
|
|
9
|
+
{ "name": "payment", "properties": ["type", "installments", "value_brl"], "eventCount": 0 }
|
|
10
|
+
],
|
|
11
|
+
"customerProperties": ["state", "city"],
|
|
12
|
+
"catalogs": [{ "id": "products", "name": "Products" }],
|
|
13
|
+
"totalCustomers": 0,
|
|
14
|
+
"totalEvents": 0,
|
|
15
|
+
"oldestTimestamp": null,
|
|
16
|
+
"dataHorizon": { "from": "2025-12-01", "to": "2026-06-01", "durationDays": 182 }
|
|
17
|
+
},
|
|
18
|
+
"anomaly": {
|
|
19
|
+
"metric": "order_count",
|
|
20
|
+
"scope": ["category:electronics"],
|
|
21
|
+
"change": {
|
|
22
|
+
"value": 150,
|
|
23
|
+
"direction": "up",
|
|
24
|
+
"baseline": "week 2 (2025-12-08 to 2025-12-15) vs 12-week baseline"
|
|
25
|
+
},
|
|
26
|
+
"severity": "positive",
|
|
27
|
+
"evidence": [],
|
|
28
|
+
"impact": "Electronics order count spiked about 2.5x across multiple states."
|
|
29
|
+
},
|
|
30
|
+
"diagnosis": {
|
|
31
|
+
"conclusion": "Electronics order count spiked about 2.5x in week 2 versus baseline. The spike is broad across states, revenue scaled with order count, and AOV stayed stable, so this appears to be a real demand surge rather than a single large-buyer artifact.",
|
|
32
|
+
"evidence": [
|
|
33
|
+
"get_anomaly_context(metric=order_count, dimension=category, segment=electronics) returned pct_change=+1.50 for week 2.",
|
|
34
|
+
"SP, RJ, MG, RS, and PR were all up 100-200% in week 2.",
|
|
35
|
+
"Revenue scaled with order count, with AOV roughly flat.",
|
|
36
|
+
"No other category moved with electronics that week."
|
|
37
|
+
],
|
|
38
|
+
"hypothesesConsidered": [
|
|
39
|
+
{
|
|
40
|
+
"hypothesis": "Single large buyer distorted the metric",
|
|
41
|
+
"supported": false,
|
|
42
|
+
"reasoning": "The spike was distributed across states and many customers."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"hypothesis": "Electronics-specific promotional or seasonal pull",
|
|
46
|
+
"supported": true,
|
|
47
|
+
"reasoning": "The category moved broadly while other categories did not."
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"affectedCustomers": {
|
|
51
|
+
"count": 8800,
|
|
52
|
+
"segmentDescription": "Electronics buyers across BR states in week 2"
|
|
53
|
+
},
|
|
54
|
+
"confidence": "medium"
|
|
55
|
+
},
|
|
56
|
+
"tools": [
|
|
57
|
+
{ "name": "list_segmentations", "description": "List existing segments", "inputSchema": { "type": "object" }, "result": { "data": [{ "name": "electronics buyers" }, { "name": "recent accessory buyers" }] } },
|
|
58
|
+
{ "name": "list_email_campaigns", "description": "List email campaigns", "inputSchema": { "type": "object" }, "result": { "data": [{ "name": "holiday electronics promo" }] } },
|
|
59
|
+
{ "name": "list_recommendations", "description": "List recommendation models", "inputSchema": { "type": "object" }, "result": { "data": [{ "name": "accessory cross-sell" }] } }
|
|
60
|
+
],
|
|
61
|
+
"modelResponses": [
|
|
62
|
+
{
|
|
63
|
+
"content": [
|
|
64
|
+
{ "type": "tool_use", "id": "tool-1", "name": "list_segmentations", "input": { "project_id": "olist" } },
|
|
65
|
+
{ "type": "tool_use", "id": "tool-2", "name": "list_recommendations", "input": { "project_id": "olist" } }
|
|
66
|
+
],
|
|
67
|
+
"usage": { "inputTokens": 910, "outputTokens": 80 },
|
|
68
|
+
"model": "fixture-model"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"content": [
|
|
72
|
+
{
|
|
73
|
+
"type": "text",
|
|
74
|
+
"text": "```json\n[{\"title\":\"Cross-sell accessories to week-2 electronics buyers\",\"rationale\":\"The diagnosis shows a real electronics demand surge with stable AOV. A follow-on campaign can turn one-time electronics purchases into higher LTV by promoting complementary accessories while purchase recency is high.\",\"bloomreachFeature\":\"campaign\",\"steps\":[\"Build a segment of customers who bought electronics in week 2.\",\"Send a 3-week accessory campaign featuring cables, cases, warranties, and setup bundles.\",\"Exclude customers who already bought accessories after the electronics order.\"],\"estimatedImpact\":{\"range\":\"+$70k - $140k incremental revenue over 21 days\",\"rangeUsd\":{\"low\":70000,\"high\":140000},\"assumption\":\"Assumes 5-10% accessory attach rate on 8800 electronics buyers at about $160 accessory order value.\"},\"effort\":\"medium\",\"timeToSetUpMinutes\":120,\"readResultInDays\":21,\"prerequisites\":[{\"label\":\"electronics buyer segment available\",\"satisfied\":true},{\"label\":\"accessory recommendation model available\",\"satisfied\":true}],\"successMetric\":\"Accessory attach rate rises from about 3% baseline to 5-10% over 21 days.\",\"confidence\":\"medium\"},{\"title\":\"Identify top electronics SKUs behind the spike\",\"rationale\":\"The spike looks real, but the reusable playbook depends on whether a few SKUs or the whole category drove it. A segment analysis gates whether to rerun a promotion or build a seasonal calendar trigger.\",\"bloomreachFeature\":\"segment\",\"steps\":[\"Create a week-2 electronics order segment.\",\"Rank SKUs by order count and compare their share to baseline.\",\"Classify the spike as concentrated promotion or broad seasonal pull.\"],\"estimatedImpact\":{\"range\":\"Diagnostic: gates repeat-promo investment\",\"assumption\":\"No direct lift; prevents scaling the wrong electronics playbook.\"},\"effort\":\"low\",\"timeToSetUpMinutes\":30,\"readResultInDays\":2,\"prerequisites\":[{\"label\":\"SKU-level order data accessible\",\"satisfied\":true}],\"successMetric\":\"Top-10 SKU share classified as concentrated above 50% or broad below 30%.\",\"confidence\":\"high\"}]\n```"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"usage": { "inputTokens": 1350, "outputTokens": 610 },
|
|
78
|
+
"model": "fixture-model"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"eval": {
|
|
82
|
+
"requiredFields": ["0.title", "0.rationale", "0.bloomreachFeature", "0.steps", "0.estimatedImpact", "0.confidence"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "voucher-dropoff-w10-on-openai-promoted",
|
|
3
|
+
"description": "Promoted deterministic fixture from openai replay artifact. Source fixture: voucher-dropoff-w10-on. Replay created at: 2026-06-18T16:53:02.698Z.",
|
|
4
|
+
"workspace": {
|
|
5
|
+
"projectId": "olist",
|
|
6
|
+
"projectName": "Olist Brazilian ecommerce fixture",
|
|
7
|
+
"events": [
|
|
8
|
+
{
|
|
9
|
+
"name": "order",
|
|
10
|
+
"properties": [
|
|
11
|
+
"state",
|
|
12
|
+
"category",
|
|
13
|
+
"purchase_ts",
|
|
14
|
+
"price_brl"
|
|
15
|
+
],
|
|
16
|
+
"eventCount": 0
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "payment",
|
|
20
|
+
"properties": [
|
|
21
|
+
"type",
|
|
22
|
+
"installments",
|
|
23
|
+
"value_brl"
|
|
24
|
+
],
|
|
25
|
+
"eventCount": 0
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"customerProperties": [
|
|
29
|
+
"state",
|
|
30
|
+
"city"
|
|
31
|
+
],
|
|
32
|
+
"catalogs": [],
|
|
33
|
+
"totalCustomers": 0,
|
|
34
|
+
"totalEvents": 0,
|
|
35
|
+
"oldestTimestamp": null,
|
|
36
|
+
"dataHorizon": {
|
|
37
|
+
"from": "2025-12-01",
|
|
38
|
+
"to": "2026-06-01",
|
|
39
|
+
"durationDays": 182
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"anomaly": {
|
|
43
|
+
"metric": "payment_value",
|
|
44
|
+
"scope": [
|
|
45
|
+
"payment_type:voucher"
|
|
46
|
+
],
|
|
47
|
+
"change": {
|
|
48
|
+
"value": 95,
|
|
49
|
+
"direction": "down",
|
|
50
|
+
"baseline": "weeks 10-26 vs weeks 1-9 baseline"
|
|
51
|
+
},
|
|
52
|
+
"severity": "critical",
|
|
53
|
+
"evidence": [],
|
|
54
|
+
"impact": "Voucher payment value collapsed to about 5% of baseline and stayed depressed."
|
|
55
|
+
},
|
|
56
|
+
"diagnosis": {
|
|
57
|
+
"conclusion": "Voucher payment volume collapsed to roughly 5% of baseline starting week 10 and remained depressed through the end of the data horizon. Credit card and boleto did not absorb the lost volume, and order count fell, so this is likely a program-level voucher change rather than clean substitution.",
|
|
58
|
+
"evidence": [
|
|
59
|
+
"get_anomaly_context(metric=payment_value, dimension=payment_type, segment=voucher) returned pct_change=-0.95 for weeks 10-26.",
|
|
60
|
+
"Credit_card and boleto did not rise enough to absorb the lost voucher volume.",
|
|
61
|
+
"Total order_count was about 8% below baseline after the voucher cliff.",
|
|
62
|
+
"The drop was uniform across SP, RJ, and MG."
|
|
63
|
+
],
|
|
64
|
+
"hypothesesConsidered": [
|
|
65
|
+
{
|
|
66
|
+
"hypothesis": "Voucher volume substituted to credit card or boleto",
|
|
67
|
+
"supported": false,
|
|
68
|
+
"reasoning": "Other payment types did not rise and total order count fell."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"hypothesis": "Program-level voucher change",
|
|
72
|
+
"supported": true,
|
|
73
|
+
"reasoning": "The cliff-shaped onset and sustained cross-state impact fit suspension, expiry, or restriction."
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"affectedCustomers": {
|
|
77
|
+
"count": 12500,
|
|
78
|
+
"segmentDescription": "Customers who previously used voucher payment in weeks 1-9"
|
|
79
|
+
},
|
|
80
|
+
"confidence": "medium"
|
|
81
|
+
},
|
|
82
|
+
"tools": [
|
|
83
|
+
{
|
|
84
|
+
"name": "list_voucher_pools",
|
|
85
|
+
"description": "List voucher pools",
|
|
86
|
+
"inputSchema": {
|
|
87
|
+
"type": "object"
|
|
88
|
+
},
|
|
89
|
+
"result": {
|
|
90
|
+
"data": []
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "list_email_campaigns",
|
|
95
|
+
"description": "List email campaigns",
|
|
96
|
+
"inputSchema": {
|
|
97
|
+
"type": "object"
|
|
98
|
+
},
|
|
99
|
+
"result": {
|
|
100
|
+
"data": [
|
|
101
|
+
{
|
|
102
|
+
"name": "inactive customer broadcast"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "get_frequency_policies",
|
|
109
|
+
"description": "List frequency policies",
|
|
110
|
+
"inputSchema": {
|
|
111
|
+
"type": "object"
|
|
112
|
+
},
|
|
113
|
+
"result": {
|
|
114
|
+
"data": [
|
|
115
|
+
{
|
|
116
|
+
"name": "one marketing message per week"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"modelResponses": [
|
|
123
|
+
{
|
|
124
|
+
"content": [
|
|
125
|
+
{
|
|
126
|
+
"type": "text",
|
|
127
|
+
"text": "```json\n[\n {\n \"title\": \"Reinstate or Launch New Voucher Incentive for Lapsed Voucher Users\",\n \"rationale\": \"Since voucher usage has collapsed and was not replaced by other payment types, reinstating a voucher offer can help recover lost order volume from affected customers who previously relied on vouchers. The order count decline suggests many of these users have likely lapsed, representing material lost revenue.\",\n \"bloomreachFeature\": \"voucher\",\n \"steps\": [\n \"Create a new voucher pool or campaign targeting customers who used vouchers in weeks 1-9 but stopped purchasing after week 10.\",\n \"Design the voucher to be attractive enough to re-engage this audience (e.g., similar or better than previous offers, possibly with a limited-time urgency).\",\n \"Communicate the voucher via email or SMS to maximize reach and conversion.\"\n ],\n \"estimatedImpact\": {\n \"range\": \"Moderate to High (USD 10,000 - 40,000 regained revenue)\",\n \"rangeUsd\": {\n \"low\": 10000,\n \"high\": 40000\n },\n \"assumption\": \"Assumes recapturing 20 - 50% of the estimated $45,000+ in lost voucher-order GMV (baseline $1,500/week x 16 weeks x 12500 customers)\"\n },\n \"confidence\": \"high\",\n \"effort\": \"medium\",\n \"timeToSetUpMinutes\": 60,\n \"readResultInDays\": 14,\n \"prerequisites\": [\n {\n \"label\": \"Voucher engine configured\",\n \"satisfied\": true\n },\n {\n \"label\": \"Segment of lapsed voucher users available\",\n \"satisfied\": true\n }\n ],\n \"successMetric\": \"Number of recovered orders from targeted lapsed voucher users; baseline: 0/wk, target: +150/wk\"\n },\n {\n \"title\": \"Segment Analysis: Identify and Profile Lapsed Voucher Customers\",\n \"rationale\": \"A well-defined segment of customers who stopped ordering when voucher incentives ended is critical for targeted recovery and ongoing program design. Understanding their value and response patterns informs further interventions.\",\n \"bloomreachFeature\": \"segment\",\n \"steps\": [\n \"Define a segment encompassing all customers who used voucher payments in weeks 1-9 but placed zero orders in weeks 10-26.\",\n \"Analyze this segment for order value, category mix, and location to prioritize outreach.\",\n \"Feed this segment into marketing or win-back initiatives.\"\n ],\n \"estimatedImpact\": \"Medium; enables more effective targeting for campaigns and reduces wasted marketing spend.\",\n \"confidence\": \"high\",\n \"effort\": \"low\",\n \"timeToSetUpMinutes\": 30,\n \"readResultInDays\": 3,\n \"prerequisites\": [\n {\n \"label\": \"Customer order-by-payment-type data available\",\n \"satisfied\": true\n }\n ],\n \"successMetric\": \"Segment accuracy and percentage overlap with lost voucher revenue group; baseline: n/a, target: >85%\"\n },\n {\n \"title\": \"A/B Test: Voucher Value or Friction Experiment\",\n \"rationale\": \"Run an experiment restoring voucher value or relaxing criteria (e.g., minimum spend, eligible SKUs) for a sample of lapsed users to validate whether incentive structure - not external factors - caused the drop.\",\n \"bloomreachFeature\": \"experiment\",\n \"steps\": [\n \"Randomly assign lapsed voucher users to test and control groups.\",\n \"Offer the test group an updated voucher similar to the previous baseline program.\",\n \"Monitor recovery of orders and compare to control to assess direct causality and incremental lift.\"\n ],\n \"estimatedImpact\": \"Medium to high if program-level changes caused the drop; validates full-scale reinstatement potential.\",\n \"confidence\": \"medium\",\n \"effort\": \"medium\",\n \"timeToSetUpMinutes\": 90,\n \"readResultInDays\": 21,\n \"prerequisites\": [\n {\n \"label\": \"Ability to randomize voucher distribution\",\n \"satisfied\": true\n },\n {\n \"label\": \"Segment of lapsed voucher users identified\",\n \"satisfied\": false\n }\n ],\n \"successMetric\": \"Test group uplift over control in new orders; baseline: 0, target: +10% or more\"\n }\n]\n```"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"usage": {
|
|
131
|
+
"inputTokens": 1052,
|
|
132
|
+
"outputTokens": 915,
|
|
133
|
+
"estimated": true
|
|
134
|
+
},
|
|
135
|
+
"model": "promoted-openai-replay"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"eval": {
|
|
139
|
+
"requiredFields": [
|
|
140
|
+
"0.title",
|
|
141
|
+
"0.rationale",
|
|
142
|
+
"0.bloomreachFeature",
|
|
143
|
+
"0.steps",
|
|
144
|
+
"0.estimatedImpact",
|
|
145
|
+
"0.confidence"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"expectations": {
|
|
149
|
+
"requiredFeatures": [
|
|
150
|
+
"voucher"
|
|
151
|
+
],
|
|
152
|
+
"requiredText": [
|
|
153
|
+
"lapsed voucher users",
|
|
154
|
+
"experiment"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"promotion": {
|
|
158
|
+
"sourceArtifact": "artifacts/replays/2026-06-18T16-53-02-698Z-voucher-dropoff-w10-on-openai.json",
|
|
159
|
+
"sourceProvider": {
|
|
160
|
+
"id": "openai",
|
|
161
|
+
"model": "gpt-4.1"
|
|
162
|
+
},
|
|
163
|
+
"promotedAt": "2026-06-18T17:01:37.868Z",
|
|
164
|
+
"note": "This fixture captures the final replay answer deterministically; it does not reconstruct the live provider tool loop."
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "voucher-dropoff-w10-on-openai-promoted",
|
|
3
|
+
"description": "Promoted deterministic fixture from openai replay artifact. Source fixture: voucher-dropoff-w10-on. Replay created at: 2026-06-18T17:20:55.422Z.",
|
|
4
|
+
"workspace": {
|
|
5
|
+
"projectId": "olist",
|
|
6
|
+
"projectName": "Olist Brazilian ecommerce fixture",
|
|
7
|
+
"events": [
|
|
8
|
+
{
|
|
9
|
+
"name": "order",
|
|
10
|
+
"properties": [
|
|
11
|
+
"state",
|
|
12
|
+
"category",
|
|
13
|
+
"purchase_ts",
|
|
14
|
+
"price_brl"
|
|
15
|
+
],
|
|
16
|
+
"eventCount": 0
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "payment",
|
|
20
|
+
"properties": [
|
|
21
|
+
"type",
|
|
22
|
+
"installments",
|
|
23
|
+
"value_brl"
|
|
24
|
+
],
|
|
25
|
+
"eventCount": 0
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"customerProperties": [
|
|
29
|
+
"state",
|
|
30
|
+
"city"
|
|
31
|
+
],
|
|
32
|
+
"catalogs": [],
|
|
33
|
+
"totalCustomers": 0,
|
|
34
|
+
"totalEvents": 0,
|
|
35
|
+
"oldestTimestamp": null,
|
|
36
|
+
"dataHorizon": {
|
|
37
|
+
"from": "2025-12-01",
|
|
38
|
+
"to": "2026-06-01",
|
|
39
|
+
"durationDays": 182
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"anomaly": {
|
|
43
|
+
"metric": "payment_value",
|
|
44
|
+
"scope": [
|
|
45
|
+
"payment_type:voucher"
|
|
46
|
+
],
|
|
47
|
+
"change": {
|
|
48
|
+
"value": 95,
|
|
49
|
+
"direction": "down",
|
|
50
|
+
"baseline": "weeks 10-26 vs weeks 1-9 baseline"
|
|
51
|
+
},
|
|
52
|
+
"severity": "critical",
|
|
53
|
+
"evidence": [],
|
|
54
|
+
"impact": "Voucher payment value collapsed to about 5% of baseline and stayed depressed."
|
|
55
|
+
},
|
|
56
|
+
"diagnosis": {
|
|
57
|
+
"conclusion": "Voucher payment volume collapsed to roughly 5% of baseline starting week 10 and remained depressed through the end of the data horizon. Credit card and boleto did not absorb the lost volume, and order count fell, so this is likely a program-level voucher change rather than clean substitution.",
|
|
58
|
+
"evidence": [
|
|
59
|
+
"get_anomaly_context(metric=payment_value, dimension=payment_type, segment=voucher) returned pct_change=-0.95 for weeks 10-26.",
|
|
60
|
+
"Credit_card and boleto did not rise enough to absorb the lost voucher volume.",
|
|
61
|
+
"Total order_count was about 8% below baseline after the voucher cliff.",
|
|
62
|
+
"The drop was uniform across SP, RJ, and MG."
|
|
63
|
+
],
|
|
64
|
+
"hypothesesConsidered": [
|
|
65
|
+
{
|
|
66
|
+
"hypothesis": "Voucher volume substituted to credit card or boleto",
|
|
67
|
+
"supported": false,
|
|
68
|
+
"reasoning": "Other payment types did not rise and total order count fell."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"hypothesis": "Program-level voucher change",
|
|
72
|
+
"supported": true,
|
|
73
|
+
"reasoning": "The cliff-shaped onset and sustained cross-state impact fit suspension, expiry, or restriction."
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"affectedCustomers": {
|
|
77
|
+
"count": 12500,
|
|
78
|
+
"segmentDescription": "Customers who previously used voucher payment in weeks 1-9"
|
|
79
|
+
},
|
|
80
|
+
"confidence": "medium"
|
|
81
|
+
},
|
|
82
|
+
"tools": [
|
|
83
|
+
{
|
|
84
|
+
"name": "list_voucher_pools",
|
|
85
|
+
"description": "List voucher pools",
|
|
86
|
+
"inputSchema": {
|
|
87
|
+
"type": "object"
|
|
88
|
+
},
|
|
89
|
+
"result": {
|
|
90
|
+
"data": []
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "list_email_campaigns",
|
|
95
|
+
"description": "List email campaigns",
|
|
96
|
+
"inputSchema": {
|
|
97
|
+
"type": "object"
|
|
98
|
+
},
|
|
99
|
+
"result": {
|
|
100
|
+
"data": [
|
|
101
|
+
{
|
|
102
|
+
"name": "inactive customer broadcast"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "get_frequency_policies",
|
|
109
|
+
"description": "List frequency policies",
|
|
110
|
+
"inputSchema": {
|
|
111
|
+
"type": "object"
|
|
112
|
+
},
|
|
113
|
+
"result": {
|
|
114
|
+
"data": [
|
|
115
|
+
{
|
|
116
|
+
"name": "one marketing message per week"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"modelResponses": [
|
|
123
|
+
{
|
|
124
|
+
"content": [
|
|
125
|
+
{
|
|
126
|
+
"type": "text",
|
|
127
|
+
"text": "```json\n[\n {\n \"title\": \"Reactivate Voucher Incentives for Lost Voucher Users\",\n \"rationale\": \"A sudden and sustained drop in voucher usage affected ~12,500 customers and led to an 8% overall order decline. To recover lost conversion, an automated scenario targeting voucher users pre-week 10 should reintroduce vouchers or explain changes.\",\n \"bloomreachFeature\": \"scenario\",\n \"steps\": [\n \"Define a scenario targeting customers who used vouchers in weeks 1-9 but not since week 10.\",\n \"Trigger personalized emails or SMS with a new time-limited voucher and/or messaging about ongoing incentives.\",\n \"Monitor reactivation and payment type preferences of re-engaged customers.\"\n ],\n \"estimatedImpact\": {\n \"range\": \"high (potential to recover up to 8% of lost orders)\",\n \"rangeUsd\": {\n \"low\": 25000,\n \"high\": 80000\n },\n \"assumption\": \"Assumes recovery of 20-65% of lost voucher user purchase value over the next month; number derived from baseline order drop and typical voucher-driven order value.\"\n },\n \"confidence\": \"high\",\n \"effort\": \"medium\",\n \"timeToSetUpMinutes\": 120,\n \"readResultInDays\": 14,\n \"prerequisites\": [\n {\n \"label\": \"Ability to identify customers who used vouchers in weeks 1-9\",\n \"satisfied\": true\n },\n {\n \"label\": \"Active voucher pool to assign new codes\",\n \"satisfied\": false\n },\n {\n \"label\": \"Automated messaging channel configured\",\n \"satisfied\": true\n }\n ],\n \"successMetric\": \"Order count for former voucher users: baseline ~12,500 orders per 9 weeks vs. target recovery of 4,000+ incremental orders in 4 weeks\"\n },\n {\n \"title\": \"Segment and Analyze Voucher-Dependent Customers\",\n \"rationale\": \"To tailor recovery efforts and long-term programs, cluster and analyze the cohort most affected - voucher users pre-week 10 - to understand their demographics, product categories, and payment alternatives.\",\n \"bloomreachFeature\": \"segment\",\n \"steps\": [\n \"Create a segment of all customers who made a voucher payment in weeks 1-9 and none since week 10.\",\n \"Analyze their order history, geolocation (SP, RJ, MG), and basket composition.\",\n \"Surface insights for targeted marketing or product adjustments.\"\n ],\n \"estimatedImpact\": \"medium (enables improved targeting, likely indirect financial impact via future campaigns)\",\n \"confidence\": \"medium\",\n \"effort\": \"low\",\n \"timeToSetUpMinutes\": 45,\n \"readResultInDays\": 3,\n \"prerequisites\": [\n {\n \"label\": \"Access to historical payment and customer data\",\n \"satisfied\": true\n }\n ],\n \"successMetric\": \"Segment created, >10,000 affected customers accurately identified; subsequent campaign conversion rate >10% above average\"\n },\n {\n \"title\": \"Campaign: Communicate Voucher Program Changes and Alternatives\",\n \"rationale\": \"Customer confusion over voucher policy changes may have contributed to order drop. A broadcast campaign clarifying changes, new incentives, or alternative payment benefits can ease friction and reduce churn.\",\n \"bloomreachFeature\": \"campaign\",\n \"steps\": [\n \"Draft clear communication explaining reasons for voucher changes or expiry.\",\n \"Offer incentives for alternative payments (e.g., installment plans, first purchase cashback).\",\n \"Send campaign to all impacted voucher users and monitor engagement.\"\n ],\n \"estimatedImpact\": {\n \"range\": \"low to moderate (~3-5% win-back of lost orders)\",\n \"rangeUsd\": {\n \"low\": 10000,\n \"high\": 25000\n },\n \"assumption\": \"Assumes 25-40% open rate with 5-10% conversion among recipients.\"\n },\n \"confidence\": \"medium\",\n \"effort\": \"low\",\n \"timeToSetUpMinutes\": 60,\n \"readResultInDays\": 7,\n \"prerequisites\": [\n {\n \"label\": \"Up-to-date communication list of all affected users\",\n \"satisfied\": true\n },\n {\n \"label\": \"Clarity on voucher program changes and new offers\",\n \"satisfied\": false\n }\n ],\n \"successMetric\": \"Open rate > 25%, click-through > 5%, incremental orders attributable to campaign > 400 within two weeks\"\n }\n]\n```"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"usage": {
|
|
131
|
+
"inputTokens": 1052,
|
|
132
|
+
"outputTokens": 950,
|
|
133
|
+
"estimated": true
|
|
134
|
+
},
|
|
135
|
+
"model": "promoted-openai-replay"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"eval": {
|
|
139
|
+
"requiredFields": [
|
|
140
|
+
"0.title",
|
|
141
|
+
"0.rationale",
|
|
142
|
+
"0.bloomreachFeature",
|
|
143
|
+
"0.steps",
|
|
144
|
+
"0.estimatedImpact",
|
|
145
|
+
"0.confidence"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"promotion": {
|
|
149
|
+
"sourceArtifact": "artifacts/replays/2026-06-18T17-20-55-422Z-voucher-dropoff-w10-on-openai-studio.json",
|
|
150
|
+
"sourceProvider": {
|
|
151
|
+
"id": "openai",
|
|
152
|
+
"model": "gpt-4.1-2025-04-14"
|
|
153
|
+
},
|
|
154
|
+
"promotedAt": "2026-06-18T17:27:18.678Z",
|
|
155
|
+
"note": "This fixture captures the final replay answer deterministically; it does not reconstruct the live provider tool loop."
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "sp-revenue-drop-w4",
|
|
3
|
+
"description": "Fixture derived from Blooming Insights recommendation regression case 06-recommendation-sp.",
|
|
4
|
+
"workspace": {
|
|
5
|
+
"projectId": "olist",
|
|
6
|
+
"projectName": "Olist Brazilian ecommerce fixture",
|
|
7
|
+
"events": [
|
|
8
|
+
{ "name": "order", "properties": ["state", "category", "purchase_ts", "price_brl"], "eventCount": 0 },
|
|
9
|
+
{ "name": "payment", "properties": ["type", "installments", "value_brl"], "eventCount": 0 }
|
|
10
|
+
],
|
|
11
|
+
"customerProperties": ["state", "city"],
|
|
12
|
+
"catalogs": [],
|
|
13
|
+
"totalCustomers": 0,
|
|
14
|
+
"totalEvents": 0,
|
|
15
|
+
"oldestTimestamp": null,
|
|
16
|
+
"dataHorizon": { "from": "2025-12-01", "to": "2026-06-01", "durationDays": 182 }
|
|
17
|
+
},
|
|
18
|
+
"anomaly": {
|
|
19
|
+
"metric": "revenue",
|
|
20
|
+
"scope": ["state:SP"],
|
|
21
|
+
"change": {
|
|
22
|
+
"value": 30,
|
|
23
|
+
"direction": "down",
|
|
24
|
+
"baseline": "week 4 (2025-12-22 to 2025-12-29) vs 12-week baseline"
|
|
25
|
+
},
|
|
26
|
+
"severity": "critical",
|
|
27
|
+
"evidence": [],
|
|
28
|
+
"impact": "Revenue for state:SP fell about 30% in a discrete window."
|
|
29
|
+
},
|
|
30
|
+
"diagnosis": {
|
|
31
|
+
"conclusion": "Sao Paulo state revenue fell about 30% in week 4 versus the surrounding baseline. The drop is isolated to SP and broad across categories, consistent with a localized demand or fulfillment factor.",
|
|
32
|
+
"evidence": [
|
|
33
|
+
"get_anomaly_context(metric=revenue, dimension=state, segment=SP) returned pct_change=-0.30 for week 4.",
|
|
34
|
+
"Related states RJ, MG, and PR stayed within normal variance.",
|
|
35
|
+
"Electronics, fashion, and home_decor were all down in SP week 4.",
|
|
36
|
+
"Order count fell while AOV stayed roughly flat, so the drop is volume-driven."
|
|
37
|
+
],
|
|
38
|
+
"hypothesesConsidered": [
|
|
39
|
+
{
|
|
40
|
+
"hypothesis": "Single-category collapse drove the SP revenue drop",
|
|
41
|
+
"supported": false,
|
|
42
|
+
"reasoning": "All examined categories moved together."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"hypothesis": "Localized SP fulfillment or demand factor",
|
|
46
|
+
"supported": true,
|
|
47
|
+
"reasoning": "The issue is isolated to SP and volume-driven across categories."
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"affectedCustomers": {
|
|
51
|
+
"count": 4200,
|
|
52
|
+
"segmentDescription": "SP-state buyers in week 4 of dataset"
|
|
53
|
+
},
|
|
54
|
+
"confidence": "medium"
|
|
55
|
+
},
|
|
56
|
+
"tools": [
|
|
57
|
+
{ "name": "list_scenarios", "description": "List existing automations", "inputSchema": { "type": "object" }, "result": { "data": [] } },
|
|
58
|
+
{ "name": "list_segmentations", "description": "List existing segments", "inputSchema": { "type": "object" }, "result": { "data": [{ "name": "SP recent buyers" }] } },
|
|
59
|
+
{ "name": "get_frequency_policies", "description": "List frequency policies", "inputSchema": { "type": "object" }, "result": { "data": [{ "name": "global weekly cap" }] } }
|
|
60
|
+
],
|
|
61
|
+
"modelResponses": [
|
|
62
|
+
{
|
|
63
|
+
"content": [
|
|
64
|
+
{ "type": "tool_use", "id": "tool-1", "name": "list_scenarios", "input": { "project_id": "olist" } }
|
|
65
|
+
],
|
|
66
|
+
"usage": { "inputTokens": 850, "outputTokens": 45 },
|
|
67
|
+
"model": "fixture-model"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"content": [
|
|
71
|
+
{
|
|
72
|
+
"type": "text",
|
|
73
|
+
"text": "```json\n[{\"title\":\"Re-engagement campaign targeting lapsed SP buyers\",\"rationale\":\"Order count in SP fell while AOV held flat, so the fastest recovery lever is to reach full-value SP buyers who went quiet during the drop week.\",\"bloomreachFeature\":\"campaign\",\"steps\":[\"Build a segment of SP customers who purchased in the prior 8 weeks but not during the drop week.\",\"Send a localized re-engagement email with a soft incentive.\",\"Measure SP order count and revenue against the anomaly-week baseline.\"],\"estimatedImpact\":{\"range\":\"+$21k - $43k recovered revenue\",\"rangeUsd\":{\"low\":21000,\"high\":43000},\"assumption\":\"Assumes 10-20% reactivation of 4200 affected SP buyers.\"},\"effort\":\"low\",\"timeToSetUpMinutes\":45,\"readResultInDays\":7,\"prerequisites\":[{\"label\":\"email channel active\",\"satisfied\":true},{\"label\":\"SP customer property available\",\"satisfied\":true}],\"successMetric\":\"SP weekly order count returns to at least 95 orders within 7 days.\",\"confidence\":\"medium\"},{\"title\":\"Automated win-back scenario for SP buyers\",\"rationale\":\"The pattern may recur, so a triggered flow gives durable recovery infrastructure for SP customers who go silent.\",\"bloomreachFeature\":\"scenario\",\"steps\":[\"Trigger when state=SP and no order in 14 days after prior activity.\",\"Send a personalized win-back email.\",\"Escalate to a voucher follow-up if no purchase occurs.\"],\"estimatedImpact\":{\"range\":\"+$18k - $38k recovered revenue per recurrence\",\"rangeUsd\":{\"low\":18000,\"high\":38000},\"assumption\":\"Assumes 8-15% conversion among reachable lapsed SP buyers.\"},\"effort\":\"medium\",\"timeToSetUpMinutes\":90,\"readResultInDays\":14,\"prerequisites\":[{\"label\":\"triggered email channel active\",\"satisfied\":true}],\"successMetric\":\"Scenario conversion rate reaches at least 10% within 14 days.\",\"confidence\":\"medium\"}]\n```"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"usage": { "inputTokens": 1200, "outputTokens": 550 },
|
|
77
|
+
"model": "fixture-model"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"eval": {
|
|
81
|
+
"requiredFields": ["0.title", "0.rationale", "0.bloomreachFeature", "0.steps", "0.estimatedImpact", "0.confidence"]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "voucher-dropoff-w10-on",
|
|
3
|
+
"description": "Fixture derived from Blooming Insights recommendation regression case 08-recommendation-voucher.",
|
|
4
|
+
"workspace": {
|
|
5
|
+
"projectId": "olist",
|
|
6
|
+
"projectName": "Olist Brazilian ecommerce fixture",
|
|
7
|
+
"events": [
|
|
8
|
+
{ "name": "order", "properties": ["state", "category", "purchase_ts", "price_brl"], "eventCount": 0 },
|
|
9
|
+
{ "name": "payment", "properties": ["type", "installments", "value_brl"], "eventCount": 0 }
|
|
10
|
+
],
|
|
11
|
+
"customerProperties": ["state", "city"],
|
|
12
|
+
"catalogs": [],
|
|
13
|
+
"totalCustomers": 0,
|
|
14
|
+
"totalEvents": 0,
|
|
15
|
+
"oldestTimestamp": null,
|
|
16
|
+
"dataHorizon": { "from": "2025-12-01", "to": "2026-06-01", "durationDays": 182 }
|
|
17
|
+
},
|
|
18
|
+
"anomaly": {
|
|
19
|
+
"metric": "payment_value",
|
|
20
|
+
"scope": ["payment_type:voucher"],
|
|
21
|
+
"change": {
|
|
22
|
+
"value": 95,
|
|
23
|
+
"direction": "down",
|
|
24
|
+
"baseline": "weeks 10-26 vs weeks 1-9 baseline"
|
|
25
|
+
},
|
|
26
|
+
"severity": "critical",
|
|
27
|
+
"evidence": [],
|
|
28
|
+
"impact": "Voucher payment value collapsed to about 5% of baseline and stayed depressed."
|
|
29
|
+
},
|
|
30
|
+
"diagnosis": {
|
|
31
|
+
"conclusion": "Voucher payment volume collapsed to roughly 5% of baseline starting week 10 and remained depressed through the end of the data horizon. Credit card and boleto did not absorb the lost volume, and order count fell, so this is likely a program-level voucher change rather than clean substitution.",
|
|
32
|
+
"evidence": [
|
|
33
|
+
"get_anomaly_context(metric=payment_value, dimension=payment_type, segment=voucher) returned pct_change=-0.95 for weeks 10-26.",
|
|
34
|
+
"Credit_card and boleto did not rise enough to absorb the lost voucher volume.",
|
|
35
|
+
"Total order_count was about 8% below baseline after the voucher cliff.",
|
|
36
|
+
"The drop was uniform across SP, RJ, and MG."
|
|
37
|
+
],
|
|
38
|
+
"hypothesesConsidered": [
|
|
39
|
+
{
|
|
40
|
+
"hypothesis": "Voucher volume substituted to credit card or boleto",
|
|
41
|
+
"supported": false,
|
|
42
|
+
"reasoning": "Other payment types did not rise and total order count fell."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"hypothesis": "Program-level voucher change",
|
|
46
|
+
"supported": true,
|
|
47
|
+
"reasoning": "The cliff-shaped onset and sustained cross-state impact fit suspension, expiry, or restriction."
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"affectedCustomers": {
|
|
51
|
+
"count": 12500,
|
|
52
|
+
"segmentDescription": "Customers who previously used voucher payment in weeks 1-9"
|
|
53
|
+
},
|
|
54
|
+
"confidence": "medium"
|
|
55
|
+
},
|
|
56
|
+
"tools": [
|
|
57
|
+
{ "name": "list_voucher_pools", "description": "List voucher pools", "inputSchema": { "type": "object" }, "result": { "data": [] } },
|
|
58
|
+
{ "name": "list_email_campaigns", "description": "List email campaigns", "inputSchema": { "type": "object" }, "result": { "data": [{ "name": "inactive customer broadcast" }] } },
|
|
59
|
+
{ "name": "get_frequency_policies", "description": "List frequency policies", "inputSchema": { "type": "object" }, "result": { "data": [{ "name": "one marketing message per week" }] } }
|
|
60
|
+
],
|
|
61
|
+
"modelResponses": [
|
|
62
|
+
{
|
|
63
|
+
"content": [
|
|
64
|
+
{ "type": "tool_use", "id": "tool-1", "name": "list_voucher_pools", "input": { "project_id": "olist" } },
|
|
65
|
+
{ "type": "tool_use", "id": "tool-2", "name": "get_frequency_policies", "input": { "project_id": "olist" } }
|
|
66
|
+
],
|
|
67
|
+
"usage": { "inputTokens": 940, "outputTokens": 75 },
|
|
68
|
+
"model": "fixture-model"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"content": [
|
|
72
|
+
{
|
|
73
|
+
"type": "text",
|
|
74
|
+
"text": "```json\n[{\"title\":\"Launch replacement incentive campaign for prior voucher users\",\"rationale\":\"The voucher program appears blocked and part of the former voucher cohort stopped ordering. A replacement incentive on boleto or credit card gives the merchant a fast retention path while the voucher root cause is resolved.\",\"bloomreachFeature\":\"campaign\",\"steps\":[\"Build a segment of customers who used voucher payment in weeks 1-9 and have not ordered since week 10.\",\"Create a 5% replacement incentive valid on boleto or credit card.\",\"Send a broadcast with a 10% holdout to measure incremental recovery.\"],\"estimatedImpact\":{\"range\":\"+$140k - $280k recovered over 28 days\",\"rangeUsd\":{\"low\":140000,\"high\":280000},\"assumption\":\"Assumes 10-20% reactivation of 12500 affected customers at the historical AOV.\"},\"effort\":\"medium\",\"timeToSetUpMinutes\":90,\"readResultInDays\":28,\"prerequisites\":[{\"label\":\"new voucher or discount pool exists\",\"satisfied\":false},{\"label\":\"email campaign channel available\",\"satisfied\":true}],\"successMetric\":\"Dormant voucher cohort reactivation reaches 10-20% within 28 days.\",\"confidence\":\"medium\"},{\"title\":\"Escalate voucher-program root cause with a status scenario\",\"rationale\":\"No marketing message fixes a program-level voucher outage. A structured escalation and customer-status segment makes the operational fix trackable and prevents the agent from treating policy failure as a campaign-only problem.\",\"bloomreachFeature\":\"scenario\",\"steps\":[\"Create a segment of customers affected by the voucher cliff.\",\"Route the week-10 cliff evidence to the voucher program owner.\",\"If voucher pools are restored, trigger a relaunch message to affected customers.\"],\"estimatedImpact\":{\"range\":\"Up to full voucher-channel recovery if the program is restored\",\"assumption\":\"Bounds the upside against pre-week-10 voucher payment value.\"},\"effort\":\"high\",\"timeToSetUpMinutes\":240,\"readResultInDays\":7,\"prerequisites\":[{\"label\":\"voucher program owner identified\",\"satisfied\":false},{\"label\":\"frequency policy available\",\"satisfied\":true}],\"successMetric\":\"Program status confirmed within 7 days with re-enable date or replacement-program decision.\",\"confidence\":\"high\"}]\n```"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"usage": { "inputTokens": 1420, "outputTokens": 590 },
|
|
78
|
+
"model": "fixture-model"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"eval": {
|
|
82
|
+
"requiredFields": ["0.title", "0.rationale", "0.bloomreachFeature", "0.steps", "0.estimatedImpact", "0.confidence"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aptkit/agent-recommendation",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/src/index.js",
|
|
6
|
+
"types": "./dist/src/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"README.md",
|
|
9
|
+
"dist/src",
|
|
10
|
+
"fixtures"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/src/index.d.ts",
|
|
15
|
+
"import": "./dist/src/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.json",
|
|
20
|
+
"test": "npm run build && node --test dist/test/*.test.js && node ../../../scripts/replay-promoted-fixtures.mjs --count recommendationCount",
|
|
21
|
+
"replay:fixture": "npm run build && node dist/scripts/replay-fixture.js",
|
|
22
|
+
"replay:promoted": "npm run build && node ../../../scripts/replay-promoted-fixtures.mjs --count recommendationCount"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@aptkit/context": "0.0.0",
|
|
26
|
+
"@aptkit/evals": "0.0.0",
|
|
27
|
+
"@aptkit/prompts": "0.0.0",
|
|
28
|
+
"@aptkit/runtime": "0.0.0",
|
|
29
|
+
"@aptkit/tools": "0.0.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^20.0.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @aptkit/context
|
|
2
|
+
|
|
3
|
+
Shared context builders for data-backed AptKit capabilities.
|
|
4
|
+
|
|
5
|
+
This package owns the provider-neutral `WorkspaceDescriptor` shape and deterministic
|
|
6
|
+
workspace summary rendering used by agents, prompt previews, and replay provenance.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { schemaSummary, type WorkspaceDescriptor } from '@aptkit/context';
|
|
10
|
+
|
|
11
|
+
const summary = schemaSummary(workspace);
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Use capability-specific adapters outside this package to fetch or cache workspace
|
|
15
|
+
metadata. This package should stay deterministic and fixture-friendly.
|