When .beads is a symlink (e.g., ~/gt/.beads -> ~/gt/olympus/.beads), findTownRoutes() incorrectly used filepath.Dir() on the resolved symlink path to determine the town root. This caused route resolution to fail because the town root would be ~/gt/olympus instead of ~/gt, making routes point to non-existent directories. The fix adds findTownRootFromCWD() which walks up from the current working directory instead of the beads directory path. This finds the correct town root regardless of symlink resolution. Changes: - Add findTownRootFromCWD() function - Update findTownRoutes() to use CWD-based town root detection - Add fallback to filepath.Dir() for non-Gas Town repos - Add debug logging (BD_DEBUG_ROUTING=1) - Add comprehensive test case Test: go test ./internal/routing/...
14 KiB
14 KiB