Grant `done` on a Draft-scoped intent and return `(id, intent_file)`. The grant stamps the substance pin and materializes the file to disk.
(repo: &Repository)
| 2502 | /// Grant `done` on a Draft-scoped intent and return `(id, intent_file)`. The |
| 2503 | /// grant stamps the substance pin and materializes the file to disk. |
| 2504 | fn create_done_draft_intent(repo: &Repository) -> (String, String) { |
| 2505 | let result = repo |
| 2506 | .vault_intent_create(crate::repository::IntentCreateOptions { |
| 2507 | title: "Record-time lapse".to_string(), |
| 2508 | priority: None, |
| 2509 | assignee: None, |
| 2510 | labels: vec![], |
| 2511 | session_id: None, |
| 2512 | turn_id: None, |
| 2513 | kind: None, |
| 2514 | }) |
| 2515 | .unwrap(); |
| 2516 | |
| 2517 | // The authoring view (`dev`) is Shared by default; make it Draft so the |
| 2518 | // lapse applies. |
| 2519 | let view_name = repo.current_view().to_string(); |
| 2520 | repo.set_view_scope(&view_name, atomic_core::pristine::ViewScope::Draft) |
| 2521 | .unwrap(); |
| 2522 | |
| 2523 | let updated = repo |
| 2524 | .vault_intent_update( |
| 2525 | &result.id, |
| 2526 | crate::repository::IntentUpdateOptions { |
| 2527 | status: Some("done".to_string()), |
| 2528 | content: Some(RECORD_DONE_BODY.to_string()), |
| 2529 | ..Default::default() |
| 2530 | }, |
| 2531 | ) |
| 2532 | .unwrap(); |
| 2533 | assert_eq!(updated.status, "done"); |
| 2534 | (result.id, result.intent_file) |
| 2535 | } |
| 2536 | |
| 2537 | /// (a) A raw on-disk substance edit deflated via the RECORD path (the path |
| 2538 | /// that bypassed the lapse before this fix) demotes a `done` Draft intent to |