{"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":"A last observed value cannot supply a duration average over an empty interval.","family":"s3-numerical-aggregation-time-weighted-step-level-step-empty-duration","id":"FA-13656","implementations":{"attempt":{"sha256":"a69567c1603df100cd2ceb0919fef64bc1b49694e9653d9baee24d56e0b29915","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 str(events[-1][1]) if events else \"0\"\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"},"broken":{"sha256":"b71273d428695df96b5ee09c60918abf77132367793b16c7601b2dccad24b0db","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 \"0\"\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"},"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-empty-duration","generated_at":"2026-09-29T14:39:09.309910+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":"An empty interval is reported as zero measured level.","sha256":"1e657643383ebc2b6b665045b350702e63b67772a9fd99eb826e2659cc33d96b","title":"Time weighted step level: An empty interval is reported as zero measured level. · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":46.971,"exit_code":1,"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":"2","check":"regression 6","expected":null,"passed":false},{"actual":"17/5","check":"regression 7","expected":"17/5","passed":true},{"actual":"4","check":"variable duration weighting","expected":"4","passed":true}],"passed":false,"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\": \"2\", \"expected\": null, \"passed\": false}, {\"check\": \"regression 7\", \"actual\": \"17/5\", \"expected\": \"17/5\", \"passed\": true}, {\"check\": \"variable duration weighting\", \"actual\": \"4\", \"expected\": \"4\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.128,"exit_code":1,"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":"0","check":"regression 6","expected":null,"passed":false},{"actual":"17/5","check":"regression 7","expected":"17/5","passed":true},{"actual":"4","check":"variable duration weighting","expected":"4","passed":true}],"passed":false,"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\": \"0\", \"expected\": null, \"passed\": false}, {\"check\": \"regression 7\", \"actual\": \"17/5\", \"expected\": \"17/5\", \"passed\": true}, {\"check\": \"variable duration weighting\", \"actual\": \"4\", \"expected\": \"4\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.53,"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"}