Resolve the **canonical** `.atomic` directory for a working path without* opening the database. If `path` is inside an agent sandbox, follows the `.atomic-sandbox` pointer to the canonical repository; otherwise finds the enclosing repository root. Returns ` /.atomic`. Use this for lock-free filesystem access to the canonical graph — e.g. writing a provenance graph through [`Change
(path: P)
| 536 | /// sandbox `path/.atomic` is a throwaway local dir (or absent), so joining |
| 537 | /// `.atomic` onto the working root would miss the real graph entirely. |
| 538 | pub fn canonical_dot_dir<P: AsRef<Path>>(path: P) -> Result<PathBuf, RepositoryError> { |
| 539 | if let Some((_working, canonical, _view)) = sandbox::detect_sandbox(path.as_ref()) { |
| 540 | return Ok(Self::find_root(&canonical)?.join(DOT_DIR)); |
| 541 | } |
| 542 | Ok(Self::find_root(path.as_ref())?.join(DOT_DIR)) |
| 543 | } |
| 544 | |
| 545 | /// Get the repository root path. |
| 546 | #[inline] |
nothing calls this directly
no test coverage detected