Skip to content

test: cover file_content scope forwarding for Harness Code APIs#604

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-2713
Draft

test: cover file_content scope forwarding for Harness Code APIs#604
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-2713

Conversation

@cursor

@cursor cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

Adds registry dispatch tests for the file_content resource introduced in #602. That fix forwards orgIdentifier / projectIdentifier query parameters on file content and blame requests so Harness Code can resolve project-scoped repositories.

Risky behavior now covered

  • file_content get: org_id / project_id inputs are forwarded as orgIdentifier / projectIdentifier query params; omitted when not provided (account-scoped repos).
  • file_content blame execute: same scope forwarding for the blame action, including optional git_ref and line range params.
  • Toolset contract: structural assertions that queryParams maps use snake_case input keys (org_id, project_id) and that scopeOptional prevents silent config-default injection.

Test files added/updated

  • tests/registry/repositories.test.ts (new, 7 tests)

Why these tests materially reduce regression risk

Without scope forwarding, harness_get(resource_type="file_content") and harness_execute(..., action="blame") silently hit the wrong repository scope — the run succeeds but returns content from an account-level repo or 404s on project-scoped repos. This is the same class of silent-failure bug fixed in #579 (git context for input sets). The tests lock the dispatch contract so future refactors to scope injection or query param mapping cannot drop these params again.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other — test coverage

Checklist

  • pnpm test passes (targeted: tests/registry/repositories.test.ts)
  • pnpm typecheck passes
  • pnpm build passes
  • pnpm standards:check passes
  • pnpm docs:check passes
Open in Web View Automation 

sunilgattupalle and others added 2 commits July 9, 2026 19:58
AI-Session-Id: 103ece16-0d3e-4af0-a493-04e44aa113c9
AI-Tool: claude-code
AI-Model: unknown
Add registry dispatch tests for file_content get and blame execute
actions to guard #602 — orgIdentifier/projectIdentifier must be forwarded
when org_id/project_id are provided, and omitted for account-scoped
repos when scope is not specified.

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 all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ cursoragent
❌ sunilgattupalle
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