test: strengthen coding-standards guardrails#588
Draft
cursor[bot] wants to merge 1 commit into
Draft
Conversation
Centralize allowed MCP tool and handler lists in tests/coding-standards/constants.ts so architecture, scope, error-handling, and docs tests cannot drift apart. Add security guardrails (RateLimiter usage, secrets metadata-only policy, credential logging checks) and AGENTS.md consistency tests alongside the existing docs/coding-standards.md checks. 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.
Description
Audited the codebase against the registry-driven MCP architecture standards in
docs/coding-standards.md. The codebase already complies — 89 automated guardrail tests now enforce the rules on every CI run viapnpm standards:check.This PR strengthens enforcement to prevent drift:
tests/coding-standards/constants.ts— single source of truth for the 11 allowed MCP tools and handler file paths (used across all standards tests)tests/coding-standards/security.test.ts— RateLimiter usage, secrets metadata-only policy, credential logging checksdocs-consistency.test.ts— AGENTS.md drift guards (11 tools, Zod v4,pnpm standards:check)Type of Change
Checklist
pnpm testpasses (2487 tests)pnpm standards:checkpasses (89 tests)server.registerTool()callsconsole.log()insrc/Notes on standards snapshot
The automation prompt referenced an older snapshot (10 tools, Zod v3). The canonical standards are documented in
docs/coding-standards.mdandAGENTS.md:harness_schema)import * as z from "zod/v4")registerTool()(not deprecatedserver.tool())confirm: truevia client elicitation (notconfirmation)