test: extend automated coding standards enforcement#414
Closed
cursor[bot] wants to merge 4 commits into
Closed
Conversation
Update version across package.json, both manifest files, and the release-metadata test that keeps them in sync. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> AI-Session-Id: 1b46c8db-abe4-4e9f-a38b-750362ead8ac AI-Tool: claude-code AI-Model: unknown
Expand automated architecture guardrails to cover: - Global fetch() limited to documented exceptions (HarnessClient, log-resolver CDN blobs, audit webhooks) - HarnessClient instantiation only in src/index.ts - Zod v4 import convention in tool handlers and config - Explicit openWorldHint annotations on all tool handlers - No deprecated server.tool() usage - Runtime registry contract checks (scope, identifierFields, operationPolicy) Document fetch() exceptions in docs/coding-standards.md. Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
…apperKey scope injection Add regression tests for high-blast-radius utilities and registry paths that lacked focused coverage after recent merges: - formatBodyPreview redacts content/content_base64 before write elicitation - parseZipCsv and dashboardDataExtract handle store and deflate ZIP CSVs - connector create injects org/project scope inside bodyWrapperKey wrapper and validates bodySchema fields against the wrapped payload Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
- Add tool-handlers.test.ts covering Zod .describe(), confirm wiring, error mapping pattern, pagination defaults, and MCP annotations - Extend registry-contract.test.ts to verify executeActions operationPolicy - Fix harness-schema.ts to use standard isUserError/toMcpError catch pattern - Align docs/coding-standards.md confirm param naming with implementation Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
|
|
7 tasks
Collaborator
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
Audits the codebase against
docs/coding-standards.mdand strengthens automated guardrails so architecture rules are enforced in CI viapnpm standards:check.What was already compliant
The registry-driven model is in good shape:
harness_list…harness_schema) — no strayserver.registerTool()callsHarnessClient/ MCP SDK /Registryimports in toolset filesconsole.log()insrc/HarnessClientconstructed only insrc/index.tsfetch()exceptions — log blob CDN URLs and audit webhooks onlyscope,identifierFields, andoperationPolicyon all CRUD operationsChanges in this PR
New automated checks (
tests/coding-standards/tool-handlers.test.ts)inputSchemafield has.describe()(including shared schemas likeresourceScopeSchema)confirmViaElicitationand exposeconfirmparamisUserError→errorResult→throw toMcpErrorcatch pattern on API-facing handlersharness_listpagination defaults (page=0,size=20, max100)Extended registry contract tests
executeActionsnow verified foroperationPolicy.risk+retryPolicyCode fix
harness-schema.tsouter catch now follows the standard error mapping pattern instead of always returningerrorResultDocs alignment
docs/coding-standards.mdto referenceconfirm/ elicitation (was staleconfirmation: true)Verification
Known gaps (documented but not yet automated)
These remain manual review items for future guardrails:
knowledge-graph.ts,semantic-layer.ts)listFilterFieldson 15 get-only resources (should move toparamsSchemaper standards)passthroughusage volume (~200+) — acceptable only when API shape is already agent-facingyaml,preflightHTTP inccm.ts/scs.ts)