{"abstract":"Tied stop matches choose the longest sequence.","category":"Model output stopping rules","checks":6,"contract":"Among stop sequences beginning at the earliest matching position, choose the longest; ties use the lowest input index. Return prefix and chosen sequence index, or all tokens and None.","contract_signature":"tokens, stops","evaluation_group":"w3-output-longest-tie","failed_approach":"Choosing the earliest position fixes ordering, but a first-listed short marker still masks a longer marker there.","family":"w3-model-output-stopping-rules-longest-same-position","id":"FA-100746","implementations":{"attempt":{"sha256":"dbc0432c71b3da3de285947b85759364324520ce16649a1ceb65b30c02ba3bf4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tokens, stops):\n    hits=[(i,j) for j,s in enumerate(stops) if s for i in range(len(tokens)-len(s)+1) if tokens[i:i+len(s)]==s]\n    if not hits:return tokens,None\n    i,j=min(hits)\n    return tokens[:i],j\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('longer tie',solve(['p','e','n','d'],[['e'],['e','n']]),(['p'],1))\ncheck('earlier position beats length',solve(['e','n','x'],[['e'],['n','x']]),([],0))\ncheck('same length stable index',solve(['a','b'],[['a','b'],['a','b']]),([],0))\ncheck('no match',solve(['x'],[['a']]),(['x'],None))\ncheck('empty output',solve([], [[]]),([],None))\ncheck('suffix match',solve(['x','a','b'],[['a'],['a','b']]),(['x'],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":"acc5547819e7b56e0e5f997ffb305fac0906f72ba74cc9cbc1f2b005a7993421","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tokens, stops):\n    for j,s in enumerate(stops):\n        for i in range(len(tokens)-len(s)+1):\n            if s and tokens[i:i+len(s)]==s:return tokens[:i],j\n    return tokens,None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('longer tie',solve(['p','e','n','d'],[['e'],['e','n']]),(['p'],1))\ncheck('earlier position beats length',solve(['e','n','x'],[['e'],['n','x']]),([],0))\ncheck('same length stable index',solve(['a','b'],[['a','b'],['a','b']]),([],0))\ncheck('no match',solve(['x'],[['a']]),(['x'],None))\ncheck('empty output',solve([], [[]]),([],None))\ncheck('suffix match',solve(['x','a','b'],[['a'],['a','b']]),(['x'],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":"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-longest-same-position","generated_at":"2026-09-30T16:48:39.096656+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 first matching stop at a stream position is chosen before considering longer alternatives.","sha256":"807ff6167fc8a61bf8679db0b414407d00a077a655597198b1840193e911c2a7","title":"Output stopping: Tied stop matches choose the longest sequence · 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":34.137,"exit_code":1,"observations":[{"actual":[["p"],0],"check":"longer tie","expected":[["p"],1],"passed":false},{"actual":[[],0],"check":"earlier position beats length","expected":[[],0],"passed":true},{"actual":[[],0],"check":"same length stable index","expected":[[],0],"passed":true},{"actual":[["x"],null],"check":"no match","expected":[["x"],null],"passed":true},{"actual":[[],null],"check":"empty output","expected":[[],null],"passed":true},{"actual":[["x"],0],"check":"suffix match","expected":[["x"],1],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"longer tie\", \"actual\": [[\"p\"], 0], \"expected\": [[\"p\"], 1], \"passed\": false}, {\"check\": \"earlier position beats length\", \"actual\": [[], 0], \"expected\": [[], 0], \"passed\": true}, {\"check\": \"same length stable index\", \"actual\": [[], 0], \"expected\": [[], 0], \"passed\": true}, {\"check\": \"no match\", \"actual\": [[\"x\"], null], \"expected\": [[\"x\"], null], \"passed\": true}, {\"check\": \"empty output\", \"actual\": [[], null], \"expected\": [[], null], \"passed\": true}, {\"check\": \"suffix match\", \"actual\": [[\"x\"], 0], \"expected\": [[\"x\"], 1], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":33.696,"exit_code":1,"observations":[{"actual":[["p"],0],"check":"longer tie","expected":[["p"],1],"passed":false},{"actual":[[],0],"check":"earlier position beats length","expected":[[],0],"passed":true},{"actual":[[],0],"check":"same length stable index","expected":[[],0],"passed":true},{"actual":[["x"],null],"check":"no match","expected":[["x"],null],"passed":true},{"actual":[[],null],"check":"empty output","expected":[[],null],"passed":true},{"actual":[["x"],0],"check":"suffix match","expected":[["x"],1],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"longer tie\", \"actual\": [[\"p\"], 0], \"expected\": [[\"p\"], 1], \"passed\": false}, {\"check\": \"earlier position beats length\", \"actual\": [[], 0], \"expected\": [[], 0], \"passed\": true}, {\"check\": \"same length stable index\", \"actual\": [[], 0], \"expected\": [[], 0], \"passed\": true}, {\"check\": \"no match\", \"actual\": [[\"x\"], null], \"expected\": [[\"x\"], null], \"passed\": true}, {\"check\": \"empty output\", \"actual\": [[], null], \"expected\": [[], null], \"passed\": true}, {\"check\": \"suffix match\", \"actual\": [[\"x\"], 0], \"expected\": [[\"x\"], 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."}}