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

Method get_session_intent

atomic-core/src/pristine/txn/read.rs:1247–1265  ·  view source on GitHub ↗

Get intent metadata for a provenance graph. Returns the intent entry when the graph carries a Goal node with intent `detail` (Sherpa graphs always do; other agents when available), `None` otherwise.

(
        &self,
        provenance_id: u64,
    )

Source from the content-addressed store, hash-verified

1245 /// `detail` (Sherpa graphs always do; other agents when available),
1246 /// `None` otherwise.
1247 pub fn get_session_intent(
1248 &self,
1249 provenance_id: u64,
1250 ) -> PristineResult<Option<crate::change::session::IntentEntry>> {
1251 use crate::change::session::IntentEntry;
1252
1253 let table = self.txn.open_table(SESSION_INTENTS)?;
1254
1255 match table.get(provenance_id)? {
1256 Some(guard) => match IntentEntry::from_bytes(guard.value()) {
1257 Ok(entry) => Ok(Some(entry)),
1258 Err(e) => {
1259 log::warn!("Failed to deserialize intent entry: {}", e);
1260 Ok(None)
1261 }
1262 },
1263 None => Ok(None),
1264 }
1265 }
1266}
1267
1268// VaultTxnT Implementation

Callers

nothing calls this directly

Calls 2

valueMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected