(&self)
| 93 | |
| 94 | impl 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 | |
| 135 | impl Attest { |
nothing calls this directly
no test coverage detected