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

Function classify_dirty_turn_git_transition

atomic-agent/src/record/mod.rs:875–911  ·  view source on GitHub ↗

Classify the Git transition of a turn whose working copy was NOT clean (review R2): the content work is attributed normally, but the transition is classified with the same authority as a git-only turn. Returns `None` when there is no observed transition to classify (missing baseline, failed end observation, or semantic checkpoint equality).

(
    repo: &atomic_repository::Repository,
    repo_root: &Path,
    options: &TurnRecordOptions<'_>,
    boundary_end: Option<&TurnBoundary>,
)

Source from the content-addressed store, hash-verified

873/// when there is no observed transition to classify (missing baseline, failed
874/// end observation, or semantic checkpoint equality).
875fn classify_dirty_turn_git_transition(
876 repo: &atomic_repository::Repository,
877 repo_root: &Path,
878 options: &TurnRecordOptions<'_>,
879 boundary_end: Option<&TurnBoundary>,
880) -> Option<RecordedGitTransition> {
881 let start_git = options
882 .session
883 .boundary_start
884 .as_ref()
885 .and_then(|boundary| boundary.git.clone())?;
886 let end_boundary = boundary_end?;
887 let end_git = end_boundary.git.clone()?;
888 if checkpoints_semantically_equal(&start_git, &end_git) {
889 return None;
890 }
891 let operations = describe_git_transition(&start_git, &end_git);
892 // The DIRTY path records the worktree content: when the worktree has
893 // no remainder beyond the commit, the recorded delta IS the commit
894 // delta (exact — ManagedGitCommitCaptured).
895 let classification = classify_git_transition(
896 repo,
897 repo_root,
898 options,
899 &start_git,
900 &end_git,
901 operations,
902 &end_boundary.working_copy,
903 true,
904 );
905 Some(RecordedGitTransition {
906 operations: classification.operations,
907 capture: classification.capture,
908 incomplete: classification.incomplete,
909 exact_commit_oid: classification.exact_commit_oid,
910 })
911}
912
913/// Whether the working tree carries changes beyond the Git HEAD (unstaged
914/// or untracked content) — the CB-12A follow-up exact-separability oracle.

Callers 1

record_turnFunction · 0.85

Calls 5

describe_git_transitionFunction · 0.85
classify_git_transitionFunction · 0.85
as_refMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected