Problem
There are two path encoding functions with different behavior:
internal/config/config.go:172-186 - encodeProjectPath
internal/history/paths.go:22-34 - EncodeProjectPath
Evidence
config.go version:
func encodeProjectPath(path string) string {
result := ""
for _, c := range path {
if c == filepath.Separator {
result += "-"
} else if c == ':' {
continue // Skip Windows colon
} else {
result += string(c) // KEEPS DOTS
}
}
return result
}
paths.go version:
func EncodeProjectPath(path string) string {
encoded := strings.ReplaceAll(path, string(filepath.Separator), "-")
encoded = strings.ReplaceAll(encoded, ".", "-") // REPLACES DOTS
// ...
}
The key difference: history.EncodeProjectPath replaces dots with dashes, while config.encodeProjectPath preserves dots.
Impact
This inconsistency could cause path mismatches if both functions are used in different parts of the codebase with the expectation of matching results.
Suggested Fix
- Delete the private
config.encodeProjectPath function
- Use the public
history.EncodeProjectPath everywhere
- The
history package version should be canonical since it's the public API
Files:
internal/config/config.go:172-186
internal/history/paths.go:22-34
Problem
There are two path encoding functions with different behavior:
internal/config/config.go:172-186-encodeProjectPathinternal/history/paths.go:22-34-EncodeProjectPathEvidence
config.go version:
paths.go version:
The key difference:
history.EncodeProjectPathreplaces dots with dashes, whileconfig.encodeProjectPathpreserves dots.Impact
This inconsistency could cause path mismatches if both functions are used in different parts of the codebase with the expectation of matching results.
Suggested Fix
config.encodeProjectPathfunctionhistory.EncodeProjectPatheverywherehistorypackage version should be canonical since it's the public APIFiles:
internal/config/config.go:172-186internal/history/paths.go:22-34