Add checkpoints backend selection settings and mirror fan-out

main

Commit

Soph2mo ago

Wire the registry to settings-driven backend selection and add independent backend mirroring.

Settings: a new checkpoints.{primary, mirrors} block using a discriminated {type, config} shape, read through a dedicated lenient loader (settings.LoadCheckpointsConfig). The loader is fail-soft by design — a missing file, whole-file JSON syntax error, or unrelated invalid settings all resolve to "no config" so checkpoint construction defaults to git; it errors only when a present checkpoints block is itself invalid. This avoids making Open newly fail on unrelated malformed settings (the strict settings.Load path still surfaces those for normal commands). The field also lives on EntireSettings so the strict loader accepts a checkpoints key.

Open: builds the primary and mirrors through the registry. The primary must be git (attach/resume/push/doctor/cleanup/OPF all assume a git refs.Primary), so a non-git primary is rejected. A git-typed mirror is rejected too: it would share the primary ref topology and double-write the same ref.

fanoutStore: serves all reads from the primary and writes to the primary first, then fans out best-effort to each mirror (failures logged, never surfaced). With no mirrors it returns the primary unwrapped, preserving its concrete type and optional capabilities. When wrapping, it preserves the optional AuthorReader iff the primary implements it, so explain's author fallback keeps working.

Mirrors are write-only and may lag the primary (no cleanup-delete or pre-push OPF fan-out); they must not become a read/sync source without reconciliation.

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

Checkpoints

Checkpoint Backend Registry and Settings-Driven Selection

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1