{"abstract":"Words that end exactly at the right edge are wrapped.","category":"Typography line breaking","checks":8,"contract":"Input [label, words, width, hang]. The label starts at column 0; first-line text starts at column hang when label+1 space fits, else right after label plus one space. Continuation lines are indented by hang. Greedy fill with unit spaces measuring absolute columns. Return padded lines.","contract_signature":"x","evaluation_group":"w2-typography-line-breaking-hanging-label","failed_approach":"Allowing one column past the width overflows.","family":"w2-typography-line-breaking-hanging-label-column-fit-boundary","id":"FA-80256","implementations":{"attempt":{"sha256":"135ef44a49194d226e794bc0220829dad31792c9b8180da2057b7f67553c20c0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    label, words, width, hang = x\n    lines = []\n    first = True\n    start = hang if len(label) + 1 <= hang else len(label) + 1\n    cur = []\n    col = start\n    for w in words:\n        need = col + len(w) if not cur else col + 1 + len(w)\n        if cur and need > width + 1:\n            prefix = label.ljust(start) if first else ' ' * hang\n            lines.append(prefix + ' '.join(cur))\n            first = False\n            cur = [w]\n            col = hang + len(w)\n        else:\n            cur.append(w)\n            col = need\n    if cur:\n        prefix = label.ljust(start) if first else ' ' * hang\n        lines.append(prefix + ' '.join(cur))\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', '   grid is on', '   serif']), ('regression: column fit boundary', ['1.', ['is', 'type', 'kerning', 'kerning', 'kerning', 'ink', 'measure', 'a', 'ink'], 18, 3], ['1. is type kerning', '   kerning kerning', '   ink measure a', '   ink']), ('partial-repair probe', ['Note:', ['type', 'type', 'of', 'on', 'on', 'kerning'], 20, 5], ['Note: type type of', '     on on kerning']), ('partial-repair probe', ['iv.', ['x', 'a', 'ink', 'at', 'serif', 'of', 'is', 'x', 'kerning'], 14, 5], ['iv.  x a ink', '     at serif', '     of is x', '     kerning']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', '   grid is', '   on']), ('control layout', ['A.1.2', ['on', 'of', 'the'], 16, 4], ['A.1.2 on of the']), ('control layout', ['Note:', ['is', 'serif'], 22, 4], ['Note: is serif']), ('control layout', ['•', ['a', 'is', 'measure', 'baseline', 'ink'], 21, 5], ['•    a is measure', '     baseline ink'])], [('regression: column fit boundary', ['•', ['the', 'ink', 'of', 'of', 'is'], 18, 5], ['•    the ink of of', '     is']), ('regression: column fit boundary', ['1.', ['kerning', 'baseline', 'measure', 'a', 'serif', 'x'], 18, 2], ['1. kerning', '  baseline measure', '  a serif x']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', '   grid is', '   on']), ('partial-repair probe', ['1.', ['a', 'of', 'serif', 'type', 'the', 'ink', 'is', 'at', 'kerning'], 14, 3], ['1. a of serif', '   type the', '   ink is at', '   kerning']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', '   grid is on', '   serif']), ('control layout', ['•', ['of', 'x', 'is'], 18, 4], ['•   of x is']), ('control layout', ['1.', ['serif', 'at'], 14, 3], ['1. serif at']), ('control layout', ['iv.', ['of', 'is'], 17, 2], ['iv. of is'])], [('regression: column fit boundary', ['iv.', ['type', 'a', 'of', 'of', 'is', 'is', 'baseline', 'kerning'], 13, 4], ['iv. type a of', '    of is is', '    baseline', '    kerning']), ('regression: column fit boundary', ['Note:', ['on', 'at', 'a', 'x', 'baseline', 'x', 'grid'], 18, 3], ['Note: on at a x', '   baseline x grid']), ('regression: column fit boundary', ['A.1.2', ['measure', 'is', 'grid', 'type', 'type', 'of', 'serif', 'at', 'ink'], 20, 3], ['A.1.2 measure is', '   grid type type of', '   serif at ink']), ('partial-repair probe', ['A.1.2', ['ink', 'grid', 'ink', 'serif', 'is', 'baseline'], 13, 2], ['A.1.2 ink', '  grid ink', '  serif is', '  baseline']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', '   grid is on', '   serif']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', '   grid is', '   on']), ('control layout', ['•', ['a', 'kerning', 'measure', 'the', 'the', 'kerning', 'is'], 15, 3], ['•  a kerning', '   measure the', '   the kerning', '   is']), ('control layout', ['1.', ['is', 'x'], 18, 3], ['1. is x'])], [('regression: column fit boundary', ['•', ['is', 'x', 'at', 'type', 'kerning', 'the'], 14, 3], ['•  is x at', '   type', '   kerning the']), ('regression: column fit boundary', ['A.1.2', ['a', 'kerning', 'measure', 'a', 'at', 'measure'], 22, 2], ['A.1.2 a kerning', '  measure a at measure']), ('regression: column fit boundary', ['Note:', ['is', 'measure', 'a', 'x', 'type', 'on', 'measure', 'of'], 18, 2], ['Note: is measure a', '  x type on', '  measure of']), ('partial-repair probe', ['(a)', ['type', 'ink'], 12, 5], ['(a)  type', '     ink']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', '   grid is on', '   serif']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', '   grid is', '   on']), ('control layout', ['A.1.2', ['baseline', 'grid', 'on', 'is', 'kerning'], 13, 2], ['A.1.2 baseline', '  grid on is', '  kerning']), ('control layout', ['Note:', ['ink', 'baseline', 'measure', 'type', 'type', 'ink', 'kerning', 'at', 'kerning'], 19, 5], ['Note: ink baseline', '     measure type', '     type ink', '     kerning at', '     kerning'])], [('regression: column fit boundary', ['•', ['measure', 'kerning', 'grid', 'of'], 20, 5], ['•    measure kerning', '     grid of']), ('regression: column fit boundary', ['10.', ['grid', 'is', 'type', 'of', 'of', 'of', 'a', 'on', 'ink'], 19, 3], ['10. grid is type of', '   of of a on ink']), ('regression: column fit boundary', ['(a)', ['of', 'ink', 'baseline', 'ink', 'on', 'type', 'measure', 'baseline', 'grid'], 14, 2], ['(a) of ink', '  baseline ink', '  on type', '  measure', '  baseline', '  grid']), ('partial-repair probe', ['1.', ['of', 'type', 'kerning', 'the', 'on', 'kerning', 'type', 'x', 'kerning'], 22, 4], ['1.  of type kerning', '    the on kerning', '    type x kerning']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', '   grid is', '   on']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', '   grid is on', '   serif']), ('control layout', ['•', ['of', 'of'], 20, 4], ['•   of of']), ('control layout', ['1.', ['ink', 'kerning'], 22, 5], ['1.   ink kerning'])]]\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":"40a1e72e24fc03abbb953fadff5ee0b3f0e2596ff3bb2d143fb5309ac75b3218","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    label, words, width, hang = x\n    lines = []\n    first = True\n    start = hang if len(label) + 1 <= hang else len(label) + 1\n    cur = []\n    col = start\n    for w in words:\n        need = col + len(w) if not cur else col + 1 + len(w)\n        if cur and need >= width:\n            prefix = label.ljust(start) if first else ' ' * hang\n            lines.append(prefix + ' '.join(cur))\n            first = False\n            cur = [w]\n            col = hang + len(w)\n        else:\n            cur.append(w)\n            col = need\n    if cur:\n        prefix = label.ljust(start) if first else ' ' * hang\n        lines.append(prefix + ' '.join(cur))\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', '   grid is on', '   serif']), ('regression: column fit boundary', ['1.', ['is', 'type', 'kerning', 'kerning', 'kerning', 'ink', 'measure', 'a', 'ink'], 18, 3], ['1. is type kerning', '   kerning kerning', '   ink measure a', '   ink']), ('partial-repair probe', ['Note:', ['type', 'type', 'of', 'on', 'on', 'kerning'], 20, 5], ['Note: type type of', '     on on kerning']), ('partial-repair probe', ['iv.', ['x', 'a', 'ink', 'at', 'serif', 'of', 'is', 'x', 'kerning'], 14, 5], ['iv.  x a ink', '     at serif', '     of is x', '     kerning']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', '   grid is', '   on']), ('control layout', ['A.1.2', ['on', 'of', 'the'], 16, 4], ['A.1.2 on of the']), ('control layout', ['Note:', ['is', 'serif'], 22, 4], ['Note: is serif']), ('control layout', ['•', ['a', 'is', 'measure', 'baseline', 'ink'], 21, 5], ['•    a is measure', '     baseline ink'])], [('regression: column fit boundary', ['•', ['the', 'ink', 'of', 'of', 'is'], 18, 5], ['•    the ink of of', '     is']), ('regression: column fit boundary', ['1.', ['kerning', 'baseline', 'measure', 'a', 'serif', 'x'], 18, 2], ['1. kerning', '  baseline measure', '  a serif x']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', '   grid is', '   on']), ('partial-repair probe', ['1.', ['a', 'of', 'serif', 'type', 'the', 'ink', 'is', 'at', 'kerning'], 14, 3], ['1. a of serif', '   type the', '   ink is at', '   kerning']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', '   grid is on', '   serif']), ('control layout', ['•', ['of', 'x', 'is'], 18, 4], ['•   of x is']), ('control layout', ['1.', ['serif', 'at'], 14, 3], ['1. serif at']), ('control layout', ['iv.', ['of', 'is'], 17, 2], ['iv. of is'])], [('regression: column fit boundary', ['iv.', ['type', 'a', 'of', 'of', 'is', 'is', 'baseline', 'kerning'], 13, 4], ['iv. type a of', '    of is is', '    baseline', '    kerning']), ('regression: column fit boundary', ['Note:', ['on', 'at', 'a', 'x', 'baseline', 'x', 'grid'], 18, 3], ['Note: on at a x', '   baseline x grid']), ('regression: column fit boundary', ['A.1.2', ['measure', 'is', 'grid', 'type', 'type', 'of', 'serif', 'at', 'ink'], 20, 3], ['A.1.2 measure is', '   grid type type of', '   serif at ink']), ('partial-repair probe', ['A.1.2', ['ink', 'grid', 'ink', 'serif', 'is', 'baseline'], 13, 2], ['A.1.2 ink', '  grid ink', '  serif is', '  baseline']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', '   grid is on', '   serif']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', '   grid is', '   on']), ('control layout', ['•', ['a', 'kerning', 'measure', 'the', 'the', 'kerning', 'is'], 15, 3], ['•  a kerning', '   measure the', '   the kerning', '   is']), ('control layout', ['1.', ['is', 'x'], 18, 3], ['1. is x'])], [('regression: column fit boundary', ['•', ['is', 'x', 'at', 'type', 'kerning', 'the'], 14, 3], ['•  is x at', '   type', '   kerning the']), ('regression: column fit boundary', ['A.1.2', ['a', 'kerning', 'measure', 'a', 'at', 'measure'], 22, 2], ['A.1.2 a kerning', '  measure a at measure']), ('regression: column fit boundary', ['Note:', ['is', 'measure', 'a', 'x', 'type', 'on', 'measure', 'of'], 18, 2], ['Note: is measure a', '  x type on', '  measure of']), ('partial-repair probe', ['(a)', ['type', 'ink'], 12, 5], ['(a)  type', '     ink']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', '   grid is on', '   serif']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', '   grid is', '   on']), ('control layout', ['A.1.2', ['baseline', 'grid', 'on', 'is', 'kerning'], 13, 2], ['A.1.2 baseline', '  grid on is', '  kerning']), ('control layout', ['Note:', ['ink', 'baseline', 'measure', 'type', 'type', 'ink', 'kerning', 'at', 'kerning'], 19, 5], ['Note: ink baseline', '     measure type', '     type ink', '     kerning at', '     kerning'])], [('regression: column fit boundary', ['•', ['measure', 'kerning', 'grid', 'of'], 20, 5], ['•    measure kerning', '     grid of']), ('regression: column fit boundary', ['10.', ['grid', 'is', 'type', 'of', 'of', 'of', 'a', 'on', 'ink'], 19, 3], ['10. grid is type of', '   of of a on ink']), ('regression: column fit boundary', ['(a)', ['of', 'ink', 'baseline', 'ink', 'on', 'type', 'measure', 'baseline', 'grid'], 14, 2], ['(a) of ink', '  baseline ink', '  on type', '  measure', '  baseline', '  grid']), ('partial-repair probe', ['1.', ['of', 'type', 'kerning', 'the', 'on', 'kerning', 'type', 'x', 'kerning'], 22, 4], ['1.  of type kerning', '    the on kerning', '    type x kerning']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', '   grid is', '   on']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', '   grid is on', '   serif']), ('control layout', ['•', ['of', 'of'], 20, 4], ['•   of of']), ('control layout', ['1.', ['ink', 'kerning'], 22, 5], ['1.   ink kerning'])]]\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-hanging-label-column-fit-boundary","generated_at":"2026-09-29T14:49:52.201643+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 wrap test uses >= width.","sha256":"3ce4b7cc6e9e45f893de5546bc73afdd33d4293dc81b11850cf0f387e81fb696","title":"Hanging-indent list labels: column fit boundary · 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":39.568,"exit_code":1,"observations":[{"actual":["Note: the type","   grid is on","   serif"],"check":"label overflows hang","expected":["Note: the type","   grid is on","   serif"],"passed":true},{"actual":["1. is type kerning","   kerning kerning","   ink measure a","   ink"],"check":"regression: column fit boundary","expected":["1. is type kerning","   kerning kerning","   ink measure a","   ink"],"passed":true},{"actual":["Note: type type of on","     on kerning"],"check":"partial-repair probe","expected":["Note: type type of","     on on kerning"],"passed":false},{"actual":["iv.  x a ink at","     serif of","     is x","     kerning"],"check":"partial-repair probe","expected":["iv.  x a ink","     at serif","     of is x","     kerning"],"passed":false},{"actual":["1. the type","   grid is on"],"check":"label exactly one short of hang","expected":["1. the type","   grid is","   on"],"passed":false},{"actual":["A.1.2 on of the"],"check":"control layout","expected":["A.1.2 on of the"],"passed":true},{"actual":["Note: is serif"],"check":"control layout","expected":["Note: is serif"],"passed":true},{"actual":["•    a is measure","     baseline ink"],"check":"control layout","expected":["•    a is measure","     baseline ink"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"label overflows hang\", \"actual\": [\"Note: the type\", \"   grid is on\", \"   serif\"], \"expected\": [\"Note: the type\", \"   grid is on\", \"   serif\"], \"passed\": true}, {\"check\": \"regression: column fit boundary\", \"actual\": [\"1. is type kerning\", \"   kerning kerning\", \"   ink measure a\", \"   ink\"], \"expected\": [\"1. is type kerning\", \"   kerning kerning\", \"   ink measure a\", \"   ink\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"Note: type type of on\", \"     on kerning\"], \"expected\": [\"Note: type type of\", \"     on on kerning\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"iv.  x a ink at\", \"     serif of\", \"     is x\", \"     kerning\"], \"expected\": [\"iv.  x a ink\", \"     at serif\", \"     of is x\", \"     kerning\"], \"passed\": false}, {\"check\": \"label exactly one short of hang\", \"actual\": [\"1. the type\", \"   grid is on\"], \"expected\": [\"1. the type\", \"   grid is\", \"   on\"], \"passed\": false}, {\"check\": \"control layout\", \"actual\": [\"A.1.2 on of the\"], \"expected\": [\"A.1.2 on of the\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"Note: is serif\"], \"expected\": [\"Note: is serif\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"•    a is measure\", \"     baseline ink\"], \"expected\": [\"•    a is measure\", \"     baseline ink\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.182,"exit_code":1,"observations":[{"actual":["Note: the","   type grid","   is on","   serif"],"check":"label overflows hang","expected":["Note: the type","   grid is on","   serif"],"passed":false},{"actual":["1. is type","   kerning","   kerning","   kerning ink","   measure a ink"],"check":"regression: column fit boundary","expected":["1. is type kerning","   kerning kerning","   ink measure a","   ink"],"passed":false},{"actual":["Note: type type of","     on on kerning"],"check":"partial-repair probe","expected":["Note: type type of","     on on kerning"],"passed":true},{"actual":["iv.  x a ink","     at serif","     of is x","     kerning"],"check":"partial-repair probe","expected":["iv.  x a ink","     at serif","     of is x","     kerning"],"passed":true},{"actual":["1. the type","   grid is","   on"],"check":"label exactly one short of hang","expected":["1. the type","   grid is","   on"],"passed":true},{"actual":["A.1.2 on of the"],"check":"control layout","expected":["A.1.2 on of the"],"passed":true},{"actual":["Note: is serif"],"check":"control layout","expected":["Note: is serif"],"passed":true},{"actual":["•    a is measure","     baseline ink"],"check":"control layout","expected":["•    a is measure","     baseline ink"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"label overflows hang\", \"actual\": [\"Note: the\", \"   type grid\", \"   is on\", \"   serif\"], \"expected\": [\"Note: the type\", \"   grid is on\", \"   serif\"], \"passed\": false}, {\"check\": \"regression: column fit boundary\", \"actual\": [\"1. is type\", \"   kerning\", \"   kerning\", \"   kerning ink\", \"   measure a ink\"], \"expected\": [\"1. is type kerning\", \"   kerning kerning\", \"   ink measure a\", \"   ink\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"Note: type type of\", \"     on on kerning\"], \"expected\": [\"Note: type type of\", \"     on on kerning\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"iv.  x a ink\", \"     at serif\", \"     of is x\", \"     kerning\"], \"expected\": [\"iv.  x a ink\", \"     at serif\", \"     of is x\", \"     kerning\"], \"passed\": true}, {\"check\": \"label exactly one short of hang\", \"actual\": [\"1. the type\", \"   grid is\", \"   on\"], \"expected\": [\"1. the type\", \"   grid is\", \"   on\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"A.1.2 on of the\"], \"expected\": [\"A.1.2 on of the\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"Note: is serif\"], \"expected\": [\"Note: is serif\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"•    a is measure\", \"     baseline ink\"], \"expected\": [\"•    a is measure\", \"     baseline ink\"], \"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."}}