{"abstract":"Streaming buffer emits partial stop prefixes too early.","category":"Model output stopping rules","checks":6,"contract":"For a stream suffix and stop strings, emit the longest prefix that cannot be part of any stop string prefix; retain the remaining suffix. Empty stop list emits everything.","contract_signature":"text, stops","evaluation_group":"w3-output-streaming-stop-suffix-buffer","failed_approach":"Holding a fixed maximum marker length delays unrelated text and does not track the actual suffix.","family":"w3-model-output-stopping-rules-streaming-prefix-buffer","id":"FA-100786","implementations":{"attempt":{"sha256":"697f899a2ccc1407116f8d9bf058da8ebc507a7e799c3a5afe6ed0aae635f6e2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, stops):\n    hold=max([len(s)-1 for s in stops if s] or [0])\n    return text[:-hold] if hold else text, text[-hold:] if hold else ''\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('partial marker held',solve('hello<st',['<stop>']),('hello','<st'))\ncheck('no prefix emits all',solve('hello',['<stop>']),('hello',''))\ncheck('longest suffix prefix',solve('ababa',['ababx','baq']),('ab','aba'))\ncheck('empty stop list',solve('abc',[]),('abc',''))\ncheck('whole marker prefix',solve('<stop>', ['<stop>']),('<stop>',''))\ncheck('short input',solve('x',['long']),('x',''))\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":"7157eb757889bfe15c1e7826fa6bf24a528165dc3249d3de8cafa35bd781306d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, stops):\n    return text,\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('partial marker held',solve('hello<st',['<stop>']),('hello','<st'))\ncheck('no prefix emits all',solve('hello',['<stop>']),('hello',''))\ncheck('longest suffix prefix',solve('ababa',['ababx','baq']),('ab','aba'))\ncheck('empty stop list',solve('abc',[]),('abc',''))\ncheck('whole marker prefix',solve('<stop>', ['<stop>']),('<stop>',''))\ncheck('short input',solve('x',['long']),('x',''))\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 toy contract covers the supplied token records only; it does not claim compatibility with a particular model runtime or tokenizer. 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":"w3-model-output-stopping-rules-streaming-prefix-buffer","generated_at":"2026-09-30T16:48:39.593640+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic output-control model isolates one finish or streaming boundary from any particular runtime.","root_cause":"The stream emits every character immediately, including suffixes that may complete a stop marker.","sha256":"0c4dd58d90a146a4426a3c60d4d0524cb92039faeb5c96bd75da62ed0dee6662","title":"Output stopping: Streaming buffer emits partial stop prefixes too early · case 01","variant":1,"variant_policy":"The same explicitly authored fixtures repeat across all five numbered records; runtime N is unused. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":29.684,"exit_code":1,"observations":[{"actual":["hel","lo<st"],"check":"partial marker held","expected":["hello","<st"],"passed":false},{"actual":["","hello"],"check":"no prefix emits all","expected":["hello",""],"passed":false},{"actual":["a","baba"],"check":"longest suffix prefix","expected":["ab","aba"],"passed":false},{"actual":["abc",""],"check":"empty stop list","expected":["abc",""],"passed":true},{"actual":["<","stop>"],"check":"whole marker prefix","expected":["<stop>",""],"passed":false},{"actual":["","x"],"check":"short input","expected":["x",""],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"partial marker held\", \"actual\": [\"hel\", \"lo<st\"], \"expected\": [\"hello\", \"<st\"], \"passed\": false}, {\"check\": \"no prefix emits all\", \"actual\": [\"\", \"hello\"], \"expected\": [\"hello\", \"\"], \"passed\": false}, {\"check\": \"longest suffix prefix\", \"actual\": [\"a\", \"baba\"], \"expected\": [\"ab\", \"aba\"], \"passed\": false}, {\"check\": \"empty stop list\", \"actual\": [\"abc\", \"\"], \"expected\": [\"abc\", \"\"], \"passed\": true}, {\"check\": \"whole marker prefix\", \"actual\": [\"<\", \"stop>\"], \"expected\": [\"<stop>\", \"\"], \"passed\": false}, {\"check\": \"short input\", \"actual\": [\"\", \"x\"], \"expected\": [\"x\", \"\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":33.114,"exit_code":1,"observations":[{"actual":["hello<st"],"check":"partial marker held","expected":["hello","<st"],"passed":false},{"actual":["hello"],"check":"no prefix emits all","expected":["hello",""],"passed":false},{"actual":["ababa"],"check":"longest suffix prefix","expected":["ab","aba"],"passed":false},{"actual":["abc"],"check":"empty stop list","expected":["abc",""],"passed":false},{"actual":["<stop>"],"check":"whole marker prefix","expected":["<stop>",""],"passed":false},{"actual":["x"],"check":"short input","expected":["x",""],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"partial marker held\", \"actual\": [\"hello<st\"], \"expected\": [\"hello\", \"<st\"], \"passed\": false}, {\"check\": \"no prefix emits all\", \"actual\": [\"hello\"], \"expected\": [\"hello\", \"\"], \"passed\": false}, {\"check\": \"longest suffix prefix\", \"actual\": [\"ababa\"], \"expected\": [\"ab\", \"aba\"], \"passed\": false}, {\"check\": \"empty stop list\", \"actual\": [\"abc\"], \"expected\": [\"abc\", \"\"], \"passed\": false}, {\"check\": \"whole marker prefix\", \"actual\": [\"<stop>\"], \"expected\": [\"<stop>\", \"\"], \"passed\": false}, {\"check\": \"short input\", \"actual\": [\"x\"], \"expected\": [\"x\", \"\"], \"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."}}