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

Method run

atomic-cli/src/commands/agent/attest.rs:301–342  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

299
300impl Command for Attest {
301 fn run(&self) -> CliResult<()> {
302 if crate::commands::rpc::agent_attest(self)? {
303 return Ok(());
304 }
305
306 let repo_root = find_repository_root()?;
307 let repo = Repository::open(&repo_root).map_err(|e| match e {
308 atomic_repository::RepositoryError::NotFound { path } => CliError::RepositoryNotFound {
309 searched_path: path.into(),
310 },
311 other => CliError::Repository(other),
312 })?;
313
314 // Project-level AI provenance summary (independent of attestations).
315 // `--pending <parent>` implies summary mode.
316 if self.summary || self.pending.is_some() {
317 // `--pending` compares a specific agent view against its parent;
318 // defaulting the agent view to the current view would produce a
319 // meaningless "X relative to X" empty delta, so require it.
320 if self.pending.is_some() && self.view.is_none() {
321 return Err(CliError::InvalidArgument {
322 message:
323 "--pending <parent_view> requires --view <agent_view> (the forked view to summarize)"
324 .to_string(),
325 });
326 }
327 return self.show_summary(&repo);
328 }
329
330 // Show details for a specific attestation
331 if let Some(ref hash_prefix) = self.hash {
332 return self.show_detail(&repo, hash_prefix);
333 }
334
335 // Filter by view
336 if let Some(ref view_name) = self.view {
337 return self.show_for_view(&repo, view_name);
338 }
339
340 // List all attestations
341 self.list_all(&repo)
342 }
343}
344
345impl Attest {

Callers

nothing calls this directly

Calls 9

agent_attestFunction · 0.85
find_repository_rootFunction · 0.85
openFunction · 0.85
RepositoryClass · 0.85
is_noneMethod · 0.80
show_summaryMethod · 0.80
show_detailMethod · 0.80
show_for_viewMethod · 0.80
list_allMethod · 0.80

Tested by

no test coverage detected