feat(fetch): extract public uffs-fetch transport lib; dep refresh + rmcp 3 - #583
Merged
Conversation
Adjust .claude/settings.json defaults and expand CLAUDE.md guidance.
…rate Move the guts of uffs-update's github.rs (with_retry, fetch_release, download_to) and verify.rs (sha256_file, parse_sha256sums, expected_hash, verify_sha256) into a new cross-platform Layer-0 lib crate, uffs-fetch, with uffs-update as its first consumer. Two generalizations for external consumers: - the user-agent is now a caller-supplied product string instead of a hardcoded uffs-update/<version> - the download byte cap is now a per-call parameter instead of the 512 MiB MAX_ASSET_BYTES constant (uffs-update keeps both as local policy constants, unchanged in behavior) Everything else is untouched: blocking reqwest with rustls-tls-native-roots, 4-attempt/500ms exponential-backoff retry, 30s connect / 60s inactivity timeouts, streaming capped copy. The HTTP/TLS-never-in-the-lean-CLI isolation is preserved: reqwest/sha2/hex move out of uffs-update's manifest into uffs-fetch.
Multi-GiB downloads are indistinguishable from a hang without a heartbeat. download_to_with_progress invokes a caller-supplied on_chunk(bytes_so_far, content_length) after every written chunk, with the Content-Length total when the server sent one; download_to becomes the no-op-callback wrapper, so existing callers are unchanged.
Direct bumps: rmcp 2.2.0 -> 3.1.0, toml 1.1.4, schemars 1.2.2, clap 4.6.5, aho-corasick 1.1.5, smallvec 1.15.2, plus the transitive refresh in Cargo.lock. All direct pins verified current against crates.io; reqwest stays 0.12.28 deliberately (re-verified: 0.13.4 still ships no rustls-tls-native-roots feature; comment updated). rmcp 3 migration in uffs-mcp: the List* results gain optional result_type/ttl_ms/cache_scope fields (now built via with_all_items, preserving the previous wire shape), and call_tool / read_resource / get_prompt return the new outcome enums via their From impls — no behavior change. Supply chain: extended cargo-vet trust to 19 crates whose publishers this project already trusts (dtolnay, epage, Manishearth, BurntSushi, seanmonstar, Darksonn, rust-lang-owner); every changed exemption version stays anchored at its pre-update value per the no-lazy-bumps discipline, with a reviewed [[audits]] delta entry recorded for each of the 51 version transitions (diff reviewed for unsafe surface, capability changes, build.rs, and dependency drift; per-crate notes in supply-chain/audits.toml). cargo vet passes: 172 fully audited, 84 partially, 238 exempted (down from 331 exemptions). cargo audit: no new advisories from this refresh; the two outstanding quick-xml advisories are pre-existing polars transitives. Vet-Reviewed-Diff: aho-corasick@1.1.4->1.1.5 Vet-Reviewed-Diff: alloc-stdlib@0.2.2->0.2.4 Vet-Reviewed-Diff: ar_archive_writer@0.5.1->0.5.3 Vet-Reviewed-Diff: block-buffer@0.12.0->0.12.1 Vet-Reviewed-Diff: brotli@8.0.3->8.0.4 Vet-Reviewed-Diff: brotli-decompressor@5.0.1->5.0.3 Vet-Reviewed-Diff: bytemuck_derive@1.10.2->1.11.0 Vet-Reviewed-Diff: crossbeam-deque@0.8.6->0.8.7 Vet-Reviewed-Diff: crossbeam-queue@0.3.12->0.3.13 Vet-Reviewed-Diff: crossbeam-utils@0.8.21->0.8.22 Vet-Reviewed-Diff: displaydoc@0.2.6->0.2.7 Vet-Reviewed-Diff: event-listener@5.4.1->5.4.2 Vet-Reviewed-Diff: fastrand@2.4.1->2.5.0 Vet-Reviewed-Diff: humantime@2.3.0->2.4.0 Vet-Reviewed-Diff: ipnet@2.12.0->2.12.1 Vet-Reviewed-Diff: jobserver@0.1.34->0.1.35 Vet-Reviewed-Diff: libredox@0.1.17->0.1.19 Vet-Reviewed-Diff: log@0.4.32->0.4.33 Vet-Reviewed-Diff: mio@1.2.1->1.2.2 Vet-Reviewed-Diff: object@0.37.3->0.39.1 Vet-Reviewed-Diff: portable-atomic@1.13.1->1.14.0 Vet-Reviewed-Diff: psm@0.1.31->0.1.32 Vet-Reviewed-Diff: quinn@0.11.9->0.11.11 Vet-Reviewed-Diff: quinn-proto@0.11.14->0.11.16 Vet-Reviewed-Diff: ref-cast@1.0.25->1.0.26 Vet-Reviewed-Diff: ref-cast-impl@1.0.25->1.0.26 Vet-Reviewed-Diff: rmcp@2.2.0->3.1.0 Vet-Reviewed-Diff: rmcp-macros@2.2.0->3.1.0 Vet-Reviewed-Diff: rustls@0.23.40->0.23.43 Vet-Reviewed-Diff: rustls-pki-types@1.14.1->1.15.1 Vet-Reviewed-Diff: schemars@1.2.1->1.2.2 Vet-Reviewed-Diff: schemars_derive@1.2.1->1.2.2 Vet-Reviewed-Diff: serde_derive_internals@0.29.1->0.30.0 Vet-Reviewed-Diff: simd-adler32@0.3.9->0.3.10 Vet-Reviewed-Diff: simd-json@0.17.0->0.17.3 Vet-Reviewed-Diff: snap@1.1.1->1.1.2 Vet-Reviewed-Diff: socket2@0.6.4->0.6.5 Vet-Reviewed-Diff: sse-stream@0.2.3->0.2.5 Vet-Reviewed-Diff: stacker@0.1.24->0.1.25 Vet-Reviewed-Diff: syn@2.0.117->2.0.119 Vet-Reviewed-Diff: syn@3.0.2->3.0.3 Vet-Reviewed-Diff: time@0.3.47->0.3.55 Vet-Reviewed-Diff: tinyvec@1.11.0->1.12.0 Vet-Reviewed-Diff: tokio-macros@2.7.0->2.7.2 Vet-Reviewed-Diff: tokio-stream@0.1.18->0.1.19 Vet-Reviewed-Diff: tokio-util@0.7.18->0.7.19 Vet-Reviewed-Diff: toml_parser@1.1.2+spec-1.1.0->1.1.3+spec-1.1.0 Vet-Reviewed-Diff: value-trait@0.12.1->0.12.2 Vet-Reviewed-Diff: xxhash-rust@0.8.15->0.8.18 Vet-Reviewed-Diff: zerocopy@0.8.50->0.8.55 Vet-Reviewed-Diff: zerocopy-derive@0.8.50->0.8.55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
uffs-fetch— extracted fromuffs-update's acquire step so external products can reuse the hardened HTTP machinery:fetch_release(GitHub Releases),download_to(generic-URL streaming with retry / 30s connect / 60s inactivity timeouts / per-call byte cap),with_retry, and theSHA256SUMSverify module. Two generalizations: caller-supplied user-agent product string and per-callmax_bytes(was a hardcoded 512 MiB constant).uffs-updateis the first consumer and keeps its previous values as local policy constants — behavior unchanged, and the HTTP/TLS stack still never touches the leanuffsCLI.download_to_with_progress— per-chunk(bytes_so_far, Content-Length)hook so multi-GiB downloads are distinguishable from a hang;download_tois the no-op-callback wrapper.with_all_itemsconstructors, wire shape unchanged), toml 1.1.4, schemars 1.2.2, clap 4.6.5, aho-corasick 1.1.5, smallvec 1.15.2 + transitive refresh. reqwest deliberately stays 0.12.28 (re-verified: 0.13.4 has norustls-tls-native-rootsfeature).[[audits]]delta entry (unsafe surface, capability changes, build.rs, dependency drift).cargo vetpasses: 172 fully audited / 84 partially / 238 exempted (down from 331 exemptions).Validation
#[ignore]set)cargo vetgreen, vet-audit-discipline gate green, full pre-push gate greencargo audit: no new advisories (the 2 outstanding quick-xml items are pre-existing polars transitives)