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

Method publish_provenance

atomic-cli/src/remote_sandbox.rs:290–326  ·  view source on GitHub ↗
(
        &self,
        root: &Path,
        graph: Vec<u8>,
        turn: SessionTurn,
    )

Source from the content-addressed store, hash-verified

288 }
289
290 fn publish_provenance(
291 &self,
292 root: &Path,
293 graph: Vec<u8>,
294 turn: SessionTurn,
295 ) -> Result<Result<SessionCheckpointPublication, SubmitRejection>, String> {
296 exchange(root, move |repository, target, channel| async move {
297 let response = sandbox_client(channel)
298 .publish_provenance(pb::PublishProvenanceRequest {
299 repository: Some(repository),
300 meta: Some(pb::RequestMeta {
301 request_id: uuid::Uuid::new_v4().to_string(),
302 observed_at: None,
303 }),
304 graph: Some(wire::provenance_graph_bytes(graph)),
305 turn: Some(pb::SessionTurn {
306 session_id: turn.session_id.clone(),
307 turn_number: turn.turn_number,
308 }),
309 expected_generation: 0,
310 target: Some(target),
311 session_turn: Some(wire::session_turn_bytes(&turn)?),
312 })
313 .await
314 .map_err(refused)?
315 .into_inner();
316 match response.outcome.ok_or("no outcome in PublishProvenance")? {
317 pb::publish_provenance_response::Outcome::Publication(published) => {
318 Ok(Ok(wire::publication_from(&published)?))
319 }
320 pb::publish_provenance_response::Outcome::Refused(info) => {
321 Ok(Err(wire::rejection_from_error_info(&info)
322 .ok_or_else(|| info.message.clone())?))
323 }
324 }
325 })
326 }
327
328 fn submit_attestation(
329 &self,

Calls 8

exchangeFunction · 0.85
sandbox_clientFunction · 0.85
provenance_graph_bytesFunction · 0.85
session_turn_bytesFunction · 0.85
publication_fromFunction · 0.85
into_innerMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected