{"abstract":"Repeated parameters disappear or move past parameters that originally separated them.","category":"Protocols","checks":8,"contract":"Parse an application/x-www-form-urlencoded query into ordered [key, value] pairs. Preserve repeated keys, empty keys, and empty values; ignore empty separator-only segments.","evaluation_group":"model-36dcaa657ab4ec5a","failed_approach":"Keeping all values per key preserves multiplicity but loses global interleaving and, by default, empty values.","family":"parse-query-multiplicity","id":"FA-191","implementations":{"attempt":{"sha256":"50adf09e5c92290de7c635d3c009cdbb17aa0eef50bb00a4367451a196153090","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom urllib.parse import parse_qs, parse_qsl\nN = 1\nobservations = []\ndef solve(query):\n    return [[key, value] for key, values in parse_qs(query).items() for value in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('interleaved duplicate keys', solve('a=' + str(N) + '&b=x&a=last'), [['a', str(N)], ['b', 'x'], ['a', 'last']])\ncheck('blank and missing value', solve('a=&b'), [['a', ''], ['b', '']])\ncheck('empty parameter name', solve('=' + str(N)), [['', str(N)]])\ncheck('encoded separators are data', solve('x=a%26b%3Dc'), [['x', 'a&b=c']])\ncheck('plus and encoded plus differ', solve('x=a+b&x=a%2Bb'), [['x', 'a b'], ['x', 'a+b']])\ncheck('repeated identical parameter', solve('&'.join(['k=v'] * (N + 1))), [['k', 'v']] * (N + 1))\ncheck('empty query', solve(''), [])\ncheck('separator-only segments ignored', solve('&&a=1&&'), [['a', '1']])\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":"28bebdac34860a5eb1ef1c6ee5c5d5a8b2dbff25ef52ca80d6d83821447b5aaf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom urllib.parse import parse_qs, parse_qsl\nN = 1\nobservations = []\ndef solve(query):\n    return [[key, values[-1]] for key, values in parse_qs(query, keep_blank_values=True).items()]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('interleaved duplicate keys', solve('a=' + str(N) + '&b=x&a=last'), [['a', str(N)], ['b', 'x'], ['a', 'last']])\ncheck('blank and missing value', solve('a=&b'), [['a', ''], ['b', '']])\ncheck('empty parameter name', solve('=' + str(N)), [['', str(N)]])\ncheck('encoded separators are data', solve('x=a%26b%3Dc'), [['x', 'a&b=c']])\ncheck('plus and encoded plus differ', solve('x=a+b&x=a%2Bb'), [['x', 'a b'], ['x', 'a+b']])\ncheck('repeated identical parameter', solve('&'.join(['k=v'] * (N + 1))), [['k', 'v']] * (N + 1))\ncheck('empty query', solve(''), [])\ncheck('separator-only segments ignored', solve('&&a=1&&'), [['a', '1']])\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":"e1a99e7c74dc816452c55d2343d3119d137efacc4c65451d9407b5c2838ede57","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom urllib.parse import parse_qs, parse_qsl\nN = 1\nobservations = []\ndef solve(query):\n    return [list(pair) for pair in parse_qsl(query, keep_blank_values=True)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('interleaved duplicate keys', solve('a=' + str(N) + '&b=x&a=last'), [['a', str(N)], ['b', 'x'], ['a', 'last']])\ncheck('blank and missing value', solve('a=&b'), [['a', ''], ['b', '']])\ncheck('empty parameter name', solve('=' + str(N)), [['', str(N)]])\ncheck('encoded separators are data', solve('x=a%26b%3Dc'), [['x', 'a&b=c']])\ncheck('plus and encoded plus differ', solve('x=a+b&x=a%2Bb'), [['x', 'a b'], ['x', 'a+b']])\ncheck('repeated identical parameter', solve('&'.join(['k=v'] * (N + 1))), [['k', 'v']] * (N + 1))\ncheck('empty query', solve(''), [])\ncheck('separator-only segments ignored', solve('&&a=1&&'), [['a', '1']])\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":" 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":"parse-query-multiplicity","generated_at":"2026-09-29T14:36:51.018756+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Some request-signature, forwarding and audit formats depend on exact ordered parameter multiplicity. A mapping is a lossy intermediate representation for that contract.","repair":"Decode directly into an ordered sequence of key/value pairs and explicitly keep blank values.","root_cause":"The query string is reduced to a mapping before its ordered, repeated pairs are preserved.","sha256":"ec69e06208cac1007d81ddff636f896ae03bb3aba90fd60d3cd8d176d7428ee0","title":"Grouping query parameters loses their original order · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":31.83,"exit_code":1,"observations":[{"actual":[["a","1"],["a","last"],["b","x"]],"check":"interleaved duplicate keys","expected":[["a","1"],["b","x"],["a","last"]],"passed":false},{"actual":[],"check":"blank and missing value","expected":[["a",""],["b",""]],"passed":false},{"actual":[["","1"]],"check":"empty parameter name","expected":[["","1"]],"passed":true},{"actual":[["x","a&b=c"]],"check":"encoded separators are data","expected":[["x","a&b=c"]],"passed":true},{"actual":[["x","a b"],["x","a+b"]],"check":"plus and encoded plus differ","expected":[["x","a b"],["x","a+b"]],"passed":true},{"actual":[["k","v"],["k","v"]],"check":"repeated identical parameter","expected":[["k","v"],["k","v"]],"passed":true},{"actual":[],"check":"empty query","expected":[],"passed":true},{"actual":[["a","1"]],"check":"separator-only segments ignored","expected":[["a","1"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"interleaved duplicate keys\", \"actual\": [[\"a\", \"1\"], [\"a\", \"last\"], [\"b\", \"x\"]], \"expected\": [[\"a\", \"1\"], [\"b\", \"x\"], [\"a\", \"last\"]], \"passed\": false}, {\"check\": \"blank and missing value\", \"actual\": [], \"expected\": [[\"a\", \"\"], [\"b\", \"\"]], \"passed\": false}, {\"check\": \"empty parameter name\", \"actual\": [[\"\", \"1\"]], \"expected\": [[\"\", \"1\"]], \"passed\": true}, {\"check\": \"encoded separators are data\", \"actual\": [[\"x\", \"a&b=c\"]], \"expected\": [[\"x\", \"a&b=c\"]], \"passed\": true}, {\"check\": \"plus and encoded plus differ\", \"actual\": [[\"x\", \"a b\"], [\"x\", \"a+b\"]], \"expected\": [[\"x\", \"a b\"], [\"x\", \"a+b\"]], \"passed\": true}, {\"check\": \"repeated identical parameter\", \"actual\": [[\"k\", \"v\"], [\"k\", \"v\"]], \"expected\": [[\"k\", \"v\"], [\"k\", \"v\"]], \"passed\": true}, {\"check\": \"empty query\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"separator-only segments ignored\", \"actual\": [[\"a\", \"1\"]], \"expected\": [[\"a\", \"1\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":31.758,"exit_code":1,"observations":[{"actual":[["a","last"],["b","x"]],"check":"interleaved duplicate keys","expected":[["a","1"],["b","x"],["a","last"]],"passed":false},{"actual":[["a",""],["b",""]],"check":"blank and missing value","expected":[["a",""],["b",""]],"passed":true},{"actual":[["","1"]],"check":"empty parameter name","expected":[["","1"]],"passed":true},{"actual":[["x","a&b=c"]],"check":"encoded separators are data","expected":[["x","a&b=c"]],"passed":true},{"actual":[["x","a+b"]],"check":"plus and encoded plus differ","expected":[["x","a b"],["x","a+b"]],"passed":false},{"actual":[["k","v"]],"check":"repeated identical parameter","expected":[["k","v"],["k","v"]],"passed":false},{"actual":[],"check":"empty query","expected":[],"passed":true},{"actual":[["a","1"]],"check":"separator-only segments ignored","expected":[["a","1"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"interleaved duplicate keys\", \"actual\": [[\"a\", \"last\"], [\"b\", \"x\"]], \"expected\": [[\"a\", \"1\"], [\"b\", \"x\"], [\"a\", \"last\"]], \"passed\": false}, {\"check\": \"blank and missing value\", \"actual\": [[\"a\", \"\"], [\"b\", \"\"]], \"expected\": [[\"a\", \"\"], [\"b\", \"\"]], \"passed\": true}, {\"check\": \"empty parameter name\", \"actual\": [[\"\", \"1\"]], \"expected\": [[\"\", \"1\"]], \"passed\": true}, {\"check\": \"encoded separators are data\", \"actual\": [[\"x\", \"a&b=c\"]], \"expected\": [[\"x\", \"a&b=c\"]], \"passed\": true}, {\"check\": \"plus and encoded plus differ\", \"actual\": [[\"x\", \"a+b\"]], \"expected\": [[\"x\", \"a b\"], [\"x\", \"a+b\"]], \"passed\": false}, {\"check\": \"repeated identical parameter\", \"actual\": [[\"k\", \"v\"]], \"expected\": [[\"k\", \"v\"], [\"k\", \"v\"]], \"passed\": false}, {\"check\": \"empty query\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"separator-only segments ignored\", \"actual\": [[\"a\", \"1\"]], \"expected\": [[\"a\", \"1\"]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":30.566,"exit_code":0,"observations":[{"actual":[["a","1"],["b","x"],["a","last"]],"check":"interleaved duplicate keys","expected":[["a","1"],["b","x"],["a","last"]],"passed":true},{"actual":[["a",""],["b",""]],"check":"blank and missing value","expected":[["a",""],["b",""]],"passed":true},{"actual":[["","1"]],"check":"empty parameter name","expected":[["","1"]],"passed":true},{"actual":[["x","a&b=c"]],"check":"encoded separators are data","expected":[["x","a&b=c"]],"passed":true},{"actual":[["x","a b"],["x","a+b"]],"check":"plus and encoded plus differ","expected":[["x","a b"],["x","a+b"]],"passed":true},{"actual":[["k","v"],["k","v"]],"check":"repeated identical parameter","expected":[["k","v"],["k","v"]],"passed":true},{"actual":[],"check":"empty query","expected":[],"passed":true},{"actual":[["a","1"]],"check":"separator-only segments ignored","expected":[["a","1"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"interleaved duplicate keys\", \"actual\": [[\"a\", \"1\"], [\"b\", \"x\"], [\"a\", \"last\"]], \"expected\": [[\"a\", \"1\"], [\"b\", \"x\"], [\"a\", \"last\"]], \"passed\": true}, {\"check\": \"blank and missing value\", \"actual\": [[\"a\", \"\"], [\"b\", \"\"]], \"expected\": [[\"a\", \"\"], [\"b\", \"\"]], \"passed\": true}, {\"check\": \"empty parameter name\", \"actual\": [[\"\", \"1\"]], \"expected\": [[\"\", \"1\"]], \"passed\": true}, {\"check\": \"encoded separators are data\", \"actual\": [[\"x\", \"a&b=c\"]], \"expected\": [[\"x\", \"a&b=c\"]], \"passed\": true}, {\"check\": \"plus and encoded plus differ\", \"actual\": [[\"x\", \"a b\"], [\"x\", \"a+b\"]], \"expected\": [[\"x\", \"a b\"], [\"x\", \"a+b\"]], \"passed\": true}, {\"check\": \"repeated identical parameter\", \"actual\": [[\"k\", \"v\"], [\"k\", \"v\"]], \"expected\": [[\"k\", \"v\"], [\"k\", \"v\"]], \"passed\": true}, {\"check\": \"empty query\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"separator-only segments ignored\", \"actual\": [[\"a\", \"1\"]], \"expected\": [[\"a\", \"1\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}