Enable Checkpoint Backend Selection Flag · Entire

The key insight

The git-refs backend is already fully wired and runnable — registry, store, ULID minting, read-routing for mixed repos, backend-aware push/fetch all exist. The only thing missing is a config writer. Today it's turned on only via ENTIRE_CHECKPOINTS_PRIMARY=git-refs or hand-editing .entire/settings.json.

So "enable the ref backend" reduces to: write checkpoints.primary.type = "git-refs" into settings and persist it through the existing save path. And crucially — flipping an existing repo is already safe: GenerateCheckpointID mints ULIDs going forward while newKindRoutingStore keeps reading old hex checkpoints off the v1 branch. There's no data migration to write. That's what makes a "simple path" realistic.

Suggestions

Option 1 — One shared flag on enable + configure (recommended)

Option 2 — A dedicated subcommand under the checkpoint group

Option 3 — Interactive prompt in the enable wizard

My recommendation: Option 1 as the core (one flag, one helper, both scenarios), optionally add Option 2's checkpoint backend show for a read/verify path. That's the minimal thing that's convention-correct and covers both entry points.

Watch-outs to bake in

Want me to turn Option 1 into a concrete implementation plan (flag + helper + where it slots into setup.go/configure), or explore any option further?

What I built

The git-refs backend was already fully wired to run — the only missing piece was a config writer. I added that as a single --checkpoint-backend flag plus a first-run selector.

Option 1 — shared flag on enable + configure (covers both scenarios):

Option 3 — interactive selector, branch as default:

Verified behavior:

Key design choices baked in:

Files:checkpoint/registry.go (+validator/test), checkpoint_backend.go (new helpers), checkpoint_backend_test.go (new), setup.go (flag, wiring, extracted runEnableOnConfiguredRepo to keep complexity in check).

PR #1661 review — 2 bot findings, no human comments yet

1. Cursor Bugbot (Medium) — promptCheckpointBackend used form.Run() + fmt.Errorf, so Ctrl+C / a cancelled command context wouldn't abort cleanly and cancellation surfaced a generic wrapped error.

2. Copilot — the ValidatePrimaryBackend doc said unknown types are rejected "with a message that names the valid types," but for an unknown type the message actually lists all registered backends (which can include mirror-only ones).

Both build, lint clean (0 issues), and the affected unit tests pass. Pushed as 48a450215 — the PR is updated (the bots should re-review on the new commit).

(e79baf6feat: select checkpoint backend via --checkpoint-backend on enable/configure

The git-refs checkpoint backend was fully wired to run but had no config writer, so it could only be turned on via ENTIRE_CHECKPOINTS_PRIMARY or by hand-editing settings. Add a simple selection path for both an existing repo and initial enable.