refactor(test): migrate rewind --list consumers to checkpoint list --pending --json · Entire
refactor(test): migrate rewind --list consumers to checkpoint list --pending --json
dc4907e→main·
suhaanthayyil·2d ago·6 files·+14 added/-13 removed
Repoint every reader of the removed rewind --list listing at
checkpoint list --pending --json. The parsed JSON shape is identical, so
downstream call sites are untouched:
- integration_test/testenv.go TestEnv.GetRewindPoints() (drives ~48 call sites)
- integration_test/setup_cmd_test.go TestRewindBlockedWhenDisabled invocation
- testutil/testutil.go RewindPoint doc comment
- e2e/entire/entire.go RewindList() harness helper + RewindPoint doc
- WINDOWS.md, .claude/skills/test-repo/SKILL.md docs
The rewind action helpers (env.Rewind / entire.Rewind / RewindLogsOnly) are
unchanged — they exercise checkpoint rewind --to, which still exists.
Changes
6
.claude/skills/test-repo
MSKILL.md+1/-1
MWINDOWS.md+1/-1
cmd/entire/cli
integration_test
Msetup_cmd_test.go+3/-3
Mtestenv.go+5/-4
testutil
Mtestutil.go+1/-1
e2e/entire
Mentire.go+3/-3
176 unmodified lines
177
178
179
180
180
181
182
183
176 unmodified lines
/tmp/entire-bin hooks claude-code post-task
# Verify task checkpoint created
/tmp/entire-bin rewind --list | jq '.[] | select(.is_task_checkpoint == true)'
/tmp/entire-bin checkpoint list --pending --json | jq '.[] | select(.is_task_checkpoint == true)'
```
### Test User Commits (Condensation)
M.claude/skills/test-repo/SKILL.md+1/-1
79 unmodified lines
80
81
82
83
83
84
85
86
79 unmodified lines
2. `entire.exe enable` — in a git repo with an agent installed
3. Start an agent session, make file changes
4. `git add . && git commit -m "test"` — hooks should fire (prepare-commit-msg, post-commit)
5. `entire.exe rewind --list` — should show checkpoint(s)
5. `entire.exe checkpoint list --pending --json` — should show checkpoint(s)
6. `entire.exe explain` — pager should use `more` by default
## Architecture Notes
MWINDOWS.md+1/-1
103 unmodified lines
104
105
106
107
108
107
108
109
110
110
111
112
113
103 unmodified lines
// Disable Entire
env.SetEnabled(false)
// Try to run checkpoint rewind --list - should show disabled message (not error)
stdout, err := env.RunCLIWithError("checkpoint", "rewind", "--list")
// Try to run checkpoint list --pending --json - should show disabled message (not error)
stdout, err := env.RunCLIWithError("checkpoint", "list", "--pending", "--json")
if err != nil {
t.Fatalf("checkpoint rewind --list command failed unexpectedly: %v\nOutput: %s", err, stdout)
t.Fatalf("checkpoint list --pending --json command failed unexpectedly: %v\nOutput: %s", err, stdout)
}
if !strings.Contains(stdout, "Entire is disabled") {
t.Errorf("Expected disabled message, got: %s", stdout)
}
Mcmd/entire/cli/integration_test/setup_cmd_test.go+3/-3
719 unmodified lines
720 721 722 723 724 725 723 724 725 726 727 728 729 1 unmodified line
731 732 733 733 734 735 736 737
719 unmodified lines
func (env *TestEnv) GetRewindPoints() []RewindPoint { env.T.Helper()
// Run rewind --list using the shared binary. Parse stdout only — the
// deprecated command prints a notice on stderr that would break the JSON.
cmd := exec.Command(getTestBinary(), "checkpoint", "rewind", "--list")
// Run checkpoint list --pending --json using the shared binary. This is
// the drop-in replacement for the removed rewind --list; the JSON shape is
// identical. Parse stdout only — any notice goes to stderr.
cmd := exec.Command(getTestBinary(), "checkpoint", "list", "--pending", "--json")
cmd.Dir = env.RepoDir
cmd.Env = env.cliEnv()
1 unmodified line
cmd.Stderr = &stderr output, err := cmd.Output() if err != nil { env.T.Fatalf("rewind --list failed: %v\nOutput: %s\nStderr: %s", err, output, stderr.String()) env.T.Fatalf("checkpoint list --pending --json failed: %v\nOutput: %s\nStderr: %s", err, output, stderr.String()) }
// Parse JSON output
Mcmd/entire/cli/integration_test/testenv.go+5/-4
17 unmodified lines
18 19 20 21 21 22 23 24
17 unmodified lines
"github.com/go-git/go-git/v6/plumbing/object"
// RewindPoint mirrors the rewind --list JSON output.
// RewindPoint mirrors the checkpoint list --pending --json JSON output.
type RewindPoint struct {
ID string json:"id"
Message string json:"message"
}
Mcmd/entire/cli/testutil/testutil.go+1/-1
21 unmodified lines
22 23 24 25 25 26 27 28 36 unmodified lines
65 66 67 68 68 69 70 71 71 72 73 74
21 unmodified lines
return p
// RewindPoint represents a single entry from entire rewind --list.
// RewindPoint represents a single entry from entire checkpoint list --pending --json.
type RewindPoint struct {
ID string json:"id"
Message string json:"message"
}
36 unmodified lines
return run(t, dir, "clean", "--force")
// RewindList runs entire checkpoint rewind --list and parses the JSON output.
// RewindList runs entire checkpoint list --pending --json and parses the JSON output.
func RewindList(t *testing.T, dir string) []RewindPoint {
t.Helper()
out := runStdout(t, dir, "checkpoint", "rewind", "--list")
out := runStdout(t, dir, "checkpoint", "list", "--pending", "--json")
var points []RewindPoint if err := json.Unmarshal([]byte(out), &points); err != nil {
Me2e/entire/entire.go+3/-3