Skip to content

test: expand coding standards enforcement for registry and handler contracts#404

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

test: expand coding standards enforcement for registry and handler contracts#404
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/mcp-server-coding-standards-4598

Conversation

@cursor

@cursor cursor Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Expands automated architecture guardrails in tests/coding-standards/architecture.test.ts so the registry-driven MCP model stays enforced as the codebase grows.

What was already in place

  • docs/coding-standards.md documents the consolidated 11-tool architecture
  • pnpm standards:check runs in CI alongside build, test, typecheck, and docs:check
  • Existing tests already blocked new MCP tools, forbidden toolset imports, console.log() in src/, raw fetch() in handlers/toolsets, and toolset registration drift

New enforcement (8 tests)

Registry resource contracts

  • Every CRUD operation and execute action declares operationPolicy (risk + retryPolicy)
  • Every resource declares identifierFields
  • Resource scope / supportedScopes use only project, org, or account

Tool handler contracts

  • Write handlers (create, update, delete, execute) expose a confirm param
  • All 11 handlers import Zod via zod/v4
  • harness_list keeps pagination defaults (page=0, size=20, max 100)
  • API handlers use errorResult() + toMcpError() (local-only describe/schema exempt)

HTTP client singleton

  • new HarnessClient() is only allowed in src/index.ts

Verification

pnpm standards:check  # 17 tests pass
pnpm test             # 2144 tests pass
Open in Web View Automation 

cursoragent and others added 2 commits June 23, 2026 10:12
…cident close

Add focused regression tests for recently merged production paths with thin
coverage:

- harness_diagnose pipeline: return_download_url on requested_step_log for
  explicit step_id and auto-fetch paths; dedup when failed_step_logs already
  holds the URL
- FME execute actions: fmeActionExtract wraps primitive kill/restore/archive
  responses so MCP output validation does not fail
- harness_execute: successful security_exemption.approve remaps resource_id to
  exemption_id in the API path; FME kill remaps resource_id to feature_flag_name
- incident close: response projection drops backend envelope/meta fields

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

Add automated guardrails for operationPolicy on all endpoints, valid
resource scopes, identifierFields presence, write-tool confirm params,
Zod v4 imports, pagination defaults, error handling patterns, and
HarnessClient singleton instantiation.

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