{"abstract":"Normal stream completion drops the held partial marker.","category":"Model output stopping rules","checks":6,"contract":"At normal end of stream, return all buffered text as visible and empty buffer; if an actual stop has completed, omit marker and discard remainder.","contract_signature":"text, stop, stopped","evaluation_group":"w3-output-stream-flush","failed_approach":"Normal flushing works, but stopped streams return a scalar instead of the required pair.","family":"w3-model-output-stopping-rules-stream-final-flush","id":"FA-100791","implementations":{"attempt":{"sha256":"a73d6226cf7fb32e2190feedbd63f0f934a297b1626ff1e80b19dbfdb13706f2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, stop, stopped):\n    if stopped:\n        i=text.find(stop)\n        return text[:i] if i>=0 else text\n    return text[:-1] if text else '', ''\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('normal final flush',solve('answer<st','<stop>',False),('answer<st',''))\ncheck('complete stop',solve('answer<stop>x','<stop>',True),('answer',''))\ncheck('stopped without marker',solve('safe','<stop>',True),('safe',''))\ncheck('empty normal',solve('','<stop>',False),('',''))\ncheck('marker at start',solve('<stop>x','<stop>',True),('',''))\ncheck('partial shorter than marker',solve('ab','long',False),('ab',''))\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":"9c66b09f1942540b87e8811de972ce0636d9628e74c2b6838236764f1786699f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, stop, stopped):\n    if stopped:\n        i=text.find(stop)\n        return text[:i] if i>=0 else text\n    return text[:-1] if text else ''\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('normal final flush',solve('answer<st','<stop>',False),('answer<st',''))\ncheck('complete stop',solve('answer<stop>x','<stop>',True),('answer',''))\ncheck('stopped without marker',solve('safe','<stop>',True),('safe',''))\ncheck('empty normal',solve('','<stop>',False),('',''))\ncheck('marker at start',solve('<stop>x','<stop>',True),('',''))\ncheck('partial shorter than marker',solve('ab','long',False),('ab',''))\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-stream-final-flush","generated_at":"2026-09-30T16:48:39.593526+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":"Normal completion drops the last buffered character instead of flushing all remaining text.","sha256":"bd3071170ada8c230ce2600d6110334146c7cee994a251dc36bfaca5b545a11d","title":"Output stopping: Normal stream completion drops the held partial marker · 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.197,"exit_code":1,"observations":[{"actual":["answer<s",""],"check":"normal final flush","expected":["answer<st",""],"passed":false},{"actual":"answer","check":"complete stop","expected":["answer",""],"passed":false},{"actual":"safe","check":"stopped without marker","expected":["safe",""],"passed":false},{"actual":["",""],"check":"empty normal","expected":["",""],"passed":true},{"actual":"","check":"marker at start","expected":["",""],"passed":false},{"actual":["a",""],"check":"partial shorter than marker","expected":["ab",""],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal final flush\", \"actual\": [\"answer<s\", \"\"], \"expected\": [\"answer<st\", \"\"], \"passed\": false}, {\"check\": \"complete stop\", \"actual\": \"answer\", \"expected\": [\"answer\", \"\"], \"passed\": false}, {\"check\": \"stopped without marker\", \"actual\": \"safe\", \"expected\": [\"safe\", \"\"], \"passed\": false}, {\"check\": \"empty normal\", \"actual\": [\"\", \"\"], \"expected\": [\"\", \"\"], \"passed\": true}, {\"check\": \"marker at start\", \"actual\": \"\", \"expected\": [\"\", \"\"], \"passed\": false}, {\"check\": \"partial shorter than marker\", \"actual\": [\"a\", \"\"], \"expected\": [\"ab\", \"\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":33.793,"exit_code":1,"observations":[{"actual":"answer<s","check":"normal final flush","expected":["answer<st",""],"passed":false},{"actual":"answer","check":"complete stop","expected":["answer",""],"passed":false},{"actual":"safe","check":"stopped without marker","expected":["safe",""],"passed":false},{"actual":"","check":"empty normal","expected":["",""],"passed":false},{"actual":"","check":"marker at start","expected":["",""],"passed":false},{"actual":"a","check":"partial shorter than marker","expected":["ab",""],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal final flush\", \"actual\": \"answer<s\", \"expected\": [\"answer<st\", \"\"], \"passed\": false}, {\"check\": \"complete stop\", \"actual\": \"answer\", \"expected\": [\"answer\", \"\"], \"passed\": false}, {\"check\": \"stopped without marker\", \"actual\": \"safe\", \"expected\": [\"safe\", \"\"], \"passed\": false}, {\"check\": \"empty normal\", \"actual\": \"\", \"expected\": [\"\", \"\"], \"passed\": false}, {\"check\": \"marker at start\", \"actual\": \"\", \"expected\": [\"\", \"\"], \"passed\": false}, {\"check\": \"partial shorter than marker\", \"actual\": \"a\", \"expected\": [\"ab\", \"\"], \"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."}}