(&self)
| 299 | |
| 300 | impl 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 | |
| 345 | impl Attest { |
nothing calls this directly
no test coverage detected