Skip to content

feat(demo): randomized, persona-based sample data with a real 6-month arc - #6

Merged
nitrimandylis merged 4 commits into
mainfrom
claude/tokenpilot-demo-randomization-suci1w
Aug 6, 2026
Merged

feat(demo): randomized, persona-based sample data with a real 6-month arc#6
nitrimandylis merged 4 commits into
mainfrom
claude/tokenpilot-demo-randomization-suci1w

Conversation

@nitrimandylis

@nitrimandylis nitrimandylis commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Reworks the demo engine so every "Try with sample data" click generates a fresh org while each run stays internally coherent, with a two-archetype persona picker on the home page.

  • Randomness lives in the UI layer only: startDemo draws one seed per click (Date.now()) and threads it through all six monthly calls. demoAnthropic/demoOpenAI stay pure and clock-free — same (year, month, seed, persona, monthsAgo) in, byte-identical data out. DEMO_SEED remains the default so tests stay deterministic.
  • enterprise (default): the sprawling 8-workspace mess where every rule category fires. startup: 3 Anthropic workspaces / 2 OpenAI projects of mostly well-optimized traffic that produce 1–2 minor findings with modest savings.
  • The arc: enterprise spend compounds ~10–14%/mo (rate seeded per run) with one incident month at monthsAgo = 2 — a runaway agent loop that ~4×'s the Agent Platform's cache writes and visibly bumps that month's spend — while the Legacy Summarizer decays ~20%/mo. Startup grows a gentle 3–6%/mo. The analytics forecast finally has a real slope to fit.
  • OpenAI parity: the per-day scenario roulette is replaced with a curated per-project workload table, one named project per rule story (mini-downgrade router, RAG bloat, steady batch, Monday-only evals, o1 overkill, legacy GPT-4, prompt bloat, caching miss, overloaded default project), non-completions services as light background traffic, and costs derived from the same token volumes at pricing-table rates.

One note: the mini-downgrade story uses o1-mini rather than gpt-4o because prOpenAI("gpt-4o-mini") substring-matches the gpt-4o table entry first, so a gpt-4o→mini repricing nets $0 and the rule can never fire on gpt-4o rows. The engine is untouched per the constraints; probably worth a follow-up fix in the pricing lookup.

Checklist

  • Step 1 — random per click, coherent per run (seed drawn in startDemo, generators pure; purity pinned by test)
  • Step 2 — personas: "enterprise" | "startup" parameter + Ink/Moss-styled picker under the sample-data button
  • Step 3 — 6-month arc: seeded compounding growth, incident month, legacy decay (monthsAgo parameter)
  • Step 4 — OpenAI parity: curated per-project workload table with consistent token-derived costs

Verification: npm run type-check, npm run lint, npm run format:check, npm test (96 tests) all pass. Docs updated (README "Run it", PRODUCT.md "Where it stands").

claude added 4 commits August 6, 2026 11:03
Rework the sample-data generators around three ideas: a fresh seed makes a
fresh org (name, scale, growth rate all seeded per run) while staying pure
and clock-free; an org archetype parameter picks between the sprawling
enterprise (every rule category fires) and a lean startup (2-3 clean
workspaces/projects, 1-2 minor findings); and a monthsAgo parameter gives
each run a deliberate shape — compounding growth toward the present,
a decaying legacy workload, and one runaway-agent incident month that
spikes the Agent Platform's cache writes.

The OpenAI side gets the curated treatment the Anthropic side already had:
a per-project completions workload table with one named project per rule
story, light background traffic on the non-completions services, and costs
derived from the same token volumes at pricing-table rates.
startDemo now draws one random seed per click and threads it, the chosen
persona, and monthsAgo through all six monthly generator calls — randomness
lives in the UI layer only. A small two-option picker under the sample-data
button selects between the sprawling enterprise and the lean startup.
Byte-identity with explicit seeds for both personas and vendors, different
seeds producing different orgs, one org per run, at least 6 distinct rule
categories per vendor for the enterprise, at most 3 modest findings per
vendor for the startup, strictly increasing enterprise spend outside the
incident month, and the incident month's cache-write spike vs neighbors.
Fresh org every click, coherent within a run, two personas — replacing the
same-org-every-run description, and bumping the test count to 96.
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tokenpilot Ready Ready Preview Aug 6, 2026 11:04am

@nitrimandylis
nitrimandylis merged commit fd222ac into main Aug 6, 2026
3 checks passed
@nitrimandylis
nitrimandylis deleted the claude/tokenpilot-demo-randomization-suci1w branch August 6, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants