{"abstract":"Lines end with an opening bracket.","category":"Typography line breaking","checks":8,"contract":"Input [text of full-width characters, line length L]. Lines take L characters. If the next character is a hanging comma/period (、。，．) and is not itself followed by a line-start-prohibited character, it hangs on the line (burasage). Otherwise move characters to the next line while the next line would start with a prohibited character (、。，．）」』！？ー and small kana), then while the line would end with an opening bracket; a line keeps at least one character. Return the lines.","contract_signature":"x","evaluation_group":"w2-typography-line-breaking-kinsoku","failed_approach":"Looking two characters back misses the bracket in the final slot.","family":"w2-typography-line-breaking-kinsoku-line-end-prohibition-index","id":"FA-80021","implementations":{"attempt":{"sha256":"c29ec59eecc8b5b2c3bf2db4b011b1f6d0669a696a1a2976ed4f17a7818d2701","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    text, L = x\n    NO_START = '、。，．）」』！？ーぁぃぅぇぉっゃゅょ'\n    NO_END = '（「『'\n    HANG = '、。，．'\n    lines = []\n    pos = 0\n    n = len(text)\n    while pos < n:\n        end = pos + L\n        if end >= n:\n            lines.append(text[pos:])\n            break\n        if text[end] in HANG and (end + 1 >= n or text[end + 1] not in NO_START):\n            end += 1\n        else:\n            while end > pos + 1 and text[end] in NO_START:\n                end -= 1\n            while end > pos + 1 and text[end - 2] in NO_END:\n                end -= 1\n        lines.append(text[pos:end])\n        pos = end\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('opening bracket at line end', ['日本語「文字」組版', 4], ['日本語', '「文字」', '組版']), ('regression: line-end prohibition index', ['、「組ー『ここっーかえあくい語『うき組、』。え', 5], ['、「組ー', '『ここっー', 'かえあくい', '語『うき', '組、』。え']), ('partial-repair probe', ['」「、本え』え日字字ゃゃ。き組。こ組う字版（', 3], ['」「、', '本え』', 'え日字', '字ゃゃ。', 'き組。', 'こ組う', '字版（']), ('regression: line-end prohibition index', ['いこ組うい）（「く文き語文くっ本『』語お版', 6], ['いこ組うい）', '（「く文き語', '文くっ本『』', '語お版']), ('period hangs past the measure', ['日本語文。字組版', 4], ['日本語文。', '字組版']), ('small kana prohibited at line start', ['日本語かっこいい', 4], ['日本語', 'かっこい', 'い']), ('control layout', ['あお組い、おっ字こ版、』けあ）', 4], ['あお組い、', 'おっ字こ', '版、』け', 'あ）']), ('control layout', ['日」』版、。字文うえこ日', 5], ['日」』版、。', '字文うえこ', '日'])], [('regression: line-end prohibition index', ['日」（日かくっ（』版き版け本く「』え日、文「（', 5], ['日」（日か', 'くっ（』版', 'き版け本く', '「』え日、', '文「（']), ('regression: line-end prohibition index', ['』（版あけ）う文え版えくく（字「いっえ）本', 5], ['』（版あ', 'け）う文え', '版えくく', '（字「いっ', 'え）本']), ('regression: line-end prohibition index', ['お（おっ文ゃっかうあああっ字（語っ「語文くっあ本', 6], ['お（おっ', '文ゃっかうあ', 'ああっ字', '（語っ「語文', 'くっあ本']), ('regression: line-end prohibition index', ['文（（字本）あ版', 3], ['文', '（（字', '本）あ', '版']), ('period hangs past the measure', ['日本語文。字組版', 4], ['日本語文。', '字組版']), ('opening bracket at line end', ['日本語「文字」組版', 4], ['日本語', '「文字」', '組版']), ('control layout', ['）ー』文え文』きく版こああ', 3], ['）ー』', '文え', '文』き', 'く版こ', 'ああ']), ('control layout', ['本い」文か』』おこかあっ、。日』', 3], ['本い」', '文', 'か』』', 'おこか', 'あっ、。', '日』'])], [('regression: line-end prohibition index', ['っ）文日くこ版日か『文日こおえ', 3], ['っ）文', '日くこ', '版日か', '『文日', 'こおえ']), ('regression: line-end prohibition index', ['「「字）』（っ』お』く『文組こー版', 7], ['「「字）』', '（っ』お』く', '『文組こー版']), ('regression: line-end prohibition index', ['文」け本「か。「あ組ゃ「。あえ組くかー文本', 5], ['文」け本', '「か。「あ', '組ゃ「。あ', 'え組くかー', '文本']), ('regression: line-end prohibition index', ['こ語え語（こお組う日本文文うく「おか', 8], ['こ語え語（こお組', 'う日本文文うく', '「おか']), ('closing bracket pushes out', ['日本語文」字組版', 4], ['日本語', '文」字組', '版']), ('opening bracket at line end', ['日本語「文字」組版', 4], ['日本語', '「文字」', '組版']), ('control layout', ['え文お文あ本かーゃ『。えけ文', 8], ['え文お文あ本', 'かーゃ『。えけ文']), ('control layout', ['、お『組えっ版字』ゃ版。組う日く」、。', 8], ['、お『組えっ版', '字』ゃ版。組う日', 'く」、。'])], [('regression: line-end prohibition index', ['ーゃゃ文。語語うくか」いか。えあ『か組', 8], ['ーゃゃ文。語語う', 'くか」いか。えあ', '『か組']), ('regression: line-end prohibition index', ['いあ『本く）く。ー', 3], ['いあ', '『本', 'く）', 'く。ー']), ('partial-repair probe', ['く字日本（）あ。え。『日、組文', 3], ['く字日', '本（）', 'あ。え。', '『日、', '組文']), ('regression: line-end prohibition index', ['版か語文っ」「か』お」。本。け「くうゃ『い本', 6], ['版か語文っ」', '「か』お」。', '本。け「く', 'うゃ『い本']), ('closing bracket pushes out', ['日本語文」字組版', 4], ['日本語', '文」字組', '版']), ('period hangs past the measure', ['日本語文。字組版', 4], ['日本語文。', '字組版']), ('control layout', ['」かき、え字版語、組お字', 5], ['」かき、え', '字版語、組', 'お字']), ('control layout', ['「かーき語組語「', 6], ['「かーき語組', '語「'])], [('regression: line-end prohibition index', ['「日う（っ。き「。け日「あ『ーか版文文あ（「', 6], ['「日う（っ。', 'き「。け日', '「あ『ーか版', '文文あ（「']), ('regression: line-end prohibition index', ['語語字けかあ版本『』字くえいき（組版あえ組こ語', 5], ['語語字けか', 'あ版本『』', '字くえいき', '（組版あえ', '組こ語']), ('regression: line-end prohibition index', ['っ「かっ版（ー『う」ー字（語う本ゃゃ本ー。あ』', 8], ['っ「かっ版（ー', '『う」ー字（語う', '本ゃゃ本ー。あ』']), ('regression: line-end prohibition index', ['『か、えあ字『こ日', 7], ['『か、えあ字', '『こ日']), ('opening bracket at line end', ['日本語「文字」組版', 4], ['日本語', '「文字」', '組版']), ('small kana prohibited at line start', ['日本語かっこいい', 4], ['日本語', 'かっこい', 'い']), ('control layout', ['」）版こあうかくーい版ー文「文き（', 6], ['」）版こあう', 'かくーい版ー', '文「文き（']), ('control layout', ['「かーき語組語「', 6], ['「かーき語組', '語「'])]]\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":"6cecf1477914c72a0d92594445234a616b2bacbbdae148f285ea854b319139d8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    text, L = x\n    NO_START = '、。，．）」』！？ーぁぃぅぇぉっゃゅょ'\n    NO_END = '（「『'\n    HANG = '、。，．'\n    lines = []\n    pos = 0\n    n = len(text)\n    while pos < n:\n        end = pos + L\n        if end >= n:\n            lines.append(text[pos:])\n            break\n        if text[end] in HANG and (end + 1 >= n or text[end + 1] not in NO_START):\n            end += 1\n        else:\n            while end > pos + 1 and text[end] in NO_START:\n                end -= 1\n            while end > pos + 1 and text[end] in NO_END:\n                end -= 1\n        lines.append(text[pos:end])\n        pos = end\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('opening bracket at line end', ['日本語「文字」組版', 4], ['日本語', '「文字」', '組版']), ('regression: line-end prohibition index', ['、「組ー『ここっーかえあくい語『うき組、』。え', 5], ['、「組ー', '『ここっー', 'かえあくい', '語『うき', '組、』。え']), ('partial-repair probe', ['」「、本え』え日字字ゃゃ。き組。こ組う字版（', 3], ['」「、', '本え』', 'え日字', '字ゃゃ。', 'き組。', 'こ組う', '字版（']), ('regression: line-end prohibition index', ['いこ組うい）（「く文き語文くっ本『』語お版', 6], ['いこ組うい）', '（「く文き語', '文くっ本『』', '語お版']), ('period hangs past the measure', ['日本語文。字組版', 4], ['日本語文。', '字組版']), ('small kana prohibited at line start', ['日本語かっこいい', 4], ['日本語', 'かっこい', 'い']), ('control layout', ['あお組い、おっ字こ版、』けあ）', 4], ['あお組い、', 'おっ字こ', '版、』け', 'あ）']), ('control layout', ['日」』版、。字文うえこ日', 5], ['日」』版、。', '字文うえこ', '日'])], [('regression: line-end prohibition index', ['日」（日かくっ（』版き版け本く「』え日、文「（', 5], ['日」（日か', 'くっ（』版', 'き版け本く', '「』え日、', '文「（']), ('regression: line-end prohibition index', ['』（版あけ）う文え版えくく（字「いっえ）本', 5], ['』（版あ', 'け）う文え', '版えくく', '（字「いっ', 'え）本']), ('regression: line-end prohibition index', ['お（おっ文ゃっかうあああっ字（語っ「語文くっあ本', 6], ['お（おっ', '文ゃっかうあ', 'ああっ字', '（語っ「語文', 'くっあ本']), ('regression: line-end prohibition index', ['文（（字本）あ版', 3], ['文', '（（字', '本）あ', '版']), ('period hangs past the measure', ['日本語文。字組版', 4], ['日本語文。', '字組版']), ('opening bracket at line end', ['日本語「文字」組版', 4], ['日本語', '「文字」', '組版']), ('control layout', ['）ー』文え文』きく版こああ', 3], ['）ー』', '文え', '文』き', 'く版こ', 'ああ']), ('control layout', ['本い」文か』』おこかあっ、。日』', 3], ['本い」', '文', 'か』』', 'おこか', 'あっ、。', '日』'])], [('regression: line-end prohibition index', ['っ）文日くこ版日か『文日こおえ', 3], ['っ）文', '日くこ', '版日か', '『文日', 'こおえ']), ('regression: line-end prohibition index', ['「「字）』（っ』お』く『文組こー版', 7], ['「「字）』', '（っ』お』く', '『文組こー版']), ('regression: line-end prohibition index', ['文」け本「か。「あ組ゃ「。あえ組くかー文本', 5], ['文」け本', '「か。「あ', '組ゃ「。あ', 'え組くかー', '文本']), ('regression: line-end prohibition index', ['こ語え語（こお組う日本文文うく「おか', 8], ['こ語え語（こお組', 'う日本文文うく', '「おか']), ('closing bracket pushes out', ['日本語文」字組版', 4], ['日本語', '文」字組', '版']), ('opening bracket at line end', ['日本語「文字」組版', 4], ['日本語', '「文字」', '組版']), ('control layout', ['え文お文あ本かーゃ『。えけ文', 8], ['え文お文あ本', 'かーゃ『。えけ文']), ('control layout', ['、お『組えっ版字』ゃ版。組う日く」、。', 8], ['、お『組えっ版', '字』ゃ版。組う日', 'く」、。'])], [('regression: line-end prohibition index', ['ーゃゃ文。語語うくか」いか。えあ『か組', 8], ['ーゃゃ文。語語う', 'くか」いか。えあ', '『か組']), ('regression: line-end prohibition index', ['いあ『本く）く。ー', 3], ['いあ', '『本', 'く）', 'く。ー']), ('partial-repair probe', ['く字日本（）あ。え。『日、組文', 3], ['く字日', '本（）', 'あ。え。', '『日、', '組文']), ('regression: line-end prohibition index', ['版か語文っ」「か』お」。本。け「くうゃ『い本', 6], ['版か語文っ」', '「か』お」。', '本。け「く', 'うゃ『い本']), ('closing bracket pushes out', ['日本語文」字組版', 4], ['日本語', '文」字組', '版']), ('period hangs past the measure', ['日本語文。字組版', 4], ['日本語文。', '字組版']), ('control layout', ['」かき、え字版語、組お字', 5], ['」かき、え', '字版語、組', 'お字']), ('control layout', ['「かーき語組語「', 6], ['「かーき語組', '語「'])], [('regression: line-end prohibition index', ['「日う（っ。き「。け日「あ『ーか版文文あ（「', 6], ['「日う（っ。', 'き「。け日', '「あ『ーか版', '文文あ（「']), ('regression: line-end prohibition index', ['語語字けかあ版本『』字くえいき（組版あえ組こ語', 5], ['語語字けか', 'あ版本『』', '字くえいき', '（組版あえ', '組こ語']), ('regression: line-end prohibition index', ['っ「かっ版（ー『う」ー字（語う本ゃゃ本ー。あ』', 8], ['っ「かっ版（ー', '『う」ー字（語う', '本ゃゃ本ー。あ』']), ('regression: line-end prohibition index', ['『か、えあ字『こ日', 7], ['『か、えあ字', '『こ日']), ('opening bracket at line end', ['日本語「文字」組版', 4], ['日本語', '「文字」', '組版']), ('small kana prohibited at line start', ['日本語かっこいい', 4], ['日本語', 'かっこい', 'い']), ('control layout', ['」）版こあうかくーい版ー文「文き（', 6], ['」）版こあう', 'かくーい版ー', '文「文き（']), ('control layout', ['「かーき語組語「', 6], ['「かーき語組', '語「'])]]\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-kinsoku-line-end-prohibition-index","generated_at":"2026-09-29T14:49:50.003543+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":"The line-end check inspects the first character of the next line instead of the last of this line.","sha256":"f7e44c6f431e6bcef9f1e592c0ec68ca6f6ac5a2dc60cfe14aa24bb76162c1f8","title":"CJK kinsoku line breaking: line-end prohibition index · 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":37.164,"exit_code":1,"observations":[{"actual":["日本語「","文字」組","版"],"check":"opening bracket at line end","expected":["日本語","「文字」","組版"],"passed":false},{"actual":["、「組ー『","ここっーか","えあくい語","『うき","組、』。え"],"check":"regression: line-end prohibition index","expected":["、「組ー","『ここっー","かえあくい","語『うき","組、』。え"],"passed":false},{"actual":["」「","、本","え』え","日字","字ゃゃ。","き組。","こ組う","字版（"],"check":"partial-repair probe","expected":["」「、","本え』","え日字","字ゃゃ。","き組。","こ組う","字版（"],"passed":false},{"actual":["いこ組うい）","（「く文き語","文くっ本『","』語お版"],"check":"regression: line-end prohibition index","expected":["いこ組うい）","（「く文き語","文くっ本『』","語お版"],"passed":false},{"actual":["日本語文。","字組版"],"check":"period hangs past the measure","expected":["日本語文。","字組版"],"passed":true},{"actual":["日本語","かっこい","い"],"check":"small kana prohibited at line start","expected":["日本語","かっこい","い"],"passed":true},{"actual":["あお組い、","おっ字こ","版、』け","あ）"],"check":"control layout","expected":["あお組い、","おっ字こ","版、』け","あ）"],"passed":true},{"actual":["日」』版、。","字文うえこ","日"],"check":"control layout","expected":["日」』版、。","字文うえこ","日"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"opening bracket at line end\", \"actual\": [\"日本語「\", \"文字」組\", \"版\"], \"expected\": [\"日本語\", \"「文字」\", \"組版\"], \"passed\": false}, {\"check\": \"regression: line-end prohibition index\", \"actual\": [\"、「組ー『\", \"ここっーか\", \"えあくい語\", \"『うき\", \"組、』。え\"], \"expected\": [\"、「組ー\", \"『ここっー\", \"かえあくい\", \"語『うき\", \"組、』。え\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"」「\", \"、本\", \"え』え\", \"日字\", \"字ゃゃ。\", \"き組。\", \"こ組う\", \"字版（\"], \"expected\": [\"」「、\", \"本え』\", \"え日字\", \"字ゃゃ。\", \"き組。\", \"こ組う\", \"字版（\"], \"passed\": false}, {\"check\": \"regression: line-end prohibition index\", \"actual\": [\"いこ組うい）\", \"（「く文き語\", \"文くっ本『\", \"』語お版\"], \"expected\": [\"いこ組うい）\", \"（「く文き語\", \"文くっ本『』\", \"語お版\"], \"passed\": false}, {\"check\": \"period hangs past the measure\", \"actual\": [\"日本語文。\", \"字組版\"], \"expected\": [\"日本語文。\", \"字組版\"], \"passed\": true}, {\"check\": \"small kana prohibited at line start\", \"actual\": [\"日本語\", \"かっこい\", \"い\"], \"expected\": [\"日本語\", \"かっこい\", \"い\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"あお組い、\", \"おっ字こ\", \"版、』け\", \"あ）\"], \"expected\": [\"あお組い、\", \"おっ字こ\", \"版、』け\", \"あ）\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"日」』版、。\", \"字文うえこ\", \"日\"], \"expected\": [\"日」』版、。\", \"字文うえこ\", \"日\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.787,"exit_code":1,"observations":[{"actual":["日本語「","文字」組","版"],"check":"opening bracket at line end","expected":["日本語","「文字」","組版"],"passed":false},{"actual":["、「組ー『","ここっーか","えあくい","語『うき","組、』。え"],"check":"regression: line-end prohibition index","expected":["、「組ー","『ここっー","かえあくい","語『うき","組、』。え"],"passed":false},{"actual":["」「、","本え』","え日字","字ゃゃ。","き組。","こ組う","字版（"],"check":"partial-repair probe","expected":["」「、","本え』","え日字","字ゃゃ。","き組。","こ組う","字版（"],"passed":true},{"actual":["いこ組うい","）（「く文き","語文くっ","本『』語お版"],"check":"regression: line-end prohibition index","expected":["いこ組うい）","（「く文き語","文くっ本『』","語お版"],"passed":false},{"actual":["日本語文。","字組版"],"check":"period hangs past the measure","expected":["日本語文。","字組版"],"passed":true},{"actual":["日本語","かっこい","い"],"check":"small kana prohibited at line start","expected":["日本語","かっこい","い"],"passed":true},{"actual":["あお組い、","おっ字こ","版、』け","あ）"],"check":"control layout","expected":["あお組い、","おっ字こ","版、』け","あ）"],"passed":true},{"actual":["日」』版、。","字文うえこ","日"],"check":"control layout","expected":["日」』版、。","字文うえこ","日"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"opening bracket at line end\", \"actual\": [\"日本語「\", \"文字」組\", \"版\"], \"expected\": [\"日本語\", \"「文字」\", \"組版\"], \"passed\": false}, {\"check\": \"regression: line-end prohibition index\", \"actual\": [\"、「組ー『\", \"ここっーか\", \"えあくい\", \"語『うき\", \"組、』。え\"], \"expected\": [\"、「組ー\", \"『ここっー\", \"かえあくい\", \"語『うき\", \"組、』。え\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"」「、\", \"本え』\", \"え日字\", \"字ゃゃ。\", \"き組。\", \"こ組う\", \"字版（\"], \"expected\": [\"」「、\", \"本え』\", \"え日字\", \"字ゃゃ。\", \"き組。\", \"こ組う\", \"字版（\"], \"passed\": true}, {\"check\": \"regression: line-end prohibition index\", \"actual\": [\"いこ組うい\", \"）（「く文き\", \"語文くっ\", \"本『』語お版\"], \"expected\": [\"いこ組うい）\", \"（「く文き語\", \"文くっ本『』\", \"語お版\"], \"passed\": false}, {\"check\": \"period hangs past the measure\", \"actual\": [\"日本語文。\", \"字組版\"], \"expected\": [\"日本語文。\", \"字組版\"], \"passed\": true}, {\"check\": \"small kana prohibited at line start\", \"actual\": [\"日本語\", \"かっこい\", \"い\"], \"expected\": [\"日本語\", \"かっこい\", \"い\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"あお組い、\", \"おっ字こ\", \"版、』け\", \"あ）\"], \"expected\": [\"あお組い、\", \"おっ字こ\", \"版、』け\", \"あ）\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"日」』版、。\", \"字文うえこ\", \"日\"], \"expected\": [\"日」』版、。\", \"字文うえこ\", \"日\"], \"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."}}