Build the (optionally kind-filtered) rows for the listing. Enumeration reuses [`Repository::vault_intent_list`]; the `kind` tag prefers stored frontmatter over the manifest fallback. 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 manifest backs both) degrades to
(
repo: &Repository,
verifier: Option<&Verifier>,
filter: Option<&str>,
)
| 358 | /// the manifest (should not happen — the same manifest backs both) degrades to |
| 359 | /// the default `feature`. |
| 360 | fn build_rows( |
| 361 | repo: &Repository, |
| 362 | verifier: Option<&Verifier>, |
| 363 | filter: Option<&str>, |
| 364 | ) -> CliResult<Vec<Row>> { |
| 365 | let manifest = repo.vault_manifest().map_err(CliError::Repository)?; |
| 366 | let intents = repo.vault_intent_list(None).map_err(CliError::Repository)?; |
| 367 | let mut rows = Vec::new(); |
| 368 | for info in &intents { |
| 369 | let kind = manifest |
| 370 | .intents |
| 371 | .get(&info.id) |
| 372 | .map(|s| repo.vault_intent_effective_kind(&s.vault_path, &s.kind)) |
| 373 | .unwrap_or_else(|| "feature".to_string()); |
| 374 | if let Some(f) = filter { |
| 375 | if kind != f { |
| 376 | continue; |
| 377 | } |
| 378 | } |
| 379 | rows.push(compute_row(repo, info, kind, verifier)); |
| 380 | } |
| 381 | Ok(rows) |
| 382 | } |
| 383 | |
| 384 | impl IntentList { |
| 385 | /// The effective `kind` filter is validated and applied client-side |