test: strengthen coding standards enforcement for error handling and pagination#418
Draft
cursor[bot] wants to merge 2 commits into
Draft
test: strengthen coding standards enforcement for error handling and pagination#418cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
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>
|
|
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
Audited the codebase against
docs/coding-standards.mdand closed two guardrail gaps:tests/coding-standards/error-handling.test.tsto ensure API-facing tool handlers useerrorResult()for known errors andthrow toMcpError(err)for unexpected failures.tests/coding-standards/pagination.test.tsto lockharness_listtopage=0,size=20,max=100.Fix
harness_schemawas the only API handler that swallowed unexpected errors viareturn errorResult(...)in its catch block. It now follows the sameisUserError/isUserFixableApiError/throw toMcpErrorpattern as the other handlers.Verification
pnpm standards:check— 64 tests pass (was 60)pnpm test— 2241 tests passNotes
The pasted automation prompt referenced 10 tools and Zod v3; the repo's canonical standards (
docs/coding-standards.md) correctly document 11 consolidated tools (includingharness_schema) and Zod v4. Existing CI already runspnpm standards:checkon every PR.