{"abstract":"Hedging doubles the delta instead of neutralizing it.","category":"Options payoff and settlement","checks":8,"contract":"Inputs positions [kind, signed contracts, absolute delta], multiplier, lot size and existing shares. Put delta is negative. Exposure = sum(sign*delta*contracts*multiplier); target shares = -exposure; the order is target - existing, rounded to whole lots with halves away from zero. Return the signed share quantity.","contract_signature":"positions, multiplier, lot, existing","evaluation_group":"w2-options_payoff_and_settlement-delta-hedge-lots","failed_approach":"Forcing the target negative only works for net long delta books.","family":"w2-options_payoff_and_settlement-delta-hedge-lots-hedge-direction","id":"FA-61766","implementations":{"attempt":{"sha256":"d68a6f6ad8478bf5e0f94683bfb165db146f22a3479b060f29029bbbbd1a06c8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(positions, multiplier, lot, existing):\n    exposure = Fraction(0)\n    for kind, c, d in positions:\n        sgn = -1 if kind == 'P' else 1\n        exposure += sgn * Fraction(str(d)) * c * multiplier\n    target = -abs(exposure)\n    trade = target - existing\n    lots = trade / lot\n    n = math.floor(abs(lots) + Fraction(1, 2))\n    return int((n if lots >= 0 else -n) * lot)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression hedge direction 1', [[['C', 2, 0.5], ['P', 1, 0.25], ['P', 1, 0.35], ['C', 2, 0.6]], 10, 25, 100], -125], ['regression hedge direction 2', [[['P', 1, 0.25], ['C', 2, 0.6], ['P', -1, 0.5]], 100, 25, -250], 100], ['partial repair probe 1', [[['C', 2, 0.35], ['C', -3, 0.75], ['P', 10, 0.35]], 100, 100, -250], 800], ['partial repair probe 2', [[['P', 5, 0.35], ['P', 2, 0.5], ['C', 5, 0.25], ['P', 1, 0.75]], 100, 25, 0], 225], ['normal control 1', [[['P', 5, 0.75]], 10, 100, 100], -100], ['normal control 2', [[['C', 1, 0.25], ['C', 1, 0.6]], 10, 25, 0], 0], ['normal control 3', [[['P', 1, 0.5], ['P', -1, 0.35], ['C', 1, 0.35]], 10, 100, 100], -100], ['normal control 4', [[['P', -3, 0.75], ['C', -1, 0.05], ['C', -3, 0.6]], 10, 50, 0], 0]], [['regression hedge direction 1', [[['P', 1, 0.35]], 100, 50, 100], -50], ['regression hedge direction 2', [[['C', -3, 0.6], ['C', 5, 0.5], ['P', 5, 0.5]], 100, 100, 100], 100], ['partial repair probe 1', [[['P', 10, 0.6], ['C', 5, 0.05]], 100, 50, 75], 500], ['partial repair probe 2', [[['P', 5, 0.5], ['P', -3, 0.6], ['P', -1, 0.05]], 100, 100, 0], 100], ['normal control 1', [[['C', 5, 0.75]], 10, 100, 100], -100], ['normal control 2', [[['C', 2, 0.25]], 10, 100, 75], -100], ['normal control 3', [[['P', 1, 0.05], ['C', 10, 0.05]], 10, 25, 75], -75], ['normal control 4', [[['C', 5, 0.25], ['C', 5, 0.35]], 10, 100, 0], 0]], [['regression hedge direction 1', [[['C', 1, 0.35], ['C', -1, 0.35], ['C', -1, 0.35]], 100, 25, -250], 275], ['regression hedge direction 2', [[['C', 1, 0.5]], 100, 100, 0], -100], ['partial repair probe 1', [[['C', 5, 0.75], ['P', 5, 0.05], ['P', 5, 0.75]], 100, 50, 100], -100], ['partial repair probe 2', [[['P', 2, 0.75], ['P', 10, 0.35], ['P', 1, 0.05]], 100, 50, 75], 450], ['normal control 1', [[['C', 2, 0.5]], 10, 25, 0], 0], ['normal control 2', [[['P', 5, 0.05], ['C', -1, 0.6], ['P', 1, 0.75]], 10, 100, 75], -100], ['normal control 3', [[['P', 5, 0.05], ['P', -3, 0.25]], 10, 25, 0], 0], ['normal control 4', [[['C', 2, 0.05], ['P', 1, 0.75], ['P', 2, 0.75]], 10, 50, 100], -100]], [['regression hedge direction 1', [[['C', 1, 0.5], ['P', -1, 0.5], ['P', 5, 0.75], ['C', -3, 0.25]], 100, 25, 75], 275], ['regression hedge direction 2', [[['C', 1, 0.6], ['C', 2, 0.25]], 100, 100, 75], -200], ['partial repair probe 1', [[['P', 2, 0.25], ['P', -3, 0.75], ['C', 1, 0.6], ['P', 10, 0.75]], 100, 100, 0], 500], ['partial repair probe 2', [[['P', 1, 0.6], ['P', 5, 0.75], ['P', 5, 0.75], ['P', 10, 0.35]], 100, 50, -250], 1400], ['normal control 1', [[['C', 5, 0.35]], 10, 100, 75], -100], ['normal control 2', [[['C', -3, 0.35], ['C', 1, 0.5], ['P', 1, 0.35]], 10, 50, 0], 0], ['normal control 3', [[['C', 10, 0.05]], 10, 100, 0], 0], ['normal control 4', [[['C', 2, 0.5]], 10, 100, 100], -100]], [['regression hedge direction 1', [[['P', -3, 0.05]], 100, 25, -250], 225], ['regression hedge direction 2', [[['C', 5, 0.6], ['P', -3, 0.35], ['P', 2, 0.6]], 10, 25, -250], 225], ['partial repair probe 1', [[['P', 5, 0.6], ['C', -1, 0.05], ['C', 1, 0.25]], 10, 50, 0], 50], ['partial repair probe 2', [[['C', 1, 0.25], ['C', 1, 0.5], ['C', -1, 0.75], ['P', 10, 0.6]], 100, 100, 100], 500], ['normal control 1', [[['C', 5, 0.75], ['P', 10, 0.05]], 10, 100, 100], -100], ['normal control 2', [[['P', -3, 0.5]], 10, 100, 0], 0], ['normal control 3', [[['C', 1, 0.75], ['C', 1, 0.05], ['C', 2, 0.05], ['C', -1, 0.25]], 10, 100, 0], 0], ['normal control 4', [[['C', -3, 0.5], ['C', 2, 0.5], ['C', 2, 0.75]], 10, 25, 75], -75]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"0d6daedfde58fff789b847d9ab7558ad3ba41797709aae38f4d87752c0c6c4f1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(positions, multiplier, lot, existing):\n    exposure = Fraction(0)\n    for kind, c, d in positions:\n        sgn = -1 if kind == 'P' else 1\n        exposure += sgn * Fraction(str(d)) * c * multiplier\n    target = exposure\n    trade = target - existing\n    lots = trade / lot\n    n = math.floor(abs(lots) + Fraction(1, 2))\n    return int((n if lots >= 0 else -n) * lot)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression hedge direction 1', [[['C', 2, 0.5], ['P', 1, 0.25], ['P', 1, 0.35], ['C', 2, 0.6]], 10, 25, 100], -125], ['regression hedge direction 2', [[['P', 1, 0.25], ['C', 2, 0.6], ['P', -1, 0.5]], 100, 25, -250], 100], ['partial repair probe 1', [[['C', 2, 0.35], ['C', -3, 0.75], ['P', 10, 0.35]], 100, 100, -250], 800], ['partial repair probe 2', [[['P', 5, 0.35], ['P', 2, 0.5], ['C', 5, 0.25], ['P', 1, 0.75]], 100, 25, 0], 225], ['normal control 1', [[['P', 5, 0.75]], 10, 100, 100], -100], ['normal control 2', [[['C', 1, 0.25], ['C', 1, 0.6]], 10, 25, 0], 0], ['normal control 3', [[['P', 1, 0.5], ['P', -1, 0.35], ['C', 1, 0.35]], 10, 100, 100], -100], ['normal control 4', [[['P', -3, 0.75], ['C', -1, 0.05], ['C', -3, 0.6]], 10, 50, 0], 0]], [['regression hedge direction 1', [[['P', 1, 0.35]], 100, 50, 100], -50], ['regression hedge direction 2', [[['C', -3, 0.6], ['C', 5, 0.5], ['P', 5, 0.5]], 100, 100, 100], 100], ['partial repair probe 1', [[['P', 10, 0.6], ['C', 5, 0.05]], 100, 50, 75], 500], ['partial repair probe 2', [[['P', 5, 0.5], ['P', -3, 0.6], ['P', -1, 0.05]], 100, 100, 0], 100], ['normal control 1', [[['C', 5, 0.75]], 10, 100, 100], -100], ['normal control 2', [[['C', 2, 0.25]], 10, 100, 75], -100], ['normal control 3', [[['P', 1, 0.05], ['C', 10, 0.05]], 10, 25, 75], -75], ['normal control 4', [[['C', 5, 0.25], ['C', 5, 0.35]], 10, 100, 0], 0]], [['regression hedge direction 1', [[['C', 1, 0.35], ['C', -1, 0.35], ['C', -1, 0.35]], 100, 25, -250], 275], ['regression hedge direction 2', [[['C', 1, 0.5]], 100, 100, 0], -100], ['partial repair probe 1', [[['C', 5, 0.75], ['P', 5, 0.05], ['P', 5, 0.75]], 100, 50, 100], -100], ['partial repair probe 2', [[['P', 2, 0.75], ['P', 10, 0.35], ['P', 1, 0.05]], 100, 50, 75], 450], ['normal control 1', [[['C', 2, 0.5]], 10, 25, 0], 0], ['normal control 2', [[['P', 5, 0.05], ['C', -1, 0.6], ['P', 1, 0.75]], 10, 100, 75], -100], ['normal control 3', [[['P', 5, 0.05], ['P', -3, 0.25]], 10, 25, 0], 0], ['normal control 4', [[['C', 2, 0.05], ['P', 1, 0.75], ['P', 2, 0.75]], 10, 50, 100], -100]], [['regression hedge direction 1', [[['C', 1, 0.5], ['P', -1, 0.5], ['P', 5, 0.75], ['C', -3, 0.25]], 100, 25, 75], 275], ['regression hedge direction 2', [[['C', 1, 0.6], ['C', 2, 0.25]], 100, 100, 75], -200], ['partial repair probe 1', [[['P', 2, 0.25], ['P', -3, 0.75], ['C', 1, 0.6], ['P', 10, 0.75]], 100, 100, 0], 500], ['partial repair probe 2', [[['P', 1, 0.6], ['P', 5, 0.75], ['P', 5, 0.75], ['P', 10, 0.35]], 100, 50, -250], 1400], ['normal control 1', [[['C', 5, 0.35]], 10, 100, 75], -100], ['normal control 2', [[['C', -3, 0.35], ['C', 1, 0.5], ['P', 1, 0.35]], 10, 50, 0], 0], ['normal control 3', [[['C', 10, 0.05]], 10, 100, 0], 0], ['normal control 4', [[['C', 2, 0.5]], 10, 100, 100], -100]], [['regression hedge direction 1', [[['P', -3, 0.05]], 100, 25, -250], 225], ['regression hedge direction 2', [[['C', 5, 0.6], ['P', -3, 0.35], ['P', 2, 0.6]], 10, 25, -250], 225], ['partial repair probe 1', [[['P', 5, 0.6], ['C', -1, 0.05], ['C', 1, 0.25]], 10, 50, 0], 50], ['partial repair probe 2', [[['C', 1, 0.25], ['C', 1, 0.5], ['C', -1, 0.75], ['P', 10, 0.6]], 100, 100, 100], 500], ['normal control 1', [[['C', 5, 0.75], ['P', 10, 0.05]], 10, 100, 100], -100], ['normal control 2', [[['P', -3, 0.5]], 10, 100, 0], 0], ['normal control 3', [[['C', 1, 0.75], ['C', 1, 0.05], ['C', 2, 0.05], ['C', -1, 0.25]], 10, 100, 0], 0], ['normal control 4', [[['C', -3, 0.5], ['C', 2, 0.5], ['C', 2, 0.75]], 10, 25, 75], -75]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic toy contract stated explicitly in the contract field; no claim of conformance to any exchange or clearing rulebook. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-options_payoff_and_settlement-delta-hedge-lots-hedge-direction","generated_at":"2026-09-29T14:46:58.363087+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Option expiry, exercise and settlement engines move cash and shares; a wrong branch misstates obligations.","root_cause":"The target is +exposure.","sha256":"07bb40fb27cf4b79e4e79b0b662bc7921d8ed2ccdd8169a46509884e20bd8da5","title":"Delta hedge order sized in lots: the hedge buys the exposure instead of offsetting it · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.619,"exit_code":1,"observations":[{"actual":-125,"check":"regression hedge direction 1","expected":-125,"passed":true},{"actual":100,"check":"regression hedge direction 2","expected":100,"passed":true},{"actual":-300,"check":"partial repair probe 1","expected":800,"passed":false},{"actual":-225,"check":"partial repair probe 2","expected":225,"passed":false},{"actual":-100,"check":"normal control 1","expected":-100,"passed":true},{"actual":0,"check":"normal control 2","expected":0,"passed":true},{"actual":-100,"check":"normal control 3","expected":-100,"passed":true},{"actual":0,"check":"normal control 4","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression hedge direction 1\", \"actual\": -125, \"expected\": -125, \"passed\": true}, {\"check\": \"regression hedge direction 2\", \"actual\": 100, \"expected\": 100, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": -300, \"expected\": 800, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": -225, \"expected\": 225, \"passed\": false}, {\"check\": \"normal control 1\", \"actual\": -100, \"expected\": -100, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": -100, \"expected\": -100, \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.167,"exit_code":1,"observations":[{"actual":-75,"check":"regression hedge direction 1","expected":-125,"passed":false},{"actual":400,"check":"regression hedge direction 2","expected":100,"passed":false},{"actual":-300,"check":"partial repair probe 1","expected":800,"passed":false},{"actual":-225,"check":"partial repair probe 2","expected":225,"passed":false},{"actual":-100,"check":"normal control 1","expected":-100,"passed":true},{"actual":0,"check":"normal control 2","expected":0,"passed":true},{"actual":-100,"check":"normal control 3","expected":-100,"passed":true},{"actual":0,"check":"normal control 4","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression hedge direction 1\", \"actual\": -75, \"expected\": -125, \"passed\": false}, {\"check\": \"regression hedge direction 2\", \"actual\": 400, \"expected\": 100, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": -300, \"expected\": 800, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": -225, \"expected\": 225, \"passed\": false}, {\"check\": \"normal control 1\", \"actual\": -100, \"expected\": -100, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": -100, \"expected\": -100, \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}