crbench//

← all cases

Sorting the roster silently misaligns payroll's positional name/amount pairing

Tier 1 easy python · cross-file · authored, execution-grounded case

Ground-truth defects

d1 · correctness · high · roster.py:3
The diff makes team_members() return members sorted by name — a plausible improvement with no caller-facing red flag. But the unchanged consumer payroll.pay_slips() zips the names with `amounts`, which remain in the members' original order. After sorting, names and amounts no longer align and everyone is paid the wrong amount. No exception is raised; the break is a silently wrong mapping, visible only through the unchanged consumer payroll.py.

The change under review

diff
diff --git a/roster.py b/roster.py
--- a/roster.py
+++ b/roster.py
@@ -1,3 +1,3 @@
 def team_members(members):
-    """Return the team members."""
-    return list(members)
+    """Return the team members, sorted alphabetically by name."""
+    return sorted(members, key=lambda m: m["name"])

Leaderboard for this case

easy · 9 of 9 bots fully caught it (100% solve rate) · 100% avg coverage.

#BotResultCaughtCoverageFindingsFalse alarms
1 Claude Code (Opus 5.5) solved 1/1 100.0% 2 0
2 Cubic solved 1/1 100.0% 1 0
3 cursor solved 1/1 100.0% 1 0
4 Drape (Deep Review) solved 1/1 100.0% 1 0
5 Drape (Review) solved 1/1 100.0% 2 0
6 greptile solved 1/1 100.0% 1 0
7 Mjolnir (Opus 5.5) solved 1/1 100.0% 2 0
8 Mjolnir (Sonnet 5.5) solved 1/1 100.0% 2 0
9 qodo solved 1/1 100.0% 1 0

Bot results

Claude Code (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact low
The old `list(members)` accepted any iterable. The new key function indexes `m["name"]`, so members that aren't mappings, or that lack a `name` key, now raise. The only caller shown (payroll.py) already reads `m["name"]`, so this probably won't trigger there in practice. The function is still public, though, and its accepted input has narrowed, so the claim holds at low impact. The finding misses the bigger bug: payroll zips the sorted names with amounts that are still in the original order. [grounded: diff] [consensus 3/3: valid=3]
raw comments (2)
payroll.py:6
`team_members` now sorts members by name instead of keeping their input order. `pay_slips` zips the names it returns with `amounts`, and its docstring says `amounts` is in the members' original order. After this change, any input that isn't already in alphabetical order pairs names with the wrong amounts, so people get paid someone else's amount. Either keep `team_members` order-preserving, or have `pay_slips` build names from `members` directly or zip before sorting.
roster.py:3
`sorted(..., key=lambda m: m["name"])` now requires every member to be a mapping with a `name` key. Members without one raise `KeyError` or `TypeError`, where the old `list(members)` accepted any iterable of anything.
Cubic · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (2)
roster.py:3
<!-- cubic:v=9d11b392-84c0-4d8d-b979-3be9179ce5c4 --> <!-- cubic:review-run=94e7d641-07c6-590e-858b-d060e3d25b57 --> <!-- metadata:{"confidence":9} --> P1: Sorting inside `team_members` breaks the caller's ordering contract: `pay_slips` in payroll.py zips `team_members(members)` names against `amounts`, which its docstring states is "in the members' original order". After this change the names are alphabetical while `amounts` stays in the original order, so every member whose original position differs from the sorted position is paired with the wrong pay amount. Sort the members in the caller together with the amounts (e.g., sort indices once and reorder both lists), or reorder `amounts` by the same key inside `pay_slips`. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At roster.py, line 3: <comment>Sorting inside `team_members` breaks the caller's ordering contract: `pay_slips` in payroll.py zips `team_members(members)` names against `amounts`, which its docstring states is "in the members' original order". After this change the names are alphabetical while `amounts` stays in the original order, so every member whose original position differs from the sorted position is paired with the wrong pay amount. Sort the members in the caller together with the amounts (e.g., sort indices once and reorder both lists), or reorder `amounts` by the same key inside `pay_slips`.</comment> <file context> @@ -1,3 +1,3 @@ - """Return the team members.""" - return list(members) + """Return the team members, sorted alphabetically by name.""" + return sorted(members, key=lambda m: m["name"]) </file context> ``` </details>
PR-level
<!-- cubic:review-summary:start --> **1 issue found** across 1 file <!-- cubic:review-summary:end --> <details> <summary>Prompt for AI agents (unresolved issues)</summary> ```text Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately. <file name="roster.py"> <violation number="1" location="roster.py:3"> P1: Sorting inside `team_members` breaks the caller's ordering contract: `pay_slips` in payroll.py zips `team_members(members)` names against `amounts`, which its docstring states is "in the members' original order". After this change the names are alphabetical while `amounts` stays in the original order, so every member whose original position differs from the sorted position is paired with the wrong pay amount. Sort the members in the caller together with the amounts (e.g., sort indices once and reorder both lists), or reorder `amounts` by the same key inside `pay_slips`.</violation> </file> ``` </details> <sub>Reply with feedback, questions, or to request a fix.<br /><br />[Re-trigger cubic](https://www.cubic.dev/action/re-review/pr/drape-io/crbench-cubic-2026-09/8/ai_pr_review_github_delivery_70d004cd1f5d0750ae4b1b3d76a5acbeb320ada085c3495f449cb22d78da2fe7?returnTo=https%3A%2F%2Fgithub.com%2Fdrape-io%2Fcrbench-cubic-2026-09%2Fpull%2F8)</sub> <!-- cubic:review-post:ai_pr_review_github_delivery_70d004cd1f5d0750ae4b1b3d76a5acbeb320ada085c3495f449cb22d78da2fe7:e2411a1940d1d4146019eb4e1193cf9730073fb3:94e7d641-07c6-590e-858b-d060e3d25b57 -->
cursor · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (2)
roster.py:3
### Sorting misaligns member pay amounts **High Severity** <!-- DESCRIPTION START --> `team_members` now returns members sorted by name, but `pay_slips` zips those names with `amounts` that follow the original member order. Pay will be assigned to the wrong people whenever the roster is not already alphabetical. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: e2f359d0-1f03-4ea0-9bf4-8b7a61932f6c --> <!-- LOCATIONS START roster.py#L2-L3 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjJhZWExZDdjLWIzODQtNDZmYi1iNmFkLWJlM2NhNzVlYjU0NCIsImVuY3J5cHRpb25LZXkiOiJKSi1STzZWUVNXZFd1aVl1SU1QbjZtQWxjcV9CQ1ZyTmZMTnR6b3pBVlpjIiwiYnJhbmNoIjoidDEtcHktc29ydC1icmVha3MtcG9zaXRpb25hbC1wYXkiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjJhZWExZDdjLWIzODQtNDZmYi1iNmFkLWJlM2NhNzVlYjU0NCIsImVuY3J5cHRpb25LZXkiOiJKSi1STzZWUVNXZFd1aVl1SU1QbjZtQWxjcV9CQ1ZyTmZMTnR6b3pBVlpjIiwiYnJhbmNoIjoidDEtcHktc29ydC1icmVha3MtcG9zaXRpb25hbC1wYXkiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByTnVtYmVyIjo4LCJjb21taXRTaGEiOiI0NDU3MmM2MTRlM2I3N2ZmODRjOWYxYjMzY2IwYWViNzQ5YWIwYWIwIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 44572c614e3b77ff84c9f1b33cb0aeb749ab0ab0. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PR-level
<!-- BUGBOT_REVIEW --> Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue. <!-- BUGBOT_FIX_ALL --> <a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTozMGVlZDE1Ny0wYjExLTRkZTUtYjlhNi02N2QxMGUxMTExYTEiLCJlbmNyeXB0aW9uS2V5IjoiWkNXbkI0X3luLTI1dTRMdnp2VDhfbVUtc01HZVN3dDFoQTdLQWtuUXM5MCIsImJyYW5jaCI6InQxLXB5LXNvcnQtYnJlYWtzLXBvc2l0aW9uYWwtcGF5IiwicmVwb093bmVyIjoiZHJhcGUtaW8iLCJyZXBvTmFtZSI6ImNyYmVuY2gtY3Vyc29yLTIwMjYtMDkiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <!-- /BUGBOT_FIX_ALL --> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN --> <sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).</sup> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END --> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 44572c614e3b77ff84c9f1b33cb0aeb749ab0ab0. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
Drape (Deep Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (1)
roster.py:3
**Pay slips assign amounts to the wrong people** `pay_slips` zips names from `team_members` with `amounts`, which are in the members' original order. Now that `team_members` sorts by name, any input not already alphabetical pairs each amount with the wrong member. Keep `team_members` in input order, or have `pay_slips` pair amounts with `members` directly before sorting. ``` roster.py:2 """Return the team members, sorted alphabetically by name.""" roster.py:3 return sorted(members, key=lambda m: m["name"]) payroll.py:5 """Map each member to their pay. `amounts` is in the members' original order.""" payroll.py:6 names = [m["name"] for m in team_members(members)] payroll.py:7 return dict(zip(names, amounts)) ```
Drape (Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact low
Python compares strings by code point, so the new key puts every uppercase-initial name before any lowercase-initial one. For example, "Carl" sorts before "bob". That breaks the alphabetical order the new docstring promises, and this change introduced both the sort and the docstring. [grounded: diff] [consensus 3/3: valid=3]
raw comments (2)
roster.py:3
**Sorting misaligns pay amounts with members** team_members now sorts by name, but pay_slips zips those names with `amounts`, which are in the original member order. Pay goes to the wrong people unless members are already alphabetical. Zip the original members with amounts in pay_slips, or sort the (member, amount) pairs together. ``` roster.py:2 """Return the team members, sorted alphabetically by name.""" roster.py:3 return sorted(members, key=lambda m: m["name"]) payroll.py:5 """Map each member to their pay. `amounts` is in the members' original order.""" payroll.py:6 names = [m["name"] for m in team_members(members)] payroll.py:7 return dict(zip(names, amounts)) ```
roster.py:3
**Docstring says alphabetical, but sort is case-sensitive** `sorted` with `key=lambda m: m["name"]` compares raw strings, so every uppercase name sorts before any lowercase one. Names with mixed case, such as "zed" and "Amy" or "bob" and "Carl", don't come out in alphabetical order. Sort with key=lambda m: m["name"].casefold(). ``` roster.py:2 """Return the team members, sorted alphabetically by name.""" roster.py:3 return sorted(members, key=lambda m: m["name"]) ```
greptile · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (2)
roster.py:3
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> **Sorting misassigns payroll amounts** When members are not already in alphabetical order, this sort changes the name order before `pay_slips` pairs those names with amounts that are still in the members' original order. For example, members `[Bob, Alice]` with amounts `[BobPay, AlicePay]` produce `{Alice: BobPay, Bob: AlicePay}`, assigning each member the wrong pay.
PR-level
<h3>Greptile Summary</h3> This PR changes `team_members` to return member records alphabetically by name instead of preserving their input order. - Adds name-based sorting to roster output. - Breaks the existing payroll flow, which associates amounts with members positionally in original input order. <h3>Confidence Score: 4/5</h3> This PR is not safe to merge until payroll preserves the association between each member and their original-order amount. The new sort changes member order before payroll zips names with amounts that remain in original order, causing incorrect pay assignments for non-alphabetical inputs. **Files Needing Attention:** roster.py (interaction with payroll.py) <details><summary><h3>Important Files Changed</h3></summary> | Filename | Overview | |----------|----------| | roster.py | Introduces alphabetical sorting that conflicts with payroll's original-order positional amount contract. | </details> <details open><summary><h3>Sequence Diagram</h3></summary> ```mermaid sequenceDiagram participant Caller participant Roster as team_members participant Payroll as pay_slips Caller->>Payroll: members [Bob, Alice], amounts [BobPay, AlicePay] Payroll->>Roster: team_members(members) Roster-->>Payroll: [Alice, Bob] Note over Payroll: zip(sorted names, original-order amounts) Payroll-->>Caller: Alice→BobPay, Bob→AlicePay ``` </details> <!-- greptile_other_comments_section --> <sub>Reviews (1): Last reviewed commit: ["Update roster.py"](https://github.com/drape-io/crbench-greptile-2026-09/commit/16e8fca45d5f7719bac56ad1d606d1b855d89de4) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=64284130)</sub>
Mjolnir (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact high
Before this change, team_members kept the original order (list(members)). Now it sorts by name, but pay_slips still zips the result with amounts that its docstring says are in the members' original order. So any input that isn't already alphabetical pays members the wrong amounts. [grounded: diff] [consensus 3/3: valid=3]
raw comments (2)
roster.py:3
[P1] Sorting team_members pairs pay amounts with the wrong members `payroll.pay_slips` builds its names from `team_members(members)` and zips them with `amounts`, and its docstring says `amounts` is in the members' original order. Before this change `team_members` kept the input order. Now it sorts by name, so whenever the input isn't already alphabetical, each pay amount is matched to the wrong person. For example, with members `[Zoe, Adam]` and amounts `[100, 200]`, the result is `{Adam: 100, Zoe: 200}`. That pays people the wrong amounts without raising any error. Either sort somewhere other than this shared helper, or update `pay_slips` to pair amounts with members in their original order before sorting.
roster.py:3
[P1] Sorting in team_members misassigns pay in pay_slips `payroll.pay_slips` zips `team_members(members)` with `amounts`, and its docstring says `amounts` follows the members' original order. With this change `team_members` returns the members sorted by name, so the pairing is off whenever the input isn't already alphabetical. For example, members `[Bob, Alice]` with amounts `[100, 200]` used to produce `{Bob: 100, Alice: 200}` and now produce `{Alice: 100, Bob: 200}`, so people get paid the wrong amount. To keep payroll correct, either sort in the callers that need sorting or update `pay_slips` so it no longer relies on the order `team_members` returns.
Mjolnir (Sonnet 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact high
pay_slips zips the names from team_members with amounts, and its docstring says amounts are in the original order. Since the change makes team_members sort its output, any input that isn't already alphabetical now pairs people with the wrong pay amounts, and nothing reports an error. [grounded: tree payroll.py] [consensus 3/3: valid=3]
raw comments (2)
roster.py:3
[P1] Sorting team_members breaks positional pay mapping team_members` now returns members sorted by name, but `payroll.pay_slips` (payroll.py:6-7) zips `team_members(members)` names against `amounts`, which its docstring says is in the members' original order. If the input isn't already alphabetical (e.g. members [Zoe, Alice] with amounts [100, 200]), Alice gets 100 and Zoe gets 200, so people are silently paid the wrong amounts. Either `pay_slips` must stop depending on the sorted order, for example by zipping the original `members`, or sorting must be done by callers that want it
roster.py:3
[P1] Sorting team_members misaligns pay_slips amounts `team_members` now returns members sorted by name instead of in input order. `payroll.pay_slips` (payroll.py:5-6) calls `team_members(members)` and zips the resulting names with `amounts`, which its docstring says is "in the members' original order". When the input isn't already alphabetical, for example members `[Bob, Alice]` with amounts `[100, 200]`, names become `[Alice, Bob]` and the result is `{Alice: 100, Bob: 200}`. That assigns each person the other's pay. The failure is silent, with no error, and it affects payroll amounts. Either `pay_slips` has to stop depending on `team_members` ordering, or the sorting has to go somewhere that doesn't feed positional consumers.
qodo · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (3)
roster.py:3
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> 1\. Payroll assigns amounts to the wrong people <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> <b><i>team_members</i></b> now alphabetizes the members before <b><i>pay_slips</i></b> extracts their names, while <b><i>amounts</i></b> remains in the callers&#x27; original order. Any roster whose original order differs from alphabetical order pairs each amount with the wrong employee in the returned payroll dictionary. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ### Issue description `team_members` now returns members sorted by name, but `pay_slips` documents and uses `amounts` in the members' original order. When the input is not alphabetically ordered, sorting names before zipping assigns each payment amount to the wrong member. ### Fix Focus Areas - roster.py[1-3] - payroll.py[4-7] ### Recommended Fix Preserve the original member order in the function used by payroll, or update the payroll flow so the amounts are reordered using the same member sort. Add a regression test with members whose input order differs from alphabetical order and verify that each amount remains associated with the intended member. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details>
PR-level
<h3>Code Review by Qodo</h3> <code>🐞 Bugs (1)</code> <code>📘 Rule violations (0)</code> <code>📜 Skill insights (0)</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <br/> <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> <details> <summary> 1. Payroll assigns amounts to the wrong people <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>team_members</i></b> now alphabetizes the members before <b><i>pay_slips</i></b> extracts their names, while <b><i>amounts</i></b> >remains in the callers&#x27; original order. Any roster whose original order differs from alphabetical >order pairs each amount with the wrong employee in the returned payroll dictionary. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[roster.py[3]](https://github.com/drape-io/crbench-qodo-2026-09/pull/8/files#diff-0d4009e0d9ac78ec0b919482ad35edbec2e98a8c3734d1d8c255e4c78e9b5828R3-R3)</code> > >```diff >+ return sorted(members, key=lambda m: m["name"]) >``` ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >### Issue description >`team_members` now returns members sorted by name, but `pay_slips` documents and uses `amounts` in the members' original order. When the input is not alphabetically ordered, sorting names before zipping assigns each payment amount to the wrong member. > >### Fix Focus Areas >- roster.py[1-3] >- payroll.py[4-7] > >### Recommended Fix >Preserve the original member order in the function used by payroll, or update the payroll flow so the amounts are reordered using the same member sort. Add a regression test with members whose input order differs from alphabetical order and verify that each amount remains associated with the intended member. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> <hr/> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-context:start --> <details><summary><strong>Context sources</strong></summary> <div>Review mode: <code>🚀 Fast</code>: This is a small, localized behavioral change to sort roster members by a presumed name key, with no high-risk or broad blast radius.</div> <!-- qodo-context:end --> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:start --> <details> <summary><strong>Tip of the day</strong></summary> <br/> <pre>💡 Did you know, you can reply &#x27;qodo&#x27; on any finding to push back, ask questions, or dig deeper</pre> <a href="https://docs.qodo.ai/tips-and-tricks">More tips ↗</a> | <a href="https://app.qodo.ai/configurations?tab=display-preferences">Customize Qodo ↗</a> | <a href="https://docs.qodo.ai">Qodo docs ↗</a> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:end --> <!-- https://github.com/drape-io/crbench-qodo-2026-09/commit/095bae980fe51951395abf2acfc621df461939f3 --> <a href="https://www.qodo.ai"><img src="https://www.qodo.ai/wp-content/uploads/2025/03/qodo-logo.svg" width="80" alt="Qodo Logo"></a>
PR-level
<h3>PR Summary by Qodo</h3> Sort team members alphabetically by name <code>✨ Enhancement</code> <code>🕐 Less than 10 minutes</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <details> <summary>AI Description</summary> <dl> <dd> <br/> ><pre> >• Sorts returned team members alphabetically using each member’s <b><i>name</i></b> field. >• Documents the new alphabetical ordering guarantee. ></pre> </dd> </dl> </details> <details> <summary>Diagram</summary> <dl> <dd> <br/> ```mermaid graph TD M["Member records"] --> R["team_members"] --> S["Sorted members"] --> P["pay_slips"] --> O["Pay mapping"] A["Original amounts"] --> P ``` </dd> </dl> </details> <details> <summary>High-Level Assessment</summary> <dl> <dd> <br/> >The following are alternative approaches to this PR: <details> <summary><b>1. Sort only at presentation boundaries</b></summary> <dl> <dd> - ➕ Preserves the existing positional contract used by payroll - ➕ Still supports alphabetized roster displays - ➖ Callers requiring sorting must apply it explicitly </dd> </dl> </details> <details> <summary><b>2. Pair members with amounts before sorting</b></summary> <dl> <dd> - ➕ Keeps each amount associated with the correct member - ➕ Allows payroll output to remain alphabetical - ➖ Requires changing payroll processing rather than only roster.py </dd> </dl> </details> >**Recommendation:** Do not sort the shared `team_members` result without updating payroll behavior. Because `pay_slips` receives amounts in the members’ original order, sorting names before `zip` can assign pay to the wrong people. Prefer sorting only for display, or pair members with amounts before sorting. </dd> </dl> </details> <details> <summary> Files changed (1) <code> +2 / -2 </code> </summary> <dl> <dd> <br/> <details> <summary>Enhancement (1) <code> +2 / -2 </code></summary> <dl> <dd> <details> <summary>roster.py<code>Return team members in alphabetical order</code> <code>+2/-2</code></summary> <br/> >Return team members in alphabetical order > ><pre> >• Changes &#x27;team_members&#x27; from preserving iterable order to sorting member dictionaries by their &#x27;name&#x27; value. The docstring now documents the alphabetical ordering guarantee. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/8/files#diff-0d4009e0d9ac78ec0b919482ad35edbec2e98a8c3734d1d8c255e4c78e9b5828'>roster.py</a> </details> </dd> </dl> </details> </dd> </dl> </details>