{"abstract":"Hyphenation stops for the rest of the paragraph after the first ladder.","category":"Typography line breaking","checks":8,"contract":"Input [words as syllable lists, width, limit]. Greedy fill with 1-unit spaces and characters. A word that does not fit may be split at the latest syllable boundary whose head plus \"-\" fits, only if fewer than limit immediately preceding lines ended in a hyphen and the word is not the paragraph's last word. A line ended without hyphen resets the streak; a word too long for an empty line is set alone. Return the lines.","contract_signature":"x","evaluation_group":"w2-typography-line-breaking-hyphen-ladder","failed_approach":"Decrementing instead of resetting still blocks legitimate hyphens later.","family":"w2-typography-line-breaking-hyphen-ladder-streak-reset-on-plain-break","id":"FA-79951","implementations":{"attempt":{"sha256":"23c4fa22d11242818cbe9dd3d429110c1fb86aeb8fe3ed84026b7ae01850ffda","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width, limit = x\n    queue = [list(w) for w in words]\n    lines = []\n    cur = ''\n    streak = 0\n    k = 0\n    while k < len(queue):\n        syl = queue[k]\n        token = ''.join(syl)\n        need = len(token) if cur == '' else len(cur) + 1 + len(token)\n        if need <= width:\n            cur = token if cur == '' else cur + ' ' + token\n            k += 1\n            continue\n        split = None\n        if streak < limit and k < len(queue) - 1:\n            for cut in range(len(syl) - 1, 0, -1):\n                head = ''.join(syl[:cut]) + '-'\n                room = len(head) if cur == '' else len(cur) + len(head) + 1\n                if room <= width:\n                    split = cut\n                    break\n        if split is not None:\n            head = ''.join(syl[:split]) + '-'\n            lines.append(head if cur == '' else cur + ' ' + head)\n            queue[k] = syl[split:]\n            cur = ''\n            streak += 1\n        elif cur == '':\n            lines.append(token)\n            k += 1\n            streak = 0\n        else:\n            lines.append(cur)\n            cur, streak = '', max(streak - 1, 0)\n    if cur:\n        lines.append(cur)\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('regression: streak reset on plain break', [[['line'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['jus', 'ti', 'fied'], ['a'], ['kern', 'ing'], ['text'], ['col', 'umn'], ['break', 'ing'], ['text'], ['col', 'umn']], 9, 1], ['line set-', 'ting', 'interna-', 'tional', 'justified', 'a kerning', 'text col-', 'umn', 'breaking', 'text', 'column']), ('regression: streak reset on plain break', [[['to'], ['jus', 'ti', 'fied'], ['set', 'ting'], ['type'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['kern', 'ing'], ['text'], ['pa', 'ra', 'graph']], 10, 3], ['to justi-', 'fied set-', 'ting type', 'hyphena-', 'tion set-', 'ting in-', 'ternational', 'setting', 'kerning', 'text', 'paragraph']), ('regression: streak reset on plain break', [[['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['lead', 'ing'], ['hy', 'phen', 'a', 'tion'], ['of'], ['to']], 6, 3], ['justi-', 'fied', 'hy-', 'phena-', 'tion', 'compo-', 'sition', 'inter-', 'na-', 'tional', 'lead-', 'ing', 'lead-', 'ing', 'hy-', 'phena-', 'tion', 'of to']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['hy', 'phen', 'a', 'tion'], ['break', 'ing'], ['of'], ['set', 'ting'], ['col', 'umn'], ['a']], 11, 1], ['hyphenation', 'breaking of', 'setting', 'column a']), ('control layout', [[['col', 'umn'], ['lead', 'ing'], ['of'], ['jus', 'ti', 'fied'], ['line']], 12, 3], ['column lead-', 'ing of jus-', 'tified line']), ('control layout', [[['kern', 'ing'], ['jus', 'ti', 'fied'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['a'], ['break', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['to'], ['com', 'po', 'si', 'tion']], 10, 3], ['kerning', 'justified', 'interna-', 'tional', 'setting a', 'breaking', 'interna-', 'tional to', 'composition'])], [('regression: streak reset on plain break', [[['a'], ['break', 'ing'], ['text'], ['to'], ['mar', 'gin'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al']], 6, 3], ['a', 'break-', 'ing', 'text', 'to', 'margin', 'set-', 'ting', 'inter-', 'na-', 'tional', 'international']), ('regression: streak reset on plain break', [[['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['to'], ['kern', 'ing'], ['mar', 'gin'], ['to'], ['lead', 'ing']], 6, 2], ['para-', 'graph', 'hy-', 'phena-', 'tion', 'inter-', 'na-', 'tional', 'justi-', 'fied', 'hy-', 'phena-', 'tion', 'to', 'kern-', 'ing', 'margin', 'to', 'leading']), ('regression: streak reset on plain break', [[['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['set', 'ting'], ['to'], ['mar', 'gin'], ['to'], ['jus', 'ti', 'fied'], ['jus', 'ti', 'fied'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['text']], 6, 2], ['inter-', 'na-', 'tional', 'inter-', 'na-', 'tional', 'para-', 'graph', 'set-', 'ting', 'to', 'margin', 'to', 'justi-', 'fied', 'justi-', 'fied', 'inter-', 'na-', 'tional', 'hy-', 'phena-', 'tion', 'text']), ('regression: streak reset on plain break', [[['type'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['type'], ['hy', 'phen', 'a', 'tion'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['mar', 'gin'], ['com', 'po', 'si', 'tion'], ['col', 'umn']], 12, 3], ['type inter-', 'national hy-', 'phenation', 'type hyphen-', 'ation hy-', 'phenation', 'leading mar-', 'gin composi-', 'tion column']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['type'], ['col', 'umn'], ['lead', 'ing'], ['lead', 'ing'], ['of'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al']], 10, 1], ['type col-', 'umn', 'leading', 'leading of', 'margin', 'international']), ('control layout', [[['a'], ['of'], ['type'], ['to'], ['col', 'umn'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph'], ['break', 'ing'], ['col', 'umn'], ['lead', 'ing'], ['com', 'po', 'si', 'tion']], 8, 3], ['a of', 'type to', 'column', 'interna-', 'tional', 'composi-', 'tion pa-', 'ragraph', 'breaking', 'column', 'leading', 'composition'])], [('regression: streak reset on plain break', [[['set', 'ting'], ['lead', 'ing'], ['jus', 'ti', 'fied'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['to'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['line']], 8, 1], ['setting', 'leading', 'justi-', 'fied of', 'interna-', 'tional', 'to jus-', 'tified', 'margin', 'line']), ('regression: streak reset on plain break', [[['hy', 'phen', 'a', 'tion'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting'], ['jus', 'ti', 'fied'], ['col', 'umn'], ['text'], ['pa', 'ra', 'graph'], ['jus', 'ti', 'fied'], ['a']], 9, 1], ['hyphena-', 'tion', 'hyphena-', 'tion', 'setting', 'justified', 'column', 'text pa-', 'ragraph', 'justified', 'a']), ('regression: streak reset on plain break', [[['set', 'ting'], ['set', 'ting'], ['pa', 'ra', 'graph'], ['col', 'umn'], ['to'], ['type'], ['col', 'umn'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['com', 'po', 'si', 'tion'], ['kern', 'ing'], ['col', 'umn']], 12, 2], ['setting set-', 'ting para-', 'graph column', 'to type col-', 'umn interna-', 'tional a', 'composition', 'kerning', 'column']), ('regression: streak reset on plain break', [[['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['lead', 'ing'], ['hy', 'phen', 'a', 'tion'], ['of'], ['to']], 6, 3], ['justi-', 'fied', 'hy-', 'phena-', 'tion', 'compo-', 'sition', 'inter-', 'na-', 'tional', 'lead-', 'ing', 'lead-', 'ing', 'hy-', 'phena-', 'tion', 'of to']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['col', 'umn'], ['pa', 'ra', 'graph'], ['text'], ['pa', 'ra', 'graph'], ['break', 'ing'], ['of'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['of'], ['jus', 'ti', 'fied'], ['in', 'ter', 'na', 'tion', 'al']], 11, 2], ['column pa-', 'ragraph', 'text para-', 'graph', 'breaking of', 'hyphenation', 'kerning of', 'justified', 'international']), ('control layout', [[['in', 'ter', 'na', 'tion', 'al'], ['of'], ['mar', 'gin'], ['set', 'ting'], ['pa', 'ra', 'graph'], ['com', 'po', 'si', 'tion']], 13, 2], ['international', 'of margin', 'setting para-', 'graph', 'composition'])], [('regression: streak reset on plain break', [[['line'], ['mar', 'gin'], ['lead', 'ing'], ['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion'], ['of'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['a'], ['type']], 7, 1], ['line', 'margin', 'leading', 'para-', 'graph', 'hyphen-', 'ation', 'of jus-', 'tified', 'para-', 'graph a', 'type']), ('regression: streak reset on plain break', [[['a'], ['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['of'], ['text'], ['line'], ['pa', 'ra', 'graph'], ['of']], 7, 1], ['a jus-', 'tified', 'hyphen-', 'ation', 'inter-', 'national', 'of text', 'line', 'para-', 'graph', 'of']), ('regression: streak reset on plain break', [[['of'], ['jus', 'ti', 'fied'], ['set', 'ting'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['break', 'ing']], 8, 3], ['of jus-', 'tified', 'setting', 'composi-', 'tion in-', 'terna-', 'tional', 'composi-', 'tion in-', 'terna-', 'tional', 'para-', 'graph', 'breaking']), ('regression: streak reset on plain break', [[['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['lead', 'ing'], ['hy', 'phen', 'a', 'tion'], ['of'], ['to']], 6, 3], ['justi-', 'fied', 'hy-', 'phena-', 'tion', 'compo-', 'sition', 'inter-', 'na-', 'tional', 'lead-', 'ing', 'lead-', 'ing', 'hy-', 'phena-', 'tion', 'of to']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['pa', 'ra', 'graph'], ['line'], ['col', 'umn'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['mar', 'gin'], ['to'], ['a'], ['col', 'umn'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['break', 'ing']], 11, 3], ['paragraph', 'line column', 'justified', 'margin mar-', 'gin to a', 'column hy-', 'phenation', 'justified', 'breaking']), ('control layout', [[['jus', 'ti', 'fied'], ['col', 'umn'], ['line'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['a'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['type'], ['mar', 'gin']], 11, 2], ['justified', 'column line', 'margin hy-', 'phenation a', 'justified', 'paragraph', 'type margin'])], [('regression: streak reset on plain break', [[['col', 'umn'], ['of'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['lead', 'ing'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['line'], ['col', 'umn']], 6, 3], ['column', 'of', 'compo-', 'sition', 'inter-', 'na-', 'tional', 'a', 'lead-', 'ing', 'compo-', 'sition', 'inter-', 'na-', 'tional', 'set-', 'ting', 'line', 'column']), ('regression: streak reset on plain break', [[['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['col', 'umn'], ['of'], ['set', 'ting'], ['pa', 'ra', 'graph'], ['kern', 'ing']], 13, 1], ['hyphenation', 'leading col-', 'umn of', 'setting para-', 'graph kerning']), ('regression: streak reset on plain break', [[['in', 'ter', 'na', 'tion', 'al'], ['to'], ['com', 'po', 'si', 'tion'], ['jus', 'ti', 'fied'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['pa', 'ra', 'graph'], ['type']], 7, 2], ['inter-', 'nation-', 'al to', 'compo-', 'sition', 'justi-', 'fied', 'justi-', 'fied', 'break-', 'ing pa-', 'ragraph', 'type']), ('regression: streak reset on plain break', [[['col', 'umn'], ['kern', 'ing'], ['com', 'po', 'si', 'tion'], ['a'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['kern', 'ing'], ['hy', 'phen', 'a', 'tion'], ['text'], ['mar', 'gin'], ['to']], 13, 3], ['column kern-', 'ing composi-', 'tion a inter-', 'national', 'leading kern-', 'ing hyphena-', 'tion text', 'margin to']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['mar', 'gin'], ['pa', 'ra', 'graph'], ['jus', 'ti', 'fied'], ['kern', 'ing'], ['col', 'umn'], ['jus', 'ti', 'fied'], ['text'], ['a'], ['jus', 'ti', 'fied'], ['break', 'ing']], 11, 2], ['margin pa-', 'ragraph', 'justified', 'kerning', 'column jus-', 'tified text', 'a justified', 'breaking']), ('control layout', [[['lead', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['break', 'ing'], ['mar', 'gin'], ['pa', 'ra', 'graph'], ['lead', 'ing']], 10, 3], ['leading', 'interna-', 'tional', 'composi-', 'tion', 'breaking', 'margin pa-', 'ragraph', 'leading'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\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":"134321ddc73ff1f8ccb473d832e4ee3252c97df5b4c26cb78286e13de2bd98d5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width, limit = x\n    queue = [list(w) for w in words]\n    lines = []\n    cur = ''\n    streak = 0\n    k = 0\n    while k < len(queue):\n        syl = queue[k]\n        token = ''.join(syl)\n        need = len(token) if cur == '' else len(cur) + 1 + len(token)\n        if need <= width:\n            cur = token if cur == '' else cur + ' ' + token\n            k += 1\n            continue\n        split = None\n        if streak < limit and k < len(queue) - 1:\n            for cut in range(len(syl) - 1, 0, -1):\n                head = ''.join(syl[:cut]) + '-'\n                room = len(head) if cur == '' else len(cur) + len(head) + 1\n                if room <= width:\n                    split = cut\n                    break\n        if split is not None:\n            head = ''.join(syl[:split]) + '-'\n            lines.append(head if cur == '' else cur + ' ' + head)\n            queue[k] = syl[split:]\n            cur = ''\n            streak += 1\n        elif cur == '':\n            lines.append(token)\n            k += 1\n            streak = 0\n        else:\n            lines.append(cur)\n            cur, streak = '', streak\n    if cur:\n        lines.append(cur)\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('regression: streak reset on plain break', [[['line'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['jus', 'ti', 'fied'], ['a'], ['kern', 'ing'], ['text'], ['col', 'umn'], ['break', 'ing'], ['text'], ['col', 'umn']], 9, 1], ['line set-', 'ting', 'interna-', 'tional', 'justified', 'a kerning', 'text col-', 'umn', 'breaking', 'text', 'column']), ('regression: streak reset on plain break', [[['to'], ['jus', 'ti', 'fied'], ['set', 'ting'], ['type'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['kern', 'ing'], ['text'], ['pa', 'ra', 'graph']], 10, 3], ['to justi-', 'fied set-', 'ting type', 'hyphena-', 'tion set-', 'ting in-', 'ternational', 'setting', 'kerning', 'text', 'paragraph']), ('regression: streak reset on plain break', [[['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['lead', 'ing'], ['hy', 'phen', 'a', 'tion'], ['of'], ['to']], 6, 3], ['justi-', 'fied', 'hy-', 'phena-', 'tion', 'compo-', 'sition', 'inter-', 'na-', 'tional', 'lead-', 'ing', 'lead-', 'ing', 'hy-', 'phena-', 'tion', 'of to']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['hy', 'phen', 'a', 'tion'], ['break', 'ing'], ['of'], ['set', 'ting'], ['col', 'umn'], ['a']], 11, 1], ['hyphenation', 'breaking of', 'setting', 'column a']), ('control layout', [[['col', 'umn'], ['lead', 'ing'], ['of'], ['jus', 'ti', 'fied'], ['line']], 12, 3], ['column lead-', 'ing of jus-', 'tified line']), ('control layout', [[['kern', 'ing'], ['jus', 'ti', 'fied'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['a'], ['break', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['to'], ['com', 'po', 'si', 'tion']], 10, 3], ['kerning', 'justified', 'interna-', 'tional', 'setting a', 'breaking', 'interna-', 'tional to', 'composition'])], [('regression: streak reset on plain break', [[['a'], ['break', 'ing'], ['text'], ['to'], ['mar', 'gin'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al']], 6, 3], ['a', 'break-', 'ing', 'text', 'to', 'margin', 'set-', 'ting', 'inter-', 'na-', 'tional', 'international']), ('regression: streak reset on plain break', [[['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['to'], ['kern', 'ing'], ['mar', 'gin'], ['to'], ['lead', 'ing']], 6, 2], ['para-', 'graph', 'hy-', 'phena-', 'tion', 'inter-', 'na-', 'tional', 'justi-', 'fied', 'hy-', 'phena-', 'tion', 'to', 'kern-', 'ing', 'margin', 'to', 'leading']), ('regression: streak reset on plain break', [[['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['set', 'ting'], ['to'], ['mar', 'gin'], ['to'], ['jus', 'ti', 'fied'], ['jus', 'ti', 'fied'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['text']], 6, 2], ['inter-', 'na-', 'tional', 'inter-', 'na-', 'tional', 'para-', 'graph', 'set-', 'ting', 'to', 'margin', 'to', 'justi-', 'fied', 'justi-', 'fied', 'inter-', 'na-', 'tional', 'hy-', 'phena-', 'tion', 'text']), ('regression: streak reset on plain break', [[['type'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['type'], ['hy', 'phen', 'a', 'tion'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['mar', 'gin'], ['com', 'po', 'si', 'tion'], ['col', 'umn']], 12, 3], ['type inter-', 'national hy-', 'phenation', 'type hyphen-', 'ation hy-', 'phenation', 'leading mar-', 'gin composi-', 'tion column']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['type'], ['col', 'umn'], ['lead', 'ing'], ['lead', 'ing'], ['of'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al']], 10, 1], ['type col-', 'umn', 'leading', 'leading of', 'margin', 'international']), ('control layout', [[['a'], ['of'], ['type'], ['to'], ['col', 'umn'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph'], ['break', 'ing'], ['col', 'umn'], ['lead', 'ing'], ['com', 'po', 'si', 'tion']], 8, 3], ['a of', 'type to', 'column', 'interna-', 'tional', 'composi-', 'tion pa-', 'ragraph', 'breaking', 'column', 'leading', 'composition'])], [('regression: streak reset on plain break', [[['set', 'ting'], ['lead', 'ing'], ['jus', 'ti', 'fied'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['to'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['line']], 8, 1], ['setting', 'leading', 'justi-', 'fied of', 'interna-', 'tional', 'to jus-', 'tified', 'margin', 'line']), ('regression: streak reset on plain break', [[['hy', 'phen', 'a', 'tion'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting'], ['jus', 'ti', 'fied'], ['col', 'umn'], ['text'], ['pa', 'ra', 'graph'], ['jus', 'ti', 'fied'], ['a']], 9, 1], ['hyphena-', 'tion', 'hyphena-', 'tion', 'setting', 'justified', 'column', 'text pa-', 'ragraph', 'justified', 'a']), ('regression: streak reset on plain break', [[['set', 'ting'], ['set', 'ting'], ['pa', 'ra', 'graph'], ['col', 'umn'], ['to'], ['type'], ['col', 'umn'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['com', 'po', 'si', 'tion'], ['kern', 'ing'], ['col', 'umn']], 12, 2], ['setting set-', 'ting para-', 'graph column', 'to type col-', 'umn interna-', 'tional a', 'composition', 'kerning', 'column']), ('regression: streak reset on plain break', [[['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['lead', 'ing'], ['hy', 'phen', 'a', 'tion'], ['of'], ['to']], 6, 3], ['justi-', 'fied', 'hy-', 'phena-', 'tion', 'compo-', 'sition', 'inter-', 'na-', 'tional', 'lead-', 'ing', 'lead-', 'ing', 'hy-', 'phena-', 'tion', 'of to']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['col', 'umn'], ['pa', 'ra', 'graph'], ['text'], ['pa', 'ra', 'graph'], ['break', 'ing'], ['of'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['of'], ['jus', 'ti', 'fied'], ['in', 'ter', 'na', 'tion', 'al']], 11, 2], ['column pa-', 'ragraph', 'text para-', 'graph', 'breaking of', 'hyphenation', 'kerning of', 'justified', 'international']), ('control layout', [[['in', 'ter', 'na', 'tion', 'al'], ['of'], ['mar', 'gin'], ['set', 'ting'], ['pa', 'ra', 'graph'], ['com', 'po', 'si', 'tion']], 13, 2], ['international', 'of margin', 'setting para-', 'graph', 'composition'])], [('regression: streak reset on plain break', [[['line'], ['mar', 'gin'], ['lead', 'ing'], ['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion'], ['of'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['a'], ['type']], 7, 1], ['line', 'margin', 'leading', 'para-', 'graph', 'hyphen-', 'ation', 'of jus-', 'tified', 'para-', 'graph a', 'type']), ('regression: streak reset on plain break', [[['a'], ['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['of'], ['text'], ['line'], ['pa', 'ra', 'graph'], ['of']], 7, 1], ['a jus-', 'tified', 'hyphen-', 'ation', 'inter-', 'national', 'of text', 'line', 'para-', 'graph', 'of']), ('regression: streak reset on plain break', [[['of'], ['jus', 'ti', 'fied'], ['set', 'ting'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['break', 'ing']], 8, 3], ['of jus-', 'tified', 'setting', 'composi-', 'tion in-', 'terna-', 'tional', 'composi-', 'tion in-', 'terna-', 'tional', 'para-', 'graph', 'breaking']), ('regression: streak reset on plain break', [[['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['lead', 'ing'], ['hy', 'phen', 'a', 'tion'], ['of'], ['to']], 6, 3], ['justi-', 'fied', 'hy-', 'phena-', 'tion', 'compo-', 'sition', 'inter-', 'na-', 'tional', 'lead-', 'ing', 'lead-', 'ing', 'hy-', 'phena-', 'tion', 'of to']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['pa', 'ra', 'graph'], ['line'], ['col', 'umn'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['mar', 'gin'], ['to'], ['a'], ['col', 'umn'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['break', 'ing']], 11, 3], ['paragraph', 'line column', 'justified', 'margin mar-', 'gin to a', 'column hy-', 'phenation', 'justified', 'breaking']), ('control layout', [[['jus', 'ti', 'fied'], ['col', 'umn'], ['line'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['a'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['type'], ['mar', 'gin']], 11, 2], ['justified', 'column line', 'margin hy-', 'phenation a', 'justified', 'paragraph', 'type margin'])], [('regression: streak reset on plain break', [[['col', 'umn'], ['of'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['lead', 'ing'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['line'], ['col', 'umn']], 6, 3], ['column', 'of', 'compo-', 'sition', 'inter-', 'na-', 'tional', 'a', 'lead-', 'ing', 'compo-', 'sition', 'inter-', 'na-', 'tional', 'set-', 'ting', 'line', 'column']), ('regression: streak reset on plain break', [[['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['col', 'umn'], ['of'], ['set', 'ting'], ['pa', 'ra', 'graph'], ['kern', 'ing']], 13, 1], ['hyphenation', 'leading col-', 'umn of', 'setting para-', 'graph kerning']), ('regression: streak reset on plain break', [[['in', 'ter', 'na', 'tion', 'al'], ['to'], ['com', 'po', 'si', 'tion'], ['jus', 'ti', 'fied'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['pa', 'ra', 'graph'], ['type']], 7, 2], ['inter-', 'nation-', 'al to', 'compo-', 'sition', 'justi-', 'fied', 'justi-', 'fied', 'break-', 'ing pa-', 'ragraph', 'type']), ('regression: streak reset on plain break', [[['col', 'umn'], ['kern', 'ing'], ['com', 'po', 'si', 'tion'], ['a'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['kern', 'ing'], ['hy', 'phen', 'a', 'tion'], ['text'], ['mar', 'gin'], ['to']], 13, 3], ['column kern-', 'ing composi-', 'tion a inter-', 'national', 'leading kern-', 'ing hyphena-', 'tion text', 'margin to']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['mar', 'gin'], ['pa', 'ra', 'graph'], ['jus', 'ti', 'fied'], ['kern', 'ing'], ['col', 'umn'], ['jus', 'ti', 'fied'], ['text'], ['a'], ['jus', 'ti', 'fied'], ['break', 'ing']], 11, 2], ['margin pa-', 'ragraph', 'justified', 'kerning', 'column jus-', 'tified text', 'a justified', 'breaking']), ('control layout', [[['lead', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['break', 'ing'], ['mar', 'gin'], ['pa', 'ra', 'graph'], ['lead', 'ing']], 10, 3], ['leading', 'interna-', 'tional', 'composi-', 'tion', 'breaking', 'margin pa-', 'ragraph', 'leading'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\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":"A deterministic toy typesetting model with integer widths and a stipulated rule set; it does not claim conformance to any engine. 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":"w2-typography-line-breaking-hyphen-ladder-streak-reset-on-plain-break","generated_at":"2026-09-29T14:49:49.324157+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Line breaking decides where paragraphs wrap on screen and in print; a wrong decision point shifts every following line.","root_cause":"Ending a line at a space does not reset the consecutive-hyphen counter.","sha256":"06814f4653b8367fd1849103004842cab044791144801a6041bf2d1875293092","title":"Consecutive hyphen limit: streak reset on plain break · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.962,"exit_code":1,"observations":[{"actual":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"check":"ladder of three hyphenated lines","expected":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"passed":true},{"actual":["line set-","ting","interna-","tional","justified","a kerning","text col-","umn","breaking","text","column"],"check":"regression: streak reset on plain break","expected":["line set-","ting","interna-","tional","justified","a kerning","text col-","umn","breaking","text","column"],"passed":true},{"actual":["to justi-","fied set-","ting type","hyphena-","tion set-","ting","interna-","tional","setting","kerning","text","paragraph"],"check":"regression: streak reset on plain break","expected":["to justi-","fied set-","ting type","hyphena-","tion set-","ting in-","ternational","setting","kerning","text","paragraph"],"passed":false},{"actual":["justi-","fied","hy-","phena-","tion","compo-","sition","inter-","na-","tional","lead-","ing","lead-","ing","hy-","phenation","of to"],"check":"regression: streak reset on plain break","expected":["justi-","fied","hy-","phena-","tion","compo-","sition","inter-","na-","tional","lead-","ing","lead-","ing","hy-","phena-","tion","of to"],"passed":false},{"actual":["a","composition"],"check":"last word never hyphenated","expected":["a","composition"],"passed":true},{"actual":["hyphenation","breaking of","setting","column a"],"check":"control layout","expected":["hyphenation","breaking of","setting","column a"],"passed":true},{"actual":["column lead-","ing of jus-","tified line"],"check":"control layout","expected":["column lead-","ing of jus-","tified line"],"passed":true},{"actual":["kerning","justified","interna-","tional","setting a","breaking","interna-","tional to","composition"],"check":"control layout","expected":["kerning","justified","interna-","tional","setting a","breaking","interna-","tional to","composition"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ladder of three hyphenated lines\", \"actual\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"expected\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"passed\": true}, {\"check\": \"regression: streak reset on plain break\", \"actual\": [\"line set-\", \"ting\", \"interna-\", \"tional\", \"justified\", \"a kerning\", \"text col-\", \"umn\", \"breaking\", \"text\", \"column\"], \"expected\": [\"line set-\", \"ting\", \"interna-\", \"tional\", \"justified\", \"a kerning\", \"text col-\", \"umn\", \"breaking\", \"text\", \"column\"], \"passed\": true}, {\"check\": \"regression: streak reset on plain break\", \"actual\": [\"to justi-\", \"fied set-\", \"ting type\", \"hyphena-\", \"tion set-\", \"ting\", \"interna-\", \"tional\", \"setting\", \"kerning\", \"text\", \"paragraph\"], \"expected\": [\"to justi-\", \"fied set-\", \"ting type\", \"hyphena-\", \"tion set-\", \"ting in-\", \"ternational\", \"setting\", \"kerning\", \"text\", \"paragraph\"], \"passed\": false}, {\"check\": \"regression: streak reset on plain break\", \"actual\": [\"justi-\", \"fied\", \"hy-\", \"phena-\", \"tion\", \"compo-\", \"sition\", \"inter-\", \"na-\", \"tional\", \"lead-\", \"ing\", \"lead-\", \"ing\", \"hy-\", \"phenation\", \"of to\"], \"expected\": [\"justi-\", \"fied\", \"hy-\", \"phena-\", \"tion\", \"compo-\", \"sition\", \"inter-\", \"na-\", \"tional\", \"lead-\", \"ing\", \"lead-\", \"ing\", \"hy-\", \"phena-\", \"tion\", \"of to\"], \"passed\": false}, {\"check\": \"last word never hyphenated\", \"actual\": [\"a\", \"composition\"], \"expected\": [\"a\", \"composition\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"hyphenation\", \"breaking of\", \"setting\", \"column a\"], \"expected\": [\"hyphenation\", \"breaking of\", \"setting\", \"column a\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"column lead-\", \"ing of jus-\", \"tified line\"], \"expected\": [\"column lead-\", \"ing of jus-\", \"tified line\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"kerning\", \"justified\", \"interna-\", \"tional\", \"setting a\", \"breaking\", \"interna-\", \"tional to\", \"composition\"], \"expected\": [\"kerning\", \"justified\", \"interna-\", \"tional\", \"setting a\", \"breaking\", \"interna-\", \"tional to\", \"composition\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.58,"exit_code":1,"observations":[{"actual":["inter-","nation-","al","composition","hyphen-","ation","text"],"check":"ladder of three hyphenated lines","expected":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"passed":false},{"actual":["line set-","ting","international","justified","a kerning","text col-","umn","breaking","text","column"],"check":"regression: streak reset on plain break","expected":["line set-","ting","interna-","tional","justified","a kerning","text col-","umn","breaking","text","column"],"passed":false},{"actual":["to justi-","fied set-","ting type","hyphena-","tion","setting","international","setting","kerning","text","paragraph"],"check":"regression: streak reset on plain break","expected":["to justi-","fied set-","ting type","hyphena-","tion set-","ting in-","ternational","setting","kerning","text","paragraph"],"passed":false},{"actual":["justi-","fied","hy-","phena-","tion","composition","inter-","na-","tional","lead-","ing","leading","hy-","phena-","tion","of to"],"check":"regression: streak reset on plain break","expected":["justi-","fied","hy-","phena-","tion","compo-","sition","inter-","na-","tional","lead-","ing","lead-","ing","hy-","phena-","tion","of to"],"passed":false},{"actual":["a","composition"],"check":"last word never hyphenated","expected":["a","composition"],"passed":true},{"actual":["hyphenation","breaking of","setting","column a"],"check":"control layout","expected":["hyphenation","breaking of","setting","column a"],"passed":true},{"actual":["column lead-","ing of jus-","tified line"],"check":"control layout","expected":["column lead-","ing of jus-","tified line"],"passed":true},{"actual":["kerning","justified","interna-","tional","setting a","breaking","interna-","tional to","composition"],"check":"control layout","expected":["kerning","justified","interna-","tional","setting a","breaking","interna-","tional to","composition"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ladder of three hyphenated lines\", \"actual\": [\"inter-\", \"nation-\", \"al\", \"composition\", \"hyphen-\", \"ation\", \"text\"], \"expected\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"passed\": false}, {\"check\": \"regression: streak reset on plain break\", \"actual\": [\"line set-\", \"ting\", \"international\", \"justified\", \"a kerning\", \"text col-\", \"umn\", \"breaking\", \"text\", \"column\"], \"expected\": [\"line set-\", \"ting\", \"interna-\", \"tional\", \"justified\", \"a kerning\", \"text col-\", \"umn\", \"breaking\", \"text\", \"column\"], \"passed\": false}, {\"check\": \"regression: streak reset on plain break\", \"actual\": [\"to justi-\", \"fied set-\", \"ting type\", \"hyphena-\", \"tion\", \"setting\", \"international\", \"setting\", \"kerning\", \"text\", \"paragraph\"], \"expected\": [\"to justi-\", \"fied set-\", \"ting type\", \"hyphena-\", \"tion set-\", \"ting in-\", \"ternational\", \"setting\", \"kerning\", \"text\", \"paragraph\"], \"passed\": false}, {\"check\": \"regression: streak reset on plain break\", \"actual\": [\"justi-\", \"fied\", \"hy-\", \"phena-\", \"tion\", \"composition\", \"inter-\", \"na-\", \"tional\", \"lead-\", \"ing\", \"leading\", \"hy-\", \"phena-\", \"tion\", \"of to\"], \"expected\": [\"justi-\", \"fied\", \"hy-\", \"phena-\", \"tion\", \"compo-\", \"sition\", \"inter-\", \"na-\", \"tional\", \"lead-\", \"ing\", \"lead-\", \"ing\", \"hy-\", \"phena-\", \"tion\", \"of to\"], \"passed\": false}, {\"check\": \"last word never hyphenated\", \"actual\": [\"a\", \"composition\"], \"expected\": [\"a\", \"composition\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"hyphenation\", \"breaking of\", \"setting\", \"column a\"], \"expected\": [\"hyphenation\", \"breaking of\", \"setting\", \"column a\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"column lead-\", \"ing of jus-\", \"tified line\"], \"expected\": [\"column lead-\", \"ing of jus-\", \"tified line\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"kerning\", \"justified\", \"interna-\", \"tional\", \"setting a\", \"breaking\", \"interna-\", \"tional to\", \"composition\"], \"expected\": [\"kerning\", \"justified\", \"interna-\", \"tional\", \"setting a\", \"breaking\", \"interna-\", \"tional to\", \"composition\"], \"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."}}