Use ulid.Now() for ULID timestamps (UTC, timezone-independent) · Entire

Use ulid.Now() for ULID timestamps (UTC, timezone-independent)

de6c927→main·

Soph·1w ago·1 file·+4 added/-2 removed

ulid.Timestamp uses t.Unix()/nanoseconds — the absolute epoch instant — so local vs UTC never changed the ID. Switch to the library's own ulid.Now() (= Timestamp(time.Now().UTC())) to make the UTC intent explicit, match the library idiom, and drop the manual time.Now() + time import.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

f05349699fb0View transcript

[?
Build Checkpoints Store Based on DesignClaude Code·Opus 4.8[1m]·4 steps](/content/gh/entireio/cli/session/6852b33a-0d22-4364-aa6c-8de706ecc215#timeline-f05349699fb0/index.html)

Changes

1

7 unmodified lines

8
9
10
11
11
12
13
144 unmodified lines

158
159
160
161
162
163
164
163
165
166
167
168

7 unmodified lines

"encoding/json"
    "fmt"
    "regexp"
    "time"

ulid "github.com/oklog/ulid/v2"
)
144 unmodified lines

// and lexicographically time-sortable. It is the format the git-refs store uses
// (chosen by checkpoint.GenerateCheckpointID); the value is canonical and passes
// KindOf/Validate as KindULID.
//
// The timestamp is Unix epoch milliseconds (via ulid.Now), so it is inherently
// timezone-independent — the machine's local zone does not affect the ID.
func GenerateULID() (CheckpointID, error) {

u, err := ulid.New(ulid.Timestamp(time.Now()), rand.Reader)

u, err := ulid.New(ulid.Now(), rand.Reader)

if err != nil {
        return EmptyCheckpointID, fmt.Errorf("failed to generate ULID checkpoint ID: %w", err)
    }

Mcmd/entire/cli/checkpoint/id/id.go+4/-2