Skip to content

fix(cli): label byte sizes in binary units - #951

Open
tolgaergin wants to merge 2 commits into
mainfrom
labels/binary-units
Open

tolgaergin wants to merge 2 commits into
mainfrom
labels/binary-units

Conversation

@tolgaergin

@tolgaergin tolgaergin commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Every size LPM CLI prints is counted in 1024s, but was labelled KB, MB or GB. The LPM.dev Registry now labels sizes in binary units (tolgaergin/a-package-manager#235) and bills remote cache overage per GiB, so the CLI says KiB, MiB and GiB too.

What changes

  • lpm_common::format_bytes labels KiB, MiB and GiB. It's used across lpm cache status, publish, store cleanup, install summaries and more.
  • One formatter: download, self-update and graph had their own copies of it; they use it now.
  • Other size strings:
    • tunnel limits ("10.0 MiB body");
    • skill size limits ("exceeds 15 KiB limit");
    • lpm whoami storage ("50.00 MiB / 500 MiB");
    • truncated tool and parallel-run output ("[output truncated at 10 MiB]");
    • runtime download caps;
    • tunnel webhook sizes ("2.4KiB").

Nothing parses these strings. lpm store clean --json keeps removed_bytes next to its display string removed.

The docs follow in lpm-dev/rust-client-docs#390 (CLI output examples) and lpm-dev/rust-client-docs#389 (plan sizes).

Testing

The whole CI gate passes locally on ec4a690:

  • cargo clippy --workspace --all-targets --locked -- -D warnings, cargo fmt --check, cargo build --workspace --locked
  • 7,149 workspace tests
  • cargo test -p lpm-cli --bin lpm-rs -- --test-threads=1: 5,401 passed
  • 119 binary-surface tests
  • the run and cache workflow tests with the hermetic CLI: 172 passed
  • the graph, skills and whoami workflow tests, whose expected labels changed: 156 passed

format_bytes has its own unit test now, with the GiB case; the tests that asserted the old labels expect the new ones.

🤖 Generated with Claude Code

tolgaergin and others added 2 commits October 11, 2026 15:37
Every size LPM CLI prints is counted in 1024s, but read KB, MB and GB:
`lpm cache status`, publish, download, self-update, graph and tunnel
limits. `lpm_common::format_bytes` now says KiB, MiB and GiB, matching the
LPM.dev Registry, which bills remote cache overage per GiB, and the three
local copies of it in download, self-update and graph use it instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Skill size limits, `lpm whoami` storage, truncated tool output, runtime
download caps and tunnel webhook sizes say KiB or MiB.

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

This branch has not been deployed

No deployments
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