Skip to content

fix: enforce coding standards — Zod describe-last and expanded guardrails#415

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

fix: enforce coding standards — Zod describe-last and expanded guardrails#415
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/mcp-server-coding-standards-8592

Conversation

@cursor

@cursor cursor Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Audits the codebase against docs/coding-standards.md and closes gaps found beyond the existing architecture tests from #373.

Changes

Fixes

  • Zod .describe() ordering in 7 handler files (harness-list, harness-get, harness-diagnose, harness-describe, harness-search, harness-status, harness-schema). Zod 4 silently drops descriptions when .optional() / .default() follow .describe() — ~37 params were invisible to MCP tool listings.
  • Removed console.error debug logging from idp.ts toolset bodyBuilder (toolsets must stay pure data).

Expanded pnpm standards:check guardrails

  • Zod describe-last rule on handler inputSchema chains
  • No server.tool() calls (only registerTool)
  • No process.stdout.write in src/
  • HarnessClient singleton — only src/index.ts may call new HarnessClient()
  • No console.* in toolset files

Verification

pnpm standards:check  # 14 tests pass
pnpm build
pnpm typecheck
pnpm test             # 2184 tests pass

Compliance status

The registry-driven architecture (11 consolidated tools, pure-data toolsets, stderr-only logging, CI standards:check) was already in place. This PR fixes the main runtime gap (lost Zod descriptions) and prevents regression.

Open in Web View Automation 

cursoragent and others added 3 commits June 24, 2026 17:40
…ctors

Add regression tests for high-risk gaps in recent merges:
- resolveLogDownloadUrl hostname rewrite for self-managed CDN URLs (PR #358)
- HarnessClient.getCurrentUserId caching, dedup, and error paths (STO exemptions)
- CCM GraphQL response extractors (views, breakdown, timeseries, summary, recommendations)
- STO security_issue hint injection and pipeline_security_issue partition flattening

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

- Add sto-exemption-actions.test.ts for create preflight, scope routing
  (/approve vs /promote), elevation input mutation, and approver injection
- Extend registry.test.ts to lock accountIdentifier injection inside
  body.resourceGroup for access_control resource_group create

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
- Fix .describe() ordering in 7 harness handler files (Zod 4 drops
  descriptions when .optional()/.default() follow .describe())
- Remove console.error debug logging from idp toolset bodyBuilder
- Expand architecture.test.ts with checks for:
  - Zod describe-last rule on handler inputSchema
  - No server.tool() calls
  - No process.stdout.write
  - HarnessClient singleton (only src/index.ts)
  - No console.* in toolset files

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 sign our Contributor License Agreement before we can accept your contribution.
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.

2 participants