CoolFace
Apppublic

AmitSJ/github-issue-triage

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes
issue_generator.py1212 linesDownload Raw Back to env
1# env/issue_generator.py2# A bank of 50+ realistic fake GitHub issues3# Each issue has the CORRECT triage answer stored alongside it4# The grader compares agent's answer with the correct answer5 6import random7from typing import List, Dict8 9ISSUE_BANK: List[Dict] = [10 11    {12        "id": "issue_001",13        "title": "App crashes immediately on launch after v3.2 update",14        "body": (15            "## Bug Report\n"16            "**What happened:** App crashes on startup — users cannot open it at all.\n\n"17            "**Steps to reproduce:**\n"18            "1. Install latest update v3.2\n"19            "2. Open the app\n"20            "3. App closes instantly\n\n"21            "**Error:** `NullPointerException at MainActivity.onCreate`\n"22            "**Affected users:** 1,200 crash reports in last 2 hours\n"23            "**Platform:** Android 13, 14"24        ),25        "repo": "mobile-app",26        "author_type": "regular",27        "user_reports": 1200,28        "existing_labels": [],29        "open_issues_count": 340,30        "correct_type": "bug",31        "correct_priority": "P1",32        "correct_team": "backend",33        "correct_effort": "small"34    },35 36    {37        "id": "issue_002",38        "title": "Payment processing failing for all users — checkout broken",39        "body": (40            "## Critical Bug\n"41            "All payments are failing since 3:00 AM IST.\n\n"42            "**Error returned:** `Payment gateway timeout after 30s`\n"43            "**Impact:** 100% of checkout attempts failing\n"44            "**Revenue loss:** Estimated Rs 4 lakh/hour\n"45            "**Stripe dashboard:** Shows no successful transactions since 3 AM"46        ),47        "repo": "ecommerce-platform",48        "author_type": "maintainer",49        "user_reports": 890,50        "existing_labels": ["critical"],51        "open_issues_count": 120,52        "correct_type": "bug",53        "correct_priority": "P1",54        "correct_team": "backend",55        "correct_effort": "small"56    },57 58    {59        "id": "issue_003",60        "title": "User data deleted after password reset flow",61        "body": (62            "## Data Loss Bug — URGENT\n"63            "When a user resets their password, all their saved data "64            "(preferences, history, files) is being wiped.\n\n"65            "**Reproduction rate:** 100% reproducible\n"66            "**Affected:** Any user who uses 'Forgot Password'\n"67            "**Severity:** User data permanently lost\n\n"68            "This has been going on since the auth refactor in PR #892."69        ),70        "repo": "user-auth-service",71        "author_type": "regular",72        "user_reports": 340,73        "existing_labels": [],74        "open_issues_count": 210,75        "correct_type": "bug",76        "correct_priority": "P1",77        "correct_team": "backend",78        "correct_effort": "medium"79    },80 81    {82        "id": "issue_004",83        "title": "Login page shows blank white screen on Safari",84        "body": (85            "## Bug Report\n"86            "Login page is completely blank on Safari 17.\n\n"87            "**Steps:**\n"88            "1. Open Safari 17\n"89            "2. Go to app.example.com/login\n"90            "3. White blank screen — nothing loads\n\n"91            "**Works on:** Chrome, Firefox\n"92            "**Doesn't work:** Safari 17 on macOS Sonoma\n"93            "**Console error:** `TypeError: Cannot read properties of undefined`"94        ),95        "repo": "web-frontend",96        "author_type": "regular",97        "user_reports": 78,98        "existing_labels": [],99        "open_issues_count": 450,100        "correct_type": "bug",101        "correct_priority": "P2",102        "correct_team": "frontend",103        "correct_effort": "small"104    },105 106    {107        "id": "issue_005",108        "title": "File upload silently fails for files larger than 50MB",109        "body": (110            "## Bug Report\n"111            "When uploading files over 50MB, the upload appears to succeed "112            "(progress bar reaches 100%) but the file is never saved.\n\n"113            "**Steps:**\n"114            "1. Go to Upload section\n"115            "2. Select any file > 50MB\n"116            "3. Upload completes — no error shown\n"117            "4. File not visible in file manager\n\n"118            "**Note:** Files under 50MB upload fine.\n"119            "**Affected users:** 23 reports this week"120        ),121        "repo": "file-manager",122        "author_type": "regular",123        "user_reports": 23,124        "existing_labels": [],125        "open_issues_count": 180,126        "correct_type": "bug",127        "correct_priority": "P2",128        "correct_team": "backend",129        "correct_effort": "medium"130    },131 132    {133        "id": "issue_006",134        "title": "Dark mode toggle resets to light mode after page refresh",135        "body": (136            "## Bug Report\n"137            "When I switch to dark mode and then refresh the page, "138            "it goes back to light mode. The preference is not being saved.\n\n"139            "**Steps:**\n"140            "1. Go to Settings > Appearance\n"141            "2. Enable Dark Mode\n"142            "3. Refresh the page\n"143            "4. Light mode is back\n\n"144            "Expected: dark mode preference persists across sessions."145        ),146        "repo": "web-frontend",147        "author_type": "regular",148        "user_reports": 12,149        "existing_labels": [],150        "open_issues_count": 450,151        "correct_type": "bug",152        "correct_priority": "P3",153        "correct_team": "frontend",154        "correct_effort": "small"155    },156 157    {158        "id": "issue_007",159        "title": "Tooltip text is cut off on mobile screens",160        "body": (161            "## Bug Report\n"162            "The tooltip that appears on hover over the info icon is "163            "getting clipped on screens smaller than 375px width.\n\n"164            "You can see the tooltip is being cut by the screen edge — "165            "the right portion of the text is not visible.\n\n"166            "Tested on: iPhone SE (375px), Galaxy S21\n"167            "Works fine on desktop."168        ),169        "repo": "web-frontend",170        "author_type": "first-time-contributor",171        "user_reports": 3,172        "existing_labels": [],173        "open_issues_count": 450,174        "correct_type": "bug",175        "correct_priority": "P4",176        "correct_team": "frontend",177        "correct_effort": "small"178    },179 180    {181        "id": "issue_008",182        "title": "Memory leak in WebSocket connection handler",183        "body": (184            "## Bug Report\n"185            "The WebSocket handler does not clean up listeners when "186            "connection is closed. Memory usage grows ~50MB every hour "187            "in long-running sessions.\n\n"188            "**Root cause identified:** `connectionPool.addListener()` "189            "is called but never removed in `onDisconnect` handler.\n\n"190            "Found during load testing. In prod, servers restart every "191            "8 hours due to OOM (Out Of Memory) errors."192        ),193        "repo": "realtime-server",194        "author_type": "maintainer",195        "user_reports": 1,196        "existing_labels": ["performance"],197        "open_issues_count": 89,198        "correct_type": "bug",199        "correct_priority": "P2",200        "correct_team": "backend",201        "correct_effort": "medium"202    },203 204    {205        "id": "issue_009",206        "title": "API returns 500 error when date field is null",207        "body": (208            "## Bug Report\n"209            "`GET /api/v2/events` returns a 500 Internal Server Error "210            "when the event's `end_date` field is null.\n\n"211            "**Request:** `GET /api/v2/events?id=1023`\n"212            "**Response:** `500 Internal Server Error`\n"213            "**Error in logs:** `AttributeError: 'NoneType' has no attribute 'strftime'`\n\n"214            "Events with null end_date (ongoing events) should be supported."215        ),216        "repo": "events-api",217        "author_type": "regular",218        "user_reports": 8,219        "existing_labels": [],220        "open_issues_count": 67,221        "correct_type": "bug",222        "correct_priority": "P2",223        "correct_team": "backend",224        "correct_effort": "small"225    },226 227    {228        "id": "issue_010",229        "title": "SQL injection vulnerability in search endpoint",230        "body": (231            "## Security Bug\n"232            "The `/api/search?q=` endpoint is vulnerable to SQL injection.\n\n"233            "**Proof of concept:**\n"234            "`GET /api/search?q=' OR '1'='1`\n"235            "Returns all records from the database.\n\n"236            "**Impact:** Full database read access possible for any user.\n"237            "Please treat this as critical and patch immediately.\n\n"238            "Reported via security disclosure program."239        ),240        "repo": "api-gateway",241        "author_type": "regular",242        "user_reports": 1,243        "existing_labels": ["security"],244        "open_issues_count": 200,245        "correct_type": "bug",246        "correct_priority": "P1",247        "correct_team": "security",248        "correct_effort": "small"249    },250 251    # ── FEATURES ─────────────────────────────────────────────252 253    {254        "id": "issue_011",255        "title": "Add dark mode support to the dashboard",256        "body": (257            "## Feature Request\n"258            "It would be great to have a dark mode option available in Settings.\n\n"259            "Many users have been requesting this — see related issues: "260            "#234, #301, #445, #512.\n\n"261            "Dark mode helps reduce eye strain during night-time usage "262            "and is standard on modern apps.\n\n"263            "Expected: A toggle in Settings > Appearance that switches "264            "between light and dark themes."265        ),266        "repo": "dashboard-ui",267        "author_type": "regular",268        "user_reports": 67,269        "existing_labels": ["enhancement"],270        "open_issues_count": 340,271        "correct_type": "feature",272        "correct_priority": "P3",273        "correct_team": "frontend",274        "correct_effort": "medium"275    },276 277    {278        "id": "issue_012",279        "title": "Add two-factor authentication (2FA) support",280        "body": (281            "## Feature Request\n"282            "Please add 2FA support using TOTP (Google Authenticator / Authy).\n\n"283            "**Why:** Enterprise customers require 2FA for compliance "284            "(SOC2, ISO27001). We are losing deals because of this missing feature.\n\n"285            "**Expected behavior:**\n"286            "- User enables 2FA in Account Security settings\n"287            "- On login, prompt for 6-digit TOTP code\n"288            "- Backup codes provided\n\n"289            "This is blocking 3 enterprise signups."290        ),291        "repo": "user-auth-service",292        "author_type": "maintainer",293        "user_reports": 45,294        "existing_labels": ["enhancement", "security"],295        "open_issues_count": 210,296        "correct_type": "feature",297        "correct_priority": "P2",298        "correct_team": "backend",299        "correct_effort": "large"300    },301 302    {303        "id": "issue_013",304        "title": "Export data to CSV/Excel from dashboard",305        "body": (306            "## Feature Request\n"307            "Users need to export their data (reports, analytics, lists) "308            "to CSV or Excel format for offline analysis.\n\n"309            "Currently there is no way to get raw data out of the dashboard.\n\n"310            "**Requested by:** 12 enterprise customers in support tickets\n"311            "**Expected:** Download button on each table/chart that exports data."312        ),313        "repo": "dashboard-ui",314        "author_type": "regular",315        "user_reports": 38,316        "existing_labels": ["enhancement"],317        "open_issues_count": 340,318        "correct_type": "feature",319        "correct_priority": "P3",320        "correct_team": "frontend",321        "correct_effort": "medium"322    },323 324    {325        "id": "issue_014",326        "title": "Add keyboard shortcuts for common actions",327        "body": (328            "## Feature Request\n"329            "Power users would benefit from keyboard shortcuts for:\n"330            "- Ctrl+N: New item\n"331            "- Ctrl+S: Save\n"332            "- Ctrl+F: Search\n"333            "- Ctrl+/: Open shortcuts help\n\n"334            "This would significantly improve productivity for frequent users."335        ),336        "repo": "web-frontend",337        "author_type": "regular",338        "user_reports": 14,339        "existing_labels": [],340        "open_issues_count": 450,341        "correct_type": "feature",342        "correct_priority": "P4",343        "correct_team": "frontend",344        "correct_effort": "medium"345    },346 347    {348        "id": "issue_015",349        "title": "Support bulk operations — delete/archive multiple items at once",350        "body": (351            "## Feature Request\n"352            "Currently users have to delete/archive items one by one.\n\n"353            "Please add:\n"354            "- Checkbox to select multiple items\n"355            "- 'Select All' option\n"356            "- Bulk action dropdown: Delete, Archive, Export\n\n"357            "This is a very common request in our support channel. "358            "Users managing large datasets find the current UX very tedious."359        ),360        "repo": "dashboard-ui",361        "author_type": "regular",362        "user_reports": 29,363        "existing_labels": ["enhancement"],364        "open_issues_count": 340,365        "correct_type": "feature",366        "correct_priority": "P3",367        "correct_team": "frontend",368        "correct_effort": "medium"369    },370 371    {372        "id": "issue_016",373        "title": "Add email digest — weekly summary of activity",374        "body": (375            "## Feature Request\n"376            "It would be useful to receive a weekly email digest summarizing:\n"377            "- New items created\n"378            "- Items completed\n"379            "- Team activity highlights\n\n"380            "User should be able to opt in/out from Notification Settings.\n"381            "Frequency: daily or weekly."382        ),383        "repo": "notifications-service",384        "author_type": "regular",385        "user_reports": 19,386        "existing_labels": [],387        "open_issues_count": 78,388        "correct_type": "feature",389        "correct_priority": "P4",390        "correct_team": "backend",391        "correct_effort": "medium"392    },393 394    {395        "id": "issue_017",396        "title": "API rate limiting — protect endpoints from abuse",397        "body": (398            "## Feature Request / Security\n"399            "Our public API currently has no rate limiting.\n\n"400            "We have seen abuse with some IPs making 10,000+ requests/minute, "401            "causing degraded performance for all users.\n\n"402            "**Requested:** Implement rate limiting:\n"403            "- 100 requests/minute for free tier\n"404            "- 1000 requests/minute for paid tier\n"405            "- Return 429 Too Many Requests with Retry-After header"406        ),407        "repo": "api-gateway",408        "author_type": "maintainer",409        "user_reports": 5,410        "existing_labels": ["security", "enhancement"],411        "open_issues_count": 200,412        "correct_type": "feature",413        "correct_priority": "P2",414        "correct_team": "backend",415        "correct_effort": "medium"416    },417 418    {419        "id": "issue_018",420        "title": "Add Slack integration for notifications",421        "body": (422            "## Feature Request\n"423            "Many teams use Slack and would like to receive notifications "424            "directly in their Slack channels.\n\n"425            "**Requested integration:**\n"426            "- Connect Slack workspace in Settings > Integrations\n"427            "- Choose channel for notifications\n"428            "- Notify on: new item, comment, status change, deadline\n\n"429            "This is #1 most requested integration from our survey."430        ),431        "repo": "integrations-service",432        "author_type": "regular",433        "user_reports": 88,434        "existing_labels": ["enhancement"],435        "open_issues_count": 145,436        "correct_type": "feature",437        "correct_priority": "P2",438        "correct_team": "backend",439        "correct_effort": "large"440    },441 442    {443        "id": "issue_019",444        "title": "Add drag and drop support for file uploads",445        "body": (446            "## Feature Request\n"447            "Currently users have to click 'Browse' to upload files.\n\n"448            "Please add drag-and-drop upload support so users can "449            "drag files directly from their desktop into the browser.\n\n"450            "Expected: Drag file onto any upload zone to trigger upload."451        ),452        "repo": "web-frontend",453        "author_type": "first-time-contributor",454        "user_reports": 22,455        "existing_labels": [],456        "open_issues_count": 450,457        "correct_type": "feature",458        "correct_priority": "P3",459        "correct_team": "frontend",460        "correct_effort": "small"461    },462 463    {464        "id": "issue_020",465        "title": "Support markdown formatting in comments",466        "body": (467            "## Feature Request\n"468            "Comments currently only support plain text.\n\n"469            "Please add markdown support so users can:\n"470            "- **Bold** and *italic* text\n"471            "- Code blocks with syntax highlighting\n"472            "- Bullet lists\n"473            "- Links\n\n"474            "This is especially important for technical teams sharing code snippets."475        ),476        "repo": "collaboration-service",477        "author_type": "regular",478        "user_reports": 41,479        "existing_labels": [],480        "open_issues_count": 190,481        "correct_type": "feature",482        "correct_priority": "P3",483        "correct_team": "frontend",484        "correct_effort": "medium"485    },486 487    # ── QUESTIONS ────────────────────────────────────────────488 489    {490        "id": "issue_021",491        "title": "How do I reset my password?",492        "body": (493            "I forgot my password.\n\n"494            "I clicked 'Forgot Password' and it says it sent an email "495            "but I haven't received anything in 30 minutes.\n"496            "I also checked my spam folder.\n\n"497            "What should I do?"498        ),499        "repo": "user-auth-service",500        "author_type": "first-time-contributor",501        "user_reports": 1,502        "existing_labels": [],503        "open_issues_count": 210,504        "correct_type": "question",505        "correct_priority": "P4",506        "correct_team": "support",507        "correct_effort": "small"508    },509 510    {511        "id": "issue_022",512        "title": "What is the rate limit for the API?",513        "body": (514            "Hi,\n\n"515            "I'm building an integration and need to know:\n"516            "1. What is the rate limit for API calls?\n"517            "2. Is it per minute or per hour?\n"518            "3. What headers are returned for rate limit info?\n\n"519            "I couldn't find this in the docs. Thanks!"520        ),521        "repo": "api-gateway",522        "author_type": "regular",523        "user_reports": 1,524        "existing_labels": [],525        "open_issues_count": 200,526        "correct_type": "question",527        "correct_priority": "P4",528        "correct_team": "support",529        "correct_effort": "small"530    },531 532    {533        "id": "issue_023",534        "title": "How to migrate data from v1 to v2?",535        "body": (536            "We are upgrading from v1 to v2 and need guidance on data migration.\n\n"537            "Specifically:\n"538            "- Is there a migration script provided?\n"539            "- Will v1 data format be auto-converted?\n"540            "- Is there a rollback plan if migration fails?\n\n"541            "We have 50GB of production data so need to be careful."542        ),543        "repo": "database-core",544        "author_type": "regular",545        "user_reports": 6,546        "existing_labels": [],547        "open_issues_count": 95,548        "correct_type": "question",549        "correct_priority": "P3",550        "correct_team": "documentation",551        "correct_effort": "small"552    },553 554    {555        "id": "issue_024",556        "title": "Can I self-host this project?",557        "body": (558            "Hello,\n\n"559            "I want to self-host this tool on my company's private server.\n\n"560            "Is self-hosting supported? If yes:\n"561            "- Is there a Docker image available?\n"562            "- What are the minimum server requirements?\n"563            "- Is the license compatible with commercial self-hosting?\n\n"564            "Thank you"565        ),566        "repo": "platform-core",567        "author_type": "first-time-contributor",568        "user_reports": 1,569        "existing_labels": [],570        "open_issues_count": 312,571        "correct_type": "question",572        "correct_priority": "P4",573        "correct_team": "support",574        "correct_effort": "small"575    },576 577    {578        "id": "issue_025",579        "title": "What is the difference between workspaces and projects?",580        "body": (581            "Hi,\n\n"582            "I'm a new user and I'm confused about the difference "583            "between Workspaces and Projects in the UI.\n\n"584            "When should I create a Workspace vs a Project?\n"585            "Can Projects exist across multiple Workspaces?\n\n"586            "The documentation doesn't clearly explain this."587        ),588        "repo": "platform-core",589        "author_type": "first-time-contributor",590        "user_reports": 1,591        "existing_labels": [],592        "open_issues_count": 312,593        "correct_type": "question",594        "correct_priority": "P4",595        "correct_team": "documentation",596        "correct_effort": "small"597    },598 599    # ── DOCUMENTATION ─────────────────────────────────────────600 601    {602        "id": "issue_026",603        "title": "README missing installation steps for Windows",604        "body": (605            "## Documentation Issue\n"606            "The README only has installation instructions for Linux and macOS.\n\n"607            "Windows users (a significant portion of contributors) have no guide.\n\n"608            "Please add:\n"609            "- Prerequisites for Windows\n"610            "- Clone and setup steps\n"611            "- How to run dev server on Windows\n"612            "- Common Windows-specific issues"613        ),614        "repo": "platform-core",615        "author_type": "first-time-contributor",616        "user_reports": 9,617        "existing_labels": ["documentation"],618        "open_issues_count": 312,619        "correct_type": "documentation",620        "correct_priority": "P3",621        "correct_team": "documentation",622        "correct_effort": "small"623    },624 625    {626        "id": "issue_027",627        "title": "API docs missing response schema for /users endpoint",628        "body": (629            "## Documentation Bug\n"630            "The API documentation for `GET /api/users` is missing:\n"631            "- Response schema / field descriptions\n"632            "- Example response JSON\n"633            "- Error codes and what they mean\n\n"634            "Without this, integrators have to guess the response format "635            "by trial and error."636        ),637        "repo": "api-gateway",638        "author_type": "regular",639        "user_reports": 7,640        "existing_labels": ["documentation"],641        "open_issues_count": 200,642        "correct_type": "documentation",643        "correct_priority": "P3",644        "correct_team": "documentation",645        "correct_effort": "small"646    },647 648    {649        "id": "issue_028",650        "title": "Contributing guide is outdated — references old branch names",651        "body": (652            "## Documentation Issue\n"653            "The CONTRIBUTING.md still references the old branch `master` "654            "but the project now uses `main`.\n\n"655            "Also the PR process steps mentioned are outdated — "656            "the project now uses linear history (rebase, not merge commits).\n\n"657            "New contributors are confused and submitting PRs incorrectly."658        ),659        "repo": "platform-core",660        "author_type": "regular",661        "user_reports": 4,662        "existing_labels": ["documentation"],663        "open_issues_count": 312,664        "correct_type": "documentation",665        "correct_priority": "P4",666        "correct_team": "documentation",667        "correct_effort": "small"668    },669 670    # ── DUPLICATES ────────────────────────────────────────────671 672    {673        "id": "issue_029",674        "title": "Login not working on Safari browser",675        "body": (676            "Login page is not loading on Safari.\n\n"677            "I get a blank white page when I go to the login URL.\n"678            "Works fine on Chrome.\n\n"679            "Safari version: 17, macOS Sonoma"680        ),681        "repo": "web-frontend",682        "author_type": "first-time-contributor",683        "user_reports": 1,684        "existing_labels": [],685        "open_issues_count": 450,686        "correct_type": "duplicate",687        "correct_priority": "P3",688        "correct_team": "frontend",689        "correct_effort": "small"690    },691 692    {693        "id": "issue_030",694        "title": "Please add night mode to the app",695        "body": (696            "I would really love a night mode / dark theme for this app.\n\n"697            "It's very bright at night and hurts my eyes.\n\n"698            "Can this be added?"699        ),700        "repo": "dashboard-ui",701        "author_type": "first-time-contributor",702        "user_reports": 1,703        "existing_labels": [],704        "open_issues_count": 340,705        "correct_type": "duplicate",706        "correct_priority": "P4",707        "correct_team": "frontend",708        "correct_effort": "small"709    },710 711    # ── MORE BUGS (P2/P3/P4) ─────────────────────────────────712 713    {714        "id": "issue_031",715        "title": "Search results not updating when filter is changed",716        "body": (717            "## Bug Report\n"718            "When I change the filter dropdown on the search results page, "719            "the results do not update. I have to manually refresh the page.\n\n"720            "**Steps:**\n"721            "1. Search for any term\n"722            "2. Results load correctly\n"723            "3. Change filter from 'All' to 'Recent'\n"724            "4. Results do NOT change — old results still showing\n"725            "5. Refresh page → correct filtered results appear"726        ),727        "repo": "web-frontend",728        "author_type": "regular",729        "user_reports": 17,730        "existing_labels": [],731        "open_issues_count": 450,732        "correct_type": "bug",733        "correct_priority": "P2",734        "correct_team": "frontend",735        "correct_effort": "small"736    },737 738    {739        "id": "issue_032",740        "title": "Notification badges not clearing after reading",741        "body": (742            "## Bug Report\n"743            "The red notification badge on the bell icon doesn't disappear "744            "after I read my notifications.\n\n"745            "**Steps:**\n"746            "1. Receive a notification (badge shows '3')\n"747            "2. Click bell icon and read all notifications\n"748            "3. Close notification panel\n"749            "4. Badge still shows '3'\n\n"750            "Expected: Badge clears after all notifications are read."751        ),752        "repo": "web-frontend",753        "author_type": "regular",754        "user_reports": 8,755        "existing_labels": [],756        "open_issues_count": 450,757        "correct_type": "bug",758        "correct_priority": "P3",759        "correct_team": "frontend",760        "correct_effort": "small"761    },762 763    {764        "id": "issue_033",765        "title": "Pagination breaks when items are deleted",766        "body": (767            "## Bug Report\n"768            "When I'm on page 3 of results and delete an item, "769            "the page reloads but shows an empty page instead of "770            "recalculating pagination.\n\n"771            "Reproducible 100% when deleting items from any page > 1."772        ),773        "repo": "web-frontend",774        "author_type": "regular",775        "user_reports": 5,776        "existing_labels": [],777        "open_issues_count": 450,778        "correct_type": "bug",779        "correct_priority": "P3",780        "correct_team": "frontend",781        "correct_effort": "small"782    },783 784    {785        "id": "issue_034",786        "title": "Database queries slow on tables with > 1 million rows",787        "body": (788            "## Performance Bug\n"789            "`GET /api/reports?type=full` takes 45+ seconds when the "790            "events table has more than 1 million rows.\n\n"791            "**Root cause:** The query does a full table scan — no index on `created_at`.\n\n"792            "Adding an index on `created_at` and `status` should fix this.\n"793            "This is affecting all enterprise customers with large datasets."794        ),795        "repo": "database-core",796        "author_type": "maintainer",797        "user_reports": 12,798        "existing_labels": ["performance"],799        "open_issues_count": 95,800        "correct_type": "bug",801        "correct_priority": "P2",802        "correct_team": "backend",803        "correct_effort": "small"804    },805 806    {807        "id": "issue_035",808        "title": "CI pipeline fails randomly on test step — flaky test",809        "body": (810            "## Bug Report\n"811            "The CI pipeline fails about 1 in 5 runs on the test step.\n\n"812            "**Failing test:** `test_concurrent_user_sessions`\n"813            "**Error:** `AssertionError: Expected 3 sessions, got 2`\n\n"814            "This is a timing/race condition issue — the test assumes "815            "async operations complete instantly. Needs a proper await or mock."816        ),817        "repo": "ci-cd-pipeline",818        "author_type": "maintainer",819        "user_reports": 1,820        "existing_labels": ["flaky-test"],821        "open_issues_count": 55,822        "correct_type": "bug",823        "correct_priority": "P3",824        "correct_team": "devops",825        "correct_effort": "medium"826    },827 828    {829        "id": "issue_036",830        "title": "Docker container exits with code 137 on startup",831        "body": (832            "## Bug Report\n"833            "The Docker container for the API service exits immediately "834            "with exit code 137 (OOM killed) when starting up.\n\n"835            "**Environment:** Docker 24, 2GB RAM allocated\n"836            "**Logs:** `Killed` — no other error\n\n"837            "The service used to work with 2GB. Something in the last "838            "3 releases must be consuming more memory on startup."839        ),840        "repo": "api-gateway",841        "author_type": "maintainer",842        "user_reports": 3,843        "existing_labels": [],844        "open_issues_count": 200,845        "correct_type": "bug",846        "correct_priority": "P2",847        "correct_team": "devops",848        "correct_effort": "medium"849    },850 851    # ── MORE FEATURES ────────────────────────────────────────852 853    {854        "id": "issue_037",855        "title": "Add GitHub OAuth login option",856        "body": (857            "## Feature Request\n"858            "Please add 'Login with GitHub' as an OAuth option.\n\n"859            "Many of our users are developers who already have GitHub accounts. "860            "This would reduce signup friction significantly.\n\n"861            "**Expected:** GitHub OAuth button on login/signup page."862        ),863        "repo": "user-auth-service",864        "author_type": "regular",865        "user_reports": 33,866        "existing_labels": ["enhancement"],867        "open_issues_count": 210,868        "correct_type": "feature",869        "correct_priority": "P3",870        "correct_team": "backend",871        "correct_effort": "medium"872    },873 874    {875        "id": "issue_038",876        "title": "Add audit log — track who changed what and when",877        "body": (878            "## Feature Request\n"879            "Enterprise customers require an audit log for compliance:\n\n"880            "- Who created/modified/deleted each record\n"881            "- Timestamp of each change\n"882            "- Old value vs new value\n"883            "- IP address of the actor\n\n"884            "This is a hard requirement for HIPAA and SOC2 compliance clients."885        ),886        "repo": "platform-core",887        "author_type": "maintainer",888        "user_reports": 18,889        "existing_labels": ["enterprise", "compliance"],890        "open_issues_count": 312,891        "correct_type": "feature",892        "correct_priority": "P2",893        "correct_team": "backend",894        "correct_effort": "large"895    },896 897    {898        "id": "issue_039",899        "title": "Support multiple languages (i18n)",900        "body": (901            "## Feature Request — Internationalization\n"902            "We have significant user bases in India, Brazil, and Germany "903            "who prefer using the app in their native language.\n\n"904            "Please add i18n support with at minimum:\n"905            "- Hindi\n"906            "- Portuguese (Brazil)\n"907            "- German\n\n"908            "This would unlock significant growth in non-English markets."909        ),910        "repo": "web-frontend",911        "author_type": "regular",912        "user_reports": 52,913        "existing_labels": ["enhancement", "i18n"],914        "open_issues_count": 450,915        "correct_type": "feature",916        "correct_priority": "P3",917        "correct_team": "frontend",918        "correct_effort": "large"919    },920 921    {922        "id": "issue_040",923        "title": "Add mobile app for iOS and Android",924        "body": (925            "## Feature Request\n"926            "Please build a mobile app for iOS and Android.\n\n"927            "Many users need to access the platform on the go. "928            "The current web app is not optimized for mobile screens.\n\n"929            "A React Native app would allow sharing code with the web."930        ),931        "repo": "platform-core",932        "author_type": "regular",933        "user_reports": 120,934        "existing_labels": ["enhancement"],935        "open_issues_count": 312,936        "correct_type": "feature",937        "correct_priority": "P3",938        "correct_team": "frontend",939        "correct_effort": "large"940    },941 942    {943        "id": "issue_041",944        "title": "Add webhook support for real-time event notifications",945        "body": (946            "## Feature Request\n"947            "Please add webhook support so external systems can be notified "948            "when events happen in our platform.\n\n"949            "**Use case:** When a new item is created, fire a POST request "950            "to a user-configured URL with event payload.\n\n"951            "This would enable Zapier/n8n integrations and custom automation."952        ),953        "repo": "integrations-service",954        "author_type": "regular",955        "user_reports": 44,956        "existing_labels": ["enhancement"],957        "open_issues_count": 145,958        "correct_type": "feature",959        "correct_priority": "P2",960        "correct_team": "backend",961        "correct_effort": "medium"962    },963 964    # ── EDGE CASES / TRICKY ONES ──────────────────────────────965 966    {967        "id": "issue_042",968        "title": "Server throwing 503 errors under high load",969        "body": (970            "## Bug Report\n"971            "During business hours (10am–4pm IST), the API starts returning "972            "503 Service Unavailable errors for about 5-10% of requests.\n\n"973            "Load testing shows the issue begins at ~500 concurrent users.\n\n"974            "The server has capacity for 1000 concurrent users per our benchmarks. "975            "Something is causing early saturation — possibly connection pool exhaustion."976        ),977        "repo": "api-gateway",978        "author_type": "maintainer",979        "user_reports": 67,980        "existing_labels": ["performance"],981        "open_issues_count": 200,982        "correct_type": "bug",983        "correct_priority": "P1",984        "correct_team": "backend",985        "correct_effort": "medium"986    },987 988    {989        "id": "issue_043",990        "title": "Typo in button label: 'Sumbit' should be 'Submit'",991        "body": (992            "The button on the contact form says 'Sumbit' instead of 'Submit'.\n\n"993            "Small typo but looks unprofessional."994        ),995        "repo": "web-frontend",996        "author_type": "first-time-contributor",997        "user_reports": 1,998        "existing_labels": [],999        "open_issues_count": 450,1000        "correct_type": "bug",1001        "correct_priority": "P4",1002        "correct_team": "frontend",1003        "correct_effort": "small"1004    },1005 1006    {1007        "id": "issue_044",1008        "title": "Need to improve test coverage — currently at 23%",1009        "body": (1010            "## Technical Debt\n"1011            "Our test coverage is at 23% — far below the recommended 80%.\n\n"1012            "Key areas with zero test coverage:\n"1013            "- Payment processing module\n"1014            "- User authentication flows\n"1015            "- File upload service\n\n"1016            "This makes refactoring risky and bugs harder to catch."1017        ),1018        "repo": "platform-core",1019        "author_type": "maintainer",1020        "user_reports": 1,1021        "existing_labels": ["technical-debt"],1022        "open_issues_count": 312,1023        "correct_type": "feature",1024        "correct_priority": "P2",1025        "correct_team": "backend",1026        "correct_effort": "large"1027    },1028 1029    {1030        "id": "issue_045",1031        "title": "Deployment script fails on AWS us-west-2 region",1032        "body": (1033            "## Bug Report\n"1034            "The deployment script `deploy.sh` fails when targeting AWS us-west-2.\n\n"1035            "**Error:** `AMI ami-0abc123 does not exist in us-west-2`\n\n"1036            "The AMI ID is hardcoded to us-east-1. The script should "1037            "automatically select the correct AMI for the target region."1038        ),1039        "repo": "ci-cd-pipeline",1040        "author_type": "regular",1041        "user_reports": 2,1042        "existing_labels": [],1043        "open_issues_count": 55,1044        "correct_type": "bug",1045        "correct_priority": "P2",1046        "correct_team": "devops",1047        "correct_effort": "small"1048    },1049 1050    {1051        "id": "issue_046",1052        "title": "How do I set up local development environment?",1053        "body": (1054            "Hi, I'm a new contributor.\n\n"1055            "I cloned the repo and followed the README but I keep getting "1056            "an error:\n"1057            "`ModuleNotFoundError: No module named 'config'`\n\n"1058            "The README doesn't mention this module. Is there a setup "1059            "step I'm missing?"1060        ),1061        "repo": "platform-core",1062        "author_type": "first-time-contributor",1063        "user_reports": 1,1064        "existing_labels": [],1065        "open_issues_count": 312,1066        "correct_type": "question",1067        "correct_priority": "P3",1068        "correct_team": "documentation",1069        "correct_effort": "small"1070    },1071 1072    {1073        "id": "issue_047",1074        "title": "Add support for custom domain names",1075        "body": (1076            "## Feature Request\n"1077            "Currently all users are on `username.app.io` subdomains.\n\n"1078            "Please allow users to connect their own custom domain "1079            "e.g. `app.mycompany.com`.\n\n"1080            "This is a must-have for enterprise/white-label customers.\n"1081            "Estimated from sales: blocking ~15 enterprise deals."1082        ),1083        "repo": "platform-core",1084        "author_type": "maintainer",1085        "user_reports": 31,1086        "existing_labels": ["enhancement", "enterprise"],1087        "open_issues_count": 312,1088        "correct_type": "feature",1089        "correct_priority": "P2",1090        "correct_team": "devops",1091        "correct_effort": "large"1092    },1093 1094    {1095        "id": "issue_048",1096        "title": "Charts library version upgrade — v2 breaking changes",1097        "body": (1098            "## Maintenance\n"1099            "The charts library (ChartJS) released v4 with breaking changes.\n"1100            "We're still on v2 which is no longer receiving security patches.\n\n"1101            "Need to upgrade to v4 and update all chart components to new API.\n\n"1102            "Affected files: ~12 chart components across the dashboard."1103        ),1104        "repo": "web-frontend",1105        "author_type": "maintainer",1106        "user_reports": 1,1107        "existing_labels": ["dependencies"],1108        "open_issues_count": 450,1109        "correct_type": "feature",1110        "correct_priority": "P3",1111        "correct_team": "frontend",1112        "correct_effort": "medium"1113    },1114 1115    {1116        "id": "issue_049",1117        "title": "Email verification link expires too quickly — 15 minutes",1118        "body": (1119            "## Bug / UX Issue\n"1120            "The email verification link expires in 15 minutes.\n\n"1121            "Many users miss this window (especially in different timezones "1122            "or if email delivery is slow) and have to request a new link.\n\n"1123            "**Suggestion:** Extend expiry to 24 hours — this is industry standard.\n"1124            "Support tickets about this: 34 in the last month."1125        ),1126        "repo": "user-auth-service",1127        "author_type": "regular",1128        "user_reports": 34,1129        "existing_labels": [],1130        "open_issues_count": 210,1131        "correct_type": "bug",1132        "correct_priority": "P3",1133        "correct_team": "backend",1134        "correct_effort": "small"1135    },1136 1137    {1138        "id": "issue_050",1139        "title": "Add GDPR data deletion — right to be forgotten",1140        "body": (1141            "## Compliance Feature\n"1142            "We need to implement GDPR Article 17 — Right to Erasure.\n\n"1143            "Users must be able to:\n"1144            "1. Request deletion of all their personal data\n"1145            "2. Receive confirmation email once complete\n"1146            "3. Be fully removed from all systems within 30 days\n\n"1147            "This is a legal requirement for EU users. "1148            "We've received 3 formal GDPR requests already this month."1149        ),1150        "repo": "user-auth-service",1151        "author_type": "maintainer",1152        "user_reports": 3,1153        "existing_labels": ["compliance", "GDPR"],1154        "open_issues_count": 210,1155        "correct_type": "feature",1156        "correct_priority": "P1",1157        "correct_team": "backend",1158        "correct_effort": "large"1159    },1160]1161 1162 1163def get_all_issues() -> List[Dict]:1164    """Return the full issue bank."""1165    return ISSUE_BANK1166 1167 1168def get_issue_by_id(issue_id: str) -> Dict:1169    """Fetch a specific issue by its ID."""1170    for issue in ISSUE_BANK:1171        if issue["id"] == issue_id:1172            return issue1173    raise ValueError(f"Issue {issue_id} not found")1174 1175 1176def get_issues_by_type(issue_type: str) -> List[Dict]:1177    """Return all issues of a specific type e.g. 'bug', 'feature'."""1178    return [i for i in ISSUE_BANK if i["correct_type"] == issue_type]1179 1180 1181def get_issues_by_priority(priority: str) -> List[Dict]:1182    """Return all issues of a specific priority e.g. 'P1', 'P2'."""1183    return [i for i in ISSUE_BANK if i["correct_priority"] == priority]1184 1185 1186def get_random_issue(task_id: str = "task_1", seen_ids: List[str] = None) -> Dict:1187    """1188    Return a random issue not yet seen in this episode.1189    task_id controls difficulty:1190      task_1 → mix of clear-cut issues (easy to classify)1191      task_2 → issues with more context needed for priority1192      task_3 → full mix including tricky edge cases1193    """1194    if seen_ids is None:1195        seen_ids = []1196 1197    if task_id == "task_1":1198        pool = [i for i in ISSUE_BANK1199                if i["id"] not in seen_ids1200                and i["correct_type"] in ["bug", "feature", "question"]]

Showing the first 1,200 of 1212 lines. Download the file for the rest.