claudetool/codereview: stabilize related files list
diff --git a/claudetool/codereview/differential.go b/claudetool/codereview/differential.go
index 8688843..25defa4 100644
--- a/claudetool/codereview/differential.go
+++ b/claudetool/codereview/differential.go
@@ -1016,9 +1016,12 @@
}
}
- // Highest correlation first
+ // Highest correlation first, then sort by path.
slices.SortFunc(relatedFiles, func(a, b RelatedFile) int {
- return -1 * cmp.Compare(a.Correlation, b.Correlation)
+ return cmp.Or(
+ -1*cmp.Compare(a.Correlation, b.Correlation),
+ cmp.Compare(a.Path, b.Path),
+ )
})
// Limit to 1 correlated file per input file.