From dc1f08aeab1722f58a8b40fff18caf10e72d2e6a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 May 2026 06:46:07 +0000 Subject: [PATCH 1/3] Initial plan From bc7d21e339350f13779630fca258d645a5ac33ed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 May 2026 06:56:13 +0000 Subject: [PATCH 2/3] Add complex playground examples Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com> --- .../example_inventory_replenishment.html | 284 ++++++++++++++++++ playground/example_marketing_attribution.html | 275 +++++++++++++++++ playground/example_marketplace_fraud.html | 276 +++++++++++++++++ playground/examples.html | 18 ++ playground/index.html | 2 +- tests/playground.test.ts | 14 + 6 files changed, 868 insertions(+), 1 deletion(-) create mode 100644 playground/example_inventory_replenishment.html create mode 100644 playground/example_marketing_attribution.html create mode 100644 playground/example_marketplace_fraud.html diff --git a/playground/example_inventory_replenishment.html b/playground/example_inventory_replenishment.html new file mode 100644 index 00000000..e4365347 --- /dev/null +++ b/playground/example_inventory_replenishment.html @@ -0,0 +1,284 @@ + + + + + + tsb — Inventory Replenishment Planning — Examples + + + +
+
+
Initializing playground…
+
+ + ← Back to examples +

📦 Inventory Replenishment Planning

+
Scenario: A retail operations analyst combines daily sell-through with SKU master data to find categories moving fastest and flag items whose on-hand stock is below lead-time demand.
+

Skills you'll use: readCsv, merge, function-valued assign, rolling-style demand features, filters, and pivot tables.

+ +
+

1 · Enrich sales with product master data

+

Parse store/SKU sales, join attributes, and compute inventory value and sell-through.

+
+
+ TypeScript +
+ + +
+
+ + +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+
+

2 · Calculate reorder points from recent demand

+

Estimate rolling demand per SKU, compare it to on-hand stock, and summarize reorder status.

+
+
+ TypeScript +
+ + +
+
+ + +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+ + + + + diff --git a/playground/example_marketing_attribution.html b/playground/example_marketing_attribution.html new file mode 100644 index 00000000..db926754 --- /dev/null +++ b/playground/example_marketing_attribution.html @@ -0,0 +1,275 @@ + + + + + + tsb — Marketing Attribution ROAS — Examples + + + +
+
+
Initializing playground…
+
+ + ← Back to examples +

📣 Marketing Attribution ROAS

+
Scenario: A growth team has campaign spend in spreadsheet-wide format and conversions in event format. Normalize the spend, join conversion facts, and compare return on ad spend across regions and channels.
+

Skills you'll use: melt, multi-column merge, KPI columns, groupby().agg(), pivotTableFull, and top-N selection.

+ +
+

1 · Normalize spend and join conversions

+

Turn wide channel spend into a tidy table, join conversion facts, and compute ROAS and cost per order.

+
+
+ TypeScript +
+ + +
+
+ + +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+
+

2 · Compare region/channel performance

+

Create a pivot-table scorecard and list the strongest daily placements.

+
+
+ TypeScript +
+ + +
+
+ + +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+ + + + + diff --git a/playground/example_marketplace_fraud.html b/playground/example_marketplace_fraud.html new file mode 100644 index 00000000..bf72c955 --- /dev/null +++ b/playground/example_marketplace_fraud.html @@ -0,0 +1,276 @@ + + + + + + tsb — Marketplace Fraud Triage — Examples + + + +
+
+
Initializing playground…
+
+ + ← Back to examples +

🛡️ Marketplace Fraud Triage

+
Scenario: A payments risk team needs a repeatable notebook-style workflow: join live transactions to merchant chargeback history, estimate loss exposure, and produce a review queue plus a segment/device heatmap.
+

Skills you'll use: merge, derived columns, boolean filters, groupby().agg(), nlargestDataFrame, pivotTableFull.

+ +
+

1 · Join risk signals and score transactions

+

Blend transaction-level events with merchant risk metadata, then calculate expected loss and a risk score.

+
+
+ TypeScript +
+ + +
+
+ + +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+
+

2 · Build a fraud heatmap and merchant leaderboard

+

Summarize exposure by segment/device and rank merchants by estimated loss.

+
+
+ TypeScript +
+ + +
+
+ + +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+ + + + + diff --git a/playground/examples.html b/playground/examples.html index 52eeeb1f..6a98dcae 100644 --- a/playground/examples.html +++ b/playground/examples.html @@ -229,6 +229,24 @@

Sports League Standings

Product Pricing Tiers

Scenario: An e-commerce merchandiser wants to bucket the catalogue into 4 price tiers (Budget / Mid / Premium / Luxury) and see the count and average margin per tier.

+ + +
🛡️
+

Marketplace Fraud Triage

+

Scenario: A payments risk team joins transactions with merchant chargeback history, scores expected loss, and builds a segment/device heatmap plus a manual review queue.

+
+ + +
📦
+

Inventory Replenishment Planning

+

Scenario: A retail operations analyst combines daily sell-through with SKU master data to calculate reorder points and summarize replenishment risk.

+
+ + +
📣
+

Marketing Attribution ROAS

+

Scenario: A growth team reshapes campaign spend, joins conversion facts, and compares return on ad spend by region and channel.

+