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

Function inspect_turn

libatomic/src/review/incremental.rs:370–390  ·  view source on GitHub ↗
(record: &SessionRecord, turn: &SessionTurn)

Source from the content-addressed store, hash-verified

368}
369
370fn inspect_turn(record: &SessionRecord, turn: &SessionTurn) -> CliResult<TurnInspection> {
371 let mut hashes: Vec<_> = turn.change_hashes.iter().map(Hash::to_base32).collect();
372 hashes.sort();
373 hashes.dedup();
374 Ok(TurnInspection {
375 session_id: record.session_id.clone(),
376 view_name: record.view_name.clone(),
377 turn_number: turn.turn_number,
378 status: if hashes.is_empty() {
379 "no_recorded_changes"
380 } else {
381 "recorded"
382 }
383 .into(),
384 session_status: record.status.label().into(),
385 plan_id: turn.plan_id.clone(),
386 provenance_hash: Some(turn.provenance_hash.to_base32()),
387 change_hashes: hashes,
388 outcome: encode(&turn.outcome)?,
389 })
390}
391
392fn pending_turn(store: &SessionStore, session: &AgentSession) -> CliResult<Option<TurnInspection>> {
393 if !session.is_turn_active() {

Callers 1

resolve_with_sessionFunction · 0.85

Calls 8

sortMethod · 0.80
encodeFunction · 0.70
collectMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45
is_emptyMethod · 0.45
labelMethod · 0.45
to_base32Method · 0.45

Tested by

no test coverage detected