PDX-0: chore(scripts): add token-measure-vs-playwright.cjs#175
Merged
Conversation
RCA: The published Provar-vs-Playwright comparison deck references this script in its methodology appendix as the reproduction recipe for the catalog-token figures. The script lived only in the PDX-482 worktree, so external readers (analysts, customers, prospects) could not actually reproduce the numbers — undermining the methodology slide's credibility. Fix: Promote scripts/token-measure-vs-playwright.cjs to develop as an independent chore. Script spawns both MCP servers (Provar local via bin/mcp-start.js, Playwright via npx -y @playwright/mcp), sends identical initialize → tools/list JSON-RPC pairs, and reports catalog size in characters and approximate tokens (chars/4). Provar MCP runs three configurations (STANDARD / COMPACT / AUTHORING) to demonstrate the PROVAR_MCP_SCHEMA_MODE + PROVAR_MCP_TOOLS levers. Also issues a representative browser_navigate + browser_snapshot against example.com to capture Playwright's per-interaction baseline. No source-tree changes; no test or behaviour impact.
Quality Orchestrator🟢 LOW · No test files mapped. ⚡ quality-orchestrator · |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a one-off measurement script that compares MCP tool-catalog token sizes between Provar MCP (in three configurations) and Playwright MCP, used as the reproduction recipe for a marketing comparison deck.
Changes:
- New
scripts/token-measure-vs-playwright.cjsspawns each MCP server over stdio, drivesinitialize→tools/list, and reports catalog chars/tokens. - For Playwright MCP, additionally measures a
browser_navigate+browser_snapshotround trip against example.com as a per-interaction baseline. - Prints a formatted comparison table, Playwright/Provar ratios, and the top-5 heaviest tools per server.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/token-measure-vs-playwright.cjsfrom the PDX-482 worktree todevelopso it lives as a permanent, discoverable artifact.develop— undermining the deck's credibility.Why a separate PR
This is a docs / marketing-support tool, not part of PDX-482's tool-description hardening. Bundling it would muddle PR scope. PDX-0 fits because there is no observable user or system behaviour change — this is purely a scripts/ addition.
What the script does
bin/mcp-start.js) and Playwright MCP vianpx -y @playwright/mcp.initialize→tools/listJSON-RPC pair to each.tools[]array — exactly what a real MCP client sends to its LLM as the tool catalog — and counts characters → tokens atchars / 4.STANDARD,COMPACT(PROVAR_MCP_SCHEMA_MODE=compact),AUTHORING(compact +PROVAR_MCP_TOOLS=authoring,inspect,connection,validation).browser_navigate+browser_snapshotagainstexample.comto capture a representative per-interaction baseline.Sample output
Test plan
yarn install,yarn compile,yarn lintall clean against the chore worktreenode scripts/token-measure-vs-playwright.cjsfrom the repo root afteryarn install && yarn compileJira
PDX-0 — chore (no Jira ticket). See the comparison deck methodology slide for the customer-facing context this script supports.
🤖 Generated with Claude Code