Skip to content

Byte counts are grouped in threes - #86

Merged
donislawdev merged 2 commits into
mainfrom
bytes/grouped
Sep 8, 2026
Merged

Byte counts are grouped in threes#86
donislawdev merged 2 commits into
mainfrom
bytes/grouped

Conversation

@donislawdev

Copy link
Copy Markdown
Owner

A total printed as 2516582400 B. Eleven digits with nothing to hold on to, and
this tool prints byte counts everywhere - it is the whole point of it, so the one
number a person came for was the hardest to read.

It now prints 2 516 582 400 B, in every message that names bytes: the minimum
in tfg formats, the summary a run prints, what a preset says its budget is, and
what tfg validate reports.

A space rather than a comma. A comma is a thousands mark in some countries and a
decimal point in others, and this tool is read in both.

Machine output is untouched. Nothing in a manifest or under --json goes
through here, because a number there is a number rather than a sentence, so no
script anybody has written sees any of this.

What it broke, and what that taught

One guard read the old shape and had to be taught the new one. What it said while
it was wrong is worth keeping: it split the line on the first space, read
1 220 B as one byte, and reported that the tool refuses the minimum it
advertises. It was right about what it saw and wrong about what it meant, which
is what a parser splitting on the wrong thing always is. Two tools outside this
repository read the same line and needed the same lesson.

Checked

  • tfg formats docx prints minimum 1 220 B
  • the three guards over the advertised minimum are green
  • journey.py is 300 of 300

🤖 Generated with Claude Code

A total printed as 2516582400 B. Eleven digits with nothing to hold on
to, and this tool prints byte counts everywhere - it is the whole point
of it, so the one number a person came for was the hardest to read.

It now prints 2 516 582 400 B, in every message that names bytes: the
minimum in tfg formats, the summary a run prints, what a preset says
its budget is, and what tfg validate reports.

A space rather than a comma. A comma is a thousands mark in some
countries and a decimal point in others, and this tool is read in both.

Machine output is untouched. Nothing in a manifest or under --json goes
through here, because a number there is a number rather than a
sentence, so no script anybody has written sees any of this.

One guard read the old shape and had to be taught the new one, and what
it said while it was wrong is worth keeping: it split the line on the
first space, read "1 220 B" as one byte, and reported that the tool
refuses the minimum it advertises. It was right about what it saw and
wrong about what it meant, which is what a parser splitting on the
wrong thing always is. Two tools outside this repository read the same
line and needed the same lesson.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CI went red on eight tests, all of them guards reading a byte count out
of the command line's own output. I had written in this branch's own
message that a change to a human sentence has a blast radius equal to
the number of things parsing it, and then shipped without running the
suite, so the branch proved its own point.

Three places, three different shapes:

- sizeText built the expected text with strconv.FormatInt, so it looked
  for "36415" in a report saying "36 415 B" and found nothing. It asks
  core.ExactBytes now, WITH the unit - which is stronger than what it
  replaced rather than merely equal, because bare digits could match
  inside a longer number and "36415" does match in "136415".

- The boundary announcement is pinned as literal text, so it moves to
  the grouped spelling.

- The sizes a person writes are pinned as literal text as well, and
  deliberately not asked of core.ExactBytes: that guard is over what a
  PERSON reads, so the spelling is half of what it holds, and a guard
  built from the same function the program prints with cannot tell the
  two apart.

Every expected string was checked against what the program actually
prints rather than worked out by hand: 1 610 612 736 B, 10 485 760 B,
1 048 576 B, 716 800 B, 0 B, 15 728 640 B.

One subtest cannot run on this machine and it is not this change: 1.5gib
is refused with exit 6, the free space code, because the disk has 1.1 GB
left. The tool is behaving correctly and the runner has room.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@donislawdev
donislawdev merged commit 39332d3 into main Sep 8, 2026
18 checks passed
@donislawdev
donislawdev deleted the bytes/grouped branch September 8, 2026 07:30
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