{"abstract":"Configured stop order overrides earliest stream position.","category":"Model output stopping rules","checks":8,"contract":"Given a token list and ordered stop sequences, return tokens before the earliest matching occurrence and its sequence index. If none match, return all tokens and None. Empty stop sequences are ignored.","contract_signature":" tokens, stops","evaluation_group":"w3-output-earliest-stop","failed_approach":"Returning the first configured sequence that matches still misses an earlier occurrence from a later-listed sequence.","family":"w3-model-output-stopping-rules-first-stop-sequence","id":"FA-100741","implementations":{"attempt":{"sha256":"7656792e5fe751edd2f043f17b7ad88770960d60c2450fc4e9620ece7d90e4e1","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        if s and any(tokens[i:i+len(s)]==s for i in range(len(tokens)-len(s)+1)):\n            i=next(i for i in range(len(tokens)-len(s)+1) if tokens[i:i+len(s)]==s)\n            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('equal start uses configured tie order',solve(['q','a','b'],[['a'],['a','b']]),(['q'],0))\ncheck('sequence prefix',solve(['q','a','x','z'],[['a','x']]),(['q'],0))\ncheck('no occurrence',solve(['a','b'],[['x']]),(['a','b'],None))\ncheck('empty sequence ignored',solve(['a'],[[]]),(['a'],None))\ncheck('at end',solve(['q','z'],[['z']]),(['q'],0))\ncheck('empty output',solve([], [['z']]),([],None))\ncheck('later-listed earlier position',solve(['a','x','b'],[['b'],['a','x']]),([],1))\ncheck('earlier listed occurrence',solve(['a','x','b'],[['a','x'],['b']]),([],0))\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":"e766fb52e1d7c889aac40906cc238771a80ad5231d2759d7aba56c80ad3bb345","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve( tokens, stops):\n    best=None\n    for j,s in enumerate(stops):\n        for i in range(len(tokens)-len(s)+1):\n            if tokens[i:i+len(s)]==s:\n                best=(i,j); break\n    return (tokens[:best[0]],best[1]) if best else (tokens,None)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('equal start uses configured tie order',solve(['q','a','b'],[['a'],['a','b']]),(['q'],0))\ncheck('sequence prefix',solve(['q','a','x','z'],[['a','x']]),(['q'],0))\ncheck('no occurrence',solve(['a','b'],[['x']]),(['a','b'],None))\ncheck('empty sequence ignored',solve(['a'],[[]]),(['a'],None))\ncheck('at end',solve(['q','z'],[['z']]),(['q'],0))\ncheck('empty output',solve([], [['z']]),([],None))\ncheck('later-listed earlier position',solve(['a','x','b'],[['b'],['a','x']]),([],1))\ncheck('earlier listed occurrence',solve(['a','x','b'],[['a','x'],['b']]),([],0))\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-first-stop-sequence","generated_at":"2026-09-30T16:48:39.096356+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":"Configured sequence order is used before stream position, allowing a later match to mask an earlier occurrence.","sha256":"f77e785cecd0d80b047f4bf45e9e117c563db0f5a6e227215a9da80c314318a2","title":"Output stopping: Configured stop order overrides earliest stream position · 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":33.796,"exit_code":1,"observations":[{"actual":[["q"],0],"check":"equal start uses configured tie order","expected":[["q"],0],"passed":true},{"actual":[["q"],0],"check":"sequence prefix","expected":[["q"],0],"passed":true},{"actual":[["a","b"],null],"check":"no occurrence","expected":[["a","b"],null],"passed":true},{"actual":[["a"],null],"check":"empty sequence ignored","expected":[["a"],null],"passed":true},{"actual":[["q"],0],"check":"at end","expected":[["q"],0],"passed":true},{"actual":[[],null],"check":"empty output","expected":[[],null],"passed":true},{"actual":[["a","x"],0],"check":"later-listed earlier position","expected":[[],1],"passed":false},{"actual":[[],0],"check":"earlier listed occurrence","expected":[[],0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"equal start uses configured tie order\", \"actual\": [[\"q\"], 0], \"expected\": [[\"q\"], 0], \"passed\": true}, {\"check\": \"sequence prefix\", \"actual\": [[\"q\"], 0], \"expected\": [[\"q\"], 0], \"passed\": true}, {\"check\": \"no occurrence\", \"actual\": [[\"a\", \"b\"], null], \"expected\": [[\"a\", \"b\"], null], \"passed\": true}, {\"check\": \"empty sequence ignored\", \"actual\": [[\"a\"], null], \"expected\": [[\"a\"], null], \"passed\": true}, {\"check\": \"at end\", \"actual\": [[\"q\"], 0], \"expected\": [[\"q\"], 0], \"passed\": true}, {\"check\": \"empty output\", \"actual\": [[], null], \"expected\": [[], null], \"passed\": true}, {\"check\": \"later-listed earlier position\", \"actual\": [[\"a\", \"x\"], 0], \"expected\": [[], 1], \"passed\": false}, {\"check\": \"earlier listed occurrence\", \"actual\": [[], 0], \"expected\": [[], 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":34.346,"exit_code":1,"observations":[{"actual":[["q"],1],"check":"equal start uses configured tie order","expected":[["q"],0],"passed":false},{"actual":[["q"],0],"check":"sequence prefix","expected":[["q"],0],"passed":true},{"actual":[["a","b"],null],"check":"no occurrence","expected":[["a","b"],null],"passed":true},{"actual":[[],0],"check":"empty sequence ignored","expected":[["a"],null],"passed":false},{"actual":[["q"],0],"check":"at end","expected":[["q"],0],"passed":true},{"actual":[[],null],"check":"empty output","expected":[[],null],"passed":true},{"actual":[[],1],"check":"later-listed earlier position","expected":[[],1],"passed":true},{"actual":[["a","x"],1],"check":"earlier listed occurrence","expected":[[],0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"equal start uses configured tie order\", \"actual\": [[\"q\"], 1], \"expected\": [[\"q\"], 0], \"passed\": false}, {\"check\": \"sequence prefix\", \"actual\": [[\"q\"], 0], \"expected\": [[\"q\"], 0], \"passed\": true}, {\"check\": \"no occurrence\", \"actual\": [[\"a\", \"b\"], null], \"expected\": [[\"a\", \"b\"], null], \"passed\": true}, {\"check\": \"empty sequence ignored\", \"actual\": [[], 0], \"expected\": [[\"a\"], null], \"passed\": false}, {\"check\": \"at end\", \"actual\": [[\"q\"], 0], \"expected\": [[\"q\"], 0], \"passed\": true}, {\"check\": \"empty output\", \"actual\": [[], null], \"expected\": [[], null], \"passed\": true}, {\"check\": \"later-listed earlier position\", \"actual\": [[], 1], \"expected\": [[], 1], \"passed\": true}, {\"check\": \"earlier listed occurrence\", \"actual\": [[\"a\", \"x\"], 1], \"expected\": [[], 0], \"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."}}