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)
| 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 | |
| 899 | impl std::fmt::Debug for TurnOrchestrator { |
no test coverage detected