{"abstract":"A casualty breathing exactly 30 times a minute is tagged RED.","category":"Clinical triage scoring","checks":10,"contract":"Input {walking, breathing, breathing_after_airway, rr, radial_pulse, cap_refill_s, follows_commands}. Toy order: walking -> GREEN; not breathing -> RED if breathing after airway repositioning else BLACK; rr > 30 -> RED; no radial pulse or refill > 2 s -> RED; not following commands -> RED; else YELLOW. Return {tag, reason}.","contract_signature":"x","evaluation_group":"w2-triage-mass-casualty-sort","failed_approach":"Adding a bradypnoea rule tags slow-breathing casualties RED outside the stipulated algorithm.","family":"w2-triage-mass-casualty-sort-respiratory-rate-threshold","id":"FA-64741","implementations":{"attempt":{"sha256":"79034844b7595afcc5fad72b47e87873ce7a38875015269aa873f40a58fc3b5f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if x['walking']:\n        return {'tag': 'GREEN', 'reason': 'walking'}\n    if not x['breathing']:\n        return {'tag': 'RED' if x['breathing_after_airway'] else 'BLACK', 'reason': 'airway'}\n    if x['rr'] > 30 or x['rr'] < 10:\n        return {'tag': 'RED', 'reason': 'respiration'}\n    if not x['radial_pulse'] or x['cap_refill_s'] > 2:\n        return {'tag': 'RED', 'reason': 'perfusion'}\n    if not x['follows_commands']:\n        return {'tag': 'RED', 'reason': 'mental'}\n    return {'tag': 'YELLOW', 'reason': 'delayed'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('walking wounded tachypnoeic',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 33,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('walking but confused',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 21,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('apnoeic breathes after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': True,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'airway'}),\n  ('apnoeic after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': False,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'BLACK', 'reason': 'airway'}),\n  ('respiratory rate exactly 30',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('slow breathing but perfusing',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 9,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('no radial pulse with quick refill',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': False,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('refill exactly 2 seconds',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 19,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('refill 3 seconds with pulse',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('cannot follow commands',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 26,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'RED', 'reason': 'mental'})],\n [('walking wounded tachypnoeic',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 34,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('walking but confused',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('apnoeic breathes after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': True,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'airway'}),\n  ('apnoeic after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': False,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'BLACK', 'reason': 'airway'}),\n  ('respiratory rate exactly 30',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('slow breathing but perfusing',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 8,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('no radial pulse with quick refill',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': False,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('refill exactly 2 seconds',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('refill 3 seconds with pulse',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('cannot follow commands',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 27,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'RED', 'reason': 'mental'})],\n [('walking wounded tachypnoeic',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 35,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('walking but confused',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 23,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('apnoeic breathes after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': True,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'airway'}),\n  ('apnoeic after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': False,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'BLACK', 'reason': 'airway'}),\n  ('respiratory rate exactly 30',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('slow breathing but perfusing',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 9,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('no radial pulse with quick refill',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': False,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('refill exactly 2 seconds',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 21,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('refill 3 seconds with pulse',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('cannot follow commands',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 28,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'RED', 'reason': 'mental'})],\n [('walking wounded tachypnoeic',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 36,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('walking but confused',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 24,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('apnoeic breathes after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': True,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'airway'}),\n  ('apnoeic after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': False,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 4,\n    'follows_commands': True},\n   {'tag': 'BLACK', 'reason': 'airway'}),\n  ('respiratory rate exactly 30',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('slow breathing but perfusing',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 8,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('no radial pulse with quick refill',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': False,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('refill exactly 2 seconds',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('refill 3 seconds with pulse',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('cannot follow commands',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 29,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'RED', 'reason': 'mental'})],\n [('walking wounded tachypnoeic',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 37,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('walking but confused',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 25,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('apnoeic breathes after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': True,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'airway'}),\n  ('apnoeic after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': False,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 5,\n    'follows_commands': True},\n   {'tag': 'BLACK', 'reason': 'airway'}),\n  ('respiratory rate exactly 30',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('slow breathing but perfusing',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 9,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('no radial pulse with quick refill',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': False,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('refill exactly 2 seconds',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 23,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('refill 3 seconds with pulse',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('cannot follow commands',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'RED', 'reason': 'mental'})]]\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":"47664b776d3c1e1cd246014ad36acc57c14c520044d693b0b0d64649f38d0722","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if x['walking']:\n        return {'tag': 'GREEN', 'reason': 'walking'}\n    if not x['breathing']:\n        return {'tag': 'RED' if x['breathing_after_airway'] else 'BLACK', 'reason': 'airway'}\n    if x['rr'] >= 30:\n        return {'tag': 'RED', 'reason': 'respiration'}\n    if not x['radial_pulse'] or x['cap_refill_s'] > 2:\n        return {'tag': 'RED', 'reason': 'perfusion'}\n    if not x['follows_commands']:\n        return {'tag': 'RED', 'reason': 'mental'}\n    return {'tag': 'YELLOW', 'reason': 'delayed'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('walking wounded tachypnoeic',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 33,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('walking but confused',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 21,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('apnoeic breathes after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': True,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'airway'}),\n  ('apnoeic after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': False,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'BLACK', 'reason': 'airway'}),\n  ('respiratory rate exactly 30',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('slow breathing but perfusing',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 9,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('no radial pulse with quick refill',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': False,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('refill exactly 2 seconds',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 19,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('refill 3 seconds with pulse',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('cannot follow commands',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 26,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'RED', 'reason': 'mental'})],\n [('walking wounded tachypnoeic',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 34,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('walking but confused',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('apnoeic breathes after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': True,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'airway'}),\n  ('apnoeic after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': False,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'BLACK', 'reason': 'airway'}),\n  ('respiratory rate exactly 30',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('slow breathing but perfusing',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 8,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('no radial pulse with quick refill',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': False,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('refill exactly 2 seconds',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('refill 3 seconds with pulse',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('cannot follow commands',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 27,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'RED', 'reason': 'mental'})],\n [('walking wounded tachypnoeic',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 35,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('walking but confused',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 23,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('apnoeic breathes after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': True,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'airway'}),\n  ('apnoeic after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': False,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'BLACK', 'reason': 'airway'}),\n  ('respiratory rate exactly 30',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('slow breathing but perfusing',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 9,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('no radial pulse with quick refill',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': False,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('refill exactly 2 seconds',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 21,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('refill 3 seconds with pulse',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('cannot follow commands',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 28,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'RED', 'reason': 'mental'})],\n [('walking wounded tachypnoeic',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 36,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('walking but confused',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 24,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('apnoeic breathes after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': True,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'airway'}),\n  ('apnoeic after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': False,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 4,\n    'follows_commands': True},\n   {'tag': 'BLACK', 'reason': 'airway'}),\n  ('respiratory rate exactly 30',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('slow breathing but perfusing',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 8,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('no radial pulse with quick refill',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': False,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('refill exactly 2 seconds',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('refill 3 seconds with pulse',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('cannot follow commands',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 29,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'RED', 'reason': 'mental'})],\n [('walking wounded tachypnoeic',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 37,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('walking but confused',\n   {'walking': True,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 25,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'GREEN', 'reason': 'walking'}),\n  ('apnoeic breathes after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': True,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'airway'}),\n  ('apnoeic after repositioning',\n   {'walking': False,\n    'breathing': False,\n    'breathing_after_airway': False,\n    'rr': 0,\n    'radial_pulse': True,\n    'cap_refill_s': 5,\n    'follows_commands': True},\n   {'tag': 'BLACK', 'reason': 'airway'}),\n  ('respiratory rate exactly 30',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('slow breathing but perfusing',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 9,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('no radial pulse with quick refill',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 20,\n    'radial_pulse': False,\n    'cap_refill_s': 1,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('refill exactly 2 seconds',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 23,\n    'radial_pulse': True,\n    'cap_refill_s': 2,\n    'follows_commands': True},\n   {'tag': 'YELLOW', 'reason': 'delayed'}),\n  ('refill 3 seconds with pulse',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 22,\n    'radial_pulse': True,\n    'cap_refill_s': 3,\n    'follows_commands': True},\n   {'tag': 'RED', 'reason': 'perfusion'}),\n  ('cannot follow commands',\n   {'walking': False,\n    'breathing': True,\n    'breathing_after_airway': False,\n    'rr': 30,\n    'radial_pulse': True,\n    'cap_refill_s': 1,\n    'follows_commands': False},\n   {'tag': 'RED', 'reason': 'mental'})]]\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":"A deterministic toy software model with explicitly stipulated thresholds and formulas; it is not clinical guidance, not a validated medical calculator, and makes no claim of conformance to any published protocol. Numbered variants vary patient and order inputs. 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-triage-mass-casualty-sort-respiratory-rate-threshold","generated_at":"2026-09-29T14:47:27.460240+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Mass casualty sorting is an ordered sequence of quick checks; order and each threshold are distinct defect sites.","root_cause":"The rate threshold includes 30.","sha256":"cfb3f38eb9e1c28da245dbc9969ec451583f98afca95c04309d541972d0d4d8b","title":"Mass casualty sorting algorithm: respiratory rate threshold · 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":42.479,"exit_code":1,"observations":[{"actual":{"reason":"walking","tag":"GREEN"},"check":"walking wounded tachypnoeic","expected":{"reason":"walking","tag":"GREEN"},"passed":true},{"actual":{"reason":"walking","tag":"GREEN"},"check":"walking but confused","expected":{"reason":"walking","tag":"GREEN"},"passed":true},{"actual":{"reason":"airway","tag":"RED"},"check":"apnoeic breathes after repositioning","expected":{"reason":"airway","tag":"RED"},"passed":true},{"actual":{"reason":"airway","tag":"BLACK"},"check":"apnoeic after repositioning","expected":{"reason":"airway","tag":"BLACK"},"passed":true},{"actual":{"reason":"delayed","tag":"YELLOW"},"check":"respiratory rate exactly 30","expected":{"reason":"delayed","tag":"YELLOW"},"passed":true},{"actual":{"reason":"respiration","tag":"RED"},"check":"slow breathing but perfusing","expected":{"reason":"delayed","tag":"YELLOW"},"passed":false},{"actual":{"reason":"perfusion","tag":"RED"},"check":"no radial pulse with quick refill","expected":{"reason":"perfusion","tag":"RED"},"passed":true},{"actual":{"reason":"delayed","tag":"YELLOW"},"check":"refill exactly 2 seconds","expected":{"reason":"delayed","tag":"YELLOW"},"passed":true},{"actual":{"reason":"perfusion","tag":"RED"},"check":"refill 3 seconds with pulse","expected":{"reason":"perfusion","tag":"RED"},"passed":true},{"actual":{"reason":"mental","tag":"RED"},"check":"cannot follow commands","expected":{"reason":"mental","tag":"RED"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"walking wounded tachypnoeic\", \"actual\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"expected\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"passed\": true}, {\"check\": \"walking but confused\", \"actual\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"expected\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"passed\": true}, {\"check\": \"apnoeic breathes after repositioning\", \"actual\": {\"tag\": \"RED\", \"reason\": \"airway\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"airway\"}, \"passed\": true}, {\"check\": \"apnoeic after repositioning\", \"actual\": {\"tag\": \"BLACK\", \"reason\": \"airway\"}, \"expected\": {\"tag\": \"BLACK\", \"reason\": \"airway\"}, \"passed\": true}, {\"check\": \"respiratory rate exactly 30\", \"actual\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"expected\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"passed\": true}, {\"check\": \"slow breathing but perfusing\", \"actual\": {\"tag\": \"RED\", \"reason\": \"respiration\"}, \"expected\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"passed\": false}, {\"check\": \"no radial pulse with quick refill\", \"actual\": {\"tag\": \"RED\", \"reason\": \"perfusion\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"perfusion\"}, \"passed\": true}, {\"check\": \"refill exactly 2 seconds\", \"actual\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"expected\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"passed\": true}, {\"check\": \"refill 3 seconds with pulse\", \"actual\": {\"tag\": \"RED\", \"reason\": \"perfusion\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"perfusion\"}, \"passed\": true}, {\"check\": \"cannot follow commands\", \"actual\": {\"tag\": \"RED\", \"reason\": \"mental\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"mental\"}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.628,"exit_code":1,"observations":[{"actual":{"reason":"walking","tag":"GREEN"},"check":"walking wounded tachypnoeic","expected":{"reason":"walking","tag":"GREEN"},"passed":true},{"actual":{"reason":"walking","tag":"GREEN"},"check":"walking but confused","expected":{"reason":"walking","tag":"GREEN"},"passed":true},{"actual":{"reason":"airway","tag":"RED"},"check":"apnoeic breathes after repositioning","expected":{"reason":"airway","tag":"RED"},"passed":true},{"actual":{"reason":"airway","tag":"BLACK"},"check":"apnoeic after repositioning","expected":{"reason":"airway","tag":"BLACK"},"passed":true},{"actual":{"reason":"respiration","tag":"RED"},"check":"respiratory rate exactly 30","expected":{"reason":"delayed","tag":"YELLOW"},"passed":false},{"actual":{"reason":"delayed","tag":"YELLOW"},"check":"slow breathing but perfusing","expected":{"reason":"delayed","tag":"YELLOW"},"passed":true},{"actual":{"reason":"perfusion","tag":"RED"},"check":"no radial pulse with quick refill","expected":{"reason":"perfusion","tag":"RED"},"passed":true},{"actual":{"reason":"delayed","tag":"YELLOW"},"check":"refill exactly 2 seconds","expected":{"reason":"delayed","tag":"YELLOW"},"passed":true},{"actual":{"reason":"perfusion","tag":"RED"},"check":"refill 3 seconds with pulse","expected":{"reason":"perfusion","tag":"RED"},"passed":true},{"actual":{"reason":"mental","tag":"RED"},"check":"cannot follow commands","expected":{"reason":"mental","tag":"RED"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"walking wounded tachypnoeic\", \"actual\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"expected\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"passed\": true}, {\"check\": \"walking but confused\", \"actual\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"expected\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"passed\": true}, {\"check\": \"apnoeic breathes after repositioning\", \"actual\": {\"tag\": \"RED\", \"reason\": \"airway\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"airway\"}, \"passed\": true}, {\"check\": \"apnoeic after repositioning\", \"actual\": {\"tag\": \"BLACK\", \"reason\": \"airway\"}, \"expected\": {\"tag\": \"BLACK\", \"reason\": \"airway\"}, \"passed\": true}, {\"check\": \"respiratory rate exactly 30\", \"actual\": {\"tag\": \"RED\", \"reason\": \"respiration\"}, \"expected\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"passed\": false}, {\"check\": \"slow breathing but perfusing\", \"actual\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"expected\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"passed\": true}, {\"check\": \"no radial pulse with quick refill\", \"actual\": {\"tag\": \"RED\", \"reason\": \"perfusion\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"perfusion\"}, \"passed\": true}, {\"check\": \"refill exactly 2 seconds\", \"actual\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"expected\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"passed\": true}, {\"check\": \"refill 3 seconds with pulse\", \"actual\": {\"tag\": \"RED\", \"reason\": \"perfusion\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"perfusion\"}, \"passed\": true}, {\"check\": \"cannot follow commands\", \"actual\": {\"tag\": \"RED\", \"reason\": \"mental\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"mental\"}, \"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."}}