Open the repository at `root` for a command that writes to the vault, creating the vault when it does not exist yet. Vault *writes* — `goal start/stop/resume`, `materialize`, `sync`, `intent new/update/delete/link/attest`, `memory new/write/attest` — open through this helper so a repository created without a vault (`atomic init --no-vault`, or one that never ran `atomic vault init`) works on firs
(root: &Path)
| 432 | /// path `atomic vault init` uses. It runs at most once: an existing vault is |
| 433 | /// never re-initialized. |
| 434 | pub fn open_repository_with_vault(root: &Path) -> CliResult<Repository> { |
| 435 | let repo = Repository::open(root).map_err(CliError::from)?; |
| 436 | ensure_vault_exists(&repo)?; |
| 437 | Ok(repo) |
| 438 | } |
| 439 | |
| 440 | /// One-time implicit vault initialization, announced on stderr so `--json` |
| 441 | /// output stays parseable. |