`atomic intent list` over ListVaultEntries — every form. The handler computes the per-intent manifest kind and the attestation/verifies state with the same domain logic the local body uses; the CLI renders with the SAME table/JSON code (one render, two data sources). The `--kind`/`--review` filter validates client-side (an unknown kind is a clean argument error) and applies over the wire's classif
(args: &super::intent::list::IntentList)
| 1362 | /// `--kind`/`--review` filter validates client-side (an unknown kind is |
| 1363 | /// a clean argument error) and applies over the wire's classification. |
| 1364 | pub fn intent_list(args: &super::intent::list::IntentList) -> CliResult<bool> { |
| 1365 | let Some(session) = Service::open()? else { |
| 1366 | return Ok(false); |
| 1367 | }; |
| 1368 | // Resolve + validate the kind filter (`--review` ⇒ `--kind review`) |
| 1369 | // BEFORE the request, so the argument error never round-trips. |
| 1370 | let filter = args.kind_filter(); |
| 1371 | if let Some(kind) = &filter { |
| 1372 | if !atomic_canonical::vocab::is_known_intent_kind(kind) { |
| 1373 | return Err(CliError::InvalidArgument { |
| 1374 | message: format!( |
| 1375 | "unknown intent kind '{}' (expected one of {:?})", |
| 1376 | kind, |
| 1377 | atomic_canonical::vocab::INTENT_KIND |
| 1378 | ), |
| 1379 | }); |
| 1380 | } |
| 1381 | } |
| 1382 | let request = pb::ListVaultEntriesRequest { |
| 1383 | repository: Some(session.reference.clone()), |
| 1384 | kind: Some(Kind::Intent as i32), |
| 1385 | status: None, |
| 1386 | summaries_only: false, |
| 1387 | cursor: None, |
| 1388 | budget: None, |
| 1389 | view: None, |
| 1390 | identity: args.identity.clone(), |
| 1391 | path_prefix: None, |
| 1392 | entry_type: None, |
| 1393 | status_filter: None, |
| 1394 | tool_result_previews: false, |
| 1395 | sort: Some(args.sort.wire() as i32), |
| 1396 | reverse: args.reverse, |
| 1397 | }; |
| 1398 | let response = session.list_vault_entries(request)?; |
| 1399 | let mut rows = response |
| 1400 | .entries |
| 1401 | .iter() |
| 1402 | .map(super::intent::list::wire_row) |
| 1403 | .collect::<Vec<_>>(); |
| 1404 | if let Some(kind) = &filter { |
| 1405 | rows.retain(|row| &row.kind == kind); |
| 1406 | } |
| 1407 | // This request is unbudgeted and returns the full intent listing. Keep the |
| 1408 | // existing wire ID order for older services, then apply the new CLI sort. |
| 1409 | if args.sort == super::intent::list::IntentSort::HumanKey { |
| 1410 | super::intent::list::sort_rows(&mut rows, args.sort, args.reverse); |
| 1411 | } |
| 1412 | super::intent::list::IntentList::render(&rows, args.json); |
| 1413 | Ok(true) |
| 1414 | } |
| 1415 | |
| 1416 | /// `atomic intent show` over GetVaultEntry — every form. The wire |
| 1417 | /// carries the lift inputs (the stored entry) plus the RAW attestation |
no test coverage detected