feat(enable): default new setups to the git-refs checkpoint backend · Entire
feat(enable): default new setups to the git-refs checkpoint backend
5a5f202→main·
peyton-alt·11h ago·3 files·+67 added/-46 removed
Drop the Branch-vs-Refs wizard question — a storage-topology choice is unanswerable during first-time setup — and instead write checkpoints.primary.type: git-refs explicitly into the new settings.json on every first run (interactive wizard and --agent alike). One less setup step.
Nothing else moves: - --checkpoint-backend branch still wins over the default; its help text now names refs as the new-setup default. - The config-less runtime fallback stays git-branch, so repos set up before this change keep their behavior; re-running enable on such a repo does not inject a checkpoints block (pinned by test). - Switching later stays one command (entire configure --checkpoint-backend), read routing keeps both formats readable, and doctor migrate-checkpoints still converts history outright.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Changes
3
cmd/entire/cli
Mcheckpoint_backend.go-35
Msetup.go+14/-11
Msetup_test.go+53
6 unmodified lines
7
8
9
10
11
10
11
12
91 unmodified lines
104
105
106
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
6 unmodified lines
"slices"
"strings"
"charm.land/huh/v2"
"github.com/entireio/cli/cmd/entire/cli/checkpoint"
"github.com/entireio/cli/cmd/entire/cli/paths"
"github.com/entireio/cli/cmd/entire/cli/settings"
91 unmodified lines
fmt.Fprintf(w, "✓ Checkpoint backend set to %s (%s)\n", typ, configDisplay)
return nil
}
// promptCheckpointBackend asks the user to choose a checkpoint storage backend
// during first-time interactive setup. The default is the git-branch backend;
// the git-refs backend is offered as the selectable alternative. It returns the
// canonical backend type, or "" when the user kept the default (or cancelled) so
// the caller can skip writing a redundant config block. Callers must gate this
// on an interactive terminal.
//
// Cancellation (Ctrl+C or a cancelled ctx) is treated like keeping the default:
// it prints a "cancelled" line and returns ("", nil) so enable continues with
// the default backend, matching the optional-prompt behavior elsewhere in setup.
func promptCheckpointBackend(ctx context.Context, w io.Writer) (string, error) {
choice := checkpoint.BackendTypeGitBranch
form := NewAccessibleForm(
huh.NewGroup(
huh.NewSelect[string]().
Title("Checkpoint storage backend").
Description("How Entire stores committed session checkpoints in your repo.").
Options(
huh.NewOption("Branch — one shared branch, entire/checkpoints/v1 (default)", checkpoint.BackendTypeGitBranch),
huh.NewOption("Refs — one git ref per checkpoint", checkpoint.BackendTypeGitRefs),
).
Value(&choice),
),
)
if err := form.RunWithContext(ctx); err != nil {
return "", handleFormCancellation(w, "Checkpoint backend selection", err)
}
if choice == checkpoint.BackendTypeGitBranch {
return "", nil
}
return choice, nil
}