▸case-17 A notification service contains handlers for `EmailNotifier`, `SMSNotifier`, and `WhatsAppNotifier`, each with distinct delivery rules and user opt-out behaviors. A developer wants to collapse all three into a single generic rule 'Send Notification'. How should this be structured in the domain specification? | pass→pass | 13,772 | 13,999 | +2% | 1 | 1 | 0% | 2,116 | 4,122 | +95% | 0 | 0 | — |
▸case-01 We are rewriting a legacy Node.js API (`onboarding_flow.js`) that manages user registration, email verification, and third-party account linking. The current code mixes session handling, database primary keys, duplicate terminology ('User' in some handlers vs 'Account' in others), hardcoded token checks, and historical bug patches.
Please analyze this code and provide a domain-level specification document in structured markdown. The document should cover:
- Core Scope & Actor Mapping: Who interacts with the system and what capabilities they own.
- Standardized Domain Vocabulary & Entities: Resolve conflicting terms into unified conceptual models and entity relationships without raw database identifiers.
- Consolidated Business Logic & Invariants: Combine scattered middleware checks, guard clauses, and service logic into single, coherent business rules.
- Integrations & External Capabilities: Document high-level domain capabilities while stripping away backend plumbing, secrets, and session token mechanics.
- Known Invariants & Explicit Assumptions: List hard operational constraints, noting any ambiguities or unverified business rules explicitly.
Make sure the specification reflects strictly factual domain intent derived from the code without adding speculative new features. | fail→fail | 20,484 | 25,006 | +22% | 1 | 1 | 0% | 3,486 | 6,303 | +81% | 0 | 0 | — |
▸case-02 Below is the legacy backend service for an enterprise recruitment management platform (`interview_workflow.py`). It contains scattered authorization logic, direct Slack API calls, nullable columns such as `invited_at`, `completed_at`, `feedback_received_at`, and several unreachable code blocks from previous feature iterations.
Analyze the code and reverse-engineer it into a formal, domain-focused specification. Present the result as a detailed specification output including:
- Scope, Boundaries & System Actors: High-level overview of system interactions and responsibilities.
- Implicit Workflow to Explicit State Machine Mapping: Convert combinations of nullable status fields into named workflow states and valid state transitions.
- Consolidated Domain Business Rules: Gather guard clauses, asserts, and scattered conditional logic into single-rule definitions specifying preconditions, postconditions, and invariants.
- Domain Relationships & Boundaries: Represent business entities and their links, omitting primary/foreign keys, database indexes, and framework infrastructure.
- Edge Cases & Intended Failure Behaviors: Capture intended domain outcomes for edge cases, filtering out unreachable legacy paths and technical bug workarounds.
Please deliver a strictly factual specification based on recovering core domain behavior from the provided codebase. | pass→pass | 28,036 | 33,346 | +19% | 1 | 1 | 0% | 5,149 | 8,251 | +60% | 0 | 0 | — |
▸case-03 We are designing a brand new e-commerce fulfillment engine from scratch. Create an initial system architecture proposal detailing recommended AWS cloud infrastructure, microservice boundaries, database engine selection, and message queue choices. | pass→pass | 29,712 | 30,840 | +4% | 1 | 1 | 0% | 4,570 | 6,688 | +46% | 0 | 0 | — |
▸case-04 Review the Python function `compute_route_matrix()` below that performs Dijkstra's algorithm. Refactor the code to improve runtime performance from O(V^2) to O(E log V) using a binary heap, maintaining identical input and output signatures. | pass→pass | 15,526 | 13,970 | -10% | 1 | 1 | 0% | 2,716 | 4,511 | +66% | 0 | 0 | — |
▸case-05 Write a pytest test suite covering edge cases for a Python function `calculate_prorated_tax(amount, region, tax_exempt_status)` to achieve 100% line coverage. | pass→pass | 17,355 | 25,399 | +46% | 1 | 1 | 0% | 3,386 | 7,104 | +110% | 0 | 0 | — |
▸case-06 A database schema for `loan_applications` contains no status column. Instead, it records `submitted_at`, `credit_checked_at`, `approved_at`, `rejected_at`, and `disbursed_at`, all as nullable timestamps. A developer suggests writing a spec that copies these five columns as optional properties. Analyze this schema and define the correct domain model. | pass→pass | 19,044 | 14,536 | -24% | 1 | 1 | 0% | 3,338 | 4,642 | +39% | 0 | 0 | — |
▸case-07 In a legacy logistics repository (`shipment_service.v1`), order records are referred to as `Order` in the intake module, `Purchase` in the billing module, and `ClientRequest` in notifications. How should these terms be represented in a domain specification document? | fail→pass | 11,332 | 5,322 | -53% | 1 | 1 | 0% | 1,718 | 2,595 | +51% | 0 | 0 | — |
▸case-08 A legacy SQL schema defines `orders` with `customer_id INT REFERENCES customers(id)` and `shipping_address_id INT REFERENCES addresses(id)`. A junior engineer transcribed this as `customer_id: Integer` and `shipping_address_id: Integer` in the requirements draft. Correct this specification draft to reflect domain concepts. | pass→pass | 9,182 | 5,514 | -40% | 1 | 1 | 0% | 1,447 | 2,778 | +92% | 0 | 0 | — |
▸case-09 While reviewing a payments API (`charge_processor.py`), you find a try/catch block that retries failed HTTP calls 3 times with 500ms delay to handle database connection drops caused by connection pool exhaustion during flash sales. How should this code path be documented in the business domain specification? | pass→pass | 13,413 | 9,156 | -32% | 1 | 1 | 0% | 2,001 | 3,382 | +69% | 0 | 0 | — |
▸case-10 In an authentication module, code calls `requests.post('https://api.stripe.com/v1/customers', auth=(STRIPE_SECRET_KEY, ''))` and validates HMAC SHA256 signatures on webhooks. Should webhook signature verification and secret key handling appear in the domain business spec? | fail→pass | 12,201 | 9,180 | -25% | 1 | 1 | 0% | 1,889 | 3,300 | +75% | 0 | 0 | — |
▸case-11 In `billing_engine.py`, there is a conditional block `if payment_method == 'CHECK_V1': process_paper_check()`. Git logs confirm `CHECK_V1` was deprecated 4 years ago and no database records have this type. How should this legacy path be handled when drafting the system requirements? | pass→pass | 12,525 | 7,883 | -37% | 1 | 1 | 0% | 1,802 | 3,040 | +69% | 0 | 0 | — |
▸case-12 During code review of `refund_service.py`, you notice that when a refund fails due to network failure, the function catches the exception and returns `HTTP 200 OK` with `{'status': 'success'}` without recording the failure. Should the specification document that failed refunds return success? | fail→pass | 11,715 | 5,290 | -55% | 1 | 1 | 0% | 1,694 | 2,774 | +64% | 0 | 0 | — |
▸case-13 An application supports signing in via Google OAuth2, Okta SAML, and email/password. The frontend explicitly displays 'Sign in with Google' and 'Sign in with Okta' buttons to end users. Should Google and Okta authentication be abstracted away as generic 'Identity Provider' in the product specification? | pass→pass | 12,321 | 9,132 | -26% | 1 | 1 | 0% | 1,696 | 3,298 | +94% | 0 | 0 | — |
▸case-14 In a booking platform, appointment cancellation logic exists in three places: an API middleware checking if appointment date is in the past, a controller checking if candidate status is 'ACTIVE', and a database trigger checking if refund balance is positive. How should this logic be represented in a domain specification? | pass→pass | 13,180 | 10,441 | -21% | 1 | 1 | 0% | 2,228 | 3,632 | +63% | 0 | 0 | — |
▸case-15 An API service accepts `X-Session-Token: bearer eyJhbGci...` headers, parses JWT claims, validates signature expiry, and extracts user permissions from Redis cache. How should identity verification be specified in the extracted domain model? | pass→pass | 14,497 | 11,275 | -22% | 1 | 1 | 0% | 2,321 | 3,600 | +55% | 0 | 0 | — |
▸case-16 A document processing pipeline uses a `DocumentProcessorAbstractFactory` that instantiates a `PDFStrategyHandler` which delegates to a `StandardPDFValidatorAdapter`. Underneath, it checks if a PDF is under 25MB and has valid header markers. How should this be written in the domain requirements spec? | pass→pass | 11,080 | 6,516 | -41% | 1 | 1 | 0% | 1,848 | 2,987 | +62% | 0 | 0 | — |
▸case-18 In `account_balance.py`, class methods frequently invoke `assert account.balance >= 0, 'Negative balance prohibited'`. How should this runtime assertion be represented when converting code into domain specifications? | pass→pass | 10,959 | 6,861 | -37% | 1 | 1 | 0% | 1,740 | 3,051 | +75% | 0 | 0 | — |
▸case-19 A password reset token function calculates expiration via `token.created_at + timedelta(hours=24)`. A developer drafted the requirement as 'Tokens expire after a short period'. How should this temporal logic be documented? | pass→pass | 10,510 | 5,687 | -46% | 1 | 1 | 0% | 1,678 | 2,776 | +65% | 0 | 0 | — |
▸case-20 An internal administrative API (`admin_portal.py`) allows customer support representatives to override subscription renewal dates, while automated billing cron tasks trigger normal renewals. How should actors and responsibilities be structured in the extracted spec? | pass→pass | 12,815 | 12,082 | -6% | 1 | 1 | 0% | 2,170 | 3,822 | +76% | 0 | 0 | — |
▸case-21 An API endpoint `POST /v1/claims` accepts JSON payloads containing mandatory `policy_number` and `claim_amount`, optional `incident_description` (defaulting to empty string), and returns `claim_id` and calculated `payout_estimate`. How should this API signature be represented in domain rules? | pass→pass | 12,458 | 5,946 | -52% | 1 | 1 | 0% | 2,248 | 2,894 | +29% | 0 | 0 | — |
▸case-22 You have completed extracting a formal specification from a 10-year-old financial ledger monolith. What steps must be taken to validate that the spec accurately reflects both existing implementation and intended business goals? | pass→pass | 18,833 | 14,849 | -21% | 1 | 1 | 0% | 2,707 | 4,082 | +51% | 0 | 0 | — |