clean checkpoint version errors · Entire

clean checkpoint version errors

efc3ca2→main·

pfleidi·3w ago·6 files·+8 added/-8 removed

Preserve the checkpointpolicy error text at command boundaries without adding noisy wrapper prefixes.

Also clarify the multi-checkpoint resume log when no metadata can be resolved.

Sessions

95d54474361dView transcript

[?
Implement Checkpoint Policy Management SystemCodex·GPT-5.5·2 steps](/content/gh/entireio/cli/session/019ef111-70d5-7203-b653-e4834b8b92c0#timeline-95d54474361d/index.html)

Changes

6

19 unmodified lines

20
21
22
23
23
24
25
26

19 unmodified lines

},
    }, cpID)

require.ErrorContains(t, err, `checkpoint 111111111111 uses unsupported checkpoint_version 
"refs-v1"`)
    require.EqualError(t, err, `checkpoint 111111111111 uses unsupported checkpoint_version 
"refs-v1": not read-supported by this Entire CLI`)
}

type checkpointInfoPolicyStub struct {

Mcmd/entire/cli/checkpoint_policy_read_test.go+1/-1

755 unmodified lines

756
757
758
759
759
760
761
762

755 unmodified lines

return nil, nil, fmt.Errorf("failed to read checkpoint: %w", err)
    }
    if err := checkpointpolicy.EnsureCanReadVersion(cpID.String(), summary.CheckpointVersion); err != nil {
        return nil, nil, fmt.Errorf("check checkpoint version: %w", err)
        return nil, nil, fmt.Errorf("%w", err)
    }

content, contentErr := checkpoint.ReadLatestSessionContent(ctx, store, cpID, summary)

Mcmd/entire/cli/explain.go+1/-1

266 unmodified lines

267
268
269
270
270
271
272
273
90 unmodified lines

364
365
366
367
367
368
369
370

266 unmodified lines

return fmt.Errorf("failed to read checkpoint: %w", err)
    }
    if err := checkpointpolicy.EnsureCanReadVersion(cpID.String(), summary.CheckpointVersion); err != nil {
        return fmt.Errorf("check checkpoint version: %w", err)
        return fmt.Errorf("%w", err)
    }

idx, err := resolveSessionIndex(summary, opts.sessionIndex)
90 unmodified lines

envelope, failedSessions := buildCheckpointJSONEnvelope(ctx, store, summary, cpID)

Mcmd/entire/cli/explain_export.go+2/-2

292 unmodified lines

293
294
295
296
296
297
298
299
69 unmodified lines

369
370
371
372
372
373
374
375

292 unmodified lines

}
        if !found {
            // No metadata available — nothing to resume from
            logging.Warn(logCtx, "resolveLatestCheckpoint failed",
            logging.Warn(logCtx, "no checkpoint metadata resolved",
                slog.Int("checkpoint_count", len(result.checkpointIDs)),
            )
            fmt.Fprintf(w, "Found %d checkpoints for commit %s but metadata is not available\n",
69 unmodified lines

return nil, fmt.Errorf("read checkpoint: %w", err)
    }
    if err := checkpointpolicy.EnsureCanReadVersion(checkpointID.String(), summary.CheckpointVersion); err != nil {
        return nil, fmt.Errorf("check checkpoint version: %w", err)
        return nil, fmt.Errorf("%w", err)
    }
    info := &strategy.CheckpointInfo{
        CheckpointID:     checkpointID,

Mcmd/entire/cli/resume.go+2/-2

733 unmodified lines

734
735
736
737
737
738
739
740

733 unmodified lines

return "", fmt.Errorf("failed to read checkpoint: %w", err)
    }
    if err := checkpointpolicy.EnsureCanReadVersion(cpID.String(), summary.CheckpointVersion); err != nil {
        return "", fmt.Errorf("check checkpoint version: %w", err)
        return "", fmt.Errorf("%w", err)
    }

content, err := checkpoint.ReadLatestSessionContent(ctx, stores.Primary, cpID, summary)

Mcmd/entire/cli/rewind.go+1/-1

652 unmodified lines

653
654
655
656
656
657
658
659

652 unmodified lines

return nil, fmt.Errorf("failed to read checkpoint: %w", err)
    }
    if err := checkpointpolicy.EnsureCanReadVersion(point.CheckpointID.String(), summary.CheckpointVersion); err != nil {
        return nil, fmt.Errorf("check checkpoint version: %w", err)
        return nil, fmt.Errorf("%w", err)
    }

// Get worktree root for agent session directory lookup