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

Method run

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

Source from the content-addressed store, hash-verified

93
94impl Command for Attest {
95 fn run(&self) -> CliResult<()> {
96 let repo_root = find_repository_root()?;
97 let repo = Repository::open(&repo_root).map_err(|e| match e {
98 atomic_repository::RepositoryError::NotFound { path } => CliError::RepositoryNotFound {
99 searched_path: path.into(),
100 },
101 other => CliError::Repository(other),
102 })?;
103
104 // Project-level AI provenance summary (independent of attestations).
105 // `--pending <parent>` implies summary mode.
106 if self.summary || self.pending.is_some() {
107 // `--pending` compares a specific agent view against its parent;
108 // defaulting the agent view to the current view would produce a
109 // meaningless "X relative to X" empty delta, so require it.
110 if self.pending.is_some() && self.view.is_none() {
111 return Err(CliError::InvalidArgument {
112 message:
113 "--pending <parent_view> requires --view <agent_view> (the forked view to summarize)"
114 .to_string(),
115 });
116 }
117 return self.show_summary(&repo);
118 }
119
120 // Show details for a specific attestation
121 if let Some(ref hash_prefix) = self.hash {
122 return self.show_detail(&repo, hash_prefix);
123 }
124
125 // Filter by view
126 if let Some(ref view_name) = self.view {
127 return self.show_for_view(&repo, view_name);
128 }
129
130 // List all attestations
131 self.list_all(&repo)
132 }
133}
134
135impl Attest {

Callers

nothing calls this directly

Calls 7

find_repository_rootFunction · 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