Skip to content

test: strengthen coding standards enforcement for error handling and pagination#418

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/mcp-server-coding-standards-e510
Draft

test: strengthen coding standards enforcement for error handling and pagination#418
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/mcp-server-coding-standards-e510

Conversation

@cursor

@cursor cursor Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Audited the codebase against docs/coding-standards.md and closed two guardrail gaps:

  • Error handling (§6): Added tests/coding-standards/error-handling.test.ts to ensure API-facing tool handlers use errorResult() for known errors and throw toMcpError(err) for unexpected failures.
  • Pagination defaults (§8): Added tests/coding-standards/pagination.test.ts to lock harness_list to page=0, size=20, max=100.

Fix

harness_schema was the only API handler that swallowed unexpected errors via return errorResult(...) in its catch block. It now follows the same isUserError / isUserFixableApiError / throw toMcpError pattern as the other handlers.

Verification

  • pnpm standards:check — 64 tests pass (was 60)
  • pnpm test — 2241 tests pass

Notes

The pasted automation prompt referenced 10 tools and Zod v3; the repo's canonical standards (docs/coding-standards.md) correctly document 11 consolidated tools (including harness_schema) and Zod v4. Existing CI already runs pnpm standards:check on every PR.

Open in Web View Automation 

thisrohangupta and others added 2 commits June 24, 2026 18:46
Bump version to 3.2.2 across package.json, root and directory bundle
manifests, and the release-metadata version contract test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

AI-Session-Id: 7ac8d1f2-ac05-4023-8226-8b0012f3adae
AI-Tool: claude-code
AI-Model: unknown
Add automated checks for docs/coding-standards.md rules that were
documented but not yet guarded: API handlers must use errorResult and
throw toMcpError for unexpected failures, and harness_list must keep
page=0 / size=20 / max=100 defaults.

Align harness_schema with the same error-handling pattern as the other
API-facing tool handlers.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ thisrohangupta
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants