From cfd9694de0c417740d2aa4507c324287e18deb5b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 29 Sep 2026 21:03:56 +0200 Subject: [PATCH] Pin that an index found whole at start-up was built Losing a collection the worker found whole at start-up is a rebuild. The mutation that left Build::Unbuilt in place on a matching label survived, because nothing observed the difference until the collection was lost. Co-Authored-By: Claude Opus 5.5 --- crates/huginn-daemon/src/index/tests.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/huginn-daemon/src/index/tests.rs b/crates/huginn-daemon/src/index/tests.rs index 51bf48c..e890163 100644 --- a/crates/huginn-daemon/src/index/tests.rs +++ b/crates/huginn-daemon/src/index/tests.rs @@ -1832,6 +1832,10 @@ fn a_minds_first_build_is_lag_whoever_looks_first() { partial.want(entries.iter().cloned()); partial.advance().unwrap(); assert_eq!(partial.progress_status(), IndexStatus::Behind { pending: 1 }, "an index found whole at start-up only lags"); + drain(&mut partial); + index.state.lock().unwrap().collections.remove(&collection()); + assert_eq!(partial.recheck().unwrap(), Advance::Progressed); + assert_eq!(partial.progress_status(), IndexStatus::Reconciling { pending: 4 }, "an index found at start-up was built: losing it is a rebuild"); embedder.state.lock().unwrap().identity.digest = "d2".into(); let mut replaced = Projector::new(embedder, index, &slug(INSTANCE), Some(MIND.into()));