FAILURE MAP
← Case archive

FA-100741 / Model output stopping rules / Open access

Output stopping: Configured stop order overrides earliest stream position · case 01

Configured stop order overrides earliest stream position.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Configured sequence order is used before stream position, allowing a later match to mask an earlier occurrence.

THE FAILURE

Configured sequence order is used before stream position, allowing a later match to mask an earlier occurrence.

Unsuccessful approach: Returning the first configured sequence that matches still misses an earlier occurrence from a later-listed sequence.

Case 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.

Why this case matters

A deterministic output-control model isolates one finish or streaming boundary from any particular runtime.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve( tokens, stops):
    best=None
    for j,s in enumerate(stops):
        for i in range(len(tokens)-len(s)+1):
            if tokens[i:i+len(s)]==s:
                best=(i,j); break
    return (tokens[:best[0]],best[1]) if best else (tokens,None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('equal start uses configured tie order',solve(['q','a','b'],[['a'],['a','b']]),(['q'],0))
check('sequence prefix',solve(['q','a','x','z'],[['a','x']]),(['q'],0))
check('no occurrence',solve(['a','b'],[['x']]),(['a','b'],None))
check('empty sequence ignored',solve(['a'],[[]]),(['a'],None))
check('at end',solve(['q','z'],[['z']]),(['q'],0))
check('empty output',solve([], [['z']]),([],None))
check('later-listed earlier position',solve(['a','x','b'],[['b'],['a','x']]),([],1))
check('earlier listed occurrence',solve(['a','x','b'],[['a','x'],['b']]),([],0))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
equal start uses configured tie order[['q'], 1][['q'], 0]Failed
sequence prefix[['q'], 0][['q'], 0]Passed
no occurrence[['a', 'b'], None][['a', 'b'], None]Passed
empty sequence ignored[[], 0][['a'], None]Failed
at end[['q'], 0][['q'], 0]Passed
empty output[[], None][[], None]Passed
later-listed earlier position[[], 1][[], 1]Passed
earlier listed occurrence[['a', 'x'], 1][[], 0]Failed

SHA-256 / e766fb52e1d7c889aac40906cc238771a80ad5231d2759d7aba56c80ad3bb345

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve( tokens, stops):
    for j,s in enumerate(stops):
        if s and any(tokens[i:i+len(s)]==s for i in range(len(tokens)-len(s)+1)):
            i=next(i for i in range(len(tokens)-len(s)+1) if tokens[i:i+len(s)]==s)
            return tokens[:i],j
    return tokens,None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('equal start uses configured tie order',solve(['q','a','b'],[['a'],['a','b']]),(['q'],0))
check('sequence prefix',solve(['q','a','x','z'],[['a','x']]),(['q'],0))
check('no occurrence',solve(['a','b'],[['x']]),(['a','b'],None))
check('empty sequence ignored',solve(['a'],[[]]),(['a'],None))
check('at end',solve(['q','z'],[['z']]),(['q'],0))
check('empty output',solve([], [['z']]),([],None))
check('later-listed earlier position',solve(['a','x','b'],[['b'],['a','x']]),([],1))
check('earlier listed occurrence',solve(['a','x','b'],[['a','x'],['b']]),([],0))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
equal start uses configured tie order[['q'], 0][['q'], 0]Passed
sequence prefix[['q'], 0][['q'], 0]Passed
no occurrence[['a', 'b'], None][['a', 'b'], None]Passed
empty sequence ignored[['a'], None][['a'], None]Passed
at end[['q'], 0][['q'], 0]Passed
empty output[[], None][[], None]Passed
later-listed earlier position[['a', 'x'], 0][[], 1]Failed
earlier listed occurrence[[], 0][[], 0]Passed

SHA-256 / 7656792e5fe751edd2f043f17b7ad88770960d60c2450fc4e9620ece7d90e4e1

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:39.096356+00:00.

Case digest / f77e785cecd0d80b047f4bf45e9e117c563db0f5a6e227215a9da80c314318a2