`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)
| 6413 | /// GoalStartOptions' fields ride the request and the created goal's |
| 6414 | /// dir/file ride the response. |
| 6415 | pub fn vault_goal_start(args: &super::vault::goal::GoalStart) -> CliResult<bool> { |
| 6416 | let Some(session) = Service::open()? else { |
| 6417 | return Ok(false); |
| 6418 | }; |
| 6419 | let request = pb::CreateVaultEntityRequest { |
| 6420 | repository: Some(session.reference.clone()), |
| 6421 | meta: request_meta(), |
| 6422 | kind: Kind::Goal as i32, |
| 6423 | title: args.name.clone().unwrap_or_default(), |
| 6424 | body: None, |
| 6425 | memory_kind: None, |
| 6426 | derived_from: Vec::new(), |
| 6427 | about: Vec::new(), |
| 6428 | developer: args.developer.clone(), |
| 6429 | intent: args.intent.clone(), |
| 6430 | model: args.model.clone(), |
| 6431 | intent_kind: None, |
| 6432 | review_target: None, |
| 6433 | memory_id: None, |
| 6434 | memory_status: None, |
| 6435 | view: None, |
| 6436 | expected_snapshot: None, |
| 6437 | }; |
| 6438 | let response = session.create_vault_entity(request)?; |
| 6439 | let entry = response.entry.expect("created goal entry"); |
| 6440 | if args.json { |
| 6441 | let json = serde_json::json!({ |
| 6442 | "name": entry.id, |
| 6443 | "goal_dir": entry.goal_dir.clone().unwrap_or_default(), |
| 6444 | "goal_file": entry.goal_file.clone().unwrap_or_default(), |
| 6445 | }); |
| 6446 | println!("{}", serde_json::to_string_pretty(&json).unwrap()); |
| 6447 | } else { |
| 6448 | println!("Started goal: {}", entry.id); |
| 6449 | println!( |
| 6450 | " directory: .vault/{}", |
| 6451 | entry.goal_dir.clone().unwrap_or_default() |
| 6452 | ); |
| 6453 | } |
| 6454 | Ok(true) |
| 6455 | } |
| 6456 | |
| 6457 | /// `atomic vault goal stop` over UpdateVaultEntity's GoalStop arm — the |
| 6458 | /// handler resolves the most recent active goal when none is named and |
no test coverage detected