Skip to content

test: strengthen coding-standards guardrails for security and multi-scope pathBuilders#675

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

test: strengthen coding-standards guardrails for security and multi-scope pathBuilders#675
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/mcp-server-coding-standards-bc31

Conversation

@cursor

@cursor cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Description

Audited the codebase against docs/coding-standards.md and confirmed existing source already complies with the registry-driven MCP architecture. This PR adds automated guardrails that were missing from main to prevent future drift.

Added enforcement

  • tests/coding-standards/security.test.ts (§9) — secret resource is metadata-only (list/get), no value-exposing body fields in the secrets toolset, RateLimiter in HarnessClient, and response redaction via redactJsonString.
  • tests/coding-standards/multi-scope-pathbuilders.test.ts (§4) — custom pathBuilder functions that encode account/org/project in the URL path must accept PathBuilderConfig and honor HARNESS_ORG / HARNESS_PROJECT defaults.
  • tests/coding-standards/docs-consistency.test.ts extensionsAGENTS.md alignment, registerTool() (not deprecated server.tool()), and multi-scope pathBuilder documentation.
  • docs/coding-standards.md — documents the multi-scope pathBuilder contract.

Standards snapshot note

The automation prompt referenced an older standards snapshot (10 tools, Zod v3, server.tool()). Canonical docs and enforcement use 11 consolidated tools (including harness_schema), Zod v4, and registerTool().

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (test guardrails)

Checklist

  • pnpm test passes (121 files / 2619 tests)
  • pnpm typecheck passes
  • pnpm build passes
  • pnpm standards:check passes (12 files / 92 tests)
  • pnpm docs:check not required (no registry/tool count changes)

Coding Standards (registry-driven MCP model)

  • No new server.registerTool() calls
  • No runtime code changes — test and documentation guardrails only
Open in Web View Automation 

cursoragent and others added 3 commits July 21, 2026 15:36
…cope pathBuilders

Add automated enforcement for docs/coding-standards.md §4 and §9:
- security.test.ts: secret read-only metadata, RateLimiter, response redaction
- multi-scope-pathbuilders.test.ts: PathBuilderConfig contract for scope-encoding pathBuilders
- docs-consistency.test.ts: lock 11-tool model, registerTool, pathBuilder docs, AGENTS.md alignment
- docs/coding-standards.md: document multi-scope pathBuilder rules

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
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