use super::{search_index_state, SourcePolicy};
pub(crate) fn source_policy_from_ready(snapshot: &super::ReadyIndexSnapshot) -> SourcePolicy {
SourcePolicy {
mode: "indexed_snapshot_fresh_source".to_string(),
snapshot_bound: true,
live: false,
stale: false,
head_commit: snapshot.state.head_commit.clone(),
worktree_fingerprint: Some(snapshot.state.worktree_fingerprint.clone()),
index_state: Some(search_index_state(
snapshot.state.clone(),
false,
snapshot.exact_shard.summary.clone(),
)),
note: "current registered source was verified to match the indexed SQLite chunk snapshot before this command ran".to_string(),
}
}