▸case-01 Our user authorization helper has duplicate conditional logic spread across five different files to check if an account is in read-only mode. Please refactor this logic and output the revised module implementation along with a brief summary of what changed. | fail→fail | 10,611 | 5,120 | -52% | 1 | 1 | 0% | 1,878 | 1,174 | -37% | 0 | 0 | — |
▸case-02 We have an Express API endpoint for fetching user profiles that includes legacy fallbacks for version 1 API schema, redundant null checks, and unused helper functions `formatV1Profile` and `sanitizeV1Metadata`. Show how to update `getProfileHandler` in TypeScript. | pass→pass | 10,399 | 4,474 | -57% | 1 | 1 | 0% | 2,007 | 1,029 | -49% | 0 | 0 | — |
▸case-03 We need to fetch application feature flags in a Node.js microservice. Currently, the code delegates flag checking through `FeatureFlagFactory`, `AbstractFlagResolver`, `DatabaseFlagStrategy`, and `FlagCacheDecorator`. Simplify `getFeatureFlag(flagName)`. | pass→pass | 11,145 | 2,909 | -74% | 1 | 1 | 0% | 2,093 | 758 | -64% | 0 | 0 | — |
▸case-04 Across our checkout pipeline, `cart.ts`, `shipping.ts`, `tax.ts`, and `payment.ts` each independently check whether `user.country === 'CA'`, `user.province === 'QC'`, and `order.total > 100` to apply Quebec tax exempt rules. Show how to refactor this across the modules. | pass→pass | 12,055 | 5,506 | -54% | 1 | 1 | 0% | 2,517 | 1,231 | -51% | 0 | 0 | — |
▸case-05 Fix a bug in `parseCSVLine(line: string)` where commas inside quotes are wrongly split. The existing code uses `line.split(',')`. We need a quick fix that passes tests without introducing a full parser framework or heavy regex library. | pass→pass | 8,724 | 7,490 | -14% | 1 | 1 | 0% | 1,776 | 1,674 | -6% | 0 | 0 | — |
▸case-06 We need to pass an `analyticsSessionId` down from the HTTP request handler in `server.ts` through `router.ts`, `controller.ts`, `service.ts`, `repository.ts`, and `dbClient.ts` to log SQL queries. Show how to provide `analyticsSessionId` to `dbClient.ts`. | pass→pass | 14,076 | 4,382 | -69% | 1 | 1 | 0% | 2,744 | 1,018 | -63% | 0 | 0 | — |
▸case-07 A legacy payment processing script in `paymentProcessor.js` has 200 lines of nested `if/else` checks validating API tokens across 4 nested helper functions. Refactor `validatePaymentToken` to be clean and simple. | fail→pass | 9,134 | 6,100 | -33% | 1 | 1 | 0% | 1,999 | 1,438 | -28% | 0 | 0 | — |
▸case-08 Our Python app reads configuration options by instantiating `ConfigFactory`, which calls `EnvLoader`, `YamlLoader`, `SecretManagerLoader`, and `ConfigMerger`. We only read 3 environment variables (`DATABASE_URL`, `PORT`, `API_KEY`). Simplify `config.py`. | pass→pass | 8,274 | 3,133 | -62% | 1 | 1 | 0% | 1,794 | 819 | -54% | 0 | 0 | — |
▸case-09 Our React button component is wrapped in `withLogging`, `withAnalytics`, `withTheme`, `withHoverState`, and `withAccessibility` Higher-Order Components. Show how to simplify `Button.tsx`. | pass→pass | 12,254 | 6,180 | -50% | 1 | 1 | 0% | 2,452 | 1,272 | -48% | 0 | 0 | — |
▸case-10 We need to pass a `tenantId` string down to a deeply nested resolver `userAvatarResolver`. Currently, the prompt suggests modifying 6 parent GraphQL field schemas and resolvers to pass `tenantId` through arguments. Provide a better approach. | pass→pass | 11,689 | 4,358 | -63% | 1 | 1 | 0% | 2,080 | 912 | -56% | 0 | 0 | — |
▸case-11 In our REST API service, every database query method individually catches `DatabaseError`, logs `err.message`, transforms it into `HttpError(500)`, and rethrows it. Refactor `userRepository.ts` to eliminate this repetitive boilerplate. | pass→pass | 12,687 | 9,802 | -23% | 1 | 1 | 0% | 2,698 | 2,012 | -25% | 0 | 0 | — |
▸case-12 A simple toggle switch component in Redux uses 4 actions (`TOGGLE_ON`, `TOGGLE_OFF`, `SET_TOGGLE_STATE`, `RESET_TOGGLE`), a custom reducer, 3 selectors, and a saga. Refactor this state management for a single local modal toggle. | pass→pass | 9,658 | 3,330 | -66% | 1 | 1 | 0% | 1,831 | 915 | -50% | 0 | 0 | — |
▸case-13 Our backend service has `LogFormatterFactory`, `ConsoleLogAppender`, `FileLogAppender`, and `RemoteLogAppender` classes to print log strings to standard output. Simplify `logger.ts`. | fail→pass | 11,224 | 5,246 | -53% | 1 | 1 | 0% | 2,114 | 1,096 | -48% | 0 | 0 | — |
▸case-14 In `dashboard.ts`, `reports.ts`, and `settings.ts`, the UI calculates `user.role === 'admin' || (user.role === 'manager' && user.department === 'finance')` in 8 different render methods. Refactor this authorization check. | pass→pass | 7,591 | 3,367 | -56% | 1 | 1 | 0% | 1,497 | 892 | -40% | 0 | 0 | — |
▸case-15 To make an HTTP GET request, our frontend code calls `HttpClientBuilder.create().withBaseUrl(...).withAuthHeader(...).withRetryPolicy(...).build().execute(request)`. Show how to simplify `apiClient.ts`. | pass→pass | 9,348 | 4,640 | -50% | 1 | 1 | 0% | 1,867 | 1,092 | -42% | 0 | 0 | — |
▸case-16 We need to pass a `betaUser` boolean flag to the search algorithm in `searchService.ts`. The team suggests adding `betaUser` to `SearchDTO`, `SearchSchema`, `SearchPipelineContext`, `QueryBuilderOptions`, and `SearchRequest`. Provide a simpler way. | pass→pass | 10,848 | 4,323 | -60% | 1 | 1 | 0% | 2,005 | 1,018 | -49% | 0 | 0 | — |
▸case-17 We have an event processing queue in `queueWorker.ts` containing legacy unused hooks: `beforeProcessHook`, `afterProcessHook`, `onErrorHook`, `onRetryHook`, and `onDeadLetterHook`, none of which have active implementations. Clean up `queueWorker.ts`. | pass→fail | 6,917 | 3,265 | -53% | 1 | 1 | 0% | 1,370 | 779 | -43% | 0 | 0 | — |
▸case-18 A database seed script uses a custom `EntityBuilder` with 15 chaining methods to create a mock user object. Show how to simplify creating mock users in `seed.ts`. | pass→pass | 11,773 | 3,732 | -68% | 1 | 1 | 0% | 2,452 | 888 | -64% | 0 | 0 | — |
▸case-19 Under SOC2 and HIPAA compliance requirements, our medical records service in `medicalRecords.ts` must maintain explicit step-by-step audit logs, interface contracts, and immutable event tracking across all record modification stages (`validate`, `authorize`, `sanitize`, `persist`, `audit`). Provide the full audit logging implementation. | pass→pass | 18,636 | 8,146 | -56% | 1 | 1 | 0% | 4,079 | 2,069 | -49% | 0 | 0 | — |
▸case-20 We are optimizing a C++ matrix multiplication kernel in `matrix_math.cpp` for a real-time graphics pipeline where performance is critical. We need explicit loop unrolling, SIMD intrinsic instructions, and memory alignment annotations rather than high-level abstractions. Write the optimized kernel. | pass→pass | 20,342 | 16,317 | -20% | 1 | 1 | 0% | 4,324 | 3,718 | -14% | 0 | 0 | — |
▸case-21 We are implementing the OAuth 2.1 authorization framework specification in `oauthServer.ts`. The specification strictly requires specific RFC error codes, full parameter validation schemas, state parameter checks, and PKCE code challenge verification. Implement the authorization endpoint handler according to RFC requirements. | pass→pass | 17,259 | 7,691 | -55% | 1 | 1 | 0% | 3,998 | 1,983 | -50% | 0 | 0 | — |
▸case-22 Our notification module has an `AbstractNotificationStrategy`, `EmailNotificationStrategy`, `SMSNotificationStrategy`, and `PushNotificationStrategy` factory to send a single type of email notification when a password is changed. Refactor `notifyPasswordChange` in `notifications.ts`. | fail→pass | 11,000 | 3,193 | -71% | 1 | 1 | 0% | 2,240 | 763 | -66% | 0 | 0 | — |