{"abstract":"The reduction disagrees with its explicit aggregation oracle.","category":"Numerical aggregation","checks":8,"contract":"Events set a right-continuous integer-timestamp level; later-listed events win timestamp ties. Initial level before any event is zero. Return exact average over [start,end), including level carried from earlier history, or None if interval has no duration.","evaluation_group":"s3-na-time-weighted-step-level","failed_approach":"Dropping the first segment loses exposure before the first interior change.","family":"s3-numerical-aggregation-time-weighted-step-level-step-terminal-span","id":"FA-13646","implementations":{"attempt":{"sha256":"70c0a79c8e1483d5ccf4432b02f82f35c79b91e242559b1e5d124dee760ae8b5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nfrom collections import Counter, defaultdict\nimport math\nimport itertools\nN = 1\nobservations = []\ndef solve(events, start, end):\n    if end<=start: return None\n    changes={}\n    for t,value in events:\n        changes[t]=value\n    points=sorted(set([start,end]+[t for t in changes if start<t<end]))\n    area=0\n    for left,right in zip(points[1:],points[2:]):\n        earlier=[t for t in changes if t<=left]\n        value=changes[max(earlier)] if earlier else 0\n        area+=value*(right-left)\n    return str(Fraction(area,end-start))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('regression 1', solve(*([(0, 2), (3, 8)], 1, 5)), '5')\ncheck('regression 2', solve(*([], 0, 4)), '0')\ncheck('regression 3', solve(*([(3, 5)], 0, 5)), '2')\ncheck('regression 4', solve(*([(0, 4), (0, 7), (4, 9)], 0, 4)), '7')\ncheck('regression 5', solve(*([(2, -3), (-2, 8), (5, 1)], 0, 7)), '9/7')\ncheck('regression 6', solve(*([(0, 2)], 3, 3)), None)\ncheck('regression 7', solve(*([(0, 1), (1, 10), (2, 2)], 0, 5)), '17/5')\ncheck(\"variable duration weighting\",solve([(0,0),(N,6)],0,N+2),str(Fraction(12,N+2)))\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":"65c2a0ac62afe0791a081d27cb1597bbbb6ec35fd8bda0eba34c623fd88cbee3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nfrom collections import Counter, defaultdict\nimport math\nimport itertools\nN = 1\nobservations = []\ndef solve(events, start, end):\n    if end<=start: return None\n    changes={}\n    for t,value in events:\n        changes[t]=value\n    points=sorted(set([start,end]+[t for t in changes if start<t<end]))\n    area=0\n    for left,right in zip(points[:-1],points[1:-1]):\n        earlier=[t for t in changes if t<=left]\n        value=changes[max(earlier)] if earlier else 0\n        area+=value*(right-left)\n    return str(Fraction(area,end-start))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('regression 1', solve(*([(0, 2), (3, 8)], 1, 5)), '5')\ncheck('regression 2', solve(*([], 0, 4)), '0')\ncheck('regression 3', solve(*([(3, 5)], 0, 5)), '2')\ncheck('regression 4', solve(*([(0, 4), (0, 7), (4, 9)], 0, 4)), '7')\ncheck('regression 5', solve(*([(2, -3), (-2, 8), (5, 1)], 0, 7)), '9/7')\ncheck('regression 6', solve(*([(0, 2)], 3, 3)), None)\ncheck('regression 7', solve(*([(0, 1), (1, 10), (2, 2)], 0, 5)), '17/5')\ncheck(\"variable duration weighting\",solve([(0,0),(N,6)],0,N+2),str(Fraction(12,N+2)))\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":"ec56b09168128a2cff596d10d65fb53579b28d586988114cb3e4e6f00788e2c7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nfrom collections import Counter, defaultdict\nimport math\nimport itertools\nN = 1\nobservations = []\ndef solve(events, start, end):\n    if end<=start: return None\n    changes={}\n    for t,value in events:\n        changes[t]=value\n    points=sorted(set([start,end]+[t for t in changes if start<t<end]))\n    area=0\n    for left,right in zip(points,points[1:]):\n        earlier=[t for t in changes if t<=left]\n        value=changes[max(earlier)] if earlier else 0\n        area+=value*(right-left)\n    return str(Fraction(area,end-start))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('regression 1', solve(*([(0, 2), (3, 8)], 1, 5)), '5')\ncheck('regression 2', solve(*([], 0, 4)), '0')\ncheck('regression 3', solve(*([(3, 5)], 0, 5)), '2')\ncheck('regression 4', solve(*([(0, 4), (0, 7), (4, 9)], 0, 4)), '7')\ncheck('regression 5', solve(*([(2, -3), (-2, 8), (5, 1)], 0, 7)), '9/7')\ncheck('regression 6', solve(*([(0, 2)], 3, 3)), None)\ncheck('regression 7', solve(*([(0, 1), (1, 10), (2, 2)], 0, 5)), '17/5')\ncheck(\"variable duration weighting\",solve([(0,0),(N,6)],0,N+2),str(Fraction(12,N+2)))\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":"Small offline integer/rational inputs only; no performance, statistical inference, or production-library conformance claim. 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":"s3-numerical-aggregation-time-weighted-step-level-step-terminal-span","generated_at":"2026-09-29T14:39:09.093009+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Exact bounded examples isolate a reduction defect without floating-point or external-service effects.","repair":"Preserve the time weighted step level contract at the identified reduction decision.","root_cause":"The final carried segment after the last change is omitted.","sha256":"9b209e61820f1e20547fc3fdfeb0c1f28a23d67210b4565ef9da04ee7c287b92","title":"Time weighted step level: The final carried segment after the last change is omitted. · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.798,"exit_code":1,"observations":[{"actual":"4","check":"regression 1","expected":"5","passed":false},{"actual":"0","check":"regression 2","expected":"0","passed":true},{"actual":"2","check":"regression 3","expected":"2","passed":true},{"actual":"0","check":"regression 4","expected":"7","passed":false},{"actual":"-1","check":"regression 5","expected":"9/7","passed":false},{"actual":null,"check":"regression 6","expected":null,"passed":true},{"actual":"16/5","check":"regression 7","expected":"17/5","passed":false},{"actual":"4","check":"variable duration weighting","expected":"4","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 1\", \"actual\": \"4\", \"expected\": \"5\", \"passed\": false}, {\"check\": \"regression 2\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"regression 3\", \"actual\": \"2\", \"expected\": \"2\", \"passed\": true}, {\"check\": \"regression 4\", \"actual\": \"0\", \"expected\": \"7\", \"passed\": false}, {\"check\": \"regression 5\", \"actual\": \"-1\", \"expected\": \"9/7\", \"passed\": false}, {\"check\": \"regression 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"regression 7\", \"actual\": \"16/5\", \"expected\": \"17/5\", \"passed\": false}, {\"check\": \"variable duration weighting\", \"actual\": \"4\", \"expected\": \"4\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.769,"exit_code":1,"observations":[{"actual":"1","check":"regression 1","expected":"5","passed":false},{"actual":"0","check":"regression 2","expected":"0","passed":true},{"actual":"0","check":"regression 3","expected":"2","passed":false},{"actual":"0","check":"regression 4","expected":"7","passed":false},{"actual":"1","check":"regression 5","expected":"9/7","passed":false},{"actual":null,"check":"regression 6","expected":null,"passed":true},{"actual":"11/5","check":"regression 7","expected":"17/5","passed":false},{"actual":"0","check":"variable duration weighting","expected":"4","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 1\", \"actual\": \"1\", \"expected\": \"5\", \"passed\": false}, {\"check\": \"regression 2\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"regression 3\", \"actual\": \"0\", \"expected\": \"2\", \"passed\": false}, {\"check\": \"regression 4\", \"actual\": \"0\", \"expected\": \"7\", \"passed\": false}, {\"check\": \"regression 5\", \"actual\": \"1\", \"expected\": \"9/7\", \"passed\": false}, {\"check\": \"regression 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"regression 7\", \"actual\": \"11/5\", \"expected\": \"17/5\", \"passed\": false}, {\"check\": \"variable duration weighting\", \"actual\": \"0\", \"expected\": \"4\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.687,"exit_code":0,"observations":[{"actual":"5","check":"regression 1","expected":"5","passed":true},{"actual":"0","check":"regression 2","expected":"0","passed":true},{"actual":"2","check":"regression 3","expected":"2","passed":true},{"actual":"7","check":"regression 4","expected":"7","passed":true},{"actual":"9/7","check":"regression 5","expected":"9/7","passed":true},{"actual":null,"check":"regression 6","expected":null,"passed":true},{"actual":"17/5","check":"regression 7","expected":"17/5","passed":true},{"actual":"4","check":"variable duration weighting","expected":"4","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 1\", \"actual\": \"5\", \"expected\": \"5\", \"passed\": true}, {\"check\": \"regression 2\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"regression 3\", \"actual\": \"2\", \"expected\": \"2\", \"passed\": true}, {\"check\": \"regression 4\", \"actual\": \"7\", \"expected\": \"7\", \"passed\": true}, {\"check\": \"regression 5\", \"actual\": \"9/7\", \"expected\": \"9/7\", \"passed\": true}, {\"check\": \"regression 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"regression 7\", \"actual\": \"17/5\", \"expected\": \"17/5\", \"passed\": true}, {\"check\": \"variable duration weighting\", \"actual\": \"4\", \"expected\": \"4\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}