chore: strengthen coding standards enforcement and fix Zod describe order#383
Closed
cursor[bot] wants to merge 3 commits into
Closed
chore: strengthen coding standards enforcement and fix Zod describe order#383cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
…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>
|
|
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
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.describe()is the last call in schema chains (Zod 4 requirement — descriptions are lost when followed by.optional()/.default())src/index.tsmay constructnew HarnessClient()scopeandidentifierFields; get-capable resources with emptyidentifierFieldsmust 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.tsVerification
All 2091 tests pass; 13 coding-standards checks pass.
Standards compliance snapshot
console.log()in src/fetch()in tools/toolsets.describe()last in chainoperationPolicyon endpointspassthroughextractors (287 endpoints)