Review Branch and Refactor Shard Methods · Entire

Branch/PR Review

Review Findings

Review 1

Minor Non-Blocking Cleanup:

Validation Run:


Review 2

Validation Run:


Review 3

For validation with oklog/ulid/v2:

import "github.com/oklog/ulid/v2"

func isValidULID(s string) bool {
    _, err := ulid.ParseStrict(s)
    return err == nil
}

Use ParseStrict, not Parse, if you want canonical 26-char ULIDs and correct Crockford/base32/range validation.

That said, pulling in a dependency only for validation may be more than this PR needs. A stricter regex is likely fine here:

const ULIDPattern = `[0-7][REDACTED]{25}`

But if future work will generate ULIDs too, adding github.com/oklog/ulid/v2 now would be reasonable.


Review 4

Validation Run:


Review 5

Validation Run:


Additional Commit Information

ShardFor (and the CheckpointID.Kind() method it used) had no production caller in this PR — their only consumer is the git-refs store's RefName, which lands with the ref-store work — so their doc comments had to forward-reference a per-checkpoint ref store that isn't here. Sharding is a storage concern, not part of recognizing/validating an ID, so move both (and their tests) to the ref-store change.

This PR now contains only the universal "understanding" layer: KindOf/Kind, isULID (oklog-backed), Validate/NewCheckpointID/UnmarshalJSON, and the Pattern/CheckpointPattern matchers. No unused exports, no forward-referencing comments; the Kind type doc drops its git-ref clause.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 510078f47f13+1/-65