fix(mcp-server): ship payload-size runner dep for npm consumers (#62)#67
Conversation
Move json-schema-faker to production dependencies so payload-size works from published npm installs. Add CI consumer smoke test, clarify runner error messages, and document atest/1 deps. Full runner packaging deferred to v1.1 (#66).
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change packages ChangesNPM packaging and runner availability
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| const detail = | ||
| "error" in initiatorAtest && /unavailable/i.test(initiatorAtest.error) | ||
| ? " (install json-schema-faker dev dependency for payload-size runner)" | ||
| ? " (payload-size runner unavailable — reinstall agentpair or check json-schema-faker dependency)" |
There was a problem hiding this comment.
[nit] The e2e detail string still says "check json-schema-faker dependency", which slightly reintroduces the old "install jsf yourself" framing that payload-size.ts intentionally left behind ("should ship with the package"). In a monorepo e2e failure this can send developers hunting for a missing optional dep instead of a broken install/link of agentpair itself.
Suggestion: Align with the runner message, e.g. "payload-size runner unavailable — reinstall agentpair (json-schema-faker should ship with the package)".
| trap 'rm -rf "${TMP_DIR}"' EXIT | ||
|
|
||
| echo "==> Building protocol and agentpair" | ||
| pnpm --filter @agentpair/protocol build |
There was a problem hiding this comment.
[suggestion] The script always rebuilds @agentpair/protocol and agentpair, including the WASM step. CI already ran pnpm build and pnpm test (which rebuilds again via pretest) before this step, so every PR pays a third protocol/wasm compile. Standalone local use wants a rebuild; CI does not.
Suggestion: Either document that the script is standalone-safe and accept the cost, or skip rebuild when dist artifacts already exist / add a SKIP_BUILD=1 path for the CI step so only pack+install+smoke runs after the existing Build/Test jobs.
| node --input-type=module -e " | ||
| import { readFileSync, writeFileSync } from 'node:fs'; | ||
| const pkg = JSON.parse(readFileSync('${MCP_DIR}/package.json', 'utf8')); | ||
| const publishable = { |
There was a problem hiding this comment.
[suggestion] The publish-shaped package is hand-assembled (subset of package.json fields + cp dist + LICENSE) rather than produced by pnpm pack / publish, which is what actually rewrites workspace: and applies the real files allowlist. Today the subset matches package.json, so the smoke test is valid for #62, but it can drift if fields like exports, bin, or files change and still pass this gate.
Suggestion: Prefer pnpm --filter agentpair exec/pnpm pack (or pack the real package after a workspace-protocol rewrite) so the verified tarball matches publish output more closely; keep the explicit json-schema-faker dependency assertion either way.
- Align e2e unavailable hint with payload-size runner message - Add SKIP_BUILD=1 for CI verify step (skip redundant wasm rebuild) - Use pnpm pack instead of hand-assembled publish tarball
Review follow-up (e751090)
|
Summary
Partial v1.0 fix for #62 (judges-approved §5 path):
json-schema-fakerto productiondependenciessopayload-sizeworks from published npm /npx agentpairinstallsscripts/verify-npm-consumer.sh+ CI step: staged publish-shaped pack, manifest assertion, freshnpm install,runPayloadSizesmoke testatest/1runner deps in user guides (EN + ID)Not in scope (deferred v1.1):
@agentpair/runnersextraction (#66),codegen-compileregistration, spectral bundling. #62 stays open until v1.1.Type of Change
Test plan
bash scripts/verify-npm-consumer.sh— manifest + consumer install smoke passedpnpm --filter agentpair test— passedpnpm lint— cleanPre-flight Checklist
Summary by CodeRabbit
Bug Fixes
payload-sizerunner now works correctly when installed from npm by including its required runtime dependency.payload-size,spectral, andquicktype.Documentation
Chores