test: strengthen coding-standards guardrails#598
Draft
cursor[bot] wants to merge 2 commits into
Draft
Conversation
- Add shared constants.ts for the 11 consolidated MCP tool names - Add AGENTS.md consistency checks (tools, Zod v4, standards:check) - Add security checks (secret metadata, no value leakage, rate limiter) - Move scorecardStatsExtract to shared extractors.ts per standards §3 - Refactor architecture/docs tests to use shared constants Standards suite: 80 -> 88 tests; all pass with pnpm test (2486). Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reviewed the codebase against
docs/coding-standards.md(triggered by PR #597 schema sync). The existing 80-testpnpm standards:checksuite already enforces the registry-driven architecture; this PR strengthens coverage and fixes one minor standards violation.Changes
tests/coding-standards/constants.ts— single source of truth for the 11 consolidated MCP tool names (shared across guardrail tests)tests/coding-standards/agents-consistency.test.ts— keepsAGENTS.mdaligned with canonical docs (11 tools, Zod v4,pnpm standards:check)tests/coding-standards/security.test.ts— enforces §9 safety rules: secret metadata never exposes values, no secret field mapping in toolsets, IDP workflowapi_key_secretnot echoed in API body,RateLimiterinHarnessClientsrc/registry/extractors.ts— movedscorecardStatsExtractfrom inlineidp.ts(shared extractor rule §3)architecture.test.tsanddocs-consistency.test.tsto use shared constantsReview findings
registerTool()/server.tool()callsconsole.log()(stdio safety)HarnessClient+ no rawfetch()in handlers/toolsets.describe()on all input paramsconfirm+ elicitationpnpm standards:checkci.ymlNote: The standards snapshot in the automation prompt lists 10 tools and Zod v3 — the canonical docs (
docs/coding-standards.md,AGENTS.md) correctly document 11 tools (includingharness_schema) and Zod v4.Verification
pnpm standards:check— 88 tests (was 80)pnpm buildpnpm typecheckpnpm test— 2486 tests