{"abstract":"A global response adjustment transfers weight across response cells.","category":"Survey sampling estimators","checks":6,"contract":"Rows are (cell, positive base weight, responded boolean). Return adjusted respondent weights in row order; return None if any represented cell has zero respondents. Empty input returns empty list.","evaluation_group":"model-665d94b4dece1a45","failed_approach":"A cell response-count factor ignores unequal base weights.","family":"z-survey_sampling-response-cells","id":"FA-12611","implementations":{"attempt":{"sha256":"b08841e4cae6452bbd52457b42c73904194ff6a349a790c853879fa94808cb9d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    if any(not any(r for c,w,r in rows if c==cell) for cell in {c for c,w,r in rows}): return None\n    return [round(w*sum(c==cell for c,v,r in rows)/sum(c==cell and r for c,v,r in rows),8) for cell,w,r in rows if r]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('unequal weights within cell',solve([('a',N,True),('a',3*N,False)]),[4*N])\ncheck('different cell response',solve([('a',N,True),('a',N,False),('b',N,True)]),[2*N,N])\ncheck('all response',solve([('a',N,True),('b',2*N,True)]),[N,2*N])\ncheck('cell has no response',solve([('a',N,True),('b',N,False)]),None)\ncheck('preserve respondent proportions',solve([('a',N,True),('a',3*N,True),('a',4*N,False)]),[2*N,6*N])\ncheck('empty frame',solve([]),[])\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":"3193b2455a93ef7f8b1ca901630135acf7bb4ac9e9a31a812f9ea699e9934556","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    total=sum(w for c,w,r in rows); observed=sum(w for c,w,r in rows if r)\n    return [round(w*total/observed,8) for c,w,r in rows if r] if observed else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('unequal weights within cell',solve([('a',N,True),('a',3*N,False)]),[4*N])\ncheck('different cell response',solve([('a',N,True),('a',N,False),('b',N,True)]),[2*N,N])\ncheck('all response',solve([('a',N,True),('b',2*N,True)]),[N,2*N])\ncheck('cell has no response',solve([('a',N,True),('b',N,False)]),None)\ncheck('preserve respondent proportions',solve([('a',N,True),('a',3*N,True),('a',4*N,False)]),[2*N,6*N])\ncheck('empty frame',solve([]),[])\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":"3a29277de52ac7da88846eb64d74cba136ace2b941169b41d95270a1848df4b0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    totals={}; responding={}\n    for c,w,r in rows:\n        totals[c]=totals.get(c,0)+w\n        if r: responding[c]=responding.get(c,0)+w\n    if set(totals)-set(responding): return None\n    return [round(w*totals[c]/responding[c],8) for c,w,r in rows if r]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('unequal weights within cell',solve([('a',N,True),('a',3*N,False)]),[4*N])\ncheck('different cell response',solve([('a',N,True),('a',N,False),('b',N,True)]),[2*N,N])\ncheck('all response',solve([('a',N,True),('b',2*N,True)]),[N,2*N])\ncheck('cell has no response',solve([('a',N,True),('b',N,False)]),None)\ncheck('preserve respondent proportions',solve([('a',N,True),('a',3*N,True),('a',4*N,False)]),[2*N,6*N])\ncheck('empty frame',solve([]),[])\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":"Controlled finite fixtures; not a general survey-analysis package. 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":"z-survey_sampling-response-cells","generated_at":"2026-09-29T14:38:58.532044+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic survey-design model isolates this sampling contract before it is embedded in a larger estimation pipeline.","repair":"Within each cell preserve its eligible base-weight total by scaling respondent weights only.","root_cause":"All response cells share one global response inflation factor.","sha256":"42ca869041321dad28634e038dabb2747989c5b885e7019194b8372b2d243713","title":"A global response adjustment transfers weight across response cells · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.335,"exit_code":1,"observations":[{"actual":[2.0],"check":"unequal weights within cell","expected":[4],"passed":false},{"actual":[2.0,1.0],"check":"different cell response","expected":[2,1],"passed":true},{"actual":[1.0,2.0],"check":"all response","expected":[1,2],"passed":true},{"actual":null,"check":"cell has no response","expected":null,"passed":true},{"actual":[1.5,4.5],"check":"preserve respondent proportions","expected":[2,6],"passed":false},{"actual":[],"check":"empty frame","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unequal weights within cell\", \"actual\": [2.0], \"expected\": [4], \"passed\": false}, {\"check\": \"different cell response\", \"actual\": [2.0, 1.0], \"expected\": [2, 1], \"passed\": true}, {\"check\": \"all response\", \"actual\": [1.0, 2.0], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"cell has no response\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"preserve respondent proportions\", \"actual\": [1.5, 4.5], \"expected\": [2, 6], \"passed\": false}, {\"check\": \"empty frame\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.838,"exit_code":1,"observations":[{"actual":[4.0],"check":"unequal weights within cell","expected":[4],"passed":true},{"actual":[1.5,1.5],"check":"different cell response","expected":[2,1],"passed":false},{"actual":[1.0,2.0],"check":"all response","expected":[1,2],"passed":true},{"actual":[2.0],"check":"cell has no response","expected":null,"passed":false},{"actual":[2.0,6.0],"check":"preserve respondent proportions","expected":[2,6],"passed":true},{"actual":null,"check":"empty frame","expected":[],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unequal weights within cell\", \"actual\": [4.0], \"expected\": [4], \"passed\": true}, {\"check\": \"different cell response\", \"actual\": [1.5, 1.5], \"expected\": [2, 1], \"passed\": false}, {\"check\": \"all response\", \"actual\": [1.0, 2.0], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"cell has no response\", \"actual\": [2.0], \"expected\": null, \"passed\": false}, {\"check\": \"preserve respondent proportions\", \"actual\": [2.0, 6.0], \"expected\": [2, 6], \"passed\": true}, {\"check\": \"empty frame\", \"actual\": null, \"expected\": [], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.925,"exit_code":0,"observations":[{"actual":[4.0],"check":"unequal weights within cell","expected":[4],"passed":true},{"actual":[2.0,1.0],"check":"different cell response","expected":[2,1],"passed":true},{"actual":[1.0,2.0],"check":"all response","expected":[1,2],"passed":true},{"actual":null,"check":"cell has no response","expected":null,"passed":true},{"actual":[2.0,6.0],"check":"preserve respondent proportions","expected":[2,6],"passed":true},{"actual":[],"check":"empty frame","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unequal weights within cell\", \"actual\": [4.0], \"expected\": [4], \"passed\": true}, {\"check\": \"different cell response\", \"actual\": [2.0, 1.0], \"expected\": [2, 1], \"passed\": true}, {\"check\": \"all response\", \"actual\": [1.0, 2.0], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"cell has no response\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"preserve respondent proportions\", \"actual\": [2.0, 6.0], \"expected\": [2, 6], \"passed\": true}, {\"check\": \"empty frame\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}