Reframe backend taxonomy: git-branch type + one-of-each-type mirrors · Entire

Reframe backend taxonomy: git-branch type + one-of-each-type mirrors

d0e4056→main·

Soph·3w ago·5 files·+155 added/-65 removed

The registered type "git" conflated "uses git" with "stores on a git branch". Rename it to "git-branch" (the current backend stores the committed record on the entire/checkpoints/v1 branch); this leaves room for a future git-refs backend in the same git-backed family.

Replace the string-equality constraints with a declared capability and a topology rule:

A future per-mirror config (same type, distinct repo/refs) could relax the one-of-each-type rule further.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

b6014c28999aView transcript

Changes

5

// json-encode the path so separators / spaces are escaped correctly.
encodedPath, err := json.Marshal(mirrorDir);
require.NoError(t, err);
body := `{"enabled": true, "checkpoints": {"primary": {"type": "git"}, "mirrors": [{"type": "fs", "config": {"path": ` + body := `{"enabled": true, "checkpoints": {"primary": {"type": "git-branch"}, "mirrors": [{"type": "fs", "config": {"path": ` +
string(encodedPath) + `}}]}}`;
require.NoError(t, os.MkdirAll(filepath.Join(repoDir, ".entire"), 0o755));
require.NoError(t, os.WriteFile(filepath.Join(repoDir, ".entire", "settings.json"), []byte(body), 0o644));

// Open resolves the checkpoint storage topology and constructs the backing // store(s). It keeps ref resolution, backend selection, and blob-fetcher wiring // in one place. The primary is built through the backend registry; with no // checkpoints config it resolves to the git backend with no mirrors, so default // behavior is unchanged. When mirrors are configured, the persistent store is a // fan-out wrapper (reads from primary, best-effort writes to each mirror). // checkpoints config it resolves to the git-branch backend with no mirrors, so // default behavior is unchanged. When mirrors are configured, the persistent // store is a fan-out wrapper (reads from primary, best-effort writes to mirrors). // Backend selection is read via settings.LoadCheckpointsConfig, which resolves // like settings.Load: from the context's worktree root if set, else relative to // the current working directory — not from repo. Callers opening a repository // that is not the cwd should wrap ctx with that worktree root (as dispatch does). // Resolution is fail-soft: a missing or unreadable settings file yields the // default git backend with no mirrors, preserving default behavior. // default git-branch backend with no mirrors, preserving default behavior.