Skip to content

chore: strengthen coding standards enforcement and fix Zod describe order#383

Closed
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/mcp-server-coding-standards-31f9
Closed

chore: strengthen coding standards enforcement and fix Zod describe order#383
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/mcp-server-coding-standards-31f9

Conversation

@cursor

@cursor cursor Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Builds on PR #373's automated coding standards enforcement by expanding guardrails and fixing real violations in tool handler Zod schemas.

Changes

Expanded tests/coding-standards/architecture.test.ts

  • Zod describe order: Ensures .describe() is the last call in schema chains (Zod 4 requirement — descriptions are lost when followed by .optional()/.default())
  • HarnessClient singleton: Only src/index.ts may construct new HarnessClient()
  • Resource metadata: Every resource must declare scope and identifierFields; get-capable resources with empty identifierFields must be in an explicit allowlist (16 known singleton/dashboard endpoints)

Fixed Zod schema ordering in tool handlers

  • harness-list.ts, harness-get.ts, harness-status.ts, harness-search.ts, harness-diagnose.ts, harness-describe.ts

Verification

pnpm build && pnpm standards:check && pnpm typecheck && pnpm test

All 2091 tests pass; 13 coding-standards checks pass.

Standards compliance snapshot

Rule Status
11 consolidated MCP tools only Enforced (CI)
Pure-data toolsets Enforced (CI)
No console.log() in src/ Enforced (CI)
No raw fetch() in tools/toolsets Enforced (CI)
ToolsetName ↔ ALL_TOOLSETS sync Enforced (CI)
Zod .describe() last in chain Enforced (CI) + fixed
HarnessClient singleton Enforced (CI)
operationPolicy on endpoints TypeScript-enforced
passthrough extractors (287 endpoints) Pre-existing — not auto-enforced yet
Open in Web View Automation 

cursoragent and others added 3 commits June 22, 2026 10:03
…ctFn path

Add regression tests for recent production fixes where coverage was thin:

- GitOps supportedScopes: lock account/org/project declaration on the four
  scopeOptional resources fixed in #342 and verify account-scope list dispatch
  omits org/project params; contrast with gitops_application fallback behavior
- hasRequiredDiscoveryScope: direct unit tests for account/org/project gating
  used by execution-summary and pipeline-yaml resources (#325)
- HarnessClient: include config-service in x-tenant-id gRPC-proxy coverage (#361)
- compactItems: test custom compactFn delegation and openInHarness merge

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
- Add docs/coding-standards.md as the canonical architecture guide
- Add tests/coding-standards/architecture.test.ts with 9 guardrail checks
- Wire pnpm standards:check into CI alongside build/test/typecheck
- Fix ToolsetName union missing knowledge-graph and semantic-layer
- Remove HarnessClient imports from sto/ccm toolsets (use narrow interfaces)

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
- Fix .describe() placement in harness-list, harness-get, harness-status,
  harness-search, harness-diagnose, and harness-describe (Zod 4 requires
  describe last in the chain)
- Add architecture tests for Zod describe order, HarnessClient singleton,
  and resource metadata (scope + identifierFields with allowlist for
  singleton GET resources)

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.

@thisrohangupta

Copy link
Copy Markdown
Collaborator

Closing as stale: merge conflicts with main and work superseded by merged PRs (#447, #446, #449, #469, #440, #398, etc.) or duplicate agent-generated attempts. Reopen from a fresh branch if still needed.

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