{"abstract":"Reconciling differences are reported with the opposite sign.","category":"Double-entry ledger accounting","checks":7,"contract":"x = {'control': [[day, amount]], 'sub': {customer: [[day, amount]]}, 'as_of': day}. Only rows dated on or before as_of count. The subledger total nets every customer balance, including credit (negative) balances. Return {'control', 'subledger', 'difference': control - subledger, 'credit_balances': customers with negative balance sorted by name, 'open_customers': count of nonzero balances}.","contract_signature":"x","evaluation_group":"w2-double-entry-ledger-accounting-subledger-control-tieout","failed_approach":"An absolute difference hides which ledger is overstated.","family":"w2-double-entry-ledger-accounting-subledger-control-tieout-difference-orientation","id":"FA-58266","implementations":{"attempt":{"sha256":"8653f32158051fd25099c0aeed62964bd21b3651df403de68120df177cfca926","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cut = x['as_of']\n    control = sum(a for d, a in x['control'] if d <= cut)\n    per = {}\n    for cust, rows in x['sub'].items():\n        per[cust] = sum(a for d, a in rows if d <= cut)\n    sub_total = sum(per.values())\n    credit = sorted(c for c, v in per.items() if v < 0)\n    return {'control': control, 'subledger': sub_total, 'difference': abs(control - sub_total), 'credit_balances': credit, 'open_customers': sum(1 for v in per.values() if v != 0)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: difference orientation', {'control': [[5, 100], [19, -80], [21, -80]], 'sub': {'bolt': [[5, -80], [1, 250], [5, -80]], 'acme': [[21, 100]], 'dyna': [[20, 400], [1, 250], [20, 100]], 'crux': [[20, 400], [5, 100]]}, 'as_of': 20}, {'control': 20, 'subledger': 1340, 'difference': -1320, 'credit_balances': [], 'open_customers': 3}], ['control 1', {'control': [[21, 250], [20, 250], [21, 400], [21, 250], [20, 250]], 'sub': {'bolt': [[1, -300], [21, 250]], 'crux': [[5, 400], [21, 100]], 'dyna': [[21, -80], [1, 400]]}, 'as_of': 20}, {'control': 500, 'subledger': 500, 'difference': 0, 'credit_balances': ['bolt'], 'open_customers': 3}], ['control 2', {'control': [[1, -80], [21, 400], [20, 400]], 'sub': {'bolt': [[21, 250]], 'crux': [[21, 250], [1, -300], [5, 100]], 'dyna': [[1, -80], [20, 100]], 'acme': [[20, 100], [5, 400], [21, 100]]}, 'as_of': 20}, {'control': 320, 'subledger': 320, 'difference': 0, 'credit_balances': ['crux'], 'open_customers': 3}], ['control 3', {'control': [[10, 100], [9, -80]], 'sub': {'dyna': [[10, -80], [10, 100]]}, 'as_of': 10}, {'control': 20, 'subledger': 20, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 4', {'control': [[1, 100], [32, 250], [32, 250]], 'sub': {'dyna': [[31, 100], [32, -80]]}, 'as_of': 31}, {'control': 100, 'subledger': 100, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 5', {'control': [[32, 100], [31, 400], [32, -80]], 'sub': {'dyna': [[1, 400]]}, 'as_of': 31}, {'control': 400, 'subledger': 400, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['sample 6', {'control': [[21, 400], [5, 250], [19, 250], [20, 400], [19, -80]], 'sub': {'bolt': [[5, 250]]}, 'as_of': 20}, {'control': 820, 'subledger': 250, 'difference': 570, 'credit_balances': [], 'open_customers': 1}]], [['regression: difference orientation', {'control': [[1, 400], [11, 250]], 'sub': {'dyna': [[1, 250]], 'crux': [[1, 250], [1, 250], [1, 100]], 'acme': [[10, 250], [1, 250], [11, 250]], 'bolt': [[11, 250], [5, 400]]}, 'as_of': 10}, {'control': 400, 'subledger': 1750, 'difference': -1350, 'credit_balances': [], 'open_customers': 4}], ['control 1', {'control': [[31, 250], [5, 100], [5, -80], [32, 100]], 'sub': {'bolt': [[5, -80], [5, 250], [5, 400]], 'dyna': [[1, -300]], 'acme': [[32, -300]]}, 'as_of': 31}, {'control': 270, 'subledger': 270, 'difference': 0, 'credit_balances': ['dyna'], 'open_customers': 2}], ['control 2', {'control': [[5, 100], [1, 250], [5, 250], [10, 250], [5, -80], [11, 250]], 'sub': {'bolt': [[1, 100], [10, 100]], 'acme': [[1, 400]], 'dyna': [[1, -80]], 'crux': [[5, 250]]}, 'as_of': 10}, {'control': 770, 'subledger': 770, 'difference': 0, 'credit_balances': ['dyna'], 'open_customers': 4}], ['control 3', {'control': [[10, 250], [9, -80], [9, -80]], 'sub': {'bolt': [[1, 100], [5, -80], [5, -80]], 'acme': [[10, 100], [10, 250], [10, 400]], 'dyna': [[10, -300], [10, -300]]}, 'as_of': 10}, {'control': 90, 'subledger': 90, 'difference': 0, 'credit_balances': ['bolt', 'dyna'], 'open_customers': 3}], ['control 4', {'control': [[1, 100], [32, 400], [32, -80], [1, -80], [31, 400], [5, -80]], 'sub': {'acme': [[32, -300], [1, -80], [5, -80]], 'crux': [[1, 250], [32, 400], [1, 250]]}, 'as_of': 31}, {'control': 340, 'subledger': 340, 'difference': 0, 'credit_balances': ['acme'], 'open_customers': 2}], ['sample 5', {'control': [[20, 250], [19, 100], [5, 400]], 'sub': {'bolt': [[20, 250]], 'acme': [[1, -300], [1, 100], [1, 250]]}, 'as_of': 20}, {'control': 750, 'subledger': 300, 'difference': 450, 'credit_balances': [], 'open_customers': 2}], ['sample 6', {'control': [[5, 400], [20, -80], [19, 250]], 'sub': {'acme': [[21, 250]], 'bolt': [[20, 250], [1, -80], [1, -80]], 'dyna': [[21, -80], [20, 100]], 'crux': [[5, 400], [21, 400], [20, -300]]}, 'as_of': 20}, {'control': 570, 'subledger': 290, 'difference': 280, 'credit_balances': [], 'open_customers': 3}]], [['regression: difference orientation', {'control': [[9, 250], [11, 100], [11, -80], [11, 250]], 'sub': {'dyna': [[1, 250], [11, 400], [10, -80]], 'acme': [[11, -300], [1, 400], [1, 400]], 'bolt': [[1, -300]]}, 'as_of': 10}, {'control': 250, 'subledger': 670, 'difference': -420, 'credit_balances': ['bolt'], 'open_customers': 3}], ['control 1', {'control': [[1, 100], [9, -80], [5, 100]], 'sub': {'crux': [[11, 400], [10, -80], [11, -80]], 'acme': [[1, 400]], 'bolt': [[10, -300], [5, 400]], 'dyna': [[5, -300], [11, -300], [11, 100]]}, 'as_of': 10}, {'control': 120, 'subledger': 120, 'difference': 0, 'credit_balances': ['crux', 'dyna'], 'open_customers': 4}], ['control 2', {'control': [[30, 250], [30, 250]], 'sub': {'dyna': [[5, 250], [31, 250]]}, 'as_of': 31}, {'control': 500, 'subledger': 500, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 3', {'control': [[5, 250], [10, 400], [11, 100], [9, 400]], 'sub': {'dyna': [[1, 400], [11, -80], [5, 250]], 'crux': [[10, 400]]}, 'as_of': 10}, {'control': 1050, 'subledger': 1050, 'difference': 0, 'credit_balances': [], 'open_customers': 2}], ['sample 4', {'control': [[1, -80], [1, 100], [32, 400], [31, 250]], 'sub': {'bolt': [[1, 250]]}, 'as_of': 31}, {'control': 270, 'subledger': 250, 'difference': 20, 'credit_balances': [], 'open_customers': 1}], ['sample 5', {'control': [[11, 100], [5, -80], [9, 400]], 'sub': {'acme': [[11, 100], [11, 250], [1, 250]], 'dyna': [[5, 100]], 'bolt': [[5, -300], [5, -300]], 'crux': [[5, 250], [11, -300], [1, 100]]}, 'as_of': 10}, {'control': 320, 'subledger': 100, 'difference': 220, 'credit_balances': ['bolt'], 'open_customers': 4}], ['sample 6', {'control': [[1, -80], [5, 250], [1, 400], [21, -80], [5, 250], [5, 100]], 'sub': {'crux': [[20, -80]], 'acme': [[1, 100]], 'bolt': [[5, 400], [1, 400], [21, 250]]}, 'as_of': 20}, {'control': 920, 'subledger': 820, 'difference': 100, 'credit_balances': ['crux'], 'open_customers': 3}]], [['regression: difference orientation', {'control': [[20, -80], [21, 100]], 'sub': {'dyna': [[1, -80], [20, 250]], 'bolt': [[1, -300], [20, 400], [21, -300]]}, 'as_of': 20}, {'control': -80, 'subledger': 270, 'difference': -350, 'credit_balances': [], 'open_customers': 2}], ['control 1', {'control': [[21, 250], [5, 100], [21, 250]], 'sub': {'bolt': [[21, -300], [5, 100]]}, 'as_of': 20}, {'control': 100, 'subledger': 100, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 2', {'control': [[19, 400], [1, 400], [19, 250], [1, -80]], 'sub': {'crux': [[21, 100], [5, 100], [1, 400]], 'acme': [[21, -300], [21, -80]], 'dyna': [[5, -80], [20, 100], [1, 100]], 'bolt': [[1, 400], [20, 250], [1, -300]]}, 'as_of': 20}, {'control': 970, 'subledger': 970, 'difference': 0, 'credit_balances': [], 'open_customers': 3}], ['control 3', {'control': [[9, 100], [1, -80], [11, 400], [1, 250]], 'sub': {'acme': [[10, 250]], 'dyna': [[10, -80], [11, -80], [1, 100]]}, 'as_of': 10}, {'control': 270, 'subledger': 270, 'difference': 0, 'credit_balances': [], 'open_customers': 2}], ['control 4', {'control': [[1, 400], [21, 400], [5, 250], [20, 250]], 'sub': {'dyna': [[5, 100], [5, 400], [20, 400]]}, 'as_of': 20}, {'control': 900, 'subledger': 900, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 5', {'control': [[21, 400], [5, 100]], 'sub': {'bolt': [[5, 100], [21, -300], [21, -300]], 'acme': [[21, 100], [21, -80], [21, 400]], 'crux': [[21, -80], [21, -300], [21, 100]]}, 'as_of': 20}, {'control': 100, 'subledger': 100, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 6', {'control': [[5, 100], [32, 250]], 'sub': {'crux': [[5, -300], [32, 400]], 'dyna': [[1, 400], [32, 100], [32, -300]]}, 'as_of': 31}, {'control': 100, 'subledger': 100, 'difference': 0, 'credit_balances': ['crux'], 'open_customers': 2}]], [['regression: difference orientation', {'control': [[5, 100], [5, 250], [19, -80], [21, 250], [21, 250]], 'sub': {'crux': [[20, -80], [20, -80]], 'acme': [[21, 100]]}, 'as_of': 20}, {'control': 270, 'subledger': -160, 'difference': 430, 'credit_balances': ['crux'], 'open_customers': 1}], ['regression: difference orientation, partial-repair probe', {'control': [[10, -80], [9, 400], [1, 250]], 'sub': {'crux': [[5, 250], [1, 400], [5, 250]], 'acme': [[10, -80]]}, 'as_of': 10}, {'control': 570, 'subledger': 820, 'difference': -250, 'credit_balances': ['acme'], 'open_customers': 2}], ['control 1', {'control': [[20, -80], [20, 100], [21, -80], [21, 100]], 'sub': {'acme': [[5, 100], [1, -80], [21, 100]]}, 'as_of': 20}, {'control': 20, 'subledger': 20, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 2', {'control': [[30, 100], [32, -80]], 'sub': {'acme': [[31, 100], [32, 400]]}, 'as_of': 31}, {'control': 100, 'subledger': 100, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 3', {'control': [[30, 100], [30, 400]], 'sub': {'bolt': [[32, 400]], 'dyna': [[5, 400], [5, 400], [5, -300]]}, 'as_of': 31}, {'control': 500, 'subledger': 500, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 4', {'control': [[1, -80], [1, 100]], 'sub': {'dyna': [[31, -80], [32, 250], [1, 100]]}, 'as_of': 31}, {'control': 20, 'subledger': 20, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 5', {'control': [[10, 400], [5, 100], [1, -80], [1, 400]], 'sub': {'crux': [[11, 400], [11, 100], [10, 250]], 'bolt': [[10, -80]], 'dyna': [[1, 400]], 'acme': [[10, 250]]}, 'as_of': 10}, {'control': 820, 'subledger': 820, 'difference': 0, 'credit_balances': ['bolt'], 'open_customers': 4}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, 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":"c21cea6f503aa23c67970c3deb31938aff1f2947fab7ae4aeca6b4dfee225852","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cut = x['as_of']\n    control = sum(a for d, a in x['control'] if d <= cut)\n    per = {}\n    for cust, rows in x['sub'].items():\n        per[cust] = sum(a for d, a in rows if d <= cut)\n    sub_total = sum(per.values())\n    credit = sorted(c for c, v in per.items() if v < 0)\n    return {'control': control, 'subledger': sub_total, 'difference': sub_total - control, 'credit_balances': credit, 'open_customers': sum(1 for v in per.values() if v != 0)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: difference orientation', {'control': [[5, 100], [19, -80], [21, -80]], 'sub': {'bolt': [[5, -80], [1, 250], [5, -80]], 'acme': [[21, 100]], 'dyna': [[20, 400], [1, 250], [20, 100]], 'crux': [[20, 400], [5, 100]]}, 'as_of': 20}, {'control': 20, 'subledger': 1340, 'difference': -1320, 'credit_balances': [], 'open_customers': 3}], ['control 1', {'control': [[21, 250], [20, 250], [21, 400], [21, 250], [20, 250]], 'sub': {'bolt': [[1, -300], [21, 250]], 'crux': [[5, 400], [21, 100]], 'dyna': [[21, -80], [1, 400]]}, 'as_of': 20}, {'control': 500, 'subledger': 500, 'difference': 0, 'credit_balances': ['bolt'], 'open_customers': 3}], ['control 2', {'control': [[1, -80], [21, 400], [20, 400]], 'sub': {'bolt': [[21, 250]], 'crux': [[21, 250], [1, -300], [5, 100]], 'dyna': [[1, -80], [20, 100]], 'acme': [[20, 100], [5, 400], [21, 100]]}, 'as_of': 20}, {'control': 320, 'subledger': 320, 'difference': 0, 'credit_balances': ['crux'], 'open_customers': 3}], ['control 3', {'control': [[10, 100], [9, -80]], 'sub': {'dyna': [[10, -80], [10, 100]]}, 'as_of': 10}, {'control': 20, 'subledger': 20, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 4', {'control': [[1, 100], [32, 250], [32, 250]], 'sub': {'dyna': [[31, 100], [32, -80]]}, 'as_of': 31}, {'control': 100, 'subledger': 100, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 5', {'control': [[32, 100], [31, 400], [32, -80]], 'sub': {'dyna': [[1, 400]]}, 'as_of': 31}, {'control': 400, 'subledger': 400, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['sample 6', {'control': [[21, 400], [5, 250], [19, 250], [20, 400], [19, -80]], 'sub': {'bolt': [[5, 250]]}, 'as_of': 20}, {'control': 820, 'subledger': 250, 'difference': 570, 'credit_balances': [], 'open_customers': 1}]], [['regression: difference orientation', {'control': [[1, 400], [11, 250]], 'sub': {'dyna': [[1, 250]], 'crux': [[1, 250], [1, 250], [1, 100]], 'acme': [[10, 250], [1, 250], [11, 250]], 'bolt': [[11, 250], [5, 400]]}, 'as_of': 10}, {'control': 400, 'subledger': 1750, 'difference': -1350, 'credit_balances': [], 'open_customers': 4}], ['control 1', {'control': [[31, 250], [5, 100], [5, -80], [32, 100]], 'sub': {'bolt': [[5, -80], [5, 250], [5, 400]], 'dyna': [[1, -300]], 'acme': [[32, -300]]}, 'as_of': 31}, {'control': 270, 'subledger': 270, 'difference': 0, 'credit_balances': ['dyna'], 'open_customers': 2}], ['control 2', {'control': [[5, 100], [1, 250], [5, 250], [10, 250], [5, -80], [11, 250]], 'sub': {'bolt': [[1, 100], [10, 100]], 'acme': [[1, 400]], 'dyna': [[1, -80]], 'crux': [[5, 250]]}, 'as_of': 10}, {'control': 770, 'subledger': 770, 'difference': 0, 'credit_balances': ['dyna'], 'open_customers': 4}], ['control 3', {'control': [[10, 250], [9, -80], [9, -80]], 'sub': {'bolt': [[1, 100], [5, -80], [5, -80]], 'acme': [[10, 100], [10, 250], [10, 400]], 'dyna': [[10, -300], [10, -300]]}, 'as_of': 10}, {'control': 90, 'subledger': 90, 'difference': 0, 'credit_balances': ['bolt', 'dyna'], 'open_customers': 3}], ['control 4', {'control': [[1, 100], [32, 400], [32, -80], [1, -80], [31, 400], [5, -80]], 'sub': {'acme': [[32, -300], [1, -80], [5, -80]], 'crux': [[1, 250], [32, 400], [1, 250]]}, 'as_of': 31}, {'control': 340, 'subledger': 340, 'difference': 0, 'credit_balances': ['acme'], 'open_customers': 2}], ['sample 5', {'control': [[20, 250], [19, 100], [5, 400]], 'sub': {'bolt': [[20, 250]], 'acme': [[1, -300], [1, 100], [1, 250]]}, 'as_of': 20}, {'control': 750, 'subledger': 300, 'difference': 450, 'credit_balances': [], 'open_customers': 2}], ['sample 6', {'control': [[5, 400], [20, -80], [19, 250]], 'sub': {'acme': [[21, 250]], 'bolt': [[20, 250], [1, -80], [1, -80]], 'dyna': [[21, -80], [20, 100]], 'crux': [[5, 400], [21, 400], [20, -300]]}, 'as_of': 20}, {'control': 570, 'subledger': 290, 'difference': 280, 'credit_balances': [], 'open_customers': 3}]], [['regression: difference orientation', {'control': [[9, 250], [11, 100], [11, -80], [11, 250]], 'sub': {'dyna': [[1, 250], [11, 400], [10, -80]], 'acme': [[11, -300], [1, 400], [1, 400]], 'bolt': [[1, -300]]}, 'as_of': 10}, {'control': 250, 'subledger': 670, 'difference': -420, 'credit_balances': ['bolt'], 'open_customers': 3}], ['control 1', {'control': [[1, 100], [9, -80], [5, 100]], 'sub': {'crux': [[11, 400], [10, -80], [11, -80]], 'acme': [[1, 400]], 'bolt': [[10, -300], [5, 400]], 'dyna': [[5, -300], [11, -300], [11, 100]]}, 'as_of': 10}, {'control': 120, 'subledger': 120, 'difference': 0, 'credit_balances': ['crux', 'dyna'], 'open_customers': 4}], ['control 2', {'control': [[30, 250], [30, 250]], 'sub': {'dyna': [[5, 250], [31, 250]]}, 'as_of': 31}, {'control': 500, 'subledger': 500, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 3', {'control': [[5, 250], [10, 400], [11, 100], [9, 400]], 'sub': {'dyna': [[1, 400], [11, -80], [5, 250]], 'crux': [[10, 400]]}, 'as_of': 10}, {'control': 1050, 'subledger': 1050, 'difference': 0, 'credit_balances': [], 'open_customers': 2}], ['sample 4', {'control': [[1, -80], [1, 100], [32, 400], [31, 250]], 'sub': {'bolt': [[1, 250]]}, 'as_of': 31}, {'control': 270, 'subledger': 250, 'difference': 20, 'credit_balances': [], 'open_customers': 1}], ['sample 5', {'control': [[11, 100], [5, -80], [9, 400]], 'sub': {'acme': [[11, 100], [11, 250], [1, 250]], 'dyna': [[5, 100]], 'bolt': [[5, -300], [5, -300]], 'crux': [[5, 250], [11, -300], [1, 100]]}, 'as_of': 10}, {'control': 320, 'subledger': 100, 'difference': 220, 'credit_balances': ['bolt'], 'open_customers': 4}], ['sample 6', {'control': [[1, -80], [5, 250], [1, 400], [21, -80], [5, 250], [5, 100]], 'sub': {'crux': [[20, -80]], 'acme': [[1, 100]], 'bolt': [[5, 400], [1, 400], [21, 250]]}, 'as_of': 20}, {'control': 920, 'subledger': 820, 'difference': 100, 'credit_balances': ['crux'], 'open_customers': 3}]], [['regression: difference orientation', {'control': [[20, -80], [21, 100]], 'sub': {'dyna': [[1, -80], [20, 250]], 'bolt': [[1, -300], [20, 400], [21, -300]]}, 'as_of': 20}, {'control': -80, 'subledger': 270, 'difference': -350, 'credit_balances': [], 'open_customers': 2}], ['control 1', {'control': [[21, 250], [5, 100], [21, 250]], 'sub': {'bolt': [[21, -300], [5, 100]]}, 'as_of': 20}, {'control': 100, 'subledger': 100, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 2', {'control': [[19, 400], [1, 400], [19, 250], [1, -80]], 'sub': {'crux': [[21, 100], [5, 100], [1, 400]], 'acme': [[21, -300], [21, -80]], 'dyna': [[5, -80], [20, 100], [1, 100]], 'bolt': [[1, 400], [20, 250], [1, -300]]}, 'as_of': 20}, {'control': 970, 'subledger': 970, 'difference': 0, 'credit_balances': [], 'open_customers': 3}], ['control 3', {'control': [[9, 100], [1, -80], [11, 400], [1, 250]], 'sub': {'acme': [[10, 250]], 'dyna': [[10, -80], [11, -80], [1, 100]]}, 'as_of': 10}, {'control': 270, 'subledger': 270, 'difference': 0, 'credit_balances': [], 'open_customers': 2}], ['control 4', {'control': [[1, 400], [21, 400], [5, 250], [20, 250]], 'sub': {'dyna': [[5, 100], [5, 400], [20, 400]]}, 'as_of': 20}, {'control': 900, 'subledger': 900, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 5', {'control': [[21, 400], [5, 100]], 'sub': {'bolt': [[5, 100], [21, -300], [21, -300]], 'acme': [[21, 100], [21, -80], [21, 400]], 'crux': [[21, -80], [21, -300], [21, 100]]}, 'as_of': 20}, {'control': 100, 'subledger': 100, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 6', {'control': [[5, 100], [32, 250]], 'sub': {'crux': [[5, -300], [32, 400]], 'dyna': [[1, 400], [32, 100], [32, -300]]}, 'as_of': 31}, {'control': 100, 'subledger': 100, 'difference': 0, 'credit_balances': ['crux'], 'open_customers': 2}]], [['regression: difference orientation', {'control': [[5, 100], [5, 250], [19, -80], [21, 250], [21, 250]], 'sub': {'crux': [[20, -80], [20, -80]], 'acme': [[21, 100]]}, 'as_of': 20}, {'control': 270, 'subledger': -160, 'difference': 430, 'credit_balances': ['crux'], 'open_customers': 1}], ['regression: difference orientation, partial-repair probe', {'control': [[10, -80], [9, 400], [1, 250]], 'sub': {'crux': [[5, 250], [1, 400], [5, 250]], 'acme': [[10, -80]]}, 'as_of': 10}, {'control': 570, 'subledger': 820, 'difference': -250, 'credit_balances': ['acme'], 'open_customers': 2}], ['control 1', {'control': [[20, -80], [20, 100], [21, -80], [21, 100]], 'sub': {'acme': [[5, 100], [1, -80], [21, 100]]}, 'as_of': 20}, {'control': 20, 'subledger': 20, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 2', {'control': [[30, 100], [32, -80]], 'sub': {'acme': [[31, 100], [32, 400]]}, 'as_of': 31}, {'control': 100, 'subledger': 100, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 3', {'control': [[30, 100], [30, 400]], 'sub': {'bolt': [[32, 400]], 'dyna': [[5, 400], [5, 400], [5, -300]]}, 'as_of': 31}, {'control': 500, 'subledger': 500, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 4', {'control': [[1, -80], [1, 100]], 'sub': {'dyna': [[31, -80], [32, 250], [1, 100]]}, 'as_of': 31}, {'control': 20, 'subledger': 20, 'difference': 0, 'credit_balances': [], 'open_customers': 1}], ['control 5', {'control': [[10, 400], [5, 100], [1, -80], [1, 400]], 'sub': {'crux': [[11, 400], [11, 100], [10, 250]], 'bolt': [[10, -80]], 'dyna': [[1, 400]], 'acme': [[10, 250]]}, 'as_of': 10}, {'control': 820, 'subledger': 820, 'difference': 0, 'credit_balances': ['bolt'], 'open_customers': 4}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, 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 bounded teaching model with stipulated toy bookkeeping rules stated in the contract; amounts are integer cents; it makes no claim of conformance to any accounting standard or product. 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-double-entry-ledger-accounting-subledger-control-tieout-difference-orientation","generated_at":"2026-09-29T14:46:25.092605+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Ledger software must keep debits equal to credits and apply normal-balance, period and cutoff rules exactly; small sign or boundary slips silently misstate financial statements.","root_cause":"The difference subtracts control from the subledger.","sha256":"433da9fdbf20a4a1e4b6715d1f7207c9a1e3e3cbc73d6e6f35380a29f324a0bd","title":"Receivables subledger tie-out: difference orientation · 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":45.204,"exit_code":1,"observations":[{"actual":{"control":20,"credit_balances":[],"difference":1320,"open_customers":3,"subledger":1340},"check":"regression: difference orientation","expected":{"control":20,"credit_balances":[],"difference":-1320,"open_customers":3,"subledger":1340},"passed":false},{"actual":{"control":500,"credit_balances":["bolt"],"difference":0,"open_customers":3,"subledger":500},"check":"control 1","expected":{"control":500,"credit_balances":["bolt"],"difference":0,"open_customers":3,"subledger":500},"passed":true},{"actual":{"control":320,"credit_balances":["crux"],"difference":0,"open_customers":3,"subledger":320},"check":"control 2","expected":{"control":320,"credit_balances":["crux"],"difference":0,"open_customers":3,"subledger":320},"passed":true},{"actual":{"control":20,"credit_balances":[],"difference":0,"open_customers":1,"subledger":20},"check":"control 3","expected":{"control":20,"credit_balances":[],"difference":0,"open_customers":1,"subledger":20},"passed":true},{"actual":{"control":100,"credit_balances":[],"difference":0,"open_customers":1,"subledger":100},"check":"control 4","expected":{"control":100,"credit_balances":[],"difference":0,"open_customers":1,"subledger":100},"passed":true},{"actual":{"control":400,"credit_balances":[],"difference":0,"open_customers":1,"subledger":400},"check":"control 5","expected":{"control":400,"credit_balances":[],"difference":0,"open_customers":1,"subledger":400},"passed":true},{"actual":{"control":820,"credit_balances":[],"difference":570,"open_customers":1,"subledger":250},"check":"sample 6","expected":{"control":820,"credit_balances":[],"difference":570,"open_customers":1,"subledger":250},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: difference orientation\", \"actual\": {\"control\": 20, \"subledger\": 1340, \"difference\": 1320, \"credit_balances\": [], \"open_customers\": 3}, \"expected\": {\"control\": 20, \"subledger\": 1340, \"difference\": -1320, \"credit_balances\": [], \"open_customers\": 3}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"control\": 500, \"subledger\": 500, \"difference\": 0, \"credit_balances\": [\"bolt\"], \"open_customers\": 3}, \"expected\": {\"control\": 500, \"subledger\": 500, \"difference\": 0, \"credit_balances\": [\"bolt\"], \"open_customers\": 3}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"control\": 320, \"subledger\": 320, \"difference\": 0, \"credit_balances\": [\"crux\"], \"open_customers\": 3}, \"expected\": {\"control\": 320, \"subledger\": 320, \"difference\": 0, \"credit_balances\": [\"crux\"], \"open_customers\": 3}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"control\": 20, \"subledger\": 20, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"expected\": {\"control\": 20, \"subledger\": 20, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"control\": 100, \"subledger\": 100, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"expected\": {\"control\": 100, \"subledger\": 100, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"control\": 400, \"subledger\": 400, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"expected\": {\"control\": 400, \"subledger\": 400, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"passed\": true}, {\"check\": \"sample 6\", \"actual\": {\"control\": 820, \"subledger\": 250, \"difference\": 570, \"credit_balances\": [], \"open_customers\": 1}, \"expected\": {\"control\": 820, \"subledger\": 250, \"difference\": 570, \"credit_balances\": [], \"open_customers\": 1}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.293,"exit_code":1,"observations":[{"actual":{"control":20,"credit_balances":[],"difference":1320,"open_customers":3,"subledger":1340},"check":"regression: difference orientation","expected":{"control":20,"credit_balances":[],"difference":-1320,"open_customers":3,"subledger":1340},"passed":false},{"actual":{"control":500,"credit_balances":["bolt"],"difference":0,"open_customers":3,"subledger":500},"check":"control 1","expected":{"control":500,"credit_balances":["bolt"],"difference":0,"open_customers":3,"subledger":500},"passed":true},{"actual":{"control":320,"credit_balances":["crux"],"difference":0,"open_customers":3,"subledger":320},"check":"control 2","expected":{"control":320,"credit_balances":["crux"],"difference":0,"open_customers":3,"subledger":320},"passed":true},{"actual":{"control":20,"credit_balances":[],"difference":0,"open_customers":1,"subledger":20},"check":"control 3","expected":{"control":20,"credit_balances":[],"difference":0,"open_customers":1,"subledger":20},"passed":true},{"actual":{"control":100,"credit_balances":[],"difference":0,"open_customers":1,"subledger":100},"check":"control 4","expected":{"control":100,"credit_balances":[],"difference":0,"open_customers":1,"subledger":100},"passed":true},{"actual":{"control":400,"credit_balances":[],"difference":0,"open_customers":1,"subledger":400},"check":"control 5","expected":{"control":400,"credit_balances":[],"difference":0,"open_customers":1,"subledger":400},"passed":true},{"actual":{"control":820,"credit_balances":[],"difference":-570,"open_customers":1,"subledger":250},"check":"sample 6","expected":{"control":820,"credit_balances":[],"difference":570,"open_customers":1,"subledger":250},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: difference orientation\", \"actual\": {\"control\": 20, \"subledger\": 1340, \"difference\": 1320, \"credit_balances\": [], \"open_customers\": 3}, \"expected\": {\"control\": 20, \"subledger\": 1340, \"difference\": -1320, \"credit_balances\": [], \"open_customers\": 3}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"control\": 500, \"subledger\": 500, \"difference\": 0, \"credit_balances\": [\"bolt\"], \"open_customers\": 3}, \"expected\": {\"control\": 500, \"subledger\": 500, \"difference\": 0, \"credit_balances\": [\"bolt\"], \"open_customers\": 3}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"control\": 320, \"subledger\": 320, \"difference\": 0, \"credit_balances\": [\"crux\"], \"open_customers\": 3}, \"expected\": {\"control\": 320, \"subledger\": 320, \"difference\": 0, \"credit_balances\": [\"crux\"], \"open_customers\": 3}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"control\": 20, \"subledger\": 20, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"expected\": {\"control\": 20, \"subledger\": 20, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"control\": 100, \"subledger\": 100, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"expected\": {\"control\": 100, \"subledger\": 100, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"control\": 400, \"subledger\": 400, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"expected\": {\"control\": 400, \"subledger\": 400, \"difference\": 0, \"credit_balances\": [], \"open_customers\": 1}, \"passed\": true}, {\"check\": \"sample 6\", \"actual\": {\"control\": 820, \"subledger\": 250, \"difference\": -570, \"credit_balances\": [], \"open_customers\": 1}, \"expected\": {\"control\": 820, \"subledger\": 250, \"difference\": 570, \"credit_balances\": [], \"open_customers\": 1}, \"passed\": false}], \"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."}}