Skip to content

refactor(search): type repository, user, org and commit search tools - #3395

Draft
SamMorrowDrums wants to merge 1 commit into
sammorrowdrums-typed-granular-issue-toolsfrom
sammorrowdrums-typed-search-tools
Draft

SamMorrowDrums wants to merge 1 commit into
sammorrowdrums-typed-granular-issue-toolsfrom
sammorrowdrums-typed-search-tools

Conversation

@SamMorrowDrums

Copy link
Copy Markdown
Collaborator

Summary

Migrate exactly search_repositories, search_users, search_orgs, and search_commits to concrete typed inputs and outputs. This draft is a focused layer above #3394; native stack registration is left to the coordinator.

Why

Continue the protocol-gated typed read/search migration without changing legacy text responses or search semantics.
Fixes # N/A — migration layer above #3394, not an issue-closing change.

What changed

  • Use existing NewTool[In, Out] registration and shared pagination/schema helpers, preserving legacy coercion, zero/default pagination, type qualifiers, sanitization, errors, scopes, IFC labels, and repository minimal/full output selection.
  • Model full repository responses with a concrete recursive DTO and JSON-compatible custom-property union, avoiding upstream map[string]any; test upstream field coverage and absence of untyped output fields.
  • Add modern (2026-07-28), legacy (2025-11-25), and unknown-protocol list/call coverage, byte-exact text assertions, success/empty/error cases, schema Resolve and actual structured output validation. Update relevant snapshots.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
    Modern negotiated clients receive concrete output schemas and validated structured content. Legacy/unknown clients retain text and see neither; input schema definitions and legacy text ordering are unchanged.
  • New tool added

Prompts tested (tool changes only)

  • Automated MCP calls (mock GitHub API, not live prompts): search repositories/users/orgs/commits with query: "repo:owner/repo fix"; verify default and string/numeric-zero pagination and nonzero string coercion.
  • Automated MCP calls with query: "type:org (location:seattle OR location:california)" verify that an existing type qualifier is not duplicated.
  • Repository search with minimal_output: false/true, recursive custom properties, empty responses, and errors; user/org sparse profiles and commit metadata/IFC labels.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
    Existing public-read and read:org scope requirements are unchanged; client/API failures remain tool errors.
  • Data exposure, filtering, or token/size limits considered
    Preserve compact default responses, explicit full repository output, existing sanitization, and IFC metadata. No new fields are exposed beyond existing full output.

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
    script/lint: passed, 0 issues.
  • Tested locally with ./script/test
    script/test: passed (go test -race ./...); pkg/github reported ok in 140.083s.

Additional validation:

  • UPDATE_TOOLSNAPS=true go test ./...: passed; pkg/github reported ok in 16.065s.
  • go test ./pkg/github -run 'TestTypedAccountRepositorySearch|TestSearchRepositoryOutputCoversUpstreamFields|TestSearchPropertyValueJSONUnion|TestSearchOutputsHaveNoUntypedFields' -count=1: passed (0.343s).
  • script/generate-docs: passed; reported successful updates to README and remote-server/insiders-features/feature-flags/tool-renaming docs, with no resulting documentation diff.
  • git diff --check: passed.

The final required sequence was script/lint → script/test → script/generate-docs → git diff --check, all exit 0. Live E2E tests were not run (require a GitHub PAT).

Parent verification: original local/live #3394 head was 83955ca85c929687a0630503dcc061b1b9af4537; synchronized before edits to the license-bot commit a6b1d6931d0f2e20c62f6fe6b03b1416a5acc93d. That parent delta changes only three license files (3 insertions, 3 deletions). Final merge-base is exactly a6b1d6931d0f2e20c62f6fe6b03b1416a5acc93d; the only layer commit is c918f4b7b9f570f468e7b4566e2392acd2f1b44c, touching eight search implementation/test/snapshot files. License-bot commit is unchanged. Signing failed with 1Password: failed to fill whole buffer; retried using command-local git -c commit.gpgsign=false commit only.

Docs

  • Not needed
    Documentation generation completed and produced no content changes.
  • Updated (README / docs / examples)

Preserve legacy text and search semantics while publishing protocol-gated concrete structured outputs. Cover modern, legacy, and unknown clients, full repository JSON unions, defaults, IFC labels, and errors.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

1 participant