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

Method mark_session_incomplete

atomic-repository/src/repository/changes.rs:851–875  ·  view source on GitHub ↗

Persist a managed-agent incomplete outcome without indexing a turn. Returns the canonical stored outcome. If duplicate callbacks present a different value, the first durable recovery object is preserved.

(
        &self,
        session_id: &str,
        view_name: Option<String>,
        parent_view: Option<String>,
        incomplete: &atomic_core::change::session::IncompleteSession,
    )

Source from the content-addressed store, hash-verified

849 /// Returns the canonical stored outcome. If duplicate callbacks present a
850 /// different value, the first durable recovery object is preserved.
851 pub fn mark_session_incomplete(
852 &self,
853 session_id: &str,
854 view_name: Option<String>,
855 parent_view: Option<String>,
856 incomplete: &atomic_core::change::session::IncompleteSession,
857 ) -> Result<atomic_core::change::session::IncompleteSession, RepositoryError> {
858 self.ensure_project_identity(atomic_core::kg::project_id::MintReason::Upgrade)?;
859 let json_path = self
860 .dot_dir
861 .join("sessions")
862 .join(format!("{}.json", session_id))
863 .to_string_lossy()
864 .to_string();
865 let mut txn = self
866 .pristine
867 .write_txn()
868 .map_err(|e| RepositoryError::Database(e.to_string()))?;
869 let persisted = txn
870 .mark_session_incomplete(session_id, &json_path, view_name, parent_view, incomplete)
871 .map_err(|e| RepositoryError::Database(e.to_string()))?;
872 txn.commit()
873 .map_err(|e| RepositoryError::Database(e.to_string()))?;
874 Ok(persisted)
875 }
876
877 /// Attach durable turn boundaries and the semantic outcome to an already
878 /// indexed turn row (CB-12A, RFC §10.1/§10.2).

Calls 3

write_txnMethod · 0.80
commitMethod · 0.45