{"abstract":"Streaming suffix retains only one character of a longer possible stop prefix.","category":"Model output stopping rules","checks":6,"contract":"Return (emittable, holdback), withholding the longest suffix of text that equals a proper prefix of any stop string.","contract_signature":"text, stops","evaluation_group":"w3-output-streaming-stop-suffix-buffer","failed_approach":"Allowing a full stop string into the holdback range retains completed markers indefinitely.","family":"w3-model-output-stopping-rules-suffix-longest-prefix","id":"FA-100836","implementations":{"attempt":{"sha256":"7a847126f8a4b78094573b5ef0f1ec0f64ac43161daf18e3a602c9102c08b4df","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, stops):\n    hold=max((k for s in stops for k in range(1,min(len(s),len(text))+1) if text.endswith(s[:k])),default=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('long partial held',solve('say<st',['<stop>']),('say','<st'))\ncheck('full stop held by proper-prefix rule',solve('<stop>', ['<stop>']),('<stop>',''))\ncheck('unrelated suffix',solve('hello',['<stop>']),('hello',''))\ncheck('two candidate lengths',solve('abab',['ababc','abc']),('','abab'))\ncheck('empty input',solve('', ['abc']),('',''))\ncheck('one-char prefix',solve('x',['xyz']),('','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":"206b2c538ffb36fd07f574efe28d3250db026052cc2d9b4e43e08c097126804b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, stops):\n    hold=1 if text and any(text.endswith(s[:1]) for s in stops if s) else 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('long partial held',solve('say<st',['<stop>']),('say','<st'))\ncheck('full stop held by proper-prefix rule',solve('<stop>', ['<stop>']),('<stop>',''))\ncheck('unrelated suffix',solve('hello',['<stop>']),('hello',''))\ncheck('two candidate lengths',solve('abab',['ababc','abc']),('','abab'))\ncheck('empty input',solve('', ['abc']),('',''))\ncheck('one-char prefix',solve('x',['xyz']),('','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-suffix-longest-prefix","generated_at":"2026-09-30T16:48:40.054619+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":"Only a one-character suffix is considered, losing longer partial marker prefixes across stream calls.","sha256":"e49db435b555b25428e433f39c0398d3cd4090dc77da4d19f491fb540762ba51","title":"Output stopping: Streaming suffix retains only one character of a longer possible stop prefix · 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.045,"exit_code":1,"observations":[{"actual":["say","<st"],"check":"long partial held","expected":["say","<st"],"passed":true},{"actual":["","<stop>"],"check":"full stop held by proper-prefix rule","expected":["<stop>",""],"passed":false},{"actual":["hello",""],"check":"unrelated suffix","expected":["hello",""],"passed":true},{"actual":["","abab"],"check":"two candidate lengths","expected":["","abab"],"passed":true},{"actual":["",""],"check":"empty input","expected":["",""],"passed":true},{"actual":["","x"],"check":"one-char prefix","expected":["","x"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"long partial held\", \"actual\": [\"say\", \"<st\"], \"expected\": [\"say\", \"<st\"], \"passed\": true}, {\"check\": \"full stop held by proper-prefix rule\", \"actual\": [\"\", \"<stop>\"], \"expected\": [\"<stop>\", \"\"], \"passed\": false}, {\"check\": \"unrelated suffix\", \"actual\": [\"hello\", \"\"], \"expected\": [\"hello\", \"\"], \"passed\": true}, {\"check\": \"two candidate lengths\", \"actual\": [\"\", \"abab\"], \"expected\": [\"\", \"abab\"], \"passed\": true}, {\"check\": \"empty input\", \"actual\": [\"\", \"\"], \"expected\": [\"\", \"\"], \"passed\": true}, {\"check\": \"one-char prefix\", \"actual\": [\"\", \"x\"], \"expected\": [\"\", \"x\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.846,"exit_code":1,"observations":[{"actual":["say<st",""],"check":"long partial held","expected":["say","<st"],"passed":false},{"actual":["<stop>",""],"check":"full stop held by proper-prefix rule","expected":["<stop>",""],"passed":true},{"actual":["hello",""],"check":"unrelated suffix","expected":["hello",""],"passed":true},{"actual":["abab",""],"check":"two candidate lengths","expected":["","abab"],"passed":false},{"actual":["",""],"check":"empty input","expected":["",""],"passed":true},{"actual":["","x"],"check":"one-char prefix","expected":["","x"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"long partial held\", \"actual\": [\"say<st\", \"\"], \"expected\": [\"say\", \"<st\"], \"passed\": false}, {\"check\": \"full stop held by proper-prefix rule\", \"actual\": [\"<stop>\", \"\"], \"expected\": [\"<stop>\", \"\"], \"passed\": true}, {\"check\": \"unrelated suffix\", \"actual\": [\"hello\", \"\"], \"expected\": [\"hello\", \"\"], \"passed\": true}, {\"check\": \"two candidate lengths\", \"actual\": [\"abab\", \"\"], \"expected\": [\"\", \"abab\"], \"passed\": false}, {\"check\": \"empty input\", \"actual\": [\"\", \"\"], \"expected\": [\"\", \"\"], \"passed\": true}, {\"check\": \"one-char prefix\", \"actual\": [\"\", \"x\"], \"expected\": [\"\", \"x\"], \"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."}}