{"summary":{"benchmark":"Martian's Code Review Bench, offline set","benchmark_repository":"https://github.com/withmartian/code-review-benchmark","tool":"mergestorm-vortex-swarm","mode":"Swarm","show_secondary_findings_on_the_pr":false,"secondary_findings_not_shown":{"findings":83,"pull_requests":24},"judge":"the benchmark's GPT-5.2 judge","runs":1,"date":"2026-12-05","leaderboard_entry":false,"development_set_score":true,"pull_requests":50,"comments":{"inline":151,"outside_the_changed_lines_in_the_review_body":2,"total":153},"candidates":164,"totals":{"strict":{"items":139,"hits":96,"false_alarms":56,"misses":43,"precision":63.16,"recall":69.06,"f1":65.98,"f2":67.8},"core":{"items":158,"hits":103,"false_alarms":56,"misses":55,"precision":64.78,"recall":65.19,"f1":64.98,"f2":65.11},"all":{"items":173,"hits":106,"false_alarms":56,"misses":67,"precision":65.43,"recall":61.27,"f1":63.28,"f2":62.06}},"core_by_project":{"cal_dot_com":{"name":"Cal.com","pull_requests":10,"items":37,"hits":27,"false_alarms":13,"misses":10,"precision":67.5,"recall":72.97,"f1":70.13,"f2":71.81},"discourse":{"name":"Discourse","pull_requests":10,"items":38,"hits":23,"false_alarms":15,"misses":15,"precision":60.53,"recall":60.53,"f1":60.53,"f2":60.53},"grafana":{"name":"Grafana","pull_requests":10,"items":25,"hits":16,"false_alarms":11,"misses":9,"precision":59.26,"recall":64.0,"f1":61.54,"f2":62.99},"keycloak":{"name":"Keycloak","pull_requests":10,"items":25,"hits":16,"false_alarms":8,"misses":9,"precision":66.67,"recall":64.0,"f1":65.31,"f2":64.52},"sentry":{"name":"Sentry","pull_requests":10,"items":33,"hits":21,"false_alarms":9,"misses":12,"precision":70.0,"recall":63.64,"f1":66.67,"f2":64.81}},"core_by_severity":{"Critical":{"items":12,"hits":9,"misses":3,"recall":75.0},"High":{"items":54,"hits":41,"misses":13,"recall":75.93},"Medium":{"items":59,"hits":40,"misses":19,"recall":67.8},"Low":{"items":33,"hits":13,"misses":20,"recall":39.39}}},"reviews":{"cal_dot_com__cal.com__PR10600":{"pull_request":"https://github.com/calcom/cal.com/pull/10600","project":"Cal.com","review_body":"**Vortex: changes requested, 2 issues to fix** at `54486a0` \u00b7 16/16 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udd34 **Blocker** \u00b7 **Password check skipped when backupCode and totpCode are both sent** \u00b7 `packages/features/auth/lib/next-auth-options.ts:131`\n- \ud83d\udfe0 **Important** \u00b7 **The backup code is read, checked, then overwritten via \\`prisma.user.update\\` non-atomically, so tw...** \u00b7 `packages/features/auth/lib/next-auth-options.ts:149`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@packages/features/auth/lib/next-auth-options.ts` (line 131, Blocker):\n   `if (user.password && !credentials.totpCode)` (line 121) gates password verification on `totpCode` being empty, and the new `user.twoFactorEnabled && credentials.backupCode` branch does not verify the password itself. A direct credentials POST with a valid backup code plus any non-empty `totpCode` therefore authenticates without the password. The UI clears `totpCode` in lost-access mode, so this is only reachable by calling the endpoint directly, but it is still an auth bypass. Verify the password whenever `user.password` is set and the request is not a pure TOTP step.\n\n2. In `@packages/features/auth/lib/next-auth-options.ts` (line 149, Important):\n   The backup code is read, checked, then overwritten via `prisma.user.update` non-atomically, so two concurrent logins with the same code can both succeed. Use a conditional `updateMany` on the previously read `backupCodes` (or a transaction) and fail if no row updates.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 3 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"packages/features/auth/lib/next-auth-options.ts","line":131,"body":"\ud83d\udd34 **Blocker**\n\n**Password check skipped when backupCode and totpCode are both sent**\n\n`if (user.password && !credentials.totpCode)` (line 121) gates password verification on `totpCode` being empty, and the new `user.twoFactorEnabled && credentials.backupCode` branch does not verify the password itself. A direct credentials POST with a valid backup code plus any non-empty `totpCode` therefore authenticates without the password. The UI clears `totpCode` in lost-access mode, so this is only reachable by calling the endpoint directly, but it is still an auth bypass. Verify the password whenever `user.password` is set and the request is not a pure TOTP step."},{"path":"packages/features/auth/lib/next-auth-options.ts","line":149,"body":"\ud83d\udfe0 **Important**\n\n**The backup code is read, checked, then overwritten via `prisma.user.update` non-atomically, so tw...**\n\nThe backup code is read, checked, then overwritten via `prisma.user.update` non-atomically, so two concurrent logins with the same code can both succeed. Use a conditional `updateMany` on the previously read `backupCodes` (or a transaction) and fail if no row updates."}]},"cal_dot_com__cal.com__PR10967":{"pull_request":"https://github.com/calcom/cal.com/pull/10967","project":"Cal.com","review_body":"**Vortex: changes requested, 6 issues to fix** at `de62829` \u00b7 22/22 files reviewed\n\nActionable comments posted: 6\n\n- \ud83d\udd34 **Blocker** \u00b7 **updateEvent loses the destination calendar when externalCalendarId is null** \u00b7 `packages/app-store/googlecalendar/lib/CalendarService.ts:256`\n- \ud83d\udd34 **Blocker** \u00b7 **deleteEvent always falls back to primary calendar** \u00b7 `packages/app-store/googlecalendar/lib/CalendarService.ts:317`\n- \ud83d\udd34 **Blocker** \u00b7 **\\`mainHostDestinationCalendar\\` is undefined when \\`evt.destinationCalendar\\` is undefined or \\`\\[\\]\\`, s...** \u00b7 `packages/core/EventManager.ts:119`\n- \ud83d\udd34 **Blocker** \u00b7 **\\`...(IS\\_TEAM\\_BILLING\\_ENABLED ? { slug } : {})\\` inverts the original \\`!IS\\_TEAM\\_BILLING\\_ENABLED &amp;&amp; ...** \u00b7 `packages/trpc/server/routers/viewer/organizations/create.handler.ts:151`\n- \ud83d\udfe0 **Important** \u00b7 **The recurring-delete branch (all credentials \u00d7 all updated bookings) at handleCancelBooking.ts:44...** \u00b7 `packages/features/bookings/lib/handleCancelBooking.ts:449`\n- \ud83d\udfe0 **Important** \u00b7 **\\`evt.destinationCalendar?.push(...teamDestinationCalendars)\\` is skipped when \\`evt.destinationCale...** \u00b7 `packages/features/bookings/lib/handleNewBooking.ts:1078`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (6 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@packages/app-store/googlecalendar/lib/CalendarService.ts` (line 256, Blocker):\n   In `updateEvent`, `destinationCalendar?.find((cal) => cal.externalId === externalCalendarId)` runs only when `externalCalendarId` is falsy, so it matches nothing and `calendar.events.update` gets no `calendarId`. Restore `event.destinationCalendar?.externalId` or match by the intended value.\n\n2. In `@packages/app-store/googlecalendar/lib/CalendarService.ts` (line 317, Blocker):\n   `CalendarManager.deleteEvent` never passes `externalCalendarId`, so the `find` in `deleteEvent` matches nothing and `calendarId` falls back to `\"primary\"`. Events on non-primary destination calendars are not deleted; use the destination calendar's externalId directly.\n\n3. In `@packages/core/EventManager.ts` (line 119, Blocker):\n   `mainHostDestinationCalendar` is undefined when `evt.destinationCalendar` is undefined or `[]`, so `mainHostDestinationCalendar.integration` throws a TypeError for Google Meet. Use `mainHostDestinationCalendar?.integration` so it falls back to Cal Video.\n\n4. In `@packages/trpc/server/routers/viewer/organizations/create.handler.ts` (line 151, Blocker):\n   `...(IS_TEAM_BILLING_ENABLED ? { slug } : {})` inverts the original `!IS_TEAM_BILLING_ENABLED && { slug }`. With billing enabled the org takes the slug immediately, and with billing disabled it gets none; restore the `!`.\n\n5. In `@packages/features/bookings/lib/handleCancelBooking.ts` (line 449, Important):\n   The recurring-delete branch (all credentials \u00d7 all updated bookings) at handleCancelBooking.ts:449 runs inside the per-reference loop, so with multiple calendar references the same deleteEvent pass repeats per reference. Hoist it outside the loop and run it once.\n\n6. In `@packages/features/bookings/lib/handleNewBooking.ts` (line 1078, Important):\n   `evt.destinationCalendar?.push(...teamDestinationCalendars)` is skipped when `evt.destinationCalendar` is `null`, silently dropping collective team members' calendars. Initialize it to `[]` or assign the team calendars when null.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 6 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"packages/app-store/googlecalendar/lib/CalendarService.ts","line":256,"body":"\ud83d\udd34 **Blocker**\n\n**updateEvent loses the destination calendar when externalCalendarId is null**\n\nIn `updateEvent`, `destinationCalendar?.find((cal) => cal.externalId === externalCalendarId)` runs only when `externalCalendarId` is falsy, so it matches nothing and `calendar.events.update` gets no `calendarId`. Restore `event.destinationCalendar?.externalId` or match by the intended value."},{"path":"packages/app-store/googlecalendar/lib/CalendarService.ts","line":317,"body":"\ud83d\udd34 **Blocker**\n\n**deleteEvent always falls back to primary calendar**\n\n`CalendarManager.deleteEvent` never passes `externalCalendarId`, so the `find` in `deleteEvent` matches nothing and `calendarId` falls back to `\"primary\"`. Events on non-primary destination calendars are not deleted; use the destination calendar's externalId directly."},{"path":"packages/core/EventManager.ts","line":119,"body":"\ud83d\udd34 **Blocker**\n\n**`mainHostDestinationCalendar` is undefined when `evt.destinationCalendar` is undefined or `[]`, s...**\n\n`mainHostDestinationCalendar` is undefined when `evt.destinationCalendar` is undefined or `[]`, so `mainHostDestinationCalendar.integration` throws a TypeError for Google Meet. Use `mainHostDestinationCalendar?.integration` so it falls back to Cal Video."},{"path":"packages/trpc/server/routers/viewer/organizations/create.handler.ts","line":151,"body":"\ud83d\udd34 **Blocker**\n\n**`...(IS_TEAM_BILLING_ENABLED ? { slug } : {})` inverts the original `!IS_TEAM_BILLING_ENABLED && ...**\n\n`...(IS_TEAM_BILLING_ENABLED ? { slug } : {})` inverts the original `!IS_TEAM_BILLING_ENABLED && { slug }`. With billing enabled the org takes the slug immediately, and with billing disabled it gets none; restore the `!`."},{"path":"packages/features/bookings/lib/handleCancelBooking.ts","line":449,"body":"\ud83d\udfe0 **Important**\n\n**The recurring-delete branch (all credentials \u00d7 all updated bookings) at handleCancelBooking.ts:44...**\n\nThe recurring-delete branch (all credentials \u00d7 all updated bookings) at handleCancelBooking.ts:449 runs inside the per-reference loop, so with multiple calendar references the same deleteEvent pass repeats per reference. Hoist it outside the loop and run it once."},{"path":"packages/features/bookings/lib/handleNewBooking.ts","line":1078,"body":"\ud83d\udfe0 **Important**\n\n**`evt.destinationCalendar?.push(...teamDestinationCalendars)` is skipped when `evt.destinationCale...**\n\n`evt.destinationCalendar?.push(...teamDestinationCalendars)` is skipped when `evt.destinationCalendar` is `null`, silently dropping collective team members' calendars. Initialize it to `[]` or assign the team calendars when null."}]},"cal_dot_com__cal.com__PR11059":{"pull_request":"https://github.com/calcom/cal.com/pull/11059","project":"Cal.com","review_body":"**Vortex: changes requested, 12 issues to fix** at `9fde0e9` \u00b7 40/40 files reviewed\n\nActionable comments posted: 12\n\n- \ud83d\udd34 **Blocker** \u00b7 **\\`\\[z.string().toString()\\]: z.number()\\` produces the literal key &quot;\\[object Object\\]&quot;, so \\`minimumToke...** \u00b7 `packages/app-store/_utils/oauth/parseRefreshTokenResponse.ts:8`\n- \ud83d\udd34 **Blocker** \u00b7 **In sync mode \\`refreshOAuthTokens\\` returns the raw fetch \\`Response\\`, but callers (Google, Lark, Zo...** \u00b7 `packages/app-store/_utils/oauth/refreshOAuthTokens.ts:15`\n- \ud83d\udd34 **Blocker** \u00b7 **\\`parseRefreshTokenResponse\\` returns the zod SafeParse result (\\`{success, data}\\`), yet it is saved...** \u00b7 `packages/app-store/googlecalendar/lib/CalendarService.ts:97`\n- \ud83d\udd34 **Blocker** \u00b7 **With credential sync enabled, \\`refreshOAuthTokens\\` returns the raw fetch \\`Response\\`, but hubspot ...** \u00b7 `packages/app-store/hubspot/lib/CalendarService.ts:177`\n- \ud83d\udd34 **Blocker** \u00b7 **\\`response.statusText !== &quot;OK&quot;\\` treats a successful refresh as failure when the reason phrase isn&#39;...** \u00b7 `packages/app-store/salesforce/lib/CalendarService.ts:86`\n- \ud83d\udd34 **Blocker** \u00b7 **\\`await prisma.credential.update(...)\\`** \u00b7 `packages/app-store/salesforce/lib/CalendarService.ts:96`\n- \ud83d\udd34 **Blocker** \u00b7 **\\`credentialId\\` is passed as the third argument, but \\`refreshOAuthTokens\\` expects the Cal.com \\`use...** \u00b7 `packages/app-store/zoho-bigin/lib/CalendarService.ts:93`\n- \ud83d\udfe0 **Important** \u00b7 **\\`appCredentialWebhookRequestBodySchema.parse(req.body)\\`** \u00b7 `apps/web/pages/api/webhook/app-credential.ts:31`\n- \ud83d\udd34 **Blocker** \u00b7 **Do not replace the refresh token with a placeholder** \u00b7 `packages/app-store/_utils/oauth/parseRefreshTokenResponse.ts:25`\n- \ud83d\udfe0 **Important** \u00b7 **Normalize the sync response for Lark&#39;s token handler** \u00b7 `packages/app-store/larkcalendar/lib/CalendarService.ts:67`\n- \ud83d\udfe0 **Important** \u00b7 **With sync enabled, \\`refreshOAuthTokens\\` returns the raw sync-endpoint response without any \\`respo...** \u00b7 `packages/app-store/office365video/lib/VideoApiAdapter.ts:61`\n- \ud83d\udfe0 **Important** \u00b7 **Initialize the connection with the refreshed token** \u00b7 `packages/app-store/salesforce/lib/CalendarService.ts:98`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (12 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@packages/app-store/_utils/oauth/parseRefreshTokenResponse.ts` (line 8, Blocker):\n   `[z.string().toString()]: z.number()` produces the literal key \"[object Object]\", so `minimumTokenResponseSchema` requires a numeric \"[object Object]\" property and every sync-mode parse throws. Use `z.object({access_token: z.string()}).passthrough()` and check expiry explicitly.\n\n2. In `@packages/app-store/_utils/oauth/refreshOAuthTokens.ts` (line 15, Blocker):\n   In sync mode `refreshOAuthTokens` returns the raw fetch `Response`, but callers (Google, Lark, Zoho CRM) read `.data`, which is undefined, so `token.access_token` throws. Check `response.ok`, parse with `await response.json()`, and return the expected shape.\n\n3. In `@packages/app-store/googlecalendar/lib/CalendarService.ts` (line 97, Blocker):\n   `parseRefreshTokenResponse` returns the zod SafeParse result (`{success, data}`), yet it is saved as the credential `key` in `prisma.credential.update`. The next `googleCredentialSchema.parse(credential.key)` then fails; use `key.data`.\n\n4. In `@packages/app-store/hubspot/lib/CalendarService.ts` (line 177, Blocker):\n   With credential sync enabled, `refreshOAuthTokens` returns the raw fetch `Response`, but hubspot `refreshAccessToken` uses it as a `HubspotToken`. `expiresIn`/`accessToken` are undefined, so expiry is NaN; parse the body with `.json()` first.\n\n5. In `@packages/app-store/salesforce/lib/CalendarService.ts` (line 86, Blocker):\n   `response.statusText !== \"OK\"` treats a successful refresh as failure when the reason phrase isn't exactly \"OK\" (e.g. empty under HTTP/2), throwing `HttpError`. Check `!response.ok` instead.\n\n6. In `@packages/app-store/salesforce/lib/CalendarService.ts` (line 96, Blocker):\n   `prisma` is never imported in this file (the imports list has no `@calcom/prisma`), so this throws a ReferenceError (or fails type-check) on every client creation. Add `import prisma from \"@calcom/prisma\"`.\n\n7. In `@packages/app-store/zoho-bigin/lib/CalendarService.ts` (line 93, Blocker):\n   `credentialId` is passed as the third argument, but `refreshOAuthTokens` expects the Cal.com `userId`. With credential sync enabled, the sync endpoint receives the credential ID as `calcomUserId`; pass the credential's `userId` instead.\n\n8. In `@apps/web/pages/api/webhook/app-credential.ts` (line 31, Important):\n   `parse` throws a ZodError on a malformed body, and nothing catches it, so the route returns a 500. Use `safeParse` and return a 400.\n\n9. In `@packages/app-store/_utils/oauth/parseRefreshTokenResponse.ts` (line 25, Blocker):\n   `parseRefreshTokenResponse` overwrites a missing `refresh_token` with the literal \"refresh_token\" (always in sync mode, since the minimum schema strips it). Callers that persist it, like Zoom and Office 365, lose the real token; don't substitute a placeholder.\n\n10. In `@packages/app-store/larkcalendar/lib/CalendarService.ts` (line 67, Important):\n   With credential sync enabled, `refreshOAuthTokens` returns the sync endpoint's payload (access token and expiry only). `handleLarkError` then expects Lark's `{ code: 0, data }` envelope, so the Lark refresh fails; normalize the payload before line 84.\n\n11. In `@packages/app-store/office365video/lib/VideoApiAdapter.ts` (line 61, Important):\n   With sync enabled, `refreshOAuthTokens` returns the raw sync-endpoint response without any `response.ok` check, but the following code assumes a Microsoft-shaped body with `expires_in`. A different expiry field gives `expiry_date = now`, so the token refreshes on every call; validate and parse the response.\n\n12. In `@packages/app-store/salesforce/lib/CalendarService.ts` (line 98, Important):\n   The `jsforce.Connection` is built from `credentialKey.access_token` and `credentialKey.instance_url` (pre-refresh) instead of `accessTokenParsed.data`, so an expired access token is used. Use the refreshed values.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 2 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"packages/app-store/_utils/oauth/parseRefreshTokenResponse.ts","line":8,"body":"\ud83d\udd34 **Blocker**\n\n**`[z.string().toString()]: z.number()` produces the literal key \"[object Object]\", so `minimumToke...**\n\n`[z.string().toString()]: z.number()` produces the literal key \"[object Object]\", so `minimumTokenResponseSchema` requires a numeric \"[object Object]\" property and every sync-mode parse throws. Use `z.object({access_token: z.string()}).passthrough()` and check expiry explicitly."},{"path":"packages/app-store/_utils/oauth/refreshOAuthTokens.ts","line":15,"body":"\ud83d\udd34 **Blocker**\n\n**In sync mode `refreshOAuthTokens` returns the raw fetch `Response`, but callers (Google, Lark, Zo...**\n\nIn sync mode `refreshOAuthTokens` returns the raw fetch `Response`, but callers (Google, Lark, Zoho CRM) read `.data`, which is undefined, so `token.access_token` throws. Check `response.ok`, parse with `await response.json()`, and return the expected shape."},{"path":"packages/app-store/googlecalendar/lib/CalendarService.ts","line":97,"body":"\ud83d\udd34 **Blocker**\n\n**`parseRefreshTokenResponse` returns the zod SafeParse result (`{success, data}`), yet it is saved...**\n\n`parseRefreshTokenResponse` returns the zod SafeParse result (`{success, data}`), yet it is saved as the credential `key` in `prisma.credential.update`. The next `googleCredentialSchema.parse(credential.key)` then fails; use `key.data`."},{"path":"packages/app-store/hubspot/lib/CalendarService.ts","line":177,"body":"\ud83d\udd34 **Blocker**\n\n**With credential sync enabled, `refreshOAuthTokens` returns the raw fetch `Response`, but hubspot ...**\n\nWith credential sync enabled, `refreshOAuthTokens` returns the raw fetch `Response`, but hubspot `refreshAccessToken` uses it as a `HubspotToken`. `expiresIn`/`accessToken` are undefined, so expiry is NaN; parse the body with `.json()` first."},{"path":"packages/app-store/salesforce/lib/CalendarService.ts","line":86,"body":"\ud83d\udd34 **Blocker**\n\n**`response.statusText !== \"OK\"` treats a successful refresh as failure when the reason phrase isn'...**\n\n`response.statusText !== \"OK\"` treats a successful refresh as failure when the reason phrase isn't exactly \"OK\" (e.g. empty under HTTP/2), throwing `HttpError`. Check `!response.ok` instead."},{"path":"packages/app-store/salesforce/lib/CalendarService.ts","line":96,"body":"\ud83d\udd34 **Blocker**\n\n**`await prisma.credential.update(...)`**\n\n`prisma` is never imported in this file (the imports list has no `@calcom/prisma`), so this throws a ReferenceError (or fails type-check) on every client creation. Add `import prisma from \"@calcom/prisma\"`."},{"path":"packages/app-store/zoho-bigin/lib/CalendarService.ts","line":93,"body":"\ud83d\udd34 **Blocker**\n\n**`credentialId` is passed as the third argument, but `refreshOAuthTokens` expects the Cal.com `use...**\n\n`credentialId` is passed as the third argument, but `refreshOAuthTokens` expects the Cal.com `userId`. With credential sync enabled, the sync endpoint receives the credential ID as `calcomUserId`; pass the credential's `userId` instead."},{"path":"apps/web/pages/api/webhook/app-credential.ts","line":31,"body":"\ud83d\udfe0 **Important**\n\n**`appCredentialWebhookRequestBodySchema.parse(req.body)`**\n\n`parse` throws a ZodError on a malformed body, and nothing catches it, so the route returns a 500. Use `safeParse` and return a 400."},{"path":"packages/app-store/_utils/oauth/parseRefreshTokenResponse.ts","line":25,"body":"\ud83d\udd34 **Blocker**\n\n**Do not replace the refresh token with a placeholder**\n\n`parseRefreshTokenResponse` overwrites a missing `refresh_token` with the literal \"refresh_token\" (always in sync mode, since the minimum schema strips it). Callers that persist it, like Zoom and Office 365, lose the real token; don't substitute a placeholder."},{"path":"packages/app-store/larkcalendar/lib/CalendarService.ts","line":67,"body":"\ud83d\udfe0 **Important**\n\n**Normalize the sync response for Lark's token handler**\n\nWith credential sync enabled, `refreshOAuthTokens` returns the sync endpoint's payload (access token and expiry only). `handleLarkError` then expects Lark's `{ code: 0, data }` envelope, so the Lark refresh fails; normalize the payload before line 84."},{"path":"packages/app-store/office365video/lib/VideoApiAdapter.ts","line":61,"body":"\ud83d\udfe0 **Important**\n\n**With sync enabled, `refreshOAuthTokens` returns the raw sync-endpoint response without any `respo...**\n\nWith sync enabled, `refreshOAuthTokens` returns the raw sync-endpoint response without any `response.ok` check, but the following code assumes a Microsoft-shaped body with `expires_in`. A different expiry field gives `expiry_date = now`, so the token refreshes on every call; validate and parse the response."},{"path":"packages/app-store/salesforce/lib/CalendarService.ts","line":98,"body":"\ud83d\udfe0 **Important**\n\n**Initialize the connection with the refreshed token**\n\nThe `jsforce.Connection` is built from `credentialKey.access_token` and `credentialKey.instance_url` (pre-refresh) instead of `accessTokenParsed.data`, so an expired access token is used. Use the refreshed values."}]},"cal_dot_com__cal.com__PR14740":{"pull_request":"https://github.com/calcom/cal.com/pull/14740","project":"Cal.com","review_body":"**Vortex: changes requested, 4 issues to fix** at `92f44dc` \u00b7 15/15 files reviewed\n\nActionable comments posted: 4\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`isTeamAdminOrOwner\\` combines \\`isTeamAdmin(...) &amp;&amp; isTeamOwner(...)\\`, which reduces to owner-only...** \u00b7 `packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts:48`\n- \ud83d\udd34 **Blocker** \u00b7 **Deduplicate addresses within the request** \u00b7 `packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts:74`\n- \ud83d\udfe0 **Important** \u00b7 **The blacklist check uses raw \\`guest\\` against lowercased \\`blacklistedGuestEmails\\`, so \\`Spam&#64;Exampl...** \u00b7 `packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts:77`\n- \ud83d\udfe0 **Important** \u00b7 **\\`sendAddGuestsEmails(evt, guests)\\` passes the raw input instead of \\`uniqueGuests\\`, so already-pre...** \u00b7 `packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts:168`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (4 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts` (line 48, Important):\n   `isTeamAdminOrOwner` combines `isTeamAdmin(...) && isTeamOwner(...)`, which reduces to owner-only, so team admins get FORBIDDEN. Use `||`.\n\n2. In `@packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts` (line 74, Blocker):\n   The `uniqueGuests` filter only checks against existing booking attendees, so duplicate addresses within one `guests` request both survive and `createMany` inserts duplicate attendees. Deduplicate the input first.\n\n3. In `@packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts` (line 77, Important):\n   The blacklist check uses raw `guest` against lowercased `blacklistedGuestEmails`, so `Spam@Example.com` bypasses the blacklist. Lowercase `guest` before `includes`.\n\n4. In `@packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts` (line 168, Important):\n   `sendAddGuestsEmails(evt, guests)` passes the raw input instead of `uniqueGuests`, so already-present guests re-submitted get a full AttendeeScheduledEmail instead of the add-guests email. Pass `uniqueGuests`.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 3 more findings are kept in notes and are not shown on this PR.\n\n---\n**Notes outside the changed lines (1)** \u2014 PR-level notes, not findings:\n\n\ud83d\udca1 **Suggestion**\n\n**Any attendee can invite arbitrary addresses to the booking**\n\nDecision required: any non-organizer attendee passes the `isAttendee` check and can add arbitrary emails. Those new guests then receive the event details, location, and video link in the invite. If attendees should be able to add guests, this is fine; if only organizers and team admins should, the `isAttendee` clause should be removed. Pick based on the intended product permissions.","inline_comments":[{"path":"packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts","line":48,"body":"\ud83d\udfe0 **Important**\n\n**`isTeamAdminOrOwner` combines `isTeamAdmin(...) && isTeamOwner(...)`, which reduces to owner-only...**\n\n`isTeamAdminOrOwner` combines `isTeamAdmin(...) && isTeamOwner(...)`, which reduces to owner-only, so team admins get FORBIDDEN. Use `||`."},{"path":"packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts","line":74,"body":"\ud83d\udd34 **Blocker**\n\n**Deduplicate addresses within the request**\n\nThe `uniqueGuests` filter only checks against existing booking attendees, so duplicate addresses within one `guests` request both survive and `createMany` inserts duplicate attendees. Deduplicate the input first."},{"path":"packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts","line":77,"body":"\ud83d\udfe0 **Important**\n\n**The blacklist check uses raw `guest` against lowercased `blacklistedGuestEmails`, so `Spam@Exampl...**\n\nThe blacklist check uses raw `guest` against lowercased `blacklistedGuestEmails`, so `Spam@Example.com` bypasses the blacklist. Lowercase `guest` before `includes`."},{"path":"packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts","line":168,"body":"\ud83d\udfe0 **Important**\n\n**`sendAddGuestsEmails(evt, guests)` passes the raw input instead of `uniqueGuests`, so already-pre...**\n\n`sendAddGuestsEmails(evt, guests)` passes the raw input instead of `uniqueGuests`, so already-present guests re-submitted get a full AttendeeScheduledEmail instead of the add-guests email. Pass `uniqueGuests`."}]},"cal_dot_com__cal.com__PR14943":{"pull_request":"https://github.com/calcom/cal.com/pull/14943","project":"Cal.com","review_body":"**Vortex: 3 issues to fix** at `c790227` \u00b7 3/3 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`retryCount: { gt: 1 }\\` sits in its own OR branch without a \\`method: WorkflowMethods.SMS\\` filter,...** \u00b7 `packages/features/ee/workflows/api/scheduleSMSReminders.ts:39`\n- \ud83d\udfe0 **Important** \u00b7 **Increment retryCount atomically** \u00b7 `packages/features/ee/workflows/api/scheduleSMSReminders.ts:184`\n- \ud83d\udfe0 **Important** \u00b7 **The \\`prisma.workflowReminder.update\\` in the \\`catch\\` block has no try of its own. If the reminder ...** \u00b7 `packages/features/ee/workflows/api/scheduleSMSReminders.ts:190`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@packages/features/ee/workflows/api/scheduleSMSReminders.ts` (line 39, Important):\n   `retryCount: { gt: 1 }` sits in its own OR branch without a `method: WorkflowMethods.SMS` filter, so this SMS cron deletes any WorkflowReminder (email, WhatsApp) with retryCount > 1. Move the `method` filter outside the OR or add it to this branch.\n\n2. In `@packages/features/ee/workflows/api/scheduleSMSReminders.ts` (line 184, Important):\n   `retryCount: reminder.retryCount + 1` writes the stale value read by `findMany`; concurrent cron runs that both fail lose an increment, delaying the `retryCount > 1` cleanup. Use Prisma's atomic `{ increment: 1 }` here and in the catch update at line 195.\n\n3. In `@packages/features/ee/workflows/api/scheduleSMSReminders.ts` (line 190, Important):\n   The `prisma.workflowReminder.update` in the `catch` block has no try of its own. If the reminder is deleted after `findMany`, Prisma throws P2025, which escapes the `for` loop and skips the remaining reminders. Wrap it in try/catch or use `updateMany`.\n```\n\n</details>","inline_comments":[{"path":"packages/features/ee/workflows/api/scheduleSMSReminders.ts","line":39,"body":"\ud83d\udfe0 **Important**\n\n**`retryCount: { gt: 1 }` sits in its own OR branch without a `method: WorkflowMethods.SMS` filter,...**\n\n`retryCount: { gt: 1 }` sits in its own OR branch without a `method: WorkflowMethods.SMS` filter, so this SMS cron deletes any WorkflowReminder (email, WhatsApp) with retryCount > 1. Move the `method` filter outside the OR or add it to this branch."},{"path":"packages/features/ee/workflows/api/scheduleSMSReminders.ts","line":184,"body":"\ud83d\udfe0 **Important**\n\n**Increment retryCount atomically**\n\n`retryCount: reminder.retryCount + 1` writes the stale value read by `findMany`; concurrent cron runs that both fail lose an increment, delaying the `retryCount > 1` cleanup. Use Prisma's atomic `{ increment: 1 }` here and in the catch update at line 195."},{"path":"packages/features/ee/workflows/api/scheduleSMSReminders.ts","line":190,"body":"\ud83d\udfe0 **Important**\n\n**The `prisma.workflowReminder.update` in the `catch` block has no try of its own. If the reminder ...**\n\nThe `prisma.workflowReminder.update` in the `catch` block has no try of its own. If the reminder is deleted after `findMany`, Prisma throws P2025, which escapes the `for` loop and skips the remaining reminders. Wrap it in try/catch or use `updateMany`."}]},"cal_dot_com__cal.com__PR22345":{"pull_request":"https://github.com/calcom/cal.com/pull/22345","project":"Cal.com","review_body":"**Vortex: approved, nothing to fix** at `da09bc0` \u00b7 2/2 files reviewed\n\n\u2705 All clear \u2014 nothing to fix. <!-- vortex:all-clear -->\n\n\n<!-- vortex:secondary-findings --> 1 more finding is kept in notes and is not shown on this PR.","inline_comments":[]},"cal_dot_com__cal.com__PR22532":{"pull_request":"https://github.com/calcom/cal.com/pull/22532","project":"Cal.com","review_body":"**Vortex: 5 issues to fix** at `5fd11f9` \u00b7 17/17 files reviewed\n\nActionable comments posted: 5\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`updateManyByCredentialId(this.credential.id, {})\\` passes an empty \\`data\\`, so it relies on Prisma...** \u00b7 `packages/app-store/googlecalendar/lib/CalendarService.ts:1024`\n- \ud83d\udfe0 **Important** \u00b7 **\\`new Intl.DateTimeFormat(&quot;en-US&quot;, ...)\\` hardcodes the locale, so all users see US-style dates. Us...** \u00b7 `packages/features/apps/components/CredentialActionsDropdown.tsx:89`\n- \ud83d\udfe0 **Important** \u00b7 **Feature-flag gate bypassed for cache status** \u00b7 `packages/features/calendar-cache/calendar-cache.repository.mock.ts:27`\n- \ud83d\udfe0 **Important** \u00b7 **\\`throw new Error(&quot;Credential not found or access denied&quot;)\\`** \u00b7 `packages/trpc/server/routers/viewer/calendars/deleteCache.handler.ts:25`\n- \ud83d\udfe0 **Important** \u00b7 **\\`sed -i &#39;&#39; -E ...\\` is BSD/macOS syntax; on GNU sed (Linux) it fails, so GOOGLE\\_WEBHOOK\\_URL is nev...** \u00b7 `scripts/test-gcal-webhooks.sh:68`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (5 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@packages/app-store/googlecalendar/lib/CalendarService.ts` (line 1024, Important):\n   `updateManyByCredentialId(this.credential.id, {})` passes an empty `data`, so it relies on Prisma applying `@updatedAt` to an empty update and may not bump `SelectedCalendar.updatedAt`. Set `updatedAt: new Date()` explicitly.\n\n2. In `@packages/features/apps/components/CredentialActionsDropdown.tsx` (line 89, Important):\n   `new Intl.DateTimeFormat(\"en-US\", ...)` hardcodes the locale, so all users see US-style dates. Use the user's locale, e.g. `i18n.language` from `useLocale`.\n\n3. In `@packages/features/calendar-cache/calendar-cache.repository.mock.ts` (line 27, Important):\n   `connectedCalendars.handler.ts` calls `new CalendarCacheRepository()` directly, bypassing the `calendar-cache` feature check in `CalendarCache.init()`, so `getCacheStatusByCredentialIds` returns `cacheUpdatedAt` with the flag off. Use `CalendarCache.init(null)` instead.\n\n4. In `@packages/trpc/server/routers/viewer/calendars/deleteCache.handler.ts` (line 25, Important):\n   A plain Error reaches the client as INTERNAL_SERVER_ERROR (HTTP 500). Throw a TRPCError with code NOT_FOUND or FORBIDDEN instead.\n\n5. In `@scripts/test-gcal-webhooks.sh` (line 68, Important):\n   `sed -i '' -E ...` is BSD/macOS syntax; on GNU sed (Linux) it fails, so GOOGLE_WEBHOOK_URL is never updated. Use a portable form, such as writing to a temp file and moving it into place.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 3 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"packages/app-store/googlecalendar/lib/CalendarService.ts","line":1024,"body":"\ud83d\udfe0 **Important**\n\n**`updateManyByCredentialId(this.credential.id, {})` passes an empty `data`, so it relies on Prisma...**\n\n`updateManyByCredentialId(this.credential.id, {})` passes an empty `data`, so it relies on Prisma applying `@updatedAt` to an empty update and may not bump `SelectedCalendar.updatedAt`. Set `updatedAt: new Date()` explicitly."},{"path":"packages/features/apps/components/CredentialActionsDropdown.tsx","line":89,"body":"\ud83d\udfe0 **Important**\n\n**`new Intl.DateTimeFormat(\"en-US\", ...)` hardcodes the locale, so all users see US-style dates. Us...**\n\n`new Intl.DateTimeFormat(\"en-US\", ...)` hardcodes the locale, so all users see US-style dates. Use the user's locale, e.g. `i18n.language` from `useLocale`."},{"path":"packages/features/calendar-cache/calendar-cache.repository.mock.ts","line":27,"body":"\ud83d\udfe0 **Important**\n\n**Feature-flag gate bypassed for cache status**\n\n`connectedCalendars.handler.ts` calls `new CalendarCacheRepository()` directly, bypassing the `calendar-cache` feature check in `CalendarCache.init()`, so `getCacheStatusByCredentialIds` returns `cacheUpdatedAt` with the flag off. Use `CalendarCache.init(null)` instead."},{"path":"packages/trpc/server/routers/viewer/calendars/deleteCache.handler.ts","line":25,"body":"\ud83d\udfe0 **Important**\n\n**`throw new Error(\"Credential not found or access denied\")`**\n\nA plain Error reaches the client as INTERNAL_SERVER_ERROR (HTTP 500). Throw a TRPCError with code NOT_FOUND or FORBIDDEN instead."},{"path":"scripts/test-gcal-webhooks.sh","line":68,"body":"\ud83d\udfe0 **Important**\n\n**`sed -i '' -E ...` is BSD/macOS syntax; on GNU sed (Linux) it fails, so GOOGLE_WEBHOOK_URL is nev...**\n\n`sed -i '' -E ...` is BSD/macOS syntax; on GNU sed (Linux) it fails, so GOOGLE_WEBHOOK_URL is never updated. Use a portable form, such as writing to a temp file and moving it into place."}]},"cal_dot_com__cal.com__PR7232":{"pull_request":"https://github.com/calcom/cal.com/pull/7232","project":"Cal.com","review_body":"**Vortex: 2 issues to fix** at `6048e2a` \u00b7 10/10 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **Do not purge expired cancelled reminders before cancelling them** \u00b7 `packages/features/ee/workflows/api/scheduleEmailReminders.ts:44`\n- \ud83d\udfe0 **Important** \u00b7 **\\`deleteScheduledEmailReminder\\` and \\`deleteScheduledSMSReminder\\` are async but called without \\`awa...** \u00b7 `packages/trpc/server/routers/viewer/bookings.tsx:490`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@packages/features/ee/workflows/api/scheduleEmailReminders.ts` (line 44, Important):\n   `remindersToCancel` is loaded after the earlier `deleteMany` removes every email reminder with `scheduledDate <= now`. A reminder that expired before the next cron run is deleted before its SendGrid cancel, so the provider can still send it; load and cancel before the purge.\n\n2. In `@packages/trpc/server/routers/viewer/bookings.tsx` (line 490, Important):\n   `deleteScheduledEmailReminder` and `deleteScheduledSMSReminder` are async but called without `await` (e.g. in bookings.tsx), so handlers may return before the work finishes and serverless runtimes can drop it. Collect the promises and `await Promise.all(...)`.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 3 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"packages/features/ee/workflows/api/scheduleEmailReminders.ts","line":44,"body":"\ud83d\udfe0 **Important**\n\n**Do not purge expired cancelled reminders before cancelling them**\n\n`remindersToCancel` is loaded after the earlier `deleteMany` removes every email reminder with `scheduledDate <= now`. A reminder that expired before the next cron run is deleted before its SendGrid cancel, so the provider can still send it; load and cancel before the purge."},{"path":"packages/trpc/server/routers/viewer/bookings.tsx","line":490,"body":"\ud83d\udfe0 **Important**\n\n**`deleteScheduledEmailReminder` and `deleteScheduledSMSReminder` are async but called without `awa...**\n\n`deleteScheduledEmailReminder` and `deleteScheduledSMSReminder` are async but called without `await` (e.g. in bookings.tsx), so handlers may return before the work finishes and serverless runtimes can drop it. Collect the promises and `await Promise.all(...)`."}]},"cal_dot_com__cal.com__PR8087":{"pull_request":"https://github.com/calcom/cal.com/pull/8087","project":"Cal.com","review_body":"**Vortex: 2 issues to fix** at `820d7fa` \u00b7 12/12 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **Recurring-event calendar deletes are no longer tracked or started synchronously** \u00b7 `packages/features/bookings/lib/handleCancelBooking.ts:461`\n- \ud83d\udfe0 **Important** \u00b7 **async callback in forEach is not awaited** \u00b7 `packages/trpc/server/routers/viewer/bookings.tsx:553`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@packages/features/bookings/lib/handleCancelBooking.ts` (line 461, Important):\n   In `handleCancelBooking.ts`, `await getCalendar(credential)` inside `.forEach(async ...)` means `apiDeletes.push(deletedEvent)` runs after `Promise.all(apiDeletes)` is evaluated. Cancellation doesn't wait for these recurring-event deletes, and their errors go unhandled; use `for...of` or collect the promises and await them.\n\n2. In `@packages/trpc/server/routers/viewer/bookings.tsx` (line 553, Important):\n   `bookingRefsFiltered.forEach(async ...)` in `bookings.tsx` isn't awaited, so the handler can return before `deleteEvent`/`deleteMeeting` finish, and rejections go unhandled. Use `await Promise.all(bookingRefsFiltered.map(async ...))` or `for...of`.\n```\n\n</details>","inline_comments":[{"path":"packages/features/bookings/lib/handleCancelBooking.ts","line":461,"body":"\ud83d\udfe0 **Important**\n\n**Recurring-event calendar deletes are no longer tracked or started synchronously**\n\nIn `handleCancelBooking.ts`, `await getCalendar(credential)` inside `.forEach(async ...)` means `apiDeletes.push(deletedEvent)` runs after `Promise.all(apiDeletes)` is evaluated. Cancellation doesn't wait for these recurring-event deletes, and their errors go unhandled; use `for...of` or collect the promises and await them."},{"path":"packages/trpc/server/routers/viewer/bookings.tsx","line":553,"body":"\ud83d\udfe0 **Important**\n\n**async callback in forEach is not awaited**\n\n`bookingRefsFiltered.forEach(async ...)` in `bookings.tsx` isn't awaited, so the handler can return before `deleteEvent`/`deleteMeeting` finish, and rejections go unhandled. Use `await Promise.all(bookingRefsFiltered.map(async ...))` or `for...of`."}]},"cal_dot_com__cal.com__PR8330":{"pull_request":"https://github.com/calcom/cal.com/pull/8330","project":"Cal.com","review_body":"**Vortex: 2 issues to fix** at `ee38fd2` \u00b7 4/4 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`dayjs(date.start).add(...) === dayjs(date.end).add(...)\\` compares object references and is alway...** \u00b7 `packages/trpc/server/routers/viewer/slots.ts:114`\n- \ud83d\udfe0 **Important** \u00b7 **\\`end\\` is computed from \\`slotStartTime\\`, identical to \\`start\\`, so \\`end &gt; workingHour.endTime\\` only...** \u00b7 `packages/trpc/server/routers/viewer/slots.ts:142`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@packages/trpc/server/routers/viewer/slots.ts` (line 114, Important):\n   `dayjs(date.start).add(...) === dayjs(date.end).add(...)` compares object references and is always false, so the zero-length override (day unavailable) is never caught. Compare with `.isSame()` or `.valueOf()`.\n\n2. In `@packages/trpc/server/routers/viewer/slots.ts` (line 142, Important):\n   `end` is computed from `slotStartTime`, identical to `start`, so `end > workingHour.endTime` only checks the slot start. A slot starting inside working hours but running past `endTime` is accepted. Use `slotEndTime` for `end`.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 4 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"packages/trpc/server/routers/viewer/slots.ts","line":114,"body":"\ud83d\udfe0 **Important**\n\n**`dayjs(date.start).add(...) === dayjs(date.end).add(...)` compares object references and is alway...**\n\n`dayjs(date.start).add(...) === dayjs(date.end).add(...)` compares object references and is always false, so the zero-length override (day unavailable) is never caught. Compare with `.isSame()` or `.valueOf()`."},{"path":"packages/trpc/server/routers/viewer/slots.ts","line":142,"body":"\ud83d\udfe0 **Important**\n\n**`end` is computed from `slotStartTime`, identical to `start`, so `end > workingHour.endTime` only...**\n\n`end` is computed from `slotStartTime`, identical to `start`, so `end > workingHour.endTime` only checks the slot start. A slot starting inside working hours but running past `endTime` is accepted. Use `slotEndTime` for `end`."}]},"discourse__discourse-graphite__PR1":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/1","project":"Discourse","review_body":"**Vortex: changes requested, 2 issues to fix** at `ffbaf8c` \u00b7 3/3 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udd34 **Blocker** \u00b7 **Second \\`downsize\\` definition overrides the 5-arg version and breaks ResizeEmoji** \u00b7 `app/models/optimized_image.rb:149`\n- \ud83d\udfe0 **Important** \u00b7 **Client size limit ignores \\`max\\_&lt;type&gt;\\_size\\_kb\\` for attachments** \u00b7 `app/assets/javascripts/discourse/lib/utilities.js:182`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@app/models/optimized_image.rb` (line 149, Blocker):\n   The second `def self.downsize(from, to, dimensions, opts={})` in `app/models/optimized_image.rb` overrides the 5-arg version. `resize_emoji.rb:14` calls `downsize(path, path, 100, 100, opts)`, which now raises ArgumentError. Keep one signature accepting both forms, or update the caller.\n\n2. In `@app/assets/javascripts/discourse/lib/utilities.js` (line 182, Important):\n   `var maxSizeKB = 10 * 1024;` in `utilities.js` replaces the per-type `max_<type>_size_kb` setting for all uploads. Attachments over a lower `max_attachment_size_kb` pass the client check and fail only on the server. Keep the per-type setting for non-image uploads.\n```\n\n</details>","inline_comments":[{"path":"app/models/optimized_image.rb","line":149,"body":"\ud83d\udd34 **Blocker**\n\n**Second `downsize` definition overrides the 5-arg version and breaks ResizeEmoji**\n\nThe second `def self.downsize(from, to, dimensions, opts={})` in `app/models/optimized_image.rb` overrides the 5-arg version. `resize_emoji.rb:14` calls `downsize(path, path, 100, 100, opts)`, which now raises ArgumentError. Keep one signature accepting both forms, or update the caller."},{"path":"app/assets/javascripts/discourse/lib/utilities.js","line":182,"body":"\ud83d\udfe0 **Important**\n\n**Client size limit ignores `max_<type>_size_kb` for attachments**\n\n`var maxSizeKB = 10 * 1024;` in `utilities.js` replaces the per-type `max_<type>_size_kb` setting for all uploads. Attachments over a lower `max_attachment_size_kb` pass the client check and fail only on the server. Keep the per-type setting for non-image uploads."}]},"discourse__discourse-graphite__PR10":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/10","project":"Discourse","review_body":"**Vortex: changes requested, 7 issues to fix** at `d1c6918` \u00b7 36/36 files reviewed\n\nActionable comments posted: 7\n\n- \ud83d\udd34 **Blocker** \u00b7 **\\`execute(...)\\[0\\]\\[&#39;id&#39;\\]\\` at line 11 raises NoMethodError when no \\`embed\\_category\\` setting or match...** \u00b7 `db/migrate/20150818190757_create_embeddable_hosts.rb:11`\n- \ud83d\udfe0 **Important** \u00b7 **In \\`Admin::EmbeddableHostsController\\`, \\`update\\` and \\`destroy\\` use \\`.where(id:).first\\`, which is n...** \u00b7 `app/controllers/admin/embeddable_hosts_controller.rb:16`\n- \ud83d\udfe0 **Important** \u00b7 **Hosts stored with a port never match** \u00b7 `app/controllers/embed_controller.rb:61`\n- \ud83d\udfe0 **Important** \u00b7 **The \\`before\\_validation\\` block calls \\`self.host.sub!\\`, which raises NoMethodError when \\`host\\` is n...** \u00b7 `app/models/embeddable_host.rb:6`\n- \ud83d\udfe0 **Important** \u00b7 **\\`record\\_for\\_host\\` compares \\`lower(host)\\` against \\`uri.host\\`, which isn&#39;t downcased, so a URL like...** \u00b7 `app/models/embeddable_host.rb:17`\n- \ud83d\udfe0 **Important** \u00b7 **Unescaped host value interpolated into INSERT** \u00b7 `db/migrate/20150818190757_create_embeddable_hosts.rb:25`\n- \ud83d\udfe0 **Important** \u00b7 **The fabricator files are swapped: \\`category\\_fabricator.rb\\` defines \\`Fabricator(:embeddable\\_host)\\`...** \u00b7 `spec/fabricators/category_fabricator.rb:1`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (7 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@db/migrate/20150818190757_create_embeddable_hosts.rb` (line 11, Blocker):\n   `execute(...)[0]['id']` at line 11 raises NoMethodError when no `embed_category` setting or matching category exists, because `[0]` is nil, which aborts the migration. Guard for a nil row before reading the column; line 15 has the same problem.\n\n2. In `@app/controllers/admin/embeddable_hosts_controller.rb` (line 16, Important):\n   In `Admin::EmbeddableHostsController`, `update` and `destroy` use `.where(id:).first`, which is nil for an unknown id, so `host.destroy`/`save_host(host)` raise NoMethodError (500). Use `find` or return 404.\n\n3. In `@app/controllers/embed_controller.rb` (line 61, Important):\n   `EmbeddableHost.record_for_host` looks up `uri.host`, which drops the port, but host validation allows `(:[0-9]{1,5})?`. A host stored as `example.com:8080` never matches its referer. Strip the port on save or compare with the port.\n\n4. In `@app/models/embeddable_host.rb` (line 6, Important):\n   The `before_validation` block calls `self.host.sub!`, which raises NoMethodError when `host` is nil, so a create or update without a host returns a 500 instead of a validation error. Add a nil check or use `self.host.to_s`.\n\n5. In `@app/models/embeddable_host.rb` (line 17, Important):\n   `record_for_host` compares `lower(host)` against `uri.host`, which isn't downcased, so a URL like `http://Eviltrout.com/x` never matches and `host_allowed?` returns false. Downcase `host` before the query.\n\n6. In `@db/migrate/20150818190757_create_embeddable_hosts.rb` (line 25, Important):\n   Line 25 interpolates the legacy host as `'#{h}'` into the INSERT, so a host containing a single quote produces invalid SQL and aborts the migration. Use a quoted or bound value such as `quote(h)`.\n\n7. In `@spec/fabricators/category_fabricator.rb` (line 1, Important):\n   The fabricator files are swapped: `category_fabricator.rb` defines `Fabricator(:embeddable_host)`, while `embeddable_host_fabricator.rb` defines the category fabricators. Move each definition into the file matching its name.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 3 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"db/migrate/20150818190757_create_embeddable_hosts.rb","line":11,"body":"\ud83d\udd34 **Blocker**\n\n**`execute(...)[0]['id']` at line 11 raises NoMethodError when no `embed_category` setting or match...**\n\n`execute(...)[0]['id']` at line 11 raises NoMethodError when no `embed_category` setting or matching category exists, because `[0]` is nil, which aborts the migration. Guard for a nil row before reading the column; line 15 has the same problem."},{"path":"app/controllers/admin/embeddable_hosts_controller.rb","line":16,"body":"\ud83d\udfe0 **Important**\n\n**In `Admin::EmbeddableHostsController`, `update` and `destroy` use `.where(id:).first`, which is n...**\n\nIn `Admin::EmbeddableHostsController`, `update` and `destroy` use `.where(id:).first`, which is nil for an unknown id, so `host.destroy`/`save_host(host)` raise NoMethodError (500). Use `find` or return 404."},{"path":"app/controllers/embed_controller.rb","line":61,"body":"\ud83d\udfe0 **Important**\n\n**Hosts stored with a port never match**\n\n`EmbeddableHost.record_for_host` looks up `uri.host`, which drops the port, but host validation allows `(:[0-9]{1,5})?`. A host stored as `example.com:8080` never matches its referer. Strip the port on save or compare with the port."},{"path":"app/models/embeddable_host.rb","line":6,"body":"\ud83d\udfe0 **Important**\n\n**The `before_validation` block calls `self.host.sub!`, which raises NoMethodError when `host` is n...**\n\nThe `before_validation` block calls `self.host.sub!`, which raises NoMethodError when `host` is nil, so a create or update without a host returns a 500 instead of a validation error. Add a nil check or use `self.host.to_s`."},{"path":"app/models/embeddable_host.rb","line":17,"body":"\ud83d\udfe0 **Important**\n\n**`record_for_host` compares `lower(host)` against `uri.host`, which isn't downcased, so a URL like...**\n\n`record_for_host` compares `lower(host)` against `uri.host`, which isn't downcased, so a URL like `http://Eviltrout.com/x` never matches and `host_allowed?` returns false. Downcase `host` before the query."},{"path":"db/migrate/20150818190757_create_embeddable_hosts.rb","line":25,"body":"\ud83d\udfe0 **Important**\n\n**Unescaped host value interpolated into INSERT**\n\nLine 25 interpolates the legacy host as `'#{h}'` into the INSERT, so a host containing a single quote produces invalid SQL and aborts the migration. Use a quoted or bound value such as `quote(h)`."},{"path":"spec/fabricators/category_fabricator.rb","line":1,"body":"\ud83d\udfe0 **Important**\n\n**The fabricator files are swapped: `category_fabricator.rb` defines `Fabricator(:embeddable_host)`...**\n\nThe fabricator files are swapped: `category_fabricator.rb` defines `Fabricator(:embeddable_host)`, while `embeddable_host_fabricator.rb` defines the category fabricators. Move each definition into the file matching its name."}]},"discourse__discourse-graphite__PR2":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/2","project":"Discourse","review_body":"**Vortex: 3 issues to fix** at `6669a2d` \u00b7 18/18 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`TopicUser.find\\_by(...)\\` at line 105 can return nil (e.g. user never visited the topic, email cam...** \u00b7 `app/controllers/topics_controller.rb:105`\n- \ud83d\udfe0 **Important** \u00b7 **\\`unsubscribe\\` mutates notification state via \\`tu.save!\\` on a GET route (routes.rb:440-441), so ma...** \u00b7 `app/controllers/topics_controller.rb:113`\n- \ud83d\udfe0 **Important** \u00b7 **Mark this as a user notification-level change** \u00b7 `app/controllers/topics_controller.rb:113`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@app/controllers/topics_controller.rb` (line 105, Important):\n   `TopicUser.find_by(...)` at line 105 can return nil (e.g. user never visited the topic, email came from a watched category), so `tu.notification_level` raises NoMethodError and returns a 500. Handle nil or use `TopicUser.change`.\n\n2. In `@app/controllers/topics_controller.rb` (line 113, Important):\n   `unsubscribe` mutates notification state via `tu.save!` on a GET route (routes.rb:440-441), so mail scanners/prefetchers can mute users and repeated hits toggle regular\u2192muted. Require a confirmation POST/PUT.\n\n3. In `@app/controllers/topics_controller.rb` (line 113, Important):\n   `tu.save!` leaves `notifications_reason_id` unchanged, unlike `TopicUser.change`. A downgraded auto-tracked user can keep a nil reason, so a later topic read may auto-promote them back to tracking and undo the unsubscribe.\n```\n\n</details>","inline_comments":[{"path":"app/controllers/topics_controller.rb","line":105,"body":"\ud83d\udfe0 **Important**\n\n**`TopicUser.find_by(...)` at line 105 can return nil (e.g. user never visited the topic, email cam...**\n\n`TopicUser.find_by(...)` at line 105 can return nil (e.g. user never visited the topic, email came from a watched category), so `tu.notification_level` raises NoMethodError and returns a 500. Handle nil or use `TopicUser.change`."},{"path":"app/controllers/topics_controller.rb","line":113,"body":"\ud83d\udfe0 **Important**\n\n**`unsubscribe` mutates notification state via `tu.save!` on a GET route (routes.rb:440-441), so ma...**\n\n`unsubscribe` mutates notification state via `tu.save!` on a GET route (routes.rb:440-441), so mail scanners/prefetchers can mute users and repeated hits toggle regular\u2192muted. Require a confirmation POST/PUT."},{"path":"app/controllers/topics_controller.rb","line":113,"body":"\ud83d\udfe0 **Important**\n\n**Mark this as a user notification-level change**\n\n`tu.save!` leaves `notifications_reason_id` unchanged, unlike `TopicUser.change`. A downgraded auto-tracked user can keep a nil reason, so a later topic read may auto-promote them back to tracking and undo the unsubscribe."}]},"discourse__discourse-graphite__PR3":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/3","project":"Discourse","review_body":"**Vortex: 3 issues to fix** at `5f8a130` \u00b7 10/10 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udfe0 **Important** \u00b7 **Validation runs twice, so match\\_count is incremented twice** \u00b7 `app/controllers/users_controller.rb:194`\n- \ud83d\udfe0 **Important** \u00b7 **Blocked-email lookup is case-sensitive** \u00b7 `app/models/blocked_email.rb:12`\n- \ud83d\udfe0 **Important** \u00b7 **Domain match is not anchored at the end** \u00b7 `lib/validators/email_validator.rb:20`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@app/controllers/users_controller.rb` (line 194, Important):\n   `UsersController#create` calls `user.valid?` (line 168) and then `user.save`, so `EmailValidator` runs `BlockedEmail.should_block?` twice and `match_count` is incremented twice per signup. Move the counting out of the validator or fire it once per attempt.\n\n2. In `@app/models/blocked_email.rb` (line 12, Important):\n   `BlockedEmail.should_block?` looks up `where(email: email)` with exact case, so a block on `bad@spamclub.com` is bypassed by `Bad@SpamClub.com`. Normalise with `Email.downcase` on both the stored and queried value.\n\n3. In `@lib/validators/email_validator.rb` (line 20, Important):\n   `email_in_restriction_setting?` builds `Regexp.new(\"@(#{domains})\", true)` with no end anchor, so `bob@example.com.attacker.net` matches a whitelisted `example.com`. Anchor it, e.g. `@(?:#{domains})$`.\n```\n\n</details>","inline_comments":[{"path":"app/controllers/users_controller.rb","line":194,"body":"\ud83d\udfe0 **Important**\n\n**Validation runs twice, so match_count is incremented twice**\n\n`UsersController#create` calls `user.valid?` (line 168) and then `user.save`, so `EmailValidator` runs `BlockedEmail.should_block?` twice and `match_count` is incremented twice per signup. Move the counting out of the validator or fire it once per attempt."},{"path":"app/models/blocked_email.rb","line":12,"body":"\ud83d\udfe0 **Important**\n\n**Blocked-email lookup is case-sensitive**\n\n`BlockedEmail.should_block?` looks up `where(email: email)` with exact case, so a block on `bad@spamclub.com` is bypassed by `Bad@SpamClub.com`. Normalise with `Email.downcase` on both the stored and queried value."},{"path":"lib/validators/email_validator.rb","line":20,"body":"\ud83d\udfe0 **Important**\n\n**Domain match is not anchored at the end**\n\n`email_in_restriction_setting?` builds `Regexp.new(\"@(#{domains})\", true)` with no end anchor, so `bob@example.com.attacker.net` matches a whitelisted `example.com`. Anchor it, e.g. `@(?:#{domains})$`."}]},"discourse__discourse-graphite__PR4":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/4","project":"Discourse","review_body":"**Vortex: changes requested, 8 issues to fix** at `4f8aed2` \u00b7 28/28 files reviewed\n\nActionable comments posted: 8\n\n- \ud83d\udd34 **Blocker** \u00b7 **Prevent redirects to internal hosts** \u00b7 `app/jobs/regular/retrieve_topic.rb:17`\n- \ud83d\udd34 **Blocker** \u00b7 **\\`TopicEmbed.import\\` interpolates \\`url\\` unescaped into \\`&lt;a href=&#39;#{url}&#39;&gt;\\`, and the \\`/^https?\\\\:\\\\/\\\\...** \u00b7 `app/models/topic_embed.rb:13`\n- \ud83d\udd34 **Blocker** \u00b7 **Syntax error: \\`end if\\` with no condition** \u00b7 `app/views/embed/best.html.erb:6`\n- \ud83d\udfe0 **Important** \u00b7 **postMessage origin check uses substring match** \u00b7 `app/assets/javascripts/embed.js:17`\n- \ud83d\udfe0 **Important** \u00b7 **X-Frame-Options &quot;ALLOWALL&quot; is not a valid value** \u00b7 `app/controllers/embed_controller.rb:28`\n- \ud83d\udd34 **Blocker** \u00b7 **raw\\_html cook skips all sanitization** \u00b7 `app/models/post.rb:133`\n- \ud83d\udfe0 **Important** \u00b7 **\\`create\\_table :top\\_topics, force: true\\` drops an existing \\`top\\_topics\\` table and its rows if the ...** \u00b7 `db/migrate/20131223171005_create_top_topics.rb:3`\n- \ud83d\udfe0 **Important** \u00b7 **\\`TopicEmbed.import\\_remote(user, t\\[:link\\], ...)\\` fetches each Disqus URL over HTTP via \\`open(url)\\`...** \u00b7 `lib/tasks/disqus.thor:148`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (8 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@app/jobs/regular/retrieve_topic.rb` (line 17, Blocker):\n   `TopicRetriever#invalid_host?` validates only the initial host, but `TopicEmbed.import_remote` calls `open(url)`, which follows redirects. A redirect from the embeddable host to an internal address would be fetched; validate redirect targets or disable redirects.\n\n2. In `@app/models/topic_embed.rb` (line 13, Blocker):\n   `TopicEmbed.import` interpolates `url` unescaped into `<a href='#{url}'>`, and the `/^https?\\:\\/\\//` guard accepts quote-injecting or multi-line values, giving stored XSS in `raw_html`. Escape the URL and anchor the check with `\\A`/`\\z`.\n\n3. In `@app/views/embed/best.html.erb` (line 6, Blocker):\n   `<%- end if %>` is invalid Ruby (`if` modifier without a condition). The template fails to compile, so `embed/best` raises for every request. It should be `<%- end %>`.\n\n4. In `@app/assets/javascripts/embed.js` (line 17, Important):\n   `discourseUrl.indexOf(e.origin) === -1` in `embed.js` accepts any origin that is a substring of `discourseUrl`, so a lookalike origin can set the iframe height. Compare `e.origin` for equality with the parsed origin of `discourseUrl`.\n\n5. In `@app/controllers/embed_controller.rb` (line 28, Important):\n   `ALLOWALL` is not a valid X-Frame-Options value, so browsers ignore the header and the response is framable by any origin. To restrict framing to `embeddable_host`, use CSP `frame-ancestors`; if unrestricted framing is intended, remove the header.\n\n6. In `@app/models/post.rb` (line 133, Blocker):\n   `Post#cook` returns `raw` unsanitized when `cook_method == raw_html`, and `TopicEmbed.import` stores remote content with only `absolutize_urls`. The embed view renders it with `raw post.cooked`, so scripts in a feed item become stored XSS; sanitize before storing.\n\n7. In `@db/migrate/20131223171005_create_top_topics.rb` (line 3, Important):\n   `create_table :top_topics, force: true` drops an existing `top_topics` table and its rows if the migration runs where the table exists. Remove `force: true` unless re-running is deliberate and documented.\n\n8. In `@lib/tasks/disqus.thor` (line 148, Important):\n   `TopicEmbed.import_remote(user, t[:link], ...)` fetches each Disqus URL over HTTP via `open(url)` with no rescue, so one dead link aborts the whole import loop partway through. Rescue per thread and log/skip the failed link.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 4 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"app/jobs/regular/retrieve_topic.rb","line":17,"body":"\ud83d\udd34 **Blocker**\n\n**Prevent redirects to internal hosts**\n\n`TopicRetriever#invalid_host?` validates only the initial host, but `TopicEmbed.import_remote` calls `open(url)`, which follows redirects. A redirect from the embeddable host to an internal address would be fetched; validate redirect targets or disable redirects."},{"path":"app/models/topic_embed.rb","line":13,"body":"\ud83d\udd34 **Blocker**\n\n**`TopicEmbed.import` interpolates `url` unescaped into `<a href='#{url}'>`, and the `/^https?\\:\\/\\...**\n\n`TopicEmbed.import` interpolates `url` unescaped into `<a href='#{url}'>`, and the `/^https?\\:\\/\\//` guard accepts quote-injecting or multi-line values, giving stored XSS in `raw_html`. Escape the URL and anchor the check with `\\A`/`\\z`."},{"path":"app/views/embed/best.html.erb","line":6,"body":"\ud83d\udd34 **Blocker**\n\n**Syntax error: `end if` with no condition**\n\n`<%- end if %>` is invalid Ruby (`if` modifier without a condition). The template fails to compile, so `embed/best` raises for every request. It should be `<%- end %>`."},{"path":"app/assets/javascripts/embed.js","line":17,"body":"\ud83d\udfe0 **Important**\n\n**postMessage origin check uses substring match**\n\n`discourseUrl.indexOf(e.origin) === -1` in `embed.js` accepts any origin that is a substring of `discourseUrl`, so a lookalike origin can set the iframe height. Compare `e.origin` for equality with the parsed origin of `discourseUrl`."},{"path":"app/controllers/embed_controller.rb","line":28,"body":"\ud83d\udfe0 **Important**\n\n**X-Frame-Options \"ALLOWALL\" is not a valid value**\n\n`ALLOWALL` is not a valid X-Frame-Options value, so browsers ignore the header and the response is framable by any origin. To restrict framing to `embeddable_host`, use CSP `frame-ancestors`; if unrestricted framing is intended, remove the header."},{"path":"app/models/post.rb","line":133,"body":"\ud83d\udd34 **Blocker**\n\n**raw_html cook skips all sanitization**\n\n`Post#cook` returns `raw` unsanitized when `cook_method == raw_html`, and `TopicEmbed.import` stores remote content with only `absolutize_urls`. The embed view renders it with `raw post.cooked`, so scripts in a feed item become stored XSS; sanitize before storing."},{"path":"db/migrate/20131223171005_create_top_topics.rb","line":3,"body":"\ud83d\udfe0 **Important**\n\n**`create_table :top_topics, force: true` drops an existing `top_topics` table and its rows if the ...**\n\n`create_table :top_topics, force: true` drops an existing `top_topics` table and its rows if the migration runs where the table exists. Remove `force: true` unless re-running is deliberate and documented."},{"path":"lib/tasks/disqus.thor","line":148,"body":"\ud83d\udfe0 **Important**\n\n**`TopicEmbed.import_remote(user, t[:link], ...)` fetches each Disqus URL over HTTP via `open(url)`...**\n\n`TopicEmbed.import_remote(user, t[:link], ...)` fetches each Disqus URL over HTTP via `open(url)` with no rescue, so one dead link aborts the whole import loop partway through. Rescue per thread and log/skip the failed link."}]},"discourse__discourse-graphite__PR5":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/5","project":"Discourse","review_body":"**Vortex: 2 issues to fix** at `5b22931` \u00b7 5/5 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`-ms-align-items: $alignment;\\`** \u00b7 `app/assets/stylesheets/common/foundation/mixins.scss:121`\n- \ud83d\udfe0 **Important** \u00b7 **\\`-webkit-box-ordinal-group\\` and \\`-moz-box-ordinal-group\\` start at 1 while \\`order\\` starts at 0. Pa...** \u00b7 `app/assets/stylesheets/common/foundation/mixins.scss:126`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@app/assets/stylesheets/common/foundation/mixins.scss` (line 121, Important):\n   No browser implements this property, so the declaration is ignored everywhere. Remove it. `-ms-flex-align` is already set on the line above.\n\n2. In `@app/assets/stylesheets/common/foundation/mixins.scss` (line 126, Important):\n   `-webkit-box-ordinal-group` and `-moz-box-ordinal-group` start at 1 while `order` starts at 0. Passing `$val` to both puts old WebKit/Gecko one group off, and 0 is invalid. Use `$val + 1` for those two lines.\n```\n\n</details>","inline_comments":[{"path":"app/assets/stylesheets/common/foundation/mixins.scss","line":121,"body":"\ud83d\udfe0 **Important**\n\n**`-ms-align-items: $alignment;`**\n\nNo browser implements this property, so the declaration is ignored everywhere. Remove it. `-ms-flex-align` is already set on the line above."},{"path":"app/assets/stylesheets/common/foundation/mixins.scss","line":126,"body":"\ud83d\udfe0 **Important**\n\n**`-webkit-box-ordinal-group` and `-moz-box-ordinal-group` start at 1 while `order` starts at 0. Pa...**\n\n`-webkit-box-ordinal-group` and `-moz-box-ordinal-group` start at 1 while `order` starts at 0. Passing `$val` to both puts old WebKit/Gecko one group off, and 0 is invalid. Use `$val + 1` for those two lines."}]},"discourse__discourse-graphite__PR6":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/6","project":"Discourse","review_body":"**Vortex: 1 issue to fix** at `267d8be` \u00b7 5/5 files reviewed\n\nActionable comment posted: 1\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`include\\_website\\_name\\` lacks the trailing \\`?\\`, so ActiveModel::Serializers never calls it and \\`we...** \u00b7 `app/serializers/user_serializer.rb:153`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (1 finding)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@app/serializers/user_serializer.rb` (line 153, Important):\n   `include_website_name` lacks the trailing `?`, so ActiveModel::Serializers never calls it and `website_name` is always serialized (nil when there is no website). Rename it to `include_website_name?`.\n```\n\n</details>","inline_comments":[{"path":"app/serializers/user_serializer.rb","line":153,"body":"\ud83d\udfe0 **Important**\n\n**`include_website_name` lacks the trailing `?`, so ActiveModel::Serializers never calls it and `we...**\n\n`include_website_name` lacks the trailing `?`, so ActiveModel::Serializers never calls it and `website_name` is always serialized (nil when there is no website). Rename it to `include_website_name?`."}]},"discourse__discourse-graphite__PR7":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/7","project":"Discourse","review_body":"**Vortex: 5 issues to fix** at `d38c4d5` \u00b7 32/32 files reviewed\n\nActionable comments posted: 5\n\n- \ud83d\udfe0 **Important** \u00b7 **In \\`.topic-meta-data h5 a\\`, the \\`$primary\\` argument of \\`dark-light-choose\\` changed from \\`$lightne...** \u00b7 `app/assets/stylesheets/desktop/topic-post.scss:291`\n- \ud83d\udfe0 **Important** \u00b7 **\\`.group-member-info .name\\` changed from \\`scale-color($primary, $lightness: 30%)\\` to 50% for \\`$pri...** \u00b7 `app/assets/stylesheets/desktop/user.scss:522`\n- \ud83d\udfe0 **Important** \u00b7 **In \\`.custom-message-length\\`, the light branch changed from \\`$lightness: 70%\\` to 30%, so it is muc...** \u00b7 `app/assets/stylesheets/mobile/modal.scss:102`\n- \ud83d\udfe0 **Important** \u00b7 **In \\`.topic-map h3\\`, the light branch changed from \\`$lightness: 20%\\` to 50%, so light themes get a...** \u00b7 `app/assets/stylesheets/mobile/topic-post.scss:182`\n- \ud83d\udfe0 **Important** \u00b7 **In \\`.group-member-info .name\\`, the light branch of \\`dark-light-choose\\` changed from \\`scale-color(...** \u00b7 `app/assets/stylesheets/mobile/user.scss:497`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (5 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@app/assets/stylesheets/desktop/topic-post.scss` (line 291, Important):\n   In `.topic-meta-data h5 a`, the `$primary` argument of `dark-light-choose` changed from `$lightness: 30%` to 70%, so light themes get a much lighter username color. Keep 30% for `$primary` and use 70% for `$secondary`.\n\n2. In `@app/assets/stylesheets/desktop/user.scss` (line 522, Important):\n   `.group-member-info .name` changed from `scale-color($primary, $lightness: 30%)` to 50% for `$primary`, so the light theme color changes and now matches `.title`. Use 30% for `$primary` and 70% for `$secondary`.\n\n3. In `@app/assets/stylesheets/mobile/modal.scss` (line 102, Important):\n   In `.custom-message-length`, the light branch changed from `$lightness: 70%` to 30%, so it is much darker on light themes. Keep 70% for `$primary` and use 30% for `$secondary`.\n\n4. In `@app/assets/stylesheets/mobile/topic-post.scss` (line 182, Important):\n   In `.topic-map h3`, the light branch changed from `$lightness: 20%` to 50%, so light themes get a lighter color. Use `dark-light-choose(scale-color($primary, $lightness: 20%), scale-color($secondary, $lightness: 80%))`.\n\n5. In `@app/assets/stylesheets/mobile/user.scss` (line 497, Important):\n   In `.group-member-info .name`, the light branch of `dark-light-choose` changed from `scale-color($primary, $lightness: 30%)` to 50%, so the light-theme name is lighter than before. Restore 30% in the `$primary` branch and keep `$secondary` for dark.\n```\n\n</details>","inline_comments":[{"path":"app/assets/stylesheets/desktop/topic-post.scss","line":291,"body":"\ud83d\udfe0 **Important**\n\n**In `.topic-meta-data h5 a`, the `$primary` argument of `dark-light-choose` changed from `$lightne...**\n\nIn `.topic-meta-data h5 a`, the `$primary` argument of `dark-light-choose` changed from `$lightness: 30%` to 70%, so light themes get a much lighter username color. Keep 30% for `$primary` and use 70% for `$secondary`."},{"path":"app/assets/stylesheets/desktop/user.scss","line":522,"body":"\ud83d\udfe0 **Important**\n\n**`.group-member-info .name` changed from `scale-color($primary, $lightness: 30%)` to 50% for `$pri...**\n\n`.group-member-info .name` changed from `scale-color($primary, $lightness: 30%)` to 50% for `$primary`, so the light theme color changes and now matches `.title`. Use 30% for `$primary` and 70% for `$secondary`."},{"path":"app/assets/stylesheets/mobile/modal.scss","line":102,"body":"\ud83d\udfe0 **Important**\n\n**In `.custom-message-length`, the light branch changed from `$lightness: 70%` to 30%, so it is muc...**\n\nIn `.custom-message-length`, the light branch changed from `$lightness: 70%` to 30%, so it is much darker on light themes. Keep 70% for `$primary` and use 30% for `$secondary`."},{"path":"app/assets/stylesheets/mobile/topic-post.scss","line":182,"body":"\ud83d\udfe0 **Important**\n\n**In `.topic-map h3`, the light branch changed from `$lightness: 20%` to 50%, so light themes get a...**\n\nIn `.topic-map h3`, the light branch changed from `$lightness: 20%` to 50%, so light themes get a lighter color. Use `dark-light-choose(scale-color($primary, $lightness: 20%), scale-color($secondary, $lightness: 80%))`."},{"path":"app/assets/stylesheets/mobile/user.scss","line":497,"body":"\ud83d\udfe0 **Important**\n\n**In `.group-member-info .name`, the light branch of `dark-light-choose` changed from `scale-color(...**\n\nIn `.group-member-info .name`, the light branch of `dark-light-choose` changed from `scale-color($primary, $lightness: 30%)` to 50%, so the light-theme name is lighter than before. Restore 30% in the `$primary` branch and keep `$secondary` for dark."}]},"discourse__discourse-graphite__PR8":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/8","project":"Discourse","review_body":"**Vortex: 4 issues to fix** at `060cda7` \u00b7 16/16 files reviewed\n\nActionable comments posted: 4\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`Math.floor(user\\_count / limit) + 1\\` overcounts pages when \\`user\\_count\\` is an exact multiple of \\`...** \u00b7 `app/assets/javascripts/admin/controllers/admin-group.js.es6:13`\n- \ud83d\udfe0 **Important** \u00b7 **\\`setupController\\` calls \\`model.findMembers()\\` without returning it, so the route no longer waits ...** \u00b7 `app/assets/javascripts/admin/routes/admin_group_route.js:13`\n- \ud83d\udfe0 **Important** \u00b7 **\\`limit = (params\\[:limit\\] \\|\\| 50).to\\_i\\` now applies to every group, but the public \\`group/members.h...** \u00b7 `app/controllers/groups_controller.rb:22`\n- \ud83d\udfe0 **Important** \u00b7 **The spec uses \\`xhr :put, :remove\\_member\\`, but the route is DELETE only (config/routes.rb:49), so ...** \u00b7 `spec/controllers/admin/groups_controller_spec.rb:115`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (4 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@app/assets/javascripts/admin/controllers/admin-group.js.es6` (line 13, Important):\n   `Math.floor(user_count / limit) + 1` overcounts pages when `user_count` is an exact multiple of `limit` (50 members, limit 50 gives 2 pages), so `next` shows an empty page. Use `Math.ceil` instead.\n\n2. In `@app/assets/javascripts/admin/routes/admin_group_route.js` (line 13, Important):\n   `setupController` calls `model.findMembers()` without returning it, so the route no longer waits for members (as `afterModel` did) and AJAX failures are dropped. Return the promise or restore `afterModel`.\n\n3. In `@app/controllers/groups_controller.rb` (line 22, Important):\n   `limit = (params[:limit] || 50).to_i` now applies to every group, but the public `group/members.hbs` has no paging, so groups with over 50 members are silently truncated for users. Add paging there or raise the default limit.\n\n4. In `@spec/controllers/admin/groups_controller_spec.rb` (line 115, Important):\n   The spec uses `xhr :put, :remove_member`, but the route is DELETE only (config/routes.rb:49), so it doesn't match production routing. Use `xhr :delete`.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 4 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"app/assets/javascripts/admin/controllers/admin-group.js.es6","line":13,"body":"\ud83d\udfe0 **Important**\n\n**`Math.floor(user_count / limit) + 1` overcounts pages when `user_count` is an exact multiple of `...**\n\n`Math.floor(user_count / limit) + 1` overcounts pages when `user_count` is an exact multiple of `limit` (50 members, limit 50 gives 2 pages), so `next` shows an empty page. Use `Math.ceil` instead."},{"path":"app/assets/javascripts/admin/routes/admin_group_route.js","line":13,"body":"\ud83d\udfe0 **Important**\n\n**`setupController` calls `model.findMembers()` without returning it, so the route no longer waits ...**\n\n`setupController` calls `model.findMembers()` without returning it, so the route no longer waits for members (as `afterModel` did) and AJAX failures are dropped. Return the promise or restore `afterModel`."},{"path":"app/controllers/groups_controller.rb","line":22,"body":"\ud83d\udfe0 **Important**\n\n**`limit = (params[:limit] || 50).to_i` now applies to every group, but the public `group/members.h...**\n\n`limit = (params[:limit] || 50).to_i` now applies to every group, but the public `group/members.hbs` has no paging, so groups with over 50 members are silently truncated for users. Add paging there or raise the default limit."},{"path":"spec/controllers/admin/groups_controller_spec.rb","line":115,"body":"\ud83d\udfe0 **Important**\n\n**The spec uses `xhr :put, :remove_member`, but the route is DELETE only (config/routes.rb:49), so ...**\n\nThe spec uses `xhr :put, :remove_member`, but the route is DELETE only (config/routes.rb:49), so it doesn't match production routing. Use `xhr :delete`."}]},"discourse__discourse-graphite__PR9":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/9","project":"Discourse","review_body":"**Vortex: 3 issues to fix** at `ecfa17b` \u00b7 7/7 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udfe0 **Important** \u00b7 **Fallback locales are only loaded in set\\_locale, not in other I18n.locale paths** \u00b7 `app/controllers/application_controller.rb:159`\n- \ud83d\udfe0 **Important** \u00b7 **Fallback-dependent translation cache is not site-aware** \u00b7 `config/initializers/i18n.rb:17`\n- \ud83d\udfe0 **Important** \u00b7 **\\`ensure\\_loaded!\\` does \\`&#64;loaded\\_locales \\|\\|= \\[\\]\\` outside \\`LOAD\\_MUTEX\\`, so concurrent first calls ca...** \u00b7 `lib/freedom_patches/translate_accelerator.rb:63`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@app/controllers/application_controller.rb` (line 159, Important):\n   `I18n.fallbacks.ensure_loaded!` is only called in the controller's `set_locale`, so Sidekiq jobs (`app/jobs/base.rb`) and `I18n.with_locale` in `post_alerter.rb`/`post_destroyer.rb` may never load `:en` or the site default. A missing key then returns \"translation missing\"; call it in those paths too.\n\n2. In `@config/initializers/i18n.rb` (line 17, Important):\n   `FallbackLocaleList#[]` depends on `SiteSetting.default_locale`, which varies per multisite DB, but the `I18n.translate` cache key (`translate_accelerator.rb:72`) omits it. A fallback string cached on one site can be returned on another; include the default locale or site in the key.\n\n3. In `@lib/freedom_patches/translate_accelerator.rb` (line 63, Important):\n   `ensure_loaded!` does `@loaded_locales ||= []` outside `LOAD_MUTEX`, so concurrent first calls can replace the array another thread is filling. Initialize `@loaded_locales` once at definition time, and in `reload!`, or do the check inside the mutex.\n```\n\n</details>","inline_comments":[{"path":"app/controllers/application_controller.rb","line":159,"body":"\ud83d\udfe0 **Important**\n\n**Fallback locales are only loaded in set_locale, not in other I18n.locale paths**\n\n`I18n.fallbacks.ensure_loaded!` is only called in the controller's `set_locale`, so Sidekiq jobs (`app/jobs/base.rb`) and `I18n.with_locale` in `post_alerter.rb`/`post_destroyer.rb` may never load `:en` or the site default. A missing key then returns \"translation missing\"; call it in those paths too."},{"path":"config/initializers/i18n.rb","line":17,"body":"\ud83d\udfe0 **Important**\n\n**Fallback-dependent translation cache is not site-aware**\n\n`FallbackLocaleList#[]` depends on `SiteSetting.default_locale`, which varies per multisite DB, but the `I18n.translate` cache key (`translate_accelerator.rb:72`) omits it. A fallback string cached on one site can be returned on another; include the default locale or site in the key."},{"path":"lib/freedom_patches/translate_accelerator.rb","line":63,"body":"\ud83d\udfe0 **Important**\n\n**`ensure_loaded!` does `@loaded_locales ||= []` outside `LOAD_MUTEX`, so concurrent first calls ca...**\n\n`ensure_loaded!` does `@loaded_locales ||= []` outside `LOAD_MUTEX`, so concurrent first calls can replace the array another thread is filling. Initialize `@loaded_locales` once at definition time, and in `reload!`, or do the check inside the mutex."}]},"grafana__grafana__PR103633":{"pull_request":"https://github.com/grafana/grafana/pull/103633","project":"Grafana","review_body":"**Vortex: 2 issues to fix** at `7562f37` \u00b7 4/4 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`userPermDenialCacheKey\\` joins name and parent with \\`\\_\\` unescaped, so name \\`a\\_b\\`/folder \\`c\\` and n...** \u00b7 `pkg/services/authz/rbac/cache.go:31`\n- \ud83d\udfe0 **Important** \u00b7 **The denial key built from \\`checkReq.UserUID\\` omits identity type, and anonymous and render identi...** \u00b7 `pkg/services/authz/rbac/service.go:116`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@pkg/services/authz/rbac/cache.go` (line 31, Important):\n   `userPermDenialCacheKey` joins name and parent with `_` unescaped, so name `a_b`/folder `c` and name `a`/folder `b_c` yield the same key. A cached denial for one wrongly denies the other; use a separator that can't appear in UIDs, or hash the parts.\n\n2. In `@pkg/services/authz/rbac/service.go` (line 116, Important):\n   The denial key built from `checkReq.UserUID` omits identity type, and anonymous and render identities both use UID \"0\". An anonymous denial of `dashboards:read` can then wrongly deny the renderer for up to 30s; include the identity type in the key.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 1 more finding is kept in notes and is not shown on this PR.","inline_comments":[{"path":"pkg/services/authz/rbac/cache.go","line":31,"body":"\ud83d\udfe0 **Important**\n\n**`userPermDenialCacheKey` joins name and parent with `_` unescaped, so name `a_b`/folder `c` and n...**\n\n`userPermDenialCacheKey` joins name and parent with `_` unescaped, so name `a_b`/folder `c` and name `a`/folder `b_c` yield the same key. A cached denial for one wrongly denies the other; use a separator that can't appear in UIDs, or hash the parts."},{"path":"pkg/services/authz/rbac/service.go","line":116,"body":"\ud83d\udfe0 **Important**\n\n**The denial key built from `checkReq.UserUID` omits identity type, and anonymous and render identi...**\n\nThe denial key built from `checkReq.UserUID` omits identity type, and anonymous and render identities both use UID \"0\". An anonymous denial of `dashboards:read` can then wrongly deny the renderer for up to 30s; include the identity type in the key."}]},"grafana__grafana__PR106778":{"pull_request":"https://github.com/grafana/grafana/pull/106778","project":"Grafana","review_body":"**Vortex: 3 issues to fix** at `8df8503` \u00b7 14/14 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udfe0 **Important** \u00b7 **Keep federated ruler rules immutable** \u00b7 `public/app/features/alerting/unified/hooks/useAbilities.ts:245`\n- \ud83d\udfe0 **Important** \u00b7 **The \\`&lt;GrafanaRuleListItem&gt;\\` in \\`rules.map\\` lacks \\`key={key}\\` (the other branches have it), causin...** \u00b7 `public/app/features/alerting/unified/rule-list/FilterView.tsx:157`\n- \ud83d\udfe0 **Important** \u00b7 **\\`GrafanaRuleListItem\\` builds \\`href\\` with \\`createRelativeUrl(\\`/alerting/grafana/${uid}/view\\`)\\` wit...** \u00b7 `public/app/features/alerting/unified/rule-list/GrafanaRuleListItem.tsx:40`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@public/app/features/alerting/unified/hooks/useAbilities.ts` (line 245, Important):\n   `const isFederated = false` in `useAllRulerRuleAbilities` makes federated Mimir rules editable/deletable/pausable, where the old code blocked them via `isFederatedRuleGroup(rule.group)`. Pass the group/federated status into the hook.\n\n2. In `@public/app/features/alerting/unified/rule-list/FilterView.tsx` (line 157, Important):\n   The `<GrafanaRuleListItem>` in `rules.map` lacks `key={key}` (the other branches have it), causing React key warnings and possible state reuse across rules. Add `key={key}`.\n\n3. In `@public/app/features/alerting/unified/rule-list/GrafanaRuleListItem.tsx` (line 40, Important):\n   `GrafanaRuleListItem` builds `href` with `createRelativeUrl(`/alerting/grafana/${uid}/view`)` without `returnTo`, so back navigation from the view page no longer returns to the filtered list. Pass `{ returnTo: createReturnTo() }` to `createRelativeUrl`, as before.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 4 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"public/app/features/alerting/unified/hooks/useAbilities.ts","line":245,"body":"\ud83d\udfe0 **Important**\n\n**Keep federated ruler rules immutable**\n\n`const isFederated = false` in `useAllRulerRuleAbilities` makes federated Mimir rules editable/deletable/pausable, where the old code blocked them via `isFederatedRuleGroup(rule.group)`. Pass the group/federated status into the hook."},{"path":"public/app/features/alerting/unified/rule-list/FilterView.tsx","line":157,"body":"\ud83d\udfe0 **Important**\n\n**The `<GrafanaRuleListItem>` in `rules.map` lacks `key={key}` (the other branches have it), causin...**\n\nThe `<GrafanaRuleListItem>` in `rules.map` lacks `key={key}` (the other branches have it), causing React key warnings and possible state reuse across rules. Add `key={key}`."},{"path":"public/app/features/alerting/unified/rule-list/GrafanaRuleListItem.tsx","line":40,"body":"\ud83d\udfe0 **Important**\n\n**`GrafanaRuleListItem` builds `href` with `createRelativeUrl(`/alerting/grafana/${uid}/view`)` wit...**\n\n`GrafanaRuleListItem` builds `href` with `createRelativeUrl(`/alerting/grafana/${uid}/view`)` without `returnTo`, so back navigation from the view page no longer returns to the filtered list. Pass `{ returnTo: createReturnTo() }` to `createRelativeUrl`, as before."}]},"grafana__grafana__PR107534":{"pull_request":"https://github.com/grafana/grafana/pull/107534","project":"Grafana","review_body":"**Vortex: 1 issue to fix** at `1cab414` \u00b7 4/4 files reviewed\n\nActionable comment posted: 1\n\n- \ud83d\udfe0 **Important** \u00b7 **Avoid reapplying ad hoc filters to split targets** \u00b7 `public/app/plugins/datasource/loki/querySplitting.ts:299`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (1 finding)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@public/app/plugins/datasource/loki/querySplitting.ts` (line 299, Important):\n   `runSplitQuery` and `runShardSplitQuery` call `applyTemplateVariables(query, request.scopedVars, request.filters)`, then `DataSourceWithBackend.query` applies `request.filters` again, and `addAdHocFilters` doesn't dedupe. Apply the filters in only one place.\n```\n\n</details>","inline_comments":[{"path":"public/app/plugins/datasource/loki/querySplitting.ts","line":299,"body":"\ud83d\udfe0 **Important**\n\n**Avoid reapplying ad hoc filters to split targets**\n\n`runSplitQuery` and `runShardSplitQuery` call `applyTemplateVariables(query, request.scopedVars, request.filters)`, then `DataSourceWithBackend.query` applies `request.filters` again, and `addAdHocFilters` doesn't dedupe. Apply the filters in only one place."}]},"grafana__grafana__PR76186":{"pull_request":"https://github.com/grafana/grafana/pull/76186","project":"Grafana","review_body":"**Vortex: 2 issues to fix** at `303cdc2` \u00b7 8/8 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **TestLogger.FromContext returns a new logger, so calls are not recorded on the injected fake** \u00b7 `pkg/plugins/log/fake.go:47`\n- \ud83d\udfe0 **Important** \u00b7 **\\`req.PluginContext\\` is dereferenced without a nil check in \\`QueryData\\`, \\`CallResource\\`, \\`CheckHea...** \u00b7 `pkg/services/pluginsintegration/clientmiddleware/contextual_logger_middleware.go:40`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@pkg/plugins/log/fake.go` (line 47, Important):\n   `TestLogger.FromContext` returns `NewTestLogger()`, so `LoggerMiddleware`'s `m.logger.FromContext(ctx).Info(...)` is logged on a throwaway instance. A test asserting `InfoLogs.Calls` on the injected fake sees 0; return `f` instead.\n\n2. In `@pkg/services/pluginsintegration/clientmiddleware/contextual_logger_middleware.go` (line 40, Important):\n   `req.PluginContext` is dereferenced without a nil check in `QueryData`, `CallResource`, `CheckHealth` and `CollectMetrics`. A nil request now panics here instead of reaching `next`, unlike `LoggerMiddleware`; add matching nil guards.\n```\n\n</details>","inline_comments":[{"path":"pkg/plugins/log/fake.go","line":47,"body":"\ud83d\udfe0 **Important**\n\n**TestLogger.FromContext returns a new logger, so calls are not recorded on the injected fake**\n\n`TestLogger.FromContext` returns `NewTestLogger()`, so `LoggerMiddleware`'s `m.logger.FromContext(ctx).Info(...)` is logged on a throwaway instance. A test asserting `InfoLogs.Calls` on the injected fake sees 0; return `f` instead."},{"path":"pkg/services/pluginsintegration/clientmiddleware/contextual_logger_middleware.go","line":40,"body":"\ud83d\udfe0 **Important**\n\n**`req.PluginContext` is dereferenced without a nil check in `QueryData`, `CallResource`, `CheckHea...**\n\n`req.PluginContext` is dereferenced without a nil check in `QueryData`, `CallResource`, `CheckHealth` and `CollectMetrics`. A nil request now panics here instead of reaching `next`, unlike `LoggerMiddleware`; add matching nil guards."}]},"grafana__grafana__PR79265":{"pull_request":"https://github.com/grafana/grafana/pull/79265","project":"Grafana","review_body":"**Vortex: changes requested, 2 issues to fix** at `bbd8c50` \u00b7 11/11 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`CreateOrUpdateDevice\\` calls \\`CountDevices\\` and then does a separate upsert with no transaction o...** \u00b7 `pkg/services/anonymous/anonimpl/anonstore/database.go:110`\n- \ud83d\udd34 **Blocker** \u00b7 **\\`tagDeviceUI\\` calls \\`localCache.SetDefault(key, ...)\\` before \\`CreateOrUpdateDevice\\`, so after \\`Er...** \u00b7 `pkg/services/anonymous/anonimpl/client.go:45`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@pkg/services/anonymous/anonimpl/anonstore/database.go` (line 110, Important):\n   `CreateOrUpdateDevice` calls `CountDevices` and then does a separate upsert with no transaction or lock. Concurrent new devices at count == limit-1 can all pass the check and insert, exceeding the limit; make the check and insert atomic, e.g. a conditional INSERT ... SELECT.\n\n2. In `@pkg/services/anonymous/anonimpl/client.go` (line 45, Blocker):\n   `tagDeviceUI` calls `localCache.SetDefault(key, ...)` before `CreateOrUpdateDevice`, so after `ErrDeviceLimitReached` the key stays cached. The device's next request hits the cache and `TagDevice` returns nil, bypassing the limit; set the cache only after success or delete the key on error.\n```\n\n</details>","inline_comments":[{"path":"pkg/services/anonymous/anonimpl/anonstore/database.go","line":110,"body":"\ud83d\udfe0 **Important**\n\n**`CreateOrUpdateDevice` calls `CountDevices` and then does a separate upsert with no transaction o...**\n\n`CreateOrUpdateDevice` calls `CountDevices` and then does a separate upsert with no transaction or lock. Concurrent new devices at count == limit-1 can all pass the check and insert, exceeding the limit; make the check and insert atomic, e.g. a conditional INSERT ... SELECT."},{"path":"pkg/services/anonymous/anonimpl/client.go","line":45,"body":"\ud83d\udd34 **Blocker**\n\n**`tagDeviceUI` calls `localCache.SetDefault(key, ...)` before `CreateOrUpdateDevice`, so after `Er...**\n\n`tagDeviceUI` calls `localCache.SetDefault(key, ...)` before `CreateOrUpdateDevice`, so after `ErrDeviceLimitReached` the key stays cached. The device's next request hits the cache and `TagDevice` returns nil, bypassing the limit; set the cache only after success or delete the key on error."}]},"grafana__grafana__PR80329":{"pull_request":"https://github.com/grafana/grafana/pull/80329","project":"Grafana","review_body":"**Vortex: 2 issues to fix** at `04cfa3b` \u00b7 3/3 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **Routine batch progress logged at Error level with full ID lists** \u00b7 `pkg/services/annotations/annotationsimpl/xorm_store.go:534`\n- \ud83d\udfe0 **Important** \u00b7 **\\`time.NewTicker(time.Minute \\* 1)\\` in cleanup.go changed the interval from 10 minutes to 1, so eve...** \u00b7 `pkg/services/cleanup/cleanup.go:77`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@pkg/services/annotations/annotationsimpl/xorm_store.go` (line 534, Important):\n   The annotation/tag cleanup in xorm_store.go logs every successful batch at Error level (`r.log.Error(\"Annotations to clean by time\", ... \"ids\", ids ...)` and the by-count, tags and \"cleaned\" lines). Use Debug and drop the full `ids` list.\n\n2. In `@pkg/services/cleanup/cleanup.go` (line 77, Important):\n   `time.NewTicker(time.Minute * 1)` in cleanup.go changed the interval from 10 minutes to 1, so every cleanup job runs 10x as often, adding DB load and lock contention. Unless this is intentional, revert it to `time.Minute * 10`.\n```\n\n</details>","inline_comments":[{"path":"pkg/services/annotations/annotationsimpl/xorm_store.go","line":534,"body":"\ud83d\udfe0 **Important**\n\n**Routine batch progress logged at Error level with full ID lists**\n\nThe annotation/tag cleanup in xorm_store.go logs every successful batch at Error level (`r.log.Error(\"Annotations to clean by time\", ... \"ids\", ids ...)` and the by-count, tags and \"cleaned\" lines). Use Debug and drop the full `ids` list."},{"path":"pkg/services/cleanup/cleanup.go","line":77,"body":"\ud83d\udfe0 **Important**\n\n**`time.NewTicker(time.Minute * 1)` in cleanup.go changed the interval from 10 minutes to 1, so eve...**\n\n`time.NewTicker(time.Minute * 1)` in cleanup.go changed the interval from 10 minutes to 1, so every cleanup job runs 10x as often, adding DB load and lock contention. Unless this is intentional, revert it to `time.Minute * 10`."}]},"grafana__grafana__PR90045":{"pull_request":"https://github.com/grafana/grafana/pull/90045","project":"Grafana","review_body":"**Vortex: changes requested, 6 issues to fix** at `e369f24` \u00b7 5/5 files reviewed\n\nActionable comments posted: 6\n\n- \ud83d\udd34 **Blocker** \u00b7 **Async legacy write uses the request context** \u00b7 `pkg/apiserver/rest/dualwriter_mode3.go:51`\n- \ud83d\udfe0 **Important** \u00b7 **\\`d.recordLegacyDuration(true, ...)\\` is called when the Storage create fails. The error is recorde...** \u00b7 `pkg/apiserver/rest/dualwriter_mode3.go:45`\n- \ud83d\udfe0 **Important** \u00b7 **\\`klog.NewContext(ctx, d.Log)\\` stores the base logger and drops the \\`name\\`, \\`kind\\` and \\`method\\` va...** \u00b7 `pkg/apiserver/rest/dualwriter_mode3.go:97`\n- \ud83d\udfe0 **Important** \u00b7 **\\`d.recordStorageDuration(false, mode3Str, name, ...)\\` in Delete uses the object \\`name\\` as the met...** \u00b7 `pkg/apiserver/rest/dualwriter_mode3.go:103`\n- \ud83d\udfe0 **Important** \u00b7 **In \\`DualWriterMode3.Update\\`, the storage-failure path calls \\`d.recordLegacyDuration(true, ...)\\`, ...** \u00b7 `pkg/apiserver/rest/dualwriter_mode3.go:128`\n- \ud83d\udfe0 **Important** \u00b7 **In \\`DualWriterMode3.DeleteCollection\\`, the goroutine running \\`Legacy.DeleteCollection\\` calls \\`d.r...** \u00b7 `pkg/apiserver/rest/dualwriter_mode3.go:167`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (6 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@pkg/apiserver/rest/dualwriter_mode3.go` (line 51, Blocker):\n   The async legacy write in `Create` uses `context.WithTimeoutCause(ctx, ...)`, which derives from the request context that is canceled when the handler returns. `d.Legacy.Create` will usually fail with context canceled, so the object is never written to legacy storage; detach with `context.WithoutCancel(ctx)`.\n\n2. In `@pkg/apiserver/rest/dualwriter_mode3.go` (line 45, Important):\n   `d.recordLegacyDuration(true, ...)` is called when the Storage create fails. The error is recorded in the legacy metric instead of the storage metric. Use `recordStorageDuration`.\n\n3. In `@pkg/apiserver/rest/dualwriter_mode3.go` (line 97, Important):\n   `klog.NewContext(ctx, d.Log)` stores the base logger and drops the `name`, `kind` and `method` values that `log` carries. Pass `log` instead.\n\n4. In `@pkg/apiserver/rest/dualwriter_mode3.go` (line 103, Important):\n   `d.recordStorageDuration(false, mode3Str, name, ...)` in Delete uses the object `name` as the metric label instead of `options.Kind`, creating a high-cardinality label and a wrong series. Use `options.Kind`.\n\n5. In `@pkg/apiserver/rest/dualwriter_mode3.go` (line 128, Important):\n   In `DualWriterMode3.Update`, the storage-failure path calls `d.recordLegacyDuration(true, ...)`, so the storage error is recorded in the legacy metric. Use `recordStorageDuration`.\n\n6. In `@pkg/apiserver/rest/dualwriter_mode3.go` (line 167, Important):\n   In `DualWriterMode3.DeleteCollection`, the goroutine running `Legacy.DeleteCollection` calls `d.recordStorageDuration(err != nil, ...)`, so the legacy duration is recorded in the storage metric. Use `recordLegacyDuration`.\n```\n\n</details>","inline_comments":[{"path":"pkg/apiserver/rest/dualwriter_mode3.go","line":51,"body":"\ud83d\udd34 **Blocker**\n\n**Async legacy write uses the request context**\n\nThe async legacy write in `Create` uses `context.WithTimeoutCause(ctx, ...)`, which derives from the request context that is canceled when the handler returns. `d.Legacy.Create` will usually fail with context canceled, so the object is never written to legacy storage; detach with `context.WithoutCancel(ctx)`."},{"path":"pkg/apiserver/rest/dualwriter_mode3.go","line":45,"body":"\ud83d\udfe0 **Important**\n\n**`d.recordLegacyDuration(true, ...)` is called when the Storage create fails. The error is recorde...**\n\n`d.recordLegacyDuration(true, ...)` is called when the Storage create fails. The error is recorded in the legacy metric instead of the storage metric. Use `recordStorageDuration`."},{"path":"pkg/apiserver/rest/dualwriter_mode3.go","line":97,"body":"\ud83d\udfe0 **Important**\n\n**`klog.NewContext(ctx, d.Log)` stores the base logger and drops the `name`, `kind` and `method` va...**\n\n`klog.NewContext(ctx, d.Log)` stores the base logger and drops the `name`, `kind` and `method` values that `log` carries. Pass `log` instead."},{"path":"pkg/apiserver/rest/dualwriter_mode3.go","line":103,"body":"\ud83d\udfe0 **Important**\n\n**`d.recordStorageDuration(false, mode3Str, name, ...)` in Delete uses the object `name` as the met...**\n\n`d.recordStorageDuration(false, mode3Str, name, ...)` in Delete uses the object `name` as the metric label instead of `options.Kind`, creating a high-cardinality label and a wrong series. Use `options.Kind`."},{"path":"pkg/apiserver/rest/dualwriter_mode3.go","line":128,"body":"\ud83d\udfe0 **Important**\n\n**In `DualWriterMode3.Update`, the storage-failure path calls `d.recordLegacyDuration(true, ...)`, ...**\n\nIn `DualWriterMode3.Update`, the storage-failure path calls `d.recordLegacyDuration(true, ...)`, so the storage error is recorded in the legacy metric. Use `recordStorageDuration`."},{"path":"pkg/apiserver/rest/dualwriter_mode3.go","line":167,"body":"\ud83d\udfe0 **Important**\n\n**In `DualWriterMode3.DeleteCollection`, the goroutine running `Legacy.DeleteCollection` calls `d.r...**\n\nIn `DualWriterMode3.DeleteCollection`, the goroutine running `Legacy.DeleteCollection` calls `d.recordStorageDuration(err != nil, ...)`, so the legacy duration is recorded in the storage metric. Use `recordLegacyDuration`."}]},"grafana__grafana__PR90939":{"pull_request":"https://github.com/grafana/grafana/pull/90939","project":"Grafana","review_body":"**Vortex: 2 issues to fix** at `b1613e3` \u00b7 1/1 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`GetWebAssets\\` doesn&#39;t re-check \\`entryPointAssetsCache\\` after taking \\`entryPointAssetsCacheMu.Loc...** \u00b7 `pkg/api/webassets/webassets.go:49`\n- \ud83d\udfe0 **Important** \u00b7 **\\`entryPointAssetsCache = result\\` runs even when \\`err != nil\\`, so a failed manifest read overwrite...** \u00b7 `pkg/api/webassets/webassets.go:52`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@pkg/api/webassets/webassets.go` (line 49, Important):\n   `GetWebAssets` doesn't re-check `entryPointAssetsCache` after taking `entryPointAssetsCacheMu.Lock()`. Goroutines that missed under the RLock each re-read and parse `assets-manifest.json`; re-check the cache after locking and return it if non-nil and `cfg.Env != setting.Dev`.\n\n2. In `@pkg/api/webassets/webassets.go` (line 52, Important):\n   `entryPointAssetsCache = result` runs even when `err != nil`, so a failed manifest read overwrites a previously good cache with nil. Only assign when `err == nil`.\n```\n\n</details>","inline_comments":[{"path":"pkg/api/webassets/webassets.go","line":49,"body":"\ud83d\udfe0 **Important**\n\n**`GetWebAssets` doesn't re-check `entryPointAssetsCache` after taking `entryPointAssetsCacheMu.Loc...**\n\n`GetWebAssets` doesn't re-check `entryPointAssetsCache` after taking `entryPointAssetsCacheMu.Lock()`. Goroutines that missed under the RLock each re-read and parse `assets-manifest.json`; re-check the cache after locking and return it if non-nil and `cfg.Env != setting.Dev`."},{"path":"pkg/api/webassets/webassets.go","line":52,"body":"\ud83d\udfe0 **Important**\n\n**`entryPointAssetsCache = result` runs even when `err != nil`, so a failed manifest read overwrite...**\n\n`entryPointAssetsCache = result` runs even when `err != nil`, so a failed manifest read overwrites a previously good cache with nil. Only assign when `err == nil`."}]},"grafana__grafana__PR94942":{"pull_request":"https://github.com/grafana/grafana/pull/94942","project":"Grafana","review_body":"**Vortex: 2 issues to fix** at `f3317b3` \u00b7 7/7 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`enableSqlExpressions\\` returns false on every path, and it first calls \\`h.features.IsEnabledGloba...** \u00b7 `pkg/expr/reader.go:194`\n- \ud83d\udfe0 **Important** \u00b7 **\\`NewSQLCommand\\` wraps the stub&#39;s &quot;not implemented&quot; error from \\`TablesList\\` \u2192 \\`RunCommands\\` as a g...** \u00b7 `pkg/expr/sql/db.go:13`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@pkg/expr/reader.go` (line 194, Important):\n   `enableSqlExpressions` returns false on every path, and it first calls `h.features.IsEnabledGlobally`, which panics if `features` is nil. If it's meant as a hard kill switch, return false without touching `features`; otherwise fix the inverted `!IsEnabledGlobally`.\n\n2. In `@pkg/expr/sql/db.go` (line 13, Important):\n   `NewSQLCommand` wraps the stub's \"not implemented\" error from `TablesList` \u2192 `RunCommands` as a generic 400 \"error reading SQL command\", so the disabled-SQL reason appears only in the server log. Surface the disabled state explicitly on this path.\n```\n\n</details>","inline_comments":[{"path":"pkg/expr/reader.go","line":194,"body":"\ud83d\udfe0 **Important**\n\n**`enableSqlExpressions` returns false on every path, and it first calls `h.features.IsEnabledGloba...**\n\n`enableSqlExpressions` returns false on every path, and it first calls `h.features.IsEnabledGlobally`, which panics if `features` is nil. If it's meant as a hard kill switch, return false without touching `features`; otherwise fix the inverted `!IsEnabledGlobally`."},{"path":"pkg/expr/sql/db.go","line":13,"body":"\ud83d\udfe0 **Important**\n\n**`NewSQLCommand` wraps the stub's \"not implemented\" error from `TablesList` \u2192 `RunCommands` as a g...**\n\n`NewSQLCommand` wraps the stub's \"not implemented\" error from `TablesList` \u2192 `RunCommands` as a generic 400 \"error reading SQL command\", so the disabled-SQL reason appears only in the server log. Surface the disabled state explicitly on this path."}]},"grafana__grafana__PR97529":{"pull_request":"https://github.com/grafana/grafana/pull/97529","project":"Grafana","review_body":"**Vortex: 2 issues to fix** at `26fed31` \u00b7 5/5 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **TotalDocs iterates the cache map without the lock** \u00b7 `pkg/storage/unified/resource/search.go:216`\n- \ud83d\udfe0 **Important** \u00b7 **\\`BuildIndex\\` holds \\`cacheMu\\` only for the map write, and \\`getOrCreateIndex\\` does a non-atomic Get...** \u00b7 `pkg/storage/unified/search/bleve.go:137`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@pkg/storage/unified/resource/search.go` (line 216, Important):\n   `TotalDocs()` in bleve.go ranges over `b.cache` without taking `cacheMu`, while the event goroutine's `handleEvent` -> `BuildIndex` writes `b.cache[key]` under it. A concurrent watch event can cause a fatal \"concurrent map read and map write\". Take `cacheMu.RLock()` in `TotalDocs`.\n\n2. In `@pkg/storage/unified/search/bleve.go` (line 137, Important):\n   `BuildIndex` holds `cacheMu` only for the map write, and `getOrCreateIndex` does a non-atomic GetIndex-then-build. Concurrent searches for the same uncached key both build: file-backed `bleve.New(dir)` fails, and memory indexes overwrite and leak one. Add a per-key guard or re-check the cache under the lock.\n```\n\n</details>","inline_comments":[{"path":"pkg/storage/unified/resource/search.go","line":216,"body":"\ud83d\udfe0 **Important**\n\n**TotalDocs iterates the cache map without the lock**\n\n`TotalDocs()` in bleve.go ranges over `b.cache` without taking `cacheMu`, while the event goroutine's `handleEvent` -> `BuildIndex` writes `b.cache[key]` under it. A concurrent watch event can cause a fatal \"concurrent map read and map write\". Take `cacheMu.RLock()` in `TotalDocs`."},{"path":"pkg/storage/unified/search/bleve.go","line":137,"body":"\ud83d\udfe0 **Important**\n\n**`BuildIndex` holds `cacheMu` only for the map write, and `getOrCreateIndex` does a non-atomic Get...**\n\n`BuildIndex` holds `cacheMu` only for the map write, and `getOrCreateIndex` does a non-atomic GetIndex-then-build. Concurrent searches for the same uncached key both build: file-backed `bleve.New(dir)` fails, and memory indexes overwrite and leak one. Add a per-key guard or re-check the cache under the lock."}]},"keycloak__keycloak-greptile__PR1":{"pull_request":"https://github.com/ai-code-review-evaluation/keycloak-greptile/pull/1","project":"Keycloak","review_body":"**Vortex: changes requested, 3 issues to fix** at `3214b18` \u00b7 9/9 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udd34 **Blocker** \u00b7 **\\`isConditionalPasskeysEnabled()\\` at UsernameForm.java:47 has no no-arg overload (only \\`isConditio...** \u00b7 `services/src/main/java/org/keycloak/authentication/authenticators/browser/UsernameForm.java:47`\n- \ud83d\udd34 **Blocker** \u00b7 **\\`isConditionalPasskeysEnabled(UserModel)\\` returns false when \\`user == null\\`, the normal fresh-log...** \u00b7 `services/src/main/java/org/keycloak/authentication/authenticators/browser/UsernamePasswordForm.java:161`\n- \ud83d\udfe0 **Important** \u00b7 **Comment typo: \\`Succesful\\` should be \\`Successful\\`** \u00b7 `testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/webauthn/passwordless/PasskeysUsernamePasswordFormTest.java:413`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@services/src/main/java/org/keycloak/authentication/authenticators/browser/UsernameForm.java` (line 47, Blocker):\n   `isConditionalPasskeysEnabled()` at UsernameForm.java:47 has no no-arg overload (only `isConditionalPasskeysEnabled(UserModel)` exists), so it won't compile. Pass `context.getUser()`.\n\n2. In `@services/src/main/java/org/keycloak/authentication/authenticators/browser/UsernamePasswordForm.java` (line 161, Blocker):\n   `isConditionalPasskeysEnabled(UserModel)` returns false when `user == null`, the normal fresh-login case, so `authenticate()` and `challenge()` skip `webauthnAuth.fillContextForm` and conditional-UI passkey login breaks. Drop the `user != null` requirement or adjust the callers.\n\n3. In `@testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/webauthn/passwordless/PasskeysUsernamePasswordFormTest.java` (line 413, Important):\n   Comment typo: `Succesful` should be `Successful`.\n```\n\n</details>","inline_comments":[{"path":"services/src/main/java/org/keycloak/authentication/authenticators/browser/UsernameForm.java","line":47,"body":"\ud83d\udd34 **Blocker**\n\n**`isConditionalPasskeysEnabled()` at UsernameForm.java:47 has no no-arg overload (only `isConditio...**\n\n`isConditionalPasskeysEnabled()` at UsernameForm.java:47 has no no-arg overload (only `isConditionalPasskeysEnabled(UserModel)` exists), so it won't compile. Pass `context.getUser()`."},{"path":"services/src/main/java/org/keycloak/authentication/authenticators/browser/UsernamePasswordForm.java","line":161,"body":"\ud83d\udd34 **Blocker**\n\n**`isConditionalPasskeysEnabled(UserModel)` returns false when `user == null`, the normal fresh-log...**\n\n`isConditionalPasskeysEnabled(UserModel)` returns false when `user == null`, the normal fresh-login case, so `authenticate()` and `challenge()` skip `webauthnAuth.fillContextForm` and conditional-UI passkey login breaks. Drop the `user != null` requirement or adjust the callers."},{"path":"testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/webauthn/passwordless/PasskeysUsernamePasswordFormTest.java","line":413,"body":"\ud83d\udfe0 **Important**\n\n**Comment typo: `Succesful` should be `Successful`**\n\nComment typo: `Succesful` should be `Successful`."}]},"keycloak__keycloak__PR32918":{"pull_request":"https://github.com/keycloak/keycloak/pull/32918","project":"Keycloak","review_body":"**Vortex: 2 issues to fix** at `e944e2a` \u00b7 4/4 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **Login cache not invalidated on update while the org is disabled** \u00b7 `model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/InfinispanIdentityProviderStorageProvider.java:93`\n- \ud83d\udfe0 **Important** \u00b7 **\\`getCleanup().addCleanup(testRealm().identityProviders().get(&quot;alias&quot;)::remove)\\` uses the literal ...** \u00b7 `testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/organization/cache/OrganizationCacheTest.java:381`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/InfinispanIdentityProviderStorageProvider.java` (line 93, Important):\n   `update()` passes `idpById` (wrapped by `createOrganizationAwareIdentityProviderModel`) to `registerIDPLoginInvalidationOnUpdate`. While the org is disabled `isEnabled()` is false, so login-affecting updates skip invalidation and leave stale cached login IdPs; use the raw `idpDelegate.getById(...)` model.\n\n2. In `@testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/organization/cache/OrganizationCacheTest.java` (line 381, Important):\n   `getCleanup().addCleanup(testRealm().identityProviders().get(\"alias\")::remove)` uses the literal \"alias\" instead of the created alias (`\"idp-alias-\" + i`, `idp-alias-20`), so the IdPs are never cleaned up. Register cleanup with the real alias via a `final String alias` local.\n```\n\n</details>","inline_comments":[{"path":"model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/InfinispanIdentityProviderStorageProvider.java","line":93,"body":"\ud83d\udfe0 **Important**\n\n**Login cache not invalidated on update while the org is disabled**\n\n`update()` passes `idpById` (wrapped by `createOrganizationAwareIdentityProviderModel`) to `registerIDPLoginInvalidationOnUpdate`. While the org is disabled `isEnabled()` is false, so login-affecting updates skip invalidation and leave stale cached login IdPs; use the raw `idpDelegate.getById(...)` model."},{"path":"testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/organization/cache/OrganizationCacheTest.java","line":381,"body":"\ud83d\udfe0 **Important**\n\n**`getCleanup().addCleanup(testRealm().identityProviders().get(\"alias\")::remove)` uses the literal ...**\n\n`getCleanup().addCleanup(testRealm().identityProviders().get(\"alias\")::remove)` uses the literal \"alias\" instead of the created alias (`\"idp-alias-\" + i`, `idp-alias-20`), so the IdPs are never cleaned up. Register cleanup with the real alias via a `final String alias` local."}]},"keycloak__keycloak__PR33832":{"pull_request":"https://github.com/keycloak/keycloak/pull/33832","project":"Keycloak","review_body":"**Vortex: 2 issues to fix** at `79d11c4` \u00b7 12/12 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **ASN1Decoder.readLength() returns -1 for indefinite length (0x80) and callers use it unchecked: \\`r...** \u00b7 `authz/client/src/main/java/org/keycloak/authorization/client/util/crypto/ASN1Decoder.java:72`\n- \ud83d\udfe0 **Important** \u00b7 **Dead ASN1Encoder calls in concatenatedRSToASN1DER** \u00b7 `authz/client/src/main/java/org/keycloak/authorization/client/util/crypto/AuthzClientCryptoProvider.java:114`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@authz/client/src/main/java/org/keycloak/authorization/client/util/crypto/ASN1Decoder.java` (line 72, Important):\n   ASN1Decoder.readLength() returns -1 for indefinite length (0x80) and callers use it unchecked: `read(-1)` throws NegativeArraySizeException, and an empty INTEGER (`02 00`) makes `new BigInteger` throw NumberFormatException. Reject negative/zero lengths with IOException.\n\n2. In `@authz/client/src/main/java/org/keycloak/authorization/client/util/crypto/AuthzClientCryptoProvider.java` (line 114, Important):\n   `ASN1Encoder.create().write(rBigInteger);` and the same call for `sBigInteger` create new encoders and discard them. They do nothing, because the real encoding happens in the writeDerSeq call below. Remove both lines.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 4 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"authz/client/src/main/java/org/keycloak/authorization/client/util/crypto/ASN1Decoder.java","line":72,"body":"\ud83d\udfe0 **Important**\n\n**ASN1Decoder.readLength() returns -1 for indefinite length (0x80) and callers use it unchecked: `r...**\n\nASN1Decoder.readLength() returns -1 for indefinite length (0x80) and callers use it unchecked: `read(-1)` throws NegativeArraySizeException, and an empty INTEGER (`02 00`) makes `new BigInteger` throw NumberFormatException. Reject negative/zero lengths with IOException."},{"path":"authz/client/src/main/java/org/keycloak/authorization/client/util/crypto/AuthzClientCryptoProvider.java","line":114,"body":"\ud83d\udfe0 **Important**\n\n**Dead ASN1Encoder calls in concatenatedRSToASN1DER**\n\n`ASN1Encoder.create().write(rBigInteger);` and the same call for `sBigInteger` create new encoders and discard them. They do nothing, because the real encoding happens in the writeDerSeq call below. Remove both lines."}]},"keycloak__keycloak__PR36880":{"pull_request":"https://github.com/keycloak/keycloak/pull/36880","project":"Keycloak","review_body":"**Vortex: changes requested, 2 issues to fix** at `1950a51` \u00b7 10/10 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udd34 **Blocker** \u00b7 **Literal &quot;Clients&quot; returned as a client ID causes NPE in role-mapping endpoint** \u00b7 `services/src/main/java/org/keycloak/services/resources/admin/permissions/ClientPermissionsV2.java:140`\n- \ud83d\udfe0 **Important** \u00b7 **Client deletion throws when V1 and V2 are both enabled** \u00b7 `services/src/main/java/org/keycloak/services/resources/admin/permissions/AdminPermissions.java:91`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@services/src/main/java/org/keycloak/services/resources/admin/permissions/ClientPermissionsV2.java` (line 140, Blocker):\n   `ClientPermissionsV2.getClientsWithPermission` adds `resource.getName()` for the all-clients type resource, so the literal \"Clients\" is returned as a client ID. `AvailableRoleMappingResource.getRoleIdsWithPermissions` then NPEs on `realm.getClientById(\"Clients\")`; skip or filter out the type-level resource.\n\n2. In `@services/src/main/java/org/keycloak/services/resources/admin/permissions/AdminPermissions.java` (line 91, Important):\n   `AdminPermissions` calls `clients().setPermissionsEnabled(cast.getClient(), false)` on client removal, and `ClientPermissionsV2.setPermissionsEnabled` throws `UnsupportedOperationException`. With V1 and V2 both enabled, every client delete fails; avoid the call under V2 or implement it.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 3 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"services/src/main/java/org/keycloak/services/resources/admin/permissions/ClientPermissionsV2.java","line":140,"body":"\ud83d\udd34 **Blocker**\n\n**Literal \"Clients\" returned as a client ID causes NPE in role-mapping endpoint**\n\n`ClientPermissionsV2.getClientsWithPermission` adds `resource.getName()` for the all-clients type resource, so the literal \"Clients\" is returned as a client ID. `AvailableRoleMappingResource.getRoleIdsWithPermissions` then NPEs on `realm.getClientById(\"Clients\")`; skip or filter out the type-level resource."},{"path":"services/src/main/java/org/keycloak/services/resources/admin/permissions/AdminPermissions.java","line":91,"body":"\ud83d\udfe0 **Important**\n\n**Client deletion throws when V1 and V2 are both enabled**\n\n`AdminPermissions` calls `clients().setPermissionsEnabled(cast.getClient(), false)` on client removal, and `ClientPermissionsV2.setPermissionsEnabled` throws `UnsupportedOperationException`. With V1 and V2 both enabled, every client delete fails; avoid the call under V2 or implement it."}]},"keycloak__keycloak__PR36882":{"pull_request":"https://github.com/keycloak/keycloak/pull/36882","project":"Keycloak","review_body":"**Vortex: 1 issue to fix** at `62bf989` \u00b7 10/11 files reviewed\n\nActionable comment posted: 1\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`RECREATE\\_UPGRADE\\_EXIT\\_CODE\\` changes from 4 to 3 and 4 is reused for \\`FEATURE\\_DISABLED\\`. Scripts ...** \u00b7 `quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java:34`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (1 finding)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java` (line 34, Important):\n   `RECREATE_UPGRADE_EXIT_CODE` changes from 4 to 3 and 4 is reused for `FEATURE_DISABLED`. Scripts that treat 4 as \"recreate upgrade\" will misread a disabled feature as recreate. Document the change in the upgrade notes and exit-code docs.\n```\n\n</details>","inline_comments":[{"path":"quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java","line":34,"body":"\ud83d\udfe0 **Important**\n\n**`RECREATE_UPGRADE_EXIT_CODE` changes from 4 to 3 and 4 is reused for `FEATURE_DISABLED`. Scripts ...**\n\n`RECREATE_UPGRADE_EXIT_CODE` changes from 4 to 3 and 4 is reused for `FEATURE_DISABLED`. Scripts that treat 4 as \"recreate upgrade\" will misread a disabled feature as recreate. Document the change in the upgrade notes and exit-code docs."}]},"keycloak__keycloak__PR37038":{"pull_request":"https://github.com/keycloak/keycloak/pull/37038","project":"Keycloak","review_body":"**Vortex: changes requested, 2 issues to fix** at `7355f05` \u00b7 19/19 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udd34 **Blocker** \u00b7 **\\`GroupPermissionsV2.canManage()\\` calls \\`hasPermission(null, VIEW, MANAGE)\\`, so an admin with only...** \u00b7 `services/src/main/java/org/keycloak/services/resources/admin/permissions/GroupPermissionsV2.java:70`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@services/src/main/java/org/keycloak/services/resources/admin/permissions/GroupPermissionsV2.java` (line 70, Blocker):\n   `GroupPermissionsV2.canManage()` calls `hasPermission(null, VIEW, MANAGE)`, so an admin with only `view` on the all-groups resource type can manage groups. Check only `AdminPermissionsSchema.MANAGE`, as `canManage(GroupModel)` does.\n\nAdditional findings outside changed lines:\n1. In `@services/src/main/java/org/keycloak/services/resources/admin/permissions/GroupPermissionsV2.java` (line 122, Important):\n   In `getGroupIdsWithViewPermission`, `hasPermission(groupResource.getId(), ...)` and `granted.add(...\n   In `getGroupIdsWithViewPermission`, `hasPermission(groupResource.getId(), ...)` and `granted.add(groupResource.getId())` use the resource UUID, but lookup is by name (the group id), so it misses and returns wrong ids. Use `groupResource.getName()` for both.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 5 more findings are kept in notes and are not shown on this PR.\n\n---\n**Findings outside the changed lines (1)** \u2014 could not be attached inline:\n\n\ud83d\udfe0 **Important**\n\n**In `getGroupIdsWithViewPermission`, `hasPermission(groupResource.getId(), ...)` and `granted.add(...**\n\nIn `getGroupIdsWithViewPermission`, `hasPermission(groupResource.getId(), ...)` and `granted.add(groupResource.getId())` use the resource UUID, but lookup is by name (the group id), so it misses and returns wrong ids. Use `groupResource.getName()` for both.\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nIn `@services/src/main/java/org/keycloak/services/resources/admin/permissions/GroupPermissionsV2.java` (line 122, Important):\nIn `getGroupIdsWithViewPermission`, `hasPermission(groupResource.getId(), ...)` and `granted.add(groupResource.getId())` use the resource UUID, but lookup is by name (the group id), so it misses and returns wrong ids. Use `groupResource.getName()` for both.\n```\n\n</details>","inline_comments":[{"path":"services/src/main/java/org/keycloak/services/resources/admin/permissions/GroupPermissionsV2.java","line":70,"body":"\ud83d\udd34 **Blocker**\n\n**`GroupPermissionsV2.canManage()` calls `hasPermission(null, VIEW, MANAGE)`, so an admin with only...**\n\n`GroupPermissionsV2.canManage()` calls `hasPermission(null, VIEW, MANAGE)`, so an admin with only `view` on the all-groups resource type can manage groups. Check only `AdminPermissionsSchema.MANAGE`, as `canManage(GroupModel)` does."}]},"keycloak__keycloak__PR37429":{"pull_request":"https://github.com/keycloak/keycloak/pull/37429","project":"Keycloak","review_body":"**Vortex: changes requested, 3 issues to fix** at `02f48f7` \u00b7 47/48 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udd34 **Blocker** \u00b7 **Lithuanian totpStep1 replaced with Italian text** \u00b7 `themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties:101`\n- \ud83d\udfe0 **Important** \u00b7 **\\`totpStep1\\` in messages\\_zh\\_CN.properties is Traditional Chinese (\u624b\u6a5f, \u5b89\u88dd, \u61c9\u7528\u7a0b\u5f0f) in a Simplified Ch...** \u00b7 `themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties:112`\n- \ud83d\udfe0 **Important** \u00b7 **\\`loginTotpStep1\\` in the Lithuanian login bundle is Italian text, so Lithuanian users see Italian ...** \u00b7 `themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties:71`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties` (line 101, Blocker):\n   `totpStep1` in messages_lt.properties is Italian text copied from messages_it.properties, so Lithuanian account console users see Italian. Translate the English `Install one of the following applications on your mobile:` into Lithuanian.\n\n2. In `@themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties` (line 112, Important):\n   `totpStep1` in messages_zh_CN.properties is Traditional Chinese (\u624b\u6a5f, \u5b89\u88dd, \u61c9\u7528\u7a0b\u5f0f) in a Simplified Chinese file. Replace it with Simplified text such as \u5728\u60a8\u7684\u624b\u673a\u4e0a\u5b89\u88c5\u4ee5\u4e0b\u5e94\u7528\u7a0b\u5e8f\u4e4b\u4e00\uff1a\n\n3. In `@themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties` (line 71, Important):\n   `loginTotpStep1` in the Lithuanian login bundle is Italian text, so Lithuanian users see Italian on the TOTP setup page. Use a Lithuanian translation, e.g. \"\u012ediekite vien\u0105 i\u0161 \u0161i\u0173 program\u0117li\u0173 savo telefone:\", or remove the key to fall back to English.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 2 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties","line":101,"body":"\ud83d\udd34 **Blocker**\n\n**Lithuanian totpStep1 replaced with Italian text**\n\n`totpStep1` in messages_lt.properties is Italian text copied from messages_it.properties, so Lithuanian account console users see Italian. Translate the English `Install one of the following applications on your mobile:` into Lithuanian."},{"path":"themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties","line":112,"body":"\ud83d\udfe0 **Important**\n\n**`totpStep1` in messages_zh_CN.properties is Traditional Chinese (\u624b\u6a5f, \u5b89\u88dd, \u61c9\u7528\u7a0b\u5f0f) in a Simplified Ch...**\n\n`totpStep1` in messages_zh_CN.properties is Traditional Chinese (\u624b\u6a5f, \u5b89\u88dd, \u61c9\u7528\u7a0b\u5f0f) in a Simplified Chinese file. Replace it with Simplified text such as \u5728\u60a8\u7684\u624b\u673a\u4e0a\u5b89\u88c5\u4ee5\u4e0b\u5e94\u7528\u7a0b\u5e8f\u4e4b\u4e00\uff1a"},{"path":"themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties","line":71,"body":"\ud83d\udfe0 **Important**\n\n**`loginTotpStep1` in the Lithuanian login bundle is Italian text, so Lithuanian users see Italian ...**\n\n`loginTotpStep1` in the Lithuanian login bundle is Italian text, so Lithuanian users see Italian on the TOTP setup page. Use a Lithuanian translation, e.g. \"\u012ediekite vien\u0105 i\u0161 \u0161i\u0173 program\u0117li\u0173 savo telefone:\", or remove the key to fall back to English."}]},"keycloak__keycloak__PR37634":{"pull_request":"https://github.com/keycloak/keycloak/pull/37634","project":"Keycloak","review_body":"**Vortex: 3 issues to fix** at `daffb05` \u00b7 28/28 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udfe0 **Important** \u00b7 **The constructor&#39;s \\`Objects.requireNonNull(grantType, &quot;Null rawTokenId not allowed&quot;)\\` checks \\`gran...** \u00b7 `services/src/main/java/org/keycloak/protocol/oidc/encode/AccessTokenContext.java:73`\n- \ud83d\udfe0 **Important** \u00b7 **Client-credentials tokens lack grant context** \u00b7 `services/src/main/java/org/keycloak/protocol/oidc/grants/ClientCredentialsGrantTypeFactory.java:40`\n- \ud83d\udfe0 **Important** \u00b7 **In \\`isAccessTokenId\\`, \\`items\\[0\\].substring(3, 5).equals(expectedGrantShortcut)\\` is inverted and us...** \u00b7 `testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AssertEvents.java:483`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@services/src/main/java/org/keycloak/protocol/oidc/encode/AccessTokenContext.java` (line 73, Important):\n   The constructor's `Objects.requireNonNull(grantType, \"Null rawTokenId not allowed\")` checks `grantType` twice instead of `rawTokenId`. A null `rawTokenId` passes and later becomes the text \"null\" in `encodeTokenId`; check `rawTokenId`.\n\n2. In `@services/src/main/java/org/keycloak/protocol/oidc/grants/ClientCredentialsGrantTypeFactory.java` (line 40, Important):\n   `ClientCredentialsGrantType.process` calls `responseBuilder.generateAccessToken()` directly, never `createTokenResponse`, so `Constants.GRANT_TYPE` is never set. Client-credentials token IDs encode `UNKNOWN` instead of `cc`; set the attribute before token generation.\n\n3. In `@testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AssertEvents.java` (line 483, Important):\n   In `isAccessTokenId`, `items[0].substring(3, 5).equals(expectedGrantShortcut)` is inverted and uses the wrong offset. Use `!items[0].substring(4, 6).equals(expectedGrantShortcut)`.\n```\n\n</details>","inline_comments":[{"path":"services/src/main/java/org/keycloak/protocol/oidc/encode/AccessTokenContext.java","line":73,"body":"\ud83d\udfe0 **Important**\n\n**The constructor's `Objects.requireNonNull(grantType, \"Null rawTokenId not allowed\")` checks `gran...**\n\nThe constructor's `Objects.requireNonNull(grantType, \"Null rawTokenId not allowed\")` checks `grantType` twice instead of `rawTokenId`. A null `rawTokenId` passes and later becomes the text \"null\" in `encodeTokenId`; check `rawTokenId`."},{"path":"services/src/main/java/org/keycloak/protocol/oidc/grants/ClientCredentialsGrantTypeFactory.java","line":40,"body":"\ud83d\udfe0 **Important**\n\n**Client-credentials tokens lack grant context**\n\n`ClientCredentialsGrantType.process` calls `responseBuilder.generateAccessToken()` directly, never `createTokenResponse`, so `Constants.GRANT_TYPE` is never set. Client-credentials token IDs encode `UNKNOWN` instead of `cc`; set the attribute before token generation."},{"path":"testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AssertEvents.java","line":483,"body":"\ud83d\udfe0 **Important**\n\n**In `isAccessTokenId`, `items[0].substring(3, 5).equals(expectedGrantShortcut)` is inverted and us...**\n\nIn `isAccessTokenId`, `items[0].substring(3, 5).equals(expectedGrantShortcut)` is inverted and uses the wrong offset. Use `!items[0].substring(4, 6).equals(expectedGrantShortcut)`."}]},"keycloak__keycloak__PR38446":{"pull_request":"https://github.com/keycloak/keycloak/pull/38446","project":"Keycloak","review_body":"**Vortex: 3 issues to fix** at `ce2dcc5` \u00b7 8/8 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udfe0 **Important** \u00b7 **Do not remove federated credentials from local storage** \u00b7 `services/src/main/java/org/keycloak/authentication/authenticators/browser/RecoveryAuthnCodesFormAuthenticator.java:80`\n- \ud83d\udfe0 **Important** \u00b7 **Unchecked Optional.get() on recovery credential** \u00b7 `services/src/main/java/org/keycloak/forms/login/freemarker/model/RecoveryAuthnCodeInputLoginBean.java:19`\n- \ud83d\udfe0 **Important** \u00b7 **\\`RecoveryAuthnCodesCredentialModel.createFromValues(...)\\` in \\`getCredentials\\` builds a new model ...** \u00b7 `testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/BackwardsCompatibilityUserStorage.java:237`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@services/src/main/java/org/keycloak/authentication/authenticators/browser/RecoveryAuthnCodesFormAuthenticator.java` (line 80, Important):\n   `RecoveryAuthnCodesUtils.getCredential` can return a federated credential, but the exhausted-code path calls `removeStoredCredentialById()` with its ID, which doesn't remove it from the external user-storage provider. The exhausted credential stays stored and reported as configured.\n\n2. In `@services/src/main/java/org/keycloak/forms/login/freemarker/model/RecoveryAuthnCodeInputLoginBean.java` (line 19, Important):\n   `credentialModelOpt.get()` throws NoSuchElementException when `RecoveryAuthnCodesUtils.getCredential(user)` is empty, i.e. the user has no recovery credential. Handle the empty case explicitly, e.g. `orElseThrow` with a clear message.\n\n3. In `@testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/BackwardsCompatibilityUserStorage.java` (line 237, Important):\n   `RecoveryAuthnCodesCredentialModel.createFromValues(...)` in `getCredentials` builds a new model without the id set in `updateCredential`, so the returned credential has a null id. Lookups or removals by id then fail; copy the stored id onto the returned model.\n```\n\n</details>","inline_comments":[{"path":"services/src/main/java/org/keycloak/authentication/authenticators/browser/RecoveryAuthnCodesFormAuthenticator.java","line":80,"body":"\ud83d\udfe0 **Important**\n\n**Do not remove federated credentials from local storage**\n\n`RecoveryAuthnCodesUtils.getCredential` can return a federated credential, but the exhausted-code path calls `removeStoredCredentialById()` with its ID, which doesn't remove it from the external user-storage provider. The exhausted credential stays stored and reported as configured."},{"path":"services/src/main/java/org/keycloak/forms/login/freemarker/model/RecoveryAuthnCodeInputLoginBean.java","line":19,"body":"\ud83d\udfe0 **Important**\n\n**Unchecked Optional.get() on recovery credential**\n\n`credentialModelOpt.get()` throws NoSuchElementException when `RecoveryAuthnCodesUtils.getCredential(user)` is empty, i.e. the user has no recovery credential. Handle the empty case explicitly, e.g. `orElseThrow` with a clear message."},{"path":"testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/BackwardsCompatibilityUserStorage.java","line":237,"body":"\ud83d\udfe0 **Important**\n\n**`RecoveryAuthnCodesCredentialModel.createFromValues(...)` in `getCredentials` builds a new model ...**\n\n`RecoveryAuthnCodesCredentialModel.createFromValues(...)` in `getCredentials` builds a new model without the id set in `updateCredential`, so the returned credential has a null id. Lookups or removals by id then fail; copy the stored id onto the returned model."}]},"keycloak__keycloak__PR40940":{"pull_request":"https://github.com/keycloak/keycloak/pull/40940","project":"Keycloak","review_body":"**Vortex: 2 issues to fix** at `4def149` \u00b7 4/4 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **Preserve the non-null subgroup count contract** \u00b7 `model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/GroupAdapter.java:275`\n- \ud83d\udfe0 **Important** \u00b7 **The reader thread is never joined, so \\`assertThat(caughtExceptions, Matchers.empty())\\` can run wh...** \u00b7 `tests/base/src/test/java/org/keycloak/tests/admin/group/GroupTest.java:157`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/GroupAdapter.java` (line 275, Important):\n   `GroupAdapter.getSubGroupsCount()` returns `null` when deletion races the delegate lookup, violating the non-null contract of `GroupModel.getSubGroupsCount()`. `GroupUtils.populateSubGroupCount()` then copies that `null` into the representation; return a non-null count instead.\n\n2. In `@tests/base/src/test/java/org/keycloak/tests/admin/group/GroupTest.java` (line 157, Important):\n   The reader thread is never joined, so `assertThat(caughtExceptions, Matchers.empty())` can run while an in-flight call is still pending, missing late exceptions. Join the thread after `deletedAll.set(true)` before asserting.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 1 more finding is kept in notes and is not shown on this PR.","inline_comments":[{"path":"model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/GroupAdapter.java","line":275,"body":"\ud83d\udfe0 **Important**\n\n**Preserve the non-null subgroup count contract**\n\n`GroupAdapter.getSubGroupsCount()` returns `null` when deletion races the delegate lookup, violating the non-null contract of `GroupModel.getSubGroupsCount()`. `GroupUtils.populateSubGroupCount()` then copies that `null` into the representation; return a non-null count instead."},{"path":"tests/base/src/test/java/org/keycloak/tests/admin/group/GroupTest.java","line":157,"body":"\ud83d\udfe0 **Important**\n\n**The reader thread is never joined, so `assertThat(caughtExceptions, Matchers.empty())` can run wh...**\n\nThe reader thread is never joined, so `assertThat(caughtExceptions, Matchers.empty())` can run while an in-flight call is still pending, missing late exceptions. Join the thread after `deletedAll.set(true)` before asserting."}]},"sentry__sentry-greptile__PR1":{"pull_request":"https://github.com/ai-code-review-evaluation/sentry-greptile/pull/1","project":"Sentry","review_body":"**Vortex: changes requested, 3 issues to fix** at `8ab8814` \u00b7 3/3 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udd34 **Blocker** \u00b7 **\\`organization\\_context.member.has\\_global\\_access\\` raises AttributeError when \\`member\\` is None (e.g....** \u00b7 `src/sentry/api/endpoints/organization_auditlogs.py:71`\n- \ud83d\udd34 **Blocker** \u00b7 **\\`OptimizedCursorPaginator.get\\_item\\_key\\` calls \\`math.floor\\`/\\`math.ceil\\` on \\`item.datetime\\`, which ...** \u00b7 `src/sentry/api/paginator.py:840`\n- \ud83d\udd34 **Blocker** \u00b7 **In \\`OptimizedCursorPaginator.get\\_result\\`, \\`queryset\\[start\\_offset:stop\\]\\` with a negative \\`cursor.o...** \u00b7 `src/sentry/api/paginator.py:880`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@src/sentry/api/endpoints/organization_auditlogs.py` (line 71, Blocker):\n   `organization_context.member.has_global_access` raises AttributeError when `member` is None (e.g. API key/org token callers) and the user isn't superuser, breaking every GET. Guard with `organization_context.member is not None and ...`.\n\n2. In `@src/sentry/api/paginator.py` (line 840, Blocker):\n   `OptimizedCursorPaginator.get_item_key` calls `math.floor`/`math.ceil` on `item.datetime`, which raises TypeError for any audit-log result with `optimized_pagination=true`. Convert to a millisecond timestamp as `DateTimePaginator.get_item_key` does.\n\n3. In `@src/sentry/api/paginator.py` (line 880, Blocker):\n   In `OptimizedCursorPaginator.get_result`, `queryset[start_offset:stop]` with a negative `cursor.offset` raises AssertionError in Django (500), contrary to the comment. Reject negative offsets with BadPaginationError.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 3 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"src/sentry/api/endpoints/organization_auditlogs.py","line":71,"body":"\ud83d\udd34 **Blocker**\n\n**`organization_context.member.has_global_access` raises AttributeError when `member` is None (e.g....**\n\n`organization_context.member.has_global_access` raises AttributeError when `member` is None (e.g. API key/org token callers) and the user isn't superuser, breaking every GET. Guard with `organization_context.member is not None and ...`."},{"path":"src/sentry/api/paginator.py","line":840,"body":"\ud83d\udd34 **Blocker**\n\n**`OptimizedCursorPaginator.get_item_key` calls `math.floor`/`math.ceil` on `item.datetime`, which ...**\n\n`OptimizedCursorPaginator.get_item_key` calls `math.floor`/`math.ceil` on `item.datetime`, which raises TypeError for any audit-log result with `optimized_pagination=true`. Convert to a millisecond timestamp as `DateTimePaginator.get_item_key` does."},{"path":"src/sentry/api/paginator.py","line":880,"body":"\ud83d\udd34 **Blocker**\n\n**In `OptimizedCursorPaginator.get_result`, `queryset[start_offset:stop]` with a negative `cursor.o...**\n\nIn `OptimizedCursorPaginator.get_result`, `queryset[start_offset:stop]` with a negative `cursor.offset` raises AssertionError in Django (500), contrary to the comment. Reject negative offsets with BadPaginationError."}]},"sentry__sentry-greptile__PR2":{"pull_request":"https://github.com/ai-code-review-evaluation/sentry-greptile/pull/2","project":"Sentry","review_body":"**Vortex: changes requested, 3 issues to fix** at `8ab8814` \u00b7 9/9 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udd34 **Blocker** \u00b7 **\\`organization\\_context.member\\` is \\`None\\` for memberless credentials (API key, org auth token), so ...** \u00b7 `src/sentry/api/endpoints/organization_auditlogs.py:71`\n- \ud83d\udd34 **Blocker** \u00b7 **A negative \\`cursor.offset\\` is passed to \\`queryset\\[start\\_offset:stop\\]\\` at paginator.py:880, and Dj...** \u00b7 `src/sentry/api/paginator.py:880`\n- \ud83d\udfe0 **Important** \u00b7 **Comment claims a behavior the Cursor does not implement** \u00b7 `src/sentry/utils/cursors.py:26`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@src/sentry/api/endpoints/organization_auditlogs.py` (line 71, Blocker):\n   `organization_context.member` is `None` for memberless credentials (API key, org auth token), so `organization_context.member.has_global_access` at line 71 raises `AttributeError` and returns 500 on every non-superuser GET. Guard with `organization_context.member is not None and ...`.\n\n2. In `@src/sentry/api/paginator.py` (line 880, Blocker):\n   A negative `cursor.offset` is passed to `queryset[start_offset:stop]` at paginator.py:880, and Django raises `ValueError` on negative slicing, giving a 500 with `optimized_pagination=true`. Clamp the offset or raise `BadPaginationError`.\n\n3. In `@src/sentry/utils/cursors.py` (line 26, Important):\n   The comment above `self.offset = int(offset)` claims negative offsets are now allowed for performance, but the code only casts to int. Remove or correct the comment, since paginators still reject negative offsets with `BadPaginationError`.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 3 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"src/sentry/api/endpoints/organization_auditlogs.py","line":71,"body":"\ud83d\udd34 **Blocker**\n\n**`organization_context.member` is `None` for memberless credentials (API key, org auth token), so ...**\n\n`organization_context.member` is `None` for memberless credentials (API key, org auth token), so `organization_context.member.has_global_access` at line 71 raises `AttributeError` and returns 500 on every non-superuser GET. Guard with `organization_context.member is not None and ...`."},{"path":"src/sentry/api/paginator.py","line":880,"body":"\ud83d\udd34 **Blocker**\n\n**A negative `cursor.offset` is passed to `queryset[start_offset:stop]` at paginator.py:880, and Dj...**\n\nA negative `cursor.offset` is passed to `queryset[start_offset:stop]` at paginator.py:880, and Django raises `ValueError` on negative slicing, giving a 500 with `optimized_pagination=true`. Clamp the offset or raise `BadPaginationError`."},{"path":"src/sentry/utils/cursors.py","line":26,"body":"\ud83d\udfe0 **Important**\n\n**Comment claims a behavior the Cursor does not implement**\n\nThe comment above `self.offset = int(offset)` claims negative offsets are now allowed for performance, but the code only casts to int. Remove or correct the comment, since paginators still reject negative offsets with `BadPaginationError`."}]},"sentry__sentry-greptile__PR3":{"pull_request":"https://github.com/ai-code-review-evaluation/sentry-greptile/pull/3","project":"Sentry","review_body":"**Vortex: 2 issues to fix** at `6ad6fe3` \u00b7 8/8 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udfe0 **Important** \u00b7 **Upsampling gate uses outer \\`dataset\\`, not the dataset being queried** \u00b7 `src/sentry/api/endpoints/organization_events_stats.py:221`\n- \ud83d\udfe0 **Important** \u00b7 **Truthiness check drops a zero client\\_sample\\_rate** \u00b7 `src/sentry/testutils/factories.py:353`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@src/sentry/api/endpoints/organization_events_stats.py` (line 221, Important):\n   `_get_event_stats` passes the enclosing `dataset` to `is_errors_query_for_error_upsampled_projects` instead of `scoped_dataset`. Upsampling can then be applied to transactions queries or skipped for error queries; pass `scoped_dataset`.\n\n2. In `@src/sentry/testutils/factories.py` (line 353, Important):\n   `if client_sample_rate:` in `_set_sample_rate_from_error_sampling` treats a `client_sample_rate` of 0 or 0.0 as missing, so `sample_rate` is never set. Use `is not None`.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 5 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"src/sentry/api/endpoints/organization_events_stats.py","line":221,"body":"\ud83d\udfe0 **Important**\n\n**Upsampling gate uses outer `dataset`, not the dataset being queried**\n\n`_get_event_stats` passes the enclosing `dataset` to `is_errors_query_for_error_upsampled_projects` instead of `scoped_dataset`. Upsampling can then be applied to transactions queries or skipped for error queries; pass `scoped_dataset`."},{"path":"src/sentry/testutils/factories.py","line":353,"body":"\ud83d\udfe0 **Important**\n\n**Truthiness check drops a zero client_sample_rate**\n\n`if client_sample_rate:` in `_set_sample_rate_from_error_sampling` treats a `client_sample_rate` of 0 or 0.0 as missing, so `sample_rate` is never set. Use `is not None`."}]},"sentry__sentry-greptile__PR5":{"pull_request":"https://github.com/ai-code-review-evaluation/sentry-greptile/pull/5","project":"Sentry","review_body":"**Vortex: changes requested, 5 issues to fix** at `ea188e2` \u00b7 106/106 files reviewed\n\nActionable comments posted: 5\n\n- \ud83d\udd34 **Blocker** \u00b7 **Flagged table branch renders hardcoded empty data** \u00b7 `static/app/views/dashboards/widgetCard/chart.tsx:165`\n- \ud83d\udfe0 **Important** \u00b7 **\\`validate\\_timestamp\\`/\\`validate\\_age\\` use \\`self.initial\\_data.get(...)\\` truthiness, so \\`age: 0\\` or \\`...** \u00b7 `src/sentry/issues/endpoints/browser_reporting_collector.py:52`\n- \ud83d\udfe0 **Important** \u00b7 **Analytics recorded before feature gate** \u00b7 `src/sentry/preprod/api/endpoints/organization_preprod_artifact_assemble.py:81`\n- \ud83d\udfe0 **Important** \u00b7 **Error IDs zipped with unordered/sparse nodestore results** \u00b7 `src/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py:118`\n- \ud83d\udfe0 **Important** \u00b7 **Hidden attributes only filtered when searching** \u00b7 `static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/attributes.tsx:67`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (5 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@static/app/views/dashboards/widgetCard/chart.tsx` (line 165, Blocker):\n   With `use-table-widget-visualization` on, `TableWidgetVisualization` gets `columns={[]}` and `tableData={{data: [], meta: {fields: {}, units: {}}}}`, so every table widget renders empty. Pass `result.data`/`result.meta` and the widget's columns instead.\n\n2. In `@src/sentry/issues/endpoints/browser_reporting_collector.py` (line 52, Important):\n   `validate_timestamp`/`validate_age` use `self.initial_data.get(...)` truthiness, so `age: 0` or `timestamp: 0` counts as absent and both fields can be accepted together. Use `\"age\" in self.initial_data` and `\"timestamp\" in self.initial_data`.\n\n3. In `@src/sentry/preprod/api/endpoints/organization_preprod_artifact_assemble.py` (line 81, Important):\n   `analytics.record(\"preprod_artifact.api.assemble\", ...)` runs before the `features.has(\"organizations:preprod-artifact-assemble\")` check, so requests rejected with 404 are still counted as assemble events. Move the call after the gate.\n\n4. In `@src/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py` (line 118, Important):\n   `zip(error_ids, events.values())` assumes `get_multi` returns values in request order with no missing nodes, but it returns a dict keyed by node_id. Iterate over error_ids and look up `events.get(node_id)` so event IDs aren't mispaired.\n\n5. In `@static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/attributes.tsx` (line 67, Important):\n   `HIDDEN_ATTRIBUTES` filtering in `sortedAndFilteredAttributes` runs only after the empty-query early `return sorted`, so hidden attributes (`is_segment`, `project_id`, `received`) show until the user types. Filter before the early return.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 9 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"static/app/views/dashboards/widgetCard/chart.tsx","line":165,"body":"\ud83d\udd34 **Blocker**\n\n**Flagged table branch renders hardcoded empty data**\n\nWith `use-table-widget-visualization` on, `TableWidgetVisualization` gets `columns={[]}` and `tableData={{data: [], meta: {fields: {}, units: {}}}}`, so every table widget renders empty. Pass `result.data`/`result.meta` and the widget's columns instead."},{"path":"src/sentry/issues/endpoints/browser_reporting_collector.py","line":52,"body":"\ud83d\udfe0 **Important**\n\n**`validate_timestamp`/`validate_age` use `self.initial_data.get(...)` truthiness, so `age: 0` or `...**\n\n`validate_timestamp`/`validate_age` use `self.initial_data.get(...)` truthiness, so `age: 0` or `timestamp: 0` counts as absent and both fields can be accepted together. Use `\"age\" in self.initial_data` and `\"timestamp\" in self.initial_data`."},{"path":"src/sentry/preprod/api/endpoints/organization_preprod_artifact_assemble.py","line":81,"body":"\ud83d\udfe0 **Important**\n\n**Analytics recorded before feature gate**\n\n`analytics.record(\"preprod_artifact.api.assemble\", ...)` runs before the `features.has(\"organizations:preprod-artifact-assemble\")` check, so requests rejected with 404 are still counted as assemble events. Move the call after the gate."},{"path":"src/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py","line":118,"body":"\ud83d\udfe0 **Important**\n\n**Error IDs zipped with unordered/sparse nodestore results**\n\n`zip(error_ids, events.values())` assumes `get_multi` returns values in request order with no missing nodes, but it returns a dict keyed by node_id. Iterate over error_ids and look up `events.get(node_id)` so event IDs aren't mispaired."},{"path":"static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/attributes.tsx","line":67,"body":"\ud83d\udfe0 **Important**\n\n**Hidden attributes only filtered when searching**\n\n`HIDDEN_ATTRIBUTES` filtering in `sortedAndFilteredAttributes` runs only after the empty-query early `return sorted`, so hidden attributes (`is_segment`, `project_id`, `received`) show until the user types. Filter before the early return."}]},"sentry__sentry__PR67876":{"pull_request":"https://github.com/getsentry/sentry/pull/67876","project":"Sentry","review_body":"**Vortex: changes requested, 2 issues to fix** at `bb75657` \u00b7 3/3 files reviewed\n\nActionable comments posted: 2\n\n- \ud83d\udd34 **Blocker** \u00b7 **OAuth state is a constant, not a per-flow nonce** \u00b7 `src/sentry/integrations/github/integration.py:402`\n- \ud83d\udfe0 **Important** \u00b7 **\\`integration.metadata\\[&quot;sender&quot;\\]\\[&quot;login&quot;\\]\\` raises KeyError (a 500) for an existing Integration who...** \u00b7 `src/sentry/integrations/github/integration.py:503`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (2 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@src/sentry/integrations/github/integration.py` (line 402, Blocker):\n   `state = pipeline.signature` is an md5 of the pipeline view names, so it is identical for every user and flow and the check at line 412 isn't a CSRF nonce. Generate a random per-flow value (e.g. `secrets.token_urlsafe`), store it in pipeline state, and compare against it.\n\n2. In `@src/sentry/integrations/github/integration.py` (line 503, Important):\n   `integration.metadata[\"sender\"][\"login\"]` raises KeyError (a 500) for an existing Integration whose metadata has no `sender`. Use `.get` and fail closed with `error(...)`.\n```\n\n</details>","inline_comments":[{"path":"src/sentry/integrations/github/integration.py","line":402,"body":"\ud83d\udd34 **Blocker**\n\n**OAuth state is a constant, not a per-flow nonce**\n\n`state = pipeline.signature` is an md5 of the pipeline view names, so it is identical for every user and flow and the check at line 412 isn't a CSRF nonce. Generate a random per-flow value (e.g. `secrets.token_urlsafe`), store it in pipeline state, and compare against it."},{"path":"src/sentry/integrations/github/integration.py","line":503,"body":"\ud83d\udfe0 **Important**\n\n**`integration.metadata[\"sender\"][\"login\"]` raises KeyError (a 500) for an existing Integration who...**\n\n`integration.metadata[\"sender\"][\"login\"]` raises KeyError (a 500) for an existing Integration whose metadata has no `sender`. Use `.get` and fail closed with `error(...)`."}]},"sentry__sentry__PR77754":{"pull_request":"https://github.com/getsentry/sentry/pull/77754","project":"Sentry","review_body":"**Vortex: 1 issue to fix** at `9501091` \u00b7 7/7 files reviewed\n\nActionable comment posted: 1\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`queued: datetime = timezone.now()\\` is evaluated once at import, so every \\`AssignmentSource\\` from...** \u00b7 `src/sentry/integrations/services/assignment_source.py:18`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (1 finding)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@src/sentry/integrations/services/assignment_source.py` (line 18, Important):\n   `queued: datetime = timezone.now()` is evaluated once at import, so every `AssignmentSource` from `from_integration` shares a stale timestamp. Use `field(default_factory=timezone.now)`.\n```\n\n</details>","inline_comments":[{"path":"src/sentry/integrations/services/assignment_source.py","line":18,"body":"\ud83d\udfe0 **Important**\n\n**`queued: datetime = timezone.now()` is evaluated once at import, so every `AssignmentSource` from...**\n\n`queued: datetime = timezone.now()` is evaluated once at import, so every `AssignmentSource` from `from_integration` shares a stale timestamp. Use `field(default_factory=timezone.now)`."}]},"sentry__sentry__PR80168":{"pull_request":"https://github.com/getsentry/sentry/pull/80168","project":"Sentry","review_body":"**Vortex: changes requested, 3 issues to fix** at `8422030` \u00b7 4/4 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udd34 **Blocker** \u00b7 **\\`MetricAlertDetectorHandler\\` subclasses \\`StatefulDetectorHandler\\` with \\`pass\\`, leaving its abstra...** \u00b7 `src/sentry/incidents/grouptype.py:12`\n- \ud83d\udfe0 **Important** \u00b7 **The docstring says \\`evaluate\\` &quot;returns a list of \\`DetectorEvaluationResult\\`&quot;. The method now retu...** \u00b7 `src/sentry/workflow_engine/processors/detector.py:230`\n- \ud83d\udfe0 **Important** \u00b7 **Expected occurrence built for a different group key** \u00b7 `tests/sentry/workflow_engine/processors/test_detector.py:536`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@src/sentry/incidents/grouptype.py` (line 12, Blocker):\n   `MetricAlertDetectorHandler` subclasses `StatefulDetectorHandler` with `pass`, leaving its abstract methods unimplemented. Instantiating it via `Detector.detector_handler` raises `TypeError`. Implement them or use a non-stateful stub.\n\n2. In `@src/sentry/workflow_engine/processors/detector.py` (line 230, Important):\n   The docstring says `evaluate` \"returns a list of `DetectorEvaluationResult`\". The method now returns a dict keyed by group key. Update the docstring to match.\n\n3. In `@tests/sentry/workflow_engine/processors/test_detector.py` (line 536, Important):\n   The expected occurrence is built with `build_mock_occurrence_and_event(handler, \"val1\", 6, ...)`, so its fingerprint is `<detector_id>:val1`, not `group_key`. The assertion passes only because `IssueOccurrence.__eq__` compares just id; build it with `\"group_key\"`.\n```\n\n</details>","inline_comments":[{"path":"src/sentry/incidents/grouptype.py","line":12,"body":"\ud83d\udd34 **Blocker**\n\n**`MetricAlertDetectorHandler` subclasses `StatefulDetectorHandler` with `pass`, leaving its abstra...**\n\n`MetricAlertDetectorHandler` subclasses `StatefulDetectorHandler` with `pass`, leaving its abstract methods unimplemented. Instantiating it via `Detector.detector_handler` raises `TypeError`. Implement them or use a non-stateful stub."},{"path":"src/sentry/workflow_engine/processors/detector.py","line":230,"body":"\ud83d\udfe0 **Important**\n\n**The docstring says `evaluate` \"returns a list of `DetectorEvaluationResult`\". The method now retu...**\n\nThe docstring says `evaluate` \"returns a list of `DetectorEvaluationResult`\". The method now returns a dict keyed by group key. Update the docstring to match."},{"path":"tests/sentry/workflow_engine/processors/test_detector.py","line":536,"body":"\ud83d\udfe0 **Important**\n\n**Expected occurrence built for a different group key**\n\nThe expected occurrence is built with `build_mock_occurrence_and_event(handler, \"val1\", 6, ...)`, so its fingerprint is `<detector_id>:val1`, not `group_key`. The assertion passes only because `IssueOccurrence.__eq__` compares just id; build it with `\"group_key\"`."}]},"sentry__sentry__PR80528":{"pull_request":"https://github.com/getsentry/sentry/pull/80528","project":"Sentry","review_body":"**Vortex: 1 issue to fix** at `dcdcadb` \u00b7 4/4 files reviewed\n\nActionable comment posted: 1\n\n- \ud83d\udfe0 **Important** \u00b7 **\\`get\\_monitor\\_environment\\_context\\` builds a \\`config\\` copy with a human-readable \\`schedule\\_type\\`, b...** \u00b7 `src/sentry/monitors/logic/incident_occurrence.py:168`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (1 finding)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@src/sentry/monitors/logic/incident_occurrence.py` (line 168, Important):\n   `get_monitor_environment_context` builds a `config` copy with a human-readable `schedule_type`, but returns the original `monitor.config`, so the copy is discarded. Return `config` instead.\n```\n\n</details>","inline_comments":[{"path":"src/sentry/monitors/logic/incident_occurrence.py","line":168,"body":"\ud83d\udfe0 **Important**\n\n**`get_monitor_environment_context` builds a `config` copy with a human-readable `schedule_type`, b...**\n\n`get_monitor_environment_context` builds a `config` copy with a human-readable `schedule_type`, but returns the original `monitor.config`, so the copy is discarded. Return `config` instead."}]},"sentry__sentry__PR93824":{"pull_request":"https://github.com/getsentry/sentry/pull/93824","project":"Sentry","review_body":"**Vortex: 3 issues to fix** at `3162ad6` \u00b7 6/6 files reviewed\n\nActionable comments posted: 3\n\n- \ud83d\udfe0 **Important** \u00b7 **The \\`wait\\_produce\\` metric at flusher.py:199 uses \\`tags={&quot;shards&quot;: shard\\_tag}\\`, but the metrics at...** \u00b7 `src/sentry/spans/consumers/process/flusher.py:199`\n- \ud83d\udfe0 **Important** \u00b7 **\\`mp\\_context.Process\\` creates a \\`SpawnProcess\\`, which is not a \\`multiprocessing.Process\\`, so the \\`...** \u00b7 `src/sentry/spans/consumers/process/flusher.py:254`\n- \ud83d\udfe0 **Important** \u00b7 **In \\`join\\`, the \\`isinstance(process, multiprocessing.Process)\\` guard (flusher.py:346) is False for...** \u00b7 `src/sentry/spans/consumers/process/flusher.py:341`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (3 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@src/sentry/spans/consumers/process/flusher.py` (line 199, Important):\n   The `wait_produce` metric at flusher.py:199 uses `tags={\"shards\": shard_tag}`, but the metrics at lines 185 and 195 use the key `shard`. This splits the series, so it can't be grouped with the others. Change the key to `shard`.\n\n2. In `@src/sentry/spans/consumers/process/flusher.py` (line 254, Important):\n   `mp_context.Process` creates a `SpawnProcess`, which is not a `multiprocessing.Process`, so the `isinstance` check at flusher.py:254 is False. A hung flusher is never killed, and the replacement runs alongside it. Check `multiprocessing.process.BaseProcess` or call `kill()` unconditionally.\n\n3. In `@src/sentry/spans/consumers/process/flusher.py` (line 341, Important):\n   In `join`, the `isinstance(process, multiprocessing.Process)` guard (flusher.py:346) is False for `SpawnProcess`, so `terminate()` never runs; the `break` at the expired deadline also skips remaining processes. Check `BaseProcess` and use `continue`.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 2 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"src/sentry/spans/consumers/process/flusher.py","line":199,"body":"\ud83d\udfe0 **Important**\n\n**The `wait_produce` metric at flusher.py:199 uses `tags={\"shards\": shard_tag}`, but the metrics at...**\n\nThe `wait_produce` metric at flusher.py:199 uses `tags={\"shards\": shard_tag}`, but the metrics at lines 185 and 195 use the key `shard`. This splits the series, so it can't be grouped with the others. Change the key to `shard`."},{"path":"src/sentry/spans/consumers/process/flusher.py","line":254,"body":"\ud83d\udfe0 **Important**\n\n**`mp_context.Process` creates a `SpawnProcess`, which is not a `multiprocessing.Process`, so the `...**\n\n`mp_context.Process` creates a `SpawnProcess`, which is not a `multiprocessing.Process`, so the `isinstance` check at flusher.py:254 is False. A hung flusher is never killed, and the replacement runs alongside it. Check `multiprocessing.process.BaseProcess` or call `kill()` unconditionally."},{"path":"src/sentry/spans/consumers/process/flusher.py","line":341,"body":"\ud83d\udfe0 **Important**\n\n**In `join`, the `isinstance(process, multiprocessing.Process)` guard (flusher.py:346) is False for...**\n\nIn `join`, the `isinstance(process, multiprocessing.Process)` guard (flusher.py:346) is False for `SpawnProcess`, so `terminate()` never runs; the `break` at the expired deadline also skips remaining processes. Check `BaseProcess` and use `continue`."}]},"sentry__sentry__PR95633":{"pull_request":"https://github.com/getsentry/sentry/pull/95633","project":"Sentry","review_body":"**Vortex: changes requested, 6 issues to fix** at `9966ec5` \u00b7 5/7 files reviewed\n\nActionable comments posted: 6\n\n- \ud83d\udd34 **Blocker** \u00b7 **Reject negative queue counts** \u00b7 `src/sentry/remote_subscriptions/consumers/result_consumer.py:136`\n- \ud83d\udd34 **Blocker** \u00b7 **Queue pool is reused after shutdown on rebalance, dropping results** \u00b7 `src/sentry/remote_subscriptions/consumers/result_consumer.py:254`\n- \ud83d\udfe0 **Important** \u00b7 **Committable offsets advance only across strictly consecutive offsets (\\`offset in all\\_offsets\\` els...** \u00b7 `src/sentry/remote_subscriptions/consumers/queue_consumer.py:99`\n- \ud83d\udfe0 **Important** \u00b7 **\\`queue.Queue()\\` is unbounded and \\`submit()\\` never blocks, despite the docstring promising &quot;Natura...** \u00b7 `src/sentry/remote_subscriptions/consumers/queue_consumer.py:156`\n- \ud83d\udfe0 **Important** \u00b7 **In \\`test\\_stats\\_reporting\\`, workers start consuming on submit, so \\`stats\\[&quot;total\\_items&quot;\\] &gt; 0\\` can b...** \u00b7 `tests/sentry/remote_subscriptions/consumers/test_queue_consumer.py:185`\n- \ud83d\udfe0 **Important** \u00b7 **\\`test\\_thread\\_queue\\_parallel\\_error\\_handling\\` asserts \\`test\\_partition not in committed\\_offsets\\`, bu...** \u00b7 `tests/sentry/uptime/consumers/test_results_consumer.py:1876`\n\n<details>\n<summary>\ud83e\udd16 Prompt for AI agents (6 findings)</summary>\n\n```\nVerify each finding against current code. Fix only still-valid concrete bugs, skip the\nrest with a brief reason, keep changes minimal, and validate. Skip Decision required,\npolicy forks, and \"consider X\" alternatives. Do not add new features, refactors, or\narchitecture beyond the fix; prefer the smallest diff.\n\nTo dispute, defer or ask about a finding, reply in that finding's review thread, or\nmention @mergestorm-vortex in a pull request comment. A fix needs no reply: Vortex\nreviews the next push.\n\nFindings to address:\n1. In `@src/sentry/remote_subscriptions/consumers/result_consumer.py` (line 136, Blocker):\n   `num_queues=max_workers or 20` accepts a negative `--max-workers`, giving `FixedQueuePool` zero queues. `hash(group_key) % self.num_queues` then raises ZeroDivisionError, which `submit()` swallows while marking the offset complete; validate the value is positive.\n\n2. In `@src/sentry/remote_subscriptions/consumers/result_consumer.py` (line 254, Blocker):\n   The factory-owned `queue_pool` is shared by every `SimpleQueueProcessingStrategy`, and `close()`/`terminate()` call `queue_pool.shutdown()`. After a rebalance, new strategies submit to shut-down queues and results are dropped; have only the factory shut it down, or create one pool per strategy.\n\n3. In `@src/sentry/remote_subscriptions/consumers/queue_consumer.py` (line 99, Important):\n   Committable offsets advance only across strictly consecutive offsets (`offset in all_offsets` else `break`). Kafka offset gaps (transaction markers, compaction) permanently stall commits for that partition; track submitted-offset order instead of requiring +1 contiguity.\n\n4. In `@src/sentry/remote_subscriptions/consumers/queue_consumer.py` (line 156, Important):\n   `queue.Queue()` is unbounded and `submit()` never blocks, despite the docstring promising \"Natural backpressure when queues fill up\". Slow workers cause unbounded memory growth; use a bounded queue and raise `MessageRejected` when full.\n\n5. In `@tests/sentry/remote_subscriptions/consumers/test_queue_consumer.py` (line 185, Important):\n   In `test_stats_reporting`, workers start consuming on submit, so `stats[\"total_items\"] > 0` can be 0 by the time `get_stats()` runs. Block the processor on an event until after the check, or drop the assertion.\n\n6. In `@tests/sentry/uptime/consumers/test_results_consumer.py` (line 1876, Important):\n   `test_thread_queue_parallel_error_handling` asserts `test_partition not in committed_offsets`, but `OrderedQueueWorker.run` calls `complete_offset` in a `finally`, so the failed offset is committable. It passes only because polling stops before the 1s commit tick; assert offsets are eventually committed.\n```\n\n</details>\n\n<!-- vortex:secondary-findings --> 5 more findings are kept in notes and are not shown on this PR.","inline_comments":[{"path":"src/sentry/remote_subscriptions/consumers/result_consumer.py","line":136,"body":"\ud83d\udd34 **Blocker**\n\n**Reject negative queue counts**\n\n`num_queues=max_workers or 20` accepts a negative `--max-workers`, giving `FixedQueuePool` zero queues. `hash(group_key) % self.num_queues` then raises ZeroDivisionError, which `submit()` swallows while marking the offset complete; validate the value is positive."},{"path":"src/sentry/remote_subscriptions/consumers/result_consumer.py","line":254,"body":"\ud83d\udd34 **Blocker**\n\n**Queue pool is reused after shutdown on rebalance, dropping results**\n\nThe factory-owned `queue_pool` is shared by every `SimpleQueueProcessingStrategy`, and `close()`/`terminate()` call `queue_pool.shutdown()`. After a rebalance, new strategies submit to shut-down queues and results are dropped; have only the factory shut it down, or create one pool per strategy."},{"path":"src/sentry/remote_subscriptions/consumers/queue_consumer.py","line":99,"body":"\ud83d\udfe0 **Important**\n\n**Committable offsets advance only across strictly consecutive offsets (`offset in all_offsets` els...**\n\nCommittable offsets advance only across strictly consecutive offsets (`offset in all_offsets` else `break`). Kafka offset gaps (transaction markers, compaction) permanently stall commits for that partition; track submitted-offset order instead of requiring +1 contiguity."},{"path":"src/sentry/remote_subscriptions/consumers/queue_consumer.py","line":156,"body":"\ud83d\udfe0 **Important**\n\n**`queue.Queue()` is unbounded and `submit()` never blocks, despite the docstring promising \"Natura...**\n\n`queue.Queue()` is unbounded and `submit()` never blocks, despite the docstring promising \"Natural backpressure when queues fill up\". Slow workers cause unbounded memory growth; use a bounded queue and raise `MessageRejected` when full."},{"path":"tests/sentry/remote_subscriptions/consumers/test_queue_consumer.py","line":185,"body":"\ud83d\udfe0 **Important**\n\n**In `test_stats_reporting`, workers start consuming on submit, so `stats[\"total_items\"] > 0` can b...**\n\nIn `test_stats_reporting`, workers start consuming on submit, so `stats[\"total_items\"] > 0` can be 0 by the time `get_stats()` runs. Block the processor on an event until after the check, or drop the assertion."},{"path":"tests/sentry/uptime/consumers/test_results_consumer.py","line":1876,"body":"\ud83d\udfe0 **Important**\n\n**`test_thread_queue_parallel_error_handling` asserts `test_partition not in committed_offsets`, bu...**\n\n`test_thread_queue_parallel_error_handling` asserts `test_partition not in committed_offsets`, but `OrderedQueueWorker.run` calls `complete_offset` in a `finally`, so the failed offset is committable. It passes only because polling stops before the 1s commit tick; assert offsets are eventually committed."}]}},"judgements":{"cal_dot_com__cal.com__PR10600":{"pull_request":"https://github.com/calcom/cal.com/pull/10600","project":"Cal.com","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":5,"candidates":[{"index":0,"text":"Password verification is incorrectly skipped when both backupCode and a non-empty totpCode are provided, allowing authentication with a valid backup code without checking the password (auth bypass via direct POST)","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"Backup code consumption is non-atomic (read/check then overwrite via prisma.user.update), allowing concurrent logins to reuse the same backup code successfully; should be made atomic via conditional updateMany or a transaction","verdict":"hit","basis":"matched answer-key item","answer_key_items":[3]}],"hits":[{"answer_key_index":3,"answer_key_item":"Because backupCodes are decrypted and mutated in memory before being written back, two concurrent login requests using the same backupCode could both pass this check and update, so a single backup code may effectively be accepted more than once if used concurrently, weakening the intended one-time-use semantics.","severity":"High","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"Backup code consumption is non-atomic (read/check then overwrite via prisma.user.update), allowing concurrent logins to reuse the same backup code successfully; should be made atomic via conditional updateMany or a transaction","confidence":0.93,"reasoning":"Yes. Both describe a race condition where backup code validation/consumption is done as a non-atomic read/check then write, so concurrent requests can both accept the same one-time backup code and update state, breaking one-time-use semantics."}],"missed":[{"answer_key_index":0,"answer_key_item":"The exported function TwoFactor handles backup codes and is in BackupCode.tsx. Inconsistent naming.","severity":"Low","category":"style","profiles":["all"]},{"answer_key_index":1,"answer_key_item":"Error message mentions 'backup code login' but this is a disable endpoint, not login","severity":"Low","category":"doc_defect","profiles":["core","all"]},{"answer_key_index":2,"answer_key_item":"Backup code validation is case-sensitive due to the use of indexOf(). This causes validation to fail if a user enters uppercase hex characters, as backup codes should be case-insensitive for a better user experience.","severity":"Medium","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":4,"answer_key_item":"Object URL for backup codes is not revoked on component unmount, leading to a potential memory leak. This can cause increased memory usage over time, especially if the component is mounted and unmounted frequently.","severity":"Low","category":"perf","profiles":["core","all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":2,"hits":1,"false_alarms":1,"misses":1},"core":{"items":4,"hits":1,"false_alarms":1,"misses":3},"all":{"items":5,"hits":1,"false_alarms":1,"misses":4}}},"cal_dot_com__cal.com__PR10967":{"pull_request":"https://github.com/calcom/cal.com/pull/10967","project":"Cal.com","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":6,"candidates":[{"index":0,"text":"In updateEvent, destinationCalendar.find compares externalId to externalCalendarId only when externalCalendarId is falsy, so it never matches and calendar.events.update is called without a calendarId (destination calendar is lost)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":1,"text":"In deleteEvent, CalendarManager.deleteEvent never passes externalCalendarId, so the destination calendar lookup fails and calendarId falls back to \"primary\", preventing deletion from non-primary destination calendars","verdict":"false alarm","basis":"matched no answer-key item"},{"index":2,"text":"mainHostDestinationCalendar can be undefined when evt.destinationCalendar is undefined or empty, causing a TypeError when accessing mainHostDestinationCalendar.integration (should use optional chaining/fallback)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":3,"text":"The spread conditional ...(IS_TEAM_BILLING_ENABLED ? { slug } : {}) inverts the intended logic of !IS_TEAM_BILLING_ENABLED && { slug }, causing slug assignment behavior to be reversed","verdict":"hit","basis":"matched answer-key item","answer_key_items":[3]},{"index":4,"text":"In handleCancelBooking.ts, the recurring-delete branch runs inside the per-reference loop, causing repeated deleteEvent passes for multiple calendar references (should be hoisted to run once)","verdict":"false alarm","basis":"matched no answer-key item"},{"index":5,"text":"In handleNewBooking.ts, evt.destinationCalendar?.push(...teamDestinationCalendars) is skipped when evt.destinationCalendar is null, silently dropping team destination calendars (should initialize/assign when null)","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"A null reference occurs in GoogleCalendarService.createEvent() and updateEvent() when mainHostDestinationCalendar is destructured from evt.destinationCalendar but evt.destinationCalendar is null or an empty array, causing mainHostDestinationCalendar to be undefined.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"mainHostDestinationCalendar can be undefined when evt.destinationCalendar is undefined or empty, causing a TypeError when accessing mainHostDestinationCalendar.integration (should use optional chaining/fallback)","confidence":0.9,"reasoning":"Both describe the same root problem: destructuring/using mainHostDestinationCalendar derived from evt.destinationCalendar can yield undefined when destinationCalendar is null/undefined or empty, leading to a runtime TypeError when accessing properties like integration in createEvent()/updateEvent(). Candidate omits explicit mention of null but covers undefined/empty which aligns with the golden issue."},{"answer_key_index":2,"answer_key_item":"Logic error: when externalCalendarId is provided, you're searching for a calendar where externalId === externalCalendarId, but this will always fail since you're looking for a calendar that matches itself. Should likely find by credentialId or use different logic.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"In updateEvent, destinationCalendar.find compares externalId to externalCalendarId only when externalCalendarId is falsy, so it never matches and calendar.events.update is called without a calendarId (destination calendar is lost)","confidence":0.78,"reasoning":"Both point to the same underlying logic bug in selecting destinationCalendar: the find/comparison involving externalCalendarId/externalId is wrong, causing the lookup to fail when externalCalendarId is provided and leading to a missing/incorrect calendarId for the update. Candidate describes it as a conditional inversion/falsy check, but the core issue (calendar lookup always failing due to bad comparison logic) matches the golden concern."},{"answer_key_index":3,"answer_key_item":"Logic inversion in organization creation: The slug property is now conditionally set when IS_TEAM_BILLING_ENABLED is true, instead of when it's false as originally intended. This change, combined with requestedSlug still being set when IS_TEAM_BILLING_ENABLED is true, results in both properties being set when billing is enabled, and neither when disabled","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":3,"matched_candidate":"The spread conditional ...(IS_TEAM_BILLING_ENABLED ? { slug } : {}) inverts the intended logic of !IS_TEAM_BILLING_ENABLED && { slug }, causing slug assignment behavior to be reversed","confidence":0.78,"reasoning":"The candidate correctly flags that the conditional spread for `slug` has inverted the original logic, matching the core bug described in the golden comment. However, it does not mention the additional interaction with `requestedSlug` leading to both/neither properties being set depending on the flag. Still, it identifies the same underlying inversion issue."}],"missed":[{"answer_key_index":1,"answer_key_item":"The optional chaining on mainHostDestinationCalendar?.integration is redundant since you already check mainHostDestinationCalendar in the ternary condition.","severity":"Low","category":"style","profiles":["all"]},{"answer_key_index":4,"answer_key_item":"The Calendar interface now requires createEvent(event, credentialId), but some implementations (e.g., Lark/Office365) still declare createEvent(event) only\u2014this breaks the interface contract (also applies to other locations in the PR).","severity":"Low","category":"api","profiles":["strict","core","all"]},{"answer_key_index":5,"answer_key_item":"The `credential` may be undefined when passed to `updateEvent` if `reference.credentialId` is set but the credential is not found. This can lead to a runtime error when `updateEvent` is called with an undefined credential, which should be handled to prevent crashes.","severity":"High","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2],[3],[4],[5]],"counts":{"strict":{"items":5,"hits":3,"false_alarms":3,"misses":2},"core":{"items":5,"hits":3,"false_alarms":3,"misses":2},"all":{"items":6,"hits":3,"false_alarms":3,"misses":3}}},"cal_dot_com__cal.com__PR11059":{"pull_request":"https://github.com/calcom/cal.com/pull/11059","project":"Cal.com","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":9,"candidates":[{"index":0,"text":"Using `[z.string().toString()]: z.number()` in a Zod object schema creates a literal \"[object Object]\" key, causing `minimumTokenResponseSchema` to require a numeric \"[object Object]\" property and making sync-mode parsing fail","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":1,"text":"`refreshOAuthTokens` returns a raw fetch `Response` in sync mode, but callers expect an object with `.data`, so `.data` is undefined and accessing `token.access_token` throws","verdict":"hit","basis":"matched answer-key item","answer_key_items":[3,4]},{"index":2,"text":"`parseRefreshTokenResponse` returns a Zod `safeParse` result (`{ success, data }`), but that whole object is persisted as `credential.key`, causing later `googleCredentialSchema.parse(credential.key)` to fail (should persist `key.data`)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":3,"text":"With credential sync enabled, HubSpot code treats the raw fetch `Response` returned by `refreshOAuthTokens` as a `HubspotToken`, so `expiresIn`/`accessToken` are undefined and expiry becomes NaN","verdict":"hit","basis":"duplicate of a candidate that matched an answer-key item"},{"index":4,"text":"Checking `response.statusText !== \"OK\"` incorrectly treats successful refresh responses as failures when the reason phrase differs/empty (e.g., HTTP/2), throwing `HttpError`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[6]},{"index":5,"text":"`prisma` is used (`prisma.credential.update(...)`) but never imported in the file, causing a ReferenceError or type-check failure","verdict":"false alarm","basis":"matched no answer-key item"},{"index":6,"text":"`credentialId` is passed as the third argument to `refreshOAuthTokens`, but the function expects a Cal.com `userId`, so the sync endpoint receives the credential ID as `calcomUserId`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[5]},{"index":7,"text":"`appCredentialWebhookRequestBodySchema.parse(req.body)` can throw a ZodError on malformed input and is not caught, causing the route to return 500 instead of a 400","verdict":"hit","basis":"matched answer-key item","answer_key_items":[8]},{"index":8,"text":"`parseRefreshTokenResponse` overwrites a missing `refresh_token` with the literal string \"refresh_token\", causing persisted credentials (e.g., Zoom/Office 365) to lose the real refresh token","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":9,"text":"With credential sync enabled, Lark's `handleLarkError` expects a `{ code: 0, data }` envelope but receives the sync endpoint payload (access token/expiry only), causing Lark refresh handling to fail","verdict":"false alarm","basis":"matched no answer-key item"},{"index":10,"text":"With sync enabled, Office365 video adapter uses the raw sync-endpoint response without checking `response.ok` and assumes a Microsoft-shaped body with `expires_in`, leading to incorrect `expiry_date` (e.g., set to now) and repeated refreshes","verdict":"false alarm","basis":"matched no answer-key item"},{"index":11,"text":"Salesforce `jsforce.Connection` is initialized using pre-refresh `credentialKey.access_token`/`instance_url` instead of the refreshed token data, so it may use an expired access token","verdict":"hit","basis":"matched answer-key item","answer_key_items":[7]}],"hits":[{"answer_key_index":0,"answer_key_item":"The parseRefreshTokenResponse function incorrectly sets refresh_token to the hardcoded string 'refresh_token' when it's missing from the OAuth refresh token response. This invalidates the token, breaking subsequent token refreshes and causing authentication failures.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":8,"matched_candidate":"`parseRefreshTokenResponse` overwrites a missing `refresh_token` with the literal string \"refresh_token\", causing persisted credentials (e.g., Zoom/Office 365) to lose the real refresh token","confidence":0.94,"reasoning":"Both describe the same bug: in parseRefreshTokenResponse, when the OAuth response lacks refresh_token, the code sets it to the literal string \"refresh_token\", overwriting/invalidating the real token and breaking future refresh/auth flows."},{"answer_key_index":1,"answer_key_item":"The Zod schema in parseRefreshTokenResponse uses computed property keys [z.string().toString()] and [z.string().optional().toString()] in minimumTokenResponseSchema, which is invalid Zod syntax and will throw a runtime error.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"Using `[z.string().toString()]: z.number()` in a Zod object schema creates a literal \"[object Object]\" key, causing `minimumTokenResponseSchema` to require a numeric \"[object Object]\" property and making sync-mode parsing fail","confidence":0.9,"reasoning":"Both point to the same underlying problem: the Zod object schema is using computed property keys derived from `z.string().toString()`, which is invalid/misused syntax. The candidate explains it manifests as a literal \"[object Object]\" key and breaks parsing, which is the same runtime-failure issue described in the golden comment (even though the golden also mentions the optional variant)."},{"answer_key_index":2,"answer_key_item":"parseRefreshTokenResponse returns a Zod safeParse result ({ success, data, error }), not the credential key object. Persisting that as key stores the wrapper instead of the token payload; we should store the parsed data or use schema parse.","severity":"High","category":"data","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"`parseRefreshTokenResponse` returns a Zod `safeParse` result (`{ success, data }`), but that whole object is persisted as `credential.key`, causing later `googleCredentialSchema.parse(credential.key)` to fail (should persist `key.data`)","confidence":0.96,"reasoning":"The candidate correctly notes that parseRefreshTokenResponse returns a Zod safeParse wrapper object and that persisting it as credential.key is wrong; it should persist the parsed data (key.data) or otherwise parse properly. This matches the golden issue exactly."},{"answer_key_index":3,"answer_key_item":"When APP_CREDENTIAL_SHARING_ENABLED and CALCOM_CREDENTIAL_SYNC_ENDPOINT are set, the refreshFunction helper returns the fetch Response, but several callers (for example GoogleCalendarService.refreshAccessToken expecting res.data, and HubspotCalendarService.refreshAccessToken expecting a HubspotToken) assume it returns the integration-specific token object. That mismatch will cause runtime errors in the sync-enabled path unless the return type or those call sites are adjusted.","severity":"High","category":"api","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`refreshOAuthTokens` returns a raw fetch `Response` in sync mode, but callers expect an object with `.data`, so `.data` is undefined and accessing `token.access_token` throws","confidence":0.93,"reasoning":"Both describe the same core bug: in credential sync mode the refresh helper returns a raw fetch Response, while callers expect an integration-specific token object (often via `.data`), leading to undefined access and runtime errors. The candidate mentions `.data` being undefined and subsequent token field access failing, matching the golden issue."},{"answer_key_index":4,"answer_key_item":"When the sync endpoint path is used, res is a fetch Response and has no .data; res?.data will be undefined and token.access_token will throw at runtime. This relies on a consistent return shape from refreshOAuthTokens, which isn\u2019t guaranteed currently.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`refreshOAuthTokens` returns a raw fetch `Response` in sync mode, but callers expect an object with `.data`, so `.data` is undefined and accessing `token.access_token` throws","confidence":0.94,"reasoning":"The candidate describes the same core bug: in sync mode `refreshOAuthTokens` returns a fetch `Response` rather than an object with `.data`, so `res.data` is undefined and later access to `token.access_token` can throw. This matches the golden comment\u2019s concern about inconsistent return shape and runtime failure."},{"answer_key_index":5,"answer_key_item":"The `refreshOAuthTokens` function is passed `credentialId` instead of `userId`, which breaks the credential sync functionality by causing incorrect user lookups. This issue can lead to failures in syncing user credentials, impacting user experience.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":6,"matched_candidate":"`credentialId` is passed as the third argument to `refreshOAuthTokens`, but the function expects a Cal.com `userId`, so the sync endpoint receives the credential ID as `calcomUserId`","confidence":0.94,"reasoning":"The candidate issue states that `credentialId` is being passed to `refreshOAuthTokens` where a Cal.com `userId` is expected, causing the sync endpoint to treat the credential ID as the user ID. This matches the golden comment\u2019s core bug: wrong identifier passed leading to incorrect user lookups and broken credential sync."},{"answer_key_index":6,"answer_key_item":"The Salesforce integration checks `response.statusText` instead of `response.ok` when handling OAuth token refresh responses. This can lead to unreliable behavior, as a successful response may not be correctly identified, resulting in the use of stale credentials and potential authentication failures.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":4,"matched_candidate":"Checking `response.statusText !== \"OK\"` incorrectly treats successful refresh responses as failures when the reason phrase differs/empty (e.g., HTTP/2), throwing `HttpError`","confidence":0.93,"reasoning":"Yes. Both describe the same underlying bug: the code uses `response.statusText` (e.g., comparing to \"OK\") to determine success of the OAuth token refresh, which is unreliable (can be empty/different) and may misclassify successful responses as failures, leading to stale credentials/auth issues."},{"answer_key_index":7,"answer_key_item":"The `jsforce.Connection` is created using stale `credentialKey.access_token` and `credentialKey.instance_url` after a token refresh, which can lead to authentication failures and incorrect data access. Ensure that the connection is established using the refreshed token values instead.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":11,"matched_candidate":"Salesforce `jsforce.Connection` is initialized using pre-refresh `credentialKey.access_token`/`instance_url` instead of the refreshed token data, so it may use an expired access token","confidence":0.95,"reasoning":"The candidate issue states that jsforce.Connection is initialized with pre-refresh access_token/instance_url rather than refreshed token data, risking use of an expired token. This matches the golden issue about using stale credential values after refresh and needing to use refreshed values when establishing the connection."},{"answer_key_index":8,"answer_key_item":"The `appCredentialWebhookRequestBodySchema.parse` function can throw on invalid payloads, resulting in 500 Internal Server Errors instead of the expected 400 Bad Request responses. This can lead to confusion for clients and hinder proper error handling.","severity":"Medium","category":"api","profiles":["strict","core","all"],"matched_candidate_index":7,"matched_candidate":"`appCredentialWebhookRequestBodySchema.parse(req.body)` can throw a ZodError on malformed input and is not caught, causing the route to return 500 instead of a 400","confidence":0.98,"reasoning":"Both describe that `appCredentialWebhookRequestBodySchema.parse(req.body)` may throw (ZodError) on invalid input, and without handling it the server returns a 500 instead of the intended 400 Bad Request."}],"missed":[],"duplicate_groups":[[0],[1,3],[2],[4],[5],[6],[7],[8],[9],[10],[11]],"counts":{"strict":{"items":9,"hits":9,"false_alarms":3,"misses":0},"core":{"items":9,"hits":9,"false_alarms":3,"misses":0},"all":{"items":9,"hits":9,"false_alarms":3,"misses":0}}},"cal_dot_com__cal.com__PR14740":{"pull_request":"https://github.com/calcom/cal.com/pull/14740","project":"Cal.com","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":6,"candidates":[{"index":0,"text":"`isTeamAdminOrOwner` uses `isTeamAdmin(...) && isTeamOwner(...)`, effectively allowing only owners and causing team admins to get FORBIDDEN; should use `||`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":1,"text":"`uniqueGuests` only filters against existing booking attendees and does not deduplicate duplicate emails within the same `guests` request, leading to duplicate inserts via `createMany`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[3]},{"index":2,"text":"Blacklist check compares raw `guest` email against lowercased `blacklistedGuestEmails`, allowing case-variant emails (e.g., `Spam@Example.com`) to bypass; lowercase `guest` before checking","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":3,"text":"`sendAddGuestsEmails(evt, guests)` uses the raw `guests` input instead of `uniqueGuests`, causing already-present guests to receive the wrong email type; pass `uniqueGuests`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":4,"text":"Permission concern: any attendee passing the `isAttendee` check can invite arbitrary email addresses to a booking, potentially exposing event details; may need to restrict adding guests to organizers/admins","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"The addGuests.handler.ts blacklist check uses blacklistedGuestEmails.includes(guest) after lowercasing the blacklist but not the input guest emails, allowing attackers to bypass BLACKLISTED_GUEST_EMAILS restrictions by submitting emails with uppercase characters.","severity":"High","category":"security","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"Blacklist check compares raw `guest` email against lowercased `blacklistedGuestEmails`, allowing case-variant emails (e.g., `Spam@Example.com`) to bypass; lowercase `guest` before checking","confidence":0.96,"reasoning":"Both describe the same flaw: the blacklist array is lowercased but the incoming guest email is not, so case variations can bypass the blacklist; both recommend lowercasing the guest before the includes check."},{"answer_key_index":1,"answer_key_item":"The logic for checking team admin/owner permissions is incorrect. This condition uses AND (&&) which requires both isTeamAdmin AND isTeamOwner to be true, but it should use OR (||) since a user needs to be either an admin OR an owner to have permission.","severity":"Critical","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"`isTeamAdminOrOwner` uses `isTeamAdmin(...) && isTeamOwner(...)`, effectively allowing only owners and causing team admins to get FORBIDDEN; should use `||`","confidence":0.98,"reasoning":"Both the golden comment and the candidate point out that the permission check incorrectly uses AND (&&) between isTeamAdmin and isTeamOwner, requiring both to be true, and that it should be OR (||) so either role grants permission."},{"answer_key_index":2,"answer_key_item":"The sendAddGuestsEmails function in email-manager.ts passes the full calendarEvent.attendees array when determining which attendees receive AttendeeScheduledEmail vs AttendeeAddGuestsEmail, but checks if newGuests.includes(attendee.email) where newGuests is the input guests array.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":3,"matched_candidate":"`sendAddGuestsEmails(evt, guests)` uses the raw `guests` input instead of `uniqueGuests`, causing already-present guests to receive the wrong email type; pass `uniqueGuests`","confidence":0.78,"reasoning":"Both point to the same underlying bug: the function decides which email to send by checking membership against the input `guests` list (or a derived `uniqueGuests`) while iterating over the full `calendarEvent.attendees`, leading to incorrect classification/email type for attendees. The candidate frames it as using `guests` instead of `uniqueGuests`, but it\u2019s the same mismatch between the attendees array being processed and the list used for the `includes` check."},{"answer_key_index":3,"answer_key_item":"uniqueGuests filters out existing attendees and blacklisted emails but does not deduplicate duplicates within the input; createMany can insert duplicate attendee rows if the client submits repeated emails.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`uniqueGuests` only filters against existing booking attendees and does not deduplicate duplicate emails within the same `guests` request, leading to duplicate inserts via `createMany`","confidence":0.94,"reasoning":"The candidate states that `uniqueGuests` filters against existing attendees but does not deduplicate duplicate emails within the same request, which can cause duplicate inserts via `createMany`. This matches the golden issue about lack of deduplication in input leading to duplicate attendee rows."}],"missed":[{"answer_key_index":4,"answer_key_item":"Starting with an array containing an empty string may cause validation issues. Consider starting with an empty array [] and handling the empty state in the MultiEmail component instead.","severity":"Low","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":5,"answer_key_item":"The `sendAddGuestsEmails` function does not check the `disableStandardEmails` flags in the `EventType` metadata, which may result in sending emails to hosts/attendees even when standard emails are disabled for the event type.","severity":"Medium","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2],[3],[4]],"counts":{"strict":{"items":6,"hits":4,"false_alarms":1,"misses":2},"core":{"items":6,"hits":4,"false_alarms":1,"misses":2},"all":{"items":6,"hits":4,"false_alarms":1,"misses":2}}},"cal_dot_com__cal.com__PR14943":{"pull_request":"https://github.com/calcom/cal.com/pull/14943","project":"Cal.com","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"`retryCount: { gt: 1 }` is in an OR branch without `method: WorkflowMethods.SMS`, so the SMS cron can delete non-SMS WorkflowReminders (e.g., email/WhatsApp) when `retryCount > 1`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":1,"text":"`retryCount: reminder.retryCount + 1` is non-atomic and can lose increments under concurrent cron runs because it writes a stale value read by `findMany`; should use Prisma atomic `{ increment: 1 }` (including in the catch-path update)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":2,"text":"The `prisma.workflowReminder.update` inside the `catch` block is not protected by its own try/catch; if the reminder was deleted after `findMany`, Prisma can throw P2025 and abort the loop, skipping remaining reminders","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"Using retryCount: reminder.retryCount + 1 reads a possibly stale value and can lose increments under concurrency; consider an atomic increment via Prisma (increment: 1) to avoid race conditions (also applies to the similar update in the catch block).","severity":"High","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`retryCount: reminder.retryCount + 1` is non-atomic and can lose increments under concurrent cron runs because it writes a stale value read by `findMany`; should use Prisma atomic `{ increment: 1 }` (including in the catch-path update)","confidence":0.98,"reasoning":"The candidate flags the same concurrency/race condition: retryCount computed from a potentially stale reminder.retryCount read earlier, leading to lost increments, and recommends Prisma atomic increment { increment: 1 } including the catch-path update."},{"answer_key_index":1,"answer_key_item":"The deletion logic in scheduleSMSReminders.ts incorrectly deletes non-SMS workflow reminders (e.g., Email, WhatsApp) that have retryCount > 1. This occurs because the retryCount condition within the OR clause for deletion lacks a method: WorkflowMethods.SMS filter, causing it to apply to all reminder types instead of only SMS reminders, which is the intended scope of this function.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"`retryCount: { gt: 1 }` is in an OR branch without `method: WorkflowMethods.SMS`, so the SMS cron can delete non-SMS WorkflowReminders (e.g., email/WhatsApp) when `retryCount > 1`","confidence":0.97,"reasoning":"The candidate describes the same bug: an OR deletion condition includes `retryCount > 1` without restricting `method` to `WorkflowMethods.SMS`, allowing the SMS cron to delete non-SMS reminders like email/WhatsApp. This matches the golden comment\u2019s underlying issue and cause."}],"missed":[],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":2,"hits":2,"false_alarms":1,"misses":0},"core":{"items":2,"hits":2,"false_alarms":1,"misses":0},"all":{"items":2,"hits":2,"false_alarms":1,"misses":0}}},"cal_dot_com__cal.com__PR22345":{"pull_request":"https://github.com/calcom/cal.com/pull/22345","project":"Cal.com","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[],"hits":[],"missed":[{"answer_key_index":0,"answer_key_item":"In getBaseConditions(), the else if (filterConditions) and final else branches are unreachable. This is because getAuthorizationConditions() always returns a non-null Prisma.Sql object, making authConditions always truthy, which means only the first two if/else if conditions are ever evaluated.","severity":"Low","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":1,"answer_key_item":"Fetching userIdsFromOrg only when teamsFromOrg.length > 0 can exclude org-level members for orgs without child teams; consider deriving from teamIds (which includes orgId) or removing the guard so org-only orgs still include member user bookings.","severity":"Medium","category":"speculative","profiles":["all"]}],"duplicate_groups":[],"counts":{"strict":{"items":1,"hits":0,"false_alarms":0,"misses":1},"core":{"items":1,"hits":0,"false_alarms":0,"misses":1},"all":{"items":2,"hits":0,"false_alarms":0,"misses":2}}},"cal_dot_com__cal.com__PR22532":{"pull_request":"https://github.com/calcom/cal.com/pull/22532","project":"Cal.com","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":4,"candidates":[{"index":0,"text":"updateManyByCredentialId(this.credential.id, {}) performs an empty Prisma update and may not bump SelectedCalendar.updatedAt via @updatedAt; updatedAt should be set explicitly (e.g., new Date())","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"new Intl.DateTimeFormat(\"en-US\", ...) hardcodes the locale, causing all users to see US-formatted dates instead of using the user's locale (e.g., i18n.language from useLocale)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[3]},{"index":2,"text":"connectedCalendars.handler.ts instantiates CalendarCacheRepository directly, bypassing the calendar-cache feature-flag check in CalendarCache.init(), so getCacheStatusByCredentialIds can return cacheUpdatedAt even when the flag is off","verdict":"false alarm","basis":"matched no answer-key item"},{"index":3,"text":"Throwing new Error(\"Credential not found or access denied\") results in an INTERNAL_SERVER_ERROR (500) to the client; should throw a TRPCError with NOT_FOUND or FORBIDDEN","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":4,"text":"scripts/test-gcal-webhooks.sh uses sed -i '' -E (BSD/macOS syntax) which fails on GNU sed (Linux), preventing GOOGLE_WEBHOOK_URL from being updated; needs a portable approach (e.g., temp file + move)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":0,"answer_key_item":"The updateManyByCredentialId call uses an empty data object, which prevents Prisma's @updatedAt decorator from updating the updatedAt timestamp. This results in inaccurate cache status tracking, as the timestamp isn't updated when the cache is refreshed. To fix this, explicitly set the updatedAt field.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"updateManyByCredentialId(this.credential.id, {}) performs an empty Prisma update and may not bump SelectedCalendar.updatedAt via @updatedAt; updatedAt should be set explicitly (e.g., new Date())","confidence":0.96,"reasoning":"The candidate flags that an empty Prisma update ({}) may not trigger the @updatedAt behavior on SelectedCalendar.updatedAt and recommends explicitly setting updatedAt (e.g., new Date()). This is the same underlying issue as the golden comment about inaccurate cache status tracking due to updatedAt not being bumped on refresh."},{"answer_key_index":1,"answer_key_item":"logic: macOS-specific sed syntax with empty string after -i flag will fail on Linux systems","severity":"Low","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":4,"matched_candidate":"scripts/test-gcal-webhooks.sh uses sed -i '' -E (BSD/macOS syntax) which fails on GNU sed (Linux), preventing GOOGLE_WEBHOOK_URL from being updated; needs a portable approach (e.g., temp file + move)","confidence":0.97,"reasoning":"The candidate flags that `sed -i ''` is BSD/macOS-specific and will fail on GNU sed on Linux, which is exactly the golden issue about macOS-specific sed in-place syntax with an empty string after `-i` breaking on Linux."},{"answer_key_index":2,"answer_key_item":"Throwing a generic Error for authentication failures results in a 500 response in tRPC. Instead, it should return a structured TRPCError with an appropriate code, such as FORBIDDEN, to accurately reflect the error type.","severity":"High","category":"api","profiles":["strict","core","all"],"matched_candidate_index":3,"matched_candidate":"Throwing new Error(\"Credential not found or access denied\") results in an INTERNAL_SERVER_ERROR (500) to the client; should throw a TRPCError with NOT_FOUND or FORBIDDEN","confidence":0.93,"reasoning":"Both comments flag that throwing a generic Error for an auth/authorization-related failure in tRPC will surface as a 500 INTERNAL_SERVER_ERROR, and recommend throwing a structured TRPCError with an appropriate code (e.g., FORBIDDEN). The candidate even mentions FORBIDDEN explicitly, matching the golden issue."},{"answer_key_index":3,"answer_key_item":"Date is formatted with hardcoded 'en-US' locale instead of using the user's locale from useLocale, which can lead to incorrect date representation for users in different locales.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"new Intl.DateTimeFormat(\"en-US\", ...) hardcodes the locale, causing all users to see US-formatted dates instead of using the user's locale (e.g., i18n.language from useLocale)","confidence":0.97,"reasoning":"The candidate issue flags that Intl.DateTimeFormat is hardcoded to \"en-US\" and should instead use the user's locale (e.g., from useLocale/i18n.language), which is exactly the golden concern about incorrect date formatting for non-US locales."}],"missed":[],"duplicate_groups":[[0],[1],[2],[3],[4]],"counts":{"strict":{"items":4,"hits":4,"false_alarms":1,"misses":0},"core":{"items":4,"hits":4,"false_alarms":1,"misses":0},"all":{"items":4,"hits":4,"false_alarms":1,"misses":0}}},"cal_dot_com__cal.com__PR7232":{"pull_request":"https://github.com/calcom/cal.com/pull/7232","project":"Cal.com","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":3,"candidates":[{"index":0,"text":"`remindersToCancel` is loaded after a `deleteMany` purge that deletes email reminders with `scheduledDate <= now`, causing expired reminders to be removed before SendGrid cancellation and potentially still sent by the provider","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"`deleteScheduledEmailReminder` and `deleteScheduledSMSReminder` are async but are called without `await`, so handlers may return before deletions complete (especially in serverless runtimes); promises should be collected and awaited (e.g., via `Promise.all`)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]}],"hits":[{"answer_key_index":0,"answer_key_item":"Asynchronous functions deleteScheduledEmailReminder and deleteScheduledSMSReminder are called without await inside forEach loops. This occurs during booking rescheduling/cancellation, and workflow/workflow step deletion/updates. Consequently, scheduled workflow reminders may not be reliably cancelled, potentially leaving them active.","severity":"Medium","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`deleteScheduledEmailReminder` and `deleteScheduledSMSReminder` are async but are called without `await`, so handlers may return before deletions complete (especially in serverless runtimes); promises should be collected and awaited (e.g., via `Promise.all`)","confidence":0.9,"reasoning":"The candidate flags the same core issue: async deleteScheduledEmailReminder/deleteScheduledSMSReminder are invoked without awaiting, meaning execution may finish before deletions complete. This matches the golden concern about unreliable cancellation of scheduled reminders due to missing awaits (often in loops)."}],"missed":[{"answer_key_index":1,"answer_key_item":"When immediateDelete is true, the deleteScheduledEmailReminder function cancels the SendGrid email but fails to delete the corresponding WorkflowReminder record from the database. This creates orphaned database entries and is inconsistent with the immediateDelete: false path, which marks the record as cancelled. The SendGrid DELETE API call is also omitted in this path.","severity":"High","category":"data","profiles":["strict","core","all"]},{"answer_key_index":2,"answer_key_item":"The 'cancelled' field is nullable, which can lead to existing records having null values instead of a default of false. This can cause incorrect behavior in the application when checking the cancellation status of reminders.","severity":"Medium","category":"data","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":3,"hits":1,"false_alarms":1,"misses":2},"core":{"items":3,"hits":1,"false_alarms":1,"misses":2},"all":{"items":3,"hits":1,"false_alarms":1,"misses":2}}},"cal_dot_com__cal.com__PR8087":{"pull_request":"https://github.com/calcom/cal.com/pull/8087","project":"Cal.com","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"In handleCancelBooking.ts, using await inside a forEach(async ...) causes apiDeletes.push(deletedEvent) to occur after Promise.all(apiDeletes) is evaluated, so recurring-event calendar deletions are not properly tracked or awaited","verdict":"hit","basis":"duplicate of a candidate that matched an answer-key item"},{"index":1,"text":"In handleCancelBooking.ts, errors from recurring-event calendar deletions can go unhandled because the async forEach callback is not awaited","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":2,"text":"In bookings.tsx, bookingRefsFiltered.forEach(async ...) is not awaited, so the handler may return before deleteEvent/deleteMeeting complete","verdict":"false alarm","basis":"matched no answer-key item"},{"index":3,"text":"In bookings.tsx, rejections/errors from deleteEvent/deleteMeeting can go unhandled because the async forEach callback is not awaited","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":1,"answer_key_item":"The code uses forEach with async callbacks, which causes asynchronous operations (e.g., calendar/video event deletions, payment refunds) to run concurrently without being awaited. This 'fire-and-forget' behavior leads to unhandled promise rejections, race conditions, and incomplete cleanup, as surrounding try-catch blocks cannot properly handle errors from these unawaited promises. Replace forEach with for...of loops or Promise.all() with map() to ensure proper sequential execution and error handling.","severity":"Critical","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"In handleCancelBooking.ts, errors from recurring-event calendar deletions can go unhandled because the async forEach callback is not awaited","confidence":0.9,"reasoning":"The candidate flags the same core problem: using an async callback inside forEach that is not awaited, leading to unhandled errors (specifically for recurring-event calendar deletions). This aligns with the golden issue about fire-and-forget async operations and ineffective error handling due to unawaited promises, though the candidate mentions only one instance rather than all related operations."}],"missed":[{"answer_key_index":0,"answer_key_item":"Consider adding try-catch around the await to handle import failures gracefully","severity":"Low","category":"speculative","profiles":["all"]}],"duplicate_groups":[[0,1],[2,3]],"counts":{"strict":{"items":1,"hits":1,"false_alarms":2,"misses":0},"core":{"items":1,"hits":1,"false_alarms":2,"misses":0},"all":{"items":2,"hits":1,"false_alarms":2,"misses":1}}},"cal_dot_com__cal.com__PR8330":{"pull_request":"https://github.com/calcom/cal.com/pull/8330","project":"Cal.com","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"Using `dayjs(date.start).add(...) === dayjs(date.end).add(...)` compares object references and is always false, so the zero-length override (day unavailable) is never detected; should compare via `.isSame()` or `.valueOf()`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":1,"text":"`end` is computed from `slotStartTime` (same as `start`), so `end > workingHour.endTime` only validates the slot start time and allows slots that extend past `endTime`; should compute `end` from `slotEndTime`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]}],"hits":[{"answer_key_index":0,"answer_key_item":"Incorrect end time calculation using slotStartTime instead of slotEndTime","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`end` is computed from `slotStartTime` (same as `start`), so `end > workingHour.endTime` only validates the slot start time and allows slots that extend past `endTime`; should compute `end` from `slotEndTime`","confidence":0.98,"reasoning":"The candidate explicitly states that `end` is incorrectly computed from `slotStartTime` instead of `slotEndTime`, matching the golden issue about incorrect end time calculation."},{"answer_key_index":1,"answer_key_item":"Using === for dayjs object comparison will always return false as it compares object references, not values. Use .isSame() method instead: dayjs(date.start).add(utcOffset, 'minutes').isSame(dayjs(date.end).add(utcOffset, minutes))","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"Using `dayjs(date.start).add(...) === dayjs(date.end).add(...)` compares object references and is always false, so the zero-length override (day unavailable) is never detected; should compare via `.isSame()` or `.valueOf()`","confidence":0.96,"reasoning":"Both comments flag that comparing Dayjs instances with `===` checks object identity rather than date/time value, making the condition always false. Both recommend using `.isSame()` (candidate also mentions `.valueOf()` as an alternative), which addresses the same underlying bug."}],"missed":[],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":2,"hits":2,"false_alarms":0,"misses":0},"core":{"items":2,"hits":2,"false_alarms":0,"misses":0},"all":{"items":2,"hits":2,"false_alarms":0,"misses":0}}},"discourse__discourse-graphite__PR1":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/1","project":"Discourse","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":4,"candidates":[{"index":0,"text":"A second `downsize(from, to, dimensions, opts={})` method definition in `app/models/optimized_image.rb` overrides the existing 5-argument `downsize` version, breaking callers that pass 5 args","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"`resize_emoji.rb:14` calls `downsize(path, path, 100, 100, opts)` and now raises `ArgumentError` due to the overridden `downsize` signature","verdict":"hit","basis":"duplicate of a candidate that matched an answer-key item"},{"index":2,"text":"`var maxSizeKB = 10 * 1024;` in `app/assets/javascripts/discourse/lib/utilities.js` hardcodes the client upload size limit and ignores per-type `max_<type>_size_kb` settings","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":3,"text":"Because the client-side size check ignores `max_attachment_size_kb`, oversized attachments can pass the client validation and only fail on the server","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"The downsize method is defined twice. The second definition, which expects a single dimensions string parameter, overrides the first, which expected separate max_width and max_height parameters. This makes the original method unreachable and breaks existing code that calls it with separate width and height arguments.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"A second `downsize(from, to, dimensions, opts={})` method definition in `app/models/optimized_image.rb` overrides the existing 5-argument `downsize` version, breaking callers that pass 5 args","confidence":0.93,"reasoning":"Both describe that `downsize` is defined twice and the later definition overrides the earlier one, making the original signature unreachable and breaking existing callers that use the older argument list."},{"answer_key_index":1,"answer_key_item":"Hardcoding maxSizeKB = 10 * 1024 ignores Discourse.SiteSettings['max_' + type + '_size_kb'], so the client-side limit can diverge from server-side and per-type settings (also applies to the 413 handler below).","severity":"Low","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"`var maxSizeKB = 10 * 1024;` in `app/assets/javascripts/discourse/lib/utilities.js` hardcodes the client upload size limit and ignores per-type `max_<type>_size_kb` settings","confidence":0.9,"reasoning":"The candidate flags the same core problem: a hardcoded `maxSizeKB = 10 * 1024` on the client that ignores the per-type `max_<type>_size_kb` site settings, leading to divergence from server-side limits. It doesn\u2019t mention the 413 handler, but the primary issue matches."}],"missed":[{"answer_key_index":2,"answer_key_item":"Passing 80% as the dimensions can fail for animated GIFs when allow_animated_thumbnails is true, since the animated path uses gifsicle --resize-fit which expects WxH geometry, not a percentage; downsizing would then silently fail.","severity":"Medium","category":"data","profiles":["strict","core","all"]},{"answer_key_index":3,"answer_key_item":"The loop checking `tempfile.size` may never terminate correctly due to stale cached size, leading to potential infinite loops or incorrect file handling after modifications.","severity":"Medium","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0,1],[2],[3]],"counts":{"strict":{"items":4,"hits":2,"false_alarms":1,"misses":2},"core":{"items":4,"hits":2,"false_alarms":1,"misses":2},"all":{"items":4,"hits":2,"false_alarms":1,"misses":2}}},"discourse__discourse-graphite__PR10":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/10","project":"Discourse","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":7,"candidates":[{"index":0,"text":"`execute(...)[0]['id']` in the migration can raise NoMethodError when no `embed_category` setting or matching category exists because `[0]` is nil (also occurs at line 15)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[6]},{"index":1,"text":"In `Admin::EmbeddableHostsController` `update`/`destroy`, using `.where(id:).first` can return nil for unknown ids, leading to NoMethodError when calling `destroy` or `save_host(host)` instead of returning 404/using `find`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":2,"text":"`EmbeddableHost.record_for_host` matches against `uri.host` (no port) while validation allows storing hosts with ports, so entries like `example.com:8080` never match referers","verdict":"false alarm","basis":"matched no answer-key item"},{"index":3,"text":"`before_validation` calls `self.host.sub!` which raises NoMethodError when `host` is nil, causing 500s instead of validation errors","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":4,"text":"`record_for_host` compares `lower(host)` to `uri.host` without downcasing `uri.host`, so mixed-case hosts (e.g., `http://Eviltrout.com/x`) fail to match and `host_allowed?` returns false","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":5,"text":"Migration interpolates legacy host value directly into SQL (`'#{h}'`), so hosts containing single quotes break SQL and abort the migration; should use quoting/bind parameters","verdict":"hit","basis":"matched answer-key item","answer_key_items":[5]},{"index":6,"text":"Fabricator definitions are in the wrong files: `category_fabricator.rb` defines `Fabricator(:embeddable_host)` and `embeddable_host_fabricator.rb` defines category fabricators; they should be swapped/moved to matching filenames","verdict":"hit","basis":"matched answer-key item","answer_key_items":[4]}],"hits":[{"answer_key_index":0,"answer_key_item":"The EmbeddableHost model's before_validation callback calls self.host.sub! to strip http://, https://, and path segments, but if self.host is nil, this raises NoMethodError.","severity":"Critical","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":3,"matched_candidate":"`before_validation` calls `self.host.sub!` which raises NoMethodError when `host` is nil, causing 500s instead of validation errors","confidence":0.93,"reasoning":"Both describe the same bug: the before_validation callback uses `self.host.sub!`, which will raise NoMethodError when `host` is nil. The candidate omits the detail about stripping protocols/path segments but correctly identifies the nil-host crash underlying the golden comment."},{"answer_key_index":1,"answer_key_item":"The update and destroy methods in Admin::EmbeddableHostsController do not validate the existence of the EmbeddableHost record retrieved by ID. If EmbeddableHost.where(id: params[:id]).first returns nil (i.e., the host does not exist), attempting to call methods on the nil object (e.g., save_host or destroy) will result in a NoMethodError.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"In `Admin::EmbeddableHostsController` `update`/`destroy`, using `.where(id:).first` can return nil for unknown ids, leading to NoMethodError when calling `destroy` or `save_host(host)` instead of returning 404/using `find`","confidence":0.96,"reasoning":"The candidate notes that `.where(id:).first` in `update`/`destroy` may return nil for unknown IDs and that calling `destroy` or `save_host` on it would raise a NoMethodError, suggesting returning 404 or using `find`. This is the same nil-record validation issue described in the golden comment."},{"answer_key_index":2,"answer_key_item":"record_for_host compares lower(host) = ? but does not normalize the parameter\u2019s case, so mixed\u2011case referer hosts may fail to match even though comparison intends to be case\u2011insensitive.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":4,"matched_candidate":"`record_for_host` compares `lower(host)` to `uri.host` without downcasing `uri.host`, so mixed-case hosts (e.g., `http://Eviltrout.com/x`) fail to match and `host_allowed?` returns false","confidence":0.98,"reasoning":"Both describe the same bug: `record_for_host` lowercases the stored host in the comparison but does not normalize/downcase the input host (`uri.host`/parameter), causing mixed-case hosts to fail matching despite intended case-insensitive behavior."},{"answer_key_index":4,"answer_key_item":"The contents of `category_fabricator.rb` and `embeddable_host_fabricator.rb` have been swapped, resulting in the loss of original category fabricators and potentially causing errors in fabricator usage.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":6,"matched_candidate":"Fabricator definitions are in the wrong files: `category_fabricator.rb` defines `Fabricator(:embeddable_host)` and `embeddable_host_fabricator.rb` defines category fabricators; they should be swapped/moved to matching filenames","confidence":0.94,"reasoning":"The candidate notes that `category_fabricator.rb` contains the embeddable_host fabricator and `embeddable_host_fabricator.rb` contains category fabricators, indicating the definitions are in the wrong files and should be swapped. This is the same underlying issue as the golden comment about the files\u2019 contents being swapped, leading to loss/misuse of the intended fabricators."},{"answer_key_index":5,"answer_key_item":"The SQL query in the `app/controllers/admin/embeddable_hosts_controller.rb` file uses string interpolation (`'#{h}'`) to insert values, which is vulnerable to SQL injection. It should use parameter binding or proper quoting to prevent this security vulnerability.","severity":"Critical","category":"security","profiles":["strict","core","all"],"matched_candidate_index":5,"matched_candidate":"Migration interpolates legacy host value directly into SQL (`'#{h}'`), so hosts containing single quotes break SQL and abort the migration; should use quoting/bind parameters","confidence":0.9,"reasoning":"Both point out unsafe SQL string interpolation using `'#{h}'` and recommend quoting/bind parameters. The candidate emphasizes migration failure with quotes but still identifies the same underlying SQL injection/unsafe interpolation issue."},{"answer_key_index":6,"answer_key_item":"The migration accesses execute(...)[0]['id'] without checking if the query returned any rows, which causes a crash when no embed_category setting exists. This can lead to a broken feature when attempting to edit category/host relationships.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"`execute(...)[0]['id']` in the migration can raise NoMethodError when no `embed_category` setting or matching category exists because `[0]` is nil (also occurs at line 15)","confidence":0.93,"reasoning":"Both describe the migration indexing into `execute(...)[0]['id']` without ensuring any rows were returned, leading to a crash/NoMethodError when the `embed_category` setting (or matching category) is missing. This is the same underlying issue."}],"missed":[{"answer_key_index":3,"answer_key_item":"Because this migration inserts embeddable_hosts rows with raw SQL, any existing embeddable_hosts values that include http:// or /https:// or path segments won\u2019t go through the EmbeddableHost model\u2019s normalization, so the new host lookup (which compares only the bare host) may fail for migrated data. Consider ensuring that migrated hosts are normalized to the same format as newly created EmbeddableHost records so existing embedding configurations keep working.","severity":"High","category":"data","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2],[3],[4],[5],[6]],"counts":{"strict":{"items":7,"hits":6,"false_alarms":1,"misses":1},"core":{"items":7,"hits":6,"false_alarms":1,"misses":1},"all":{"items":7,"hits":6,"false_alarms":1,"misses":1}}},"discourse__discourse-graphite__PR2":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/2","project":"Discourse","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"TopicUser.find_by(...) can return nil, so accessing tu.notification_level can raise NoMethodError and cause a 500; needs nil handling or use TopicUser.change","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"unsubscribe mutates notification state via tu.save! on a GET route, allowing mail scanners/prefetchers or repeated hits to unintentionally mute/toggle notification state; should require confirmation POST/PUT","verdict":"false alarm","basis":"matched no answer-key item"},{"index":2,"text":"Using tu.save! directly does not update notifications_reason_id (unlike TopicUser.change), so an auto-tracked user may keep a nil reason and later topic reads can auto-promote them back to tracking, undoing the unsubscribe","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"logic: Potential nil pointer exception - if no TopicUser record exists, tu will be nil and calling methods on it will crash","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"TopicUser.find_by(...) can return nil, so accessing tu.notification_level can raise NoMethodError and cause a 500; needs nil handling or use TopicUser.change","confidence":0.94,"reasoning":"Both point out that TopicUser.find_by may return nil and subsequent method/attribute access on tu would raise an exception (nil pointer/NoMethodError), requiring nil handling."}],"missed":[{"answer_key_index":1,"answer_key_item":"Typo in property name: 'stopNotificiationsText' should be 'stopNotificationsText' (missing 'n' in 'Notifications')","severity":"Low","category":"style","profiles":["all"]}],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":1,"hits":1,"false_alarms":2,"misses":0},"core":{"items":1,"hits":1,"false_alarms":2,"misses":0},"all":{"items":2,"hits":1,"false_alarms":2,"misses":1}}},"discourse__discourse-graphite__PR3":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/3","project":"Discourse","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":3,"candidates":[{"index":0,"text":"UsersController#create calls user.valid? and then user.save, causing EmailValidator/BlockedEmail.should_block? to run twice and increment match_count twice per signup","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"BlockedEmail.should_block? performs a case-sensitive lookup (where(email: email)), allowing blocked emails to bypass the check by changing letter case","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":2,"text":"email_in_restriction_setting? builds a domain-matching regex without an end anchor, allowing emails like bob@example.com.attacker.net to match a whitelisted domain example.com","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":0,"answer_key_item":"BlockedEmail.should_block_email? method has side effects during a read operation - it updates statistics even when just checking if an email should be blocked. This could cause race conditions in concurrent environments and makes the method name misleading.","severity":"Medium","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"UsersController#create calls user.valid? and then user.save, causing EmailValidator/BlockedEmail.should_block? to run twice and increment match_count twice per signup","confidence":0.78,"reasoning":"Golden issue is that BlockedEmail.should_block_email? has side effects (updates statistics) during what should be a read/check, leading to misleading naming and potential race conditions. The candidate points out a specific manifestation: calling validation and then save triggers the check twice, causing match_count to increment twice. This relies on the same underlying problem (side effects in the check method), but focuses on double invocation rather than the broader design/race-condition concern. Still, it identifies the same core issue: the check increments stats when it shouldn\u2019t."},{"answer_key_index":1,"answer_key_item":"The regex pattern @(#{domains}) in email_in_restriction_setting? method only matches domain suffixes, not full domains with proper boundary anchoring. An attacker can register evil.example.com to bypass a whitelist entry for example.com.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"email_in_restriction_setting? builds a domain-matching regex without an end anchor, allowing emails like bob@example.com.attacker.net to match a whitelisted domain example.com","confidence":0.9,"reasoning":"Both describe the same flaw: the domain-matching regex in email_in_restriction_setting? lacks proper boundary/end anchoring, so a whitelisted domain like example.com can be bypassed by using a longer domain that contains it (e.g., evil.example.com or example.com.attacker.net)."},{"answer_key_index":2,"answer_key_item":"The case-sensitive email lookup in `BlockedEmail.should_block?` creates a bypass risk, allowing 'User@Example.com' to bypass a block on 'user@example.com'. This can lead to unauthorized access to blocked users.","severity":"Critical","category":"security","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"BlockedEmail.should_block? performs a case-sensitive lookup (where(email: email)), allowing blocked emails to bypass the check by changing letter case","confidence":0.97,"reasoning":"Both the golden comment and the candidate issue describe the same underlying problem: `BlockedEmail.should_block?` uses a case-sensitive email lookup, which allows bypassing a block by changing the email\u2019s letter casing (e.g., User@Example.com vs user@example.com)."}],"missed":[],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":3,"hits":3,"false_alarms":0,"misses":0},"core":{"items":3,"hits":3,"false_alarms":0,"misses":0},"all":{"items":3,"hits":3,"false_alarms":0,"misses":0}}},"discourse__discourse-graphite__PR4":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/4","project":"Discourse","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":8,"candidates":[{"index":0,"text":"TopicRetriever#invalid_host? validates only the initial host, but open(url) follows redirects, allowing redirects from an allowed embeddable host to internal addresses (SSRF risk); redirect targets must be validated or redirects disabled","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"TopicEmbed.import interpolates url unescaped into an <a href='#{url}'>, and the /^https?:\\/\\// guard allows quote injection or multiline values, enabling stored XSS in raw_html; URL must be escaped and regex anchored with \\A/\\z","verdict":"false alarm","basis":"matched no answer-key item"},{"index":2,"text":"Template syntax error: '<%- end if %>' is invalid Ruby (if modifier without condition), causing embed/best template compilation failure and runtime errors on every request","verdict":"hit","basis":"matched answer-key item","answer_key_items":[5]},{"index":3,"text":"embed.js postMessage origin validation uses substring match (discourseUrl.indexOf(e.origin) === -1), allowing lookalike origins that are substrings to control iframe height; must compare exact parsed origins","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":4,"text":"X-Frame-Options header uses invalid value 'ALLOWALL', so browsers ignore it and the response becomes framable by any origin; should use CSP frame-ancestors to restrict or remove the header if unrestricted framing is intended","verdict":"false alarm","basis":"matched no answer-key item"},{"index":5,"text":"Post#cook returns raw unsanitized when cook_method == raw_html, and TopicEmbed.import stores remote content with only URL absolutization; rendering with raw post.cooked enables stored XSS from embedded feed content; sanitize before storing/rendering","verdict":"false alarm","basis":"matched no answer-key item"},{"index":6,"text":"Migration uses create_table :top_topics, force: true, which can drop an existing top_topics table and its data when run where the table exists; remove force: true unless intentional and documented","verdict":"false alarm","basis":"matched no answer-key item"},{"index":7,"text":"Disqus import task fetches each URL via open(url) with no per-item rescue, so a single dead link aborts the entire import loop; rescue per thread/link and log/skip failures","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":1,"answer_key_item":"The current origin validation using indexOf is insufficient and can be bypassed. An attacker could use a malicious domain like evil-discourseUrl.com to pass this check.","severity":"Medium","category":"security","profiles":["strict","core","all"],"matched_candidate_index":3,"matched_candidate":"embed.js postMessage origin validation uses substring match (discourseUrl.indexOf(e.origin) === -1), allowing lookalike origins that are substrings to control iframe height; must compare exact parsed origins","confidence":0.94,"reasoning":"Both describe the same flaw: origin validation relies on indexOf/substring matching, which can be bypassed by lookalike/malicious domains that contain the trusted domain as a substring. Candidate also notes the need for exact parsed origin comparison, aligning with the golden issue."},{"answer_key_index":5,"answer_key_item":"The ERB block closes with end if, which is invalid Ruby/ERB and will raise at render; it should just be end to close the if block.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"Template syntax error: '<%- end if %>' is invalid Ruby (if modifier without condition), causing embed/best template compilation failure and runtime errors on every request","confidence":0.96,"reasoning":"Both describe the same ERB/Ruby syntax problem: using `<%- end if %>` to close an `if` block is invalid and will raise during template rendering; it should be just `end`."}],"missed":[{"answer_key_index":0,"answer_key_item":"The PollFeed job calls open(SiteSetting.feed_polling_url) without validating the URL, allowing an attacker who controls the feed_polling_url site setting to make the server fetch arbitrary internal or external URLs.","severity":"Critical","category":"security","profiles":["strict","core","all"]},{"answer_key_index":2,"answer_key_item":"postMessage targetOrigin should be the origin (scheme+host+port), not the full referrer URL; using the full URL will cause the message to be dropped and prevent resizing.","severity":"Medium","category":"security","profiles":["strict","core","all"]},{"answer_key_index":3,"answer_key_item":"The code sets X-Frame-Options: ALLOWALL which completely disables clickjacking protection. The referer validation can be bypassed (referer headers are easily spoofed), and the fallback to empty string for nil referer masks validation failures.","severity":"Medium","category":"security","profiles":["strict","core","all"]},{"answer_key_index":4,"answer_key_item":"The TopicEmbed.import method is susceptible to a NoMethodError if the contents parameter is nil when attempting to append a string, and an XSS vulnerability due to unescaped url interpolation in the generated HTML.","severity":"Medium","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":6,"answer_key_item":"Calling `i.content.scrub` assumes that `i.content` is always populated. However, many RSS feeds do not provide a `content` field, leading to a potential nil pointer exception when `i.content` is nil. A fallback to `description` should be implemented to prevent crashes.","severity":"High","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":7,"answer_key_item":"An unescaped request header (request.referer) is interpolated into JavaScript without proper escaping, which can lead to XSS vulnerabilities if the referer contains malicious content. This issue can allow attackers to execute arbitrary scripts in the context of the application.","severity":"Critical","category":"security","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2],[3],[4],[5],[6],[7]],"counts":{"strict":{"items":8,"hits":2,"false_alarms":6,"misses":6},"core":{"items":8,"hits":2,"false_alarms":6,"misses":6},"all":{"items":8,"hits":2,"false_alarms":6,"misses":6}}},"discourse__discourse-graphite__PR5":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/5","project":"Discourse","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":3,"candidates":[{"index":0,"text":"Uses the non-implemented CSS property `-ms-align-items: $alignment;`, which is ignored by all browsers and should be removed since `-ms-flex-align` is already set","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":1,"text":"`-webkit-box-ordinal-group` and `-moz-box-ordinal-group` are assigned `$val` even though they are 1-based (and 0 is invalid) while `order` is 0-based; they should use `$val + 1`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]}],"hits":[{"answer_key_index":1,"answer_key_item":"-ms-align-items never existed in any version of IE/Edge; the correct legacy property is -ms-flex-align.","severity":"Low","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"Uses the non-implemented CSS property `-ms-align-items: $alignment;`, which is ignored by all browsers and should be removed since `-ms-flex-align` is already set","confidence":0.94,"reasoning":"Both point out that `-ms-align-items` is not a valid/implemented legacy IE/Edge flexbox property and that `-ms-flex-align` is the correct one already present, so the invalid property should be removed/replaced."},{"answer_key_index":2,"answer_key_item":"-webkit-box-ordinal-group and -moz-box-ordinal-group require values starting from 1, not 0. If $val is 0, this will cause incorrect rendering in older browsers, leading to layout issues.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`-webkit-box-ordinal-group` and `-moz-box-ordinal-group` are assigned `$val` even though they are 1-based (and 0 is invalid) while `order` is 0-based; they should use `$val + 1`","confidence":0.96,"reasoning":"The candidate notes that -webkit-box-ordinal-group and -moz-box-ordinal-group are 1-based, that 0 is invalid, and suggests using $val + 1, which matches the golden issue about incorrect rendering when $val is 0 in older browsers."}],"missed":[{"answer_key_index":0,"answer_key_item":"Mixing float: left with flexbox causes layout issues. Further this PR removes the float-based right alignment for .d-header .panel, which may cause the login panel in the non-Ember/noscript header (where .panel is nested inside .row and not a flex item) to stack under the title instead of remaining right-aligned.","severity":"Low","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":3,"hits":2,"false_alarms":0,"misses":1},"core":{"items":3,"hits":2,"false_alarms":0,"misses":1},"all":{"items":3,"hits":2,"false_alarms":0,"misses":1}}},"discourse__discourse-graphite__PR6":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/6","project":"Discourse","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":1,"candidates":[{"index":0,"text":"`include_website_name` method is missing the trailing `?`, so ActiveModel::Serializers does not invoke it and `website_name` is always serialized (nil when no website); it should be renamed to `include_website_name?`.","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[],"missed":[{"answer_key_index":0,"answer_key_item":"The include_website_name method is missing the required ? suffix. Rails serializers expect include_ methods to end with ? for conditional attribute inclusion, a convention followed by other methods in this serializer. Without it, the website_name attribute may not be conditionally included as intended. Additionally, the '.' << website_host string concatenation should be replaced with '.' + website_host or '.#{website_host}' to avoid mutating string literals, which can lead to issues.","severity":"Medium","category":"api","profiles":["strict","core","all"]}],"duplicate_groups":[],"counts":{"strict":{"items":1,"hits":0,"false_alarms":1,"misses":1},"core":{"items":1,"hits":0,"false_alarms":1,"misses":1},"all":{"items":1,"hits":0,"false_alarms":1,"misses":1}}},"discourse__discourse-graphite__PR7":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/7","project":"Discourse","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":5,"candidates":[{"index":0,"text":"In `.topic-meta-data h5 a`, the `$primary` argument to `dark-light-choose` was changed from `scale-color($primary, $lightness: 30%)` to 70%, making light-theme username color too light; `$primary` should remain 30% and `$secondary` should use 70%","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0,3]},{"index":1,"text":"In `.group-member-info .name` (desktop), `scale-color($primary, $lightness: 30%)` was changed to 50% for `$primary`, altering the light-theme color so it matches `.title`; `$primary` should be 30% and `$secondary` should be 70%","verdict":"hit","basis":"judged a match, directly or through a duplicate, for an answer-key item that another candidate matched with higher confidence; the benchmark does not count it as a false alarm"},{"index":2,"text":"In `.custom-message-length`, the light branch lightness was changed from 70% to 30%, making it much darker on light themes; `$primary` should be 70% and `$secondary` should be 30%","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":3,"text":"In `.topic-map h3`, the light branch lightness was changed from 20% to 50%, making light-theme color too light; it should use `dark-light-choose(scale-color($primary, $lightness: 20%), scale-color($secondary, $lightness: 80%))`","verdict":"false alarm","basis":"matched no answer-key item"},{"index":4,"text":"In `.group-member-info .name` (mobile), the light branch of `dark-light-choose` was changed from `scale-color($primary, $lightness: 30%)` to 50%, making the light-theme name lighter than before; restore 30% for the `$primary` branch and keep `$secondary` for dark","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":0,"answer_key_item":"In .topic-meta-data h5 a, the original code had color: scale-color($primary, $lightness: 30%) but was changed to dark-light-choose(scale-color($primary, $lightness: 70%), scale-color($secondary, $lightness: 30%)). The lightness for the light theme changed from 30% to 70%, which is a dramatic inversion","severity":"Low","category":"style","profiles":["all"],"matched_candidate_index":0,"matched_candidate":"In `.topic-meta-data h5 a`, the `$primary` argument to `dark-light-choose` was changed from `scale-color($primary, $lightness: 30%)` to 70%, making light-theme username color too light; `$primary` should remain 30% and `$secondary` should use 70%","confidence":0.9,"reasoning":"Both point to the same underlying issue in `.topic-meta-data h5 a`: the light-theme color based on `$primary` had its lightness changed from 30% to 70% when introducing `dark-light-choose`, which is an unintended dramatic shift/inversion. The candidate also suggests swapping values, but it still identifies the core problem of 30% -> 70% for the light theme."},{"answer_key_index":1,"answer_key_item":"This change for desktop/user.css changes $primary from 30% to 50% for the light theme; most other changes preserve the original $primary value and move the complement to $secondary for dark. Consider reviewing this (also applies to a similar .name change in the mobile variant).","severity":"Low","category":"speculative","profiles":["all"],"matched_candidate_index":4,"matched_candidate":"In `.group-member-info .name` (mobile), the light branch of `dark-light-choose` was changed from `scale-color($primary, $lightness: 30%)` to 50%, making the light-theme name lighter than before; restore 30% for the `$primary` branch and keep `$secondary` for dark","confidence":0.9,"reasoning":"Both point out that the light-theme branch changed the $primary scale-color lightness from 30% to 50% and suggest reverting to 30%, while keeping the dark branch using $secondary. The candidate explicitly mentions the mobile `.name` case, which the golden comment notes as a similar issue; it matches the same underlying concern about unintended $primary light-theme change."},{"answer_key_index":2,"answer_key_item":"In topic-post.css the original code used $lightness: 70% but the replacement uses $lightness: 30% for the light theme. This makes the text significantly darker than intended.","severity":"Low","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"In `.custom-message-length`, the light branch lightness was changed from 70% to 30%, making it much darker on light themes; `$primary` should be 70% and `$secondary` should be 30%","confidence":0.9,"reasoning":"Both comments flag the same underlying issue: in the light theme branch the $lightness value was changed from 70% to 30%, resulting in much darker text than intended. The candidate adds extra suggestions about $primary/$secondary, but it still identifies the same core regression."},{"answer_key_index":3,"answer_key_item":"The light theme color for `.topic-meta-data h5 a` was changed from `scale-color($primary, $lightness: 30%)` to `scale-color($primary, $lightness: 70%)`, which may unintentionally reduce contrast and affect readability. This change should be reviewed to ensure it aligns with design intentions.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"In `.topic-meta-data h5 a`, the `$primary` argument to `dark-light-choose` was changed from `scale-color($primary, $lightness: 30%)` to 70%, making light-theme username color too light; `$primary` should remain 30% and `$secondary` should use 70%","confidence":0.9,"reasoning":"Both comments flag the same change in `.topic-meta-data h5 a` where the light-theme color was altered from `scale-color($primary, $lightness: 30%)` to `70%`, potentially making the text too light and harming contrast/readability. The candidate adds an extra suggestion about `$secondary`, but the core issue matches."}],"missed":[{"answer_key_index":4,"answer_key_item":"In mobile/user.scss line 497, the lightness value for dark themes should be inverted to 70% instead of being changed to 50%. This change may lead to unintended visual regressions in light themes.","severity":"Medium","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2],[3],[4]],"counts":{"strict":{"items":3,"hits":2,"false_alarms":1,"misses":1},"core":{"items":3,"hits":2,"false_alarms":1,"misses":1},"all":{"items":5,"hits":4,"false_alarms":1,"misses":1}}},"discourse__discourse-graphite__PR8":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/8","project":"Discourse","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":6,"candidates":[{"index":0,"text":"`Math.floor(user_count / limit) + 1` overcounts total pages when `user_count` is an exact multiple of `limit`, causing `next` to show an empty page; should use `Math.ceil`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1,3]},{"index":1,"text":"`setupController` calls `model.findMembers()` without returning the promise, so the route doesn't wait for members to load and AJAX failures are dropped; return the promise or restore `afterModel`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":2,"text":"`limit = (params[:limit] || 50).to_i` applies to every group, but the public `group/members.hbs` has no paging, so groups with >50 members are silently truncated; add paging or increase the default limit","verdict":"false alarm","basis":"matched no answer-key item"},{"index":3,"text":"Controller spec uses `xhr :put, :remove_member` but the production route only supports DELETE, so the spec doesn't match routing; use `xhr :delete`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]}],"hits":[{"answer_key_index":0,"answer_key_item":" The findMembers() call is now asynchronous and unhandled. The controller may not have member data immediately available, creating a race condition.","severity":"High","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`setupController` calls `model.findMembers()` without returning the promise, so the route doesn't wait for members to load and AJAX failures are dropped; return the promise or restore `afterModel`","confidence":0.93,"reasoning":"Both describe the same underlying problem: `findMembers()` is asynchronous and its promise is not handled/returned, so the route/controller proceeds without waiting for member data, causing a race condition and potentially dropping errors."},{"answer_key_index":1,"answer_key_item":"In the next action, capping the next offset at user_count can produce an empty page (e.g., total equal to limit results in offset == total, showing 2/2 with no members). This can cause confusing UX on the last page.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"`Math.floor(user_count / limit) + 1` overcounts total pages when `user_count` is an exact multiple of `limit`, causing `next` to show an empty page; should use `Math.ceil`","confidence":0.9,"reasoning":"Both describe the same pagination edge case: when total users is an exact multiple of the page limit, the computed next offset/page can land exactly at user_count, yielding an empty last/next page and confusing UX. The candidate frames it as an overcounted total-pages calculation (floor+1 vs ceil), but the resulting bug (next leads to empty page) matches the golden issue."},{"answer_key_index":2,"answer_key_item":"The remove_member test uses xhr :put to call the remove_member action, but the route defines delete 'members' => 'groups#remove_member' requiring DELETE method.","severity":"Medium","category":"api","profiles":["strict","core","all"],"matched_candidate_index":3,"matched_candidate":"Controller spec uses `xhr :put, :remove_member` but the production route only supports DELETE, so the spec doesn't match routing; use `xhr :delete`","confidence":0.98,"reasoning":"Both point out that the spec calls remove_member with xhr :put, but the route is defined to accept DELETE for that action, so the HTTP verb in the test should be DELETE (xhr :delete)."},{"answer_key_index":3,"answer_key_item":"The `totalPages` calculation using `Math.floor(user_count / limit) + 1` produces an extra page when `user_count` is an exact multiple of `limit`, leading to incorrect pagination. For example, with 100 users and a limit of 50, it reports 3 pages instead of 2, allowing navigation to an empty page.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"`Math.floor(user_count / limit) + 1` overcounts total pages when `user_count` is an exact multiple of `limit`, causing `next` to show an empty page; should use `Math.ceil`","confidence":0.98,"reasoning":"The candidate flags the same pagination bug: using Math.floor(user_count/limit)+1 overcounts pages when user_count is an exact multiple of limit, leading to an extra/empty page, and suggests Math.ceil as the fix."}],"missed":[{"answer_key_index":4,"answer_key_item":"Expected to return a value at the end of function - code paths without explicit returns will return undefined","severity":"Medium","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":5,"answer_key_item":"The route provides the group's ID in params[:id], but the code attempts to read it from params[:group_id], causing the action to fail. This results in a broken feature when trying to access group memberships.","severity":"High","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2],[3]],"counts":{"strict":{"items":6,"hits":4,"false_alarms":1,"misses":2},"core":{"items":6,"hits":4,"false_alarms":1,"misses":2},"all":{"items":6,"hits":4,"false_alarms":1,"misses":2}}},"discourse__discourse-graphite__PR9":{"pull_request":"https://github.com/ai-code-review-evaluation/discourse-graphite/pull/9","project":"Discourse","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"I18n fallback locales are only ensured loaded in ApplicationController#set_locale; other locale-setting paths (e.g., Sidekiq jobs and I18n.with_locale usage in post_alerter/post_destroyer) may not load :en or the site default, causing missing keys to return \"translation missing\"","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"Translation cache key for I18n.translate omits site/default locale context even though FallbackLocaleList#[] depends on SiteSetting.default_locale (multisite-specific), allowing cached fallback translations from one site to be incorrectly reused on another","verdict":"false alarm","basis":"matched no answer-key item"},{"index":2,"text":"ensure_loaded! initializes @loaded_locales with ||= outside LOAD_MUTEX, creating a race where concurrent first calls can replace the array another thread is populating","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]}],"hits":[{"answer_key_index":0,"answer_key_item":"The @loaded_locales instance variable in translate_accelerator.rb is lazily initialized and accessed by multiple concurrent threads without synchronization.","severity":"Low","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"ensure_loaded! initializes @loaded_locales with ||= outside LOAD_MUTEX, creating a race where concurrent first calls can replace the array another thread is populating","confidence":0.93,"reasoning":"Both describe the same concurrency bug: @loaded_locales is lazily initialized (via ||=) and accessed/modified by multiple threads without proper synchronization, leading to a race during first-time initialization/population."}],"missed":[{"answer_key_index":1,"answer_key_item":"Consider normalizing the input locale (e.g., to a symbol) when checking/loading here to avoid double-loading if the same locale is passed as a String vs Symbol (also applies to other locations in the PR).","severity":"Low","category":"perf","profiles":["core","all"]}],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":1,"hits":1,"false_alarms":2,"misses":0},"core":{"items":2,"hits":1,"false_alarms":2,"misses":1},"all":{"items":2,"hits":1,"false_alarms":2,"misses":1}}},"grafana__grafana__PR103633":{"pull_request":"https://github.com/grafana/grafana/pull/103633","project":"Grafana","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":3,"candidates":[{"index":0,"text":"`userPermDenialCacheKey` concatenates name and parent with an unescaped `_`, allowing different (name,parent) pairs (e.g., `a_b`/`c` vs `a`/`b_c`) to collide and cause incorrect cached permission denials","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":1,"text":"Denial cache key built from `checkReq.UserUID` omits identity type; since anonymous and renderer identities both use UID `0`, an anonymous denial can incorrectly deny the renderer until cache expiry","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":2,"answer_key_item":"The cache key construction in `userPermDenialCacheKey` uses simple string concatenation with underscores, which can lead to ambiguous keys and collision risks when any component contains underscores or is empty. This could result in incorrect denial cache hits, affecting user permissions.","severity":"Medium","category":"data","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"`userPermDenialCacheKey` concatenates name and parent with an unescaped `_`, allowing different (name,parent) pairs (e.g., `a_b`/`c` vs `a`/`b_c`) to collide and cause incorrect cached permission denials","confidence":0.94,"reasoning":"The candidate flags that `userPermDenialCacheKey` builds cache keys by concatenating components with an unescaped underscore, leading to collisions between different (name,parent) pairs and thus incorrect cached permission denials. This is the same ambiguity/collision risk described in the golden comment (underscore delimiter and empty/underscore-containing components)."}],"missed":[{"answer_key_index":0,"answer_key_item":"The Check operation exhibits asymmetric cache trust logic: cached permission grants are trusted and returned immediately, but cached denials from the same permission cache are ignored, leading to a fresh database lookup. This allows stale cached grants to provide access to revoked resources, posing a security risk. ","severity":"High","category":"security","profiles":["strict","core","all"]},{"answer_key_index":1,"answer_key_item":"The test comment says the cached permissions 'allow access', but the map stores false for dashboards:uid:dash1, so checkPermission will still treat this scope as not allowed.","severity":"Low","category":"doc_defect","profiles":["core","all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":2,"hits":1,"false_alarms":1,"misses":1},"core":{"items":3,"hits":1,"false_alarms":1,"misses":2},"all":{"items":3,"hits":1,"false_alarms":1,"misses":2}}},"grafana__grafana__PR106778":{"pull_request":"https://github.com/grafana/grafana/pull/106778","project":"Grafana","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"`useAllRulerRuleAbilities` hardcodes `const isFederated = false`, making federated Mimir rules editable/deletable/pausable instead of immutable; should determine federated status from the rule group (e.g., via `isFederatedRuleGroup(rule.group)`) and pass it into the hook","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"`<GrafanaRuleListItem>` rendered inside `rules.map` in `FilterView.tsx` is missing a React `key` prop (`key={key}`), causing React key warnings and potential incorrect state reuse between list items","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":2,"text":"`GrafanaRuleListItem` builds its `href` with `createRelativeUrl(`/alerting/grafana/${uid}/view`)` without including `returnTo`, breaking back navigation to the filtered list; should pass `{ returnTo: createReturnTo() }`","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"The rendered GrafanaRuleListItem is missing the required key prop for React list items. This can cause rendering issues when the list order changes.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`<GrafanaRuleListItem>` rendered inside `rules.map` in `FilterView.tsx` is missing a React `key` prop (`key={key}`), causing React key warnings and potential incorrect state reuse between list items","confidence":0.97,"reasoning":"Both the golden comment and the candidate issue point out that GrafanaRuleListItem elements rendered in a map are missing the required React key prop, which can lead to warnings and incorrect rendering/state reuse when list order changes."}],"missed":[{"answer_key_index":1,"answer_key_item":"RuleActionsButtons is invoked with only promRule, but SilenceGrafanaRuleDrawer inside RuleActionsButtons still depends on a Grafana Ruler rule being present, so for Grafana rules coming from list views the 'Silence notifications' menu entry (now driven by Grafana Prom abilities) will toggle showSilenceDrawer without ever rendering the drawer. This means clicking 'Silence notifications' for these rules has no visible effect, even when abilities indicate silencing is allowed.","severity":"High","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":2,"hits":1,"false_alarms":2,"misses":1},"core":{"items":2,"hits":1,"false_alarms":2,"misses":1},"all":{"items":2,"hits":1,"false_alarms":2,"misses":1}}},"grafana__grafana__PR107534":{"pull_request":"https://github.com/grafana/grafana/pull/107534","project":"Grafana","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":1,"candidates":[{"index":0,"text":"Ad hoc filters are applied twice: runSplitQuery/runShardSplitQuery pass request.filters into applyTemplateVariables, and DataSourceWithBackend.query applies request.filters again, causing duplicated filtering","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"addAdHocFilters does not deduplicate filters, so reapplying request.filters can result in duplicate ad hoc filters being added","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[],"missed":[{"answer_key_index":0,"answer_key_item":"The applyTemplateVariables method is called with request.filters as the third parameter, but this parameter is not used in the corresponding test setup.","severity":"Low","category":"test_gap","profiles":["core","all"]}],"duplicate_groups":[[0,1]],"counts":{"strict":{"items":0,"hits":0,"false_alarms":2,"misses":0},"core":{"items":1,"hits":0,"false_alarms":2,"misses":1},"all":{"items":1,"hits":0,"false_alarms":2,"misses":1}}},"grafana__grafana__PR76186":{"pull_request":"https://github.com/grafana/grafana/pull/76186","project":"Grafana","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":3,"candidates":[{"index":0,"text":"TestLogger.FromContext returns a new TestLogger instance (NewTestLogger) instead of the injected fake, so LoggerMiddleware logs to a throwaway logger and tests observing InfoLogs.Calls on the injected fake see zero calls","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":1,"text":"req.PluginContext is dereferenced without a nil check in QueryData, CallResource, CheckHealth, and CollectMetrics, so a nil request can panic instead of passing through to next (missing nil guards)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]}],"hits":[{"answer_key_index":0,"answer_key_item":"The ContextualLoggerMiddleware methods (QueryData, CallResource, CheckHealth, CollectMetrics) panic when a nil request is received. This occurs because they directly access req.PluginContext (via the instrumentContext function) without first checking if req is nil. This is a regression, as previous middleware layers gracefully handled nil requests.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"req.PluginContext is dereferenced without a nil check in QueryData, CallResource, CheckHealth, and CollectMetrics, so a nil request can panic instead of passing through to next (missing nil guards)","confidence":0.93,"reasoning":"The candidate flags that req.PluginContext is dereferenced without checking if req is nil in the same four middleware methods, leading to a panic on nil requests. This is the same core issue described in the golden comment (nil request causes panic due to direct access of PluginContext)."},{"answer_key_index":2,"answer_key_item":"The `TestLogger.FromContext` method returns a new `TestLogger` instance via `NewTestLogger()` instead of returning the receiver (f). This causes logs to be recorded on an un-referenced instance, leading to broken test assertions that expect logs to be recorded on the original logger.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"TestLogger.FromContext returns a new TestLogger instance (NewTestLogger) instead of the injected fake, so LoggerMiddleware logs to a throwaway logger and tests observing InfoLogs.Calls on the injected fake see zero calls","confidence":0.94,"reasoning":"The candidate describes that TestLogger.FromContext creates a new TestLogger via NewTestLogger instead of using the injected/receiver logger, causing middleware to log to a throwaway instance and tests to see no calls. This is the same underlying issue as the golden comment (logs recorded on an unreferenced instance, breaking assertions)."}],"missed":[{"answer_key_index":1,"answer_key_item":"The traceID is no longer logged for plugin requests. During a refactoring, the tracing import and the logic to extract and add traceID from the context to log parameters were removed from the LoggerMiddleware. The newly introduced ContextualLoggerMiddleware does not add this information, resulting in missing traceID in plugin request logs and impacting debugging and request tracing capabilities.","severity":"Low","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":3,"hits":2,"false_alarms":0,"misses":1},"core":{"items":3,"hits":2,"false_alarms":0,"misses":1},"all":{"items":3,"hits":2,"false_alarms":0,"misses":1}}},"grafana__grafana__PR79265":{"pull_request":"https://github.com/grafana/grafana/pull/79265","project":"Grafana","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":5,"candidates":[{"index":0,"text":"CreateOrUpdateDevice performs a CountDevices check and then a separate upsert without a transaction/lock, allowing concurrent inserts to exceed the device limit","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"tagDeviceUI sets localCache.SetDefault(key, ...) before CreateOrUpdateDevice, so when ErrDeviceLimitReached occurs the key remains cached and subsequent requests bypass the device limit check","verdict":"hit","basis":"matched answer-key item","answer_key_items":[4]}],"hits":[{"answer_key_index":0,"answer_key_item":"Race condition: Multiple concurrent requests could pass the device count check simultaneously and create devices beyond the limit. Consider using a database transaction or lock.","severity":"High","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"CreateOrUpdateDevice performs a CountDevices check and then a separate upsert without a transaction/lock, allowing concurrent inserts to exceed the device limit","confidence":0.96,"reasoning":"Both describe the same race condition: a device count check followed by a separate create/upsert without transactional protection, allowing concurrent requests to bypass the limit and insert too many devices. Both suggest the need for a transaction/lock to prevent this."},{"answer_key_index":4,"answer_key_item":"The `tagDeviceUI` function populates the local cache with the device ID before the `CreateOrUpdateDevice` call. If `ErrDeviceLimitReached` is returned, the cache entry remains set, allowing subsequent requests to bypass the device limit until the cache expires after 29 minutes.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"tagDeviceUI sets localCache.SetDefault(key, ...) before CreateOrUpdateDevice, so when ErrDeviceLimitReached occurs the key remains cached and subsequent requests bypass the device limit check","confidence":0.94,"reasoning":"The candidate describes the same bug: tagDeviceUI caches the device ID before CreateOrUpdateDevice, and if ErrDeviceLimitReached occurs the cache entry remains, letting later requests bypass the device limit check. It omits the 29-minute expiry detail but matches the underlying issue."}],"missed":[{"answer_key_index":1,"answer_key_item":"Anonymous authentication now fails entirely if anonDeviceService.TagDevice returns ErrDeviceLimitReached. Previously, device tagging was asynchronous and non-blocking. This change prevents anonymous users from authenticating when the device limit is reached.","severity":"Medium","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":2,"answer_key_item":"The updateDevice function returns ErrDeviceLimitReached when rowsAffected == 0, but zero affected rows means the device doesn't exist or falls outside the time window, not that a limit was reached.","severity":"Low","category":"doc_defect","profiles":["core","all"]},{"answer_key_index":3,"answer_key_item":"Time window calculation inconsistency: Using device.UpdatedAt.UTC().Add(-anonymousDeviceExpiration) as the lower bound but device.UpdatedAt as the current time may not match the intended logic. Consider using time.Now().UTC() consistently.","severity":"Low","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":4,"hits":2,"false_alarms":0,"misses":2},"core":{"items":5,"hits":2,"false_alarms":0,"misses":3},"all":{"items":5,"hits":2,"false_alarms":0,"misses":3}}},"grafana__grafana__PR80329":{"pull_request":"https://github.com/grafana/grafana/pull/80329","project":"Grafana","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"Annotation/tag cleanup in xorm_store.go logs routine successful batch progress at Error level; should use Debug instead","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"Annotation/tag cleanup logging includes full IDs list (\"ids\", ids) for each batch; should drop the full ids list from logs","verdict":"false alarm","basis":"matched no answer-key item"},{"index":2,"text":"cleanup.go uses time.NewTicker(time.Minute * 1), reducing cleanup interval from 10 minutes to 1 minute and increasing DB load/lock contention; should revert to time.Minute * 10 unless intentional","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":0,"answer_key_item":"The code uses Error log level for what appears to be debugging information. This will pollute error logs in production. Consider using Debug or Info level instead.","severity":"Low","category":"perf","profiles":["core","all"],"matched_candidate_index":0,"matched_candidate":"Annotation/tag cleanup in xorm_store.go logs routine successful batch progress at Error level; should use Debug instead","confidence":0.93,"reasoning":"Both comments flag that routine/non-error progress/debug information is being logged at Error level, which is inappropriate for production logs, and recommend using a lower level like Debug/Info instead."},{"answer_key_index":1,"answer_key_item":"The cleanup job ticker was changed from 10 minutes to 1 minute, which can lead to increased database load and contention due to more frequent execution of cleanup tasks. This change should be reviewed to ensure it aligns with performance expectations.","severity":"Low","category":"perf","profiles":["core","all"],"matched_candidate_index":2,"matched_candidate":"cleanup.go uses time.NewTicker(time.Minute * 1), reducing cleanup interval from 10 minutes to 1 minute and increasing DB load/lock contention; should revert to time.Minute * 10 unless intentional","confidence":0.96,"reasoning":"The candidate explicitly notes the ticker interval was reduced from 10 minutes to 1 minute, warns about increased DB load/lock contention, and suggests reviewing/reverting unless intentional\u2014same underlying performance concern as the golden comment."}],"missed":[],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":0,"hits":0,"false_alarms":1,"misses":0},"core":{"items":2,"hits":2,"false_alarms":1,"misses":0},"all":{"items":2,"hits":2,"false_alarms":1,"misses":0}}},"grafana__grafana__PR90045":{"pull_request":"https://github.com/grafana/grafana/pull/90045","project":"Grafana","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":3,"candidates":[{"index":0,"text":"Async legacy write in Create derives from the request context via context.WithTimeoutCause(ctx,...), so it gets canceled when the handler returns and d.Legacy.Create often fails with context canceled; should detach using context.WithoutCancel(ctx)","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"On Storage create failure, code calls d.recordLegacyDuration(true, ...) so the storage error is recorded in the legacy metric; should call recordStorageDuration instead","verdict":"hit","basis":"judged a match, directly or through a duplicate, for an answer-key item that another candidate matched with higher confidence; the benchmark does not count it as a false alarm"},{"index":2,"text":"klog.NewContext(ctx, d.Log) uses the base logger and drops existing log values (name/kind/method); should pass the enriched log instead","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":3,"text":"Delete records storage duration with object name as the metric label (d.recordStorageDuration(..., name, ...)) instead of options.Kind, causing wrong series and high-cardinality labels; should use options.Kind","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":4,"text":"In DualWriterMode3.Update, the storage-failure path calls d.recordLegacyDuration(true, ...) so the storage error is recorded in the legacy metric; should call recordStorageDuration","verdict":"false alarm","basis":"matched no answer-key item"},{"index":5,"text":"In DualWriterMode3.DeleteCollection, the goroutine running Legacy.DeleteCollection calls d.recordStorageDuration(err != nil, ...) so legacy duration is recorded in the storage metric; should call recordLegacyDuration","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":0,"answer_key_item":"The context is being created with d.Log instead of the log variable that was initialized with additional context values (name, kind, method). This means those values won't be propagated to the logging context.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"klog.NewContext(ctx, d.Log) uses the base logger and drops existing log values (name/kind/method); should pass the enriched log instead","confidence":0.96,"reasoning":"The candidate notes that klog.NewContext is called with d.Log (base logger) instead of the enriched `log` that includes name/kind/method, causing those context values to be dropped. This is the same underlying issue as the golden comment."},{"answer_key_index":1,"answer_key_item":"In DualWriterMode3's DeleteCollection method, when a storage operation fails, recordStorageDuration is incorrectly called with recordLegacyDuration instead.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":5,"matched_candidate":"In DualWriterMode3.DeleteCollection, the goroutine running Legacy.DeleteCollection calls d.recordStorageDuration(err != nil, ...) so legacy duration is recorded in the storage metric; should call recordLegacyDuration","confidence":0.9,"reasoning":"Both point to the same metric-recording bug in DualWriterMode3.DeleteCollection: the legacy delete path is using recordStorageDuration instead of recordLegacyDuration, causing legacy duration to be recorded under the storage metric (especially on failure). This matches the golden issue about calling the wrong duration recorder."},{"answer_key_index":2,"answer_key_item":"Inconsistency: using name instead of options.Kind for metrics recording differs from other methods.","severity":"Medium","category":"api","profiles":["strict","core","all"],"matched_candidate_index":3,"matched_candidate":"Delete records storage duration with object name as the metric label (d.recordStorageDuration(..., name, ...)) instead of options.Kind, causing wrong series and high-cardinality labels; should use options.Kind","confidence":0.93,"reasoning":"Both describe the same inconsistency in metrics labeling: the code uses the object name as the label when recording storage duration instead of using options.Kind, differing from other methods and leading to incorrect/high-cardinality metric series."}],"missed":[],"duplicate_groups":[[0],[1],[2],[3],[4],[5]],"counts":{"strict":{"items":3,"hits":3,"false_alarms":2,"misses":0},"core":{"items":3,"hits":3,"false_alarms":2,"misses":0},"all":{"items":3,"hits":3,"false_alarms":2,"misses":0}}},"grafana__grafana__PR90939":{"pull_request":"https://github.com/grafana/grafana/pull/90939","project":"Grafana","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"GetWebAssets does not re-check entryPointAssetsCache after acquiring entryPointAssetsCacheMu.Lock(), causing multiple goroutines to redundantly re-read and parse assets-manifest.json instead of returning the cached value when cfg.Env != setting.Dev","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"entryPointAssetsCache is assigned result even when err != nil, so a failed manifest read can overwrite a previously valid cache with nil; assignment should only happen when err == nil","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":0,"answer_key_item":"The GetWebAssets function implements an incomplete double-checked locking pattern for caching web assets. The function first checks if the cache is populated using a read lock (RLock), and if the cache is empty, it acquires a write lock to populate it. However, it fails to re-check whether the cache was populated by another goroutine while waiting to acquire the write lock.","severity":"Medium","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"GetWebAssets does not re-check entryPointAssetsCache after acquiring entryPointAssetsCacheMu.Lock(), causing multiple goroutines to redundantly re-read and parse assets-manifest.json instead of returning the cached value when cfg.Env != setting.Dev","confidence":0.93,"reasoning":"Both describe the same concurrency bug: an incomplete double-checked locking pattern in GetWebAssets where it checks the cache under RLock, then takes a write Lock to populate, but fails to re-check after acquiring the write lock, leading to redundant work when multiple goroutines race."},{"answer_key_index":1,"answer_key_item":"In addition to the missing double-check, the function has a critical flaw in its error handling: it unconditionally assigns the fetch result to the cache (line 69: entryPointAssetsCache = result) regardless of whether the fetch succeeded or failed. When an error occurs during asset fetching, result is nil, and this nil value overwrites any previously valid cache entry.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"entryPointAssetsCache is assigned result even when err != nil, so a failed manifest read can overwrite a previously valid cache with nil; assignment should only happen when err == nil","confidence":0.93,"reasoning":"The candidate flags that entryPointAssetsCache is assigned the fetch result even when err != nil, allowing a failed read (nil result) to overwrite a previously valid cache. This is the same core error-handling flaw described in the golden comment (unconditional cache assignment on failure)."}],"missed":[],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":2,"hits":2,"false_alarms":0,"misses":0},"core":{"items":2,"hits":2,"false_alarms":0,"misses":0},"all":{"items":2,"hits":2,"false_alarms":0,"misses":0}}},"grafana__grafana__PR94942":{"pull_request":"https://github.com/grafana/grafana/pull/94942","project":"Grafana","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"enableSqlExpressions returns false on every execution path (logic bug)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"enableSqlExpressions calls h.features.IsEnabledGlobally without guarding against h.features being nil, which can panic","verdict":"false alarm","basis":"matched no answer-key item"},{"index":2,"text":"enableSqlExpressions likely uses inverted logic with !IsEnabledGlobally, causing incorrect enablement behavior","verdict":"hit","basis":"duplicate of a candidate that matched an answer-key item"},{"index":3,"text":"NewSQLCommand wraps the stub 'not implemented' error from TablesList\u2192RunCommands into a generic 400 'error reading SQL command', hiding the real disabled-SQL reason from the client","verdict":"false alarm","basis":"matched no answer-key item"},{"index":4,"text":"NewSQLCommand should explicitly surface the SQL-disabled state/error on the TablesList\u2192RunCommands path instead of only logging it server-side","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"The enableSqlExpressions function has flawed logic that always returns false, effectively disabling SQL expressions unconditionally:","severity":"Critical","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"enableSqlExpressions returns false on every execution path (logic bug)","confidence":0.96,"reasoning":"Both the golden comment and the candidate issue describe the same logic bug: enableSqlExpressions always returns false on all paths, effectively disabling SQL expressions unconditionally."}],"missed":[{"answer_key_index":1,"answer_key_item":"The DB methods NewInMemoryDB().RunCommands, DB.QueryFramesInto, and DB.TablesList in pkg/expr/sql/db.go return hardcoded 'not implemented' errors after removing the go-duck dependency.","severity":"High","category":"api","profiles":["strict","core","all"]}],"duplicate_groups":[[0,2],[1],[3,4]],"counts":{"strict":{"items":2,"hits":1,"false_alarms":3,"misses":1},"core":{"items":2,"hits":1,"false_alarms":3,"misses":1},"all":{"items":2,"hits":1,"false_alarms":3,"misses":1}}},"grafana__grafana__PR97529":{"pull_request":"https://github.com/grafana/grafana/pull/97529","project":"Grafana","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"TotalDocs() iterates over b.cache without holding cacheMu, risking concurrent map read/write panic when BuildIndex updates the map","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":1,"text":"getOrCreateIndex performs a non-atomic get-then-build so concurrent requests for the same missing key can both build an index, causing bleve.New(dir) failures for file-backed indexes and overwriting/leaking in-memory indexes","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]}],"hits":[{"answer_key_index":0,"answer_key_item":"A race condition in BuildIndex allows multiple goroutines to concurrently build the same expensive index for the same key. This is caused by moving the b.cacheMu lock from protecting the entire function to only protecting the final cache assignment. ","severity":"High","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"getOrCreateIndex performs a non-atomic get-then-build so concurrent requests for the same missing key can both build an index, causing bleve.New(dir) failures for file-backed indexes and overwriting/leaking in-memory indexes","confidence":0.9,"reasoning":"Both describe the same underlying race: the lock no longer covers the whole build path, so concurrent goroutines can observe a cache miss for the same key and each build the expensive index. The candidate frames it as a non-atomic get-then-build in getOrCreateIndex leading to duplicate builds and related failures/leaks, which is the same concurrency bug as the golden comment."},{"answer_key_index":1,"answer_key_item":"Calling s.search.TotalDocs() here may race with concurrent index creation: TotalDocs iterates b.cache without synchronization, and the event watcher goroutine started just above could trigger BuildIndex writes concurrently, potentially causing a concurrent map read/write panic.","severity":"High","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"TotalDocs() iterates over b.cache without holding cacheMu, risking concurrent map read/write panic when BuildIndex updates the map","confidence":0.93,"reasoning":"The candidate flags that TotalDocs() iterates over b.cache without holding cacheMu and that BuildIndex may update the map concurrently, leading to a concurrent map read/write panic. This is the same core race described in the golden comment (unsynchronized iteration racing with concurrent index creation/writes)."}],"missed":[],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":2,"hits":2,"false_alarms":0,"misses":0},"core":{"items":2,"hits":2,"false_alarms":0,"misses":0},"all":{"items":2,"hits":2,"false_alarms":0,"misses":0}}},"keycloak__keycloak-greptile__PR1":{"pull_request":"https://github.com/ai-code-review-evaluation/keycloak-greptile/pull/1","project":"Keycloak","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"UsernameForm.java:47 calls isConditionalPasskeysEnabled() with no arguments, but only isConditionalPasskeysEnabled(UserModel) exists, causing a compilation error; should pass context.getUser()","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"isConditionalPasskeysEnabled(UserModel) returns false when user is null (fresh-login case), causing authenticate()/challenge() to skip webauthnAuth.fillContextForm and breaking conditional-UI passkey login; remove the user!=null requirement or adjust callers","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":2,"text":"Typo in comment: 'Succesful' should be 'Successful' (PasskeysUsernamePasswordFormTest.java:413)","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"In UsernameForm.authenticate(), isConditionalPasskeysEnabled() is called without passing the required UserModel parameter.","severity":"Medium","category":"api","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"UsernameForm.java:47 calls isConditionalPasskeysEnabled() with no arguments, but only isConditionalPasskeysEnabled(UserModel) exists, causing a compilation error; should pass context.getUser()","confidence":0.96,"reasoning":"Both the golden comment and candidate issue point out that UsernameForm.authenticate() calls isConditionalPasskeysEnabled() without the required UserModel argument, and the candidate even suggests passing context.getUser(). This is the same underlying issue (missing parameter leading to compilation error)."},{"answer_key_index":1,"answer_key_item":"With isConditionalPasskeysEnabled(UserModel user) requiring user != null, authenticate(...) will not call webauthnAuth.fillContextForm(context) on the initial login page where context.getUser() is still null, so conditional passkey UI will not be set up for first-time passkey login. Consider whether this should also be enabled when no user has been selected yet so ID-less passkey authentication on the initial login form continues to work.","severity":"Medium","category":"speculative","profiles":["all"],"matched_candidate_index":1,"matched_candidate":"isConditionalPasskeysEnabled(UserModel) returns false when user is null (fresh-login case), causing authenticate()/challenge() to skip webauthnAuth.fillContextForm and breaking conditional-UI passkey login; remove the user!=null requirement or adjust callers","confidence":0.94,"reasoning":"The candidate describes the same root problem: isConditionalPasskeysEnabled returns false when user is null on the initial login page, so authenticate/challenge skips webauthnAuth.fillContextForm, preventing conditional passkey UI/ID-less passkey login. It also suggests the same fix direction (remove/adjust the user!=null requirement)."}],"missed":[],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":1,"hits":1,"false_alarms":1,"misses":0},"core":{"items":1,"hits":1,"false_alarms":1,"misses":0},"all":{"items":2,"hits":2,"false_alarms":1,"misses":0}}},"keycloak__keycloak__PR32918":{"pull_request":"https://github.com/keycloak/keycloak/pull/32918","project":"Keycloak","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"Login cache invalidation is skipped on identity provider update when the organization is disabled because update() passes an organization-aware wrapped model (isEnabled() false) into registerIDPLoginInvalidationOnUpdate, leaving stale cached login IdPs; should use the raw idpDelegate.getById(...) model for invalidation","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"Test cleanup registers removal using the literal string \"alias\" (getCleanup().addCleanup(testRealm().identityProviders().get(\"alias\")::remove)) instead of the actual created IdP alias (e.g., \"idp-alias-\" + i), so created IdPs are never cleaned up; should capture and use the real alias (e.g., via a final String alias)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":1,"answer_key_item":"Cleanup reference uses incorrect alias - should be 'idp-alias-' + i instead of 'alias'.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"Test cleanup registers removal using the literal string \"alias\" (getCleanup().addCleanup(testRealm().identityProviders().get(\"alias\")::remove)) instead of the actual created IdP alias (e.g., \"idp-alias-\" + i), so created IdPs are never cleaned up; should capture and use the real alias (e.g., via a final String alias)","confidence":0.96,"reasoning":"Both describe the same bug: the cleanup/removal uses the literal \"alias\" instead of the dynamically created IdP alias (\"idp-alias-\" + i), causing created IdPs not to be cleaned up. Candidate even suggests capturing the real alias, matching the golden intent."}],"missed":[{"answer_key_index":0,"answer_key_item":"InfinispanIdentityProviderStorageProvider.getForLogin() recursively calls session.identityProviders().getById() instead of idpDelegate.getById(), causing the cache lookup to re-enter the same caching layer.","severity":"Critical","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":2,"hits":1,"false_alarms":1,"misses":1},"core":{"items":2,"hits":1,"false_alarms":1,"misses":1},"all":{"items":2,"hits":1,"false_alarms":1,"misses":1}}},"keycloak__keycloak__PR33832":{"pull_request":"https://github.com/keycloak/keycloak/pull/33832","project":"Keycloak","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":4,"candidates":[{"index":0,"text":"ASN1Decoder.readLength() returns -1 for indefinite length (0x80) and callers use it unchecked, leading to read(-1) and NegativeArraySizeException; should reject negative lengths with IOException","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":1,"text":"ASN.1 INTEGER with zero length (e.g., 02 00) can reach new BigInteger and throw NumberFormatException; should reject zero lengths with IOException","verdict":"false alarm","basis":"matched no answer-key item"},{"index":2,"text":"In concatenatedRSToASN1DER, calls to ASN1Encoder.create().write(rBigInteger) and .write(sBigInteger) create/discard encoders and have no effect; remove these dead lines","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":1,"answer_key_item":"Dead code exists where ASN1Encoder instances are created and written to, but their results are immediately discarded. The actual encoding is performed by new ASN1Encoder instances created in the subsequent return statement, rendering the earlier operations useless.","severity":"Low","category":"perf","profiles":["core","all"],"matched_candidate_index":2,"matched_candidate":"In concatenatedRSToASN1DER, calls to ASN1Encoder.create().write(rBigInteger) and .write(sBigInteger) create/discard encoders and have no effect; remove these dead lines","confidence":0.95,"reasoning":"The candidate flags the same dead code: ASN1Encoder instances are created and written to but discarded, with actual encoding done by new encoders in the return path. This matches the golden issue exactly."},{"answer_key_index":2,"answer_key_item":"When length starts at -1 from indefinite-length encoding, the arithmetic 'length = length - bytes.length' will behave unexpectedly, potentially leading to incorrect processing of encoded data.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"ASN1Decoder.readLength() returns -1 for indefinite length (0x80) and callers use it unchecked, leading to read(-1) and NegativeArraySizeException; should reject negative lengths with IOException","confidence":0.86,"reasoning":"Both point to the same root problem: readLength() can return -1 for indefinite-length encoding and downstream code treats it as a normal length, causing incorrect arithmetic/processing. The candidate emphasizes negative length usage leading to read(-1)/NegativeArraySizeException, which is a concrete manifestation of the golden concern about unexpected behavior from subtracting bytes.length when length starts at -1."}],"missed":[{"answer_key_index":0,"answer_key_item":"Returns wrong provider (default keystore instead of BouncyCastle)","severity":"High","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":3,"answer_key_item":"Abstract order() method on CryptoProvider may break backward compatibility with existing implementations","severity":"Low","category":"speculative","profiles":["all"]}],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":2,"hits":1,"false_alarms":1,"misses":1},"core":{"items":3,"hits":2,"false_alarms":1,"misses":1},"all":{"items":4,"hits":2,"false_alarms":1,"misses":2}}},"keycloak__keycloak__PR36880":{"pull_request":"https://github.com/keycloak/keycloak/pull/36880","project":"Keycloak","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":5,"candidates":[{"index":0,"text":"ClientPermissionsV2.getClientsWithPermission adds resource.getName() for the all-clients type resource, causing the literal \"Clients\" to be returned as a client ID and leading to an NPE in AvailableRoleMappingResource.getRoleIdsWithPermissions when realm.getClientById(\"Clients\") is called (should skip/filter the type-level resource).","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":1,"text":"AdminPermissions calls clients().setPermissionsEnabled(cast.getClient(), false) during client removal, but ClientPermissionsV2.setPermissionsEnabled throws UnsupportedOperationException; when both V1 and V2 are enabled this makes client deletion fail (avoid the call under V2 or implement it).","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":2,"answer_key_item":"In getClientsWithPermission(String scope), iterating resourceStore.findByType(server, AdminPermissionsSchema.CLIENTS_RESOURCE_TYPE) and returning resource.getName() will only ever consider the type-level 'Clients' resource (per-client resources have no type) and return its name, while AvailableRoleMappingResource#getRoleIdsWithPermissions expects actual client IDs to pass to realm.getClientById, which can lead to incorrect behavior or a null client and subsequent failures.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"ClientPermissionsV2.getClientsWithPermission adds resource.getName() for the all-clients type resource, causing the literal \"Clients\" to be returned as a client ID and leading to an NPE in AvailableRoleMappingResource.getRoleIdsWithPermissions when realm.getClientById(\"Clients\") is called (should skip/filter the type-level resource).","confidence":0.93,"reasoning":"Both describe the same underlying bug: getClientsWithPermission iterates the type-level Clients resource and returns resource.getName() (e.g., \"Clients\") instead of actual client IDs, while downstream code expects real client IDs for realm.getClientById, leading to null/NPE or incorrect behavior. Candidate adds the concrete NPE scenario and suggests filtering, consistent with the golden issue."}],"missed":[{"answer_key_index":0,"answer_key_item":"Inconsistent feature flag bug causing orphaned permissions. The AdminPermissions event listener, responsible for cleaning up permissions upon role, client, or group removal, is incorrectly guarded by the ADMIN_FINE_GRAINED_AUTHZ (V1) feature flag. This is inconsistent with other methods in the class that use ADMIN_FINE_GRAINED_AUTHZ_V2. Consequently, if ADMIN_FINE_GRAINED_AUTHZ_V2 is enabled but V1 is not, the permission cleanup logic will not execute, leading to orphaned permission data. Cleanup should occur regardless of which fine-grained authorization version is enabled.","severity":"High","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":1,"answer_key_item":"In hasPermission(ClientModel client, String scope), the resource lookup uses findByName(server, client.getId(), server.getId()), but AdminPermissionsSchema.getOrCreateResource creates per-client resources with the owner set to resourceServer.getClientId(), so this lookup will never find those resources and will always fall back to the 'all-clients' resource, effectively ignoring client-specific permissions.","severity":"High","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":3,"answer_key_item":"In ClientPermissionsV2.hasPermission, the method getResourceTypeResource could return null, leading to a NullPointerException in findByResource. Defensive null checks are needed to prevent this issue.","severity":"High","category":"bug","profiles":["strict","core","all"]},{"answer_key_index":4,"answer_key_item":"Remove unused getEvaluationContext private method in ClientPermissionsV2 - it is defined but never called","severity":"Low","category":"style","profiles":["all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":4,"hits":1,"false_alarms":1,"misses":3},"core":{"items":4,"hits":1,"false_alarms":1,"misses":3},"all":{"items":5,"hits":1,"false_alarms":1,"misses":4}}},"keycloak__keycloak__PR36882":{"pull_request":"https://github.com/keycloak/keycloak/pull/36882","project":"Keycloak","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"RECREATE_UPGRADE_EXIT_CODE changed from 4 to 3 while exit code 4 is reused for FEATURE_DISABLED, which can cause existing scripts that interpret 4 as 'recreate upgrade' to mis-handle disabled-feature cases","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"The change in exit-code meanings (RECREATE_UPGRADE_EXIT_CODE and FEATURE_DISABLED) is not documented in upgrade notes and exit-code documentation, risking user confusion and broken automation","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":1,"answer_key_item":"Need to add changelog/release notes documenting the exit code change and migration guidance","severity":"Low","category":"doc_defect","profiles":["core","all"],"matched_candidate_index":1,"matched_candidate":"The change in exit-code meanings (RECREATE_UPGRADE_EXIT_CODE and FEATURE_DISABLED) is not documented in upgrade notes and exit-code documentation, risking user confusion and broken automation","confidence":0.93,"reasoning":"Both comments flag that exit code meaning changes are not documented and that users need upgrade/migration guidance via release notes/changelog to avoid confusion or broken automation."}],"missed":[{"answer_key_index":0,"answer_key_item":"Incorrect method call for exit codes. The picocli.exit() method calls System.exit() directly, which is problematic:","severity":"Medium","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":1,"hits":0,"false_alarms":1,"misses":1},"core":{"items":2,"hits":1,"false_alarms":1,"misses":1},"all":{"items":2,"hits":1,"false_alarms":1,"misses":1}}},"keycloak__keycloak__PR37038":{"pull_request":"https://github.com/keycloak/keycloak/pull/37038","project":"Keycloak","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"GroupPermissionsV2.canManage() calls hasPermission(null, VIEW, MANAGE), allowing an admin with only VIEW on the all-groups resource type to manage groups; it should check only AdminPermissionsSchema.MANAGE (as canManage(GroupModel) does)","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"In getGroupIdsWithViewPermission, hasPermission(groupResource.getId(), ...) and granted.add(groupResource.getId()) use the resource UUID, but lookup is by name (group id), causing misses and wrong ids; use groupResource.getName() instead","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":0,"answer_key_item":"In GroupPermissionsV2.canManage(), the permission fallback checks for both VIEW and MANAGE scopes (hasPermission(null, AdminPermissionsSchema.VIEW, AdminPermissionsSchema.MANAGE)), but canManage() should only grant access for MANAGE scope, not VIEW. This means users with only VIEW permission on groups can pass the canManage() check, granting them write access they should not have. The canView() method correctly checks both VIEW and MANAGE, but canManage() should only check MANAGE.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"GroupPermissionsV2.canManage() calls hasPermission(null, VIEW, MANAGE), allowing an admin with only VIEW on the all-groups resource type to manage groups; it should check only AdminPermissionsSchema.MANAGE (as canManage(GroupModel) does)","confidence":0.97,"reasoning":"The candidate flags that GroupPermissionsV2.canManage() incorrectly checks hasPermission(null, VIEW, MANAGE), which lets VIEW-only admins pass a manage check, and says it should require only MANAGE. This is the same underlying permission-scope bug described in the golden comment."},{"answer_key_index":1,"answer_key_item":"In getGroupIdsWithViewPermission, hasPermission is called with groupResource.getId() and the same groupResource.getId() is added to granted, but hasPermission resolves resources by name (treating the argument as a group id) and the GroupPermissionEvaluator contract says this method returns group IDs that are later used as UserModel.GROUPS and in getUsersCount group filters. This mismatch means per-group VIEW_MEMBERS/MANAGE_MEMBERS permissions may not yield the expected group IDs for filtering and counts, and evaluation may effectively only look at the type-level 'all-groups' resource; consider revisiting whether this should operate on the underlying group ids (resource names) instead so it aligns with the JPA queries and the interface contract.","severity":"High","category":"api","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"In getGroupIdsWithViewPermission, hasPermission(groupResource.getId(), ...) and granted.add(groupResource.getId()) use the resource UUID, but lookup is by name (group id), causing misses and wrong ids; use groupResource.getName() instead","confidence":0.9,"reasoning":"Both describe the same core mismatch: getGroupIdsWithViewPermission passes/returns groupResource.getId() (UUID) while permission/resource resolution expects the group identifier used as the resource name (group id/name), leading to incorrect permission checks and wrong IDs returned for later filtering/counting. Candidate suggests using groupResource.getName() to align, which matches the golden concern about using underlying group ids/resource names."}],"missed":[],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":2,"hits":2,"false_alarms":0,"misses":0},"core":{"items":2,"hits":2,"false_alarms":0,"misses":0},"all":{"items":2,"hits":2,"false_alarms":0,"misses":0}}},"keycloak__keycloak__PR37429":{"pull_request":"https://github.com/keycloak/keycloak/pull/37429","project":"Keycloak","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":5,"candidates":[{"index":0,"text":"In themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties, the totpStep1 value is incorrectly Italian text; it should be translated into Lithuanian (from English: \"Install one of the following applications on your mobile:\").","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"In themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties, the totpStep1 value is Traditional Chinese in a Simplified Chinese bundle; replace it with Simplified Chinese text (e.g., \"\u5728\u60a8\u7684\u624b\u673a\u4e0a\u5b89\u88c5\u4ee5\u4e0b\u5e94\u7528\u7a0b\u5e8f\u4e4b\u4e00\uff1a\").","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":2,"text":"In themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties, the loginTotpStep1 value is incorrectly Italian text; replace with a Lithuanian translation or remove the key to fall back to English.","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"The translation is in Italian instead of Lithuanian. This should be translated to Lithuanian to match the file's locale (messages_lt.properties).","severity":"Medium","category":"doc_defect","profiles":["core","all"],"matched_candidate_index":0,"matched_candidate":"In themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties, the totpStep1 value is incorrectly Italian text; it should be translated into Lithuanian (from English: \"Install one of the following applications on your mobile:\").","confidence":0.94,"reasoning":"Both the golden comment and the candidate issue point out that the messages_lt.properties file contains Italian text and should be translated into Lithuanian to match the Lithuanian locale. The candidate specifies the exact key (totpStep1) but the underlying issue is the same."},{"answer_key_index":1,"answer_key_item":"The totpStep1 value uses Traditional Chinese terms in the Simplified Chinese file (zh_CN), which is likely incorrect for this locale. Please verify the locale\u2011appropriate translation.","severity":"Medium","category":"doc_defect","profiles":["core","all"],"matched_candidate_index":1,"matched_candidate":"In themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties, the totpStep1 value is Traditional Chinese in a Simplified Chinese bundle; replace it with Simplified Chinese text (e.g., \"\u5728\u60a8\u7684\u624b\u673a\u4e0a\u5b89\u88c5\u4ee5\u4e0b\u5e94\u7528\u7a0b\u5e8f\u4e4b\u4e00\uff1a\").","confidence":0.96,"reasoning":"Both the golden comment and the candidate issue point out that the totpStep1 string in the zh_CN (Simplified Chinese) properties file contains Traditional Chinese wording and should be corrected/verified for the proper locale translation."}],"missed":[{"answer_key_index":2,"answer_key_item":"The anchor sanitization logic has a potential issue where it consumes English matcher groups without proper validation. If the translated text has more anchor tags than the English text, this could lead to incorrect validation results.","severity":"Low","category":"security","profiles":["strict","core","all"]},{"answer_key_index":3,"answer_key_item":"The method name 'santizeAnchors' should be 'sanitizeAnchors' (missing 'i').","severity":"Low","category":"style","profiles":["all"]},{"answer_key_index":4,"answer_key_item":"Field HTML_TAGS should be declared as 'private static final' following Java naming conventions for constants","severity":"Low","category":"style","profiles":["all"]}],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":1,"hits":0,"false_alarms":1,"misses":1},"core":{"items":3,"hits":2,"false_alarms":1,"misses":1},"all":{"items":5,"hits":2,"false_alarms":1,"misses":3}}},"keycloak__keycloak__PR37634":{"pull_request":"https://github.com/keycloak/keycloak/pull/37634","project":"Keycloak","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":4,"candidates":[{"index":0,"text":"AccessTokenContext constructor calls Objects.requireNonNull on grantType twice instead of validating rawTokenId, allowing null rawTokenId to pass and later be encoded as the string \"null\"","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"ClientCredentialsGrantType.process generates an access token without setting Constants.GRANT_TYPE (bypasses createTokenResponse), causing client-credentials token IDs to encode UNKNOWN instead of the expected \"cc\" grant shortcut","verdict":"false alarm","basis":"matched no answer-key item"},{"index":2,"text":"AssertEvents.isAccessTokenId uses an inverted equality check and incorrect substring offsets when comparing the encoded grant shortcut, leading to incorrect access-token ID validation","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":0,"answer_key_item":"In AccessTokenContext constructor, the fourth Objects.requireNonNull validates grantType twice instead of validating rawTokenId, allowing null rawTokenId values to pass validation.","severity":"Critical","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"AccessTokenContext constructor calls Objects.requireNonNull on grantType twice instead of validating rawTokenId, allowing null rawTokenId to pass and later be encoded as the string \"null\"","confidence":0.97,"reasoning":"The candidate describes the same constructor bug: Objects.requireNonNull is mistakenly applied to grantType twice instead of rawTokenId, allowing rawTokenId to be null. It even adds a downstream consequence, but the core issue matches the golden comment."},{"answer_key_index":1,"answer_key_item":"In isAccessTokenId, the substring for the grant shortcut and the equality check look inverted: the grant shortcut occupies indices 4\u20135 (substring(4,6)), and a match should return true (combined with UUID check), not false.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"AssertEvents.isAccessTokenId uses an inverted equality check and incorrect substring offsets when comparing the encoded grant shortcut, leading to incorrect access-token ID validation","confidence":0.93,"reasoning":"The golden comment flags two specific inversions in isAccessTokenId: the grant shortcut substring indices should be (4,6) and the equality check logic is inverted (a match should yield true, not false). The candidate issue states there is an inverted equality check and incorrect substring offsets when comparing the encoded grant shortcut, causing incorrect validation. This is the same underlying bug."}],"missed":[{"answer_key_index":2,"answer_key_item":"Javadoc mentions \"usually like 3-letters shortcut\" but some implementations use 2-letter shortcuts (\"ac\", \"cc\", \"rt\", \"te\", \"pc\", \"ci\", \"ro\"). Consider updating documentation to reflect actual usage pattern.","severity":"Low","category":"doc_defect","profiles":["core","all"]},{"answer_key_index":3,"answer_key_item":" Catching generic RuntimeException is too broad. The implementation throws IllegalArgumentException specifically - catch that instead for more precise testing.","severity":"Low","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":3,"hits":2,"false_alarms":1,"misses":1},"core":{"items":4,"hits":2,"false_alarms":1,"misses":2},"all":{"items":4,"hits":2,"false_alarms":1,"misses":2}}},"keycloak__keycloak__PR38446":{"pull_request":"https://github.com/keycloak/keycloak/pull/38446","project":"Keycloak","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"Exhausted recovery-code path calls removeStoredCredentialById() on a federated credential ID, which does not remove it from the external user-storage provider, leaving the exhausted credential stored and still reported as configured","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"Unchecked Optional.get() on the recovery credential can throw NoSuchElementException when RecoveryAuthnCodesUtils.getCredential(user) returns empty (user has no recovery credential); empty case should be handled explicitly","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":2,"text":"getCredentials uses RecoveryAuthnCodesCredentialModel.createFromValues(...) to build a new model without setting the stored credential id during updateCredential, resulting in a returned credential with null id and causing lookups/removals by id to fail","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":0,"answer_key_item":"Unsafe raw List deserialization without type safety. Calling Optional.get() directly on the Optional returned by RecoveryAuthnCodesUtils.getCredential(user) without checking isPresent() can lead to a NoSuchElementException if the Optional is empty.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"Unchecked Optional.get() on the recovery credential can throw NoSuchElementException when RecoveryAuthnCodesUtils.getCredential(user) returns empty (user has no recovery credential); empty case should be handled explicitly","confidence":0.86,"reasoning":"Candidate correctly flags unchecked Optional.get() leading to NoSuchElementException when the Optional is empty, matching the core issue in the golden comment. It does not mention the raw List deserialization/type safety aspect, but it matches one of the golden issues exactly."},{"answer_key_index":1,"answer_key_item":"After creating the RecoveryAuthnCodesCredentialModel, consider setting its id from the stored credential (e.g., myUser.recoveryCodes.getId()); otherwise getId() will be null and downstream removal by id (e.g., removeStoredCredentialById in the authenticator flow) may not work.","severity":"Low","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"getCredentials uses RecoveryAuthnCodesCredentialModel.createFromValues(...) to build a new model without setting the stored credential id during updateCredential, resulting in a returned credential with null id and causing lookups/removals by id to fail","confidence":0.93,"reasoning":"Both describe that a RecoveryAuthnCodesCredentialModel is created without propagating the stored credential's id, leaving getId() null and breaking downstream operations that rely on credential id (e.g., removal/lookup by id)."}],"missed":[],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":2,"hits":2,"false_alarms":1,"misses":0},"core":{"items":2,"hits":2,"false_alarms":1,"misses":0},"all":{"items":2,"hits":2,"false_alarms":1,"misses":0}}},"keycloak__keycloak__PR40940":{"pull_request":"https://github.com/keycloak/keycloak/pull/40940","project":"Keycloak","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"GroupAdapter.getSubGroupsCount() can return null during a deletion/delegate lookup race, violating GroupModel.getSubGroupsCount()'s non-null contract and propagating null via GroupUtils.populateSubGroupCount()","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"In GroupTest, the reader thread is not joined, so assertThat(caughtExceptions, Matchers.empty()) may run before in-flight calls finish and miss late exceptions","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]}],"hits":[{"answer_key_index":0,"answer_key_item":"Returning null from getSubGroupsCount() violates the GroupModel contract (Javadoc says it never returns null) and may lead to NPEs in callers that expect a non-null count.","severity":"Critical","category":"api","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"GroupAdapter.getSubGroupsCount() can return null during a deletion/delegate lookup race, violating GroupModel.getSubGroupsCount()'s non-null contract and propagating null via GroupUtils.populateSubGroupCount()","confidence":0.93,"reasoning":"Both describe the same underlying issue: getSubGroupsCount() may return null despite the GroupModel contract/Javadoc requiring a non-null value, which can propagate and cause NPEs in callers. The candidate adds context about a race and propagation path but matches the golden concern."},{"answer_key_index":1,"answer_key_item":"The reader thread isn\u2019t waited for; flipping deletedAll to true and asserting immediately can race and miss exceptions added just after the flag change, making this test flaky.","severity":"Medium","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"In GroupTest, the reader thread is not joined, so assertThat(caughtExceptions, Matchers.empty()) may run before in-flight calls finish and miss late exceptions","confidence":0.93,"reasoning":"Both comments flag the same race/flakiness: the test asserts on caughtExceptions without waiting for the reader thread to finish (no join/wait), so exceptions added after the flag/termination condition can be missed."}],"missed":[],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":2,"hits":2,"false_alarms":0,"misses":0},"core":{"items":2,"hits":2,"false_alarms":0,"misses":0},"all":{"items":2,"hits":2,"false_alarms":0,"misses":0}}},"sentry__sentry-greptile__PR1":{"pull_request":"https://github.com/ai-code-review-evaluation/sentry-greptile/pull/1","project":"Sentry","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":4,"candidates":[{"index":0,"text":"Accessing `organization_context.member.has_global_access` when `organization_context.member` is None raises AttributeError (e.g., API key/org token callers), breaking GET requests; needs a None guard","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":1,"text":"`OptimizedCursorPaginator.get_item_key` applies `math.floor`/`math.ceil` to `item.datetime`, causing TypeError for audit-log results with `optimized_pagination=true`; should convert datetime to a millisecond timestamp like `DateTimePaginator.get_item_key`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":2,"text":"`OptimizedCursorPaginator.get_result` slices `queryset[start_offset:stop]` with a negative `cursor.offset`, triggering Django AssertionError (500); should reject negative offsets with `BadPaginationError`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]}],"hits":[{"answer_key_index":0,"answer_key_item":"The OptimizedCursorPaginator in organization_auditlogs.py attempts to use negative slice offsets on Django querysets, but Django querysets do not support negative slicing and will raise an AssertionError.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"`OptimizedCursorPaginator.get_result` slices `queryset[start_offset:stop]` with a negative `cursor.offset`, triggering Django AssertionError (500); should reject negative offsets with `BadPaginationError`","confidence":0.95,"reasoning":"Both describe the same underlying bug: OptimizedCursorPaginator uses a negative offset in queryset slicing, which Django querysets don't support and will raise an AssertionError. The candidate additionally suggests handling it with BadPaginationError, but the core issue matches."},{"answer_key_index":1,"answer_key_item":"When requests are authenticated with API keys or org auth tokens (which have user_id=None), organization_context.member is None. Line 71 attempts to access organization_context.member.has_global_access without checking if member is None, causing an AttributeError crash when optimized_pagination=true is used, even though the request passed all permission checks with valid org:write scope.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"Accessing `organization_context.member.has_global_access` when `organization_context.member` is None raises AttributeError (e.g., API key/org token callers), breaking GET requests; needs a None guard","confidence":0.93,"reasoning":"The candidate flags the same root cause: `organization_context.member` can be None for API key/org token authenticated requests, and accessing `.has_global_access` without a None check will raise an AttributeError and break requests. This matches the golden issue\u2019s crash scenario (even if it doesn\u2019t mention optimized_pagination or scope details)."},{"answer_key_index":2,"answer_key_item":"get_item_key assumes a numeric key, but the paginator is used with order_by=-datetime in the audit logs endpoint; calling math.floor/ceil on a datetime will raise a TypeError.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`OptimizedCursorPaginator.get_item_key` applies `math.floor`/`math.ceil` to `item.datetime`, causing TypeError for audit-log results with `optimized_pagination=true`; should convert datetime to a millisecond timestamp like `DateTimePaginator.get_item_key`","confidence":0.96,"reasoning":"Both describe the same bug: get_item_key assumes a numeric key and uses math.floor/ceil, but in the audit logs endpoint the ordering key is a datetime, so applying floor/ceil raises a TypeError. Candidate explicitly mentions audit-log results and suggests converting datetime to timestamp, aligning with the golden issue."}],"missed":[{"answer_key_index":3,"answer_key_item":"Importing non-existent OptimizedCursorPaginator","severity":"Low","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":4,"hits":3,"false_alarms":0,"misses":1},"core":{"items":4,"hits":3,"false_alarms":0,"misses":1},"all":{"items":4,"hits":3,"false_alarms":0,"misses":1}}},"sentry__sentry-greptile__PR2":{"pull_request":"https://github.com/ai-code-review-evaluation/sentry-greptile/pull/2","project":"Sentry","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":4,"candidates":[{"index":0,"text":"`organization_context.member` can be `None` for memberless credentials (API key/org auth token), so accessing `organization_context.member.has_global_access` raises `AttributeError` and causes 500s on non-superuser GET; needs a `member is not None` guard","verdict":"hit","basis":"matched answer-key item","answer_key_items":[3]},{"index":1,"text":"Paginator passes a negative `cursor.offset` into `queryset[start_offset:stop]`, which triggers Django `ValueError` for negative slicing and causes 500s when `optimized_pagination=true`; offset should be clamped or a `BadPaginationError` raised","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0,1]},{"index":2,"text":"Misleading/incorrect comment above `self.offset = int(offset)` claims negative offsets are allowed for performance, but the code only casts to int and paginators still reject negative offsets; comment should be removed or corrected","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"OptimizedCursorPaginator's negative-offset branch in get_result() passes cursor.offset directly as start_offset to queryset slicing when enable_advanced_features is True and cursor.offset < 0.","severity":"Critical","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"Paginator passes a negative `cursor.offset` into `queryset[start_offset:stop]`, which triggers Django `ValueError` for negative slicing and causes 500s when `optimized_pagination=true`; offset should be clamped or a `BadPaginationError` raised","confidence":0.9,"reasoning":"Both describe the same bug: in the negative-offset path, the paginator uses cursor.offset directly as the queryset slice start_offset when advanced/optimized pagination is enabled, leading to negative slicing (Django ValueError/500). Candidate adds suggested fixes but targets the same underlying issue."},{"answer_key_index":1,"answer_key_item":"In BasePaginator.get_result(), when cursor.is_prev is True, it sets start_offset = offset without clamping, allowing negative offset values to be passed to queryset slicing.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"Paginator passes a negative `cursor.offset` into `queryset[start_offset:stop]`, which triggers Django `ValueError` for negative slicing and causes 500s when `optimized_pagination=true`; offset should be clamped or a `BadPaginationError` raised","confidence":0.93,"reasoning":"Both describe the same bug: when handling a previous cursor, the paginator can use an unclamped/negative offset for queryset slicing, leading to negative slice indices (and resulting errors). The candidate explicitly mentions negative cursor.offset passed into queryset[start_offset:stop] and the need to clamp or error, matching the golden issue about start_offset not being clamped when cursor.is_prev is True."},{"answer_key_index":3,"answer_key_item":"Accessing .has_global_access on organization_context.member can raise an AttributeError when organization_context is None, particularly for non-superuser non-member users.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"`organization_context.member` can be `None` for memberless credentials (API key/org auth token), so accessing `organization_context.member.has_global_access` raises `AttributeError` and causes 500s on non-superuser GET; needs a `member is not None` guard","confidence":0.84,"reasoning":"Both describe an AttributeError risk when accessing `organization_context.member.has_global_access` without ensuring the context/member exists. The golden focuses on `organization_context` being None; the candidate focuses on `organization_context.member` being None, but the underlying bug is the same: missing null checks leading to AttributeError for certain non-superuser/non-member requests."}],"missed":[{"answer_key_index":2,"answer_key_item":"OptimizedCursorPaginator.get_item_key uses floor/ceil on a datetime key (order_by='-datetime'), causing TypeError.","severity":"High","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":4,"hits":3,"false_alarms":1,"misses":1},"core":{"items":4,"hits":3,"false_alarms":1,"misses":1},"all":{"items":4,"hits":3,"false_alarms":1,"misses":1}}},"sentry__sentry-greptile__PR3":{"pull_request":"https://github.com/ai-code-review-evaluation/sentry-greptile/pull/3","project":"Sentry","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":3,"candidates":[{"index":0,"text":"`_get_event_stats` passes the outer `dataset` to `is_errors_query_for_error_upsampled_projects` instead of `scoped_dataset`, causing error upsampling to be incorrectly applied or skipped; should pass `scoped_dataset`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":1,"text":"`_set_sample_rate_from_error_sampling` uses `if client_sample_rate:` which treats 0/0.0 as missing and fails to set `sample_rate`; should check `client_sample_rate is not None`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]}],"hits":[{"answer_key_index":0,"answer_key_item":"In _set_sample_rate_from_error_sampling(), the check `if client_sample_rate:` treats 0.0 as falsy, so a sample_rate of 0.0 is silently skipped and never set on normalized_data.","severity":"Low","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`_set_sample_rate_from_error_sampling` uses `if client_sample_rate:` which treats 0/0.0 as missing and fails to set `sample_rate`; should check `client_sample_rate is not None`","confidence":0.98,"reasoning":"The candidate flags the same bug: using `if client_sample_rate:` treats 0/0.0 as falsy, so a valid 0.0 sample rate is skipped; recommends checking against None instead."},{"answer_key_index":2,"answer_key_item":"The upsampling eligibility check passes the outer dataset instead of the actual dataset used by scoped_dataset. In paths where the query ultimately runs against discover (e.g., dashboard split) while the original dataset is metrics, upsampling may be skipped even when all projects are allowlisted.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"`_get_event_stats` passes the outer `dataset` to `is_errors_query_for_error_upsampled_projects` instead of `scoped_dataset`, causing error upsampling to be incorrectly applied or skipped; should pass `scoped_dataset`","confidence":0.9,"reasoning":"Both describe the same bug: the upsampling eligibility check is called with the outer/original dataset rather than the actual dataset used for the query (scoped_dataset), which can cause upsampling to be incorrectly skipped/applied when the query runs against a different dataset (e.g., discover vs metrics)."}],"missed":[{"answer_key_index":1,"answer_key_item":"Using Python\u2019s built-in hash() to build cache keys is non-deterministic across processes (hash randomization), so keys won\u2019t match across workers and invalidate_upsampling_cache may fail to delete them. Use a deterministic serialization of project_ids for the cache key.","severity":"Low","category":"data","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":3,"hits":2,"false_alarms":0,"misses":1},"core":{"items":3,"hits":2,"false_alarms":0,"misses":1},"all":{"items":3,"hits":2,"false_alarms":0,"misses":1}}},"sentry__sentry-greptile__PR5":{"pull_request":"https://github.com/ai-code-review-evaluation/sentry-greptile/pull/5","project":"Sentry","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":6,"candidates":[{"index":0,"text":"When `use-table-widget-visualization` is enabled, `TableWidgetVisualization` is passed hardcoded empty `columns={[]}` and empty `tableData` (`data: []`, empty `meta`), causing all table widgets to render empty instead of using `result.data`/`result.meta` and the widget's columns","verdict":"hit","basis":"matched answer-key item","answer_key_items":[3]},{"index":1,"text":"`validate_timestamp`/`validate_age` rely on `self.initial_data.get(...)` truthiness, so `age: 0` or `timestamp: 0` are treated as absent and both fields can be accepted together; should check key presence with `\"age\" in self.initial_data` and `\"timestamp\" in self.initial_data`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[4]},{"index":2,"text":"Analytics event `analytics.record(\"preprod_artifact.api.assemble\", ...)` is recorded before the feature gate check, so requests rejected by the gate (404) are still counted; move analytics recording after `features.has(...)`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[5]},{"index":3,"text":"`zip(error_ids, events.values())` incorrectly assumes nodestore `get_multi` returns ordered, complete results; since it returns a dict keyed by node_id, error IDs can be paired with the wrong events when results are unordered or missing","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":4,"text":"`HIDDEN_ATTRIBUTES` filtering in `sortedAndFilteredAttributes` happens only after an empty-query early return, so hidden attributes are shown until the user types; apply hidden-attribute filtering before the early return","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":2,"answer_key_item":"Using zip(error_ids, events.values()) assumes the get_multi result preserves the input order; dict value order is not guaranteed to match error_ids, so event data can be paired with the wrong ID (missing nodes also shift alignment).","severity":"Low","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":3,"matched_candidate":"`zip(error_ids, events.values())` incorrectly assumes nodestore `get_multi` returns ordered, complete results; since it returns a dict keyed by node_id, error IDs can be paired with the wrong events when results are unordered or missing","confidence":0.96,"reasoning":"The candidate flags the same core problem: zipping error_ids with events.values() assumes get_multi returns an ordered/complete mapping aligned to the input list, but dict values may not correspond to error_ids (especially with missing/unordered results), causing mispaired IDs and events."},{"answer_key_index":3,"answer_key_item":"Hardcoded empty data passed to TableWidgetVisualization causes it to always render an empty table instead of displaying actual results when the feature flag is enabled.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"When `use-table-widget-visualization` is enabled, `TableWidgetVisualization` is passed hardcoded empty `columns={[]}` and empty `tableData` (`data: []`, empty `meta`), causing all table widgets to render empty instead of using `result.data`/`result.meta` and the widget's columns","confidence":0.97,"reasoning":"The candidate describes that when the feature flag is enabled, TableWidgetVisualization receives hardcoded empty columns and empty data/meta, resulting in empty tables instead of rendering actual results. This is the same underlying issue as the golden comment."},{"answer_key_index":4,"answer_key_item":"Validation logic incorrectly uses .get('timestamp'), which treats a timestamp of 0 as absent. It should directly check 'timestamp' in self.initial_data to ensure proper field presence detection, preventing both 'age=0' and 'timestamp' from passing mutual-exclusion validation.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`validate_timestamp`/`validate_age` rely on `self.initial_data.get(...)` truthiness, so `age: 0` or `timestamp: 0` are treated as absent and both fields can be accepted together; should check key presence with `\"age\" in self.initial_data` and `\"timestamp\" in self.initial_data`","confidence":0.96,"reasoning":"The candidate flags the same bug: using `self.initial_data.get(...)`/truthiness causes `0` values for `age` or `timestamp` to be treated as missing, breaking mutual-exclusion validation. It recommends checking key presence with `\"age\" in self.initial_data` / `\"timestamp\" in self.initial_data`, matching the golden comment\u2019s fix and rationale."},{"answer_key_index":5,"answer_key_item":"Analytics events are recorded before the feature flag check, resulting in analytics being logged for all requests, including those that return 404 due to the feature being disabled. This can lead to misleading analytics data.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"Analytics event `analytics.record(\"preprod_artifact.api.assemble\", ...)` is recorded before the feature gate check, so requests rejected by the gate (404) are still counted; move analytics recording after `features.has(...)`","confidence":0.96,"reasoning":"The candidate states that the analytics event is recorded before the feature gate/flag check, causing even gated/404 requests to be counted, and suggests moving the recording after the check. This is the same underlying issue as the golden comment about misleading analytics due to logging before the feature flag check."}],"missed":[{"answer_key_index":0,"answer_key_item":"The BrowserReportingCollectorEndpoint returns HttpResponse objects but the endpoint inherits from Endpoint which expects rest_framework.response.Response objects.","severity":"Medium","category":"api","profiles":["strict","core","all"]},{"answer_key_index":1,"answer_key_item":"In BaseDetectorTypeValidator.update(), the validator incorrectly updates instance.type using validated_data.get('detector_type') instead of validated_data.get('type').","severity":"Medium","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1],[2],[3],[4]],"counts":{"strict":{"items":6,"hits":4,"false_alarms":1,"misses":2},"core":{"items":6,"hits":4,"false_alarms":1,"misses":2},"all":{"items":6,"hits":4,"false_alarms":1,"misses":2}}},"sentry__sentry__PR67876":{"pull_request":"https://github.com/getsentry/sentry/pull/67876","project":"Sentry","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":3,"candidates":[{"index":0,"text":"OAuth `state` is set to `pipeline.signature` (an md5 of pipeline view names), making it constant across users/flows so the state check is not a per-flow CSRF nonce","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":1,"text":"Accessing `integration.metadata[\"sender\"][\"login\"]` can raise `KeyError` when `sender` is missing in existing Integration metadata, causing a 500 instead of failing closed","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]}],"hits":[{"answer_key_index":1,"answer_key_item":"OAuth state uses pipeline.signature (static) instead of a per-request random value","severity":"Medium","category":"security","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"OAuth `state` is set to `pipeline.signature` (an md5 of pipeline view names), making it constant across users/flows so the state check is not a per-flow CSRF nonce","confidence":0.96,"reasoning":"The candidate explicitly notes that OAuth `state` is derived from `pipeline.signature` (static/md5 of view names) and thus constant rather than a per-flow random CSRF nonce, which is the same issue described in the golden comment."},{"answer_key_index":2,"answer_key_item":"The code attempts to access integration.metadata[sender][login] without checking for the existence of the sender key. This causes a KeyError for integrations where the sender metadata was not set during creation","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"Accessing `integration.metadata[\"sender\"][\"login\"]` can raise `KeyError` when `sender` is missing in existing Integration metadata, causing a 500 instead of failing closed","confidence":0.93,"reasoning":"Both describe a potential KeyError due to accessing sender/login in integration.metadata without verifying the sender key exists (missing sender metadata on some integrations). Candidate uses a slightly different indexing form but points to the same underlying missing-key issue."}],"missed":[{"answer_key_index":0,"answer_key_item":"Null reference if github_authenticated_user state is missing","severity":"Medium","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[[0],[1]],"counts":{"strict":{"items":3,"hits":2,"false_alarms":0,"misses":1},"core":{"items":3,"hits":2,"false_alarms":0,"misses":1},"all":{"items":3,"hits":2,"false_alarms":0,"misses":1}}},"sentry__sentry__PR77754":{"pull_request":"https://github.com/getsentry/sentry/pull/77754","project":"Sentry","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":4,"candidates":[{"index":0,"text":"`queued: datetime = timezone.now()` is evaluated at import time, causing all `AssignmentSource` instances created via `from_integration` to share a stale timestamp; use `field(default_factory=timezone.now)` instead","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]}],"hits":[{"answer_key_index":0,"answer_key_item":"The AssignmentSource dataclass uses queued: datetime = timezone.now() as a default field value, which evaluates timezone.now() once at class definition time and shares that single datetime instance across all objects.","severity":"Medium","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"`queued: datetime = timezone.now()` is evaluated at import time, causing all `AssignmentSource` instances created via `from_integration` to share a stale timestamp; use `field(default_factory=timezone.now)` instead","confidence":0.97,"reasoning":"Both describe the same dataclass default-value bug: `queued: datetime = timezone.now()` is evaluated once at import/class definition time, leading to a shared/stale timestamp across instances, and the fix is to use `default_factory=timezone.now`."}],"missed":[{"answer_key_index":1,"answer_key_item":"The method name has a typo: test_from_dict_inalid_data should be test_from_dict_invalid_data.","severity":"Low","category":"style","profiles":["all"]},{"answer_key_index":2,"answer_key_item":"Method name says 'empty_array' but tests empty dict - consider renaming to 'test_from_dict_empty_dict' for clarity.","severity":"Low","category":"style","profiles":["all"]},{"answer_key_index":3,"answer_key_item":"to_dict() returns a datetime for queued; if this dict is passed in task kwargs (e.g., via apply_async), JSON serialization may fail depending on the serializer, which can cause enqueue errors.","severity":"Medium","category":"bug","profiles":["strict","core","all"]}],"duplicate_groups":[],"counts":{"strict":{"items":2,"hits":1,"false_alarms":0,"misses":1},"core":{"items":2,"hits":1,"false_alarms":0,"misses":1},"all":{"items":4,"hits":1,"false_alarms":0,"misses":3}}},"sentry__sentry__PR80168":{"pull_request":"https://github.com/getsentry/sentry/pull/80168","project":"Sentry","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":3,"candidates":[{"index":0,"text":"`MetricAlertDetectorHandler` subclasses `StatefulDetectorHandler` but leaves abstract methods unimplemented (class body is `pass`), causing `TypeError` when instantiated via `Detector.detector_handler`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"`evaluate` docstring claims it returns a list of `DetectorEvaluationResult`, but the method now returns a dict keyed by group key; docstring is outdated","verdict":"hit","basis":"matched answer-key item","answer_key_items":[1]},{"index":2,"text":"Test builds the expected occurrence with group key `\"val1\"` instead of `\"group_key\"`, producing a mismatched fingerprint (`<detector_id>:val1`) and making the assertion pass only because `IssueOccurrence.__eq__` compares only `id`","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[{"answer_key_index":0,"answer_key_item":"MetricAlertDetectorHandler inherits from StatefulDetectorHandler but only contains pass, failing to implement its required abstract methods: counter_names (property), get_dedupe_value(), get_group_key_values(), and build_occurrence_and_event_data(). This will cause a TypeError at runtime when the class is instantiated.","severity":"High","category":"api","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"`MetricAlertDetectorHandler` subclasses `StatefulDetectorHandler` but leaves abstract methods unimplemented (class body is `pass`), causing `TypeError` when instantiated via `Detector.detector_handler`","confidence":0.96,"reasoning":"The candidate issue states that MetricAlertDetectorHandler subclasses StatefulDetectorHandler but has an empty body and does not implement required abstract methods, leading to a TypeError on instantiation. This matches the golden comment\u2019s underlying issue (missing implementations of abstract methods causing runtime TypeError)."},{"answer_key_index":1,"answer_key_item":"Docstring says this returns a list of DetectorEvaluationResult, but the method now returns a dict keyed by DetectorGroupKey. Consider updating the docstring to match the new return type.","severity":"Low","category":"doc_defect","profiles":["core","all"],"matched_candidate_index":1,"matched_candidate":"`evaluate` docstring claims it returns a list of `DetectorEvaluationResult`, but the method now returns a dict keyed by group key; docstring is outdated","confidence":0.98,"reasoning":"Both the golden comment and the candidate issue point out that the `evaluate` docstring is outdated: it states the return type is a list of `DetectorEvaluationResult`, but the implementation returns a dict keyed by `DetectorGroupKey`/group key. Same underlying documentation mismatch."}],"missed":[{"answer_key_index":2,"answer_key_item":"Wrong value `6` passed for `group_2` occurrence \u2014 the data packet specifies `\"group_2\": 10`. Should be `10` to accurately reflect the test scenario, which will ensure the test produces the correct occurrence data.","severity":"Medium","category":"test_gap","profiles":["core","all"]}],"duplicate_groups":[[0],[1],[2]],"counts":{"strict":{"items":1,"hits":1,"false_alarms":1,"misses":0},"core":{"items":3,"hits":2,"false_alarms":1,"misses":1},"all":{"items":3,"hits":2,"false_alarms":1,"misses":1}}},"sentry__sentry__PR80528":{"pull_request":"https://github.com/getsentry/sentry/pull/80528","project":"Sentry","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"get_monitor_environment_context builds a modified config copy with a human-readable schedule_type but returns monitor.config instead, discarding the copy; it should return the modified config","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]}],"hits":[{"answer_key_index":0,"answer_key_item":"The function modifies the config variable to include display values but then returns the original monitor.config instead of the modified version.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"get_monitor_environment_context builds a modified config copy with a human-readable schedule_type but returns monitor.config instead, discarding the copy; it should return the modified config","confidence":0.96,"reasoning":"Both describe the same bug: the function creates/modifies a config (adding human-readable/display values like schedule_type) but mistakenly returns the original monitor.config, thereby discarding the modified version."}],"missed":[{"answer_key_index":1,"answer_key_item":"The code fetches MonitorCheckIn objects by ID when the required data already exists in previous_checkins. This creates an unnecessary database query.","severity":"Low","category":"perf","profiles":["core","all"]}],"duplicate_groups":[],"counts":{"strict":{"items":1,"hits":1,"false_alarms":0,"misses":0},"core":{"items":2,"hits":1,"false_alarms":0,"misses":1},"all":{"items":2,"hits":1,"false_alarms":0,"misses":1}}},"sentry__sentry__PR93824":{"pull_request":"https://github.com/getsentry/sentry/pull/93824","project":"Sentry","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":5,"candidates":[{"index":0,"text":"Metric `wait_produce` in flusher.py uses tag key `shards` while related metrics use `shard`, splitting the metric series and preventing grouping; change tag key to `shard`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[0]},{"index":1,"text":"`mp_context.Process` returns a `SpawnProcess` that fails `isinstance(..., multiprocessing.Process)` at flusher.py:254, so hung flusher processes are never killed and replacements run alongside them; check against `multiprocessing.process.BaseProcess` or call `kill()` unconditionally","verdict":"hit","basis":"matched answer-key item","answer_key_items":[2]},{"index":2,"text":"In `join`, `isinstance(process, multiprocessing.Process)` guard is false for `SpawnProcess`, so `terminate()` never runs; additionally, breaking on expired deadline skips remaining processes\u2014use `BaseProcess` check and `continue` instead of `break`","verdict":"hit","basis":"matched answer-key item","answer_key_items":[4]}],"hits":[{"answer_key_index":0,"answer_key_item":"In the SpanFlusher flush loop, metric tags inconsistently use 'shard' (e.g., in spans.buffer.flusher.produce and spans.buffer.segment_size_bytes) and 'shards' (in spans.buffer.flusher.wait_produce) for the same shard identifier value. This prevents correct metric aggregation across flush stages \u2014 dashboards and alerts filtering by tag 'shard' will miss data tagged as 'shards' and vice versa.","severity":"Medium","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":0,"matched_candidate":"Metric `wait_produce` in flusher.py uses tag key `shards` while related metrics use `shard`, splitting the metric series and preventing grouping; change tag key to `shard`","confidence":0.96,"reasoning":"The candidate flags that `wait_produce` uses tag key `shards` while other related flusher metrics use `shard`, causing metric series splitting and preventing proper grouping/aggregation. This is the same inconsistency described in the golden comment and the same impact on dashboards/alerts."},{"answer_key_index":2,"answer_key_item":"Because flusher processes are created via multiprocessing.get_context('spawn').Process, they are instances of multiprocessing.context.SpawnProcess, which on POSIX is not a subclass of multiprocessing.Process, so this isinstance check will always be false and hung processes won't be killed here.","severity":"High","category":"bug","profiles":["strict","core","all"],"matched_candidate_index":1,"matched_candidate":"`mp_context.Process` returns a `SpawnProcess` that fails `isinstance(..., multiprocessing.Process)` at flusher.py:254, so hung flusher processes are never killed and replacements run alongside them; check against `multiprocessing.process.BaseProcess` or call `kill()` unconditionally","confidence":0.94,"reasoning":"The candidate describes that mp_context.Process creates a SpawnProcess which does not satisfy isinstance(..., multiprocessing.Process), causing the kill logic to never run and hung processes to persist. This is the same underlying issue as the golden comment about SpawnProcess not being a subclass of multiprocessing.Process on POSIX and the isinstance check always failing."},{"answer_key_index":4,"answer_key_item":"Breaking out of the loop when the deadline has elapsed can skip terminating remaining flusher processes, potentially leaving them running after shutdown; consider ensuring termination is attempted even if the deadline is exceeded.","severity":"Medium","category":"concurrency","profiles":["strict","core","all"],"matched_candidate_index":2,"matched_candidate":"In `join`, `isinstance(process, multiprocessing.Process)` guard is false for `SpawnProcess`, so `terminate()` never runs; additionally, breaking on expired deadline skips remaining processes\u2014use `BaseProcess` check and `continue` instead of `break`","confidence":0.9,"reasoning":"The golden issue is that breaking out of the loop when the deadline is exceeded can skip terminating remaining flusher processes. The candidate explicitly mentions that breaking on expired deadline skips remaining processes and suggests using `continue` instead of `break`, which matches the same underlying concern (it also adds an extra related issue about `isinstance`/`SpawnProcess`)."}],"missed":[{"answer_key_index":1,"answer_key_item":"The test_basic function in test_consumer.py uses a monkeypatched time.sleep that returns immediately, but then calls time.sleep(0.1) expecting it to actually wait.","severity":"Low","category":"test_gap","profiles":["core","all"]},{"answer_key_index":3,"answer_key_item":"Sleep in test_consumer.py won\u2019t actually wait because time.sleep was monkeypatched above; consider restoring sleep or using a different sync to ensure the flusher has time to process.","severity":"Medium","category":"test_gap","profiles":["core","all"]}],"duplicate_groups":[[0],[1,2]],"counts":{"strict":{"items":3,"hits":3,"false_alarms":0,"misses":0},"core":{"items":5,"hits":3,"false_alarms":0,"misses":2},"all":{"items":5,"hits":3,"false_alarms":0,"misses":2}}},"sentry__sentry__PR95633":{"pull_request":"https://github.com/getsentry/sentry/pull/95633","project":"Sentry","tool":"mergestorm-vortex-swarm","judge":"GPT-5.2","answer_key_items":2,"candidates":[{"index":0,"text":"Negative --max-workers value is accepted (num_queues=max_workers or 20), leading to FixedQueuePool having zero queues and a ZeroDivisionError in hash(group_key) % self.num_queues; submit() swallows the error while marking the offset complete, so max_workers/num_queues should be validated as positive","verdict":"false alarm","basis":"matched no answer-key item"},{"index":1,"text":"Factory-owned queue_pool is shared across SimpleQueueProcessingStrategy instances and is shut down in close()/terminate(); after a rebalance new strategies submit to a shut-down pool and results are dropped, so shutdown ownership/lifecycle is incorrect (factory should shut down or pool should be per-strategy)","verdict":"false alarm","basis":"matched no answer-key item"},{"index":2,"text":"Committable offsets only advance for strictly consecutive offsets (breaks when offset not in all_offsets), so Kafka offset gaps can permanently stall commits for a partition; commit tracking should not require +1 contiguity","verdict":"false alarm","basis":"matched no answer-key item"},{"index":3,"text":"queue.Queue() is unbounded and submit() never blocks despite docstring claiming natural backpressure; slow workers can cause unbounded memory growth, so the queue should be bounded and submit should reject when full","verdict":"false alarm","basis":"matched no answer-key item"},{"index":4,"text":"test_stats_reporting is flaky because workers may consume immediately on submit, making stats[\"total_items\"] > 0 become 0 by the time get_stats() runs; the test should synchronize or remove the assertion","verdict":"false alarm","basis":"matched no answer-key item"},{"index":5,"text":"test_thread_queue_parallel_error_handling asserts a partition is not in committed_offsets, but OrderedQueueWorker.run completes the offset in a finally so the failed offset becomes committable; the test only passes due to timing (commit tick), so it should assert eventual commit behavior instead","verdict":"false alarm","basis":"matched no answer-key item"}],"hits":[],"missed":[{"answer_key_index":0,"answer_key_item":"The magic number 50 for max_wait is used repeatedly throughout the tests. Consider extracting this as a named constant to improve maintainability.","severity":"Low","category":"style","profiles":["all"]},{"answer_key_index":1,"answer_key_item":"The test test_thread_queue_parallel_error_handling has a docstring that doesn't match the test implementation.","severity":"Low","category":"doc_defect","profiles":["core","all"]}],"duplicate_groups":[[0],[1],[2],[3],[4],[5]],"counts":{"strict":{"items":0,"hits":0,"false_alarms":6,"misses":0},"core":{"items":1,"hits":0,"false_alarms":6,"misses":1},"all":{"items":2,"hits":0,"false_alarms":6,"misses":2}}}}}