Build the (optionally kind-filtered) rows for the listing. Enumeration reuses [`Repository::vault_intent_list`]; the `kind` tag is read straight from the manifest `IntentSummary.kind` (a manifest read, never a lift). Factored out of [`Command::run`] so the kind tag + filter are unit-testable without a global identity store. A row whose id is missing from the manifest (should not happen — the same
(
repo: &Repository,
verifier: Option<&Verifier>,
filter: Option<&str>,
)
| 261 | /// the manifest (should not happen — the same manifest backs both) degrades to |
| 262 | /// the default `feature`. |
| 263 | fn build_rows( |
| 264 | repo: &Repository, |
| 265 | verifier: Option<&Verifier>, |
| 266 | filter: Option<&str>, |
| 267 | ) -> CliResult<Vec<Row>> { |
| 268 | let manifest = repo.vault_manifest().map_err(CliError::Repository)?; |
| 269 | let intents = repo.vault_intent_list(None).map_err(CliError::Repository)?; |
| 270 | let mut rows = Vec::new(); |
| 271 | for info in &intents { |
| 272 | let kind = manifest |
| 273 | .intents |
| 274 | .get(&info.id) |
| 275 | .map(|s| s.kind.clone()) |
| 276 | .unwrap_or_else(|| "feature".to_string()); |
| 277 | if let Some(f) = filter { |
| 278 | if kind != f { |
| 279 | continue; |
| 280 | } |
| 281 | } |
| 282 | rows.push(compute_row(repo, info, kind, verifier)); |
| 283 | } |
| 284 | Ok(rows) |
| 285 | } |
| 286 | |
| 287 | impl Command for IntentList { |
| 288 | fn run(&self) -> CliResult<()> { |