Skip to content

feat(cli): show bundle counts, resumed bytes and unreadable records on the dashboard - #2752

Merged
thiras merged 2 commits into
mainfrom
feat/dashboard-pull-counts
Oct 29, 2026
Merged

thiras merged 2 commits into
mainfrom
feat/dashboard-pull-counts

Conversation

@thiras

@thiras thiras commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What

Three decdn dashboard follow-ups to #2637/#2651, which share the pull record, /_status and the page:

  • dashboard: show a bundle run's skipped, excluded and failed counts in the finished-pulls table #2638: a finished bundle run shows its non-zero entry counts under its row (11 skipped, 9 excluded). Failed and not-run counts show in the critical tone. BundleCounts gains reused, so a run whose every file was reused from disk does not read "nothing to fetch". A run that ends with nothing to fetch (the filter keeps nothing, or --select deselects all) records its excluded entries instead of ending done with counts: null. Planned::Nothing { reason, excluded } and PullObserver::nothing_to_fetch end that run in one place.

  • dashboard: show downloaded and resumed bytes apart, and record a blob run's resume base #2639: the record keeps downloaded_bytes, resumed_bytes and reused_bytes for every kind. ActivityRecorder counts them per blob, keyed by hash; a bundle run plans path → hash from its manifest.

    • A landed blob counts what its EntryLanded says it paid for, resumed and spliced.
    • A blob that did not land counts its lowest position as resumed and the rest as downloaded. A fetch to a file reports its .partial base first. copy_verified reports 0 before its first read, so a stream to stdout resumes nothing. A refetch from 0 after a hash mismatch clears the base.
    • Whole-file reuse comes from the report. A blob run is one such blob. BundleCounts keeps the entry counts only.

    So an interrupted bundle counts its unfinished blobs, and an entry written to a file counts its splice as reused (both from the Copilot review). The ended-pulls column is "Downloaded", with + X resumed · Y reused under it. A live row names its resumed bytes, and its progress bar stays on the whole position.

  • dashboard: name the files that did not read as a pull record #2666: /_status carries each *.json in the records directory that does not parse, with its path and the error. The page lists the first five, then "…and N more".

Closes #2638
Closes #2639
Closes #2666

Reviewer notes

  • The record format changes with no serde default, per the pre-mainnet rule. Every record an earlier build wrote reads as unreadable (missing field \resumed_bytes`), up to the 200 the directory keeps, and the new banner lists them. The dashboard is in no tag yet (latest is v0.2.0), so no released host sees this. The CHANGELOG Added` entries for the dashboard and the record are updated in place.
  • Start with activity.rs (BlobBytes, RunBytes, Landed, read_records), then bundle_pull.rs (Planned, nothing_to_fetch).
  • copy_verified's new (0, total) report also reaches the stdout progress bar. The first-byte timing mark is gated on received > 0, so it does not move.
  • The unreadable banner moves out of App.tsx into components/UnreadableRecords.tsx, so a render test can reach it.

Verification

  • pre-commit run on every changed file: passed (cargo deny warns on the existing crypto-bigint RUSTSEC-2026-0387 only)
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: clean
  • cargo nextest run -p decdn-cli: 1230 passed
  • cargo nextest run -p decdn-e2e --features anvil-e2e -E 'binary(cli_fetch_two_data_dirs)': passed, with a new resumed_bytes == 0 check for a fresh fetch
  • UPDATE_STATUS_FIXTURES=1 regenerated dashboard-*.json. In crates/cli/dashboard: pnpm test (80 passed), pnpm lint, prettier --check, pnpm build
  • CARGO_BUILD_WARNINGS=deny cargo doc -p decdn-cli --no-deps --document-private-items: clean
  • make -C adr check-refs: clean
  • Manual: decdn dashboard against a real ~/.decdn/activity/pulls lists the six records written before this change, each with "missing field resumed_bytes"
  • Not run: a live testnet re-pull of an on-disk bundle and a resumed blob fetch (paid pulls). The view, record and render tests cover those paths.

🤖 Generated with Claude Code

…n the dashboard

A `decdn get` record keeps the bytes its run resumed from an earlier
`.partial` (`resumed_bytes`): a blob run's lowest reported position, so
a stream to stdout (which reports 0 first) and a refetch from 0 resume
nothing; a bundle run's tally with its counts. A bundle record's counts
gain `reused`, and a run with nothing to fetch records its excluded
entries instead of ending with no counts.

The finished-pulls table shows the bytes downloaded apart from those
resumed or reused, and a bundle run's non-zero counts under its row,
failed and not-run in the critical tone. `/_status` names each record
file that does not parse, with why, and the page lists them.

Closes #2638
Closes #2639
Closes #2666

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras thiras self-assigned this Oct 29, 2026
Copilot AI balanced review requested due to automatic review settings October 29, 2026 04:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Dashboard byte totals misreport interrupted transfers and entry-to-file reuse, omitting retained downloaded and resumed bytes or counting locally reused data as network downloads.

2 open issues
What changed in this PR

This PR improves the local dashboard’s pull history with bundle counts, separate byte totals, and actionable unreadable-record details, addressing #2638, #2639, and #2666.

Changes:

  • Show finished bundle counts, including reused and excluded entries, with failed and not-run counts highlighted.
  • Record resumed bytes and distinguish downloaded, resumed, and reused bytes in the dashboard.
  • Carry unreadable record paths and errors through /_status, displaying the first five.
File Description
crates/​e2e/​tests/​cli_fetch_two_data_dirs.rs Assert fresh fetches record zero resumed bytes.
crates/​cli/​src/​commands/​fetch/​tests.rs Check initial and final streaming progress.
crates/​cli/​src/​commands/​fetch.rs Report zero before streaming begins.
crates/​cli/​src/​commands/​dashboard/​status/​tests.rs Extend status fixtures with counts, resumes, and read errors.
crates/​cli/​src/​commands/​dashboard/​status.rs Include unreadable paths and errors in status.
crates/​cli/​src/​commands/​dashboard/​sources/​tests.rs Verify unreadable details reach dashboard status.
crates/​cli/​src/​commands/​bundle_pull/​tests.rs Cover empty selections and recorded bundle totals.
crates/​cli/​src/​commands/​bundle_pull.rs Centralize empty-run reporting and pass resumed totals.
crates/​cli/​src/​commands/​activity/​tests.rs Test resume tracking and unreadable-record reporting.
crates/​cli/​src/​commands/​activity.rs Persist resumed bytes, reuse counts, and read diagnostics.
crates/​cli/​dashboard/​src/​view.ts Derive byte splits, count labels, and unreadable summaries.
crates/​cli/​dashboard/​src/​view.test.ts Test the new dashboard view calculations.
crates/​cli/​dashboard/​src/​fixtures/​dashboard-full.json Add representative counts, resumes, and unreadable details.
crates/​cli/​dashboard/​src/​fixtures/​dashboard-failing.json Update unreadable records to an array.
crates/​cli/​dashboard/​src/​fixtures/​dashboard-alone.json Update resume and unreadable fields.
crates/​cli/​dashboard/​src/​contract.test.ts Check revised status fields and derived views.
crates/​cli/​dashboard/​src/​components/​UnreadableRecords.tsx Display unreadable paths, errors, and overflow count.
crates/​cli/​dashboard/​src/​components/​UnreadableRecords.test.ts Test diagnostics rendering and list truncation.
crates/​cli/​dashboard/​src/​components/​RecentPulls.tsx Render byte splits and bundle counts.
crates/​cli/​dashboard/​src/​components/​RecentPulls.test.ts Test counts, byte labels, and failure styling.
crates/​cli/​dashboard/​src/​components/​LivePulls.tsx Display resumed bytes on live pulls.
crates/​cli/​dashboard/​src/​App.tsx Integrate the unreadable-record component.
crates/​cli/​dashboard/​src/​api.ts Align dashboard types with revised records.
CHANGELOG.md Describe the dashboard reporting additions.
adr/​appendix-binaries.md Document recorded totals and unreadable-file display.

Review effort: Balanced

Comment thread crates/cli/dashboard/src/view.ts Resolved
Comment thread crates/cli/dashboard/src/view.ts Resolved
@github-code-quality

github-code-quality Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main ca076a0 feat/dashboard-pull-... 13a7979 +/-
77% 77% 0%
View coverage of the 5 most impacted files.
File main ca076a0 feat/dashboard-pull-... 13a7979 +/-
crates/cli/src/...mmands/fetch.rs 46% 46% 0%
crates/node/src...s/client/mod.rs 91% 91% 0%
crates/node/src...gin/pull_leg.rs 84% 84% 0%
crates/cli/src/...nds/activity.rs 89% 89% 0%
crates/cli/src/.../bundle_pull.rs 62% 63% +1%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 29, 2026 05:09 UTC

A bundle run's report tallies only the blobs that landed, so a record
that took its downloaded and resumed bytes from it showed 0 B for an
interrupted fresh bundle, and an entry written to a file, which keeps
no counts, showed its spliced bytes as downloaded.

The record now keeps `downloaded_bytes`, `resumed_bytes` and
`reused_bytes` for every kind, from each blob's bytes: a landed blob
counts what its pull says it fetched, spliced and resumed; a blob that
did not land counts its lowest position as resumed and the rest as
downloaded. Whole-file reuse comes from the run's report. A blob run is
one such blob. `BundleCounts` keeps the entry counts only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras
thiras merged commit 2e44283 into main Oct 29, 2026
37 checks passed
@thiras
thiras deleted the feat/dashboard-pull-counts branch October 29, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants