{"abstract":"Posting frequency is mistaken for document frequency.","category":"Search retrieval semantics","checks":7,"contract":"Return the number of tokenized documents containing the query term, including documents with repeated occurrences exactly once.","contract_signature":"documents, term","evaluation_group":"model-320109f88d05a544","failed_approach":"Counting only documents where the term occurs once discards repeated-term documents.","family":"z-search-document-frequency-dedup","id":"FA-11861","implementations":{"attempt":{"sha256":"c468af1c867f83aff75053e9f2cfacd30ebe1f2b769aa454ff501ee0c23fbeba","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(documents, term):\n    return sum(doc.count(term)==1 for doc in documents)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nt='term'+str(N)\ncheck('repeated document', solve([[t]*(N+2)],t),1)\ncheck('mixed documents', solve([[t,t],[t],[]],t),2)\ncheck('absent corpus', solve([],t),0)\ncheck('absent term', solve([['other'],[]],t),0)\ncheck('two singleton documents', solve([[t],[t]],t),2)\ncheck('empty document', solve([[]],t),0)\ncheck('long unrelated document', solve([['x']*N+[t]],t),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":"df3af531dc68356a61b3bb9c892ebc95d41d0ee5a278e134c57ca0ea9b514cb7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(documents, term):\n    return sum(doc.count(term) for doc in documents)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nt='term'+str(N)\ncheck('repeated document', solve([[t]*(N+2)],t),1)\ncheck('mixed documents', solve([[t,t],[t],[]],t),2)\ncheck('absent corpus', solve([],t),0)\ncheck('absent term', solve([['other'],[]],t),0)\ncheck('two singleton documents', solve([[t],[t]],t),2)\ncheck('empty document', solve([[]],t),0)\ncheck('long unrelated document', solve([['x']*N+[t]],t),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":"Inputs are already tokenized or scored; this model makes no claim about production engine performance or linguistic analysis. 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-search-document-frequency-dedup","generated_at":"2026-09-29T14:38:51.698346+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline deterministic retrieval model isolates this search contract from tokenization, storage, and network behavior.","root_cause":"Repeated occurrences of a term inflate the count used by rarity scoring.","sha256":"38fbb6c8df66058aaa54d59aa7a3957de1fd534f0a75e989ba831a0409ae6abf","title":"Posting frequency is mistaken for document frequency · 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":41.92,"exit_code":1,"observations":[{"actual":0,"check":"repeated document","expected":1,"passed":false},{"actual":1,"check":"mixed documents","expected":2,"passed":false},{"actual":0,"check":"absent corpus","expected":0,"passed":true},{"actual":0,"check":"absent term","expected":0,"passed":true},{"actual":2,"check":"two singleton documents","expected":2,"passed":true},{"actual":0,"check":"empty document","expected":0,"passed":true},{"actual":1,"check":"long unrelated document","expected":1,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"repeated document\", \"actual\": 0, \"expected\": 1, \"passed\": false}, {\"check\": \"mixed documents\", \"actual\": 1, \"expected\": 2, \"passed\": false}, {\"check\": \"absent corpus\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"absent term\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"two singleton documents\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"empty document\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"long unrelated document\", \"actual\": 1, \"expected\": 1, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.013,"exit_code":1,"observations":[{"actual":3,"check":"repeated document","expected":1,"passed":false},{"actual":3,"check":"mixed documents","expected":2,"passed":false},{"actual":0,"check":"absent corpus","expected":0,"passed":true},{"actual":0,"check":"absent term","expected":0,"passed":true},{"actual":2,"check":"two singleton documents","expected":2,"passed":true},{"actual":0,"check":"empty document","expected":0,"passed":true},{"actual":1,"check":"long unrelated document","expected":1,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"repeated document\", \"actual\": 3, \"expected\": 1, \"passed\": false}, {\"check\": \"mixed documents\", \"actual\": 3, \"expected\": 2, \"passed\": false}, {\"check\": \"absent corpus\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"absent term\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"two singleton documents\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"empty document\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"long unrelated document\", \"actual\": 1, \"expected\": 1, \"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."}}