Skip to content

fix: resource_scope fail-loud dispatch, search type filtering, Zod descriptions#184

Draft
thisrohangupta wants to merge 10 commits into
mainfrom
cursor/pr182-architecture-scope-fixes-ce19
Draft

fix: resource_scope fail-loud dispatch, search type filtering, Zod descriptions#184
thisrohangupta wants to merge 10 commits into
mainfrom
cursor/pr182-architecture-scope-fixes-ce19

Conversation

@thisrohangupta
Copy link
Copy Markdown
Collaborator

Description

Addresses the three architecture-review items raised on PR #182 (explicit resource_scope fail-open behavior, broad harness_search fan-out, and Zod 4 .describe() ordering).

  • Registry dispatch: When callers set resource_scope to org or project, require a resolved organization (from org_id or HARNESS_ORG) and, for project scope, a resolved project (project_id or HARNESS_PROJECT) before building the request. This prevents empty scope params from widening the API call.
  • harness_search: After URL defaults merge, filter list targets to resource types where supportsResourceScope includes the requested scope. Return a clear user-facing error if nothing remains. Added Registry.supportsResourceScope() for reuse.
  • Zod inputs: resource_scope on harness_list, harness_get, and harness_search now uses .optional().describe(...) so descriptions are preserved for agents (Zod 4).

Tests: new registry cases for missing org/project under explicit scope; new search case for pipelines,connectors + resource_scope: account ensuring no pipeline list calls.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Checklist

  • Tests pass (pnpm test on touched suites; pnpm typecheck; pnpm build)
  • Typecheck passes

Note: This branch is based on the current head of PR #182 so the review fixes stack cleanly; it can be merged after #182 or the commits can be cherry-picked onto that PR branch as preferred by maintainers.

Slack Thread

Open in Web Open in Cursor 

cursoragent and others added 10 commits May 13, 2026 01:17
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>
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>
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>
Fail dispatch when resource_scope is org or project but org_id/HARNESS_ORG
or project_id/HARNESS_PROJECT are absent, so requests do not widen silently.
harness_search now limits target types to definitions that support the
requested scope. Zod 4 resource_scope fields use .optional().describe() so
descriptions are preserved for agents.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants