Skip to content

Add partial-clone mirror caches and config upgrade#5

Merged
realityforge merged 2 commits into
mainfrom
codex/partial-clone-cache
Jul 11, 2026
Merged

Add partial-clone mirror caches and config upgrade#5
realityforge merged 2 commits into
mainfrom
codex/partial-clone-cache

Conversation

@realityforge

Copy link
Copy Markdown
Owner

What changed

  • add braid add --partial-clone, restricted to mirrors with --path
  • hydrate repository-local caches with Git's blob:none filter and fetch partial downstream objects directly from the filter-capable upstream
  • add recoverable cache-mode replacement and strict promisor metadata validation
  • upgrade .braids.json to version 2 with optional partial_clone
  • add braid upgrade-config [--no-commit] with isolated commit/staging behavior and rollback
  • update completion, documentation, migration guidance, and integration coverage

Why

Path mirrors can otherwise download large blobs that live outside the selected upstream subtree. Partial clone avoids transferring and storing those unrelated blobs while preserving the existing full-cache behavior by default.

The downstream fetch intentionally connects directly to upstream rather than serving the promisor cache through local upload-pack. A real Git exercise showed that serving the partial bare cache can recursively hydrate omitted objects and hang.

Validation

  • bazel run @rules_go//go -- fmt ./...
  • git diff --exit-code
  • git --version
  • git merge-tree --write-tree "--merge-base=HEAD^{tree}" "HEAD^{tree}" "HEAD^{tree}"
  • bazel test --test_env=PATH //...
  • bazel run @rules_go//go -- vet ./...
  • bazel run @rules_go//go -- run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.0 run
  • bazel test --test_env=PATH //integration/...

Integration coverage verifies add/pull materialization, rejection of filter-incapable upstreams, config upgrade commit/no-commit behavior, and absence of a known unrelated blob from both cache and downstream with lazy fetch disabled.

Add opt-in blobless repository-local cache hydration for path mirrors, config version 2 migration, and the upgrade-config command.
@realityforge realityforge marked this pull request as ready for review July 11, 2026 10:40
@realityforge realityforge merged commit 0384d71 into main Jul 11, 2026
5 checks passed
@realityforge realityforge deleted the codex/partial-clone-cache branch July 11, 2026 10:40
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