{"abstract":"The last stage never fills and nobody reaches R through it.","category":"Epidemic compartment models","checks":7,"contract":"Infectious period split into k sequential stages each left at rate k*gamma; seeds start in stage 1; all stages transmit; Euler with dt=0.1 (10 substeps/day); return [total I at day ends including day 0 rounded 3, R rounded 3], None for k<1.","contract_signature":"beta, gamma, k, pop, i0, days","evaluation_group":"w2-epidemic-erlang-stages","failed_approach":"Starting at stage 3 skips the second stage.","family":"w2-epidemic-erlang-stages-interior-stage-chain","id":"FA-65226","implementations":{"attempt":{"sha256":"6dc9cb43098c007c61d22bcb61643673dff8f361c4ead0f0f8610bd8c1b529de","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, k, pop, i0, days):\n    if k < 1:\n        return None\n    stages = [0.0] * k\n    stages[0] = float(i0)\n    s = float(pop - i0)\n    r = 0.0\n    dt = 0.1\n    series = [round(sum(stages), 3)]\n    for _ in range(days):\n        for _ in range(10):\n            i = sum(stages)\n            inf = beta * s * i / pop * dt\n            flows = [k * gamma * x * dt for x in stages]\n            s -= inf\n            stages[0] += inf - flows[0]\n            for j in range(2, k):\n                stages[j] += flows[j - 1] - flows[j]\n            r += flows[-1]\n        series.append(round(sum(stages), 3))\n    return [series, round(r, 3)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: three stages',\n   (0.5, 0.2, 3, 1000, 10, 6),\n   [[10.0, 15.964, 24.203, 35.419, 50.774, 71.593, 99.086], 25.589]),\n  ('control: single stage equals SIR',\n   (0.4, 0.25, 1, 500, 5, 5),\n   [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032]),\n  ('regression: many stages', (0.6, 0.3, 5, 800, 20, 4), [[20.0, 34.937, 55.691, 80.709, 110.985], 33.142]),\n  ('regression: no transmission',\n   (0.0, 0.5, 2, 100, 10, 5),\n   [[10.0, 7.361, 3.917, 1.837, 0.805, 0.338], 9.662]),\n  ('control: invalid k', (0.5, 0.2, 0, 100, 5, 3), None),\n  ('regression: two stages slow',\n   (0.3, 0.1, 2, 2000, 30, 7),\n   [[30.0, 39.545, 50.929, 64.696, 81.433, 101.776, 126.384, 155.912], 30.058]),\n  ('control: boundary zero days', (0.5, 0.2, 3, 100, 5, 0), [[5.0], 0.0])],\n [('regression: three stages',\n   (0.5, 0.2, 3, 1000, 10, 6),\n   [[10.0, 15.964, 24.203, 35.419, 50.774, 71.593, 99.086], 25.589]),\n  ('control: single stage equals SIR',\n   (0.4, 0.25, 1, 500, 5, 5),\n   [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032]),\n  ('regression: no transmission',\n   (0.0, 0.5, 2, 100, 10, 5),\n   [[10.0, 7.361, 3.917, 1.837, 0.805, 0.338], 9.662]),\n  ('control: invalid k', (0.5, 0.2, 0, 100, 5, 3), None),\n  ('regression: two stages slow',\n   (0.3, 0.1, 2, 2000, 30, 7),\n   [[30.0, 39.545, 50.929, 64.696, 81.433, 101.776, 126.384, 155.912], 30.058]),\n  ('control: boundary zero days', (0.5, 0.2, 3, 100, 5, 0), [[5.0], 0.0]),\n  ('regression: four stages fast recovery',\n   (0.9, 0.5, 4, 300, 6, 5),\n   [[6.0, 12.89, 21.627, 33.085, 46.281, 57.492], 51.385])],\n [('regression: three stages',\n   (0.5, 0.2, 3, 1000, 10, 6),\n   [[10.0, 15.964, 24.203, 35.419, 50.774, 71.593, 99.086], 25.589]),\n  ('control: single stage equals SIR',\n   (0.4, 0.25, 1, 500, 5, 5),\n   [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032]),\n  ('regression: many stages', (0.6, 0.3, 5, 800, 20, 4), [[20.0, 34.937, 55.691, 80.709, 110.985], 33.142]),\n  ('regression: no transmission',\n   (0.0, 0.5, 2, 100, 10, 5),\n   [[10.0, 7.361, 3.917, 1.837, 0.805, 0.338], 9.662]),\n  ('control: invalid k', (0.5, 0.2, 0, 100, 5, 3), None),\n  ('control: boundary zero days', (0.5, 0.2, 3, 100, 5, 0), [[5.0], 0.0]),\n  ('regression: four stages fast recovery',\n   (0.9, 0.5, 4, 300, 6, 5),\n   [[6.0, 12.89, 21.627, 33.085, 46.281, 57.492], 51.385])],\n [('control: single stage equals SIR',\n   (0.4, 0.25, 1, 500, 5, 5),\n   [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032]),\n  ('regression: many stages', (0.6, 0.3, 5, 800, 20, 4), [[20.0, 34.937, 55.691, 80.709, 110.985], 33.142]),\n  ('regression: no transmission',\n   (0.0, 0.5, 2, 100, 10, 5),\n   [[10.0, 7.361, 3.917, 1.837, 0.805, 0.338], 9.662]),\n  ('control: invalid k', (0.5, 0.2, 0, 100, 5, 3), None),\n  ('regression: two stages slow',\n   (0.3, 0.1, 2, 2000, 30, 7),\n   [[30.0, 39.545, 50.929, 64.696, 81.433, 101.776, 126.384, 155.912], 30.058]),\n  ('control: boundary zero days', (0.5, 0.2, 3, 100, 5, 0), [[5.0], 0.0]),\n  ('regression: four stages fast recovery',\n   (0.9, 0.5, 4, 300, 6, 5),\n   [[6.0, 12.89, 21.627, 33.085, 46.281, 57.492], 51.385])],\n [('regression: three stages',\n   (0.5, 0.2, 3, 1000, 10, 6),\n   [[10.0, 15.964, 24.203, 35.419, 50.774, 71.593, 99.086], 25.589]),\n  ('control: single stage equals SIR',\n   (0.4, 0.25, 1, 500, 5, 5),\n   [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032]),\n  ('regression: many stages', (0.6, 0.3, 5, 800, 20, 4), [[20.0, 34.937, 55.691, 80.709, 110.985], 33.142]),\n  ('control: invalid k', (0.5, 0.2, 0, 100, 5, 3), None),\n  ('regression: two stages slow',\n   (0.3, 0.1, 2, 2000, 30, 7),\n   [[30.0, 39.545, 50.929, 64.696, 81.433, 101.776, 126.384, 155.912], 30.058]),\n  ('control: boundary zero days', (0.5, 0.2, 3, 100, 5, 0), [[5.0], 0.0]),\n  ('regression: four stages fast recovery',\n   (0.9, 0.5, 4, 300, 6, 5),\n   [[6.0, 12.89, 21.627, 33.085, 46.281, 57.492], 51.385])]]\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":"7d95588696505d0f85540f3e11bb850107f8e059d8f273ef64085e383407c976","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, k, pop, i0, days):\n    if k < 1:\n        return None\n    stages = [0.0] * k\n    stages[0] = float(i0)\n    s = float(pop - i0)\n    r = 0.0\n    dt = 0.1\n    series = [round(sum(stages), 3)]\n    for _ in range(days):\n        for _ in range(10):\n            i = sum(stages)\n            inf = beta * s * i / pop * dt\n            flows = [k * gamma * x * dt for x in stages]\n            s -= inf\n            stages[0] += inf - flows[0]\n            for j in range(1, k - 1):\n                stages[j] += flows[j - 1] - flows[j]\n            r += flows[-1]\n        series.append(round(sum(stages), 3))\n    return [series, round(r, 3)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: three stages',\n   (0.5, 0.2, 3, 1000, 10, 6),\n   [[10.0, 15.964, 24.203, 35.419, 50.774, 71.593, 99.086], 25.589]),\n  ('control: single stage equals SIR',\n   (0.4, 0.25, 1, 500, 5, 5),\n   [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032]),\n  ('regression: many stages', (0.6, 0.3, 5, 800, 20, 4), [[20.0, 34.937, 55.691, 80.709, 110.985], 33.142]),\n  ('regression: no transmission',\n   (0.0, 0.5, 2, 100, 10, 5),\n   [[10.0, 7.361, 3.917, 1.837, 0.805, 0.338], 9.662]),\n  ('control: invalid k', (0.5, 0.2, 0, 100, 5, 3), None),\n  ('regression: two stages slow',\n   (0.3, 0.1, 2, 2000, 30, 7),\n   [[30.0, 39.545, 50.929, 64.696, 81.433, 101.776, 126.384, 155.912], 30.058]),\n  ('control: boundary zero days', (0.5, 0.2, 3, 100, 5, 0), [[5.0], 0.0])],\n [('regression: three stages',\n   (0.5, 0.2, 3, 1000, 10, 6),\n   [[10.0, 15.964, 24.203, 35.419, 50.774, 71.593, 99.086], 25.589]),\n  ('control: single stage equals SIR',\n   (0.4, 0.25, 1, 500, 5, 5),\n   [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032]),\n  ('regression: no transmission',\n   (0.0, 0.5, 2, 100, 10, 5),\n   [[10.0, 7.361, 3.917, 1.837, 0.805, 0.338], 9.662]),\n  ('control: invalid k', (0.5, 0.2, 0, 100, 5, 3), None),\n  ('regression: two stages slow',\n   (0.3, 0.1, 2, 2000, 30, 7),\n   [[30.0, 39.545, 50.929, 64.696, 81.433, 101.776, 126.384, 155.912], 30.058]),\n  ('control: boundary zero days', (0.5, 0.2, 3, 100, 5, 0), [[5.0], 0.0]),\n  ('regression: four stages fast recovery',\n   (0.9, 0.5, 4, 300, 6, 5),\n   [[6.0, 12.89, 21.627, 33.085, 46.281, 57.492], 51.385])],\n [('regression: three stages',\n   (0.5, 0.2, 3, 1000, 10, 6),\n   [[10.0, 15.964, 24.203, 35.419, 50.774, 71.593, 99.086], 25.589]),\n  ('control: single stage equals SIR',\n   (0.4, 0.25, 1, 500, 5, 5),\n   [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032]),\n  ('regression: many stages', (0.6, 0.3, 5, 800, 20, 4), [[20.0, 34.937, 55.691, 80.709, 110.985], 33.142]),\n  ('regression: no transmission',\n   (0.0, 0.5, 2, 100, 10, 5),\n   [[10.0, 7.361, 3.917, 1.837, 0.805, 0.338], 9.662]),\n  ('control: invalid k', (0.5, 0.2, 0, 100, 5, 3), None),\n  ('control: boundary zero days', (0.5, 0.2, 3, 100, 5, 0), [[5.0], 0.0]),\n  ('regression: four stages fast recovery',\n   (0.9, 0.5, 4, 300, 6, 5),\n   [[6.0, 12.89, 21.627, 33.085, 46.281, 57.492], 51.385])],\n [('control: single stage equals SIR',\n   (0.4, 0.25, 1, 500, 5, 5),\n   [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032]),\n  ('regression: many stages', (0.6, 0.3, 5, 800, 20, 4), [[20.0, 34.937, 55.691, 80.709, 110.985], 33.142]),\n  ('regression: no transmission',\n   (0.0, 0.5, 2, 100, 10, 5),\n   [[10.0, 7.361, 3.917, 1.837, 0.805, 0.338], 9.662]),\n  ('control: invalid k', (0.5, 0.2, 0, 100, 5, 3), None),\n  ('regression: two stages slow',\n   (0.3, 0.1, 2, 2000, 30, 7),\n   [[30.0, 39.545, 50.929, 64.696, 81.433, 101.776, 126.384, 155.912], 30.058]),\n  ('control: boundary zero days', (0.5, 0.2, 3, 100, 5, 0), [[5.0], 0.0]),\n  ('regression: four stages fast recovery',\n   (0.9, 0.5, 4, 300, 6, 5),\n   [[6.0, 12.89, 21.627, 33.085, 46.281, 57.492], 51.385])],\n [('regression: three stages',\n   (0.5, 0.2, 3, 1000, 10, 6),\n   [[10.0, 15.964, 24.203, 35.419, 50.774, 71.593, 99.086], 25.589]),\n  ('control: single stage equals SIR',\n   (0.4, 0.25, 1, 500, 5, 5),\n   [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032]),\n  ('regression: many stages', (0.6, 0.3, 5, 800, 20, 4), [[20.0, 34.937, 55.691, 80.709, 110.985], 33.142]),\n  ('control: invalid k', (0.5, 0.2, 0, 100, 5, 3), None),\n  ('regression: two stages slow',\n   (0.3, 0.1, 2, 2000, 30, 7),\n   [[30.0, 39.545, 50.929, 64.696, 81.433, 101.776, 126.384, 155.912], 30.058]),\n  ('control: boundary zero days', (0.5, 0.2, 3, 100, 5, 0), [[5.0], 0.0]),\n  ('regression: four stages fast recovery',\n   (0.9, 0.5, 4, 300, 6, 5),\n   [[6.0, 12.89, 21.627, 33.085, 46.281, 57.492], 51.385])]]\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":"Deterministic bounded teaching model with a stipulated contract; not a validated scientific or public-health modelling library. 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-epidemic-erlang-stages-interior-stage-chain","generated_at":"2026-09-29T14:47:32.028923+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Compartmental epidemic calculations drive outbreak forecasts, vaccine targets and hospital planning; a single wrong flow, rate conversion or boundary silently changes every downstream number.","root_cause":"The stage loop stops before the final stage.","sha256":"999380aadef78549d291e632ec2d6c0c92dce86c9290c28d0e539835a1749830","title":"SIR with Erlang-distributed infectious period: interior stage chain · 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":41.587,"exit_code":1,"observations":[{"actual":[[10.0,8.988,8.061,7.214,6.445,5.749,5.12],0.0],"check":"regression: three stages","expected":[[10.0,15.964,24.203,35.419,50.774,71.593,99.086],25.589],"passed":false},{"actual":[[5.0,5.776,6.66,7.664,8.798,10.074],9.032],"check":"control: single stage equals SIR","expected":[[5.0,5.776,6.66,7.664,8.798,10.074],9.032],"passed":true},{"actual":[[20.0,7.635,2.902,1.101,0.418],0.0],"check":"regression: many stages","expected":[[20.0,34.937,55.691,80.709,110.985],33.142],"passed":false},{"actual":[[10.0,3.487,1.216,0.424,0.148,0.052],0.0],"check":"regression: no transmission","expected":[[10.0,7.361,3.917,1.837,0.805,0.338],9.662],"passed":false},{"actual":null,"check":"control: invalid k","expected":null,"passed":true},{"actual":[[30.0,32.971,36.185,39.65,43.373,47.358,51.606,56.112],0.0],"check":"regression: two stages slow","expected":[[30.0,39.545,50.929,64.696,81.433,101.776,126.384,155.912],30.058],"passed":false},{"actual":[[5.0],0.0],"check":"control: boundary zero days","expected":[[5.0],0.0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: three stages\", \"actual\": [[10.0, 8.988, 8.061, 7.214, 6.445, 5.749, 5.12], 0.0], \"expected\": [[10.0, 15.964, 24.203, 35.419, 50.774, 71.593, 99.086], 25.589], \"passed\": false}, {\"check\": \"control: single stage equals SIR\", \"actual\": [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032], \"expected\": [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032], \"passed\": true}, {\"check\": \"regression: many stages\", \"actual\": [[20.0, 7.635, 2.902, 1.101, 0.418], 0.0], \"expected\": [[20.0, 34.937, 55.691, 80.709, 110.985], 33.142], \"passed\": false}, {\"check\": \"regression: no transmission\", \"actual\": [[10.0, 3.487, 1.216, 0.424, 0.148, 0.052], 0.0], \"expected\": [[10.0, 7.361, 3.917, 1.837, 0.805, 0.338], 9.662], \"passed\": false}, {\"check\": \"control: invalid k\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"regression: two stages slow\", \"actual\": [[30.0, 32.971, 36.185, 39.65, 43.373, 47.358, 51.606, 56.112], 0.0], \"expected\": [[30.0, 39.545, 50.929, 64.696, 81.433, 101.776, 126.384, 155.912], 30.058], \"passed\": false}, {\"check\": \"control: boundary zero days\", \"actual\": [[5.0], 0.0], \"expected\": [[5.0], 0.0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.582,"exit_code":1,"observations":[{"actual":[[10.0,14.62,19.24,24.537,30.857,38.401,47.273],0.0],"check":"regression: three stages","expected":[[10.0,15.964,24.203,35.419,50.774,71.593,99.086],25.589],"passed":false},{"actual":[[5.0,5.776,6.66,7.664,8.798,10.074],9.032],"check":"control: single stage equals SIR","expected":[[5.0,5.776,6.66,7.664,8.798,10.074],9.032],"passed":true},{"actual":[[20.0,33.968,48.44,63.09,79.007],0.0],"check":"regression: many stages","expected":[[20.0,34.937,55.691,80.709,110.985],33.142],"passed":false},{"actual":[[10.0,3.487,1.216,0.424,0.148,0.052],0.0],"check":"regression: no transmission","expected":[[10.0,7.361,3.917,1.837,0.805,0.338],9.662],"passed":false},{"actual":null,"check":"control: invalid k","expected":null,"passed":true},{"actual":[[30.0,32.971,36.185,39.65,43.373,47.358,51.606,56.112],0.0],"check":"regression: two stages slow","expected":[[30.0,39.545,50.929,64.696,81.433,101.776,126.384,155.912],30.058],"passed":false},{"actual":[[5.0],0.0],"check":"control: boundary zero days","expected":[[5.0],0.0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: three stages\", \"actual\": [[10.0, 14.62, 19.24, 24.537, 30.857, 38.401, 47.273], 0.0], \"expected\": [[10.0, 15.964, 24.203, 35.419, 50.774, 71.593, 99.086], 25.589], \"passed\": false}, {\"check\": \"control: single stage equals SIR\", \"actual\": [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032], \"expected\": [[5.0, 5.776, 6.66, 7.664, 8.798, 10.074], 9.032], \"passed\": true}, {\"check\": \"regression: many stages\", \"actual\": [[20.0, 33.968, 48.44, 63.09, 79.007], 0.0], \"expected\": [[20.0, 34.937, 55.691, 80.709, 110.985], 33.142], \"passed\": false}, {\"check\": \"regression: no transmission\", \"actual\": [[10.0, 3.487, 1.216, 0.424, 0.148, 0.052], 0.0], \"expected\": [[10.0, 7.361, 3.917, 1.837, 0.805, 0.338], 9.662], \"passed\": false}, {\"check\": \"control: invalid k\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"regression: two stages slow\", \"actual\": [[30.0, 32.971, 36.185, 39.65, 43.373, 47.358, 51.606, 56.112], 0.0], \"expected\": [[30.0, 39.545, 50.929, 64.696, 81.433, 101.776, 126.384, 155.912], 30.058], \"passed\": false}, {\"check\": \"control: boundary zero days\", \"actual\": [[5.0], 0.0], \"expected\": [[5.0], 0.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."}}