fix: require explicit scope for GitOps agent deletion#666
Draft
cursor[bot] wants to merge 3 commits into
Draft
Conversation
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>
This was referenced Jul 21, 2026
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
GitOps agent DELETE paths use raw, non-scope-prefixed identifiers, and the backend selects account/org/project scope from query parameters. The new delete operation allowed
resource_scopeto be omitted and even showed a project-level example without it, which sent an account-scoped DELETE. When the same raw ID existed at multiple scopes, this could delete the wrong agent.Require an explicit
resource_scopeforgitops_agentdeletion, correct all examples, and add registry/public-tool regressions proving omission fails before HTTP dispatch and explicit account/project scopes produce the correct query parameters.Validation: focused regressions (16 tests), complete GitOps/tool-handler suites (248 tests), full
pnpm test(117 files / 2557 tests),pnpm typecheck,pnpm build,pnpm standards:check,pnpm docs:check, andgit diff --check HEAD.Type of Change
Checklist
pnpm testpassespnpm typecheckpassespnpm buildpassespnpm standards:checkpasses (architecture guardrails — see docs/coding-standards.md)pnpm docs:checkpasses (if registry/tool counts changed)Coding Standards (registry-driven MCP model)
If this PR adds or changes Harness API coverage:
server.registerTool()calls — only toolset definitions insrc/registry/toolsets/ALL_TOOLSETSandToolsetNameunionoperationPolicyon every new/changed endpointsrc/registry/extractors.ts(no raw passthrough on real endpoints)identifierFieldsandscopedeclared on new resourcesconsole.log()insrc/(stdio JSON-RPC safety)