{"abstract":"Adding multiple descriptive tags inflates the subtotal by repeating each invoice line in a join product.","category":"Storage and queries","checks":7,"contract":"Given one invoice's integer line amounts and descriptive tag strings, return [sum_of_all_lines, sorted_unique_tags]. Each line occurrence contributes once, even equal-priced lines. Missing tags do not remove an invoice or its revenue.","evaluation_group":"model-1f1b24088575b368","failed_approach":"SUM(DISTINCT amount) hides some fanout but collapses separate invoice lines that happen to cost the same amount.","family":"store-join-fanout-aggregate","id":"FA-121","implementations":{"attempt":{"sha256":"ce4e1c3cac61416effd8ccbb0766e5e160713201bfdd1b12c6e90c173c3acaa1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(lines, tags):\n    return [sum(set(lines)), sorted(set(tags))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two lines crossed with multiple tags', solve([N, N+1], ['red', 'blue']), [2*N+1, ['blue', 'red']])\ncheck('equal-priced lines are distinct facts', solve([N] * (N+1), ['one']), [N*(N+1), ['one']])\ncheck('untagged invoice remains in the result', solve([N, N+2], []), [2*N+2, []])\ncheck('duplicate tag rows do not multiply revenue', solve([N], ['a', 'a', 'b']), [N, ['a', 'b']])\ncheck('empty invoice preserves descriptive tags', solve([], ['b', 'a']), [0, ['a', 'b']])\ncheck('credit and charge lines remain separate', solve([N, -N, N], ['credit']), [N, ['credit']])\ncheck('no lines or tags', solve([], []), [0, []])\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":"a7cfb36e88987c1015c975830a9bc10e4d86a2c8b1fa858fc37019df460ba4f1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(lines, tags):\n    return [sum(amount for amount in lines for tag in tags), sorted(set(tags))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two lines crossed with multiple tags', solve([N, N+1], ['red', 'blue']), [2*N+1, ['blue', 'red']])\ncheck('equal-priced lines are distinct facts', solve([N] * (N+1), ['one']), [N*(N+1), ['one']])\ncheck('untagged invoice remains in the result', solve([N, N+2], []), [2*N+2, []])\ncheck('duplicate tag rows do not multiply revenue', solve([N], ['a', 'a', 'b']), [N, ['a', 'b']])\ncheck('empty invoice preserves descriptive tags', solve([], ['b', 'a']), [0, ['a', 'b']])\ncheck('credit and charge lines remain separate', solve([N, -N, N], ['credit']), [N, ['credit']])\ncheck('no lines or tags', solve([], []), [0, []])\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"},"fixed":{"sha256":"f3f8b7e0dd4b44e3deab12b1a243e138b36feb910055421cc77b45a844136994","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(lines, tags):\n    return [sum(lines), sorted(set(tags))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two lines crossed with multiple tags', solve([N, N+1], ['red', 'blue']), [2*N+1, ['blue', 'red']])\ncheck('equal-priced lines are distinct facts', solve([N] * (N+1), ['one']), [N*(N+1), ['one']])\ncheck('untagged invoice remains in the result', solve([N, N+2], []), [2*N+2, []])\ncheck('duplicate tag rows do not multiply revenue', solve([N], ['a', 'a', 'b']), [N, ['a', 'b']])\ncheck('empty invoice preserves descriptive tags', solve([], ['b', 'a']), [0, ['a', 'b']])\ncheck('credit and charge lines remain separate', solve([N, -N, N], ['credit']), [N, ['credit']])\ncheck('no lines or tags', solve([], []), [0, []])\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":" 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":"store-join-fanout-aggregate","generated_at":"2026-09-29T14:36:50.502890+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Models a many-to-many query fanout and grain mismatch, a frequent analytical-query error. It makes the relational cardinality explicit without claiming to reproduce a full billing database.","repair":"Aggregate line amounts before combining them with independently deduplicated descriptive tags.","root_cause":"The aggregate is calculated at the joined line-by-tag grain rather than at the invoice-line grain.","sha256":"5b417389a4b4e12020181b8ba141286238a2346fdd9113508bd76ff3bfbc7fe1","title":"A descriptive join multiplies an invoice subtotal · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":35.456,"exit_code":1,"observations":[{"actual":[3,["blue","red"]],"check":"two lines crossed with multiple tags","expected":[3,["blue","red"]],"passed":true},{"actual":[1,["one"]],"check":"equal-priced lines are distinct facts","expected":[2,["one"]],"passed":false},{"actual":[4,[]],"check":"untagged invoice remains in the result","expected":[4,[]],"passed":true},{"actual":[1,["a","b"]],"check":"duplicate tag rows do not multiply revenue","expected":[1,["a","b"]],"passed":true},{"actual":[0,["a","b"]],"check":"empty invoice preserves descriptive tags","expected":[0,["a","b"]],"passed":true},{"actual":[0,["credit"]],"check":"credit and charge lines remain separate","expected":[1,["credit"]],"passed":false},{"actual":[0,[]],"check":"no lines or tags","expected":[0,[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two lines crossed with multiple tags\", \"actual\": [3, [\"blue\", \"red\"]], \"expected\": [3, [\"blue\", \"red\"]], \"passed\": true}, {\"check\": \"equal-priced lines are distinct facts\", \"actual\": [1, [\"one\"]], \"expected\": [2, [\"one\"]], \"passed\": false}, {\"check\": \"untagged invoice remains in the result\", \"actual\": [4, []], \"expected\": [4, []], \"passed\": true}, {\"check\": \"duplicate tag rows do not multiply revenue\", \"actual\": [1, [\"a\", \"b\"]], \"expected\": [1, [\"a\", \"b\"]], \"passed\": true}, {\"check\": \"empty invoice preserves descriptive tags\", \"actual\": [0, [\"a\", \"b\"]], \"expected\": [0, [\"a\", \"b\"]], \"passed\": true}, {\"check\": \"credit and charge lines remain separate\", \"actual\": [0, [\"credit\"]], \"expected\": [1, [\"credit\"]], \"passed\": false}, {\"check\": \"no lines or tags\", \"actual\": [0, []], \"expected\": [0, []], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":36.222,"exit_code":1,"observations":[{"actual":[6,["blue","red"]],"check":"two lines crossed with multiple tags","expected":[3,["blue","red"]],"passed":false},{"actual":[2,["one"]],"check":"equal-priced lines are distinct facts","expected":[2,["one"]],"passed":true},{"actual":[0,[]],"check":"untagged invoice remains in the result","expected":[4,[]],"passed":false},{"actual":[3,["a","b"]],"check":"duplicate tag rows do not multiply revenue","expected":[1,["a","b"]],"passed":false},{"actual":[0,["a","b"]],"check":"empty invoice preserves descriptive tags","expected":[0,["a","b"]],"passed":true},{"actual":[1,["credit"]],"check":"credit and charge lines remain separate","expected":[1,["credit"]],"passed":true},{"actual":[0,[]],"check":"no lines or tags","expected":[0,[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two lines crossed with multiple tags\", \"actual\": [6, [\"blue\", \"red\"]], \"expected\": [3, [\"blue\", \"red\"]], \"passed\": false}, {\"check\": \"equal-priced lines are distinct facts\", \"actual\": [2, [\"one\"]], \"expected\": [2, [\"one\"]], \"passed\": true}, {\"check\": \"untagged invoice remains in the result\", \"actual\": [0, []], \"expected\": [4, []], \"passed\": false}, {\"check\": \"duplicate tag rows do not multiply revenue\", \"actual\": [3, [\"a\", \"b\"]], \"expected\": [1, [\"a\", \"b\"]], \"passed\": false}, {\"check\": \"empty invoice preserves descriptive tags\", \"actual\": [0, [\"a\", \"b\"]], \"expected\": [0, [\"a\", \"b\"]], \"passed\": true}, {\"check\": \"credit and charge lines remain separate\", \"actual\": [1, [\"credit\"]], \"expected\": [1, [\"credit\"]], \"passed\": true}, {\"check\": \"no lines or tags\", \"actual\": [0, []], \"expected\": [0, []], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":64.773,"exit_code":0,"observations":[{"actual":[3,["blue","red"]],"check":"two lines crossed with multiple tags","expected":[3,["blue","red"]],"passed":true},{"actual":[2,["one"]],"check":"equal-priced lines are distinct facts","expected":[2,["one"]],"passed":true},{"actual":[4,[]],"check":"untagged invoice remains in the result","expected":[4,[]],"passed":true},{"actual":[1,["a","b"]],"check":"duplicate tag rows do not multiply revenue","expected":[1,["a","b"]],"passed":true},{"actual":[0,["a","b"]],"check":"empty invoice preserves descriptive tags","expected":[0,["a","b"]],"passed":true},{"actual":[1,["credit"]],"check":"credit and charge lines remain separate","expected":[1,["credit"]],"passed":true},{"actual":[0,[]],"check":"no lines or tags","expected":[0,[]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two lines crossed with multiple tags\", \"actual\": [3, [\"blue\", \"red\"]], \"expected\": [3, [\"blue\", \"red\"]], \"passed\": true}, {\"check\": \"equal-priced lines are distinct facts\", \"actual\": [2, [\"one\"]], \"expected\": [2, [\"one\"]], \"passed\": true}, {\"check\": \"untagged invoice remains in the result\", \"actual\": [4, []], \"expected\": [4, []], \"passed\": true}, {\"check\": \"duplicate tag rows do not multiply revenue\", \"actual\": [1, [\"a\", \"b\"]], \"expected\": [1, [\"a\", \"b\"]], \"passed\": true}, {\"check\": \"empty invoice preserves descriptive tags\", \"actual\": [0, [\"a\", \"b\"]], \"expected\": [0, [\"a\", \"b\"]], \"passed\": true}, {\"check\": \"credit and charge lines remain separate\", \"actual\": [1, [\"credit\"]], \"expected\": [1, [\"credit\"]], \"passed\": true}, {\"check\": \"no lines or tags\", \"actual\": [0, []], \"expected\": [0, []], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}