Repository navigation
feat(cli)!: decdn get replaces decdn fetch and decdn bundle pull - #2461
Conversation
…2449) `get` parses a `decdn:` URI and routes it to the existing commands: a blob URI runs `decdn fetch`, `decdn:<hash>/` runs `decdn bundle pull`, and `decdn:<hash>/<path>` runs the bundle pull with one escaped `--include` glob that matches exactly that path. The URI's `ns` is the namespace hint. Bundle-only flags are rejected on a blob URI, entry filters on an entry URI, and `-o -` on anything but a blob URI. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Delete fetch, bundle pull, the bundle group, FetchArgs, BundleArgs, BundleCommand and BundlePullArgs. get hands its args and the parsed decdn: URI straight to the blob and bundle routes. bundle pull -i is dropped: publish the manifest and pull it by hash. An entry URI keeps exactly the manifest entry it names; one that names no entry is an error. BundleManifest::parse returns a typed NotAManifest, and the bundle route adds a drop-the-trailing-slash hint to it. Every e2e journey, CLI test and doc that named the old commands moves to get. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # CLAUDE.md # crates/cli/src/commands/get.rs # crates/cli/src/commands/get/tests.rs # crates/cli/src/main.rs # crates/common/src/cli/bundle.rs # crates/common/src/cli/get.rs # crates/common/src/cli/mod.rs
There was a problem hiding this comment.
🔵 Needs a closer look
It removes public CLI command surface and a public arg API and alters e2e billing assertions across many files, which merits final human verification despite no concrete defects being found.
0 open findings
What changed in this PR
This PR consolidates the two existing pull commands — decdn fetch and decdn bundle pull — into a single decdn get <decdn: URI> command (closes #2449). A decdn: URI names a raw blob (decdn:<hash>), a whole bundle (decdn:<hash>/), or one entry (decdn:<hash>/a/b.txt), with an optional ?ns=<id> routing hint. This is the cleanup half of a two-PR stack: PR #2460 added get as a thin routing layer, and this PR deletes the old commands, their arg types, and the bundle group (no aliases, per the pre-mainnet no-compat-shims policy), then migrates every caller, test, and doc.
Changes:
- Deletes
decdn fetch,decdn bundle pull, thebundlegroup, and their arg types;getnow routes a parsed/validatedDecdnUrito the blob route (fetch::fetch) or bundle route (bundle_pull::bundle_pull), both re-typed to(&GetArgs, &DecdnUri). - Replaces glob-escaped single-entry selection with an exact-path field in
EntryFilter; an entry URI naming no manifest entry is now an error, and a typeddecdn_client::bundle::NotAManifestdrives the "drop the trailing/" hint. - Sweeps docs/comments/ADRs/e2e tests from the old commands to
get, including e2e billing assertions that now account for the manifest's wire bytes when pulled by hash.
| File | Description |
|---|---|
| README.md | Swaps fetch/bundle pull usage for get decdn:<hash>; adds URI table and ?ns= routing note |
| docs/runbook.md | Renames command references (keystore password sources, buyer-store note, refusal symptoms) to decdn get |
| Dockerfile | Updates CLI stage comment and CMD usage example to get decdn:<hash> |
| docker/README.decdn.md | Updates CLI description and docker run example to get |
| crates/protocol/src/region.rs, region/tests.rs | Updates Debug-rationale comments naming the operator-facing command to decdn get |
| crates/node/tests/origin_range_pull.rs | Updates test doc comments describing the cold-miss/bundle-pull request shapes to decdn get |
| crates/node/tests/client_loopback.rs | Updates resume/pricing test doc comments to decdn get -o wording |
| crates/node/src/handlers/client/dispatch.rs | Comment update in the client dispatch handler (griefing-vector note) |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit 04d6838 in the Show a line coverage summary of the most impacted files.
Updated |
# Conflicts: # CLAUDE.md # crates/cli/src/commands/fetch.rs # crates/cli/src/main.rs # crates/common/src/cli/mod.rs
Closes #2449. Stacked on #2460 (base branch
claude/get-first-fetch-layer-3df574); retarget tomainonce that merges.decdn get <decdn: URI>is now the only way to pull.decdn fetch,decdn bundle pull, thebundlegroup and their argument types are gone, with no aliases.fetch --hash H -o fileget decdn:H -o filefetch --hash H -o -get decdn:H -o -bundle pull --hash H -o dirget decdn:H/ -o dirget decdn:H/a/b.txt -o dir--namespace N?ns=Nin the URIbundle pull -i <manifest file>Code
decdn-common:FetchArgs,BundleArgs,BundleCommand,BundlePullArgsandparse_fetch_namespace_idare deleted.GetArgscarries the full help text of the bundle flags and ownsDEFAULT_JOBS/DEFAULT_MAX_LANE_STREAMS.ClientFetchArgsstays as the shared retrieval flags.decdn-cli:getparses and checks the URI, then calls the blob route (commands::fetch::fetch) or the bundle route (commands::bundle_pull::bundle_pull). Both now take(&GetArgs, &DecdnUri)instead of their own clap structs. The-ipath is gone from the bundle route.decdn gateway(feat(cli):decdn gatewayservesdecdn:URIs to a browser with scoped, in-memory delegates #2456). The gateway drives the blob route throughfetch_into. That function takes a plainBlobFetch { hash, namespace, output, common }in place of the deletedFetchArgs, andgetbuilds the same struct.Command::Gatewayis boxed likeCommand::Get.EntryFilter, not an escaped glob. An entry URI that names no manifest entry is an error, not an empty run.BundleManifest::parsereturns a typeddecdn_client::bundle::NotAManifest. The bundle route adds "drop the trailing/to fetch the raw blob" to that error only (manifest fetch and dry-run cache read). The public API snapshot is updated.Tests
getrouting and flag rules; exact entry match with glob metacharacters (x[1].txt,a*.bin,{a,b}.txt); missing entry; the hint fires only forNotAManifest; dry runs throughgetURIs.crates/cli/tests/fetch_node_dir_guard.rsbecomesget_node_dir_guard.rsand covers the blob and bundle routes.getwith the same assertions:fetch --hash Hforget decdn:H.cli_bundle_pull_pool_idandcli_bundle_pull_multi_sourceserve the manifest from a node and pull it by hash. The exact lane watermark and the split thresholds include the manifest's wire bytes.cli_bundle_pull_range_dedupputs its hand-built manifests in the output root's manifest cache (the same cache a real pull fills), so its exact billing assertions still cover only the entries. Its import journey still fetches the manifest from the node.Ran locally:
cargo nextest run -p decdn-cli -p decdn-common -p decdn-clientcargo nextest run -p decdn-e2e --features anvil-e2eover all 10 converted binaries: 21 passedINSTA_UPDATE=always cargo nextest run -p decdn-client --features public-api-test--all-features), fmt, docDocs
README, CLAUDE.md, CHANGELOG (BREAKING entry),
docs/runbook.md, Docker docs, Dockerfile, the issue template, Cargo comments, ADR 012, 037, 039,appendix-binaries.mdandappendix-bundles.md(title anchor changes to#appendix-directory-bundles;architecture.mdfollows).Not in this PR
website:components/site/HeroTerminal.tsxand anywebsite/docs/page that shows the old commands.sponsord: the installers print abundle pullcommand (decdn.shand its PowerShell twin, plus their tests and docs). That change lands with thedecdnrelease that shipsget.🤖 Generated with Claude Code