{"abstract":"Labels exactly as wide as the hang touch the text.","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":"Tolerating a label one wider than the hang overprints the text.","family":"w2-typography-line-breaking-hanging-label-label-clearance","id":"FA-80241","implementations":{"attempt":{"sha256":"491bfa270a968c346746722dfe98a4c8038ada91223e7f4da6a318327bc4b2a7","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) <= hang + 1 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 = [[('regression: label clearance', ['Note:', ['type', 'x'], 12, 5], ['Note: type x']), ('regression: label clearance', ['A.1.2', ['x', 'a', 'grid', 'baseline', 'a', 'on', 'x'], 12, 5], ['A.1.2 x a', '     grid', '     baseline', '     a on x']), ('regression: label clearance', ['(a)', ['type', 'is', 'at', 'on'], 20, 3], ['(a) type is at on']), ('regression: label clearance', ['1.', ['type', 'serif', 'a', 'the', 'at', 'kerning', 'at'], 17, 2], ['1. type serif a', '  the at kerning', '  at']), ('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)', ['ink', 'baseline', 'serif', 'on'], 16, 4], ['(a) ink baseline', '    serif on']), ('control layout', ['(a)', ['x', 'x', 'type'], 14, 5], ['(a)  x x type'])], [('regression: label clearance', ['Note:', ['baseline', 'baseline', 'at', 'grid', 'ink', 'type'], 21, 5], ['Note: baseline', '     baseline at grid', '     ink type']), ('regression: label clearance', ['1.', ['measure', 'grid', 'kerning'], 13, 2], ['1. measure', '  grid', '  kerning']), ('regression: label clearance', ['1.', ['x', 'the', 'kerning', 'x', 'baseline', 'grid'], 20, 2], ['1. x the kerning x', '  baseline grid']), ('regression: label clearance', ['Note:', ['baseline', 'serif', 'x', 'grid', 'serif', 'x', 'type'], 18, 5], ['Note: baseline', '     serif x grid', '     serif x type']), ('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', ['1.', ['ink', 'kerning'], 22, 5], ['1.   ink kerning']), ('control layout', ['A.1.2', ['x', 'ink', 'on'], 15, 3], ['A.1.2 x ink on'])], [('regression: label clearance', ['A.1.2', ['kerning', 'x', 'the', 'measure', 'ink', 'measure'], 13, 5], ['A.1.2 kerning', '     x the', '     measure', '     ink', '     measure']), ('regression: label clearance', ['10.', ['grid', 'is', 'type', 'of', 'of', 'of', 'a', 'on', 'ink'], 19, 3], ['10. grid is type of', '   of of a on ink']), ('regression: label clearance', ['iv.', ['x', 'x'], 13, 3], ['iv. x x']), ('regression: label clearance', ['(a)', ['of', 'of', 'grid', 'grid'], 15, 3], ['(a) of of grid', '   grid']), ('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', ['A.1.2', ['ink', 'ink', 'on', 'serif', 'is', 'baseline', 'a', 'on', 'serif'], 16, 2], ['A.1.2 ink ink on', '  serif is', '  baseline a on', '  serif']), ('control layout', ['•', ['baseline', 'is', 'at'], 15, 2], ['• baseline is', '  at'])], [('regression: label clearance', ['(a)', ['at', 'on', 'of', 'grid', 'at', 'a', 'type', 'measure', 'grid'], 18, 3], ['(a) at on of grid', '   at a type', '   measure grid']), ('regression: label clearance', ['A.1.2', ['of', 'serif', 'at', 'serif', 'of', 'is'], 19, 5], ['A.1.2 of serif at', '     serif of is']), ('regression: label clearance', ['(a)', ['serif', 'x'], 19, 3], ['(a) serif x']), ('partial-repair probe', ['Note:', ['grid', 'on', 'at'], 22, 4], ['Note: grid on at']), ('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', ['iv.', ['of', 'is'], 17, 4], ['iv. of is']), ('control layout', ['10.', ['measure', 'of', 'x', 'of', 'kerning', 'a', 'serif', 'baseline'], 20, 4], ['10. measure of x of', '    kerning a serif', '    baseline'])], [('regression: label clearance', ['A.1.2', ['at', 'of', 'ink', 'x', 'is', 'type', 'grid'], 18, 5], ['A.1.2 at of ink x', '     is type grid']), ('regression: label clearance', ['(a)', ['serif', 'x'], 19, 3], ['(a) serif x']), ('regression: label clearance', ['1.', ['x', 'type', 'baseline'], 22, 2], ['1. x type baseline']), ('regression: label clearance', ['(a)', ['at', 'on', 'of', 'grid', 'at', 'a', 'type', 'measure', 'grid'], 18, 3], ['(a) at on of grid', '   at a type', '   measure grid']), ('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)', ['type', 'on', 'the', 'measure'], 16, 5], ['(a)  type on the', '     measure']), ('control layout', ['Note:', ['at', 'of'], 16, 2], ['Note: at of'])]]\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":"c51cf830c5cf6ba8e8b03a5f7b69bb7fa366651d736a7d8cf338b2e355a91d7b","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) <= 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 = [[('regression: label clearance', ['Note:', ['type', 'x'], 12, 5], ['Note: type x']), ('regression: label clearance', ['A.1.2', ['x', 'a', 'grid', 'baseline', 'a', 'on', 'x'], 12, 5], ['A.1.2 x a', '     grid', '     baseline', '     a on x']), ('regression: label clearance', ['(a)', ['type', 'is', 'at', 'on'], 20, 3], ['(a) type is at on']), ('regression: label clearance', ['1.', ['type', 'serif', 'a', 'the', 'at', 'kerning', 'at'], 17, 2], ['1. type serif a', '  the at kerning', '  at']), ('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)', ['ink', 'baseline', 'serif', 'on'], 16, 4], ['(a) ink baseline', '    serif on']), ('control layout', ['(a)', ['x', 'x', 'type'], 14, 5], ['(a)  x x type'])], [('regression: label clearance', ['Note:', ['baseline', 'baseline', 'at', 'grid', 'ink', 'type'], 21, 5], ['Note: baseline', '     baseline at grid', '     ink type']), ('regression: label clearance', ['1.', ['measure', 'grid', 'kerning'], 13, 2], ['1. measure', '  grid', '  kerning']), ('regression: label clearance', ['1.', ['x', 'the', 'kerning', 'x', 'baseline', 'grid'], 20, 2], ['1. x the kerning x', '  baseline grid']), ('regression: label clearance', ['Note:', ['baseline', 'serif', 'x', 'grid', 'serif', 'x', 'type'], 18, 5], ['Note: baseline', '     serif x grid', '     serif x type']), ('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', ['1.', ['ink', 'kerning'], 22, 5], ['1.   ink kerning']), ('control layout', ['A.1.2', ['x', 'ink', 'on'], 15, 3], ['A.1.2 x ink on'])], [('regression: label clearance', ['A.1.2', ['kerning', 'x', 'the', 'measure', 'ink', 'measure'], 13, 5], ['A.1.2 kerning', '     x the', '     measure', '     ink', '     measure']), ('regression: label clearance', ['10.', ['grid', 'is', 'type', 'of', 'of', 'of', 'a', 'on', 'ink'], 19, 3], ['10. grid is type of', '   of of a on ink']), ('regression: label clearance', ['iv.', ['x', 'x'], 13, 3], ['iv. x x']), ('regression: label clearance', ['(a)', ['of', 'of', 'grid', 'grid'], 15, 3], ['(a) of of grid', '   grid']), ('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', ['A.1.2', ['ink', 'ink', 'on', 'serif', 'is', 'baseline', 'a', 'on', 'serif'], 16, 2], ['A.1.2 ink ink on', '  serif is', '  baseline a on', '  serif']), ('control layout', ['•', ['baseline', 'is', 'at'], 15, 2], ['• baseline is', '  at'])], [('regression: label clearance', ['(a)', ['at', 'on', 'of', 'grid', 'at', 'a', 'type', 'measure', 'grid'], 18, 3], ['(a) at on of grid', '   at a type', '   measure grid']), ('regression: label clearance', ['A.1.2', ['of', 'serif', 'at', 'serif', 'of', 'is'], 19, 5], ['A.1.2 of serif at', '     serif of is']), ('regression: label clearance', ['(a)', ['serif', 'x'], 19, 3], ['(a) serif x']), ('partial-repair probe', ['Note:', ['grid', 'on', 'at'], 22, 4], ['Note: grid on at']), ('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', ['iv.', ['of', 'is'], 17, 4], ['iv. of is']), ('control layout', ['10.', ['measure', 'of', 'x', 'of', 'kerning', 'a', 'serif', 'baseline'], 20, 4], ['10. measure of x of', '    kerning a serif', '    baseline'])], [('regression: label clearance', ['A.1.2', ['at', 'of', 'ink', 'x', 'is', 'type', 'grid'], 18, 5], ['A.1.2 at of ink x', '     is type grid']), ('regression: label clearance', ['(a)', ['serif', 'x'], 19, 3], ['(a) serif x']), ('regression: label clearance', ['1.', ['x', 'type', 'baseline'], 22, 2], ['1. x type baseline']), ('regression: label clearance', ['(a)', ['at', 'on', 'of', 'grid', 'at', 'a', 'type', 'measure', 'grid'], 18, 3], ['(a) at on of grid', '   at a type', '   measure grid']), ('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)', ['type', 'on', 'the', 'measure'], 16, 5], ['(a)  type on the', '     measure']), ('control layout', ['Note:', ['at', 'of'], 16, 2], ['Note: at of'])]]\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-label-clearance","generated_at":"2026-09-29T14:49:52.159397+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 clearance test ignores the one-space gap after the label.","sha256":"7c7470f883342e5de94840c3ad674de88596a79145732c80a7402d5b907178bd","title":"Hanging-indent list labels: label clearance · 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.884,"exit_code":1,"observations":[{"actual":["Note:type x"],"check":"regression: label clearance","expected":["Note: type x"],"passed":false},{"actual":["A.1.2x a","     grid","     baseline","     a on x"],"check":"regression: label clearance","expected":["A.1.2 x a","     grid","     baseline","     a on x"],"passed":false},{"actual":["(a)type is at on"],"check":"regression: label clearance","expected":["(a) type is at on"],"passed":false},{"actual":["1.type serif a","  the at kerning","  at"],"check":"regression: label clearance","expected":["1. type serif a","  the at kerning","  at"],"passed":false},{"actual":["Note: the type","   grid is on","   serif"],"check":"label overflows hang","expected":["Note: the type","   grid is on","   serif"],"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) ink baseline","    serif on"],"check":"control layout","expected":["(a) ink baseline","    serif on"],"passed":true},{"actual":["(a)  x x type"],"check":"control layout","expected":["(a)  x x type"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: label clearance\", \"actual\": [\"Note:type x\"], \"expected\": [\"Note: type x\"], \"passed\": false}, {\"check\": \"regression: label clearance\", \"actual\": [\"A.1.2x a\", \"     grid\", \"     baseline\", \"     a on x\"], \"expected\": [\"A.1.2 x a\", \"     grid\", \"     baseline\", \"     a on x\"], \"passed\": false}, {\"check\": \"regression: label clearance\", \"actual\": [\"(a)type is at on\"], \"expected\": [\"(a) type is at on\"], \"passed\": false}, {\"check\": \"regression: label clearance\", \"actual\": [\"1.type serif a\", \"  the at kerning\", \"  at\"], \"expected\": [\"1. type serif a\", \"  the at kerning\", \"  at\"], \"passed\": false}, {\"check\": \"label overflows hang\", \"actual\": [\"Note: the type\", \"   grid is on\", \"   serif\"], \"expected\": [\"Note: the type\", \"   grid is on\", \"   serif\"], \"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) ink baseline\", \"    serif on\"], \"expected\": [\"(a) ink baseline\", \"    serif on\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"(a)  x x type\"], \"expected\": [\"(a)  x x type\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.253,"exit_code":1,"observations":[{"actual":["Note:type x"],"check":"regression: label clearance","expected":["Note: type x"],"passed":false},{"actual":["A.1.2x a","     grid","     baseline","     a on x"],"check":"regression: label clearance","expected":["A.1.2 x a","     grid","     baseline","     a on x"],"passed":false},{"actual":["(a)type is at on"],"check":"regression: label clearance","expected":["(a) type is at on"],"passed":false},{"actual":["1.type serif a","  the at kerning","  at"],"check":"regression: label clearance","expected":["1. type serif a","  the at kerning","  at"],"passed":false},{"actual":["Note: the type","   grid is on","   serif"],"check":"label overflows hang","expected":["Note: the type","   grid is on","   serif"],"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) ink baseline","    serif on"],"check":"control layout","expected":["(a) ink baseline","    serif on"],"passed":true},{"actual":["(a)  x x type"],"check":"control layout","expected":["(a)  x x type"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: label clearance\", \"actual\": [\"Note:type x\"], \"expected\": [\"Note: type x\"], \"passed\": false}, {\"check\": \"regression: label clearance\", \"actual\": [\"A.1.2x a\", \"     grid\", \"     baseline\", \"     a on x\"], \"expected\": [\"A.1.2 x a\", \"     grid\", \"     baseline\", \"     a on x\"], \"passed\": false}, {\"check\": \"regression: label clearance\", \"actual\": [\"(a)type is at on\"], \"expected\": [\"(a) type is at on\"], \"passed\": false}, {\"check\": \"regression: label clearance\", \"actual\": [\"1.type serif a\", \"  the at kerning\", \"  at\"], \"expected\": [\"1. type serif a\", \"  the at kerning\", \"  at\"], \"passed\": false}, {\"check\": \"label overflows hang\", \"actual\": [\"Note: the type\", \"   grid is on\", \"   serif\"], \"expected\": [\"Note: the type\", \"   grid is on\", \"   serif\"], \"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) ink baseline\", \"    serif on\"], \"expected\": [\"(a) ink baseline\", \"    serif on\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"(a)  x x type\"], \"expected\": [\"(a)  x x type\"], \"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."}}