{"abstract":"Walking wounded who breathe fast are tagged RED instead of GREEN.","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":"Requiring command-following for GREEN re-triages confused walking casualties.","family":"w2-triage-mass-casualty-sort-walking-check-order","id":"FA-64751","implementations":{"attempt":{"sha256":"59feb2db2befe8ad4dd67a4e96ecb3b281d7c0a2d74ba6ebf225f15764599abe","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if x['walking'] and x['follows_commands']:\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":"00e3fb4827e992fdd594484ebe9077583901ce98c18fe12169cc68ab072c883d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\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"},"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-walking-check-order","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.","repair":"Check walking first and tag every ambulatory casualty GREEN.","root_cause":"The walking check is omitted, so ambulatory casualties fall into the physiological checks.","sha256":"531b775565ac68df31a697b5bf3025299810b8dff2c0f906738eeb3fd2771a64","title":"Mass casualty sorting algorithm: walking check order · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.254,"exit_code":1,"observations":[{"actual":{"reason":"walking","tag":"GREEN"},"check":"walking wounded tachypnoeic","expected":{"reason":"walking","tag":"GREEN"},"passed":true},{"actual":{"reason":"mental","tag":"RED"},"check":"walking but confused","expected":{"reason":"walking","tag":"GREEN"},"passed":false},{"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":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\": \"RED\", \"reason\": \"mental\"}, \"expected\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":45.383,"exit_code":1,"observations":[{"actual":{"reason":"respiration","tag":"RED"},"check":"walking wounded tachypnoeic","expected":{"reason":"walking","tag":"GREEN"},"passed":false},{"actual":{"reason":"mental","tag":"RED"},"check":"walking but confused","expected":{"reason":"walking","tag":"GREEN"},"passed":false},{"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":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"walking wounded tachypnoeic\", \"actual\": {\"tag\": \"RED\", \"reason\": \"respiration\"}, \"expected\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"passed\": false}, {\"check\": \"walking but confused\", \"actual\": {\"tag\": \"RED\", \"reason\": \"mental\"}, \"expected\": {\"tag\": \"GREEN\", \"reason\": \"walking\"}, \"passed\": false}, {\"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\": false}\n"},"fixed":{"elapsed_ms":40.544,"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"}