# clear turn checkpoint IDs on policy block

`d23a5cf`→[main](/content/gh/entireio/cli/commits/main/index.html)·

pfleidi·3w ago·2 files·+3 added/-2 removed

Clear pending turn checkpoint IDs when checkpoint finalization is blocked by local checkpoint policy.

This matches the other best-effort finalization failures and allows ended sessions to release their shadow branches.

## Sessions

eff17371d4cdView transcript

[?\
Checkpoint Policy Enforcement and ValidationCodex·GPT-5.5·4 steps](/content/gh/entireio/cli/session/019efaa9-f5b2-72c0-bf9d-a2a75869ea82#timeline-eff17371d4cd/index.html)

## Changes

2

- cmd/entire/cli/strategy

- Mcheckpoint_policy_test.go+2/-2

- Mmanual_commit_hooks.go+1

```
78 unmodified lines

79
80
81
82
82
83
84
85
20 unmodified lines

106
107
108
109
109
110
111
112

78 unmodified lines

require.Positive(t, state.StepCount)
}

func TestFinalizeAllTurnCheckpointsPolicyBlockKeepsTurnCheckpointIDs(t *testing.T) {
func TestFinalizeAllTurnCheckpointsPolicyBlockClearsTurnCheckpointIDs(t *testing.T) {
	workDir := setupGitRepo(t)
	t.Chdir(workDir)
	paths.ClearWorktreeRootCache()
20 unmodified lines

errorCount := NewManualCommitStrategy().finalizeAllTurnCheckpoints(context.Background(), state)
	require.Equal(t, 1, errCount)
	require.Equal(t, []string{"a1b2c3d4e5f6"}, state.TurnCheckpointIDs)
	require.Empty(t, state.TurnCheckpointIDs)
}

func TestPrePushSkipsCheckpointPushWhenPolicyWriteUnsupported(t *testing.T) {
```

Mcmd/entire/cli/strategy/checkpoint_policy_test.go+2/-2

```
2786 unmodified lines

2787
2788
2789
2790
2791
2792
2793

2786 unmodified lines

}
defer repo.Close()
if err := checkCommittedCheckpointWritePolicy(logCtx, repo); err != nil {
	state.TurnCheckpointIDs = nil
	return 1
}
```

Mcmd/entire/cli/strategy/manual_commit_hooks.go+1
