Skip to content

tidy-calllog: one spelling for the name of a UTC partition - #281

Merged
dinstein merged 1 commit into
mainfrom
tidy-calllog
Aug 9, 2026
Merged

tidy-calllog: one spelling for the name of a UTC partition#281
dinstein merged 1 commit into
mainfrom
tidy-calllog

Conversation

@dinstein

@dinstein dinstein commented Aug 9, 2026

Copy link
Copy Markdown
Owner

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.go and a bare "2006-01-02" in four other files —
    including two length checks spelled len("2006-01-02") — plus two
    outside the package, in the CLI and the control plane, rendering a prune
    cutoff into the very response that carries the partition names removed.

    The format decides three things at once: which directory a record is
    written into, which names the pruner validates before `os.RemoveAll`,
    and which ones a reader walks. They agreed by having been typed the same
    way. `DayLayout` moves to `types.go` beside the other frozen on-disk
    names, for the reason `PressurePolicy` is already there.
    
  • Pass B — nothing cleared the bar.

  • Pass C — nothing to reconcile.

Mutation-checked: shortening DayLayout to "2006-01" fails four tests.
Before this change the same edit moved capacity.go alone — the shape where
a pruner stops recognising the directories the writer is still filling.

No behaviour change; every spelling had the same value. Verification:
make ci green.

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>
@dinstein
dinstein merged commit d2f11e7 into main Aug 9, 2026
3 checks passed
@dinstein
dinstein deleted the tidy-calllog branch August 9, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant