test(standards): strengthen coding-standards guardrails and verify PR #581 compliance#583
Draft
cursor[bot] wants to merge 2 commits into
Draft
Conversation
Add pipelineHandler unit tests that verify non-terminal executions are rejected before YAML/log fetches and that the error propagates instead of being swallowed into execution_error. Extend poll-execution tests so ApprovalRejected and Suspended stop wait-mode polling and Suspended is explicitly non-failure. Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Strengthen automated enforcement of coding-standards.md: - Secret resource remains read-only metadata (no create/update/delete) - HarnessClient uses RateLimiter and redacts error log bodies by default - Write handlers use formatBodyPreview for confirmation prompts - Docs-consistency tests lock key architecture and safety rules in AGENTS.md 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.
Description
Coding-standards compliance review for PR #581 and the broader codebase. The audit confirmed the registry-driven MCP architecture is followed; this PR adds automated guardrails for safety/security rules that were documented but not yet enforced by tests.
Compliance review (PR #581)
PR #581 (
test: unit coverage for diagnose terminal-status guard) is standards-compliant:tests/tools/diagnose/andtests/utils/toMcpError, user-facing rejection for non-terminal executions)New guardrails
tests/coding-standards/security.test.ts— enforces §9 safety rules:formatBodyPreviewfor elicitation redactiondocs-consistency.test.ts— prevents docs drift on logging, singleton client, pure-data toolsets, and write confirmationAGENTS.md— links todocs/coding-standards.mdand documentspnpm standards:checkNote on canonical standards
The canonical docs use 11 consolidated tools (includes
harness_schema), Zod v4 (zod/v4), andregisterTool()(not deprecatedserver.tool()). Write safety usesconfirm+confirmViaElicitation.Type of Change
Checklist
pnpm testpasses (2476 tests)pnpm typecheckpassespnpm buildpassespnpm standards:checkpasses (88 guardrail tests)pnpm docs:checkpasses (if registry/tool counts changed)Coding Standards (registry-driven MCP model)
server.registerTool()callsconsole.log()insrc/