Repository navigation
feat: branch and tag discovery, on-demand snapshots without pinning, FIFO capacity eviction - #14
Merged
Merged
Conversation
…FIFO capacity eviction - refs (MCP tool and GET /v1/repo/refs) lists and searches a registered repository's branches and tags from the remote, newest first, with author, title and time filters; catalogs are parsed into memory from tree-less scratch downloads that are always removed. - resolve accepts any branch or tag name of a registered repository and reports whether the commit is indexed; monitored branches keep the synchronized head. Remote lookups are coalesced, cached, bounded and back off on failure. - Preparing a full SHA no longer pins it. Retention runs after each preparation and index task; at 4096 snapshots or the storage budget the oldest unprotected snapshots are released in batches at safe points. - Git collection left by interrupted releases is finished by a separate background pass and before jobs start; retention markers are invalidated per path group before versions are revoked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Background
Users want to work with code on branches that are not monitored and on tags: resolve a branch name to a commit, list and search branches, and search and resolve tags. Until now a repository had at most 8 monitored branches,
resolverejected other branches withBRANCH_NOT_MONITOREDand could not resolve tags, preparing a full SHA pinned it automatically, and a full snapshot budget refused new work.Changes
refsandGET /v1/repo/refslist and search a registered repository's branches and tags from the remote, newest first, with name, author, title and time filters and paging. Catalogs live in memory; each refresh lists the remote first (beyond 200,000 per kind only names are kept), then downloads commit and tag objects without file trees into a scratch directory that is parsed and removed.refs/heads|tags/..., returning the commit, whether it is indexed and its commit details; monitored branches keep the synchronized head. Remote lookups are coalesced, cached (including "not found"), bounded (64 running or waiting) and back off on failure; resolution uses the refs actually downloaded, and unverifiable objects return a retryable error.docs/interfaces.md,docs/snapshots.md, README; website copy and the Connect page.Risks
Backward compatibility
commit/indexed/committer_timeand the behavior for monitored branches and full SHAs are unchanged.SNAPSHOT_LIMIT/REPOSITORY_STORAGE_LIMITare returned only when protected snapshots fill the limit; new codesREF_*,REFS_*,REMOTE_*,RECLAIM_FAILED.Testing
make check(gofmt, go vet),check-web,go test ./...,go test -race ./internal/service/ ./internal/gitstore/and the production build pass.internal/gitstore/refs_test.go(real Git fixture: listing, exact lookup, filtered fetch, tag of a tree, download abort, marker invalidation and permission errors);internal/service/refs_test.go(resolve forms, ambiguity, not found, non-commit, moved refs, refs filters, sorting, paging, names-only, truncation, first-listing preparation, failed refresh keeps the catalog, private repositories 404, lookup queue bound);internal/service/eviction_test.go(FIFO order, protection, batches, error causes, release before fetch, end-to-end sync after eviction, aborted invalidation, per-group invalidation, inaccessible repository).microsoft/vscode(6,356 refs): first catalog 10.2 s, cached query 26 µs, remote exact resolve 6.2 s, no scratch directories left.🤖 Generated with Claude Code