From 30a6c0f9df2d5b7db690fdafdf422e53727a50ba Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Fri, 30 Oct 2026 10:04:37 +0100 Subject: [PATCH 1/5] fix(deps): clear all known CVEs from the dependency graph MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `cargo audit` reported 8 vulnerable crates (two CVE-backed) and one HIGH npm advisory; `cargo audit` now reports 0 vulnerabilities. - zstd 0.13.3 → 0.14.3, zstd-safe 8.2.0, zstd-sys 2.1.2 (RUSTSEC-2026-0391 cross-stream plaintext leak, the 2026-0395..0406 UAF/OOB family, RUSTSEC-2026-0410 wasm allocator corruption) - git2 0.19 → 0.21, libgit2 1.9.7 (RUSTSEC-2026-0008/0183/0184 UB in Buf, Remote::list and blame signatures). 0.21 no longer enables the ssh/https/cred features by default, so they are now explicit — dropping them would silently remove transports and credential helpers. Accessors that became `Result`-returning were migrated at ~40 call sites. - ed25519-dalek 2.2 → 3.0 with sha1/sha2 0.11, which drops the vulnerable block-buffer 0.10.4 (GHSA-qwgh-2vcv-g2f7). digest 0.11 no longer implements LowerHex/io::Write, so scope fingerprints get an explicit hex encoder plus a hasher Write adapter; the existing manifest format is byte-identical and covered by a regression test. - rustls-webpki 0.103.16, webpki-roots 1.0.11, libz-sys 1.1.31, ctutils 0.4.7, inout 0.2.5 (CVE-2026-111943 distrusted-intermediate acceptance, RUSTSEC-2026-0381/0385/0418) - indicatif 0.18 and postcard without its heapless feature, removing the unmaintained number_prefix and atomic-polyfill crates - opencode-atomic-hooks: override zod ^4.6.7 (GHSA-mrhx-c7xc-m3w5, HIGH memory exhaustion) Remaining audit output is one unmaintained warning (unsafe-libyaml, via serde_yaml_ng 0.10, no fix available). Verified: cargo audit exit 0 on the workspace and the shacl spike, OSV cross-check clean, cargo build/clippy -D warnings/doc/fmt green, and the core, repository, agent and CLI suites plus git import/shim/binding integration suites pass. --- Cargo.lock | 315 ++++++------------ Cargo.toml | 10 +- atomic-agent/Cargo.toml | 2 +- atomic-agent/src/record/scope.rs | 53 ++- atomic-cli/src/commands/clone/command.rs | 2 +- atomic-cli/src/commands/git/binding.rs | 6 +- atomic-cli/src/commands/git/bootstrap.rs | 17 +- atomic-cli/src/commands/git/census.rs | 5 +- atomic-cli/src/commands/git/hooks.rs | 2 +- atomic-cli/src/commands/git/import.rs | 10 +- atomic-cli/src/commands/git/observation.rs | 13 +- atomic-cli/src/commands/git/parallel.rs | 12 +- atomic-cli/src/commands/git/push.rs | 14 +- .../src/commands/git/real_import_sample.rs | 2 +- atomic-cli/src/commands/git/ref_mapping.rs | 4 +- atomic-cli/src/commands/git/shadow.rs | 18 +- atomic-cli/src/commands/git/shim.rs | 6 +- atomic-cli/src/commands/git/transport.rs | 2 +- atomic-cli/tests/it/git_binding_cb6a_test.rs | 9 +- atomic-cli/tests/it/git_binding_cb6b_test.rs | 4 +- atomic-cli/tests/it/git_shim_cb10a_test.rs | 2 +- atomic-repository/Cargo.toml | 4 +- .../src/git_binding/transport.rs | 24 +- atomic-repository/src/repository/anchor.rs | 28 +- .../src/repository/binding_store.rs | 12 +- .../src/repository/git_observation.rs | 8 +- .../src/repository/projection_effects.rs | 5 +- .../repository/tests/binding_fetch_tests.rs | 2 +- .../repository/tests/binding_store_tests.rs | 2 +- .../src/repository/tests/ref_mapping_tests.rs | 2 +- .../repository/tests/tag_projection_tests.rs | 2 +- packages/opencode-atomic-hooks/bun.lock | 5 +- packages/opencode-atomic-hooks/package.json | 3 + tools/shacl-purrdf-spike/Cargo.lock | 12 +- 34 files changed, 286 insertions(+), 331 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3e1e2d6d..7c8259a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,7 +14,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1973cfbc1a2daf9cf550e74e1f088c28e7f7d8c1e1418fb6c9dc5184b7e84c99" dependencies = [ - "crypto-common 0.2.2", + "crypto-common", "inout", ] @@ -26,7 +26,7 @@ checksum = "35f0f96ce78e38c3dc6d8948aa8163d06385be74000f3c7a95bf1eef35d3ea32" dependencies = [ "cipher", "cpubits", - "cpufeatures 0.3.1", + "cpufeatures", ] [[package]] @@ -226,7 +226,7 @@ dependencies = [ "serde", "serde_json", "serial_test", - "sha2 0.10.9", + "sha2", "tempfile", "thiserror 1.0.69", "tokio", @@ -279,7 +279,7 @@ dependencies = [ "chrono", "clap", "clap_complete", - "console", + "console 0.15.11", "crossterm", "data-encoding", "dialoguer", @@ -413,15 +413,6 @@ dependencies = [ "zstd", ] -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - [[package]] name = "atomic-remote" version = "0.20.0" @@ -478,7 +469,7 @@ dependencies = [ "serde", "serde_json", "sha1", - "sha2 0.10.9", + "sha2", "syntext", "tar", "tempfile", @@ -617,6 +608,12 @@ dependencies = [ "tower-service", ] +[[package]] +name = "base16ct" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd307490d624467aa6f74b0eabb77633d1f758a7b25f12bceb0b22e08d9726f6" + [[package]] name = "base64" version = "0.22.1" @@ -629,12 +626,6 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" -[[package]] -name = "base64ct" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" - [[package]] name = "beef" version = "0.5.2" @@ -666,16 +657,7 @@ dependencies = [ "cc", "cfg-if", "constant_time_eq", - "cpufeatures 0.3.1", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", + "cpufeatures", ] [[package]] @@ -779,7 +761,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", - "cpufeatures 0.3.1", + "cpufeatures", "rand_core 0.10.1", ] @@ -803,8 +785,8 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8cf2a2c93cd704877c0858356ed03480ff301ee950b43f1cbe4573b088bfa6c" dependencies = [ - "block-buffer 0.12.1", - "crypto-common 0.2.2", + "block-buffer", + "crypto-common", "inout", ] @@ -927,10 +909,16 @@ dependencies = [ ] [[package]] -name = "const-oid" -version = "0.9.6" +name = "console" +version = "0.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +checksum = "e96a4956774c13c126a8b5af4daa79384f4d826534c95a02d76afb39e2ab64e3" +dependencies = [ + "encode_unicode", + "libc", + "unicode-width 0.2.2", + "windows-sys 0.61.2", +] [[package]] name = "const-oid" @@ -1000,15 +988,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15b85f9c39137c3a891689859392b1bd49812121d0d61c9caf00d46ed5ce06ae" -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - [[package]] name = "cpufeatures" version = "0.3.1" @@ -1027,12 +1006,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - [[package]] name = "crossbeam-channel" version = "0.5.17" @@ -1094,16 +1067,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "crypto-common" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array", - "typenum", -] - [[package]] name = "crypto-common" version = "0.2.2" @@ -1134,23 +1097,23 @@ dependencies = [ [[package]] name = "ctutils" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03bb0e1cc970d482d121d9a1744999169b69a07470b3d644a7894e53fcaf4574" +checksum = "a2376ffd6f96d8a9db59875b4b6b0237d6900b5baf64279714e05493ce64828a" dependencies = [ "cmov", ] [[package]] name = "curve25519-dalek" -version = "4.1.3" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +checksum = "b5eed333089e2e1c1ac8c6c0398e5e2497b4c9926ca6d0365ed1e099afa5bc23" dependencies = [ "cfg-if", - "cpufeatures 0.2.17", + "cpufeatures", "curve25519-dalek-derive", - "digest 0.10.7", + "digest", "fiat-crypto", "rustc_version", "subtle", @@ -1239,16 +1202,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "der" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" -dependencies = [ - "const-oid 0.9.6", - "zeroize", -] - [[package]] name = "deranged" version = "0.5.9" @@ -1283,32 +1236,22 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" dependencies = [ - "console", + "console 0.15.11", "shell-words", "tempfile", "thiserror 1.0.69", "zeroize", ] -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "crypto-common 0.1.7", -] - [[package]] name = "digest" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ - "block-buffer 0.12.1", - "const-oid 0.10.2", - "crypto-common 0.2.2", + "block-buffer", + "const-oid", + "crypto-common", ] [[package]] @@ -1354,25 +1297,24 @@ dependencies = [ [[package]] name = "ed25519" -version = "2.2.3" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +checksum = "29fcf32e6c73d1079f83ab4d782de2d81620346a5f38c6237a86a22f8368980a" dependencies = [ - "pkcs8", - "serde", + "serdect", "signature", ] [[package]] name = "ed25519-dalek" -version = "2.2.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +checksum = "6ebaa1a2bf1290ab3bfe5a7b771d050ebffab2711c19a81691c683a5144a25de" dependencies = [ "curve25519-dalek", "ed25519", "serde", - "sha2 0.10.9", + "sha2", "subtle", "zeroize", ] @@ -1480,9 +1422,9 @@ checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" [[package]] name = "fiat-crypto" -version = "0.2.9" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +checksum = "64cd1e32ddd350061ae6edb1b082d7c54915b5c672c389143b9a63403a109f24" [[package]] name = "filetime" @@ -1669,16 +1611,6 @@ dependencies = [ "slab", ] -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.17" @@ -1729,9 +1661,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" +checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e" dependencies = [ "bitflags 2.13.2", "libc", @@ -1774,15 +1706,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -1818,20 +1741,6 @@ dependencies = [ "hashbrown 0.14.5", ] -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32", - "rustc_version", - "serde", - "spin", - "stable_deref_trait", -] - [[package]] name = "heck" version = "0.5.0" @@ -2157,14 +2066,14 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.17.11" +version = "0.18.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +checksum = "9433806cd6b4ec1aba79c021c7e4c58fb4c3b9977c085062e611ac929998fb0c" dependencies = [ - "console", - "number_prefix", + "console 0.16.6", "portable-atomic", "unicode-width 0.2.2", + "unit-prefix", "web-time", ] @@ -2179,9 +2088,9 @@ dependencies = [ [[package]] name = "inout" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c0d789294fb457b791f7797a04478704788f30b407e5d0b01deaa846572d9f" +checksum = "3b5cf4372d022092674a83b8febf5865f7a573cc0c5baec5e49c879b6a20978f" dependencies = [ "hybrid-array", ] @@ -2387,9 +2296,9 @@ checksum = "ce5d3ddc6d3fa000eb1536d85e147bfe31aacaba692ed6a876f95cb7c855be78" [[package]] name = "libgit2-sys" -version = "0.17.0+1.8.1" +version = "0.18.8+1.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" +checksum = "7f7c568b25d7489bc3fb2988ed69ab111d2944d2f5fec3d5c987fe545ea97b50" dependencies = [ "cc", "libc", @@ -2451,9 +2360,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f710a23e6dbf193214fd46ca56a9d6864e550abe86202184532ae7275e46de19" +checksum = "ff20308ecabd635a2dc1dd5834a86c462cca20efba1d5d3ddab1f8aea3455cb2" dependencies = [ "cc", "libc", @@ -2748,12 +2657,6 @@ dependencies = [ "libc", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "once_cell" version = "1.21.4" @@ -2979,16 +2882,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - [[package]] name = "pkg-config" version = "0.3.34" @@ -3002,7 +2895,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0fa31d631f2b2cb2a544d0aa321ce847a94764d701ca2becc411138b93d49cd" dependencies = [ "cpubits", - "cpufeatures 0.3.1", + "cpufeatures", "universal-hash", ] @@ -3030,7 +2923,6 @@ dependencies = [ "cobs", "embedded-io 0.4.0", "embedded-io 0.6.1", - "heapless", "serde", ] @@ -3198,7 +3090,7 @@ dependencies = [ "purrdf-xsd", "regex", "regex-syntax", - "sha2 0.11.1", + "sha2", ] [[package]] @@ -3230,7 +3122,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac199f2e42bd2f48caba9a6573b1161f067d9fbe06c376c28cfc93ed69892912" dependencies = [ "purrdf-hash", - "sha2 0.11.1", + "sha2", ] [[package]] @@ -3303,7 +3195,7 @@ dependencies = [ "purrdf-xsd", "rayon", "regex", - "sha2 0.11.1", + "sha2", ] [[package]] @@ -3342,7 +3234,7 @@ dependencies = [ "purrdf-sparql-algebra", "rayon", "regex", - "sha2 0.11.1", + "sha2", ] [[package]] @@ -3377,7 +3269,7 @@ dependencies = [ "purrdf-xsd", "rayon", "regex", - "sha2 0.11.1", + "sha2", "wasm-bindgen", ] @@ -3900,9 +3792,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.15" +version = "0.103.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2" +checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281" dependencies = [ "ring", "rustls-pki-types", @@ -4094,6 +3986,16 @@ dependencies = [ "unsafe-libyaml", ] +[[package]] +name = "serdect" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66cf8fedced2fcf12406bcb34223dffb92eaf34908ede12fed414c82b7f00b3e" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "serial_test" version = "3.5.0" @@ -4122,24 +4024,13 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" -dependencies = [ - "cfg-if", - "cpufeatures 0.2.17", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.10.9" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214" dependencies = [ "cfg-if", - "cpufeatures 0.2.17", - "digest 0.10.7", + "cpufeatures", + "digest", ] [[package]] @@ -4149,8 +4040,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19" dependencies = [ "cfg-if", - "cpufeatures 0.3.1", - "digest 0.11.3", + "cpufeatures", + "digest", ] [[package]] @@ -4207,12 +4098,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.2.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "rand_core 0.6.4", -] +checksum = "28d567dcbaf0049cb8ac2608a76cd95ff9e4412e1899d389ee400918ca7537f5" [[package]] name = "simd-adler32" @@ -4264,25 +4152,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "spin" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" -dependencies = [ - "lock_api", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - [[package]] name = "stable_deref_trait" version = "1.2.1" @@ -5055,13 +4924,19 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" +[[package]] +name = "unit-prefix" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" + [[package]] name = "universal-hash" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4987bdc12753382e0bec4a65c50738ffaabc998b9cdd1f952fb5f39b0048a96" dependencies = [ - "crypto-common 0.2.2", + "crypto-common", "ctutils", ] @@ -5285,9 +5160,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" +checksum = "f5f280bbb2b287bc8e7de7e3852945a0ff50d1bbcb5ed42b6c7a568c546df171" dependencies = [ "rustls-pki-types", ] @@ -5755,27 +5630,27 @@ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" [[package]] name = "zstd" -version = "0.13.3" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +checksum = "db3ae9bf90af6e40197bef767eeefc46ad6397420fe873830bd85e5fbbfb3c70" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.3.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d80649ab6db9d9f6f9c80a40becd948eda4714a0a5ac8c4d157a32231c7882" +checksum = "ded520f16b29e1a9b771c722221b2b0a0398c2316d9bb3c42b458a5414d7434b" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.1.1+zstd.1.5.7" +version = "2.1.2+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeec9eaf2dffbbd09201e23bd0ffcbaa33bb8e9266a10734fd7ed90a85eca078" +checksum = "481ada9c543b2323cbb7bbdbb5249177fbf0188ed959ed2c15e4b22421c84ed3" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 9ab35e97..cf8af56d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,7 +63,7 @@ serde_json = "1.0" # a sequence of Unicode scalar values, a number outside the profile -- are # refused with a named error rather than collapsed or rounded. jcs-admit = "0.1" -postcard = { version = "1.0", features = ["alloc"] } +postcard = { version = "1.0", default-features = false, features = ["alloc"] } toml = "0.8" semver = "1" @@ -76,11 +76,11 @@ fastcdc = "3.1" # Hashing & Crypto bs58 = "0.5" blake3 = "1.5" -ed25519-dalek = { version = "2.1", features = ["serde"] } +ed25519-dalek = { version = "3.0", features = ["serde"] } rand = "0.8" # Compression -zstd = "0.13" +zstd = "0.14" # Database # SnapshotBackend forwards the locking API introduced after redb 4.2. @@ -93,7 +93,7 @@ rusqlite = { version = "0.32", features = ["bundled"] } # CLI clap = { version = "4.5", features = ["derive", "env", "wrap_help"] } clap_complete = { version = "4.5", features = ["unstable-dynamic"] } -indicatif = "0.17" +indicatif = "0.18" dialoguer = "0.11" console = "0.15" @@ -141,7 +141,7 @@ syntext = { version = "1.1", default-features = false, features = ["memmap2", "r # vendored-openssl compiles OpenSSL from source, which is required for # cross-compilation targets (e.g. aarch64-unknown-linux-gnu) where the # target architecture's OpenSSL system libraries are not available. -git2 = { version = "0.19", features = ["vendored-openssl"] } +git2 = { version = "0.21", features = ["vendored-openssl", "https", "ssh"] } # Testing quickcheck = "1.0" diff --git a/atomic-agent/Cargo.toml b/atomic-agent/Cargo.toml index 2c5398b0..7d2278d2 100644 --- a/atomic-agent/Cargo.toml +++ b/atomic-agent/Cargo.toml @@ -30,7 +30,7 @@ zstd = { workspace = true } # Hashing blake3 = { workspace = true } -sha2 = "0.10" +sha2 = "0.11" # Time chrono = { workspace = true } diff --git a/atomic-agent/src/record/scope.rs b/atomic-agent/src/record/scope.rs index 2e6a7e3b..4e6e3d9c 100644 --- a/atomic-agent/src/record/scope.rs +++ b/atomic-agent/src/record/scope.rs @@ -44,6 +44,30 @@ fn checked_path(root: &Path, path: &str) -> Result { Ok(full) } +/// Lowercase hex of a digest. `digest` 0.11 dropped the `LowerHex` output. +fn hex(bytes: &[u8]) -> String { + let mut out = String::with_capacity(bytes.len() * 2); + for byte in bytes { + out.push_str(&format!("{byte:02x}")); + } + out +} + +/// `digest` 0.11 dropped the `std::io::Write` impl, so streaming file bytes +/// into a hasher needs this adapter. +struct DigestWriter<'a, D>(&'a mut D); + +impl std::io::Write for DigestWriter<'_, D> { + fn write(&mut self, buf: &[u8]) -> std::io::Result { + self.0.update(buf); + Ok(buf.len()) + } + + fn flush(&mut self) -> std::io::Result<()> { + Ok(()) + } +} + /// Fingerprint a file without following its final symlink. `None` means deleted. /// Reject directories and paths outside the working tree. pub fn fingerprint(root: &Path, path: &str) -> Result, String> { @@ -56,8 +80,8 @@ pub fn fingerprint(root: &Path, path: &str) -> Result, String> { if meta.file_type().is_symlink() { let target = std::fs::read_link(full).map_err(|e| e.to_string())?; return Ok(Some(format!( - "link:{:x}", - Sha256::digest(target.as_os_str().as_encoded_bytes()) + "link:{}", + hex(&Sha256::digest(target.as_os_str().as_encoded_bytes())) ))); } if !meta.is_file() { @@ -72,11 +96,8 @@ pub fn fingerprint(root: &Path, path: &str) -> Result, String> { let executable = false; let mut file = std::fs::File::open(full).map_err(|e| e.to_string())?; let mut hash = Sha256::new(); - std::io::copy(&mut file, &mut hash).map_err(|e| e.to_string())?; - Ok(Some(format!( - "file:{hash:x}:{executable}", - hash = hash.finalize() - ))) + std::io::copy(&mut file, &mut DigestWriter(&mut hash)).map_err(|e| e.to_string())?; + Ok(Some(format!("file:{}:{executable}", hex(&hash.finalize())))) } /// Return fingerprints for dirty files and explicitly requested prior candidates. @@ -194,3 +215,21 @@ pub(super) fn filter(status: RepositoryStatus, files: Option<&FileManifest>) -> } result } + +#[cfg(test)] +mod tests { + use super::*; + + /// Fingerprints persist in session manifests and are compared across + /// binaries, so the encoding must stay the lowercase SHA-256 hex that the + /// pre-`digest`-0.11 `{:x}` formatting produced. + #[test] + fn fingerprints_are_lowercase_sha256_hex() { + let dir = tempfile::tempdir().unwrap(); + std::fs::write(dir.path().join("f.txt"), b"hi\n").unwrap(); + assert_eq!( + fingerprint(dir.path(), "f.txt").unwrap().unwrap(), + "file:98ea6e4f216f2fb4b69fff9b3a44842c38686ca685f3f55dc48c5d3fb1107be4:false" + ); + } +} diff --git a/atomic-cli/src/commands/clone/command.rs b/atomic-cli/src/commands/clone/command.rs index 6786a509..d6072b77 100644 --- a/atomic-cli/src/commands/clone/command.rs +++ b/atomic-cli/src/commands/clone/command.rs @@ -371,7 +371,7 @@ impl Clone { })?; git.head() .ok() - .and_then(|head| head.shorthand().map(str::to_owned)) + .and_then(|head| head.shorthand().ok().map(str::to_owned)) .unwrap_or_else(|| self.view.clone()) }; let outcome = crate::commands::git::bootstrap::clone_git_url( diff --git a/atomic-cli/src/commands/git/binding.rs b/atomic-cli/src/commands/git/binding.rs index c7ed29de..b12e2320 100644 --- a/atomic-cli/src/commands/git/binding.rs +++ b/atomic-cli/src/commands/git/binding.rs @@ -677,9 +677,9 @@ fn resolve_published_binding(git: &GitRepository, id: &str) -> CliResult CensusClass { .map_err(|e| e.to_string())? { let reference = reference.map_err(|e| e.to_string())?; - if let Some(name) = reference.name() { - refs.push(name.to_string()); - } + let name = reference.name().map_err(|error| error.to_string())?; + refs.push(name.to_string()); } if refs.is_empty() { return Ok(CensusClass { diff --git a/atomic-cli/src/commands/git/hooks.rs b/atomic-cli/src/commands/git/hooks.rs index 65438b0c..1062a53c 100644 --- a/atomic-cli/src/commands/git/hooks.rs +++ b/atomic-cli/src/commands/git/hooks.rs @@ -1779,7 +1779,7 @@ fn warn_if_view_mismatch(root: &Path) { repository .head() .ok() - .and_then(|head| head.shorthand().map(str::to_string)) + .and_then(|head| head.shorthand().ok().map(str::to_string)) }); if let Some(git_branch) = git_branch { if !atomic_view.is_empty() && git_branch != atomic_view { diff --git a/atomic-cli/src/commands/git/import.rs b/atomic-cli/src/commands/git/import.rs index c44fedcf..d2e63324 100644 --- a/atomic-cli/src/commands/git/import.rs +++ b/atomic-cli/src/commands/git/import.rs @@ -171,7 +171,7 @@ fn current_git_branch(git_repo: &GitRepository) -> Option { if !head.is_branch() { return None; } - head.shorthand().map(ToOwned::to_owned) + head.shorthand().ok().map(ToOwned::to_owned) } /// Binding transport requires the ordinary importer. Presence selects the @@ -431,7 +431,7 @@ impl Import { git_repo .find_remote("origin") .ok() - .and_then(|remote| remote.url().map(|s| s.to_string())) + .and_then(|remote| remote.url().ok().map(|s| s.to_string())) .and_then(|url| { // Extract repo name from URL like "https://github.com/holman/spark.git" // or "git@github.com:holman/spark.git" @@ -1533,7 +1533,7 @@ fn import_git_tags_into_view(repo: &mut Repository, git_repo: &GitRepository, vi let mut imported = 0usize; let mut refused = 0usize; for reference in tag_refs.flatten() { - let Some(name) = reference.shorthand().map(str::to_string) else { + let Ok(name) = reference.shorthand().map(str::to_string) else { continue; }; match repo.import_git_tag_from_git(view, git_repo, &name) { @@ -1610,7 +1610,7 @@ impl MaterializationTarget<'_> { message: format!("cannot read the tree of branch '{branch}': {error}"), })?; tree.walk(git2::TreeWalkMode::PreOrder, |directory, entry| { - if let Some(name) = entry.name() { + if let Ok(name) = entry.name() { paths.insert(format!("{directory}{name}")); } git2::TreeWalkResult::Ok @@ -1665,7 +1665,7 @@ fn require_materializable_worktree( let mut colliding: Vec = statuses .iter() .filter(|entry| entry.status().contains(git2::Status::WT_NEW)) - .filter_map(|entry| entry.path().map(str::to_string)) + .filter_map(|entry| entry.path().ok().map(str::to_string)) .filter(|path| target_paths.contains(path)) .collect(); colliding.sort(); diff --git a/atomic-cli/src/commands/git/observation.rs b/atomic-cli/src/commands/git/observation.rs index 6da4f5c5..b5ebd74c 100644 --- a/atomic-cli/src/commands/git/observation.rs +++ b/atomic-cli/src/commands/git/observation.rs @@ -589,8 +589,10 @@ pub fn observe_head(repository: &GitRepository) -> Result { let oid = resolved.target().ok_or_else(|| { @@ -1028,7 +1030,7 @@ fn compute_index_tree_oid( }), )); }; - if entry.oid == Oid::zero() || insert_index_tree_entry(&mut root, entry, mode).is_err() { + if entry.oid == Oid::ZERO_SHA1 || insert_index_tree_entry(&mut root, entry, mode).is_err() { return Ok(( None, IndexTreeAvailability::Unavailable(IndexTreeUnavailable::UnsupportedEntry { @@ -1357,7 +1359,10 @@ fn observe_refs(repository: &GitRepository) -> Result, Obser })?; let target = if let Some(oid) = reference.target() { RefTargetObservation::Direct(oid) - } else if let Some(symbolic) = reference.symbolic_target() { + } else if let Some(symbolic) = reference + .symbolic_target() + .map_err(|error| ObservationError::new(format!("cannot read Git HEAD: {error}")))? + { RefTargetObservation::Symbolic(symbolic.as_bytes().to_vec()) } else { RefTargetObservation::Unresolved diff --git a/atomic-cli/src/commands/git/parallel.rs b/atomic-cli/src/commands/git/parallel.rs index 0fa16840..fbb046ee 100644 --- a/atomic-cli/src/commands/git/parallel.rs +++ b/atomic-cli/src/commands/git/parallel.rs @@ -1809,7 +1809,7 @@ pub(crate) fn detect_git_boundaries(git: &GitRepository) -> CliResult Option { fn extract_commit_metadata(commit: &git2::Commit) -> CliResult { let author = commit.author(); let author_name = author.name().unwrap_or("Unknown").to_string(); - let author_email = author.email().map(|s| s.to_string()); + let author_email = author.email().ok().map(|s| s.to_string()); let author_name_raw = author.name_bytes().to_vec(); let author_email_raw = { let bytes = author.email_bytes(); @@ -8884,7 +8884,7 @@ fn extract_commit_metadata(commit: &git2::Commit) -> CliResult { }; let committer = commit.committer(); let committer_name = committer.name().unwrap_or("Unknown").to_string(); - let committer_email = committer.email().map(|s| s.to_string()); + let committer_email = committer.email().ok().map(|s| s.to_string()); let committer_name_raw = committer.name_bytes().to_vec(); let committer_email_raw = { let bytes = committer.email_bytes(); @@ -10161,7 +10161,7 @@ mod tests { "feat: test\n\nAtomic-View: {}\nAtomic-State: {}", view, state_b32 )), - tree_oid: Oid::zero(), + tree_oid: Oid::ZERO_SHA1, parent_tree_oid: None, raw_object: Vec::new(), } diff --git a/atomic-cli/src/commands/git/push.rs b/atomic-cli/src/commands/git/push.rs index 5dcdbb57..53909022 100644 --- a/atomic-cli/src/commands/git/push.rs +++ b/atomic-cli/src/commands/git/push.rs @@ -353,7 +353,7 @@ impl Command for Push { let branch_name = git_repo .head() .ok() - .and_then(|h| h.shorthand().map(str::to_owned)) + .and_then(|h| h.shorthand().ok().map(str::to_owned)) .unwrap_or_else(|| "HEAD".to_string()); let target = target_override.unwrap_or(&branch_name); let ahead = self.unpushed_commit_count(&git_repo, &branch_name, target_override); @@ -545,8 +545,12 @@ impl Push { let git_sig = git_repo.signature().map_err(|e| CliError::GitError { message: format!("Failed to get git signature: {}", e), })?; - let author = - super::shadow::projection_author(repo, repo_root, git_sig.name(), git_sig.email()); + let author = super::shadow::projection_author( + repo, + repo_root, + git_sig.name().ok(), + git_sig.email().ok(), + ); msg.push_str(&format!("atomic-author {}\n", author.did)); if let Some(agent) = &author.agent_did { msg.push_str(&format!("atomic-agent {agent}\n")); @@ -668,7 +672,7 @@ impl Push { git_repo .head() .ok() - .and_then(|h| h.shorthand().map(str::to_owned)) + .and_then(|h| h.shorthand().ok().map(str::to_owned)) .unwrap_or_else(|| "HEAD".to_string()) } @@ -695,7 +699,7 @@ impl Push { None => git_repo .branch_upstream_name(&local_ref) .ok() - .and_then(|buf| buf.as_str().map(str::to_owned)) + .and_then(|buf| buf.as_str().ok().map(str::to_owned)) .and_then(|name| git_repo.refname_to_id(&name).ok()), }; diff --git a/atomic-cli/src/commands/git/real_import_sample.rs b/atomic-cli/src/commands/git/real_import_sample.rs index 090d8411..c64ae250 100644 --- a/atomic-cli/src/commands/git/real_import_sample.rs +++ b/atomic-cli/src/commands/git/real_import_sample.rs @@ -120,7 +120,7 @@ fn prepare_hyperfine_publication_sample() { assert_ne!( git.head() .ok() - .and_then(|head| head.shorthand().map(str::to_owned)) + .and_then(|head| head.shorthand().ok().map(str::to_owned)) .as_deref(), Some(view.as_str()), "this ODB-only sample must not claim to import the source's checked-out branch" diff --git a/atomic-cli/src/commands/git/ref_mapping.rs b/atomic-cli/src/commands/git/ref_mapping.rs index 3d72de37..ede859bc 100644 --- a/atomic-cli/src/commands/git/ref_mapping.rs +++ b/atomic-cli/src/commands/git/ref_mapping.rs @@ -376,7 +376,7 @@ fn renamed_branch_target(git: &GitRepository, old_ref: &str) -> Option { let needle = format!("renamed {old_ref} to "); let branches = git.branches(Some(git2::BranchType::Local)).ok()?; for (branch, _) in branches.flatten() { - let Some(name) = branch.get().name() else { + let Ok(name) = branch.get().name() else { continue; }; let Ok(reflog) = git.reflog(name) else { @@ -385,7 +385,7 @@ fn renamed_branch_target(git: &GitRepository, old_ref: &str) -> Option { if reflog.iter().any(|entry| { entry .message() - .is_some_and(|message| message.contains(&needle)) + .is_ok_and(|message| message.is_some_and(|message| message.contains(&needle))) }) { return Some(name.to_string()); } diff --git a/atomic-cli/src/commands/git/shadow.rs b/atomic-cli/src/commands/git/shadow.rs index 65590cc9..56a09795 100644 --- a/atomic-cli/src/commands/git/shadow.rs +++ b/atomic-cli/src/commands/git/shadow.rs @@ -1603,7 +1603,12 @@ fn build_switch_projection( tree_oid.as_bytes().to_vec(), ) .map_err(|error| git_error(error.to_string()))?; - let author = projection_author(repo, repo_root, signature.name(), signature.email()); + let author = projection_author( + repo, + repo_root, + signature.name().ok(), + signature.email().ok(), + ); let _ = &tree; let (commit_oid, commit_bytes) = atomic_repository::build_projected_commit( git_repo, @@ -1615,7 +1620,12 @@ fn build_switch_projection( state: state_merkle, binding_id: None, conflict_set_hash, - author: projection_author(repo, repo_root, signature.name(), signature.email()), + author: projection_author( + repo, + repo_root, + signature.name().ok(), + signature.email().ok(), + ), timestamp: chrono::Utc::now().timestamp(), timestamp_offset: local_utc_offset_minutes(), }, @@ -1816,7 +1826,9 @@ fn snapshot_reference(git_repo: &GitRepository, name: &str) -> CliResult { if let Some(target) = reference.target() { Ok(ReferenceSnapshot::Direct(target)) - } else if let Some(target) = reference.symbolic_target() { + } else if let Some(target) = reference.symbolic_target().map_err(|error| { + git_error(format!("cannot read Git reference '{name}': {error}")) + })? { Ok(ReferenceSnapshot::Symbolic(target.to_string())) } else { Err(git_error(format!( diff --git a/atomic-cli/src/commands/git/shim.rs b/atomic-cli/src/commands/git/shim.rs index 325ba5af..3c22f95f 100644 --- a/atomic-cli/src/commands/git/shim.rs +++ b/atomic-cli/src/commands/git/shim.rs @@ -2110,7 +2110,7 @@ pub(crate) fn refresh_checkpoint_after_verified_import( let head = git .head() .map_err(|error| git_error(format!("Git HEAD is unavailable: {error}")))?; - if head.shorthand() != Some(view) { + if head.shorthand().ok() != Some(view) { return Ok(CheckpointRefresh::SkippedViewMismatch); } let commit = head @@ -2915,7 +2915,7 @@ pub(crate) fn project_atomic_to_git( } let branch = head .shorthand() - .ok_or_else(|| git_error("Git branch name is not valid UTF-8"))?; + .map_err(|error| git_error(format!("Git branch name is not valid UTF-8: {error}")))?; let desired_view = repo .desired_view_name(working_copy) .map_err(CliError::from)?; @@ -3209,7 +3209,7 @@ fn collect_git_tree( for entry in tree.iter() { let name = entry .name() - .ok_or_else(|| git_error("Git tree contains a non-UTF-8 path"))?; + .map_err(|error| git_error(format!("Git tree contains a non-UTF-8 path: {error}")))?; let path = if prefix.is_empty() { name.to_string() } else { diff --git a/atomic-cli/src/commands/git/transport.rs b/atomic-cli/src/commands/git/transport.rs index 58c3f3af..8f80be8b 100644 --- a/atomic-cli/src/commands/git/transport.rs +++ b/atomic-cli/src/commands/git/transport.rs @@ -85,7 +85,7 @@ pub fn configure_fetch_refspecs(git: &GitRepository, remote: &str) -> CliResult< let mut out = Vec::new(); while let Some(entry) = entries.next() { let entry = entry?; - if let Some(value) = entry.value() { + if let Ok(value) = entry.value() { out.push(value.to_string()); } } diff --git a/atomic-cli/tests/it/git_binding_cb6a_test.rs b/atomic-cli/tests/it/git_binding_cb6a_test.rs index 39492503..1d9f6298 100644 --- a/atomic-cli/tests/it/git_binding_cb6a_test.rs +++ b/atomic-cli/tests/it/git_binding_cb6a_test.rs @@ -99,10 +99,11 @@ fn binding_ref_names(git_dir: &Path) -> Vec { let mut refs = Vec::new(); for reference in git.references().expect("list refs") { let reference = reference.expect("reference"); - if let Some(name) = reference.name() { - if name.starts_with("refs/atomic/bindings/") { - refs.push(name.to_string()); - } + let Ok(name) = reference.name() else { + continue; + }; + if name.starts_with("refs/atomic/bindings/") { + refs.push(name.to_string()); } } refs.sort(); diff --git a/atomic-cli/tests/it/git_binding_cb6b_test.rs b/atomic-cli/tests/it/git_binding_cb6b_test.rs index 0c8934cc..a92500b2 100644 --- a/atomic-cli/tests/it/git_binding_cb6b_test.rs +++ b/atomic-cli/tests/it/git_binding_cb6b_test.rs @@ -242,7 +242,7 @@ fn imported_history_refuses_private_packs_and_fresh_clone_fetch_is_explicitly_in .references() .expect("refs") .filter_map(|r| r.ok()) - .filter_map(|r| r.name().map(|n| n.to_string())) + .filter_map(|r| r.name().ok().map(|n| n.to_string())) .collect(); assert!( refs.iter() @@ -457,7 +457,7 @@ fn private_sidecars_never_enter_a_pack_and_sentinels_stay_out_of_git() { .references() .expect("refs") .filter_map(|r| r.ok()) - .filter_map(|r| r.name().map(|n| n.to_string())) + .filter_map(|r| r.name().ok().map(|n| n.to_string())) .collect(); assert!( refs.iter() diff --git a/atomic-cli/tests/it/git_shim_cb10a_test.rs b/atomic-cli/tests/it/git_shim_cb10a_test.rs index 62d32629..d3b49201 100644 --- a/atomic-cli/tests/it/git_shim_cb10a_test.rs +++ b/atomic-cli/tests/it/git_shim_cb10a_test.rs @@ -852,7 +852,7 @@ fn stale_bookkeeping_heals_but_an_unreachable_baseline_fails_closed() { .expect("read") .expect("mapping") .clone(); - garbage.last_observed_local = Some(git2::Oid::zero().to_string()); + garbage.last_observed_local = Some(git2::Oid::ZERO_SHA1.to_string()); txn.put_ref_mapping_bytes(view.id, &garbage.encode().expect("encode")) .expect("garbage put"); txn.commit().expect("commit"); diff --git a/atomic-repository/Cargo.toml b/atomic-repository/Cargo.toml index 51531dc0..5d3b753f 100644 --- a/atomic-repository/Cargo.toml +++ b/atomic-repository/Cargo.toml @@ -56,8 +56,8 @@ reqwest = { workspace = true, features = ["rustls-tls"] } tokio = { workspace = true } tar = "0.4" flate2 = "1.0" -sha1 = "0.10" -sha2 = "0.10" +sha1 = "0.11" +sha2 = "0.11" fs2 = "0.4" [target.'cfg(windows)'.dependencies] diff --git a/atomic-repository/src/git_binding/transport.rs b/atomic-repository/src/git_binding/transport.rs index 62678526..7532aa4f 100644 --- a/atomic-repository/src/git_binding/transport.rs +++ b/atomic-repository/src/git_binding/transport.rs @@ -82,18 +82,20 @@ pub fn transferable_binding_refs(git: &git2::Repository) -> Result, .map_err(|error| format!("cannot enumerate refs: {error}"))? { let reference = reference.map_err(|error| format!("cannot read ref: {error}"))?; - if let Some(name) = reference.name() { - if is_transferable_ref(name) { - if names.len() >= MAX_TRANSFER_REFS { - return Err(format!( - "the binding ref surface exceeds the transfer bound of \ - {MAX_TRANSFER_REFS} refs; the enumeration is bounded and refuses \ - instead of feeding an unbounded queue" - )); - } - names.push(name.to_string()); - } + let name = reference + .name() + .map_err(|error| format!("cannot read ref name: {error}"))?; + if !is_transferable_ref(name) { + continue; } + if names.len() >= MAX_TRANSFER_REFS { + return Err(format!( + "the binding ref surface exceeds the transfer bound of \ + {MAX_TRANSFER_REFS} refs; the enumeration is bounded and refuses \ + instead of feeding an unbounded queue" + )); + } + names.push(name.to_string()); } names.sort(); Ok(names) diff --git a/atomic-repository/src/repository/anchor.rs b/atomic-repository/src/repository/anchor.rs index 82fee712..dd5e094d 100644 --- a/atomic-repository/src/repository/anchor.rs +++ b/atomic-repository/src/repository/anchor.rs @@ -835,7 +835,13 @@ impl Repository { // checkpoint records a `None` symref for detached states so the // entry protocol keeps them aligned (RFC §7.5). let symref = if head.is_branch() { - head.name().map(str::to_string) + Some( + head.name() + .map_err(|error| RepositoryError::InvalidRepository { + reason: format!("cannot read Git HEAD ref name: {error}"), + })? + .to_string(), + ) } else { None }; @@ -1687,16 +1693,16 @@ fn branch_is_newly_created(git: &GitRepository, branch: &str) -> bool { if reflog.len() != 1 { return false; } - reflog - .iter() - .next() - .and_then(|entry| entry.message().map(str::to_string)) - .is_some_and(|message| { - let message = message.trim(); - message.starts_with("branch: Created from") - || message.starts_with("branch: Created") - || message.starts_with("Created from") - }) + let Some(entry) = reflog.iter().next() else { + return false; + }; + let Ok(Some(message)) = entry.message() else { + return false; + }; + let message = message.trim(); + message.starts_with("branch: Created from") + || message.starts_with("branch: Created") + || message.starts_with("Created from") } fn pristine_map(error: atomic_core::pristine::PristineError) -> RepositoryError { diff --git a/atomic-repository/src/repository/binding_store.rs b/atomic-repository/src/repository/binding_store.rs index bb45298a..267e0667 100644 --- a/atomic-repository/src/repository/binding_store.rs +++ b/atomic-repository/src/repository/binding_store.rs @@ -408,9 +408,9 @@ impl Repository { let mut changes_pack: Option> = None; let mut conflicts_pack: Option> = None; for entry in tree.iter() { - let name = entry.name().ok_or_else(|| { + let name = entry.name().map_err(|error| { git_map(format!( - "binding ref '{ref_name}' tree holds a non-UTF-8 entry name" + "binding ref '{ref_name}' tree holds a non-UTF-8 entry name: {error}" )) })?; let allowlisted = matches!( @@ -658,9 +658,9 @@ impl Repository { let mut pack: Option> = None; for entry in tree.iter() { - let name = entry.name().ok_or_else(|| { + let name = entry.name().map_err(|error| { git_map(format!( - "binding ref '{ref_name}' tree holds a non-UTF-8 entry name" + "binding ref '{ref_name}' tree holds a non-UTF-8 entry name: {error}" )) })?; let allowlisted = matches!( @@ -728,9 +728,9 @@ impl Repository { let mut pack: Option> = None; for entry in tree.iter() { - let name = entry.name().ok_or_else(|| { + let name = entry.name().map_err(|error| { git_map(format!( - "binding ref '{ref_name}' tree holds a non-UTF-8 entry name" + "binding ref '{ref_name}' tree holds a non-UTF-8 entry name: {error}" )) })?; let allowlisted = matches!( diff --git a/atomic-repository/src/repository/git_observation.rs b/atomic-repository/src/repository/git_observation.rs index 614a8090..cd03702f 100644 --- a/atomic-repository/src/repository/git_observation.rs +++ b/atomic-repository/src/repository/git_observation.rs @@ -1027,8 +1027,10 @@ fn observe_metadata_head( let head = repository .find_reference("HEAD") .map_err(|error| ObservationError::GitIndex(format!("cannot read Git HEAD: {error}")))?; - if let Some(symref) = head.symbolic_target() { - let symref = symref.to_string(); + let symref = head.symbolic_target().map_err(|error| { + ObservationError::GitIndex(format!("cannot read Git HEAD symref: {error}")) + })?; + if let Some(symref) = symref.map(str::to_string) { match head.resolve() { Ok(resolved) => resolved .target() @@ -1336,7 +1338,7 @@ pub fn observe_colocated_git_readiness(root: &Path) -> ColocatedGitReadiness { .map(|names| { names .iter() - .flatten() + .filter_map(|name| name.ok().flatten()) .map(str::to_string) .collect::>() }) diff --git a/atomic-repository/src/repository/projection_effects.rs b/atomic-repository/src/repository/projection_effects.rs index 5801b1ff..c447f5df 100644 --- a/atomic-repository/src/repository/projection_effects.rs +++ b/atomic-repository/src/repository/projection_effects.rs @@ -95,7 +95,10 @@ pub(super) fn read_head_target( ) -> Result, RepositoryError> { match git.find_reference("HEAD") { Ok(head) => { - if let Some(symref) = head.symbolic_target() { + let symref = head + .symbolic_target() + .map_err(|error| git_map(format!("cannot read Git HEAD: {error}")))?; + if let Some(symref) = symref { // An unborn branch (HEAD -> refs/heads/master with no // commits) resolves to no target: that is a missing lease // value, not an operational failure. diff --git a/atomic-repository/src/repository/tests/binding_fetch_tests.rs b/atomic-repository/src/repository/tests/binding_fetch_tests.rs index 3243378b..cc36555a 100644 --- a/atomic-repository/src/repository/tests/binding_fetch_tests.rs +++ b/atomic-repository/src/repository/tests/binding_fetch_tests.rs @@ -296,7 +296,7 @@ fn transfer_to_client(publisher_root: &std::path::Path, binding: &GitStateBindin let head_branch = publisher_git .head() .ok() - .and_then(|head| head.shorthand().map(|s| s.to_string())); + .and_then(|head| head.shorthand().ok().map(|s| s.to_string())); let mut push_specs: Vec = vec![binding_refspec]; if let Some(branch) = &head_branch { push_specs.push(format!("refs/heads/{branch}:refs/heads/{branch}")); diff --git a/atomic-repository/src/repository/tests/binding_store_tests.rs b/atomic-repository/src/repository/tests/binding_store_tests.rs index c4122b47..240aa218 100644 --- a/atomic-repository/src/repository/tests/binding_store_tests.rs +++ b/atomic-repository/src/repository/tests/binding_store_tests.rs @@ -481,7 +481,7 @@ fn publication_with_a_signed_summary_carries_only_the_allowlisted_summary() { let tree = commit.tree().unwrap(); let mut names: Vec = tree .iter() - .filter_map(|entry| entry.name().map(|name| name.to_string())) + .filter_map(|entry| entry.name().ok().map(|name| name.to_string())) .collect(); names.sort(); assert_eq!( diff --git a/atomic-repository/src/repository/tests/ref_mapping_tests.rs b/atomic-repository/src/repository/tests/ref_mapping_tests.rs index 34ecc00c..5e19c17e 100644 --- a/atomic-repository/src/repository/tests/ref_mapping_tests.rs +++ b/atomic-repository/src/repository/tests/ref_mapping_tests.rs @@ -428,7 +428,7 @@ fn incomplete_walks_and_stale_exports_never_prove_containment() { ); // An unreachable (garbage) baseline is unprovable — never an empty set // read as positive containment (CB-10A review R2). - let zero = git2::Oid::zero().to_string(); + let zero = git2::Oid::ZERO_SHA1.to_string(); assert!(matches!( commits_added_since(&git, Some(&zero), Some(&child.to_string())), AddedCommits::Unprovable(_) diff --git a/atomic-repository/src/repository/tests/tag_projection_tests.rs b/atomic-repository/src/repository/tests/tag_projection_tests.rs index 2e5a6df5..19687815 100644 --- a/atomic-repository/src/repository/tests/tag_projection_tests.rs +++ b/atomic-repository/src/repository/tests/tag_projection_tests.rs @@ -143,7 +143,7 @@ fn annotated_tag_round_trip_carries_the_binding_and_restores_the_bound_state() { fixture.commit_oid, "the annotated tag points at the bound commit" ); - let message = tag_object.message().unwrap(); + let message = tag_object.message().unwrap().expect("tag message"); assert!( message.contains("Release version 1.0.0"), "the Atomic tag message is preserved: {message}" diff --git a/packages/opencode-atomic-hooks/bun.lock b/packages/opencode-atomic-hooks/bun.lock index 489ee85a..1e4f269c 100644 --- a/packages/opencode-atomic-hooks/bun.lock +++ b/packages/opencode-atomic-hooks/bun.lock @@ -14,6 +14,9 @@ }, }, }, + "overrides": { + "zod": "^4.6.7", + }, "packages": { "@opencode-ai/plugin": ["@opencode-ai/plugin@1.2.6", "", { "dependencies": { "@opencode-ai/sdk": "1.2.6", "zod": "4.1.8" } }, "sha512-CJEp3k17yWsjyfivm3zQof8L42pdze3a7iTqMOyesHgJplSuLiBYAMndbBYMDuJkyAh0dHYjw8v10vVw7Kfl4Q=="], @@ -29,6 +32,6 @@ "undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="], - "zod": ["zod@4.1.8", "", {}, "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ=="], + "zod": ["zod@4.6.7", "", {}, "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg=="], } } diff --git a/packages/opencode-atomic-hooks/package.json b/packages/opencode-atomic-hooks/package.json index 27f11536..8849037d 100644 --- a/packages/opencode-atomic-hooks/package.json +++ b/packages/opencode-atomic-hooks/package.json @@ -36,6 +36,9 @@ "version-control", "code-attribution" ], + "overrides": { + "zod": "^4.6.7" + }, "license": "MIT", "repository": { "type": "git", diff --git a/tools/shacl-purrdf-spike/Cargo.lock b/tools/shacl-purrdf-spike/Cargo.lock index aaf75a1a..01c94973 100644 --- a/tools/shacl-purrdf-spike/Cargo.lock +++ b/tools/shacl-purrdf-spike/Cargo.lock @@ -157,9 +157,9 @@ dependencies = [ [[package]] name = "ctutils" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03bb0e1cc970d482d121d9a1744999169b69a07470b3d644a7894e53fcaf4574" +checksum = "a2376ffd6f96d8a9db59875b4b6b0237d6900b5baf64279714e05493ce64828a" dependencies = [ "cmov", ] @@ -225,18 +225,18 @@ dependencies = [ [[package]] name = "inout" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4250ce6452e92010fdf7268ccc5d14faa80bb12fc741938534c58f16804e03c7" +checksum = "3b5cf4372d022092674a83b8febf5865f7a573cc0c5baec5e49c879b6a20978f" dependencies = [ "hybrid-array", ] [[package]] name = "libc" -version = "0.2.190" +version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce5d3ddc6d3fa000eb1536d85e147bfe31aacaba692ed6a876f95cb7c855be78" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" [[package]] name = "memchr" From 3645fe35e514b806f5522a654d1884daf3924814 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Fri, 30 Oct 2026 20:10:34 +0100 Subject: [PATCH 2/5] fix(cli): adapt feature-gated shorthand() call to git2 0.21 Result API --- atomic-cli/src/commands/git/push.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic-cli/src/commands/git/push.rs b/atomic-cli/src/commands/git/push.rs index 53909022..f235562f 100644 --- a/atomic-cli/src/commands/git/push.rs +++ b/atomic-cli/src/commands/git/push.rs @@ -845,7 +845,7 @@ impl Push { git_repo .head() .ok() - .and_then(|head| head.shorthand().map(str::to_string)) + .and_then(|head| head.shorthand().ok().map(str::to_string)) .unwrap_or_else(|| "master".to_string()) ); let verified = publication.git_head.ok_or_else(|| CliError::GitError { From bfa278c587d05a5fe7e1305a0cfd6ca8d09eaebb Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Mon, 2 Nov 2026 09:15:28 -0600 Subject: [PATCH 3/5] refactor(deps): tighten idiom and preserve ref-enumeration semantics Follow-up review of the git2 0.21 migration. `Reference::name()` now returns `Result` where it used to return `Option`, and three enumeration sites had been converted into hard errors: a single non-UTF-8 ref name (git allows those) would have aborted binding publication, id lookup, degraded-binding install and the WIP census. They skip again, as before; only callers that need one specific name still propagate the error. Also: hex encoding writes through `fmt::Write` instead of allocating a `String` per byte, `is_ok_and` replaces an `Option` dance, redundant `|x| x.to_string()` closures use `ToString::to_string`, a shadowed closure parameter is renamed, and a test uses two `expect`s instead of `unwrap().expect()`. No pedantic-clean regression remains on the touched lines; workspace `clippy -D warnings`, `fmt` and the agent/repository suites pass. --- atomic-agent/src/record/scope.rs | 5 ++++- atomic-cli/src/commands/git/binding.rs | 7 ++++--- atomic-cli/src/commands/git/bootstrap.rs | 6 +++--- atomic-cli/src/commands/git/census.rs | 4 +++- atomic-cli/src/commands/git/import.rs | 2 +- atomic-cli/src/commands/git/parallel.rs | 10 ++++------ atomic-cli/src/commands/git/ref_mapping.rs | 2 +- atomic-cli/tests/it/git_binding_cb6b_test.rs | 4 ++-- atomic-repository/src/git_binding/transport.rs | 8 +++++--- .../src/repository/tests/binding_fetch_tests.rs | 2 +- .../src/repository/tests/binding_store_tests.rs | 2 +- .../src/repository/tests/tag_projection_tests.rs | 5 ++++- 12 files changed, 33 insertions(+), 24 deletions(-) diff --git a/atomic-agent/src/record/scope.rs b/atomic-agent/src/record/scope.rs index 4e6e3d9c..64495ee0 100644 --- a/atomic-agent/src/record/scope.rs +++ b/atomic-agent/src/record/scope.rs @@ -46,9 +46,12 @@ fn checked_path(root: &Path, path: &str) -> Result { /// Lowercase hex of a digest. `digest` 0.11 dropped the `LowerHex` output. fn hex(bytes: &[u8]) -> String { + use std::fmt::Write as _; + let mut out = String::with_capacity(bytes.len() * 2); for byte in bytes { - out.push_str(&format!("{byte:02x}")); + // Writing to a `String` cannot fail. + let _ = write!(out, "{byte:02x}"); } out } diff --git a/atomic-cli/src/commands/git/binding.rs b/atomic-cli/src/commands/git/binding.rs index b12e2320..83d6c717 100644 --- a/atomic-cli/src/commands/git/binding.rs +++ b/atomic-cli/src/commands/git/binding.rs @@ -677,9 +677,10 @@ fn resolve_published_binding(git: &GitRepository, id: &str) -> CliResult CensusClass { .map_err(|e| e.to_string())? { let reference = reference.map_err(|e| e.to_string())?; - let name = reference.name().map_err(|error| error.to_string())?; + let Ok(name) = reference.name() else { + continue; + }; refs.push(name.to_string()); } if refs.is_empty() { diff --git a/atomic-cli/src/commands/git/import.rs b/atomic-cli/src/commands/git/import.rs index d2e63324..b6e777b5 100644 --- a/atomic-cli/src/commands/git/import.rs +++ b/atomic-cli/src/commands/git/import.rs @@ -431,7 +431,7 @@ impl Import { git_repo .find_remote("origin") .ok() - .and_then(|remote| remote.url().ok().map(|s| s.to_string())) + .and_then(|remote| remote.url().ok().map(ToString::to_string)) .and_then(|url| { // Extract repo name from URL like "https://github.com/holman/spark.git" // or "git@github.com:holman/spark.git" diff --git a/atomic-cli/src/commands/git/parallel.rs b/atomic-cli/src/commands/git/parallel.rs index fbb046ee..6e62c8f5 100644 --- a/atomic-cli/src/commands/git/parallel.rs +++ b/atomic-cli/src/commands/git/parallel.rs @@ -1807,10 +1807,8 @@ pub(crate) fn detect_git_boundaries(git: &GitRepository) -> CliResult Option { fn extract_commit_metadata(commit: &git2::Commit) -> CliResult { let author = commit.author(); let author_name = author.name().unwrap_or("Unknown").to_string(); - let author_email = author.email().ok().map(|s| s.to_string()); + let author_email = author.email().ok().map(ToString::to_string); let author_name_raw = author.name_bytes().to_vec(); let author_email_raw = { let bytes = author.email_bytes(); @@ -8884,7 +8882,7 @@ fn extract_commit_metadata(commit: &git2::Commit) -> CliResult { }; let committer = commit.committer(); let committer_name = committer.name().unwrap_or("Unknown").to_string(); - let committer_email = committer.email().ok().map(|s| s.to_string()); + let committer_email = committer.email().ok().map(ToString::to_string); let committer_name_raw = committer.name_bytes().to_vec(); let committer_email_raw = { let bytes = committer.email_bytes(); diff --git a/atomic-cli/src/commands/git/ref_mapping.rs b/atomic-cli/src/commands/git/ref_mapping.rs index ede859bc..fdd5f593 100644 --- a/atomic-cli/src/commands/git/ref_mapping.rs +++ b/atomic-cli/src/commands/git/ref_mapping.rs @@ -385,7 +385,7 @@ fn renamed_branch_target(git: &GitRepository, old_ref: &str) -> Option { if reflog.iter().any(|entry| { entry .message() - .is_ok_and(|message| message.is_some_and(|message| message.contains(&needle))) + .is_ok_and(|message| message.is_some_and(|text| text.contains(&needle))) }) { return Some(name.to_string()); } diff --git a/atomic-cli/tests/it/git_binding_cb6b_test.rs b/atomic-cli/tests/it/git_binding_cb6b_test.rs index a92500b2..15c3090d 100644 --- a/atomic-cli/tests/it/git_binding_cb6b_test.rs +++ b/atomic-cli/tests/it/git_binding_cb6b_test.rs @@ -242,7 +242,7 @@ fn imported_history_refuses_private_packs_and_fresh_clone_fetch_is_explicitly_in .references() .expect("refs") .filter_map(|r| r.ok()) - .filter_map(|r| r.name().ok().map(|n| n.to_string())) + .filter_map(|r| r.name().ok().map(ToString::to_string)) .collect(); assert!( refs.iter() @@ -457,7 +457,7 @@ fn private_sidecars_never_enter_a_pack_and_sentinels_stay_out_of_git() { .references() .expect("refs") .filter_map(|r| r.ok()) - .filter_map(|r| r.name().ok().map(|n| n.to_string())) + .filter_map(|r| r.name().ok().map(ToString::to_string)) .collect(); assert!( refs.iter() diff --git a/atomic-repository/src/git_binding/transport.rs b/atomic-repository/src/git_binding/transport.rs index 7532aa4f..33cfb1a5 100644 --- a/atomic-repository/src/git_binding/transport.rs +++ b/atomic-repository/src/git_binding/transport.rs @@ -82,9 +82,11 @@ pub fn transferable_binding_refs(git: &git2::Repository) -> Result, .map_err(|error| format!("cannot enumerate refs: {error}"))? { let reference = reference.map_err(|error| format!("cannot read ref: {error}"))?; - let name = reference - .name() - .map_err(|error| format!("cannot read ref name: {error}"))?; + // Git permits ref names that are not valid UTF-8; such a name cannot + // appear in a transferable name list, so it is skipped, not fatal. + let Ok(name) = reference.name() else { + continue; + }; if !is_transferable_ref(name) { continue; } diff --git a/atomic-repository/src/repository/tests/binding_fetch_tests.rs b/atomic-repository/src/repository/tests/binding_fetch_tests.rs index cc36555a..9d5fbdfd 100644 --- a/atomic-repository/src/repository/tests/binding_fetch_tests.rs +++ b/atomic-repository/src/repository/tests/binding_fetch_tests.rs @@ -296,7 +296,7 @@ fn transfer_to_client(publisher_root: &std::path::Path, binding: &GitStateBindin let head_branch = publisher_git .head() .ok() - .and_then(|head| head.shorthand().ok().map(|s| s.to_string())); + .and_then(|head| head.shorthand().ok().map(ToString::to_string)); let mut push_specs: Vec = vec![binding_refspec]; if let Some(branch) = &head_branch { push_specs.push(format!("refs/heads/{branch}:refs/heads/{branch}")); diff --git a/atomic-repository/src/repository/tests/binding_store_tests.rs b/atomic-repository/src/repository/tests/binding_store_tests.rs index 240aa218..9b050695 100644 --- a/atomic-repository/src/repository/tests/binding_store_tests.rs +++ b/atomic-repository/src/repository/tests/binding_store_tests.rs @@ -481,7 +481,7 @@ fn publication_with_a_signed_summary_carries_only_the_allowlisted_summary() { let tree = commit.tree().unwrap(); let mut names: Vec = tree .iter() - .filter_map(|entry| entry.name().ok().map(|name| name.to_string())) + .filter_map(|entry| entry.name().ok().map(ToString::to_string)) .collect(); names.sort(); assert_eq!( diff --git a/atomic-repository/src/repository/tests/tag_projection_tests.rs b/atomic-repository/src/repository/tests/tag_projection_tests.rs index 19687815..5451bfa0 100644 --- a/atomic-repository/src/repository/tests/tag_projection_tests.rs +++ b/atomic-repository/src/repository/tests/tag_projection_tests.rs @@ -143,7 +143,10 @@ fn annotated_tag_round_trip_carries_the_binding_and_restores_the_bound_state() { fixture.commit_oid, "the annotated tag points at the bound commit" ); - let message = tag_object.message().unwrap().expect("tag message"); + let message = tag_object + .message() + .expect("tag message is readable") + .expect("annotated tag carries a message"); assert!( message.contains("Release version 1.0.0"), "the Atomic tag message is preserved: {message}" From f09310e8bd2401ee125a4f2301615a9d60de401f Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Mon, 2 Nov 2026 09:29:42 -0600 Subject: [PATCH 4/5] docs(cli): state the real reason non-UTF-8 ref names are skipped --- atomic-cli/src/commands/git/binding.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atomic-cli/src/commands/git/binding.rs b/atomic-cli/src/commands/git/binding.rs index 83d6c717..a024cd54 100644 --- a/atomic-cli/src/commands/git/binding.rs +++ b/atomic-cli/src/commands/git/binding.rs @@ -677,7 +677,9 @@ fn resolve_published_binding(git: &GitRepository, id: &str) -> CliResult Date: Mon, 2 Nov 2026 09:36:55 -0600 Subject: [PATCH 5/5] docs(agent): cite why digest 0.11 dropped the io::Write impls --- atomic-agent/src/record/scope.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/atomic-agent/src/record/scope.rs b/atomic-agent/src/record/scope.rs index 64495ee0..1f805400 100644 --- a/atomic-agent/src/record/scope.rs +++ b/atomic-agent/src/record/scope.rs @@ -56,8 +56,11 @@ fn hex(bytes: &[u8]) -> String { out } -/// `digest` 0.11 dropped the `std::io::Write` impl, so streaming file bytes -/// into a hasher needs this adapter. +/// `digest` 0.11 removed its `std::io` impls and its `std` feature, moving +/// them to the separate `digest-io` crate (RustCrypto/traits#1809), so +/// streaming bytes into a hasher needs a wrapper again. Kept local instead of +/// taking a dependency for one `Write` impl; equivalent to +/// `digest_io::IoWrapper`. struct DigestWriter<'a, D>(&'a mut D); impl std::io::Write for DigestWriter<'_, D> {