From 6a564c5ccff37d05be94ec40f5a7a0140c064ecc Mon Sep 17 00:00:00 2001 From: Lee Faus Date: Mon, 13 Jul 2026 13:36:13 -0400 Subject: [PATCH 1/6] duplicate graph nodes --- Cargo.lock | 1092 +++++++---------- atomic-agent/src/record/mod.rs | 59 +- atomic-agent/src/record/tests.rs | 153 +++ atomic-cli/src/commands/diff/helpers.rs | 19 +- atomic-core/src/output/repo/file.rs | 14 +- .../src/record/workflow/globalize/hunk.rs | 69 +- atomic-core/src/record/workflow/record/mod.rs | 33 +- .../src/record/workflow/record/options.rs | 41 + atomic-core/src/record/workflow/retrieve.rs | 29 +- atomic-repository/src/repository/content.rs | 28 +- atomic-repository/src/repository/record.rs | 29 +- atomic-repository/src/repository/tests/mod.rs | 1 + .../tests/record_duplication_tests.rs | 578 +++++++++ tests/harness/05_semantic_layer.sh | 26 +- tests/harness/11_diff_git_parity.sh | 14 +- tests/harness/13_import_fidelity.sh | 62 +- 16 files changed, 1469 insertions(+), 778 deletions(-) create mode 100644 atomic-repository/src/repository/tests/record_duplication_tests.rs diff --git a/Cargo.lock b/Cargo.lock index 014a2ed4..63d61cbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.21" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", "anstyle-parse", @@ -43,15 +43,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-parse" -version = "0.2.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" dependencies = [ "utf8parse", ] @@ -78,15 +78,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.101" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "arc-swap" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3a1fd6f75306b68087b831f025c712524bcb19aad54e557b1129cfa0a2b207" +checksum = "c049c0be4daef0b145cb3555416b3b8ef5b7888a38aea1a3a155801fe7b0810b" dependencies = [ "rustversion", ] @@ -99,15 +99,15 @@ checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" [[package]] name = "async-compression" -version = "0.4.39" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68650b7df54f0293fd061972a0fb05aaf4fc0879d3b3d21a638a182c5c543b9f" +checksum = "e79b3f8a79cccc2898f31920fc69f304859b3bd567490f75ebf51ae1c792a9ac" dependencies = [ "compression-codecs", "compression-core", @@ -197,7 +197,7 @@ name = "atomic-core" version = "0.9.0" dependencies = [ "anyhow", - "bitflags", + "bitflags 2.13.0", "blake3", "chrono", "data-encoding", @@ -231,7 +231,7 @@ dependencies = [ "ed25519-dalek", "quickcheck", "quickcheck_macros", - "rand 0.8.5", + "rand 0.8.7", "serde", "serde_json", "tempfile", @@ -284,7 +284,7 @@ dependencies = [ "ignore", "log", "postcard", - "rand 0.8.5", + "rand 0.8.7", "rayon", "redb", "reflink-copy", @@ -341,9 +341,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "base64" @@ -359,25 +359,31 @@ checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bitflags" -version = "2.10.0" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" dependencies = [ "serde_core", ] [[package]] name = "blake3" -version = "1.8.3" +version = "1.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" +checksum = "0aa83c34e62843d924f905e0f5c866eb1dd6545fc4d719e803d9ba6030371fce" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "cpufeatures", + "cpufeatures 0.3.0", ] [[package]] @@ -391,25 +397,25 @@ dependencies = [ [[package]] name = "bstr" -version = "1.12.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" +checksum = "5cee35f73844aa3014bb606320a6c1f010249dbdf43342fe54b5a4f6a8ed4b79" dependencies = [ "memchr", - "serde", + "serde_core", ] [[package]] name = "bumpalo" -version = "3.19.1" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "bytemuck" -version = "1.25.0" +version = "1.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +checksum = "d6aedf8ae72766347502cf3cb4f41cf5e9cc37d28bee90f1fdaaae15f9cf9424" [[package]] name = "byteorder" @@ -419,18 +425,18 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.11.1" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" dependencies = [ "serde", ] [[package]] name = "cc" -version = "1.2.55" +version = "1.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" +checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38" dependencies = [ "find-msvc-tools", "jobserver", @@ -450,11 +456,22 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "chacha20" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "rand_core 0.10.1", +] + [[package]] name = "chrono" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", "js-sys", @@ -466,9 +483,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.58" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63be97961acde393029492ce0be7a1af7e323e6bae9511ebfac33751be5e6806" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" dependencies = [ "clap_builder", "clap_derive", @@ -476,9 +493,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.58" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f13174bda5dfd69d7e947827e5af4b0f2f94a4a3ee92912fba07a66150f21e2" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ "anstream", "anstyle", @@ -489,9 +506,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.55" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" dependencies = [ "heck", "proc-macro2", @@ -501,9 +518,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "cobs" @@ -516,15 +533,15 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "compression-codecs" -version = "0.4.36" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00828ba6fd27b45a448e57dbfe84f1029d4c9f26b368157e9a448a5f49a2ec2a" +checksum = "ce2548391e9c1929c21bf6aa2680af86fe4c1b33e6cea9ac1cfeec0bd11218cf" dependencies = [ "compression-core", "flate2", @@ -533,9 +550,9 @@ dependencies = [ [[package]] name = "compression-core" -version = "0.4.31" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" +checksum = "cc14f565cf027a105f7a44ccf9e5b424348421a1d8952a8fc9d499d313107789" [[package]] name = "console" @@ -572,6 +589,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -587,6 +614,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.5.0" @@ -604,9 +640,9 @@ checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "crossbeam-deque" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -614,18 +650,18 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" [[package]] name = "crypto-common" @@ -644,7 +680,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "curve25519-dalek-derive", "digest", "fiat-crypto", @@ -666,9 +702,40 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" +checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" + +[[package]] +name = "defmt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8" +dependencies = [ + "defmt-parser", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "defmt-parser" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" +dependencies = [ + "thiserror 2.0.18", +] [[package]] name = "der" @@ -726,9 +793,9 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", @@ -762,9 +829,9 @@ dependencies = [ [[package]] name = "either" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "embedded-io" @@ -795,9 +862,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a1c3cc8e57274ec99de65301228b537f1e4eedc1b8e0f9411c6caac8ae7308f" +checksum = "900d271a03799a1ee8d1ca9b19893b48ca674a9284fefcfb85f05e74ed314217" dependencies = [ "log", "regex", @@ -805,9 +872,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.9" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2daee4ea451f429a58296525ddf28b45a3b64f1acf6587e2067437bb11e218d" +checksum = "de671bd27a75a797dc9ae289ba1e77276e75e2026408aab65185384e2d5cd3f6" dependencies = [ "anstream", "anstyle", @@ -840,9 +907,9 @@ checksum = "bf51ceb43e96afbfe4dd5c6f6082af5dfd60e220820b8123792d61963f2ce6bc" [[package]] name = "fastrand" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "fiat-crypto" @@ -882,12 +949,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - [[package]] name = "foreign-types" version = "0.3.2" @@ -930,9 +991,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" dependencies = [ "futures-channel", "futures-core", @@ -945,9 +1006,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" dependencies = [ "futures-core", "futures-sink", @@ -955,15 +1016,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" [[package]] name = "futures-executor" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" dependencies = [ "futures-core", "futures-task", @@ -972,15 +1033,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" [[package]] name = "futures-macro" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", @@ -989,21 +1050,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" [[package]] name = "futures-task" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] name = "futures-util" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ "futures 0.1.31", "futures-channel", @@ -1012,9 +1073,9 @@ dependencies = [ "futures-macro", "futures-sink", "futures-task", + "libc", "memchr", "pin-project-lite", - "pin-utils", "slab", ] @@ -1043,43 +1104,29 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", "js-sys", "libc", "r-efi", - "wasip2", + "rand_core 0.10.1", "wasm-bindgen", ] -[[package]] -name = "getrandom" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "rand_core 0.10.0", - "wasip2", - "wasip3", -] - [[package]] name = "git2" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" dependencies = [ - "bitflags", + "bitflags 2.13.0", "libc", "libgit2-sys", "log", - "openssl-probe", + "openssl-probe 0.1.6", "openssl-sys", "url", ] @@ -1099,9 +1146,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.13" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +checksum = "6cb093c84e8bd9b188d4c4a8cb6579fc016968d14c99882163cd3ff402a4f155" dependencies = [ "atomic-waker", "bytes", @@ -1127,18 +1174,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "foldhash", -] - -[[package]] -name = "hashbrown" -version = "0.16.1" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" [[package]] name = "heapless" @@ -1162,9 +1200,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" dependencies = [ "bytes", "itoa", @@ -1201,9 +1239,9 @@ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "hyper" -version = "1.8.1" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" dependencies = [ "atomic-waker", "bytes", @@ -1215,7 +1253,6 @@ dependencies = [ "httparse", "itoa", "pin-project-lite", - "pin-utils", "smallvec", "tokio", "want", @@ -1223,15 +1260,14 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.7" +version = "0.27.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" dependencies = [ "http", "hyper", "hyper-util", "rustls", - "rustls-pki-types", "tokio", "tokio-rustls", "tower-service", @@ -1305,12 +1341,13 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" dependencies = [ "displaydoc", "potential_utf", + "utf8_iter", "yoke", "zerofrom", "zerovec", @@ -1318,9 +1355,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" dependencies = [ "displaydoc", "litemap", @@ -1331,9 +1368,9 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" dependencies = [ "icu_collections", "icu_normalizer_data", @@ -1345,15 +1382,15 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" [[package]] name = "icu_properties" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" dependencies = [ "icu_collections", "icu_locale_core", @@ -1365,15 +1402,15 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" [[package]] name = "icu_provider" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" dependencies = [ "displaydoc", "icu_locale_core", @@ -1384,12 +1421,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - [[package]] name = "idna" version = "1.1.0" @@ -1403,9 +1434,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" dependencies = [ "icu_normalizer", "icu_properties", @@ -1413,9 +1444,9 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.25" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" +checksum = "2adf14691c72bcfc1058740436a35bdd3ae9c07d1a941ef00b749e9ea16aefa7" dependencies = [ "crossbeam-deque", "globset", @@ -1429,14 +1460,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.16.1", - "serde", - "serde_core", + "hashbrown", ] [[package]] @@ -1454,19 +1483,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.11.0" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" - -[[package]] -name = "iri-string" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" -dependencies = [ - "memchr", - "serde", -] +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" [[package]] name = "is-docker" @@ -1495,16 +1514,17 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itoa" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jiff" -version = "0.2.19" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89a5b5e10d5a9ad6e5d1f4bd58225f655d6fe9767575a5e8ac5a6fe64e04495" +checksum = "961d16382652bfdd8c6f68b223b26a8c93e0d475c672f414411db31c6c5c900e" dependencies = [ + "defmt", "jiff-static", "log", "portable-atomic", @@ -1514,9 +1534,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.19" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff7a39c8862fc1369215ccf0a8f12dd4598c7f6484704359f0351bd617034dbf" +checksum = "d0879bd39df99c4c5e2c6615ccc026391a423dde10532c573e6086eb94a802cc" dependencies = [ "proc-macro2", "quote", @@ -1525,35 +1545,30 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" dependencies = [ - "getrandom 0.3.4", + "getrandom 0.4.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.85" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" dependencies = [ - "once_cell", + "cfg-if", + "futures-util", "wasm-bindgen", ] -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - [[package]] name = "libc" -version = "0.2.181" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "459427e2af2b9c839b132acb702a1c654d95e10f8c326bfc2ad11310e458b1c5" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libgit2-sys" @@ -1571,19 +1586,18 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.12" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" +checksum = "c943259e342f1e06ff2da7a83eabdfe7f92ce10262688dbf1895ff0b3e6e4652" dependencies = [ - "bitflags", "libc", ] [[package]] name = "libssh2-sys" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9" +checksum = "c04141a07bb0c0bc461cb657808764de571702a59bc5c726c400ac9a7625e3ab" dependencies = [ "cc", "libc", @@ -1595,9 +1609,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.25" +version = "1.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52f4c29e2a68ac30c9087e1b772dc9f44a2b66ed44edf2266cf2be9b03dafc1" +checksum = "85bc9657773828b90eeb625adff10eeac83cc21bbfd8e23a03eaa8a33c9e28d9" dependencies = [ "cc", "libc", @@ -1607,15 +1621,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "lock_api" @@ -1628,9 +1642,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.29" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "lru-slab" @@ -1646,15 +1660,15 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "memchr" -version = "2.8.0" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "memmap2" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" +checksum = "d1219ed1b7f229ee7104d281dd01d6802fe28bb6e95d292942c4daacdeb798c0" dependencies = [ "libc", ] @@ -1677,9 +1691,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" dependencies = [ "libc", "wasi", @@ -1688,14 +1702,14 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.14" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" dependencies = [ "libc", "log", "openssl", - "openssl-probe", + "openssl-probe 0.2.1", "openssl-sys", "schannel", "security-framework", @@ -1720,9 +1734,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "once_cell_polyfill" @@ -1732,26 +1746,24 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "open" -version = "5.3.3" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb73a7fa3799b198970490a51174027ba0d4ec504b03cd08caf513d40024bc" +checksum = "a0b3d059e795d52b8a72fef45658620edd4d9c359b338564aa14391ffa511ed5" dependencies = [ "is-wsl", "libc", - "pathdiff", ] [[package]] name = "openssl" -version = "0.10.75" +version = "0.10.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" +checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" dependencies = [ - "bitflags", + "bitflags 2.13.0", "cfg-if", "foreign-types", "libc", - "once_cell", "openssl-macros", "openssl-sys", ] @@ -1773,20 +1785,26 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + [[package]] name = "openssl-src" -version = "300.5.5+3.5.5" +version = "300.6.1+3.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1787d533e03597a7934fd0a765f0d28e94ecc5fb7789f8053b1e699a56f709" +checksum = "46eb8fb9fb3b61ce1c0f8a026c4c1a0714d3a9e138e7fbde78753ce2babc3846" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.111" +version = "0.9.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" +checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" dependencies = [ "cc", "libc", @@ -1824,12 +1842,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "pathdiff" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" - [[package]] name = "percent-encoding" version = "2.3.2" @@ -1838,15 +1850,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "pkcs8" @@ -1860,9 +1866,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" [[package]] name = "portable-atomic" @@ -1872,9 +1878,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "portable-atomic-util" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9db96d7fa8782dd8c15ce32ffe8680bbd1e978a43bf51a34d39483540495f5" +checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" dependencies = [ "portable-atomic", ] @@ -1894,9 +1900,9 @@ dependencies = [ [[package]] name = "potential_utf" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" dependencies = [ "zerovec", ] @@ -1910,16 +1916,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn", -] - [[package]] name = "proc-macro2" version = "1.0.106" @@ -1937,7 +1933,7 @@ checksum = "95c589f335db0f6aaa168a7cd27b1fc6920f5e1470c804f814d9cd6e62a0f70b" dependencies = [ "env_logger", "log", - "rand 0.10.0", + "rand 0.10.2", ] [[package]] @@ -1953,9 +1949,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.9" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +checksum = "0c1a41e437b6bbd489372cd4971de128e85c855f56c57f283d20ff016cf7c0a8" dependencies = [ "bytes", "cfg_aliases", @@ -1973,14 +1969,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.13" +version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +checksum = "2f4bfc015262b9df63c8845072ce59068853ff5872180c2ce2f13038b970e560" dependencies = [ "bytes", - "getrandom 0.3.4", + "getrandom 0.4.3", "lru-slab", - "rand 0.9.2", + "rand 0.10.2", + "rand_pcg", "ring", "rustc-hash", "rustls", @@ -1994,62 +1991,53 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +checksum = "35a133f956daabe89a61a685c2649f13d82d5aa4bd5d12d1277e1072a21c0694" dependencies = [ "cfg_aliases", "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "quote" -version = "1.0.44" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" dependencies = [ "proc-macro2", ] [[package]] name = "r-efi" -version = "5.3.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rand" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" dependencies = [ "libc", - "rand_chacha 0.3.1", + "rand_chacha", "rand_core 0.6.4", ] [[package]] name = "rand" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.5", -] - -[[package]] -name = "rand" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" dependencies = [ - "getrandom 0.4.1", - "rand_core 0.10.0", + "chacha20", + "getrandom 0.4.3", + "rand_core 0.10.1", ] [[package]] @@ -2062,16 +2050,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.5", -] - [[package]] name = "rand_core" version = "0.6.4" @@ -2083,24 +2061,24 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.5" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom 0.3.4", -] +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] -name = "rand_core" -version = "0.10.0" +name = "rand_pcg" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" +checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a" +dependencies = [ + "rand_core 0.10.1", +] [[package]] name = "rayon" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" dependencies = [ "either", "rayon-core", @@ -2131,7 +2109,7 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags", + "bitflags 2.13.0", ] [[package]] @@ -2147,9 +2125,9 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13362233b147e57674c37b802d216b7c5e3dcccbed8967c84f0d8d223868ae27" +checksum = "d9dd7ab4af0363d5ccfd2838d782a28196cf32a5cc2e4fe3c5dc83f2be588b8b" dependencies = [ "cfg-if", "libc", @@ -2159,9 +2137,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.3" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "2a0e75113e14dc5acb068cd0786884f214f1312650a3d36d269f5c4f3cdee8a2" dependencies = [ "aho-corasick", "memchr", @@ -2171,9 +2149,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "1f388202e4b80542a0921078cc23b6333bcf1409c1e3f86404cae4766a6131db" dependencies = [ "aho-corasick", "memchr", @@ -2182,9 +2160,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.9" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "reqwest" @@ -2259,9 +2237,9 @@ dependencies = [ [[package]] name = "rustc-hash" -version = "2.1.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] name = "rustc_version" @@ -2274,11 +2252,11 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags", + "bitflags 2.13.0", "errno", "libc", "linux-raw-sys", @@ -2287,9 +2265,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.36" +version = "0.23.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" +checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f" dependencies = [ "once_cell", "ring", @@ -2301,9 +2279,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +checksum = "764899a24af3980067ee14bc143654f297b22eaebfe3c7b6b211920a5a59b046" dependencies = [ "web-time", "zeroize", @@ -2311,9 +2289,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.9" +version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ "ring", "rustls-pki-types", @@ -2322,9 +2300,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" [[package]] name = "ryu" @@ -2341,20 +2319,11 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scc" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46e6f046b7fef48e2660c57ed794263155d713de679057f2d0c169bfc6e756cc" -dependencies = [ - "sdd", -] - [[package]] name = "schannel" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" dependencies = [ "windows-sys 0.61.2", ] @@ -2365,20 +2334,14 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sdd" -version = "3.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490dcfcbfef26be6800d11870ff2df8774fa6e86d047e3e8c8a76b25655e41ca" - [[package]] name = "security-framework" -version = "2.11.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags", - "core-foundation", + "bitflags 2.13.0", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -2386,9 +2349,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.15.0" +version = "2.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" dependencies = [ "core-foundation-sys", "libc", @@ -2396,9 +2359,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" @@ -2456,9 +2419,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "indexmap", "itoa", @@ -2491,24 +2454,23 @@ dependencies = [ [[package]] name = "serial_test" -version = "3.3.1" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0b343e184fc3b7bb44dff0705fffcf4b3756ba6aff420dddd8b24ca145e555" +checksum = "699f4197115b8a7e7ff19c9a315a4bd6fffec26cc4626ef45ecaea389e081c6d" dependencies = [ "futures-executor", "futures-util", "log", "once_cell", "parking_lot", - "scc", "serial_test_derive", ] [[package]] name = "serial_test_derive" -version = "3.3.1" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f50427f258fb77356e4cd4aa0e87e2bd2c66dbcee41dc405282cae2bfc26c83" +checksum = "94e153fc76e1c6a068703d6d29c508a0b15c061c4b7e43da59cc097bc342673c" dependencies = [ "proc-macro2", "quote", @@ -2522,7 +2484,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest", ] @@ -2534,9 +2496,9 @@ checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" [[package]] name = "shlex" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "signal-hook-registry" @@ -2559,9 +2521,9 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" [[package]] name = "similar" @@ -2577,18 +2539,18 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" -version = "1.15.1" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "socket2" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2636,9 +2598,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.114" +version = "2.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" dependencies = [ "proc-macro2", "quote", @@ -2667,9 +2629,9 @@ dependencies = [ [[package]] name = "syntext" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbb92aa6c13a82ddedcfeb2160b831280fb715ce4652a21980c19836008ef03" +checksum = "0525040dafffafa2250ed5cd7446847902d97409aee5e2f4e978c4ccbbe6066a" dependencies = [ "arc-swap", "fs2", @@ -2693,8 +2655,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ - "bitflags", - "core-foundation", + "bitflags 2.13.0", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -2721,12 +2683,12 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.25.0" +version = "3.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.1", + "getrandom 0.4.3", "once_cell", "rustix", "windows-sys 0.61.2", @@ -2734,12 +2696,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" +checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2784,9 +2746,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" dependencies = [ "displaydoc", "zerovec", @@ -2794,9 +2756,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" dependencies = [ "tinyvec_macros", ] @@ -2809,9 +2771,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.49.0" +version = "1.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" dependencies = [ "bytes", "libc", @@ -2826,9 +2788,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", @@ -2942,25 +2904,25 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ "async-compression", - "bitflags", + "bitflags 2.13.0", "bytes", "futures-core", "futures-util", "http", "http-body", "http-body-util", - "iri-string", "pin-project-lite", "tokio", "tokio-util 0.7.18", "tower", "tower-layer", "tower-service", + "url", ] [[package]] @@ -3076,9 +3038,9 @@ dependencies = [ [[package]] name = "tree-sitter-swift" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3b98fb6bc8e6a6a10023f401aa6a1858115e849dfaf7de57dd8b8ea0f257bd9" +checksum = "fe36052155b9dd69ca82b3b8f1b4ccfb2d867125ac1a4db1dd7331829242668c" dependencies = [ "cc", "tree-sitter-language", @@ -3102,15 +3064,15 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "unicode-ident" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-width" @@ -3118,12 +3080,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "untrusted" version = "0.9.0" @@ -3162,11 +3118,11 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.23.1" +version = "1.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +checksum = "ea5fab0d6c3c01ae70085a09cb03d4c7a1d6314e2b3e075392783396d724ca0a" dependencies = [ - "getrandom 0.4.1", + "getrandom 0.4.3", "js-sys", "serde_core", "wasm-bindgen", @@ -3209,29 +3165,11 @@ version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" -[[package]] -name = "wasip2" -version = "1.0.2+wasi-0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" -dependencies = [ - "wit-bindgen", -] - [[package]] name = "wasm-bindgen" -version = "0.2.108" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" dependencies = [ "cfg-if", "once_cell", @@ -3242,23 +3180,19 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.58" +version = "0.4.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" +checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" dependencies = [ - "cfg-if", - "futures-util", "js-sys", - "once_cell", "wasm-bindgen", - "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.108" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3266,9 +3200,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.108" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" dependencies = [ "bumpalo", "proc-macro2", @@ -3279,35 +3213,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.108" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" dependencies = [ "unicode-ident", ] -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder", - "wasmparser", -] - [[package]] name = "wasm-streams" version = "0.4.2" @@ -3321,18 +3233,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags", - "hashbrown 0.15.5", - "indexmap", - "semver", -] - [[package]] name = "watchman_client" version = "0.9.0" @@ -3341,7 +3241,7 @@ checksum = "88bc4c9bb443a7aae10d4fa7807bffc397805315e2305288c90c80e2f66cfb52" dependencies = [ "anyhow", "bytes", - "futures 0.3.31", + "futures 0.3.32", "maplit", "serde", "serde_bser", @@ -3353,9 +3253,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.85" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" dependencies = [ "js-sys", "wasm-bindgen", @@ -3373,9 +3273,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" +checksum = "bf85cb06032201fa7c6f829d7db5a7e5aa45bcc0655327713065f6f0576731bf" dependencies = [ "rustls-pki-types", ] @@ -3550,15 +3450,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", -] - [[package]] name = "windows-sys" version = "0.61.2" @@ -3592,30 +3483,13 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", + "windows_i686_gnullvm", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", -] - [[package]] name = "windows-threading" version = "0.2.1" @@ -3637,12 +3511,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -3655,12 +3523,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -3673,24 +3535,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -3703,12 +3553,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -3721,12 +3565,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -3739,12 +3577,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -3757,114 +3589,20 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - [[package]] name = "winnow" -version = "0.7.14" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" dependencies = [ "memchr", ] -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck", - "indexmap", - "prettyplease", - "syn", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] - [[package]] name = "writeable" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" [[package]] name = "xattr" @@ -3878,15 +3616,15 @@ dependencies = [ [[package]] name = "xxhash-rust" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" +checksum = "4d93c89cdc2d3a63c3ec48ffe926931bdc069eafa8e4402fe6d8f790c9d1e576" [[package]] name = "yoke" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -3895,9 +3633,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", @@ -3907,18 +3645,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.39" +version = "0.8.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" +checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.39" +version = "0.8.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" +checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5" dependencies = [ "proc-macro2", "quote", @@ -3927,18 +3665,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", @@ -3948,15 +3686,15 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" [[package]] name = "zerotrie" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" dependencies = [ "displaydoc", "yoke", @@ -3965,9 +3703,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" dependencies = [ "yoke", "zerofrom", @@ -3976,9 +3714,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", @@ -3987,9 +3725,9 @@ dependencies = [ [[package]] name = "zmij" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de98dfa5d5b7fef4ee834d0073d560c9ca7b6c46a71d058c48db7960f8cfaf7" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" [[package]] name = "zstd" diff --git a/atomic-agent/src/record/mod.rs b/atomic-agent/src/record/mod.rs index aa566411..63ee5e75 100644 --- a/atomic-agent/src/record/mod.rs +++ b/atomic-agent/src/record/mod.rs @@ -216,13 +216,64 @@ pub fn record_turn( if repo.is_sandbox() { repo.set_current_view_in_memory(&options.session.view_name); } else { + // POMO-1: a missing session view here is NOT the normal first-turn + // case (that path creates the view during `apply_after_record`, well + // after we already aligned successfully once). If we reach this + // branch it means the SessionStart fork that should have created + // `options.session.view_name` either never ran or failed silently, + // leaving `record()` to fall back to whatever view happened to be + // `current_view` — frequently `Shared` or an unrelated sibling view. + // Recording onto that wrong view duplicates every file already + // present there once the two views are later merged, because the + // diff is computed against the wrong parent state. + // + // Instead of silently recording onto the wrong view, fork the + // session view here, just-in-time, from its intended parent (or the + // current view as a last resort) so the diff is computed against + // the correct baseline. match repo.align_to_view(&options.session.view_name) { Ok(()) => {} Err(atomic_repository::RepositoryError::ViewNotFound { .. }) => { - log::debug!( - "session view '{}' not yet created; first-turn apply will create it", - options.session.view_name - ); + let parent = options + .session + .parent_view() + .map(|s| s.to_string()) + .unwrap_or_else(|| repo.current_view().to_string()); + + match repo.create_view_from(&options.session.view_name, &parent) { + Ok(()) => { + log::warn!( + "session view '{}' was missing at record time (SessionStart fork \ + likely skipped or failed); forked it from '{}' just-in-time", + options.session.view_name, + parent, + ); + } + Err(atomic_repository::RepositoryError::ViewAlreadyExists { .. }) => {} + Err(e) => { + return Err(AgentError::RecordFailed { + session_id: options.session.session_id.clone(), + turn_number: options.turn_number, + reason: format!( + "Session view '{}' does not exist and could not be forked \ + from '{}': {} (refusing to record onto an implicitly-created \ + orphan view, which would duplicate existing content)", + options.session.view_name, parent, e + ), + }); + } + } + + repo.align_to_view(&options.session.view_name).map_err(|e| { + AgentError::RecordFailed { + session_id: options.session.session_id.clone(), + turn_number: options.turn_number, + reason: format!( + "Failed to align to session view '{}' after forking it: {}", + options.session.view_name, e + ), + } + })?; } Err(e) => { return Err(AgentError::RecordFailed { diff --git a/atomic-agent/src/record/tests.rs b/atomic-agent/src/record/tests.rs index 61487d8a..a52e5344 100644 --- a/atomic-agent/src/record/tests.rs +++ b/atomic-agent/src/record/tests.rs @@ -1016,3 +1016,156 @@ fn test_outcome_recorded_file_list_empty() { assert!(outcome.recorded_file_list().is_empty()); } + +// POMO-1: orphaned session view duplication + +/// Build a Go-like source file with `count` distinct top-level functions, +/// each with a unique, greppable marker line. +fn build_source(count: usize) -> String { + let mut out = String::new(); + out.push_str("package main\n\n"); + for i in 0..count { + out.push_str(&format!( + "func step{i}() int {{\n // marker[{i}]\n return {i}\n}}\n\n" + )); + } + out +} + +fn count_occurrences(content: &str, pattern: &str) -> usize { + content.matches(pattern).count() +} + +/// Reproduces the real-world mechanism behind POMO-1: a session whose +/// `SessionStart` fork never ran (or failed silently), so its view doesn't +/// exist yet when `record_turn()` is called for the first time. +/// +/// Before the fix, `record_turn()` would fall through to whatever view +/// happened to be `current_view` on the raw `Repository` handle it opens +/// internally — not necessarily this session's intended parent — and record +/// the turn there. Once that view and the session's own (separately +/// forked) view were both later merged into `dev`, the divergent baselines +/// meant the same pre-existing content could be recorded twice. +/// +/// This test drives two sessions through `record_turn()` directly: session +/// A whose view is properly forked from `dev` beforehand (the normal path), +/// and session B whose view is deliberately left unforked (the orphan +/// path). Per the fix, `record_turn()` must self-heal session B by forking +/// its view just-in-time from its intended parent (`dev`) rather than +/// silently recording onto the wrong view. After merging both sessions' +/// views into `dev`, every function in the file must appear exactly once. +#[test] +fn test_orphaned_session_view_duplicates_content_on_merge() { + use atomic_repository::apply::CrossViewInsertOptions; + use atomic_repository::Repository; + use tempfile::TempDir; + + let temp_dir = TempDir::new().unwrap(); + let repo_root = temp_dir.path(); + let file = repo_root.join("main.go"); + + let initial = build_source(80); + std::fs::write(&file, &initial).unwrap(); + + { + let repo = Repository::init(repo_root).unwrap(); + repo.add( + "main.go", + atomic_repository::tracking::TrackingOptions::default(), + ) + .unwrap(); + let header = atomic_core::change::ChangeHeader::new("Add main.go"); + let options = atomic_repository::record::RecordOptions::new() + .with_all(true) + .save_to_store(true) + .apply_after_record(true); + repo.record(header, options).unwrap(); + } + + // Session A: SessionStart properly forks its view from "dev" before any + // turn is recorded — the normal, non-buggy path. + { + let mut repo = Repository::open_existing(repo_root).unwrap(); + repo.create_view_from("session-a", "dev").unwrap(); + } + + let mut session_a = AgentSession::new("session-a", "claude-code", "Claude Code"); + session_a.view_name = "session-a".to_string(); + session_a.set_parent_view("dev"); + + let edited_a = initial.replacen("return 10\n", "return 1000\n", 1); + std::fs::write(&file, &edited_a).unwrap(); + + let event_a = TurnEvent::new("session-a", HookType::TurnEnd); + let options_a = TurnRecordOptions { + session: &session_a, + event: &event_a, + turn_number: 1, + turn_duration_ms: 1000, + prompt: Some("Bump step10".to_string()), + }; + record_turn(repo_root, &options_a).unwrap(); + + // Session B: simulates a SessionStart fork that never ran (or failed) — + // its view does not exist yet when record_turn() is called. Per the + // POMO-1 fix, record_turn() must self-heal by forking it just-in-time + // from its intended parent ("dev"), NOT from whatever view happens to + // be current on the internally-opened Repository handle (which after + // session A's turn is "session-a" — forking from there would leak + // session A's edit into session B's history and, once both are merged + // into dev, resurrect it as a duplicate). + let mut session_b = AgentSession::new("session-b", "claude-code", "Claude Code"); + session_b.view_name = "session-b".to_string(); + session_b.set_parent_view("dev"); + + let edited_b = initial.replacen("return 70\n", "return 7000\n", 1); + std::fs::write(&file, &edited_b).unwrap(); + + let event_b = TurnEvent::new("session-b", HookType::TurnEnd); + let options_b = TurnRecordOptions { + session: &session_b, + event: &event_b, + turn_number: 1, + turn_duration_ms: 1000, + prompt: Some("Bump step70".to_string()), + }; + record_turn(repo_root, &options_b) + .expect("record_turn should self-heal an orphaned session view rather than fail"); + + // Merge both session views into dev. + { + let repo = Repository::open_existing(repo_root).unwrap(); + repo.insert_from_view(CrossViewInsertOptions::new("session-a", "dev")) + .unwrap(); + repo.insert_from_view(CrossViewInsertOptions::new("session-b", "dev")) + .unwrap(); + repo.materialize().unwrap(); + } + + let repo = Repository::open_existing(repo_root).unwrap(); + let content = repo + .get_file_content_on_view("main.go", "dev") + .unwrap() + .expect("file should exist on dev"); + let content = String::from_utf8(content).unwrap(); + + for i in 0..80 { + let marker = format!("// marker[{i}]"); + let occurrences = count_occurrences(&content, &marker); + assert_eq!( + occurrences, 1, + "step{} should appear exactly once after merging both session views, \ + found {} (orphan-view duplication bug — POMO-1)", + i, occurrences + ); + } + + assert!( + content.contains("return 1000"), + "session A's edit should survive the merge" + ); + assert!( + content.contains("return 7000"), + "session B's edit should survive the merge" + ); +} diff --git a/atomic-cli/src/commands/diff/helpers.rs b/atomic-cli/src/commands/diff/helpers.rs index d0d58116..700e4ea7 100644 --- a/atomic-cli/src/commands/diff/helpers.rs +++ b/atomic-cli/src/commands/diff/helpers.rs @@ -495,13 +495,18 @@ impl Diff { let rm_orig_idx = rm_entries[*ri].0; let add_orig_idx = add_entries[*ai].0; - // Only pull an add forward if there are no other Added lines - // between the remove and the matched add in the original order. - // Intervening Added lines represent genuinely new content that - // belongs before the matched line in the new file — moving the - // matched add past them would put it in the wrong position. - let has_intervening_adds = (rm_orig_idx + 1..add_orig_idx).any(|i| lines[i].is_added()); - if has_intervening_adds { + // Only pull an add forward, never backward — the add must come + // after the remove in the original order, or "pulling it + // forward" would instead duplicate a line already emitted at + // its earlier original position. + // + // Intervening Added lines between the remove and its matched add + // are allowed: pairing readability (showing what a buried + // modification actually changed) matters more here than + // preserving their exact relative display position, which is + // the whole point of this heuristic — see the "buried + // modification" and "pairing at scale" cases this exists for. + if add_orig_idx <= rm_orig_idx { continue; } diff --git a/atomic-core/src/output/repo/file.rs b/atomic-core/src/output/repo/file.rs index 594909ac..5fb56c6b 100644 --- a/atomic-core/src/output/repo/file.rs +++ b/atomic-core/src/output/repo/file.rs @@ -856,6 +856,13 @@ where /// A tuple of: /// - `Vec` - The file content at the filtered state /// - `Vec` - Any conflicts detected +/// - `bool` - Whether retrieval had to resolve fork/cyclic structure via +/// [`resolve_conflicts_semantically`] (`!resolved.is_empty()`). Callers +/// that use this content as `old_content` for a subsequent positional +/// diff (see `record_modified_file`/POMO-2) must consult this: a +/// semantic-merge resolution is not guaranteed to structurally match +/// what a plain, unambiguous checkout would render for the same graph +/// state, so a positional diff against it can produce a corrupted hunk. /// /// # Errors /// @@ -898,7 +905,7 @@ pub fn output_file_to_buffer_with_options( position: Position, _file_options: FileOutputOptions, retrieve_options: RetrieveOptions, -) -> Result<(Vec, Vec), OutputError> +) -> Result<(Vec, Vec, bool), OutputError> where T: GraphTxnT, C: ChangeStore, @@ -909,7 +916,7 @@ where // Handle empty graph (no content at this state) if retrieve_result.graph.is_empty() { - return Ok((Vec::new(), Vec::new())); + return Ok((Vec::new(), Vec::new(), false)); } // Compute SCC ordering @@ -934,6 +941,7 @@ where // Attempt semantic merge for any conflicting SCCs let resolved = resolve_conflicts_semantically(txn, changes, &graph, &order); + let had_fork_structure = !resolved.is_empty(); // Output the graph content (with semantic merge resolution) output_graph_content_resolved(changes, hash_fn, &graph, &order, &mut writer, &resolved)?; @@ -953,7 +961,7 @@ where } } - Ok((content, conflicts)) + Ok((content, conflicts, had_fork_structure)) } // TESTS diff --git a/atomic-core/src/record/workflow/globalize/hunk.rs b/atomic-core/src/record/workflow/globalize/hunk.rs index c9d404d7..36e9319d 100644 --- a/atomic-core/src/record/workflow/globalize/hunk.rs +++ b/atomic-core/src/record/workflow/globalize/hunk.rs @@ -435,19 +435,10 @@ fn globalize_replace_whole_file( where T: GraphTxnT + TreeTxnT + InodeGraphOps, { - let content_vertices = find_content_vertices_cached(ctx, inode, inode_pos)?; - let deletion_edges = match build_deletion_edges(ctx, &content_vertices) { - Ok(edges) => edges, - Err(_) => { - let global_vertices = find_content_vertices_global(ctx.txn(), inode_pos)?; - build_deletion_edges(ctx, &global_vertices)? - } - }; - - let deletion = EdgeUpdate { - edges: deletion_edges, - inode: position_to_option_hash_resolved(ctx.txn(), inode_pos, None), - }; + // Delegates to `delete_all_content` for "find every content vertex, + // delete it" — see its docs for why this always uses the thorough + // SCC-aware traversal rather than a linear walk (POMO-2/2b). + let deletion = delete_all_content(ctx, inode_pos)?; let insertions = if should_use_opaque_generated_vertices(&local.path) { vec![create_content_vertex( @@ -547,18 +538,9 @@ where } } - // Fallback: whole-file deletion. - let deletion = match delete_all_content(ctx, inode, inode_pos) { - Ok(d) => d, - Err(_) => { - let global_vertices = find_content_vertices_global(ctx.txn(), inode_pos)?; - let deletion_edges = build_deletion_edges(ctx, &global_vertices)?; - EdgeUpdate { - edges: deletion_edges, - inode: position_to_option_hash_resolved(ctx.txn(), inode_pos, None), - } - } - }; + // Fallback: whole-file deletion. `delete_all_content` already does the + // thorough search (POMO-2/2b), so no further fallback is needed here. + let deletion = delete_all_content(ctx, inode_pos)?; Ok(vec![GraphOp::Edit { change: Atom::EdgeUpdate(deletion), @@ -575,17 +557,32 @@ where /// deleted. /// /// This is the single place where "find all content vertices → create -/// deletion edges" happens. Both [`globalize_replace`] and +/// deletion edges" happens. Both [`globalize_replace_whole_file`] and /// [`globalize_delete`] delegate here. +/// +/// Uses [`find_content_vertices_global`] — the full SCC-aware traversal via +/// `retrieve_graph`, the same one used for display/diffing — rather than a +/// linear walk (`collect_sorted_content_vertices`, used elsewhere for +/// targeted range lookups). A linear walk only follows one BLOCK-edge +/// successor chain from the inode, so a genuine fork (two chains both +/// anchored on the inode — exactly what the orphan-view duplication bug, +/// POMO-1, produces) leaves one branch unvisited. It doesn't error on that +/// incomplete result, so callers that only fall back to the global search on +/// an `Err` never actually reach it: `build_deletion_edges` happily succeeds +/// on whatever partial list it's given, deleting only that branch and +/// leaving the other alive (POMO-2). This function's whole purpose is +/// deleting *every* content vertex, so it always pays for the thorough +/// traversal — it's a rare, non-hot-path fallback (opaque/legacy files, +/// whole-file replace, or a full-file delete), so the extra cost is an +/// acceptable trade for actually being complete. fn delete_all_content( ctx: &mut GlobalizeContext<'_, T>, - inode: Inode, inode_pos: Position, ) -> GlobalizeResult>> where T: GraphTxnT + TreeTxnT + InodeGraphOps, { - let content_vertices = find_content_vertices_cached(ctx, inode, inode_pos)?; + let content_vertices = find_content_vertices_global(ctx.txn(), inode_pos)?; let deletion_edges = build_deletion_edges(ctx, &content_vertices)?; Ok(EdgeUpdate { @@ -720,22 +717,6 @@ where Ok(vertices) } -fn find_content_vertices_cached( - ctx: &mut GlobalizeContext<'_, T>, - inode: Inode, - inode_pos: Position, -) -> GlobalizeResult>> -where - T: GraphTxnT + InodeGraphOps, -{ - if let Some(vertices) = ctx.content_vertices_cache.get(&inode) { - return Ok(vertices.clone()); - } - - let vertices = collect_sorted_content_vertices(ctx.txn, inode, inode_pos)?; - ctx.content_vertices_cache.insert(inode, vertices.clone()); - Ok(vertices) -} // ─────────────────────────────────────────────────────────────────────────── // Graph vertex / edge helpers diff --git a/atomic-core/src/record/workflow/record/mod.rs b/atomic-core/src/record/workflow/record/mod.rs index 73e53fba..789b9679 100644 --- a/atomic-core/src/record/workflow/record/mod.rs +++ b/atomic-core/src/record/workflow/record/mod.rs @@ -156,7 +156,7 @@ pub use types::{RecordedFile, RecordingResult, RecordingStats}; use crate::change::{Encoding, FileOps, Local}; use crate::crdt::{BranchId, TrunkId}; -use crate::diff::DiffOp; +use crate::diff::{DiffOp, Line}; use crate::output::WorkingCopyRead; use crate::types::NodeId; @@ -433,6 +433,37 @@ where return Ok(recorded); } + // POMO-2 safety fallback: if the caller's `old_content` came from + // resolving a fork or cyclic conflict (see + // `retrieve_content_with_filter_and_fork_info`), it isn't guaranteed to + // structurally match what a plain, unambiguous checkout would render for + // the same graph state. A positional diff against it can therefore + // produce a corrupted hunk. Skip the positional diff entirely and emit a + // single whole-file replace instead — "what's alive gets deleted, this is + // inserted fresh" holds regardless of how `old_content` was resolved. + // `deleted_lines: vec![usize::MAX]` is a deliberate sentinel that routes + // this hunk through `globalize_replace_whole_file`'s safe fallback path + // (the same path used for opaque/legacy files above), rather than a + // targeted per-vertex diff that would trust old_content's mismatched + // shape. This mirrors the delete+add workaround used manually to recover + // main.go in the pomodoro-2 project before this fix existed. + if options.get_force_whole_file_replace() { + let mut replace_hunk = BuiltHunk::new_replace_with_lines( + Local::new(&detected.path, 1), + Some(encoding), + vec![usize::MAX], + 0, + 0, + Line::from_bytes(&new_content).len(), + ); + replace_hunk.content_start = Some(0); + replace_hunk.content_end = Some(new_content.len() as u64); + recorded.add_hunk(replace_hunk); + recorded.set_content(new_content); + + return Ok(recorded); + } + // Compare content and build hunks let comparison = compare_content(old_content, &new_content, options.get_algorithm()); diff --git a/atomic-core/src/record/workflow/record/options.rs b/atomic-core/src/record/workflow/record/options.rs index 03b875c8..9b53410b 100644 --- a/atomic-core/src/record/workflow/record/options.rs +++ b/atomic-core/src/record/workflow/record/options.rs @@ -53,6 +53,19 @@ pub struct RecordingOptions { /// Number of context lines for hunks. context_lines: usize, + + /// Force a whole-file replace instead of a positional diff against + /// `old_content`. + /// + /// Set this when the caller's `old_content` came from resolving a fork + /// or cyclic conflict in the graph (see + /// `retrieve_content_with_filter_and_fork_info` in the record path) — + /// that resolution isn't guaranteed to structurally match what a plain + /// checkout renders for the same graph state (POMO-2), so a positional + /// diff against it can produce a corrupted hunk. A whole-file replace + /// only needs "what's alive gets deleted, this is inserted fresh" to be + /// true, which holds regardless of how `old_content` was resolved. + force_whole_file_replace: bool, } impl RecordingOptions { @@ -207,6 +220,27 @@ impl RecordingOptions { self } + /// Force a whole-file replace instead of a positional diff against + /// `old_content`. + /// + /// # Arguments + /// + /// * `force` - Whether to force a whole-file replace + /// + /// # Example + /// + /// ```rust + /// use atomic_core::record::workflow::record::RecordingOptions; + /// + /// let options = RecordingOptions::new().force_whole_file_replace(true); + /// assert!(options.get_force_whole_file_replace()); + /// ``` + #[must_use] + pub fn force_whole_file_replace(mut self, force: bool) -> Self { + self.force_whole_file_replace = force; + self + } + /// Get the algorithm setting. #[must_use] pub fn get_algorithm(&self) -> Algorithm { @@ -243,6 +277,12 @@ impl RecordingOptions { self.context_lines } + /// Get the force-whole-file-replace setting. + #[must_use] + pub fn get_force_whole_file_replace(&self) -> bool { + self.force_whole_file_replace + } + /// Check if a file size exceeds the maximum. #[must_use] pub fn exceeds_max_size(&self, size: usize) -> bool { @@ -269,6 +309,7 @@ impl Default for RecordingOptions { skip_binary: false, record_empty_files: true, context_lines: Self::DEFAULT_CONTEXT_LINES, + force_whole_file_replace: false, } } } diff --git a/atomic-core/src/record/workflow/retrieve.rs b/atomic-core/src/record/workflow/retrieve.rs index 5a7dac8f..815800bc 100644 --- a/atomic-core/src/record/workflow/retrieve.rs +++ b/atomic-core/src/record/workflow/retrieve.rs @@ -370,13 +370,36 @@ pub fn retrieve_content_with_filter( position: Position, options: RetrieveOptions, ) -> RecordResult> +where + T: GraphTxnT, + C: ChangeStore, +{ + retrieve_content_with_filter_and_fork_info(txn, changes, position, options) + .map(|(content, _had_fork_structure)| content) +} + +/// Retrieve content with a change filter, also reporting whether retrieval +/// had to resolve fork/cyclic structure to produce it. +/// +/// Like [`retrieve_content_with_filter`], but additionally returns whether +/// [`output_file_to_buffer_with_options`] had to fall back to semantic-merge +/// resolution (see its docs). Callers that use this content as `old_content` +/// for a subsequent positional diff (POMO-2) must consult this flag: such a +/// resolution is not guaranteed to structurally match what a plain checkout +/// would render for the same graph state. +pub fn retrieve_content_with_filter_and_fork_info( + txn: &T, + changes: &C, + position: Position, + options: RetrieveOptions, +) -> RecordResult<(Vec, bool)> where T: GraphTxnT, C: ChangeStore, { // Check for root position - it has no content if position == Position::ROOT { - return Ok(Vec::new()); + return Ok((Vec::new(), false)); } // Convert RetrieveOptions to FileOutputOptions, preserving the change filter @@ -389,7 +412,7 @@ where } // Use output_file_to_buffer_with_options which accepts RetrieveOptions - let (content, _conflicts) = + let (content, _conflicts, had_fork_structure) = match output_file_to_buffer_with_options(txn, changes, position, file_opts, options) { Ok(result) => result, Err(e) => { @@ -401,7 +424,7 @@ where } }; - Ok(content) + Ok((content, had_fork_structure)) } /// Retrieve content at the state before a specific sequence. diff --git a/atomic-repository/src/repository/content.rs b/atomic-repository/src/repository/content.rs index 7ac4b4a4..e76d408d 100644 --- a/atomic-repository/src/repository/content.rs +++ b/atomic-repository/src/repository/content.rs @@ -845,6 +845,30 @@ pub(crate) fn retrieve_content_with_filter_fast( position: Position, options: atomic_core::output::alive::RetrieveOptions, ) -> atomic_core::record::RecordResult> +where + T: atomic_core::pristine::GraphTxnT + atomic_core::pristine::InodeGraphOps, + C: atomic_core::change::ChangeStore, +{ + retrieve_content_with_filter_fast_with_fork_info(txn, changes, inode, position, options) + .map(|(content, _had_fork_structure)| content) +} + +/// Like [`retrieve_content_with_filter_fast`], but also reports whether +/// retrieval had to resolve fork/cyclic structure to produce the content. +/// +/// The inode-linear fast path only ever follows an unambiguous single +/// successor chain (bailing to the full graph walk on any fork), so a fast- +/// path hit never involves fork resolution and always reports `false`. Only +/// the fallback to `retrieve_content_with_filter_and_fork_info` can report +/// `true`. Callers that use this content as `old_content` for a subsequent +/// positional diff (POMO-2) must consult this flag. +pub(crate) fn retrieve_content_with_filter_fast_with_fork_info( + txn: &T, + changes: &C, + inode: Inode, + position: Position, + options: atomic_core::output::alive::RetrieveOptions, +) -> atomic_core::record::RecordResult<(Vec, bool)> where T: atomic_core::pristine::GraphTxnT + atomic_core::pristine::InodeGraphOps, C: atomic_core::change::ChangeStore, @@ -861,14 +885,14 @@ where content.len() ); } - return Ok(content); + return Ok((content, false)); } if trace_retrieve { eprintln!("[retrieve_content_with_filter_fast] falling back to retrieve_graph"); } - atomic_core::record::workflow::retrieve::retrieve_content_with_filter( + atomic_core::record::workflow::retrieve::retrieve_content_with_filter_and_fork_info( txn, changes, position, options, ) } diff --git a/atomic-repository/src/repository/record.rs b/atomic-repository/src/repository/record.rs index 84b6c7ed..b34c3065 100644 --- a/atomic-repository/src/repository/record.rs +++ b/atomic-repository/src/repository/record.rs @@ -110,7 +110,7 @@ impl Repository { let record_t0 = std::time::Instant::now(); - use super::content::retrieve_content_with_filter_fast; + use super::content::retrieve_content_with_filter_fast_with_fork_info; // Pre-compute the change filter and cached graph transaction ONCE // for the entire record operation. Previously, get_file_content() @@ -436,11 +436,21 @@ impl Repository { }; // Old content = the file as the current view sees it in the graph. - let old_content = { + // + // `had_fork_structure` is true when retrieval had to resolve a + // fork or cyclic conflict (semantic merge / change-DAG + // supersession) to produce this content — most concretely, a + // fork left over from the orphan-view duplication bug (POMO-1). + // That resolution isn't guaranteed to structurally match what a + // plain, unambiguous checkout would render for the same graph + // state, so a positional diff against it can corrupt the file + // (POMO-2). We propagate the flag to `record_modified_file` via + // `force_whole_file_replace` below instead of diffing against it. + let (old_content, had_fork_structure) = { use atomic_core::output::alive::RetrieveOptions; let opts = RetrieveOptions::new().with_change_filter(shared_change_filter.clone()); - match retrieve_content_with_filter_fast( + match retrieve_content_with_filter_fast_with_fork_info( &shared_cached_txn, &self.change_store, file_inode, @@ -519,12 +529,23 @@ impl Repository { detected.inode = Some(file_inode); detected.position = Some(file_position); let working_copy = FileSystem::from_root(&self.root); + let file_options = if had_fork_structure { + log::warn!( + "record: '{}' had fork/cyclic conflict structure in its graph — \ + forcing a whole-file replace instead of a positional diff \ + (POMO-2 safety fallback; expected to be rare and self-healing)", + path + ); + core_options.clone().force_whole_file_replace(true) + } else { + core_options.clone() + }; match record_modified_file( &working_copy, &detected, &old_content, crdt_old_content.as_deref(), - &core_options, + &file_options, existing_trunk_id, existing_branches_slice, ) { diff --git a/atomic-repository/src/repository/tests/mod.rs b/atomic-repository/src/repository/tests/mod.rs index 5808b9d9..76644132 100644 --- a/atomic-repository/src/repository/tests/mod.rs +++ b/atomic-repository/src/repository/tests/mod.rs @@ -11,6 +11,7 @@ mod edit_tests; mod history_tests; mod init_tests; mod integration_tests; +mod record_duplication_tests; mod record_tests; mod status_tests; diff --git a/atomic-repository/src/repository/tests/record_duplication_tests.rs b/atomic-repository/src/repository/tests/record_duplication_tests.rs new file mode 100644 index 00000000..83144f95 --- /dev/null +++ b/atomic-repository/src/repository/tests/record_duplication_tests.rs @@ -0,0 +1,578 @@ +//! Regression tests for POMO-1: recording a small, targeted edit to a +//! large file should produce a small, proportional diff — not treat most +//! of the file as newly-inserted content, which duplicates already-alive +//! content in the graph once materialized. +//! +//! Reported symptom (pomodoro-2 project, intent POMO-1): `main.go` ended +//! up with every top-level function defined twice after a sequence of +//! small, targeted edits ("increase header size", "match font size", +//! "sort time options ascending"). `atomic change ` stats on that +//! history showed 195-604 hunks per edit, almost all "new content" +//! inserts with only 1-2 replace/delete hunks, for edits that should have +//! touched a handful of lines. + +use super::*; +use crate::record::RecordOptions; +use atomic_core::change::ChangeHeader; + +fn record_all(repo: &Repository, message: &str) { + let header = ChangeHeader::new(message); + let options = RecordOptions::new() + .with_all(true) + .save_to_store(true) + .apply_after_record(true); + repo.record(header, options).unwrap(); +} + +fn count_occurrences(content: &str, pattern: &str) -> usize { + content.matches(pattern).count() +} + +/// Build a Go-like source file with `count` distinct top-level functions, +/// each with a unique, greppable marker line. Mirrors the shape of the +/// real-world file (`main.go`) that triggered this investigation. +fn build_go_like_source(count: usize) -> String { + let mut out = String::new(); + out.push_str("package main\n\n"); + for i in 0..count { + out.push_str(&format!( + "func step{i}() int {{\n // marker[{i}]\n return {i}\n}}\n\n" + )); + } + out +} + +/// Single-view baseline (no cross-view merge involved): record a +/// 120-function file, then make one targeted one-line edit deep in the +/// file and record again. The second record's hunk count should be a +/// handful, and the materialized file should contain each function +/// exactly once — not duplicated because the diff mistook unrelated, +/// unchanged functions for new content. +#[test] +fn test_small_edit_on_large_file_stays_proportional() { + let (temp_dir, repo) = create_temp_repo(); + + let initial = build_go_like_source(120); + let file = temp_dir.path().join("main.go"); + std::fs::write(&file, &initial).unwrap(); + repo.add("main.go", TrackingOptions::default()).unwrap(); + record_all(&repo, "Add main.go"); + + // Targeted edit: change the return value of exactly one function deep + // in the file (step 60 of 120) — a single-line change. + let edited = initial.replacen("return 60\n", "return 6000\n", 1); + assert_ne!(initial, edited, "edit must actually change the file"); + std::fs::write(&file, &edited).unwrap(); + + let outcome = repo + .record( + ChangeHeader::new("Bump step60 return value"), + RecordOptions::new() + .with_all(true) + .save_to_store(true) + .apply_after_record(true), + ) + .unwrap(); + + let hunk_count = outcome.change().hunks().len(); + assert!( + hunk_count <= 10, + "a one-line edit should produce a handful of hunks, not {} \ + (this is the 'almost the whole file is rewritten' bug — POMO-1)", + hunk_count + ); + + let content = repo + .get_file_content("main.go") + .unwrap() + .expect("file should exist"); + let content = String::from_utf8(content).unwrap(); + + assert_eq!( + content, edited, + "materialized content should be exactly the edited file, \ + byte-for-byte — any divergence here is duplicated or lost content" + ); + + for i in 0..120 { + let marker = format!("// marker[{i}]"); + let occurrences = count_occurrences(&content, &marker); + assert_eq!( + occurrences, 1, + "step{} should appear exactly once, found {} (duplication!)", + i, occurrences + ); + } +} + +/// Same as above, but repeats several small, independent single-line +/// edits in sequence — mirroring the real-world history: "increase header +/// size", "match font size", "sort time options ascending" (a series of +/// small, targeted commits). Each record's hunk count must stay small; +/// this also catches a bug that only compounds after 2+ edits. +#[test] +fn test_sequential_small_edits_do_not_compound_duplication() { + let (temp_dir, repo) = create_temp_repo(); + + let mut current = build_go_like_source(150); + let file = temp_dir.path().join("main.go"); + std::fs::write(&file, ¤t).unwrap(); + repo.add("main.go", TrackingOptions::default()).unwrap(); + record_all(&repo, "Add main.go"); + + let edits = [ + (10, 1000, "Bump step10"), + (75, 7500, "Bump step75"), + (140, 14000, "Bump step140"), + (2, 200, "Bump step2"), + ]; + + for (idx, new_val, message) in edits { + let from = format!("return {idx}\n"); + let to = format!("return {new_val}\n"); + let next = current.replacen(&from, &to, 1); + assert_ne!(current, next, "edit for step{idx} must change the file"); + current = next; + std::fs::write(&file, ¤t).unwrap(); + + let outcome = repo + .record( + ChangeHeader::new(message), + RecordOptions::new() + .with_all(true) + .save_to_store(true) + .apply_after_record(true), + ) + .unwrap(); + + let hunk_count = outcome.change().hunks().len(); + assert!( + hunk_count <= 10, + "'{}' should produce a handful of hunks, not {} \ + (whole-file rewrite detected — POMO-1)", + message, + hunk_count + ); + } + + let content = repo + .get_file_content("main.go") + .unwrap() + .expect("file should exist"); + let content = String::from_utf8(content).unwrap(); + + assert_eq!( + content, current, + "materialized content should match the final edited file exactly" + ); + + for i in 0..150 { + let marker = format!("// marker[{i}]"); + let occurrences = count_occurrences(&content, &marker); + assert_eq!( + occurrences, 1, + "step{} should appear exactly once after {} sequential edits, \ + found {} (duplication compounding — POMO-1)", + i, + edits.len(), + occurrences + ); + } +} + +/// Cross-view variant of the same property, at a scale the existing +/// `cross_view_merge_tests` suite doesn't cover: a large file (well +/// beyond the ~10-20 line fixtures used there) with divergent edits on a +/// draft and its shared parent, merged and then edited again. If +/// duplication is specific to large diffs (e.g. a size-gated code path), +/// this is expected to catch it where the small-file tests do not. +#[test] +fn test_cross_view_merge_large_file_post_merge_record_clean() { + use crate::apply::CrossViewInsertOptions; + + let (temp_dir, mut repo) = create_temp_repo(); + + let initial = build_go_like_source(120); + let file = temp_dir.path().join("main.go"); + std::fs::write(&file, &initial).unwrap(); + repo.add("main.go", TrackingOptions::default()).unwrap(); + record_all(&repo, "Add main.go"); + + repo.create_view_from("feature", "dev").unwrap(); + + // Draft: edit step 30. + repo.switch_view("feature").unwrap(); + let draft = initial.replacen("return 30\n", "return 3000\n", 1); + std::fs::write(&file, &draft).unwrap(); + record_all(&repo, "Bump step30 on feature"); + + // Dev: edit step 90 (non-overlapping section of the file). + repo.switch_view("dev").unwrap(); + let dev_edit = initial.replacen("return 90\n", "return 9000\n", 1); + std::fs::write(&file, &dev_edit).unwrap(); + record_all(&repo, "Bump step90 on dev"); + + // Merge feature -> dev. + repo.insert_from_view(CrossViewInsertOptions::new("feature", "dev")) + .unwrap(); + repo.materialize().unwrap(); + + // Post-merge edit on dev: a third, unrelated single-line change. + repo.switch_view("dev").unwrap(); + let post_merge_base = std::fs::read_to_string(&file).unwrap(); + let post_merge = post_merge_base.replacen("return 60\n", "return 6000\n", 1); + assert_ne!( + post_merge_base, post_merge, + "post-merge edit must actually change the file" + ); + std::fs::write(&file, &post_merge).unwrap(); + + let outcome = repo + .record( + ChangeHeader::new("Bump step60 after merge"), + RecordOptions::new() + .with_all(true) + .save_to_store(true) + .apply_after_record(true), + ) + .unwrap(); + + let hunk_count = outcome.change().hunks().len(); + assert!( + hunk_count <= 10, + "the post-merge edit should produce a handful of hunks, not {} \ + (whole-file rewrite detected on a large post-merge file — POMO-1)", + hunk_count + ); + + let content = repo + .get_file_content_on_view("main.go", "dev") + .unwrap() + .expect("file should exist on dev"); + let content = String::from_utf8(content).unwrap(); + + for i in 0..120 { + let marker = format!("// marker[{i}]"); + let occurrences = count_occurrences(&content, &marker); + assert_eq!( + occurrences, 1, + "step{} should appear exactly once after merge + post-merge edit, \ + found {} (duplication!)", + i, occurrences + ); + } + + assert!(content.contains("return 3000"), "feature's edit should survive the merge"); + assert!(content.contains("return 9000"), "dev's edit should survive the merge"); + assert!(content.contains("return 6000"), "post-merge edit should be present"); +} + +/// Build a slice-literal-style block of `count` lines, one per value in +/// `order` (a permutation of `0..count`). Mirrors the real-world change +/// that triggered this investigation ("Sort time options ascending by +/// time value") much more closely than a single-token edit: reordering +/// is a pure permutation of already-alive lines, not a content change. +fn build_ordered_options(order: &[usize]) -> String { + let mut out = String::new(); + out.push_str("package main\n\nvar timeOptions = []int{\n"); + for v in order { + out.push_str(&format!("\ttimeOption{v}, // marker[{v}]\n")); + } + out.push_str("}\n"); + out +} + +/// The specific operation behind the real-world regression: re-sorting a +/// large block of otherwise-unchanged lines. A pure permutation has no +/// content change at all — every line in the "sorted" version already +/// existed, verbatim, in the "scrambled" version. If the record pipeline +/// treats reordered-but-unchanged lines as brand-new content instead of +/// recognizing them, the old (pre-sort) lines never get deleted and the +/// materialized file ends up with every line twice — which is exactly +/// what shipped in this project's `main.go` after "Sort time options +/// ascending by time value" (see intent POMO-1). +#[test] +fn test_sorting_lines_does_not_duplicate_them() { + let (temp_dir, repo) = create_temp_repo(); + + const N: usize = 60; + // A fixed, deliberately unsorted permutation of 0..N (not reversed — + // reversed order can trivially collapse to a short LCS in a way that + // isn't representative; this interleaves low/high values instead). + let scrambled: Vec = (0..N) + .map(|i| if i % 2 == 0 { i / 2 } else { N - 1 - i / 2 }) + .collect(); + let sorted: Vec = (0..N).collect(); + + let initial = build_ordered_options(&scrambled); + let file = temp_dir.path().join("main.go"); + std::fs::write(&file, &initial).unwrap(); + repo.add("main.go", TrackingOptions::default()).unwrap(); + record_all(&repo, "Add main.go with unsorted time options"); + + let resorted = build_ordered_options(&sorted); + assert_ne!(initial, resorted, "sorting must actually change the file"); + std::fs::write(&file, &resorted).unwrap(); + + let outcome = repo + .record( + ChangeHeader::new("Sort time options ascending by time value"), + RecordOptions::new() + .with_all(true) + .save_to_store(true) + .apply_after_record(true), + ) + .unwrap(); + + let hunk_count = outcome.change().hunks().len(); + println!( + "test_sorting_lines_does_not_duplicate_them: sort of {} lines produced {} hunks", + N, hunk_count + ); + + let content = repo + .get_file_content("main.go") + .unwrap() + .expect("file should exist"); + let content = String::from_utf8(content).unwrap(); + + // The real bug: every value's line should appear exactly ONCE after + // the sort, not twice (old unsorted copy + new sorted copy both alive). + let mut duplicated = Vec::new(); + for v in 0..N { + let marker = format!("// marker[{v}]"); + let occurrences = count_occurrences(&content, &marker); + if occurrences != 1 { + duplicated.push((v, occurrences)); + } + } + assert!( + duplicated.is_empty(), + "sorting should not duplicate lines, but these values have the wrong \ + occurrence count (value, count): {:?}\nhunk_count={}\ncontent:\n{}", + duplicated, + hunk_count, + content + ); + + assert_eq!( + content, resorted, + "materialized content should be exactly the sorted file, byte-for-byte" + ); +} + +/// POMO-2: after a file has been through the orphan-view duplication bug +/// (POMO-1) and the resulting duplicate is merged into a shared view, does a +/// *further*, ordinary in-place edit still get detected and recorded +/// correctly? In the real project, a subsequent edit to the (already +/// duplicated) `main.go` was detected by `atomic status` but produced a +/// change with zero hunks for the file — `atomic record`/`atomic diff` +/// silently disagreed with `status` about whether anything had changed. +/// +/// This reproduces the orphan-view mechanism directly at the `Repository` +/// level (bypassing `record_turn()`, which is now self-healing per POMO-1's +/// fix and would refuse to create the orphan) to recreate the exact lineage, +/// then attempts one more plain, ordinary edit on top and checks whether +/// `status` and `record` agree about it. +#[test] +fn test_further_edit_after_orphan_view_merge_is_still_detected() { + use crate::apply::CrossViewInsertOptions; + use crate::record::RecordError; + use crate::status::StatusOptions; + + let (temp_dir, repo) = create_temp_repo(); + let file = temp_dir.path().join("main.go"); + + // Step 1: base content, recorded normally on dev. + let initial = build_go_like_source(80); + std::fs::write(&file, &initial).unwrap(); + repo.add("main.go", TrackingOptions::default()).unwrap(); + record_all(&repo, "Add main.go"); + + // Step 2: simulate an orphaned session view directly — the exact + // low-level mechanism from POMO-1. `RecordOptions::view("orphan-xyz")` + // with a view name that doesn't exist yet reaches `open_or_create_view`'s + // parentless-Shared fallback, since nothing here calls + // `create_view_from` first (unlike a properly-forked session). + let edited = initial.replacen("return 40\n", "return 4000\n", 1); + std::fs::write(&file, &edited).unwrap(); + repo.record( + ChangeHeader::new("orphan edit"), + RecordOptions::new() + .with_all(true) + .view("orphan-xyz") + .apply_after_record(true) + .save_to_store(true), + ) + .expect("orphan record should succeed (it's the duplication bug, not a crash)"); + + // Step 3: merge the orphan view into dev — this is what reproduces the + // duplication (confirmed already by POMO-1's tests); not re-asserted here. + repo.insert_from_view(CrossViewInsertOptions::new("orphan-xyz", "dev")) + .unwrap(); + repo.materialize().unwrap(); + + // Step 4: a further, ordinary, targeted edit on top of the now-merged + // (duplicated) file — exactly the scenario that failed in the real + // project. Does `status` and `record` agree about it? + let current = std::fs::read_to_string(&file).unwrap(); + let further_edited = current.replacen("return 4000\n", "return 5000\n", 1); + assert_ne!( + current, further_edited, + "the further edit must actually change the file" + ); + std::fs::write(&file, &further_edited).unwrap(); + + let status = repo.status(StatusOptions::default()).expect("status failed"); + let modified_paths: Vec = status + .modified() + .map(|e| e.path().to_string_lossy().to_string()) + .collect(); + println!( + "test_further_edit_after_orphan_view_merge_is_still_detected: status.modified = {:?}", + modified_paths + ); + + let record_result = repo.record( + ChangeHeader::new("further edit"), + RecordOptions::new() + .with_all(true) + .apply_after_record(true) + .save_to_store(true), + ); + + match record_result { + Err(RecordError::NothingToRecord) => { + panic!( + "BUG REPRODUCED: record() found nothing to record, but status.modified = {:?} \ + and the file content genuinely differs from pristine", + modified_paths + ); + } + Err(e) => panic!("unexpected record error: {}", e), + Ok(outcome) => { + let recorded = outcome.recorded_files(); + println!( + "test_further_edit_after_orphan_view_merge_is_still_detected: recorded_files = {:?}, hunk_count={}", + recorded, + outcome.change().hunks().len(), + ); + assert!( + recorded.iter().any(|p| p == "main.go"), + "BUG REPRODUCED: record() succeeded but did not include main.go, even though \ + status flagged it as modified (recorded_files = {:?})", + recorded + ); + } + } + + // Independently of whether record() claimed success, verify the actual + // materialized content matches the further edit — this is the + // ground-truth check that would have caught the real bug (record() + // silently no-op'ing while claiming nothing was wrong). + repo.materialize().unwrap(); + let final_content = std::fs::read_to_string(&file).unwrap(); + let copies = count_occurrences(&final_content, "func step0() int {"); + println!( + "test_further_edit_after_orphan_view_merge_is_still_detected: final copies of step0 = {}", + copies + ); + assert_eq!( + final_content, further_edited, + "BUG REPRODUCED: materialized content after record() does not match the further edit \ + that was actually made on disk" + ); +} + +/// Companion to `test_further_edit_after_orphan_view_merge_is_still_detected`, +/// covering `globalize_delete`'s content-vertex deletion path instead of a +/// further edit. +/// +/// Note this empties the file's *content* (writes zero bytes) rather than +/// removing it from tracking (`atomic remove` / deleting it off disk). +/// Untracking goes through a completely different mechanism +/// (`record_deleted_file` → a tree-level `GraphOp::FileDel`, driven by a +/// hardcoded single-line hunk) that doesn't exercise `globalize_delete`'s +/// content-vertex cleanup at all — confirmed empirically: instrumenting +/// `delete_all_content` and running that scenario, it was never even +/// called. Editing an already-tracked file down to empty is what actually +/// produces a `record_modified_file` diff with `deleted_lines` spanning the +/// file's true old range, which is what drives `globalize_delete` into its +/// whole-file fallback (`delete_all_content`) when the range exceeds what +/// the (buggy, pre-fix) linear-walk vertex count reports. +/// +/// `globalize_delete`'s whole-file fallback shares `delete_all_content` with +/// `globalize_replace_whole_file` — both used to rely on a linear graph walk +/// that only follows one branch of a genuine fork (POMO-2's second bug +/// layer). This confirms emptying a file that went through the orphan-view +/// duplication lineage actually removes *every* alive copy, not just one — +/// which matters because a phantom surviving branch wouldn't show up in the +/// working copy (the file just looks empty either way) but would still be +/// live in the graph, ready to resurface via a later insert, push, or fork +/// from this view. +#[test] +fn test_emptying_file_after_orphan_view_merge_removes_every_copy() { + use crate::apply::CrossViewInsertOptions; + + let (temp_dir, repo) = create_temp_repo(); + let file = temp_dir.path().join("main.go"); + + // Step 1: base content, recorded normally on dev. + let initial = build_go_like_source(80); + std::fs::write(&file, &initial).unwrap(); + repo.add("main.go", TrackingOptions::default()).unwrap(); + record_all(&repo, "Add main.go"); + + // Step 2: simulate an orphaned session view directly (POMO-1's + // mechanism), producing a second, duplicate copy of the file's content + // once merged. + let edited = initial.replacen("return 40\n", "return 4000\n", 1); + std::fs::write(&file, &edited).unwrap(); + repo.record( + ChangeHeader::new("orphan edit"), + RecordOptions::new() + .with_all(true) + .view("orphan-xyz") + .apply_after_record(true) + .save_to_store(true), + ) + .expect("orphan record should succeed (it's the duplication bug, not a crash)"); + + // Step 3: merge the orphan view into dev — reproduces the duplication. + repo.insert_from_view(CrossViewInsertOptions::new("orphan-xyz", "dev")) + .unwrap(); + repo.materialize().unwrap(); + + // Step 4: empty the (now duplicated) file's content — still tracked, + // just zero bytes — and record it. + std::fs::write(&file, b"").unwrap(); + let outcome = repo + .record( + ChangeHeader::new("empty main.go"), + RecordOptions::new() + .with_all(true) + .apply_after_record(true) + .save_to_store(true), + ) + .expect("emptying the file should record successfully"); + println!( + "test_emptying_file_after_orphan_view_merge_removes_every_copy: recorded_files = {:?}", + outcome.recorded_files() + ); + + // Step 5: ground truth — read the graph state directly for "dev" (no + // disk materialization involved, so this can't be confused by whatever + // the working copy happens to look like). If any copy survived, its + // content would still be alive in the graph and this read would return + // it — even though the working copy just looks like an empty file + // either way, so inspecting disk after emptying it couldn't have caught + // a phantom surviving branch. + let content = repo.get_file_content_on_view("main.go", "dev").unwrap(); + let leftover_bytes = content.as_ref().map(|c| c.len()).unwrap_or(0); + assert_eq!( + leftover_bytes, 0, + "BUG: main.go should have zero alive content bytes on 'dev' after being emptied, \ + but found {} — a duplicate copy from the orphan-view merge survived", + leftover_bytes + ); +} diff --git a/tests/harness/05_semantic_layer.sh b/tests/harness/05_semantic_layer.sh index e236d20c..6d75c266 100755 --- a/tests/harness/05_semantic_layer.sh +++ b/tests/harness/05_semantic_layer.sh @@ -83,8 +83,11 @@ create_file "feature.txt" "feature content" assert_success "add feature.txt" atomic add feature.txt record_change "Add feature.txt on feature" >/dev/null 2>&1 || true -# Log on feature should have 2 entries (base + feature file) -feature_log="$(atomic log 2>/dev/null || true)" +# Log on feature should have 2 entries (base + feature file). Draft views +# hide ancestor-inherited entries by default (git-branch-log semantics); +# --all shows the full history including what was explicitly pulled in via +# insert_from_view. +feature_log="$(atomic log --all 2>/dev/null || true)" feature_count="$(echo "$feature_log" | grep -cE '^[[:space:]]*#[0-9]+|^[0-9a-f]{8,}' || true)" if [[ $feature_count -ge 2 ]]; then @@ -389,9 +392,11 @@ record_change "Add removable on dev" >/dev/null 2>&1 || true new_view "feature" >/dev/null 2>&1 || true insert_from_view "dev" "feature" >/dev/null 2>&1 || true -# Verify feature has the change +# Verify feature has the change. --all needed: the change is still +# present in dev's own log at this point, so the draft-view ancestor +# filter would otherwise hide it (it was pulled in via insert_from_view). switch_view "feature" >/dev/null 2>&1 || true -feature_log_before="$(atomic log 2>/dev/null || true)" +feature_log_before="$(atomic log --all 2>/dev/null || true)" if echo "$feature_log_before" | grep -qF "Add removable on dev"; then _pass "feature log has removable change before unrecord" else @@ -587,7 +592,9 @@ else _pass "feature record completes" fi -feature_log="$(atomic log 2>/dev/null || true)" +# --all: feature inherited "Add app.py v1" via insert_from_view, which the +# draft-view ancestor filter would otherwise hide since it's also on dev. +feature_log="$(atomic log --all 2>/dev/null || true)" feature_count="$(echo "$feature_log" | grep -cE '^[[:space:]]*#[0-9]+|^[0-9a-f]{8,}' || true)" if [[ $feature_count -ge 2 ]]; then _pass "feature log has 2+ entries ($feature_count)" @@ -819,7 +826,9 @@ for i in 4 5; do record_change "Add file${i}" >/dev/null 2>&1 || true done -feature_log="$(atomic log 2>/dev/null || true)" +# --all: expected_feature counts the 3 inherited dev changes too, which +# the draft-view ancestor filter would otherwise hide. +feature_log="$(atomic log --all 2>/dev/null || true)" feature_count="$(echo "$feature_log" | grep -cE '^[[:space:]]*#[0-9]+|^[0-9a-f]{8,}' || true)" expected_feature=$((BASE + 5)) if [[ $feature_count -eq $expected_feature ]]; then @@ -862,9 +871,10 @@ else _fail "dev has $expected_after_unrecord changes after unrecord" "got $dev_count4" fi -# Feature should still have BASE+5 (unrecord was on dev) +# Feature should still have BASE+5 (unrecord was on dev). --all: same +# ancestor-filter reasoning as above. switch_view "feature" >/dev/null 2>&1 || true -feature_log2="$(atomic log 2>/dev/null || true)" +feature_log2="$(atomic log --all 2>/dev/null || true)" feature_count2="$(echo "$feature_log2" | grep -cE '^[[:space:]]*#[0-9]+|^[0-9a-f]{8,}' || true)" if [[ $feature_count2 -eq $expected_feature ]]; then _pass "feature still has $expected_feature changes after dev unrecord" diff --git a/tests/harness/11_diff_git_parity.sh b/tests/harness/11_diff_git_parity.sh index c54ec56e..e3693c62 100755 --- a/tests/harness/11_diff_git_parity.sh +++ b/tests/harness/11_diff_git_parity.sh @@ -472,16 +472,24 @@ else atomic_h=$(echo "$logline" | awk '{print $1}') [[ -z "$atomic_h" ]] && continue change_detail=$( (cd "$GIT_REPO" && atomic change "$atomic_h" 2>/dev/null) || true ) - git_sha=$(echo "$change_detail" | grep "Commit:" | awk '{print $2}') + # Not every change has "Commit:" metadata — the vault-scaffold and + # .atomicignore changes atomic git import creates alongside the + # actual git-derived history don't. Under set -e/pipefail, grep + # finding no match must not abort the whole script. + git_sha=$(echo "$change_detail" | grep "Commit:" | awk '{print $2}' || true) if [[ -n "$git_sha" ]]; then # Store the full git SHA so we can match short SHAs of any length MAP_GIT_SHAS+=("$git_sha") MAP_ATOMIC_HASHES+=("$atomic_h") fi - # Stop once we have all 4 commits mapped + # Stop once we have all 4 commits mapped. + # ${MAP_GIT_SHAS[@]:-} (not "${MAP_GIT_SHAS[@]}"): bash 3.2 (macOS's + # default /bin/bash) treats expanding an empty array as an unbound + # variable under `set -u`, which is active here via helpers.sh. _found=0 for _s in "${COMMIT_SHAS[@]}"; do - for _ms in "${MAP_GIT_SHAS[@]}"; do + for _ms in "${MAP_GIT_SHAS[@]:-}"; do + [[ -z "$_ms" ]] && continue # Match if the full SHA starts with the short SHA [[ "$_ms" == "${_s}"* ]] && _found=$((_found+1)) && break done diff --git a/tests/harness/13_import_fidelity.sh b/tests/harness/13_import_fidelity.sh index 83684082..46dae101 100755 --- a/tests/harness/13_import_fidelity.sh +++ b/tests/harness/13_import_fidelity.sh @@ -27,10 +27,16 @@ assert_import_clean_with_bootstrap() { while IFS= read -r line; do [[ -z "$line" ]] && continue - # Ignore the repository bootstrap artifacts materialized by `atomic init`. - case "$line" in - \?*\ .atomicignore) continue ;; - \?*\ .vault/*) continue ;; + # Ignore the repository bootstrap artifacts materialized by + # `atomic init`/`atomic git import` (vault scaffold + .atomicignore). + # These can show up as untracked ("??") or already-added ("A ") + # depending on whether the import step auto-adds them, so match on + # the path regardless of the leading status flag(s). + local path + path="$(echo "$line" | sed -E 's/^[^[:space:]]+[[:space:]]+//')" + case "$path" in + .atomicignore) continue ;; + .vault/*) continue ;; esac unexpected+="${line}"$'\n' @@ -43,6 +49,33 @@ assert_import_clean_with_bootstrap() { fi } +# Assert that `atomic diff` (working copy) shows no changes other than the +# repository bootstrap artifacts (vault scaffold + .atomicignore), which are +# added but not recorded by `atomic git import` and so appear as new-file +# diffs on the working copy. +assert_no_diff_except_bootstrap() { + local desc="$1" + local diff_out + diff_out="$(atomic diff 2>/dev/null || true)" + + local unexpected="" + while IFS= read -r line; do + if [[ "$line" =~ ^diff\ --atomic\ a/.*\ b/(.*)\ \( ]]; then + local path="${BASH_REMATCH[1]}" + case "$path" in + .atomicignore | .vault/*) continue ;; + *) unexpected+="${path}"$'\n' ;; + esac + fi + done <<< "$diff_out" + + if [[ -z "$unexpected" ]]; then + _pass "$desc" + else + _fail "$desc" "atomic diff shows unexpected changes for: $(printf '%s' "$unexpected" | head -10)" + fi +} + echo "" echo "${BOLD}══════════════════════════════════════════════════════════════${RESET}" echo "${BOLD} Suite: 13_import_fidelity${RESET}" @@ -80,12 +113,7 @@ assert_success "import succeeds" atomic git import assert_import_clean_with_bootstrap "working tree clean after import" # Double-check: atomic diff should show nothing -diff_out="$(atomic diff 2>/dev/null || true)" -if echo "$diff_out" | grep -qE '^diff --atomic'; then - _fail "no diff after import" "atomic diff shows unexpected changes" -else - _pass "no diff after import" -fi +assert_no_diff_except_bootstrap "no diff after import" # Verify beta still exists and has correct content assert_file_exists "beta.txt survives deletion of siblings" "beta.txt" @@ -163,12 +191,7 @@ assert_success "import with binary modification succeeds" atomic git import assert_import_clean_with_bootstrap "clean after binary modification import" # Also verify diff shows nothing -diff_out="$(atomic diff 2>/dev/null || true)" -if echo "$diff_out" | grep -qE '^diff --atomic'; then - _fail "no diff after binary modification import" "atomic diff shows changes for binary file" -else - _pass "no diff after binary modification import" -fi +assert_no_diff_except_bootstrap "no diff after binary modification import" # ──────────────────────────────────────────────────────────────────────────── @@ -453,12 +476,7 @@ for f in "${deleted_files[@]}"; do done # Final consistency check: atomic diff should be empty -diff_out="$(atomic diff 2>/dev/null || true)" -if echo "$diff_out" | grep -qE '^diff --atomic'; then - _fail "no diff in stress test" "atomic diff shows unexpected changes" -else - _pass "no diff in stress test" -fi +assert_no_diff_except_bootstrap "no diff in stress test" # ════════════════════════════════════════════════════════════════════════════ # Summary From 6c3efb2494cefda45d32afadc3285cf5d9160709 Mon Sep 17 00:00:00 2001 From: Lee Faus Date: Mon, 13 Jul 2026 13:44:37 -0400 Subject: [PATCH 2/6] clippy fixes --- atomic-agent/src/record/mod.rs | 7 +++--- .../src/record/workflow/globalize/hunk.rs | 1 - .../tests/record_duplication_tests.rs | 22 ++++++++++++++----- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/atomic-agent/src/record/mod.rs b/atomic-agent/src/record/mod.rs index 63ee5e75..b0804b00 100644 --- a/atomic-agent/src/record/mod.rs +++ b/atomic-agent/src/record/mod.rs @@ -264,16 +264,15 @@ pub fn record_turn( } } - repo.align_to_view(&options.session.view_name).map_err(|e| { - AgentError::RecordFailed { + repo.align_to_view(&options.session.view_name) + .map_err(|e| AgentError::RecordFailed { session_id: options.session.session_id.clone(), turn_number: options.turn_number, reason: format!( "Failed to align to session view '{}' after forking it: {}", options.session.view_name, e ), - } - })?; + })?; } Err(e) => { return Err(AgentError::RecordFailed { diff --git a/atomic-core/src/record/workflow/globalize/hunk.rs b/atomic-core/src/record/workflow/globalize/hunk.rs index 36e9319d..4a7fc63a 100644 --- a/atomic-core/src/record/workflow/globalize/hunk.rs +++ b/atomic-core/src/record/workflow/globalize/hunk.rs @@ -717,7 +717,6 @@ where Ok(vertices) } - // ─────────────────────────────────────────────────────────────────────────── // Graph vertex / edge helpers // ─────────────────────────────────────────────────────────────────────────── diff --git a/atomic-repository/src/repository/tests/record_duplication_tests.rs b/atomic-repository/src/repository/tests/record_duplication_tests.rs index 83144f95..94843538 100644 --- a/atomic-repository/src/repository/tests/record_duplication_tests.rs +++ b/atomic-repository/src/repository/tests/record_duplication_tests.rs @@ -170,7 +170,8 @@ fn test_sequential_small_edits_do_not_compound_duplication() { let marker = format!("// marker[{i}]"); let occurrences = count_occurrences(&content, &marker); assert_eq!( - occurrences, 1, + occurrences, + 1, "step{} should appear exactly once after {} sequential edits, \ found {} (duplication compounding — POMO-1)", i, @@ -262,9 +263,18 @@ fn test_cross_view_merge_large_file_post_merge_record_clean() { ); } - assert!(content.contains("return 3000"), "feature's edit should survive the merge"); - assert!(content.contains("return 9000"), "dev's edit should survive the merge"); - assert!(content.contains("return 6000"), "post-merge edit should be present"); + assert!( + content.contains("return 3000"), + "feature's edit should survive the merge" + ); + assert!( + content.contains("return 9000"), + "dev's edit should survive the merge" + ); + assert!( + content.contains("return 6000"), + "post-merge edit should be present" + ); } /// Build a slice-literal-style block of `count` lines, one per value in @@ -423,7 +433,9 @@ fn test_further_edit_after_orphan_view_merge_is_still_detected() { ); std::fs::write(&file, &further_edited).unwrap(); - let status = repo.status(StatusOptions::default()).expect("status failed"); + let status = repo + .status(StatusOptions::default()) + .expect("status failed"); let modified_paths: Vec = status .modified() .map(|e| e.path().to_string_lossy().to_string()) From c7a14f3d83b720993cb0e7aa43c4d2046a6489c9 Mon Sep 17 00:00:00 2001 From: Lee Faus Date: Mon, 13 Jul 2026 14:20:36 -0400 Subject: [PATCH 3/6] fix clippy --- atomic-semantic/src/parsers/java.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomic-semantic/src/parsers/java.rs b/atomic-semantic/src/parsers/java.rs index 36e38e75..ca97da03 100644 --- a/atomic-semantic/src/parsers/java.rs +++ b/atomic-semantic/src/parsers/java.rs @@ -207,7 +207,7 @@ impl JavaParser { let exported = self.has_modifier(node, source, "public"); - let sig = format!("{}enum {}", if exported { "public " } else { "" }, &name); + let sig = format!("{}enum {}", if exported { "public " } else { "" }, name); let mut entity = Entity::new(name, EntityKind::Enum, file_path, line, end_line); entity = entity.with_signature(sig); if exported { @@ -235,7 +235,7 @@ impl JavaParser { let sig = format!( "{}record {}{}", if exported { "public " } else { "" }, - &name, + name, params ); let mut entity = Entity::new(name, EntityKind::Class, file_path, line, end_line); From e556deb41e77b09e7c7549df08979f0f5ae17454 Mon Sep 17 00:00:00 2001 From: Lee Faus Date: Mon, 13 Jul 2026 15:56:32 -0400 Subject: [PATCH 4/6] full ci check --- .../src/changestore/iterators.rs | 102 +++++++++--------- .../src/repository/provenance_summary.rs | 36 ++++--- 2 files changed, 70 insertions(+), 68 deletions(-) diff --git a/atomic-repository/src/changestore/iterators.rs b/atomic-repository/src/changestore/iterators.rs index fc7e3e33..fb22a762 100644 --- a/atomic-repository/src/changestore/iterators.rs +++ b/atomic-repository/src/changestore/iterators.rs @@ -128,36 +128,33 @@ impl<'a> AttestationIterator<'a> { fn next_from_files(&mut self) -> Option> { loop { - if let Some(ref mut files) = self.current_files { - match files.next() { - Some(Ok(entry)) => { - let path = entry.path(); - if !path.is_file() { - continue; - } - if path - .extension() - .is_none_or(|e| e != atomic_core::change::ATTESTATION_EXTENSION) - { - continue; - } - // Extract hash from filename (strip extension) - let stem = match path.file_stem().and_then(|s| s.to_str()) { - Some(s) => s.to_string(), - None => continue, - }; - match Hash::from_base32(stem.as_bytes()) { - Some(hash) => return Some(Ok(hash)), - None => continue, - } + let files = self.current_files.as_mut()?; + match files.next() { + Some(Ok(entry)) => { + let path = entry.path(); + if !path.is_file() { + continue; + } + if path + .extension() + .is_none_or(|e| e != atomic_core::change::ATTESTATION_EXTENSION) + { + continue; } - Some(Err(e)) => return Some(Err(e.into())), - None => { - self.current_files = None; + // Extract hash from filename (strip extension) + let stem = match path.file_stem().and_then(|s| s.to_str()) { + Some(s) => s.to_string(), + None => continue, + }; + match Hash::from_base32(stem.as_bytes()) { + Some(hash) => return Some(Ok(hash)), + None => continue, } } - } else { - return None; + Some(Err(e)) => return Some(Err(e.into())), + None => { + self.current_files = None; + } } } } @@ -216,36 +213,33 @@ impl ProvenanceIterator { fn next_from_files(&mut self) -> Option> { loop { - if let Some(ref mut files) = self.current_files { - match files.next() { - Some(Ok(entry)) => { - let path = entry.path(); - if !path.is_file() { - continue; - } - if path - .extension() - .is_none_or(|e| e != atomic_core::change::PROVENANCE_GRAPH_EXTENSION) - { - continue; - } - // Extract hash from filename (strip extension) - let stem = match path.file_stem().and_then(|s| s.to_str()) { - Some(s) => s.to_string(), - None => continue, - }; - match Hash::from_base32(stem.as_bytes()) { - Some(hash) => return Some(Ok(hash)), - None => continue, - } + let files = self.current_files.as_mut()?; + match files.next() { + Some(Ok(entry)) => { + let path = entry.path(); + if !path.is_file() { + continue; + } + if path + .extension() + .is_none_or(|e| e != atomic_core::change::PROVENANCE_GRAPH_EXTENSION) + { + continue; } - Some(Err(e)) => return Some(Err(e.into())), - None => { - self.current_files = None; + // Extract hash from filename (strip extension) + let stem = match path.file_stem().and_then(|s| s.to_str()) { + Some(s) => s.to_string(), + None => continue, + }; + match Hash::from_base32(stem.as_bytes()) { + Some(hash) => return Some(Ok(hash)), + None => continue, } } - } else { - return None; + Some(Err(e)) => return Some(Err(e.into())), + None => { + self.current_files = None; + } } } } diff --git a/atomic-repository/src/repository/provenance_summary.rs b/atomic-repository/src/repository/provenance_summary.rs index 097a992f..71a640ec 100644 --- a/atomic-repository/src/repository/provenance_summary.rs +++ b/atomic-repository/src/repository/provenance_summary.rs @@ -338,10 +338,12 @@ mod tests { #[test] fn ai_authored_pct_excludes_system() { - let mut s = ProvenanceSummary::default(); - s.ai_changes = 4; - s.human_changes = 1; - s.system_changes = 2; // bootstrap excluded from headline denominator + let s = ProvenanceSummary { + ai_changes: 4, + human_changes: 1, + system_changes: 2, // bootstrap excluded from headline denominator + ..Default::default() + }; assert_eq!(s.authored_denominator(), 5); assert!((s.ai_authored_pct().unwrap() - 80.0).abs() < 1e-9); // ai_all_changes_pct uses total: 4 / 7 @@ -350,18 +352,22 @@ mod tests { #[test] fn ai_authored_pct_none_when_only_system() { - let mut s = ProvenanceSummary::default(); - s.system_changes = 3; + let s = ProvenanceSummary { + system_changes: 3, + ..Default::default() + }; assert_eq!(s.authored_denominator(), 0); assert_eq!(s.ai_authored_pct(), None); } #[test] fn needs_attention_does_not_count_as_human() { - let mut s = ProvenanceSummary::default(); - s.ai_changes = 1; - s.human_changes = 0; - s.needs_attention_changes = 2; // must NOT be in denominator + let s = ProvenanceSummary { + ai_changes: 1, + human_changes: 0, + needs_attention_changes: 2, // must NOT be in denominator + ..Default::default() + }; assert_eq!(s.authored_denominator(), 1); assert_eq!(s.ai_authored_pct(), Some(100.0)); } @@ -370,10 +376,12 @@ mod tests { fn unreadable_changes_do_not_skew_percent() { // Unreadable changes are reported separately, NOT counted in any // bucket — they must not silently change the denominator. - let mut s = ProvenanceSummary::default(); - s.ai_changes = 4; - s.human_changes = 1; - s.unreadable_changes = 3; + let s = ProvenanceSummary { + ai_changes: 4, + human_changes: 1, + unreadable_changes: 3, + ..Default::default() + }; assert_eq!(s.authored_denominator(), 5); assert_eq!(s.ai_authored_pct(), Some(80.0)); // total_changes excludes unreadable by design From e8dd3407ae27fb7b5737cfd59d4107fec0a8c3d0 Mon Sep 17 00:00:00 2001 From: Lee Faus Date: Mon, 13 Jul 2026 16:14:24 -0400 Subject: [PATCH 5/6] fixing --- atomic-cli/src/commands/git/parallel.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomic-cli/src/commands/git/parallel.rs b/atomic-cli/src/commands/git/parallel.rs index b24504c8..e235ca4e 100644 --- a/atomic-cli/src/commands/git/parallel.rs +++ b/atomic-cli/src/commands/git/parallel.rs @@ -3316,7 +3316,7 @@ impl ParallelImporter { } CommitClassification::Merge => { stats.merges += 1; - let tag_name = format!("merge-{}", &info.short_sha); + let tag_name = format!("merge-{}", info.short_sha); let metadata = serde_json::json!({ "git": { "sha": info.git_sha, @@ -3344,7 +3344,7 @@ impl ParallelImporter { let tag_name = if let Some(pr) = pr_number { format!("pr-{}", pr) } else { - format!("squash-{}", &info.short_sha) + format!("squash-{}", info.short_sha) }; let metadata = serde_json::json!({ "git": { From 799a8091cef82a07bcdbf8f98cae7a8d5e32cff8 Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Mon, 13 Jul 2026 15:27:23 -0500 Subject: [PATCH 6/6] docs: drop external POMO-1/POMO-2 ticket references from comments These referenced intents created in a different (pomodoro) project and aren't relevant to atomic. Rewrote each comment to describe the bug/fix directly (orphan-view duplication, whole-file-replace safety) while preserving the technical explanation. --- atomic-agent/src/record/mod.rs | 2 +- atomic-agent/src/record/tests.rs | 23 +++---- atomic-core/src/output/repo/file.rs | 2 +- .../src/record/workflow/globalize/hunk.rs | 11 ++-- atomic-core/src/record/workflow/record/mod.rs | 8 +-- .../src/record/workflow/record/options.rs | 2 +- atomic-core/src/record/workflow/retrieve.rs | 2 +- atomic-repository/src/repository/content.rs | 4 +- atomic-repository/src/repository/record.rs | 8 +-- .../tests/record_duplication_tests.rs | 62 ++++++++++--------- 10 files changed, 66 insertions(+), 58 deletions(-) diff --git a/atomic-agent/src/record/mod.rs b/atomic-agent/src/record/mod.rs index b0804b00..904440eb 100644 --- a/atomic-agent/src/record/mod.rs +++ b/atomic-agent/src/record/mod.rs @@ -216,7 +216,7 @@ pub fn record_turn( if repo.is_sandbox() { repo.set_current_view_in_memory(&options.session.view_name); } else { - // POMO-1: a missing session view here is NOT the normal first-turn + // A missing session view here is NOT the normal first-turn // case (that path creates the view during `apply_after_record`, well // after we already aligned successfully once). If we reach this // branch it means the SessionStart fork that should have created diff --git a/atomic-agent/src/record/tests.rs b/atomic-agent/src/record/tests.rs index a52e5344..4d1ebdd7 100644 --- a/atomic-agent/src/record/tests.rs +++ b/atomic-agent/src/record/tests.rs @@ -1017,7 +1017,7 @@ fn test_outcome_recorded_file_list_empty() { assert!(outcome.recorded_file_list().is_empty()); } -// POMO-1: orphaned session view duplication +// Orphaned session view duplication /// Build a Go-like source file with `count` distinct top-level functions, /// each with a unique, greppable marker line. @@ -1036,9 +1036,10 @@ fn count_occurrences(content: &str, pattern: &str) -> usize { content.matches(pattern).count() } -/// Reproduces the real-world mechanism behind POMO-1: a session whose -/// `SessionStart` fork never ran (or failed silently), so its view doesn't -/// exist yet when `record_turn()` is called for the first time. +/// Reproduces the real-world mechanism behind the orphan-view duplication +/// bug: a session whose `SessionStart` fork never ran (or failed silently), +/// so its view doesn't exist yet when `record_turn()` is called for the +/// first time. /// /// Before the fix, `record_turn()` would fall through to whatever view /// happened to be `current_view` on the raw `Repository` handle it opens @@ -1108,12 +1109,12 @@ fn test_orphaned_session_view_duplicates_content_on_merge() { // Session B: simulates a SessionStart fork that never ran (or failed) — // its view does not exist yet when record_turn() is called. Per the - // POMO-1 fix, record_turn() must self-heal by forking it just-in-time - // from its intended parent ("dev"), NOT from whatever view happens to - // be current on the internally-opened Repository handle (which after - // session A's turn is "session-a" — forking from there would leak - // session A's edit into session B's history and, once both are merged - // into dev, resurrect it as a duplicate). + // orphan-view duplication fix, record_turn() must self-heal by forking + // it just-in-time from its intended parent ("dev"), NOT from whatever + // view happens to be current on the internally-opened Repository handle + // (which after session A's turn is "session-a" — forking from there + // would leak session A's edit into session B's history and, once both + // are merged into dev, resurrect it as a duplicate). let mut session_b = AgentSession::new("session-b", "claude-code", "Claude Code"); session_b.view_name = "session-b".to_string(); session_b.set_parent_view("dev"); @@ -1155,7 +1156,7 @@ fn test_orphaned_session_view_duplicates_content_on_merge() { assert_eq!( occurrences, 1, "step{} should appear exactly once after merging both session views, \ - found {} (orphan-view duplication bug — POMO-1)", + found {} (orphan-view duplication bug)", i, occurrences ); } diff --git a/atomic-core/src/output/repo/file.rs b/atomic-core/src/output/repo/file.rs index 5fb56c6b..6eabfd02 100644 --- a/atomic-core/src/output/repo/file.rs +++ b/atomic-core/src/output/repo/file.rs @@ -859,7 +859,7 @@ where /// - `bool` - Whether retrieval had to resolve fork/cyclic structure via /// [`resolve_conflicts_semantically`] (`!resolved.is_empty()`). Callers /// that use this content as `old_content` for a subsequent positional -/// diff (see `record_modified_file`/POMO-2) must consult this: a +/// diff (see `record_modified_file`) must consult this: a /// semantic-merge resolution is not guaranteed to structurally match /// what a plain, unambiguous checkout would render for the same graph /// state, so a positional diff against it can produce a corrupted hunk. diff --git a/atomic-core/src/record/workflow/globalize/hunk.rs b/atomic-core/src/record/workflow/globalize/hunk.rs index 4a7fc63a..012511e0 100644 --- a/atomic-core/src/record/workflow/globalize/hunk.rs +++ b/atomic-core/src/record/workflow/globalize/hunk.rs @@ -437,7 +437,8 @@ where { // Delegates to `delete_all_content` for "find every content vertex, // delete it" — see its docs for why this always uses the thorough - // SCC-aware traversal rather than a linear walk (POMO-2/2b). + // SCC-aware traversal rather than a linear walk (a linear walk would + // miss one branch of a genuine fork and leave stale content alive). let deletion = delete_all_content(ctx, inode_pos)?; let insertions = if should_use_opaque_generated_vertices(&local.path) { @@ -539,7 +540,7 @@ where } // Fallback: whole-file deletion. `delete_all_content` already does the - // thorough search (POMO-2/2b), so no further fallback is needed here. + // thorough SCC-aware search, so no further fallback is needed here. let deletion = delete_all_content(ctx, inode_pos)?; Ok(vec![GraphOp::Edit { @@ -565,12 +566,12 @@ where /// linear walk (`collect_sorted_content_vertices`, used elsewhere for /// targeted range lookups). A linear walk only follows one BLOCK-edge /// successor chain from the inode, so a genuine fork (two chains both -/// anchored on the inode — exactly what the orphan-view duplication bug, -/// POMO-1, produces) leaves one branch unvisited. It doesn't error on that +/// anchored on the inode — exactly what the orphan-view duplication bug +/// produces) leaves one branch unvisited. It doesn't error on that /// incomplete result, so callers that only fall back to the global search on /// an `Err` never actually reach it: `build_deletion_edges` happily succeeds /// on whatever partial list it's given, deleting only that branch and -/// leaving the other alive (POMO-2). This function's whole purpose is +/// leaving the other alive. This function's whole purpose is /// deleting *every* content vertex, so it always pays for the thorough /// traversal — it's a rare, non-hot-path fallback (opaque/legacy files, /// whole-file replace, or a full-file delete), so the extra cost is an diff --git a/atomic-core/src/record/workflow/record/mod.rs b/atomic-core/src/record/workflow/record/mod.rs index 789b9679..094e2b4a 100644 --- a/atomic-core/src/record/workflow/record/mod.rs +++ b/atomic-core/src/record/workflow/record/mod.rs @@ -433,8 +433,8 @@ where return Ok(recorded); } - // POMO-2 safety fallback: if the caller's `old_content` came from - // resolving a fork or cyclic conflict (see + // Whole-file-replace safety fallback: if the caller's `old_content` came + // from resolving a fork or cyclic conflict (see // `retrieve_content_with_filter_and_fork_info`), it isn't guaranteed to // structurally match what a plain, unambiguous checkout would render for // the same graph state. A positional diff against it can therefore @@ -445,8 +445,8 @@ where // this hunk through `globalize_replace_whole_file`'s safe fallback path // (the same path used for opaque/legacy files above), rather than a // targeted per-vertex diff that would trust old_content's mismatched - // shape. This mirrors the delete+add workaround used manually to recover - // main.go in the pomodoro-2 project before this fix existed. + // shape. This mirrors the delete+add workaround that was used manually to + // recover a corrupted file before this fix existed. if options.get_force_whole_file_replace() { let mut replace_hunk = BuiltHunk::new_replace_with_lines( Local::new(&detected.path, 1), diff --git a/atomic-core/src/record/workflow/record/options.rs b/atomic-core/src/record/workflow/record/options.rs index 9b53410b..7f8a07dc 100644 --- a/atomic-core/src/record/workflow/record/options.rs +++ b/atomic-core/src/record/workflow/record/options.rs @@ -61,7 +61,7 @@ pub struct RecordingOptions { /// or cyclic conflict in the graph (see /// `retrieve_content_with_filter_and_fork_info` in the record path) — /// that resolution isn't guaranteed to structurally match what a plain - /// checkout renders for the same graph state (POMO-2), so a positional + /// checkout renders for the same graph state, so a positional /// diff against it can produce a corrupted hunk. A whole-file replace /// only needs "what's alive gets deleted, this is inserted fresh" to be /// true, which holds regardless of how `old_content` was resolved. diff --git a/atomic-core/src/record/workflow/retrieve.rs b/atomic-core/src/record/workflow/retrieve.rs index 815800bc..5353837d 100644 --- a/atomic-core/src/record/workflow/retrieve.rs +++ b/atomic-core/src/record/workflow/retrieve.rs @@ -384,7 +384,7 @@ where /// Like [`retrieve_content_with_filter`], but additionally returns whether /// [`output_file_to_buffer_with_options`] had to fall back to semantic-merge /// resolution (see its docs). Callers that use this content as `old_content` -/// for a subsequent positional diff (POMO-2) must consult this flag: such a +/// for a subsequent positional diff must consult this flag: such a /// resolution is not guaranteed to structurally match what a plain checkout /// would render for the same graph state. pub fn retrieve_content_with_filter_and_fork_info( diff --git a/atomic-repository/src/repository/content.rs b/atomic-repository/src/repository/content.rs index e76d408d..8bcdb30d 100644 --- a/atomic-repository/src/repository/content.rs +++ b/atomic-repository/src/repository/content.rs @@ -861,7 +861,9 @@ where /// path hit never involves fork resolution and always reports `false`. Only /// the fallback to `retrieve_content_with_filter_and_fork_info` can report /// `true`. Callers that use this content as `old_content` for a subsequent -/// positional diff (POMO-2) must consult this flag. +/// positional diff must consult this flag: a fork/cyclic resolution is not +/// guaranteed to structurally match a plain checkout, so diffing against it +/// can corrupt the file (hence the whole-file-replace safety fallback). pub(crate) fn retrieve_content_with_filter_fast_with_fork_info( txn: &T, changes: &C, diff --git a/atomic-repository/src/repository/record.rs b/atomic-repository/src/repository/record.rs index b34c3065..cb9cc613 100644 --- a/atomic-repository/src/repository/record.rs +++ b/atomic-repository/src/repository/record.rs @@ -440,11 +440,11 @@ impl Repository { // `had_fork_structure` is true when retrieval had to resolve a // fork or cyclic conflict (semantic merge / change-DAG // supersession) to produce this content — most concretely, a - // fork left over from the orphan-view duplication bug (POMO-1). + // fork left over from the orphan-view duplication bug. // That resolution isn't guaranteed to structurally match what a // plain, unambiguous checkout would render for the same graph - // state, so a positional diff against it can corrupt the file - // (POMO-2). We propagate the flag to `record_modified_file` via + // state, so a positional diff against it can corrupt the file. + // We propagate the flag to `record_modified_file` via // `force_whole_file_replace` below instead of diffing against it. let (old_content, had_fork_structure) = { use atomic_core::output::alive::RetrieveOptions; @@ -533,7 +533,7 @@ impl Repository { log::warn!( "record: '{}' had fork/cyclic conflict structure in its graph — \ forcing a whole-file replace instead of a positional diff \ - (POMO-2 safety fallback; expected to be rare and self-healing)", + (whole-file-replace safety fallback; expected to be rare and self-healing)", path ); core_options.clone().force_whole_file_replace(true) diff --git a/atomic-repository/src/repository/tests/record_duplication_tests.rs b/atomic-repository/src/repository/tests/record_duplication_tests.rs index 94843538..e60115b3 100644 --- a/atomic-repository/src/repository/tests/record_duplication_tests.rs +++ b/atomic-repository/src/repository/tests/record_duplication_tests.rs @@ -1,12 +1,12 @@ -//! Regression tests for POMO-1: recording a small, targeted edit to a -//! large file should produce a small, proportional diff — not treat most -//! of the file as newly-inserted content, which duplicates already-alive -//! content in the graph once materialized. +//! Regression tests for the orphan-view duplication bug: recording a small, +//! targeted edit to a large file should produce a small, proportional diff — +//! not treat most of the file as newly-inserted content, which duplicates +//! already-alive content in the graph once materialized. //! -//! Reported symptom (pomodoro-2 project, intent POMO-1): `main.go` ended -//! up with every top-level function defined twice after a sequence of -//! small, targeted edits ("increase header size", "match font size", -//! "sort time options ascending"). `atomic change ` stats on that +//! Reported symptom: `main.go` ended up with every top-level function +//! defined twice after a sequence of small, targeted edits ("increase +//! header size", "match font size", "sort time options ascending"). +//! `atomic change ` stats on that //! history showed 195-604 hunks per edit, almost all "new content" //! inserts with only 1-2 replace/delete hunks, for edits that should have //! touched a handful of lines. @@ -78,7 +78,7 @@ fn test_small_edit_on_large_file_stays_proportional() { assert!( hunk_count <= 10, "a one-line edit should produce a handful of hunks, not {} \ - (this is the 'almost the whole file is rewritten' bug — POMO-1)", + (this is the 'almost the whole file is rewritten' bug)", hunk_count ); @@ -149,7 +149,7 @@ fn test_sequential_small_edits_do_not_compound_duplication() { assert!( hunk_count <= 10, "'{}' should produce a handful of hunks, not {} \ - (whole-file rewrite detected — POMO-1)", + (whole-file rewrite detected)", message, hunk_count ); @@ -173,7 +173,7 @@ fn test_sequential_small_edits_do_not_compound_duplication() { occurrences, 1, "step{} should appear exactly once after {} sequential edits, \ - found {} (duplication compounding — POMO-1)", + found {} (duplication compounding)", i, edits.len(), occurrences @@ -242,7 +242,7 @@ fn test_cross_view_merge_large_file_post_merge_record_clean() { assert!( hunk_count <= 10, "the post-merge edit should produce a handful of hunks, not {} \ - (whole-file rewrite detected on a large post-merge file — POMO-1)", + (whole-file rewrite detected on a large post-merge file)", hunk_count ); @@ -299,8 +299,8 @@ fn build_ordered_options(order: &[usize]) -> String { /// treats reordered-but-unchanged lines as brand-new content instead of /// recognizing them, the old (pre-sort) lines never get deleted and the /// materialized file ends up with every line twice — which is exactly -/// what shipped in this project's `main.go` after "Sort time options -/// ascending by time value" (see intent POMO-1). +/// what shipped in the real-world `main.go` after "Sort time options +/// ascending by time value". #[test] fn test_sorting_lines_does_not_duplicate_them() { let (temp_dir, repo) = create_temp_repo(); @@ -371,18 +371,19 @@ fn test_sorting_lines_does_not_duplicate_them() { ); } -/// POMO-2: after a file has been through the orphan-view duplication bug -/// (POMO-1) and the resulting duplicate is merged into a shared view, does a -/// *further*, ordinary in-place edit still get detected and recorded +/// Positional-diff corruption: after a file has been through the orphan-view +/// duplication bug and the resulting duplicate is merged into a shared view, +/// does a *further*, ordinary in-place edit still get detected and recorded /// correctly? In the real project, a subsequent edit to the (already /// duplicated) `main.go` was detected by `atomic status` but produced a /// change with zero hunks for the file — `atomic record`/`atomic diff` /// silently disagreed with `status` about whether anything had changed. /// /// This reproduces the orphan-view mechanism directly at the `Repository` -/// level (bypassing `record_turn()`, which is now self-healing per POMO-1's -/// fix and would refuse to create the orphan) to recreate the exact lineage, -/// then attempts one more plain, ordinary edit on top and checks whether +/// level (bypassing `record_turn()`, which is now self-healing per the +/// orphan-view duplication fix and would refuse to create the orphan) to +/// recreate the exact lineage, then attempts one more plain, ordinary edit +/// on top and checks whether /// `status` and `record` agree about it. #[test] fn test_further_edit_after_orphan_view_merge_is_still_detected() { @@ -400,8 +401,9 @@ fn test_further_edit_after_orphan_view_merge_is_still_detected() { record_all(&repo, "Add main.go"); // Step 2: simulate an orphaned session view directly — the exact - // low-level mechanism from POMO-1. `RecordOptions::view("orphan-xyz")` - // with a view name that doesn't exist yet reaches `open_or_create_view`'s + // low-level mechanism of the orphan-view duplication bug. + // `RecordOptions::view("orphan-xyz")` with a view name that doesn't + // exist yet reaches `open_or_create_view`'s // parentless-Shared fallback, since nothing here calls // `create_view_from` first (unlike a properly-forked session). let edited = initial.replacen("return 40\n", "return 4000\n", 1); @@ -417,7 +419,8 @@ fn test_further_edit_after_orphan_view_merge_is_still_detected() { .expect("orphan record should succeed (it's the duplication bug, not a crash)"); // Step 3: merge the orphan view into dev — this is what reproduces the - // duplication (confirmed already by POMO-1's tests); not re-asserted here. + // duplication (confirmed already by the orphan-view duplication tests); + // not re-asserted here. repo.insert_from_view(CrossViewInsertOptions::new("orphan-xyz", "dev")) .unwrap(); repo.materialize().unwrap(); @@ -515,9 +518,10 @@ fn test_further_edit_after_orphan_view_merge_is_still_detected() { /// /// `globalize_delete`'s whole-file fallback shares `delete_all_content` with /// `globalize_replace_whole_file` — both used to rely on a linear graph walk -/// that only follows one branch of a genuine fork (POMO-2's second bug -/// layer). This confirms emptying a file that went through the orphan-view -/// duplication lineage actually removes *every* alive copy, not just one — +/// that only follows one branch of a genuine fork (the second layer of the +/// positional-diff corruption bug). This confirms emptying a file that went +/// through the orphan-view duplication lineage actually removes *every* +/// alive copy, not just one — /// which matters because a phantom surviving branch wouldn't show up in the /// working copy (the file just looks empty either way) but would still be /// live in the graph, ready to resurface via a later insert, push, or fork @@ -535,9 +539,9 @@ fn test_emptying_file_after_orphan_view_merge_removes_every_copy() { repo.add("main.go", TrackingOptions::default()).unwrap(); record_all(&repo, "Add main.go"); - // Step 2: simulate an orphaned session view directly (POMO-1's - // mechanism), producing a second, duplicate copy of the file's content - // once merged. + // Step 2: simulate an orphaned session view directly (the orphan-view + // duplication mechanism), producing a second, duplicate copy of the + // file's content once merged. let edited = initial.replacen("return 40\n", "return 4000\n", 1); std::fs::write(&file, &edited).unwrap(); repo.record(