Skip to content

chore: coding standards compliance review and test coverage - #845

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

chore: coding standards compliance review and test coverage#845
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/mcp-server-coding-standards-6f2a

Conversation

@cursor

@cursor cursor Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

Audited the codebase against docs/coding-standards.md and verified all automated guardrails pass on latest main.

This PR also rebases and extends the test coverage from #836, with one fix after main landed native FME rollout status support (#838):

  • Governance: multi-scope CRUD dispatch tests for policy / policy_set (resource_scope account/org/project)
  • Infrastructure: bodyBuilder yaml synthesis and environment Infrastructure-section deep links
  • FME rollout prompt: prompt registration, dual-mode scope validation, legacy vs Harness-native interpolation
  • Prompt cleanup: removed dead nativeModeCaveat from feature-flag-rollout (computed but never appended; obsolete after feat: wire native FME traffic type and rollout status lists #838)

Standards review summary

Rule Status
11 consolidated MCP tools only (registerTool, no new handlers) ✅ enforced by architecture.test.ts
Pure-data toolsets (no HarnessClient/Registry/logger)
stderr-only logging (no console.log in src/)
Singleton HarnessClient in src/index.ts
Shared response extractors
Scope injection via registry (no manual scope queryParams)
Zod v4 + .describe() on tool inputs
Write tools require elicitation / confirm
operationPolicy on every endpoint

Note: Automation snapshots referencing "10 tools", Zod v3, or server.tool() are outdated. Canonical source is docs/coding-standards.md (11 tools incl. harness_schema, Zod v4, registerTool()).

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other — standards compliance audit + test coverage

Checklist

  • pnpm test passes (3105 tests)
  • pnpm typecheck passes
  • pnpm build passes
  • pnpm standards:check passes (77 tests)
  • pnpm docs:check not required (no registry/tool count changes)

Coding Standards (registry-driven MCP model)

  • No new server.registerTool() calls
  • No toolset or handler architecture changes beyond prompt dead-code removal
Open in Web View Automation 

cursoragent and others added 2 commits August 20, 2026 22:26
Add regression tests for recently merged high-risk paths:

- feature-flag-rollout prompt: dual-mode scope validation (workspaceId vs
  orgId+projectId) and Harness-native NYI caveat surfacing (#806)
- policy/policy_set get/create/update/delete: verify resource_scope
  account/org/project param injection matches list behavior (#819)
- infrastructure deep links: nested environmentRef aliasing and
  environment_id param fallback when API omits environmentRef (#809)

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Remove unused nativeModeCaveat from feature-flag-rollout prompt now that
fme_rollout_status is wired on main (#838). Update harness-native test
assertions to match the current prompt text.

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