--- name: business-logic-race-analysis description: Test authorized business invariants, ordering, replay, and bounded concurrency using controlled state and complete reconciliation. --- # Business logic and race analysis ## Accepted inputs - Current scope, controlled accounts, owned records, and rollback plan - Expected business invariant and state transitions - Explicit concurrency, request, value, and timing caps ## Procedure 1. Express the invariant as before state, allowed action, expected after state, and forbidden outcome. 2. Establish sequential success and rejection baselines. 3. Record idempotency keys, object versions, timestamps, balances, limits, and server responses. 4. Run the smallest bounded concurrency attempt that can distinguish atomic from non-atomic behavior. 5. Reconcile every response and resulting state before another attempt. 6. Use the same requests sequentially as a negative control for concurrency-specific effects. ## Output artifacts - State model and timing plan - Attempt ledger with exact caps - Before-and-after evidence and reconciliation record ## Stop conditions Stop on unintended value, third-party effects, reconciliation failure, rate warning, or any state that cannot be rolled back safely. ## Completion gate Complete when the invariant failure repeats within caps and differs from sequential control, or bounded attempts reject the hypothesis with all state reconciled.