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

Method freeze_turn_intent

atomic-agent/src/turn/session.rs:920–936  ·  view source on GitHub ↗

Seal governance before any recording attempt, including one that fails before publishing a checkpoint. The caller holds `turn-end.lock`.

(&self, session_id: &str, turn_number: u32)

Source from the content-addressed store, hash-verified

918 /// Seal governance before any recording attempt, including one that fails
919 /// before publishing a checkpoint. The caller holds `turn-end.lock`.
920 pub(crate) fn freeze_turn_intent(&self, session_id: &str, turn_number: u32) -> AgentResult<()> {
921 validate_session_id(session_id)?;
922 // Validate existing evidence before recording any content.
923 self.turn_intent_binding(session_id, turn_number)?;
924 let dir = self.sessions_dir.join(session_id);
925 std::fs::create_dir_all(&dir)?;
926 let path = dir.join(format!("intent-{turn_number}.frozen"));
927 let file = std::fs::OpenOptions::new()
928 .write(true)
929 .create(true)
930 .truncate(false)
931 .open(path)?;
932 file.sync_all()?;
933 #[cfg(unix)]
934 std::fs::File::open(dir)?.sync_all()?;
935 Ok(())
936 }
937
938 /// Create a new session store at the given directory path.
939 ///

Calls 7

validate_session_idFunction · 0.85
openFunction · 0.85
turn_intent_bindingMethod · 0.80
truncateMethod · 0.80
openMethod · 0.45
createMethod · 0.45
writeMethod · 0.45