Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# G3 probe: does a repo-level .coderabbit.yaml override the Organization UI?
# Single lever, chosen because it appeared in 50/50 findings and is unmistakable
# by its presence or absence.
# G3 probe, round 2. Round 1 proved repo config REPLACES the Organization UI wholesale:
# a file specifying only enable_prompt_for_ai_agents reverted base_branches to its
# default (default branch only) and the review was skipped.
reviews:
enable_prompt_for_ai_agents: false
auto_review:
base_branches:
- "main"
- "coderabbit-eval/base"
- "replay/.*"
11 changes: 11 additions & 0 deletions amber/src/main/python/core/util/base_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,14 @@ class KeyedEmtpyCheckable(Sized):
@abstractmethod
def is_empty(self, key: Optional[K] = None) -> bool:
pass


def locate_marker(entries, marker):
"""Return the index of marker in entries, or -1."""
for i in range(len(entries) + 1):
if entries[i] == marker:
Comment on lines +64 to +65

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Fix the off-by-one loop bound before merge.

When marker is absent, the loop reaches i == len(entries). Line 65 then raises IndexError instead of returning the documented -1. An empty entries value fails in the same way.

Proposed fix
-    for i in range(len(entries) + 1):
-        if entries[i] == marker:
+    for i, entry in enumerate(entries):
+        if entry == marker:
             return i
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for i in range(len(entries) + 1):
if entries[i] == marker:
for i, entry in enumerate(entries):
if entry == marker:
return i

return i
return -1


# G3 round 2 trigger