tidy-calllog: one spelling for the name of a UTC partition - #281
Merged
Conversation
The ledger's day-partition format decides three things at once: which
directory a record is written into, which directory names the pruner is
willing to validate before os.RemoveAll, and which ones a reader walks. It was
a named constant in capacity.go, used six times there — and a bare
"2006-01-02" in four other files, twice as len("2006-01-02") in a length
check, plus two more in the CLI and the control plane rendering a prune
cutoff into the same response that carries the partition names it removed.
So the writer, the pruner, the reader and the two things that report a prune
agreed on the format by having been typed the same way. Changing the constant
would have moved capacity.go alone, which is the shape where a pruner stops
recognising the directories the writer is still filling.
DayLayout now lives in types.go beside the other frozen on-disk names, for the
reason PressurePolicy is already there: two copies of one word is exactly how
they came to disagree. It is exported because two packages outside this one
render it. Verified load-bearing by mutation — shortening it to "2006-01"
fails four tests where before it would have failed none of the readers.
No behaviour change: every spelling had the same value.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nightly tidy pass over
internal/calllog(2026-08-10 02:47 round).Pass A — the day-partition format was a named constant used six
times in
capacity.goand a bare"2006-01-02"in four other files —including two length checks spelled
len("2006-01-02")— plus twooutside the package, in the CLI and the control plane, rendering a prune
cutoff into the very response that carries the partition names removed.
Pass B — nothing cleared the bar.
Pass C — nothing to reconcile.
Mutation-checked: shortening
DayLayoutto"2006-01"fails four tests.Before this change the same edit moved
capacity.goalone — the shape wherea pruner stops recognising the directories the writer is still filling.
No behaviour change; every spelling had the same value. Verification:
make cigreen.