`atomic vault goal start` over CreateVaultEntity (kind=GOAL) — GoalStartOptions' fields ride the request and the created goal's dir/file ride the response.
(args: &super::vault::goal::GoalStart)
| 6453 | /// GoalStartOptions' fields ride the request and the created goal's |
| 6454 | /// dir/file ride the response. |
| 6455 | pub fn vault_goal_start(args: &super::vault::goal::GoalStart) -> CliResult<bool> { |
| 6456 | let Some(session) = Service::open()? else { |
| 6457 | return Ok(false); |
| 6458 | }; |
| 6459 | let request = pb::CreateVaultEntityRequest { |
| 6460 | repository: Some(session.reference.clone()), |
| 6461 | meta: request_meta(), |
| 6462 | kind: Kind::Goal as i32, |
| 6463 | title: args.name.clone().unwrap_or_default(), |
| 6464 | body: None, |
| 6465 | memory_kind: None, |
| 6466 | derived_from: Vec::new(), |
| 6467 | about: Vec::new(), |
| 6468 | developer: args.developer.clone(), |
| 6469 | intent: args.intent.clone(), |
| 6470 | model: args.model.clone(), |
| 6471 | intent_kind: None, |
| 6472 | review_target: None, |
| 6473 | memory_id: None, |
| 6474 | memory_status: None, |
| 6475 | view: None, |
| 6476 | expected_snapshot: None, |
| 6477 | }; |
| 6478 | let response = session.create_vault_entity(request)?; |
| 6479 | let entry = response.entry.expect("created goal entry"); |
| 6480 | if args.json { |
| 6481 | let json = serde_json::json!({ |
| 6482 | "name": entry.id, |
| 6483 | "goal_dir": entry.goal_dir.clone().unwrap_or_default(), |
| 6484 | "goal_file": entry.goal_file.clone().unwrap_or_default(), |
| 6485 | }); |
| 6486 | println!("{}", serde_json::to_string_pretty(&json).unwrap()); |
| 6487 | } else { |
| 6488 | println!("Started goal: {}", entry.id); |
| 6489 | println!( |
| 6490 | " directory: .vault/{}", |
| 6491 | entry.goal_dir.clone().unwrap_or_default() |
| 6492 | ); |
| 6493 | } |
| 6494 | Ok(true) |
| 6495 | } |
| 6496 | |
| 6497 | /// `atomic vault goal stop` over UpdateVaultEntity's GoalStop arm — the |
| 6498 | /// handler resolves the most recent active goal when none is named and |
no test coverage detected