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)
| 1131 | /// sandbox `path/.atomic` is a throwaway local dir (or absent), so joining |
| 1132 | /// `.atomic` onto the working root would miss the real graph entirely. |
| 1133 | pub fn canonical_dot_dir<P: AsRef<Path>>(path: P) -> Result<PathBuf, RepositoryError> { |
| 1134 | if let Some((_working, canonical, _view)) = sandbox::detect_sandbox(path.as_ref()) { |
| 1135 | return Ok(working_copy::discover_layout(&canonical)?.common_dot_dir); |
| 1136 | } |
| 1137 | Ok(working_copy::discover_layout(path.as_ref())?.common_dot_dir) |
| 1138 | } |
| 1139 | |
| 1140 | /// Resolve the canonical repository database path without opening redb. |
| 1141 | /// |
nothing calls this directly
no test coverage detected