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

Function managed_commit_refusal

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

The durable refusal for a managed commit that is not recorded as-is.

(
    options: &TurnRecordOptions<'_>,
    transition: &RecordedGitTransition,
    commit: &str,
    reason: &str,
)

Source from the content-addressed store, hash-verified

1143
1144/// The durable refusal for a managed commit that is not recorded as-is.
1145fn managed_commit_refusal(
1146 options: &TurnRecordOptions<'_>,
1147 transition: &RecordedGitTransition,
1148 commit: &str,
1149 reason: &str,
1150) -> InexactManagedCommit {
1151 log::warn!(
1152 "Managed commit {} of session {} turn {} is not exactly the turn's content ({}); \
1153 nothing is recorded and the commit stays in Git",
1154 commit,
1155 options.session.session_id,
1156 options.turn_number,
1157 reason
1158 );
1159 let incomplete = IncompleteSession::new(
1160 format!(
1161 "Managed commit captured and authenticated, but it is not exactly this turn's \
1162 recorded content ({reason}); nothing was recorded. The commit stays in Git: run \
1163 'atomic git shim reconcile' to import it (RFC §19 Q2, allow-as-incomplete)"
1164 ),
1165 Vec::<String>::new(),
1166 String::new(),
1167 SessionIncompleteOrigin::ManagedCaptureAwaitingReassembly,
1168 )
1169 .with_unbound_commits(vec![commit.to_string()]);
1170 InexactManagedCommit {
1171 operations: transition.operations.clone(),
1172 capture: transition.capture,
1173 incomplete,
1174 }
1175}
1176
1177/// The Git commit a managed turn ended on, when that commit is exactly the
1178/// turn's work (CB-12A follow-up AC-8, the exact separable case).

Calls 2

with_unbound_commitsMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected