{"abstract":"A casualty without a radial pulse but with brisk refill is tagged YELLOW.","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}.","evaluation_group":"w2-triage-mass-casualty-sort","failed_approach":"Making the refill threshold inclusive over-triages a 2-second refill.","family":"w2-triage-mass-casualty-sort-perfusion-criteria","id":"FA-64746","implementations":{"attempt":{"sha256":"31ab965c8fc1c85bce688c8219acd6dccc928976ccf89f71a5100e8803355dba","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"},"broken":{"sha256":"7868c09308ab042401c58049c162e20542f827716237b37c6c97e706e9f23041","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'] and 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"},"fixed":{"sha256":"a19cdbec220e247407686d00e0b23247d34e599e88e213561ecd744e47799e32","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-perfusion-criteria","generated_at":"2026-09-29T14:47:27.456870+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.","repair":"Tag RED when the radial pulse is absent or refill exceeds 2 s.","root_cause":"The two perfusion findings are joined with and instead of or.","sha256":"f7e1d1a2673ce8425ed06dc340145fc8e468d08c1808c21d64d23604fafb4385","title":"Mass casualty sorting algorithm: perfusion criteria · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.116,"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":"perfusion","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":"perfusion","tag":"RED"},"check":"refill exactly 2 seconds","expected":{"reason":"delayed","tag":"YELLOW"},"passed":false},{"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\": \"perfusion\"}, \"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\": \"RED\", \"reason\": \"perfusion\"}, \"expected\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"passed\": false}, {\"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.908,"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":"delayed","tag":"YELLOW"},"check":"slow breathing but perfusing","expected":{"reason":"delayed","tag":"YELLOW"},"passed":true},{"actual":{"reason":"delayed","tag":"YELLOW"},"check":"no radial pulse with quick refill","expected":{"reason":"perfusion","tag":"RED"},"passed":false},{"actual":{"reason":"delayed","tag":"YELLOW"},"check":"refill exactly 2 seconds","expected":{"reason":"delayed","tag":"YELLOW"},"passed":true},{"actual":{"reason":"delayed","tag":"YELLOW"},"check":"refill 3 seconds with pulse","expected":{"reason":"perfusion","tag":"RED"},"passed":false},{"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\": \"YELLOW\", \"reason\": \"delayed\"}, \"expected\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"passed\": true}, {\"check\": \"no radial pulse with quick refill\", \"actual\": {\"tag\": \"YELLOW\", \"reason\": \"delayed\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"perfusion\"}, \"passed\": false}, {\"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\": \"YELLOW\", \"reason\": \"delayed\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"perfusion\"}, \"passed\": false}, {\"check\": \"cannot follow commands\", \"actual\": {\"tag\": \"RED\", \"reason\": \"mental\"}, \"expected\": {\"tag\": \"RED\", \"reason\": \"mental\"}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.347,"exit_code":0,"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":"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":true,"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\": \"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\": true}\n"}},"verified":true,"visibility":"public"}