(
repo: &atomic_repository::Repository,
repo_root: &Path,
options: &TurnRecordOptions<'_>,
boundary_start: Option<TurnBoundary>,
boundary_end: TurnBoundary,
)
| 725 | /// Classify a turn whose working copy is clean (no durable content change). |
| 726 | #[allow(clippy::too_many_arguments)] |
| 727 | fn classify_clean_turn( |
| 728 | repo: &atomic_repository::Repository, |
| 729 | repo_root: &Path, |
| 730 | options: &TurnRecordOptions<'_>, |
| 731 | boundary_start: Option<TurnBoundary>, |
| 732 | boundary_end: TurnBoundary, |
| 733 | ) -> ClassifiedTurn { |
| 734 | let start_git = boundary_start |
| 735 | .as_ref() |
| 736 | .and_then(|boundary| boundary.git.clone()); |
| 737 | let end_git = boundary_end.git.clone(); |
| 738 | |
| 739 | // A repository without Git has no checkpoint to classify; a clean |
| 740 | // turn there is a legitimate ObservationOnly, never an observation |
| 741 | // gap. Only a Git-bearing repository refuses unverifiable transitions. |
| 742 | if !repo_root.join(".git").exists() { |
| 743 | return ClassifiedTurn { |
| 744 | outcome: ManagedTurnOutcome::ObservationOnly, |
| 745 | boundary_start, |
| 746 | boundary_end: Some(boundary_end), |
| 747 | incomplete: None, |
| 748 | }; |
| 749 | } |
| 750 | |
| 751 | // No baseline: refuse to claim ObservationOnly, record the observation |
| 752 | // gap explicitly, and durably refuse attribution (review R3: the missing |
| 753 | // observation is itself evidence, never a silent success). |
| 754 | let Some(start_git) = start_git else { |
| 755 | log::warn!( |
| 756 | "Turn-end classification for session {} has no turn-start baseline; \ |
| 757 | HEAD/index transition is unverifiable and no attribution is claimed", |
| 758 | options.session.session_id |
| 759 | ); |
| 760 | let unbound = boundary_end |
| 761 | .git |
| 762 | .as_ref() |
| 763 | .and_then(|git| git.head_oid.clone()) |
| 764 | .unwrap_or_default(); |
| 765 | let incomplete = IncompleteSession::new( |
| 766 | "turn-start boundary unavailable; HEAD/index transition unverifiable and \ |
| 767 | no attribution is claimed (RFC §10.2)", |
| 768 | Vec::<String>::new(), |
| 769 | String::new(), |
| 770 | SessionIncompleteOrigin::ObservationUnavailable, |
| 771 | ) |
| 772 | .with_unbound_commits(vec![unbound]); |
| 773 | return ClassifiedTurn { |
| 774 | outcome: ManagedTurnOutcome::RepositoryOperations { |
| 775 | operations: vec![ |
| 776 | "turn-start boundary unavailable; HEAD/index transition unverifiable" |
| 777 | .to_string(), |
| 778 | ], |
| 779 | capture: None, |
| 780 | }, |
| 781 | boundary_start, |
| 782 | boundary_end: Some(boundary_end), |
| 783 | incomplete: Some(incomplete), |
| 784 | }; |
no test coverage detected