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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-29 21:03:56 +02:00
commit cfd9694de0

View file

@ -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()));