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)
| 2745 | /// Grant `done` on a Draft-scoped intent and return `(id, intent_file)`. The |
| 2746 | /// grant stamps the substance pin and materializes the file to disk. |
| 2747 | fn create_done_draft_intent(repo: &Repository) -> (String, String) { |
| 2748 | let result = repo |
| 2749 | .vault_intent_create(crate::repository::IntentCreateOptions { |
| 2750 | title: "Record-time lapse".to_string(), |
| 2751 | priority: None, |
| 2752 | assignee: None, |
| 2753 | labels: vec![], |
| 2754 | session_id: None, |
| 2755 | turn_id: None, |
| 2756 | kind: None, |
| 2757 | }) |
| 2758 | .unwrap(); |
| 2759 | |
| 2760 | // The authoring view (`dev`) is Shared by default; make it Draft so the |
| 2761 | // lapse applies. |
| 2762 | let view_name = repo.current_view().to_string(); |
| 2763 | repo.set_view_scope(&view_name, atomic_core::pristine::ViewScope::Draft) |
| 2764 | .unwrap(); |
| 2765 | |
| 2766 | let updated = repo |
| 2767 | .vault_intent_update( |
| 2768 | &result.id, |
| 2769 | crate::repository::IntentUpdateOptions { |
| 2770 | status: Some("done".to_string()), |
| 2771 | content: Some(RECORD_DONE_BODY.to_string()), |
| 2772 | ..Default::default() |
| 2773 | }, |
| 2774 | ) |
| 2775 | .unwrap(); |
| 2776 | assert_eq!(updated.status, "done"); |
| 2777 | (result.id, result.intent_file) |
| 2778 | } |
| 2779 | |
| 2780 | /// (a) A raw on-disk substance edit deflated via the RECORD path (the path |
| 2781 | /// that bypassed the lapse before this fix) demotes a `done` Draft intent to |