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.
+
+
+
+
+
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.
+
+
+
+
+
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.
+
+
+
+
+
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.
+
+
+
+
+
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.
+
+
+
+
+
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.
+
+
+
+
+
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.
+
diff --git a/playground/index.html b/playground/index.html
index 7224a77f..d1b4e018 100644
--- a/playground/index.html
+++ b/playground/index.html
@@ -131,7 +131,7 @@ 📚 Real-World Examples
-
Ten complete, real-world workflows running interactively in the browser — sales dashboards, stock returns, A/B tests, web analytics, league tables, and more.
+
Thirteen complete, real-world workflows running interactively in the browser — sales dashboards, stock returns, A/B tests, web analytics, league tables, and more.
✅ New — start here
diff --git a/tests/playground.test.ts b/tests/playground.test.ts
index 1fd6b68d..bbaaed76 100644
--- a/tests/playground.test.ts
+++ b/tests/playground.test.ts
@@ -32,6 +32,12 @@ const NON_PLAYGROUND_PAGES = new Set([
"examples.html",
]);
+const REAL_WORLD_EXAMPLE_PAGES = [
+ "example_marketplace_fraud.html",
+ "example_inventory_replenishment.html",
+ "example_marketing_attribution.html",
+] as const;
+
function listPlaygroundHtmlFiles(): string[] {
return readdirSync(PLAYGROUND_DIR)
.filter((f) => f.endsWith(".html"))
@@ -50,6 +56,14 @@ describe("playground page conformance", () => {
expect(files.length).toBeGreaterThan(0);
});
+ it("links the complex real-world examples from the gallery", () => {
+ const html = read("examples.html");
+ for (const file of REAL_WORLD_EXAMPLE_PAGES) {
+ expect(html).toContain(`href="${file}"`);
+ expect(files).toContain(file);
+ }
+ });
+
for (const file of files) {
describe(file, () => {
const html = read(file);
From 95eb5c1220985a556d9732cf21d9b0ae454b4cab Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 12 May 2026 15:45:18 +0000
Subject: [PATCH 3/3] Fix Python playground examples validation
Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
---
.../example_inventory_replenishment.html | 38 +++++++++++++++-
playground/example_marketing_attribution.html | 43 ++++++++++++++++++-
playground/example_marketplace_fraud.html | 33 ++++++++++++--
3 files changed, 107 insertions(+), 7 deletions(-)
diff --git a/playground/example_inventory_replenishment.html b/playground/example_inventory_replenishment.html
index e4365347..2dd80718 100644
--- a/playground/example_inventory_replenishment.html
+++ b/playground/example_inventory_replenishment.html
@@ -198,8 +198,25 @@ 1 · Enrich sales with product master data
-