MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / has_git_checkpoint_moved

Method has_git_checkpoint_moved

atomic-agent/src/turn/orchestrator/mod.rs:874–896  ·  view source on GitHub ↗

Whether the Git checkpoint moved since the turn-start baseline (observation only — never reconciles). Unknown states report as moved so the record path classifies the gap explicitly.

(&self, session_id: &str)

Source from the content-addressed store, hash-verified

872 /// (observation only — never reconciles). Unknown states report as
873 /// moved so the record path classifies the gap explicitly.
874 pub(crate) fn has_git_checkpoint_moved(&self, session_id: &str) -> bool {
875 // A repository without Git has no checkpoint to move; clean turns
876 // there keep the plain read-only/retry semantics.
877 if !self.repo_root.join(".git").exists() {
878 return false;
879 }
880 // Working copy is clean. Compare the Git checkpoint against the
881 // turn-start baseline (observation only — never reconciles).
882 let Some(session) = self.session_store.load(session_id).ok().flatten() else {
883 return true;
884 };
885 let Some(baseline) = session.boundary_start.as_ref().and_then(|b| b.git.as_ref()) else {
886 // No baseline to compare (observation gap): let the record path
887 // classify and record the gap explicitly rather than claim
888 // observation-only without evidence.
889 return true;
890 };
891 let git = match atomic_repository::observe_git_metadata(&self.repo_root) {
892 Ok(observation) => crate::record::git_checkpoint(&observation.token()),
893 Err(_) => return true, // can't check — assume the turn needs classification
894 };
895 &git != baseline
896 }
897}
898
899impl std::fmt::Debug for TurnOrchestrator {

Callers 2

handle_turn_endMethod · 0.80

Calls 7

observe_git_metadataFunction · 0.85
git_checkpointFunction · 0.85
as_refMethod · 0.80
tokenMethod · 0.80
existsMethod · 0.45
okMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected