{"abstract":"Canonicalize a directory URL after resource lookup without redirecting regular files: the query survives directory redirect branch emits an incorrect decision.","category":"HTTP redirects","checks":7,"contract":"Canonicalize a directory URL after resource lookup without redirecting regular files. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.","contract_signature":"request, path, directory, exists, query, index_name, served","evaluation_group":"s3-http-redirects-directory-canonical-redirect","failed_approach":"The partial repair uses \"path+'?'+query\" and still fails an explicit boundary or control.","family":"s3-http-redirects-directory-canonical-redirect-query-survives-directory-redirect","id":"FA-29101","implementations":{"attempt":{"sha256":"84e0bdcaeaeb06fb308f9c6b2528026a40f097eaf4808524cb196f6a471c7dd4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom urllib.parse import urlsplit, unquote, quote\nimport posixpath\nimport re\nN = 1\nobservations = []\ndef solve(request, path, directory, exists, query, index_name, served):\n    return {'request': request, 'decision': [directory and exists and not path.endswith('/'), path if path.endswith('/') else path+'/', path+'?'+query, path.rsplit('/',1)[-1] == index_name, path.rsplit('/',1)[0]+'/', not served, exists, path or '/', path.rsplit('/',1)[-1], path.rstrip('/')+'/'+index_name]} \ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve('/requests/' + str(N) + '/0', '/docs', True, True, 'lang=en', 'index.html', False), {'request': '/requests/' + str(N) + '/0', 'decision': [True, '/docs/', '/docs?lang=en', False, '/', True, True, '/docs', 'docs', '/docs/index.html']})\ncheck('fixture 2', solve('/requests/' + str(N) + '/1', '/docs/', True, True, '', 'index.html', False), {'request': '/requests/' + str(N) + '/1', 'decision': [False, '/docs/', '/docs/', False, '/docs/', True, True, '/docs/', '', '/docs/index.html']})\ncheck('fixture 3', solve('/requests/' + str(N) + '/2', '/file.txt', False, True, 'v=1', 'index.html', True), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '/file.txt/', '/file.txt?v=1', False, '/', False, True, '/file.txt', 'file.txt', '/file.txt/index.html']})\ncheck('fixture 4', solve('/requests/' + str(N) + '/3', '/missing', True, False, 'x=', 'home.html', False), {'request': '/requests/' + str(N) + '/3', 'decision': [False, '/missing/', '/missing?x=', False, '/', True, False, '/missing', 'missing', '/missing/home.html']})\ncheck('fixture 5', solve('/requests/' + str(N) + '/4', '/', True, True, '', 'index.html', True), {'request': '/requests/' + str(N) + '/4', 'decision': [False, '/', '/', False, '/', False, True, '/', '', '/index.html']})\ncheck('fixture 6', solve('/requests/' + str(N) + '/5', '/docs/index.html', False, True, 'q=1', 'index.html', False), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '/docs/index.html/', '/docs/index.html?q=1', True, '/docs/', True, True, '/docs/index.html', 'index.html', '/docs/index.html/index.html']})\ncheck('fixture 7', solve('/requests/' + str(N) + '/6', '/index.html/other.html', False, True, '', 'index.html', False), {'request': '/requests/' + str(N) + '/6', 'decision': [False, '/index.html/other.html/', '/index.html/other.html', False, '/index.html/', True, True, '/index.html/other.html', 'other.html', '/index.html/other.html/index.html']})\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":"3dc4c4c4f9bcef03dab48de666a71885d00718c8233b2c529694e8a9e64507ad","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom urllib.parse import urlsplit, unquote, quote\nimport posixpath\nimport re\nN = 1\nobservations = []\ndef solve(request, path, directory, exists, query, index_name, served):\n    return {'request': request, 'decision': [directory and exists and not path.endswith('/'), path if path.endswith('/') else path+'/', path, path.rsplit('/',1)[-1] == index_name, path.rsplit('/',1)[0]+'/', not served, exists, path or '/', path.rsplit('/',1)[-1], path.rstrip('/')+'/'+index_name]} \ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve('/requests/' + str(N) + '/0', '/docs', True, True, 'lang=en', 'index.html', False), {'request': '/requests/' + str(N) + '/0', 'decision': [True, '/docs/', '/docs?lang=en', False, '/', True, True, '/docs', 'docs', '/docs/index.html']})\ncheck('fixture 2', solve('/requests/' + str(N) + '/1', '/docs/', True, True, '', 'index.html', False), {'request': '/requests/' + str(N) + '/1', 'decision': [False, '/docs/', '/docs/', False, '/docs/', True, True, '/docs/', '', '/docs/index.html']})\ncheck('fixture 3', solve('/requests/' + str(N) + '/2', '/file.txt', False, True, 'v=1', 'index.html', True), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '/file.txt/', '/file.txt?v=1', False, '/', False, True, '/file.txt', 'file.txt', '/file.txt/index.html']})\ncheck('fixture 4', solve('/requests/' + str(N) + '/3', '/missing', True, False, 'x=', 'home.html', False), {'request': '/requests/' + str(N) + '/3', 'decision': [False, '/missing/', '/missing?x=', False, '/', True, False, '/missing', 'missing', '/missing/home.html']})\ncheck('fixture 5', solve('/requests/' + str(N) + '/4', '/', True, True, '', 'index.html', True), {'request': '/requests/' + str(N) + '/4', 'decision': [False, '/', '/', False, '/', False, True, '/', '', '/index.html']})\ncheck('fixture 6', solve('/requests/' + str(N) + '/5', '/docs/index.html', False, True, 'q=1', 'index.html', False), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '/docs/index.html/', '/docs/index.html?q=1', True, '/docs/', True, True, '/docs/index.html', 'index.html', '/docs/index.html/index.html']})\ncheck('fixture 7', solve('/requests/' + str(N) + '/6', '/index.html/other.html', False, True, '', 'index.html', False), {'request': '/requests/' + str(N) + '/6', 'decision': [False, '/index.html/other.html/', '/index.html/other.html', False, '/index.html/', True, True, '/index.html/other.html', 'other.html', '/index.html/other.html/index.html']})\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":"Stipulated offline redirect policy, not a complete HTTP, browser, URL, cache, or security implementation. Numbered variants vary request correlation identity. 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":"s3-http-redirects-directory-canonical-redirect-query-survives-directory-redirect","generated_at":"2026-09-29T14:41:40.293118+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Models a redirect controller decision before following a target or exposing a redirect result.","root_cause":"The query-survives-directory-redirect decision uses 'path'; this violates the stipulated controller policy.","sha256":"51c7da169b317b5dfedcb868c2e189ce6b60fea1bbecf6e010786341c325c1c1","title":"Canonicalize a directory URL after resource lookup without redirecting regular files: query survives directory redirect · case 01","variant":1,"variant_policy":"N changes request correlation identity. Policy boundary fixtures are reused; numbered variants are not independent examples.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.048,"exit_code":1,"observations":[{"actual":{"decision":[true,"/docs/","/docs?lang=en",false,"/",true,true,"/docs","docs","/docs/index.html"],"request":"/requests/1/0"},"check":"fixture 1","expected":{"decision":[true,"/docs/","/docs?lang=en",false,"/",true,true,"/docs","docs","/docs/index.html"],"request":"/requests/1/0"},"passed":true},{"actual":{"decision":[false,"/docs/","/docs/?",false,"/docs/",true,true,"/docs/","","/docs/index.html"],"request":"/requests/1/1"},"check":"fixture 2","expected":{"decision":[false,"/docs/","/docs/",false,"/docs/",true,true,"/docs/","","/docs/index.html"],"request":"/requests/1/1"},"passed":false},{"actual":{"decision":[false,"/file.txt/","/file.txt?v=1",false,"/",false,true,"/file.txt","file.txt","/file.txt/index.html"],"request":"/requests/1/2"},"check":"fixture 3","expected":{"decision":[false,"/file.txt/","/file.txt?v=1",false,"/",false,true,"/file.txt","file.txt","/file.txt/index.html"],"request":"/requests/1/2"},"passed":true},{"actual":{"decision":[false,"/missing/","/missing?x=",false,"/",true,false,"/missing","missing","/missing/home.html"],"request":"/requests/1/3"},"check":"fixture 4","expected":{"decision":[false,"/missing/","/missing?x=",false,"/",true,false,"/missing","missing","/missing/home.html"],"request":"/requests/1/3"},"passed":true},{"actual":{"decision":[false,"/","/?",false,"/",false,true,"/","","/index.html"],"request":"/requests/1/4"},"check":"fixture 5","expected":{"decision":[false,"/","/",false,"/",false,true,"/","","/index.html"],"request":"/requests/1/4"},"passed":false},{"actual":{"decision":[false,"/docs/index.html/","/docs/index.html?q=1",true,"/docs/",true,true,"/docs/index.html","index.html","/docs/index.html/index.html"],"request":"/requests/1/5"},"check":"fixture 6","expected":{"decision":[false,"/docs/index.html/","/docs/index.html?q=1",true,"/docs/",true,true,"/docs/index.html","index.html","/docs/index.html/index.html"],"request":"/requests/1/5"},"passed":true},{"actual":{"decision":[false,"/index.html/other.html/","/index.html/other.html?",false,"/index.html/",true,true,"/index.html/other.html","other.html","/index.html/other.html/index.html"],"request":"/requests/1/6"},"check":"fixture 7","expected":{"decision":[false,"/index.html/other.html/","/index.html/other.html",false,"/index.html/",true,true,"/index.html/other.html","other.html","/index.html/other.html/index.html"],"request":"/requests/1/6"},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": {\"request\": \"/requests/1/0\", \"decision\": [true, \"/docs/\", \"/docs?lang=en\", false, \"/\", true, true, \"/docs\", \"docs\", \"/docs/index.html\"]}, \"expected\": {\"request\": \"/requests/1/0\", \"decision\": [true, \"/docs/\", \"/docs?lang=en\", false, \"/\", true, true, \"/docs\", \"docs\", \"/docs/index.html\"]}, \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": {\"request\": \"/requests/1/1\", \"decision\": [false, \"/docs/\", \"/docs/?\", false, \"/docs/\", true, true, \"/docs/\", \"\", \"/docs/index.html\"]}, \"expected\": {\"request\": \"/requests/1/1\", \"decision\": [false, \"/docs/\", \"/docs/\", false, \"/docs/\", true, true, \"/docs/\", \"\", \"/docs/index.html\"]}, \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": {\"request\": \"/requests/1/2\", \"decision\": [false, \"/file.txt/\", \"/file.txt?v=1\", false, \"/\", false, true, \"/file.txt\", \"file.txt\", \"/file.txt/index.html\"]}, \"expected\": {\"request\": \"/requests/1/2\", \"decision\": [false, \"/file.txt/\", \"/file.txt?v=1\", false, \"/\", false, true, \"/file.txt\", \"file.txt\", \"/file.txt/index.html\"]}, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": {\"request\": \"/requests/1/3\", \"decision\": [false, \"/missing/\", \"/missing?x=\", false, \"/\", true, false, \"/missing\", \"missing\", \"/missing/home.html\"]}, \"expected\": {\"request\": \"/requests/1/3\", \"decision\": [false, \"/missing/\", \"/missing?x=\", false, \"/\", true, false, \"/missing\", \"missing\", \"/missing/home.html\"]}, \"passed\": true}, {\"check\": \"fixture 5\", \"actual\": {\"request\": \"/requests/1/4\", \"decision\": [false, \"/\", \"/?\", false, \"/\", false, true, \"/\", \"\", \"/index.html\"]}, \"expected\": {\"request\": \"/requests/1/4\", \"decision\": [false, \"/\", \"/\", false, \"/\", false, true, \"/\", \"\", \"/index.html\"]}, \"passed\": false}, {\"check\": \"fixture 6\", \"actual\": {\"request\": \"/requests/1/5\", \"decision\": [false, \"/docs/index.html/\", \"/docs/index.html?q=1\", true, \"/docs/\", true, true, \"/docs/index.html\", \"index.html\", \"/docs/index.html/index.html\"]}, \"expected\": {\"request\": \"/requests/1/5\", \"decision\": [false, \"/docs/index.html/\", \"/docs/index.html?q=1\", true, \"/docs/\", true, true, \"/docs/index.html\", \"index.html\", \"/docs/index.html/index.html\"]}, \"passed\": true}, {\"check\": \"fixture 7\", \"actual\": {\"request\": \"/requests/1/6\", \"decision\": [false, \"/index.html/other.html/\", \"/index.html/other.html?\", false, \"/index.html/\", true, true, \"/index.html/other.html\", \"other.html\", \"/index.html/other.html/index.html\"]}, \"expected\": {\"request\": \"/requests/1/6\", \"decision\": [false, \"/index.html/other.html/\", \"/index.html/other.html\", false, \"/index.html/\", true, true, \"/index.html/other.html\", \"other.html\", \"/index.html/other.html/index.html\"]}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.329,"exit_code":1,"observations":[{"actual":{"decision":[true,"/docs/","/docs",false,"/",true,true,"/docs","docs","/docs/index.html"],"request":"/requests/1/0"},"check":"fixture 1","expected":{"decision":[true,"/docs/","/docs?lang=en",false,"/",true,true,"/docs","docs","/docs/index.html"],"request":"/requests/1/0"},"passed":false},{"actual":{"decision":[false,"/docs/","/docs/",false,"/docs/",true,true,"/docs/","","/docs/index.html"],"request":"/requests/1/1"},"check":"fixture 2","expected":{"decision":[false,"/docs/","/docs/",false,"/docs/",true,true,"/docs/","","/docs/index.html"],"request":"/requests/1/1"},"passed":true},{"actual":{"decision":[false,"/file.txt/","/file.txt",false,"/",false,true,"/file.txt","file.txt","/file.txt/index.html"],"request":"/requests/1/2"},"check":"fixture 3","expected":{"decision":[false,"/file.txt/","/file.txt?v=1",false,"/",false,true,"/file.txt","file.txt","/file.txt/index.html"],"request":"/requests/1/2"},"passed":false},{"actual":{"decision":[false,"/missing/","/missing",false,"/",true,false,"/missing","missing","/missing/home.html"],"request":"/requests/1/3"},"check":"fixture 4","expected":{"decision":[false,"/missing/","/missing?x=",false,"/",true,false,"/missing","missing","/missing/home.html"],"request":"/requests/1/3"},"passed":false},{"actual":{"decision":[false,"/","/",false,"/",false,true,"/","","/index.html"],"request":"/requests/1/4"},"check":"fixture 5","expected":{"decision":[false,"/","/",false,"/",false,true,"/","","/index.html"],"request":"/requests/1/4"},"passed":true},{"actual":{"decision":[false,"/docs/index.html/","/docs/index.html",true,"/docs/",true,true,"/docs/index.html","index.html","/docs/index.html/index.html"],"request":"/requests/1/5"},"check":"fixture 6","expected":{"decision":[false,"/docs/index.html/","/docs/index.html?q=1",true,"/docs/",true,true,"/docs/index.html","index.html","/docs/index.html/index.html"],"request":"/requests/1/5"},"passed":false},{"actual":{"decision":[false,"/index.html/other.html/","/index.html/other.html",false,"/index.html/",true,true,"/index.html/other.html","other.html","/index.html/other.html/index.html"],"request":"/requests/1/6"},"check":"fixture 7","expected":{"decision":[false,"/index.html/other.html/","/index.html/other.html",false,"/index.html/",true,true,"/index.html/other.html","other.html","/index.html/other.html/index.html"],"request":"/requests/1/6"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": {\"request\": \"/requests/1/0\", \"decision\": [true, \"/docs/\", \"/docs\", false, \"/\", true, true, \"/docs\", \"docs\", \"/docs/index.html\"]}, \"expected\": {\"request\": \"/requests/1/0\", \"decision\": [true, \"/docs/\", \"/docs?lang=en\", false, \"/\", true, true, \"/docs\", \"docs\", \"/docs/index.html\"]}, \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": {\"request\": \"/requests/1/1\", \"decision\": [false, \"/docs/\", \"/docs/\", false, \"/docs/\", true, true, \"/docs/\", \"\", \"/docs/index.html\"]}, \"expected\": {\"request\": \"/requests/1/1\", \"decision\": [false, \"/docs/\", \"/docs/\", false, \"/docs/\", true, true, \"/docs/\", \"\", \"/docs/index.html\"]}, \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": {\"request\": \"/requests/1/2\", \"decision\": [false, \"/file.txt/\", \"/file.txt\", false, \"/\", false, true, \"/file.txt\", \"file.txt\", \"/file.txt/index.html\"]}, \"expected\": {\"request\": \"/requests/1/2\", \"decision\": [false, \"/file.txt/\", \"/file.txt?v=1\", false, \"/\", false, true, \"/file.txt\", \"file.txt\", \"/file.txt/index.html\"]}, \"passed\": false}, {\"check\": \"fixture 4\", \"actual\": {\"request\": \"/requests/1/3\", \"decision\": [false, \"/missing/\", \"/missing\", false, \"/\", true, false, \"/missing\", \"missing\", \"/missing/home.html\"]}, \"expected\": {\"request\": \"/requests/1/3\", \"decision\": [false, \"/missing/\", \"/missing?x=\", false, \"/\", true, false, \"/missing\", \"missing\", \"/missing/home.html\"]}, \"passed\": false}, {\"check\": \"fixture 5\", \"actual\": {\"request\": \"/requests/1/4\", \"decision\": [false, \"/\", \"/\", false, \"/\", false, true, \"/\", \"\", \"/index.html\"]}, \"expected\": {\"request\": \"/requests/1/4\", \"decision\": [false, \"/\", \"/\", false, \"/\", false, true, \"/\", \"\", \"/index.html\"]}, \"passed\": true}, {\"check\": \"fixture 6\", \"actual\": {\"request\": \"/requests/1/5\", \"decision\": [false, \"/docs/index.html/\", \"/docs/index.html\", true, \"/docs/\", true, true, \"/docs/index.html\", \"index.html\", \"/docs/index.html/index.html\"]}, \"expected\": {\"request\": \"/requests/1/5\", \"decision\": [false, \"/docs/index.html/\", \"/docs/index.html?q=1\", true, \"/docs/\", true, true, \"/docs/index.html\", \"index.html\", \"/docs/index.html/index.html\"]}, \"passed\": false}, {\"check\": \"fixture 7\", \"actual\": {\"request\": \"/requests/1/6\", \"decision\": [false, \"/index.html/other.html/\", \"/index.html/other.html\", false, \"/index.html/\", true, true, \"/index.html/other.html\", \"other.html\", \"/index.html/other.html/index.html\"]}, \"expected\": {\"request\": \"/requests/1/6\", \"decision\": [false, \"/index.html/other.html/\", \"/index.html/other.html\", false, \"/index.html/\", true, true, \"/index.html/other.html\", \"other.html\", \"/index.html/other.html/index.html\"]}, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}