Skip to content

feat: search without an index, remote reads, tags and token scopes, CLI and skill - #22

Merged
qiansc merged 1 commit into
mainfrom
feat/remote-reads-and-cli
Nov 28, 2026
Merged

qiansc merged 1 commit into
mainfrom
feat/remote-reads-and-cli

Conversation

@qiansc

@qiansc qiansc commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Brings the service up to date with the current Source Graph design and adds a command-line client and an agent skill.

Search and reads

  • Commits without their own index are still searched: from the nearest index plus the files changed since (Meta.Hybrid), or by scanning their files (Meta.Unindexed). Large repositories index heads at a paced rate and keep older indexes in tiers.
  • Long-lived git cat-file readers serve file reads (SOURCEGRAPH_GIT_READER_POOL=off turns them off; they are skipped on a Git without --batch-command -Z and %(objectmode)).
  • Remote reads for checkout-free clients (documented in docs/interfaces.md#remote-reads): diff NamesOnly, POST /v1/repo/blob and /blobs, /v1/repo/scope-availability, /v1/repo/directories, and contents-only preparation (kind: content, MCP content_only). Truncated diff patches now return their leading whole lines.
  • Retrieval requests reuse a recent authentication for up to 60 seconds; query errors record step timings and caller-side warning levels.

Repositories and access

  • Tags, manual-only updates, resuming paused updates; personal tokens narrowed to tagged or non-public repositories.
  • Command-line sign-in through the website (/auth/cli/*), stored in MongoDB or the SQL document store.
  • Site appearance (site name), storage capacity and a GitHub proxy setting.

Clients

  • cli/: the sourcegraph CLI, attached to every GitHub Release as sourcegraph-cli.tgz by .github/workflows/cli-release.yml (published to npm as well once an NPM_TOKEN secret exists).
  • skills/sourcegraph: an agent skill (npx skills add context4ai/sourcegraph --skill sourcegraph); the repository is also a Claude Code plugin marketplace.

Compatibility

  • Existing HTTP routes, MCP tools and their defaults are unchanged; new fields and parameters are optional.
  • MongoDB URIs may name the database in their path; without one the existing c4a database is used.
  • Single-instance SQLite, PostgreSQL and MongoDB deployments keep their data: the new version was started on a data volume written by the current release and served the existing repository and indexes.

Testing

  • bun run check, go test -p 1 ./..., python3 scripts/audit-public.py.
  • Storage contract test on SQLite, PostgreSQL 17 and MongoDB 8 (replica set).
  • Docker image end to end: fresh SQLite volume, upgrade from the current main image on the same volume, and a MongoDB backend — registration, sync, index, search, read, list, blob, blobs, directories, scope-availability, names-only diff, MCP tools/list, and the CLI against the running service.
  • Website pages (home, repositories, repository, connect, operations, code reader, sign-in) rendered in headless Chromium without console errors.

🤖 Generated with Claude Code

…LI and skill

Search and reads
- Commits without their own index are searched from the nearest index plus
  the files changed since (Meta.Hybrid), or by scanning their files
  (Meta.Unindexed); large repositories index heads at a paced rate and keep
  older indexes in tiers.
- Long-lived git cat-file readers serve file reads; SOURCEGRAPH_GIT_READER_POOL=off
  turns them off.
- Remote reads for checkout-free clients: diff NamesOnly (metadata only),
  POST /v1/repo/blob and /blobs (raw bytes, framed batches),
  /v1/repo/scope-availability and /v1/repo/directories, and contents-only
  preparation (prepare kind content, MCP content_only).
- Retrieval reuses a recent authentication for up to 60 seconds; query
  errors record step timings and caller-side warning levels.

Repositories and access
- Tags, manual-only updates and a resume for paused updates.
- Personal tokens can be narrowed to tagged or non-public repositories.
- Command-line sign-in through the website (/auth/cli/*), on MongoDB and SQL.
- Site appearance (site name), storage capacity and a GitHub proxy setting.

Clients
- cli/: the sourcegraph command-line client (search, read, diff, repository
  and site administration), released as a tarball on GitHub Releases.
- skills/sourcegraph: an agent skill; the repository is also a Claude Code
  plugin marketplace.
- MongoDB URIs name their database in the path (default c4a).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qiansc
qiansc merged commit b13726e into main Nov 28, 2026
3 checks passed
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