derive_clone_id

Function derive_clone_id 

Source
pub fn derive_clone_id(exe_dir: &Path) -> Option<String>
Expand description

Walk up from exe_dir looking for a workspace-root marker, then hash that absolute (canonical) path with FNV-1a and return a 16-char hex string. Used as the per-clone discriminator in ~/.agentmux/dev/<branch>/<clone_id>/. Returns None if no marker is found (extreme edge case — task dev always runs from inside a clone with .git/Cargo.toml/Taskfile.yml).

Recognized markers (any one suffices, in priority order): .git (dir or file — supports git worktrees), Cargo.toml, Taskfile.yml. We prefer .git because it identifies the literal clone, but Cargo.toml is a safe fallback (the workspace root has a [workspace] Cargo.toml).