{"abstract":"Secondary records inflate survey variance degrees of freedom.","category":"Survey sampling estimators","checks":6,"contract":"Rows are (stratum, PSU label) for noncertainty strata; labels are unique only within a stratum. Return sum_h(number of distinct sampled PSUs_h - 1), with empty input zero.","contract_signature":"rows","evaluation_group":"model-96a51838ef9a7aa5","failed_approach":"Globally deduplicating primary-unit labels merges distinct units from different strata.","family":"z-survey_sampling-design-degrees-freedom","id":"FA-12626","implementations":{"attempt":{"sha256":"84125a213fc1aa8d7936426165a4f51b3d6b8c327858d714ace3d1bbbba5ecbf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    return len({p for h,p in rows})-len({h for h,p in rows})\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('secondary records repeated',solve([('a',N),('a',N),('a',N+1)]),1)\ncheck('labels reused across strata',solve([('a',N),('a',N+1),('b',N),('b',N+1)]),2)\ncheck('lonely PSU stratum',solve([('a',N),('a',N)]),0)\ncheck('empty sample',solve([]),0)\ncheck('one stratum three PSUs',solve([('a',N),('a',N+1),('a',N+2)]),2)\ncheck('mixed counts',solve([('a',N),('b',N),('b',N+1),('b',N+1)]),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":"1222be955568b3bec81c4639ea55bc5c80fe6f24fdeadf76c1d514367ca5b191","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    return len(rows)-len({h for h,p in rows})\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('secondary records repeated',solve([('a',N),('a',N),('a',N+1)]),1)\ncheck('labels reused across strata',solve([('a',N),('a',N+1),('b',N),('b',N+1)]),2)\ncheck('lonely PSU stratum',solve([('a',N),('a',N)]),0)\ncheck('empty sample',solve([]),0)\ncheck('one stratum three PSUs',solve([('a',N),('a',N+1),('a',N+2)]),2)\ncheck('mixed counts',solve([('a',N),('b',N),('b',N+1),('b',N+1)]),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":"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-design-degrees-freedom","generated_at":"2026-09-29T14:38:58.712317+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.","root_cause":"Rows are counted as independent primary sampling units.","sha256":"9ed876ec7fa0dd29fd0c0b662aa32ebfd969f6be9351b9a0926a6af13340b33b","title":"Secondary records inflate survey variance degrees of freedom · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":40.731,"exit_code":1,"observations":[{"actual":1,"check":"secondary records repeated","expected":1,"passed":true},{"actual":0,"check":"labels reused across strata","expected":2,"passed":false},{"actual":0,"check":"lonely PSU stratum","expected":0,"passed":true},{"actual":0,"check":"empty sample","expected":0,"passed":true},{"actual":2,"check":"one stratum three PSUs","expected":2,"passed":true},{"actual":0,"check":"mixed counts","expected":1,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"secondary records repeated\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"labels reused across strata\", \"actual\": 0, \"expected\": 2, \"passed\": false}, {\"check\": \"lonely PSU stratum\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"empty sample\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"one stratum three PSUs\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"mixed counts\", \"actual\": 0, \"expected\": 1, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.947,"exit_code":1,"observations":[{"actual":2,"check":"secondary records repeated","expected":1,"passed":false},{"actual":2,"check":"labels reused across strata","expected":2,"passed":true},{"actual":1,"check":"lonely PSU stratum","expected":0,"passed":false},{"actual":0,"check":"empty sample","expected":0,"passed":true},{"actual":2,"check":"one stratum three PSUs","expected":2,"passed":true},{"actual":2,"check":"mixed counts","expected":1,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"secondary records repeated\", \"actual\": 2, \"expected\": 1, \"passed\": false}, {\"check\": \"labels reused across strata\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"lonely PSU stratum\", \"actual\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"empty sample\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"one stratum three PSUs\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"mixed counts\", \"actual\": 2, \"expected\": 1, \"passed\": false}], \"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."}}