Problem
Two different valid GitHub repository names can resolve to the same local mirror directory. On main at 67cb640, localMirrorDir joins owner and repository with one -:
a-b/c -> ~/.aether-agent/repos/a-b-c
a/b-c -> ~/.aether-agent/repos/a-b-c
Both names pass parseRepoSpec. After the first is cloned, ensureLocalClone finds .git at the shared path. Its origin check correctly refuses to use the wrong repository, but the second repository can no longer be used through --repo on that machine.
Expected behavior
Every distinct valid owner/name pair has a distinct mirror location. An existing legacy mirror remains usable for its own repository, and a collision never overwrites or borrows it.
Acceptance criteria
- Replace the ambiguous owner/name flattening with an injective, path-safe mapping for new mirrors; preserve repo identity across Windows and POSIX path semantics.
- For a legacy
owner-name directory, validate its origin before reuse. If it belongs to another repository with the same flattened name, use the new distinct location rather than failing or overwriting the legacy mirror.
- Keep the existing wrong-origin refusal for any directory chosen for a repository. Do not delete, reset, or silently move a mirror with local work.
- Add tests for
a-b/c versus a/b-c in both access orders, same-repo legacy reuse, and a mismatched origin at the new location.
Scope
This fixes mirror identity for aether agent --repo. It does not add a general cache manager or alter the user's GitHub authentication.
Problem
Two different valid GitHub repository names can resolve to the same local mirror directory. On
mainat67cb640,localMirrorDirjoins owner and repository with one-:Both names pass
parseRepoSpec. After the first is cloned,ensureLocalClonefinds.gitat the shared path. Its origin check correctly refuses to use the wrong repository, but the second repository can no longer be used through--repoon that machine.Expected behavior
Every distinct valid
owner/namepair has a distinct mirror location. An existing legacy mirror remains usable for its own repository, and a collision never overwrites or borrows it.Acceptance criteria
owner-namedirectory, validate its origin before reuse. If it belongs to another repository with the same flattened name, use the new distinct location rather than failing or overwriting the legacy mirror.a-b/cversusa/b-cin both access orders, same-repo legacy reuse, and a mismatched origin at the new location.Scope
This fixes mirror identity for
aether agent --repo. It does not add a general cache manager or alter the user's GitHub authentication.