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

Function clean_turn_result

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

The result of a turn whose working copy is clean: the turn an interrupted turn end already recorded, or its classification.

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

Source from the content-addressed store, hash-verified

1339/// The result of a turn whose working copy is clean: the turn an
1340/// interrupted turn end already recorded, or its classification.
1341fn clean_turn_result(
1342 repo: &atomic_repository::Repository,
1343 repo_root: &Path,
1344 options: &TurnRecordOptions<'_>,
1345) -> AgentResult<TurnRecordResult> {
1346 let boundary_end = capture_turn_boundary(
1347 repo,
1348 repo_root,
1349 &options.session.session_id,
1350 options.turn_number,
1351 )
1352 .ok_or_else(|| AgentError::RecordFailed {
1353 session_id: options.session.session_id.clone(),
1354 turn_number: options.turn_number,
1355 reason: "Failed to capture turn-end boundary on a clean turn".to_string(),
1356 })?;
1357 if let Some(outcome) = resume_recorded_managed_commit(repo, repo_root, options, &boundary_end) {
1358 return Ok(TurnRecordResult::Recorded(outcome));
1359 }
1360 Ok(TurnRecordResult::Classified(classify_clean_turn(
1361 repo,
1362 repo_root,
1363 options,
1364 options.session.boundary_start.clone(),
1365 boundary_end,
1366 )))
1367}
1368
1369/// Decide, before the turn is recorded, whether the in-flight turn of
1370/// `session` ends on a commit that [`record_turn`] will classify as

Callers 1

record_turnFunction · 0.85

Calls 5

capture_turn_boundaryFunction · 0.85
RecordedClass · 0.85
classify_clean_turnFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected