Skip to content

feat(cli)!: decdn get replaces decdn fetch and decdn bundle pull - #2461

Merged
alpergundogdu merged 5 commits into
mainfrom
claude/get-cleanup
Oct 14, 2026
Merged

alpergundogdu merged 5 commits into
mainfrom
claude/get-cleanup

Conversation

@alpergundogdu

@alpergundogdu alpergundogdu commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2449. Stacked on #2460 (base branch claude/get-first-fetch-layer-3df574); retarget to main once that merges.

decdn get <decdn: URI> is now the only way to pull. decdn fetch, decdn bundle pull, the bundle group and their argument types are gone, with no aliases.

Before After
fetch --hash H -o file get decdn:H -o file
fetch --hash H -o - get decdn:H -o -
bundle pull --hash H -o dir get decdn:H/ -o dir
(none) get decdn:H/a/b.txt -o dir
--namespace N ?ns=N in the URI
bundle pull -i <manifest file> dropped: publish the manifest and pull it by hash

Code

  • decdn-common: FetchArgs, BundleArgs, BundleCommand, BundlePullArgs and parse_fetch_namespace_id are deleted. GetArgs carries the full help text of the bundle flags and owns DEFAULT_JOBS / DEFAULT_MAX_LANE_STREAMS. ClientFetchArgs stays as the shared retrieval flags.
  • decdn-cli: get parses 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 -i path is gone from the bundle route.
  • decdn gateway (feat(cli): decdn gateway serves decdn: URIs to a browser with scoped, in-memory delegates #2456). The gateway drives the blob route through fetch_into. That function takes a plain BlobFetch { hash, namespace, output, common } in place of the deleted FetchArgs, and get builds the same struct. Command::Gateway is boxed like Command::Get.
  • Exact entry selection. An entry URI is matched by an exact-path field in EntryFilter, not an escaped glob. An entry URI that names no manifest entry is an error, not an empty run.
  • Drop-the-slash hint. BundleManifest::parse returns a typed decdn_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

  • Unit: get routing and flag rules; exact entry match with glob metacharacters (x[1].txt, a*.bin, {a,b}.txt); missing entry; the hint fires only for NotAManifest; dry runs through get URIs.
  • crates/cli/tests/fetch_node_dir_guard.rs becomes get_node_dir_guard.rs and covers the blob and bundle routes.
  • e2e: every listed journey runs through get with the same assertions:
    • The fetch journeys swap fetch --hash H for get decdn:H.
    • cli_bundle_pull_pool_id and cli_bundle_pull_multi_source serve 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_dedup puts 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-client
  • cargo nextest run -p decdn-e2e --features anvil-e2e over all 10 converted binaries: 21 passed
  • INSTA_UPDATE=always cargo nextest run -p decdn-client --features public-api-test
  • clippy (--all-features), fmt, doc

Docs

README, CLAUDE.md, CHANGELOG (BREAKING entry), docs/runbook.md, Docker docs, Dockerfile, the issue template, Cargo comments, ADR 012, 037, 039, appendix-binaries.md and appendix-bundles.md (title anchor changes to #appendix-directory-bundles; architecture.md follows).

Not in this PR

  • website: components/site/HeroTerminal.tsx and any website/docs/ page that shows the old commands.
  • sponsord: the installers print a bundle pull command (decdn.sh and its PowerShell twin, plus their tests and docs). That change lands with the decdn release that ships get.

🤖 Generated with Claude Code

alpergundogdu and others added 3 commits October 14, 2026 12:22
…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]>
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]>
Base automatically changed from claude/get-first-fetch-layer-3df574 to main October 14, 2026 12:20
# 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
Copilot AI balanced review requested due to automatic review settings October 14, 2026 12:42

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.

🔵 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, the bundle group, and their arg types; get now routes a parsed/validated DecdnUri to 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 typed decdn_client::bundle::NotAManifest drives 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.

@github-code-quality

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

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 04d6838 in the claude/get-cleanup branch remains at 75%, unchanged from commit e260c3d in the main branch.

Show a line coverage summary of the most impacted files.
File main e260c3d claude/get-cleanup 04d6838 +/-
crates/common/src/cli/fetch.rs 95% 93% -2%
crates/cli/src/...mmands/fetch.rs 51% 51% 0%
crates/cache/src/engine.rs 91% 91% 0%
crates/protocol/src/framing.rs 93% 93% 0%
crates/cli/src/main.rs 76% 76% 0%
crates/client/src/bundle.rs 16% 18% +2%
crates/cli/src/.../bundle_pull.rs 47% 54% +7%
crates/cli/src/commands/get.rs 91% 100% +9%

Updated October 14, 2026 13:05 UTC

# Conflicts:
#	CLAUDE.md
#	crates/cli/src/commands/fetch.rs
#	crates/cli/src/main.rs
#	crates/common/src/cli/mod.rs
@alpergundogdu
alpergundogdu merged commit af677b6 into main Oct 14, 2026
33 checks passed
@alpergundogdu
alpergundogdu deleted the claude/get-cleanup branch October 14, 2026 13:09
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.

cli: decdn get <decdn: URI> replaces fetch and bundle pull

2 participants