agent-source-repository 0.1.0

Agent Source Repository local context registry for coding agents
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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(),
    }
}