Conversation
PR SummaryMedium Risk Overview Reviewed by Cursor Bugbot for commit b90faf6. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Binary search assumes sorted mapping without enforcement
- Added sort.Slice in NewHeader to guarantee mappings are sorted by Offset, ensuring binary search correctness regardless of input order.
Or push these changes by commenting:
@cursor push 277fabe9bc
Preview (277fabe9bc)
diff --git a/packages/shared/pkg/storage/header/header.go b/packages/shared/pkg/storage/header/header.go
--- a/packages/shared/pkg/storage/header/header.go
+++ b/packages/shared/pkg/storage/header/header.go
@@ -32,6 +32,10 @@
}}
}
+ sort.Slice(mapping, func(i, j int) bool {
+ return mapping[i].Offset < mapping[j].Offset
+ })
+
return &Header{
Metadata: metadata,
Mapping: mapping,This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b90faf6. Configure here.
The initial merge left unresolved conflict markers and didn't account for main's []*BuildMap → []BuildMap migration (PR #2319) or the simplified mapping resolution (PR #2318). This properly reconciles our compression branch (FrameTable support, BuildFiles, V4 format) with those changes: value-type BuildMap slices, sort.Search lookup, and ApplyFrames as a standalone function to avoid mixed receivers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>


Remove the bitset and simplify build id lookup to reduce the memory usage.