{"abstract":"Websocket upgrade requires both upgrade and connection tokens.","category":"WebSocket and browser transport policies","checks":4,"contract":"Bounded offline decision model: websocket upgrade requires both upgrade and connection tokens. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.","evaluation_group":"xh-websocket-upgrade-requires-both-upgrade-and-connection-tokens","failed_approach":"The attempted repair uses `\"upgrade\" in connection` and still violates a separate fixture.","family":"xh-websocket-upgrade-requires-both-upgrade-and-connection-tokens","id":"FA-7581","implementations":{"attempt":{"sha256":"e1597b661844860a6eb7c9d12b73eb325955c84aba044f2dec461770333cf1f7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport ipaddress\nimport re\nfrom urllib.parse import urlsplit, urljoin\nN = 1\nobservations = []\ndef solve(upgrade, connection):\n    return \"upgrade\" in connection\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_fixtures = [\"check('fixture 1', solve('websocket', []), False)\", \"check('fixture 2', solve('other', ['upgrade']), False)\", \"check('fixture 3', solve('WebSocket', ['Upgrade']), True)\", \"check('fixture 4', solve('websocket', ['keep-alive', 'upgrade']), True)\"]\nfor _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:\n    exec(_line)\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":"93acf246b104fe3a043d551e69b69681285338a9202ca0aeddb942d609b3f69d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport ipaddress\nimport re\nfrom urllib.parse import urlsplit, urljoin\nN = 1\nobservations = []\ndef solve(upgrade, connection):\n    return upgrade.lower() == \"websocket\"\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_fixtures = [\"check('fixture 1', solve('websocket', []), False)\", \"check('fixture 2', solve('other', ['upgrade']), False)\", \"check('fixture 3', solve('WebSocket', ['Upgrade']), True)\", \"check('fixture 4', solve('websocket', ['keep-alive', 'upgrade']), True)\"]\nfor _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:\n    exec(_line)\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":"ae354d56a91850496c17791bf4e74f7d79210a0a81eb82650ffc8187077a3dd0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport ipaddress\nimport re\nfrom urllib.parse import urlsplit, urljoin\nN = 1\nobservations = []\ndef solve(upgrade, connection):\n    return upgrade.lower() == \"websocket\" and \"upgrade\" in {x.lower() for x in connection}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_fixtures = [\"check('fixture 1', solve('websocket', []), False)\", \"check('fixture 2', solve('other', ['upgrade']), False)\", \"check('fixture 3', solve('WebSocket', ['Upgrade']), True)\", \"check('fixture 4', solve('websocket', ['keep-alive', 'upgrade']), True)\"]\nfor _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:\n    exec(_line)\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":"Bounded deterministic policy model over validated inputs; not a complete protocol stack or an interoperability claim. The five variants rotate the same explicit fixture set. 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":"xh-websocket-upgrade-requires-both-upgrade-and-connection-tokens","generated_at":"2026-09-29T14:38:13.420399+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"This deterministic websocket and browser transport policies model isolates the websocket-upgrade-requires-both-upgrade-and-connection-tokens policy at a network component boundary.","repair":"Apply the explicit websocket-upgrade-requires-both-upgrade-and-connection-tokens contract, including the tested boundary and negative cases.","root_cause":"The faulty implementation uses `upgrade.lower() == \"websocket\"` for the websocket-upgrade-requires-both-upgrade-and-connection-tokens decision.","sha256":"17fbcc932d451951c498633349e75db63bc3ae17cda17dd7ef00525ec5df477e","title":"Websocket upgrade requires both upgrade and connection tokens · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.046,"exit_code":1,"observations":[{"actual":true,"check":"fixture 2","expected":false,"passed":false},{"actual":false,"check":"fixture 3","expected":true,"passed":false},{"actual":true,"check":"fixture 4","expected":true,"passed":true},{"actual":false,"check":"fixture 1","expected":false,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 2\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": false, \"expected\": true, \"passed\": false}, {\"check\": \"fixture 4\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"fixture 1\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.323,"exit_code":1,"observations":[{"actual":false,"check":"fixture 2","expected":false,"passed":true},{"actual":true,"check":"fixture 3","expected":true,"passed":true},{"actual":true,"check":"fixture 4","expected":true,"passed":true},{"actual":true,"check":"fixture 1","expected":false,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 2\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"fixture 1\", \"actual\": true, \"expected\": false, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.018,"exit_code":0,"observations":[{"actual":false,"check":"fixture 2","expected":false,"passed":true},{"actual":true,"check":"fixture 3","expected":true,"passed":true},{"actual":true,"check":"fixture 4","expected":true,"passed":true},{"actual":false,"check":"fixture 1","expected":false,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 2\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"fixture 1\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}