{"abstract":"People recovering today already lose immunity in the same step.","category":"Epidemic compartment models","checks":7,"contract":"Daily forward-Euler SIRS; waning flow is R/immunity_days back to S (immunity_days 0 means permanent immunity); cumulative incidence sums every S->I flow including reinfections; return [S, I, R, cumulative incidence] rounded to 3.","contract_signature":"beta, gamma, immunity_days, pop, i0, days","evaluation_group":"w2-epidemic-sirs-waning","failed_approach":"Frequency-scaling the waning flow by S/pop has no basis in a per-capita loss rate.","family":"w2-epidemic-sirs-waning-waning-source","id":"FA-64966","implementations":{"attempt":{"sha256":"a46da19fb18b106162a17a8d03869a51e1c221fb45b2237152474052758a6ab7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, immunity_days, pop, i0, days):\n    s, i, r = float(pop - i0), float(i0), 0.0\n    cumulative = 0.0\n    for _ in range(days):\n        inf = beta * s * i / pop\n        rec = gamma * i\n        wane = r * s / pop / immunity_days if immunity_days > 0 else 0.0\n        s += wane - inf\n        i += inf - rec\n        r += rec - wane\n        cumulative += inf\n    return [round(s, 3), round(i, 3), round(r, 3), round(cumulative, 3)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: seasonal coronavirus', (0.4, 0.2, 30, 1000, 5, 80), [543.377, 58.225, 398.398, 1339.789]),\n  ('control: permanent immunity sentinel', (0.5, 0.2, 0, 500, 5, 40), [48.675, 7.802, 443.523, 446.325]),\n  ('regression: short immunity endemic', (0.6, 0.25, 10, 800, 8, 100), [333.272, 133.331, 333.396, 3385.33]),\n  ('control: boundary zero days', (0.4, 0.2, 30, 100, 5, 0), [95.0, 5.0, 0.0, 0.0]),\n  ('regression: no transmission waning only', (0.0, 0.3, 5, 100, 50, 20), [98.35, 0.04, 1.61, 0.0]),\n  ('regression: long immunity single wave',\n   (0.5, 0.1, 365, 2000, 10, 120),\n   [376.102, 3.345, 1620.554, 2084.424]),\n  ('regression: one day immunity', (0.5, 0.3, 1, 300, 3, 30), [188.175, 86.35, 25.475, 420.744])],\n [('regression: seasonal coronavirus', (0.4, 0.2, 30, 1000, 5, 80), [543.377, 58.225, 398.398, 1339.789]),\n  ('control: permanent immunity sentinel', (0.5, 0.2, 0, 500, 5, 40), [48.675, 7.802, 443.523, 446.325]),\n  ('control: boundary zero days', (0.4, 0.2, 30, 100, 5, 0), [95.0, 5.0, 0.0, 0.0]),\n  ('regression: no transmission waning only', (0.0, 0.3, 5, 100, 50, 20), [98.35, 0.04, 1.61, 0.0]),\n  ('regression: long immunity single wave',\n   (0.5, 0.1, 365, 2000, 10, 120),\n   [376.102, 3.345, 1620.554, 2084.424]),\n  ('regression: one day immunity', (0.5, 0.3, 1, 300, 3, 30), [188.175, 86.35, 25.475, 420.744]),\n  ('regression: two week run', (0.9, 0.3, 20, 400, 4, 14), [58.25, 94.786, 246.964, 386.248])],\n [('regression: seasonal coronavirus', (0.4, 0.2, 30, 1000, 5, 80), [543.377, 58.225, 398.398, 1339.789]),\n  ('control: permanent immunity sentinel', (0.5, 0.2, 0, 500, 5, 40), [48.675, 7.802, 443.523, 446.325]),\n  ('regression: short immunity endemic', (0.6, 0.25, 10, 800, 8, 100), [333.272, 133.331, 333.396, 3385.33]),\n  ('control: boundary zero days', (0.4, 0.2, 30, 100, 5, 0), [95.0, 5.0, 0.0, 0.0]),\n  ('regression: no transmission waning only', (0.0, 0.3, 5, 100, 50, 20), [98.35, 0.04, 1.61, 0.0]),\n  ('regression: one day immunity', (0.5, 0.3, 1, 300, 3, 30), [188.175, 86.35, 25.475, 420.744]),\n  ('regression: two week run', (0.9, 0.3, 20, 400, 4, 14), [58.25, 94.786, 246.964, 386.248])],\n [('control: permanent immunity sentinel', (0.5, 0.2, 0, 500, 5, 40), [48.675, 7.802, 443.523, 446.325]),\n  ('regression: short immunity endemic', (0.6, 0.25, 10, 800, 8, 100), [333.272, 133.331, 333.396, 3385.33]),\n  ('control: boundary zero days', (0.4, 0.2, 30, 100, 5, 0), [95.0, 5.0, 0.0, 0.0]),\n  ('regression: no transmission waning only', (0.0, 0.3, 5, 100, 50, 20), [98.35, 0.04, 1.61, 0.0]),\n  ('regression: long immunity single wave',\n   (0.5, 0.1, 365, 2000, 10, 120),\n   [376.102, 3.345, 1620.554, 2084.424]),\n  ('regression: one day immunity', (0.5, 0.3, 1, 300, 3, 30), [188.175, 86.35, 25.475, 420.744]),\n  ('regression: two week run', (0.9, 0.3, 20, 400, 4, 14), [58.25, 94.786, 246.964, 386.248])],\n [('regression: seasonal coronavirus', (0.4, 0.2, 30, 1000, 5, 80), [543.377, 58.225, 398.398, 1339.789]),\n  ('control: permanent immunity sentinel', (0.5, 0.2, 0, 500, 5, 40), [48.675, 7.802, 443.523, 446.325]),\n  ('control: boundary zero days', (0.4, 0.2, 30, 100, 5, 0), [95.0, 5.0, 0.0, 0.0]),\n  ('regression: no transmission waning only', (0.0, 0.3, 5, 100, 50, 20), [98.35, 0.04, 1.61, 0.0]),\n  ('regression: long immunity single wave',\n   (0.5, 0.1, 365, 2000, 10, 120),\n   [376.102, 3.345, 1620.554, 2084.424]),\n  ('regression: one day immunity', (0.5, 0.3, 1, 300, 3, 30), [188.175, 86.35, 25.475, 420.744]),\n  ('regression: two week run', (0.9, 0.3, 20, 400, 4, 14), [58.25, 94.786, 246.964, 386.248])]]\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":"c365fbb29f4b39d09b5db285b8f4480950181595518c0b04cefc35b6d1b317e7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, immunity_days, pop, i0, days):\n    s, i, r = float(pop - i0), float(i0), 0.0\n    cumulative = 0.0\n    for _ in range(days):\n        inf = beta * s * i / pop\n        rec = gamma * i\n        wane = (r + rec) / immunity_days if immunity_days > 0 else 0.0\n        s += wane - inf\n        i += inf - rec\n        r += rec - wane\n        cumulative += inf\n    return [round(s, 3), round(i, 3), round(r, 3), round(cumulative, 3)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: seasonal coronavirus', (0.4, 0.2, 30, 1000, 5, 80), [543.377, 58.225, 398.398, 1339.789]),\n  ('control: permanent immunity sentinel', (0.5, 0.2, 0, 500, 5, 40), [48.675, 7.802, 443.523, 446.325]),\n  ('regression: short immunity endemic', (0.6, 0.25, 10, 800, 8, 100), [333.272, 133.331, 333.396, 3385.33]),\n  ('control: boundary zero days', (0.4, 0.2, 30, 100, 5, 0), [95.0, 5.0, 0.0, 0.0]),\n  ('regression: no transmission waning only', (0.0, 0.3, 5, 100, 50, 20), [98.35, 0.04, 1.61, 0.0]),\n  ('regression: long immunity single wave',\n   (0.5, 0.1, 365, 2000, 10, 120),\n   [376.102, 3.345, 1620.554, 2084.424]),\n  ('regression: one day immunity', (0.5, 0.3, 1, 300, 3, 30), [188.175, 86.35, 25.475, 420.744])],\n [('regression: seasonal coronavirus', (0.4, 0.2, 30, 1000, 5, 80), [543.377, 58.225, 398.398, 1339.789]),\n  ('control: permanent immunity sentinel', (0.5, 0.2, 0, 500, 5, 40), [48.675, 7.802, 443.523, 446.325]),\n  ('control: boundary zero days', (0.4, 0.2, 30, 100, 5, 0), [95.0, 5.0, 0.0, 0.0]),\n  ('regression: no transmission waning only', (0.0, 0.3, 5, 100, 50, 20), [98.35, 0.04, 1.61, 0.0]),\n  ('regression: long immunity single wave',\n   (0.5, 0.1, 365, 2000, 10, 120),\n   [376.102, 3.345, 1620.554, 2084.424]),\n  ('regression: one day immunity', (0.5, 0.3, 1, 300, 3, 30), [188.175, 86.35, 25.475, 420.744]),\n  ('regression: two week run', (0.9, 0.3, 20, 400, 4, 14), [58.25, 94.786, 246.964, 386.248])],\n [('regression: seasonal coronavirus', (0.4, 0.2, 30, 1000, 5, 80), [543.377, 58.225, 398.398, 1339.789]),\n  ('control: permanent immunity sentinel', (0.5, 0.2, 0, 500, 5, 40), [48.675, 7.802, 443.523, 446.325]),\n  ('regression: short immunity endemic', (0.6, 0.25, 10, 800, 8, 100), [333.272, 133.331, 333.396, 3385.33]),\n  ('control: boundary zero days', (0.4, 0.2, 30, 100, 5, 0), [95.0, 5.0, 0.0, 0.0]),\n  ('regression: no transmission waning only', (0.0, 0.3, 5, 100, 50, 20), [98.35, 0.04, 1.61, 0.0]),\n  ('regression: one day immunity', (0.5, 0.3, 1, 300, 3, 30), [188.175, 86.35, 25.475, 420.744]),\n  ('regression: two week run', (0.9, 0.3, 20, 400, 4, 14), [58.25, 94.786, 246.964, 386.248])],\n [('control: permanent immunity sentinel', (0.5, 0.2, 0, 500, 5, 40), [48.675, 7.802, 443.523, 446.325]),\n  ('regression: short immunity endemic', (0.6, 0.25, 10, 800, 8, 100), [333.272, 133.331, 333.396, 3385.33]),\n  ('control: boundary zero days', (0.4, 0.2, 30, 100, 5, 0), [95.0, 5.0, 0.0, 0.0]),\n  ('regression: no transmission waning only', (0.0, 0.3, 5, 100, 50, 20), [98.35, 0.04, 1.61, 0.0]),\n  ('regression: long immunity single wave',\n   (0.5, 0.1, 365, 2000, 10, 120),\n   [376.102, 3.345, 1620.554, 2084.424]),\n  ('regression: one day immunity', (0.5, 0.3, 1, 300, 3, 30), [188.175, 86.35, 25.475, 420.744]),\n  ('regression: two week run', (0.9, 0.3, 20, 400, 4, 14), [58.25, 94.786, 246.964, 386.248])],\n [('regression: seasonal coronavirus', (0.4, 0.2, 30, 1000, 5, 80), [543.377, 58.225, 398.398, 1339.789]),\n  ('control: permanent immunity sentinel', (0.5, 0.2, 0, 500, 5, 40), [48.675, 7.802, 443.523, 446.325]),\n  ('control: boundary zero days', (0.4, 0.2, 30, 100, 5, 0), [95.0, 5.0, 0.0, 0.0]),\n  ('regression: no transmission waning only', (0.0, 0.3, 5, 100, 50, 20), [98.35, 0.04, 1.61, 0.0]),\n  ('regression: long immunity single wave',\n   (0.5, 0.1, 365, 2000, 10, 120),\n   [376.102, 3.345, 1620.554, 2084.424]),\n  ('regression: one day immunity', (0.5, 0.3, 1, 300, 3, 30), [188.175, 86.35, 25.475, 420.744]),\n  ('regression: two week run', (0.9, 0.3, 20, 400, 4, 14), [58.25, 94.786, 246.964, 386.248])]]\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-sirs-waning-waning-source","generated_at":"2026-09-29T14:47:29.531639+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 waning flow includes the same-day recoveries rather than start-of-day R.","sha256":"1def2098c907dd615f55ccc5a5de232ea0d34319c8ecd72a50e59d750f65a482","title":"SIRS waning-immunity simulation: waning source · 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.454,"exit_code":1,"observations":[{"actual":[442.81,5.347,551.843,956.358],"check":"regression: seasonal coronavirus","expected":[543.377,58.225,398.398,1339.789],"passed":false},{"actual":[48.675,7.802,443.523,446.325],"check":"control: permanent immunity sentinel","expected":[48.675,7.802,443.523,446.325],"passed":true},{"actual":[346.394,37.703,415.903,1791.824],"check":"regression: short immunity endemic","expected":[333.272,133.331,333.396,3385.33],"passed":false},{"actual":[95.0,5.0,0.0,0.0],"check":"control: boundary zero days","expected":[95.0,5.0,0.0,0.0],"passed":true},{"actual":[96.842,0.04,3.118,0.0],"check":"regression: no transmission waning only","expected":[98.35,0.04,1.61,0.0],"passed":false},{"actual":[11.123,0.047,1988.83,1986.335],"check":"regression: long immunity single wave","expected":[376.102,3.345,1620.554,2084.424],"passed":false},{"actual":[183.354,79.113,37.533,403.097],"check":"regression: one day immunity","expected":[188.175,86.35,25.475,420.744],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: seasonal coronavirus\", \"actual\": [442.81, 5.347, 551.843, 956.358], \"expected\": [543.377, 58.225, 398.398, 1339.789], \"passed\": false}, {\"check\": \"control: permanent immunity sentinel\", \"actual\": [48.675, 7.802, 443.523, 446.325], \"expected\": [48.675, 7.802, 443.523, 446.325], \"passed\": true}, {\"check\": \"regression: short immunity endemic\", \"actual\": [346.394, 37.703, 415.903, 1791.824], \"expected\": [333.272, 133.331, 333.396, 3385.33], \"passed\": false}, {\"check\": \"control: boundary zero days\", \"actual\": [95.0, 5.0, 0.0, 0.0], \"expected\": [95.0, 5.0, 0.0, 0.0], \"passed\": true}, {\"check\": \"regression: no transmission waning only\", \"actual\": [96.842, 0.04, 3.118, 0.0], \"expected\": [98.35, 0.04, 1.61, 0.0], \"passed\": false}, {\"check\": \"regression: long immunity single wave\", \"actual\": [11.123, 0.047, 1988.83, 1986.335], \"expected\": [376.102, 3.345, 1620.554, 2084.424], \"passed\": false}, {\"check\": \"regression: one day immunity\", \"actual\": [183.354, 79.113, 37.533, 403.097], \"expected\": [188.175, 86.35, 25.475, 420.744], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.319,"exit_code":1,"observations":[{"actual":[541.47,60.145,398.384,1377.12],"check":"regression: seasonal coronavirus","expected":[543.377,58.225,398.398,1339.789],"passed":false},{"actual":[48.675,7.802,443.523,446.325],"check":"control: permanent immunity sentinel","expected":[48.675,7.802,443.523,446.325],"passed":true},{"actual":[333.288,143.595,323.117,3630.408],"check":"regression: short immunity endemic","expected":[333.272,133.331,333.396,3385.33],"passed":false},{"actual":[95.0,5.0,0.0,0.0],"check":"control: boundary zero days","expected":[95.0,5.0,0.0,0.0],"passed":true},{"actual":[98.672,0.04,1.288,0.0],"check":"regression: no transmission waning only","expected":[98.35,0.04,1.61,0.0],"passed":false},{"actual":[376.367,3.401,1620.232,2089.589],"check":"regression: long immunity single wave","expected":[376.102,3.345,1620.554,2084.424],"passed":false},{"actual":[191.879,108.121,0.0,491.595],"check":"regression: one day immunity","expected":[188.175,86.35,25.475,420.744],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: seasonal coronavirus\", \"actual\": [541.47, 60.145, 398.384, 1377.12], \"expected\": [543.377, 58.225, 398.398, 1339.789], \"passed\": false}, {\"check\": \"control: permanent immunity sentinel\", \"actual\": [48.675, 7.802, 443.523, 446.325], \"expected\": [48.675, 7.802, 443.523, 446.325], \"passed\": true}, {\"check\": \"regression: short immunity endemic\", \"actual\": [333.288, 143.595, 323.117, 3630.408], \"expected\": [333.272, 133.331, 333.396, 3385.33], \"passed\": false}, {\"check\": \"control: boundary zero days\", \"actual\": [95.0, 5.0, 0.0, 0.0], \"expected\": [95.0, 5.0, 0.0, 0.0], \"passed\": true}, {\"check\": \"regression: no transmission waning only\", \"actual\": [98.672, 0.04, 1.288, 0.0], \"expected\": [98.35, 0.04, 1.61, 0.0], \"passed\": false}, {\"check\": \"regression: long immunity single wave\", \"actual\": [376.367, 3.401, 1620.232, 2089.589], \"expected\": [376.102, 3.345, 1620.554, 2084.424], \"passed\": false}, {\"check\": \"regression: one day immunity\", \"actual\": [191.879, 108.121, 0.0, 491.595], \"expected\": [188.175, 86.35, 25.475, 420.744], \"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."}}