{"abstract":"Words are split at their first syllable, wasting line space.","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":"Skipping the last boundary still leaves space unused.","family":"w2-typography-line-breaking-hyphen-ladder-latest-boundary-preference","id":"FA-79966","implementations":{"attempt":{"sha256":"66e4888ab2123f508b6ec1803b4e67fa872947174e448b872672f22a4a2e8a16","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) - 2, 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 = '', 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: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['a'], ['type'], ['a'], ['com', 'po', 'si', 'tion'], ['kern', 'ing'], ['of']], 14, 3], ['international', 'paragraph a', 'type a compo-', 'sition kerning', 'of']), ('regression: latest boundary preference', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('regression: latest boundary preference', [[['mar', 'gin'], ['jus', 'ti', 'fied'], ['lead', 'ing'], ['col', 'umn'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['set', 'ting'], ['a']], 6, 3], ['margin', 'justi-', 'fied', 'lead-', 'ing', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phena-', 'tion', 'para-', 'graph', 'lead-', 'ing', 'set-', 'ting a']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['to'], ['break', 'ing'], ['break', 'ing'], ['type'], ['lead', 'ing'], ['break', 'ing'], ['jus', 'ti', 'fied']], 12, 1], ['to breaking', 'breaking', 'type leading', 'breaking', 'justified']), ('control layout', [[['pa', 'ra', 'graph'], ['kern', 'ing'], ['kern', 'ing'], ['set', 'ting'], ['mar', 'gin'], ['set', 'ting']], 9, 2], ['paragraph', 'kerning', 'kerning', 'setting', 'margin', 'setting']), ('control layout', [[['col', 'umn'], ['set', 'ting'], ['break', 'ing'], ['type'], ['text'], ['of'], ['pa', 'ra', 'graph']], 10, 1], ['column', 'setting', 'breaking', 'type text', 'of', 'paragraph'])], [('regression: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['to'], ['kern', 'ing'], ['a'], ['col', 'umn'], ['line'], ['of'], ['of'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing']], 14, 1], ['international', 'to kerning a', 'column line of', 'of of interna-', 'tional kerning']), ('regression: latest boundary preference', [[['a'], ['in', 'ter', 'na', 'tion', 'al'], ['of'], ['to'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['line'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['hy', 'phen', 'a', 'tion']], 14, 3], ['a internation-', 'al of to mar-', 'gin justified', 'paragraph', 'leading line', 'international', 'a hyphenation']), ('regression: latest boundary preference', [[['jus', 'ti', 'fied'], ['com', 'po', 'si', 'tion'], ['type'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['lead', 'ing'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph'], ['set', 'ting'], ['lead', 'ing']], 7, 1], ['justi-', 'fied', 'compo-', 'sition', 'type', 'margin', 'inter-', 'national', 'leading', 'leading', 'hyphen-', 'ation', 'compo-', 'sition', 'para-', 'graph', 'setting', 'leading']), ('partial-repair probe', [[['of'], ['lead', 'ing'], ['set', 'ting'], ['kern', 'ing'], ['col', 'umn'], ['line'], ['type'], ['col', 'umn']], 13, 3], ['of leading', 'setting kern-', 'ing column', 'line type', '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', [[['col', 'umn'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['type']], 9, 2], ['column', 'justified', 'margin', 'justified', 'type']), ('control layout', [[['kern', 'ing'], ['line'], ['kern', 'ing'], ['a'], ['to']], 14, 1], ['kerning line', 'kerning a to'])], [('regression: latest boundary preference', [[['mar', 'gin'], ['jus', 'ti', 'fied'], ['lead', 'ing'], ['col', 'umn'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['set', 'ting'], ['a']], 6, 3], ['margin', 'justi-', 'fied', 'lead-', 'ing', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phena-', 'tion', 'para-', 'graph', 'lead-', 'ing', 'set-', 'ting a']), ('regression: latest boundary preference', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('regression: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['type'], ['type'], ['lead', 'ing'], ['break', 'ing'], ['mar', 'gin'], ['break', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting']], 9, 1], ['interna-', 'tional', 'hyphena-', 'tion', 'kerning', 'interna-', 'tional', 'type type', 'leading', 'breaking', 'margin', 'breaking', 'interna-', 'tional', 'setting']), ('regression: latest boundary preference', [[['a'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['mar', 'gin'], ['type'], ['to']], 13, 3], ['a composition', 'leading mar-', 'gin hyphena-', 'tion margin', 'type 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', [[['type'], ['lead', 'ing'], ['of'], ['jus', 'ti', 'fied'], ['mar', 'gin']], 8, 3], ['type', 'leading', 'of jus-', 'tified', 'margin']), ('control layout', [[['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph']], 13, 2], ['composition', 'international', 'margin hy-', 'phenation', 'paragraph'])], [('regression: latest boundary preference', [[['to'], ['of'], ['type'], ['line'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['line'], ['pa', 'ra', 'graph'], ['jus', 'ti', 'fied'], ['col', 'umn']], 8, 1], ['to of', 'type', 'line', 'justi-', 'fied', 'para-', 'graph', 'line pa-', 'ragraph', 'justi-', 'fied', 'column']), ('regression: latest boundary preference', [[['jus', 'ti', 'fied'], ['type'], ['type'], ['kern', 'ing'], ['lead', 'ing']], 6, 3], ['justi-', 'fied', 'type', 'type', 'kern-', 'ing', 'leading']), ('regression: latest boundary preference', [[['hy', 'phen', 'a', 'tion'], ['a'], ['line'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['text'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['lead', 'ing'], ['type']], 11, 2], ['hyphenation', 'a line mar-', 'gin inter-', 'national', 'text compo-', 'sition', 'leading', 'leading', 'type']), ('regression: latest boundary preference', [[['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['col', 'umn']], 7, 3], ['break-', 'ing hy-', 'phena-', 'tion', 'justi-', 'fied', 'para-', 'graph', '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', [[['col', 'umn'], ['com', 'po', 'si', 'tion'], ['a'], ['col', 'umn'], ['line']], 12, 2], ['column com-', 'position a', 'column line']), ('control layout', [[['line'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['of'], ['line']], 9, 3], ['line jus-', 'tified', 'margin', 'justified', 'breaking', 'of line'])], [('regression: latest boundary preference', [[['kern', 'ing'], ['pa', 'ra', 'graph'], ['a'], ['pa', 'ra', 'graph'], ['of'], ['pa', 'ra', 'graph'], ['text']], 6, 1], ['kern-', 'ing', 'para-', 'graph', 'a pa-', 'ragraph', 'of pa-', 'ragraph', 'text']), ('regression: latest boundary preference', [[['set', 'ting'], ['line'], ['pa', 'ra', 'graph'], ['of'], ['text'], ['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph']], 10, 1], ['setting', 'line para-', 'graph of', 'text para-', 'graph', 'hyphena-', 'tion', 'leading', 'composi-', 'tion', 'paragraph']), ('regression: latest boundary preference', [[['set', 'ting'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['of'], ['type'], ['col', 'umn'], ['line'], ['mar', 'gin'], ['to'], ['kern', 'ing']], 9, 3], ['setting', 'hyphena-', 'tion jus-', 'tified of', 'type col-', 'umn line', 'margin to', 'kerning']), ('partial-repair probe', [[['text'], ['kern', 'ing'], ['line'], ['set', 'ting'], ['break', 'ing'], ['to'], ['mar', 'gin'], ['line'], ['col', 'umn'], ['lead', 'ing'], ['com', 'po', 'si', 'tion'], ['type']], 13, 1], ['text kerning', 'line setting', 'breaking to', 'margin line', 'column lead-', 'ing', 'composition', 'type']), ('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', [[['set', 'ting'], ['set', 'ting'], ['a'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['to'], ['col', 'umn'], ['break', 'ing'], ['jus', 'ti', 'fied'], ['type'], ['set', 'ting']], 11, 3], ['setting', 'setting a', 'justified', 'paragraph', 'to column', 'breaking', 'justified', 'type', 'setting']), ('control layout', [[['to'], ['to'], ['com', 'po', 'si', 'tion'], ['line'], ['type'], ['com', 'po', 'si', 'tion'], ['col', 'umn'], ['break', 'ing']], 11, 2], ['to to com-', 'position', 'line type', 'composition', 'column', 'breaking'])]]\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":"49ee686999915636a315d0af084c99c47a9c71ea6bae9c64d60a2680cf7bc8ec","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(1, len(syl)):\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 = '', 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: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['a'], ['type'], ['a'], ['com', 'po', 'si', 'tion'], ['kern', 'ing'], ['of']], 14, 3], ['international', 'paragraph a', 'type a compo-', 'sition kerning', 'of']), ('regression: latest boundary preference', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('regression: latest boundary preference', [[['mar', 'gin'], ['jus', 'ti', 'fied'], ['lead', 'ing'], ['col', 'umn'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['set', 'ting'], ['a']], 6, 3], ['margin', 'justi-', 'fied', 'lead-', 'ing', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phena-', 'tion', 'para-', 'graph', 'lead-', 'ing', 'set-', 'ting a']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['to'], ['break', 'ing'], ['break', 'ing'], ['type'], ['lead', 'ing'], ['break', 'ing'], ['jus', 'ti', 'fied']], 12, 1], ['to breaking', 'breaking', 'type leading', 'breaking', 'justified']), ('control layout', [[['pa', 'ra', 'graph'], ['kern', 'ing'], ['kern', 'ing'], ['set', 'ting'], ['mar', 'gin'], ['set', 'ting']], 9, 2], ['paragraph', 'kerning', 'kerning', 'setting', 'margin', 'setting']), ('control layout', [[['col', 'umn'], ['set', 'ting'], ['break', 'ing'], ['type'], ['text'], ['of'], ['pa', 'ra', 'graph']], 10, 1], ['column', 'setting', 'breaking', 'type text', 'of', 'paragraph'])], [('regression: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['to'], ['kern', 'ing'], ['a'], ['col', 'umn'], ['line'], ['of'], ['of'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing']], 14, 1], ['international', 'to kerning a', 'column line of', 'of of interna-', 'tional kerning']), ('regression: latest boundary preference', [[['a'], ['in', 'ter', 'na', 'tion', 'al'], ['of'], ['to'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['line'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['hy', 'phen', 'a', 'tion']], 14, 3], ['a internation-', 'al of to mar-', 'gin justified', 'paragraph', 'leading line', 'international', 'a hyphenation']), ('regression: latest boundary preference', [[['jus', 'ti', 'fied'], ['com', 'po', 'si', 'tion'], ['type'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['lead', 'ing'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph'], ['set', 'ting'], ['lead', 'ing']], 7, 1], ['justi-', 'fied', 'compo-', 'sition', 'type', 'margin', 'inter-', 'national', 'leading', 'leading', 'hyphen-', 'ation', 'compo-', 'sition', 'para-', 'graph', 'setting', 'leading']), ('partial-repair probe', [[['of'], ['lead', 'ing'], ['set', 'ting'], ['kern', 'ing'], ['col', 'umn'], ['line'], ['type'], ['col', 'umn']], 13, 3], ['of leading', 'setting kern-', 'ing column', 'line type', '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', [[['col', 'umn'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['type']], 9, 2], ['column', 'justified', 'margin', 'justified', 'type']), ('control layout', [[['kern', 'ing'], ['line'], ['kern', 'ing'], ['a'], ['to']], 14, 1], ['kerning line', 'kerning a to'])], [('regression: latest boundary preference', [[['mar', 'gin'], ['jus', 'ti', 'fied'], ['lead', 'ing'], ['col', 'umn'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['set', 'ting'], ['a']], 6, 3], ['margin', 'justi-', 'fied', 'lead-', 'ing', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phena-', 'tion', 'para-', 'graph', 'lead-', 'ing', 'set-', 'ting a']), ('regression: latest boundary preference', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('regression: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['type'], ['type'], ['lead', 'ing'], ['break', 'ing'], ['mar', 'gin'], ['break', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting']], 9, 1], ['interna-', 'tional', 'hyphena-', 'tion', 'kerning', 'interna-', 'tional', 'type type', 'leading', 'breaking', 'margin', 'breaking', 'interna-', 'tional', 'setting']), ('regression: latest boundary preference', [[['a'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['mar', 'gin'], ['type'], ['to']], 13, 3], ['a composition', 'leading mar-', 'gin hyphena-', 'tion margin', 'type 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', [[['type'], ['lead', 'ing'], ['of'], ['jus', 'ti', 'fied'], ['mar', 'gin']], 8, 3], ['type', 'leading', 'of jus-', 'tified', 'margin']), ('control layout', [[['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph']], 13, 2], ['composition', 'international', 'margin hy-', 'phenation', 'paragraph'])], [('regression: latest boundary preference', [[['to'], ['of'], ['type'], ['line'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['line'], ['pa', 'ra', 'graph'], ['jus', 'ti', 'fied'], ['col', 'umn']], 8, 1], ['to of', 'type', 'line', 'justi-', 'fied', 'para-', 'graph', 'line pa-', 'ragraph', 'justi-', 'fied', 'column']), ('regression: latest boundary preference', [[['jus', 'ti', 'fied'], ['type'], ['type'], ['kern', 'ing'], ['lead', 'ing']], 6, 3], ['justi-', 'fied', 'type', 'type', 'kern-', 'ing', 'leading']), ('regression: latest boundary preference', [[['hy', 'phen', 'a', 'tion'], ['a'], ['line'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['text'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['lead', 'ing'], ['type']], 11, 2], ['hyphenation', 'a line mar-', 'gin inter-', 'national', 'text compo-', 'sition', 'leading', 'leading', 'type']), ('regression: latest boundary preference', [[['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['col', 'umn']], 7, 3], ['break-', 'ing hy-', 'phena-', 'tion', 'justi-', 'fied', 'para-', 'graph', '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', [[['col', 'umn'], ['com', 'po', 'si', 'tion'], ['a'], ['col', 'umn'], ['line']], 12, 2], ['column com-', 'position a', 'column line']), ('control layout', [[['line'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['of'], ['line']], 9, 3], ['line jus-', 'tified', 'margin', 'justified', 'breaking', 'of line'])], [('regression: latest boundary preference', [[['kern', 'ing'], ['pa', 'ra', 'graph'], ['a'], ['pa', 'ra', 'graph'], ['of'], ['pa', 'ra', 'graph'], ['text']], 6, 1], ['kern-', 'ing', 'para-', 'graph', 'a pa-', 'ragraph', 'of pa-', 'ragraph', 'text']), ('regression: latest boundary preference', [[['set', 'ting'], ['line'], ['pa', 'ra', 'graph'], ['of'], ['text'], ['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph']], 10, 1], ['setting', 'line para-', 'graph of', 'text para-', 'graph', 'hyphena-', 'tion', 'leading', 'composi-', 'tion', 'paragraph']), ('regression: latest boundary preference', [[['set', 'ting'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['of'], ['type'], ['col', 'umn'], ['line'], ['mar', 'gin'], ['to'], ['kern', 'ing']], 9, 3], ['setting', 'hyphena-', 'tion jus-', 'tified of', 'type col-', 'umn line', 'margin to', 'kerning']), ('partial-repair probe', [[['text'], ['kern', 'ing'], ['line'], ['set', 'ting'], ['break', 'ing'], ['to'], ['mar', 'gin'], ['line'], ['col', 'umn'], ['lead', 'ing'], ['com', 'po', 'si', 'tion'], ['type']], 13, 1], ['text kerning', 'line setting', 'breaking to', 'margin line', 'column lead-', 'ing', 'composition', 'type']), ('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', [[['set', 'ting'], ['set', 'ting'], ['a'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['to'], ['col', 'umn'], ['break', 'ing'], ['jus', 'ti', 'fied'], ['type'], ['set', 'ting']], 11, 3], ['setting', 'setting a', 'justified', 'paragraph', 'to column', 'breaking', 'justified', 'type', 'setting']), ('control layout', [[['to'], ['to'], ['com', 'po', 'si', 'tion'], ['line'], ['type'], ['com', 'po', 'si', 'tion'], ['col', 'umn'], ['break', 'ing']], 11, 2], ['to to com-', 'position', 'line type', 'composition', 'column', 'breaking'])]]\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-latest-boundary-preference","generated_at":"2026-09-29T14:49:49.577608+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":"Candidate boundaries are scanned from the start of the word instead of from the end.","sha256":"be102a1340dbb73adb8531f5c197d925c9b6863f3c9a35dee575973b2e0d9827","title":"Consecutive hyphen limit: latest boundary preference · 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":44.747,"exit_code":1,"observations":[{"actual":["inter-","na-","tional","compo-","sition","hyphen-","ation","text"],"check":"ladder of three hyphenated lines","expected":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"passed":false},{"actual":["international","paragraph a","type a compo-","sition kerning","of"],"check":"regression: latest boundary preference","expected":["international","paragraph a","type a compo-","sition kerning","of"],"passed":true},{"actual":["setting","justified","breaking","type type","text","breaking","hyphenation","a setting"],"check":"regression: latest boundary preference","expected":["setting","justified","breaking","type type","text break-","ing hyphen-","ation a","setting"],"passed":false},{"actual":["margin","jus-","tified","leading","column","of in-","terna-","tional","hy-","phen-","ation","pa-","ragraph","leading","setting","a"],"check":"regression: latest boundary preference","expected":["margin","justi-","fied","lead-","ing","column","of in-","terna-","tional","hy-","phena-","tion","para-","graph","lead-","ing","set-","ting a"],"passed":false},{"actual":["a","composition"],"check":"last word never hyphenated","expected":["a","composition"],"passed":true},{"actual":["to breaking","breaking","type leading","breaking","justified"],"check":"control layout","expected":["to breaking","breaking","type leading","breaking","justified"],"passed":true},{"actual":["paragraph","kerning","kerning","setting","margin","setting"],"check":"control layout","expected":["paragraph","kerning","kerning","setting","margin","setting"],"passed":true},{"actual":["column","setting","breaking","type text","of","paragraph"],"check":"control layout","expected":["column","setting","breaking","type text","of","paragraph"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ladder of three hyphenated lines\", \"actual\": [\"inter-\", \"na-\", \"tional\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"expected\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"passed\": false}, {\"check\": \"regression: latest boundary preference\", \"actual\": [\"international\", \"paragraph a\", \"type a compo-\", \"sition kerning\", \"of\"], \"expected\": [\"international\", \"paragraph a\", \"type a compo-\", \"sition kerning\", \"of\"], \"passed\": true}, {\"check\": \"regression: latest boundary preference\", \"actual\": [\"setting\", \"justified\", \"breaking\", \"type type\", \"text\", \"breaking\", \"hyphenation\", \"a setting\"], \"expected\": [\"setting\", \"justified\", \"breaking\", \"type type\", \"text break-\", \"ing hyphen-\", \"ation a\", \"setting\"], \"passed\": false}, {\"check\": \"regression: latest boundary preference\", \"actual\": [\"margin\", \"jus-\", \"tified\", \"leading\", \"column\", \"of in-\", \"terna-\", \"tional\", \"hy-\", \"phen-\", \"ation\", \"pa-\", \"ragraph\", \"leading\", \"setting\", \"a\"], \"expected\": [\"margin\", \"justi-\", \"fied\", \"lead-\", \"ing\", \"column\", \"of in-\", \"terna-\", \"tional\", \"hy-\", \"phena-\", \"tion\", \"para-\", \"graph\", \"lead-\", \"ing\", \"set-\", \"ting a\"], \"passed\": false}, {\"check\": \"last word never hyphenated\", \"actual\": [\"a\", \"composition\"], \"expected\": [\"a\", \"composition\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"to breaking\", \"breaking\", \"type leading\", \"breaking\", \"justified\"], \"expected\": [\"to breaking\", \"breaking\", \"type leading\", \"breaking\", \"justified\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"paragraph\", \"kerning\", \"kerning\", \"setting\", \"margin\", \"setting\"], \"expected\": [\"paragraph\", \"kerning\", \"kerning\", \"setting\", \"margin\", \"setting\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"column\", \"setting\", \"breaking\", \"type text\", \"of\", \"paragraph\"], \"expected\": [\"column\", \"setting\", \"breaking\", \"type text\", \"of\", \"paragraph\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.403,"exit_code":1,"observations":[{"actual":["in-","ter-","national","com-","po-","sition","hy-","phen-","ation","text"],"check":"ladder of three hyphenated lines","expected":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"passed":false},{"actual":["international","paragraph a","type a com-","position kern-","ing of"],"check":"regression: latest boundary preference","expected":["international","paragraph a","type a compo-","sition kerning","of"],"passed":false},{"actual":["setting","justified","breaking","type type","text break-","ing hy-","phenation a","setting"],"check":"regression: latest boundary preference","expected":["setting","justified","breaking","type type","text break-","ing hyphen-","ation a","setting"],"passed":false},{"actual":["margin","jus-","tified","lead-","ing","column","of in-","ter-","na-","tional","hy-","phen-","ation","pa-","ra-","graph","lead-","ing","set-","ting a"],"check":"regression: latest boundary preference","expected":["margin","justi-","fied","lead-","ing","column","of in-","terna-","tional","hy-","phena-","tion","para-","graph","lead-","ing","set-","ting a"],"passed":false},{"actual":["a","composition"],"check":"last word never hyphenated","expected":["a","composition"],"passed":true},{"actual":["to breaking","breaking","type leading","breaking","justified"],"check":"control layout","expected":["to breaking","breaking","type leading","breaking","justified"],"passed":true},{"actual":["paragraph","kerning","kerning","setting","margin","setting"],"check":"control layout","expected":["paragraph","kerning","kerning","setting","margin","setting"],"passed":true},{"actual":["column","setting","breaking","type text","of","paragraph"],"check":"control layout","expected":["column","setting","breaking","type text","of","paragraph"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ladder of three hyphenated lines\", \"actual\": [\"in-\", \"ter-\", \"national\", \"com-\", \"po-\", \"sition\", \"hy-\", \"phen-\", \"ation\", \"text\"], \"expected\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"passed\": false}, {\"check\": \"regression: latest boundary preference\", \"actual\": [\"international\", \"paragraph a\", \"type a com-\", \"position kern-\", \"ing of\"], \"expected\": [\"international\", \"paragraph a\", \"type a compo-\", \"sition kerning\", \"of\"], \"passed\": false}, {\"check\": \"regression: latest boundary preference\", \"actual\": [\"setting\", \"justified\", \"breaking\", \"type type\", \"text break-\", \"ing hy-\", \"phenation a\", \"setting\"], \"expected\": [\"setting\", \"justified\", \"breaking\", \"type type\", \"text break-\", \"ing hyphen-\", \"ation a\", \"setting\"], \"passed\": false}, {\"check\": \"regression: latest boundary preference\", \"actual\": [\"margin\", \"jus-\", \"tified\", \"lead-\", \"ing\", \"column\", \"of in-\", \"ter-\", \"na-\", \"tional\", \"hy-\", \"phen-\", \"ation\", \"pa-\", \"ra-\", \"graph\", \"lead-\", \"ing\", \"set-\", \"ting a\"], \"expected\": [\"margin\", \"justi-\", \"fied\", \"lead-\", \"ing\", \"column\", \"of in-\", \"terna-\", \"tional\", \"hy-\", \"phena-\", \"tion\", \"para-\", \"graph\", \"lead-\", \"ing\", \"set-\", \"ting a\"], \"passed\": false}, {\"check\": \"last word never hyphenated\", \"actual\": [\"a\", \"composition\"], \"expected\": [\"a\", \"composition\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"to breaking\", \"breaking\", \"type leading\", \"breaking\", \"justified\"], \"expected\": [\"to breaking\", \"breaking\", \"type leading\", \"breaking\", \"justified\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"paragraph\", \"kerning\", \"kerning\", \"setting\", \"margin\", \"setting\"], \"expected\": [\"paragraph\", \"kerning\", \"kerning\", \"setting\", \"margin\", \"setting\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"column\", \"setting\", \"breaking\", \"type text\", \"of\", \"paragraph\"], \"expected\": [\"column\", \"setting\", \"breaking\", \"type text\", \"of\", \"paragraph\"], \"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."}}