FAILURE MAP
← Case archive

FA-80331 / Typography line breaking / Open access

URL line breaking: candidate window · case 01

An opportunity exactly at the line end is ignored.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Candidates must be strictly inside the window.

VERIFIED REPAIR

Include opportunities at start + width.

Unsuccessful approach: Excluding the first position after the start is a different window error.

Case contract

Input [url, width]. Break opportunities (no hyphen added): after ":"; after "//" (never between its slashes); before a single "/"; before . - _ ? # % ~; before or after = and &. While the rest exceeds the width, break at the latest opportunity within width characters, else hard-break at width. Return lines.

Why this case matters

Line breaking decides where paragraphs wrap on screen and in print; a wrong decision point shifts every following line.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    url, width = x
    n = len(url)
    ok = set()
    for p in range(1, n):
        a, b = url[p - 1], url[p]
        if a == ':':
            ok.add(p)
        elif a == '/' and url[p - 2:p] == '//':
            ok.add(p)
        elif b == '/' and a != '/' and url[p + 1:p + 2] != '/':
            ok.add(p)
        elif b in '.-_?#%~':
            ok.add(p)
        elif a in '=&' or b in '=&':
            ok.add(p)
    lines = []
    start = 0
    while n - start > width:
        cands = [p for p in ok if start < p < start + width]
        cut = max(cands) if cands else start + width
        lines.append(url[start:cut])
        start = cut
    lines.append(url[start:])
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('regression: candidate window', ['file:///usr/local/share/doc', 4], ['file', ':///', 'usr', '/loc', 'al', '/sha', 're', '/doc']), ('regression: candidate window', ['https://example.com/path/to/page.html', 4], ['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e', '.htm', 'l']), ('partial-repair probe', ['file:///usr/local/share/doc', 5], ['file:', '///', 'usr', '/loca', 'l', '/shar', 'e/doc']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('control layout', ['https://x.io/search?term=line%20break&lang=en', 15], ['https://x.io', '/search?term=', 'line%20break&', 'lang=en']), ('control layout', ['mailto:someone@example.com', 13], ['mailto:', 'someone@examp', 'le.com']), ('control layout', ['file:///usr/local/share/doc', 14], ['file:///usr', '/local/share', '/doc'])], [('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 11], ['https://sub', '.domain', '.example.co', '.uk/~user', '/page']), ('regression: candidate window', ['https://x.io/search?term=line%20break&lang=en', 5], ['https', '://x', '.io', '/sear', 'ch', '?term', '=line', '%20br', 'eak&', 'lang=', 'en']), ('partial-repair probe', ['https://sub.domain.example.co.uk/~user/page', 6], ['https:', '//sub', '.domai', 'n', '.examp', 'le.co', '.uk/', '~user', '/page']), ('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('control layout', ['mailto:someone@example.com', 7], ['mailto:', 'someone', '@exampl', 'e.com']), ('control layout', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 5], ['ftp:', '//', 'files', '.site', '.net', '/pub', '/file', '-name', '_v2', '.tar', '.gz'])], [('regression: candidate window', ['https://x.io/search?term=line%20break&lang=en', 6], ['https:', '//x.io', '/searc', 'h?term', '=line', '%20bre', 'ak&', 'lang=', 'en']), ('regression: candidate window', ['https://w.org/a=b/c&d', 11], ['https://w', '.org/a=b/c&', 'd']), ('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('regression: candidate window', ['https://example.com/path/to/page.html', 4], ['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e', '.htm', 'l']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('control layout', ['https://t.co/AbCdEf', 7], ['https:', '//t.co', '/AbCdEf']), ('control layout', ['https://sub.domain.example.co.uk/~user/page', 9], ['https://', 'sub', '.domain', '.example', '.co.uk/', '~user', '/page'])], [('regression: candidate window', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 12], ['ftp://files', '.site.net', '/pub/file', '-name_v2.tar', '.gz']), ('regression: candidate window', ['https://www.docs.io/a/b/c#sec-3', 5], ['https', '://', 'www', '.docs', '.io/a', '/b/c', '#sec', '-3']), ('regression: candidate window', ['https://x.io/search?term=line%20break&lang=en', 4], ['http', 's://', 'x.io', '/sea', 'rch', '?ter', 'm=', 'line', '%20b', 'reak', '&', 'lang', '=en']), ('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('control layout', ['https://sub.domain.example.co.uk/~user/page', 16], ['https://sub', '.domain.example', '.co.uk/~user', '/page']), ('control layout', ['mailto:someone@example.com', 16], ['mailto:', 'someone@example', '.com'])], [('regression: candidate window', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 9], ['ftp://', 'files', '.site.net', '/pub/file', '-name_v2', '.tar.gz']), ('regression: candidate window', ['https://t.co/AbCdEf', 4], ['http', 's://', 't.co', '/AbC', 'dEf']), ('partial-repair probe', ['mailto:someone@example.com', 6], ['mailto', ':', 'someon', 'e@exam', 'ple', '.com']), ('partial-repair probe', ['https://sub.domain.example.co.uk/~user/page', 6], ['https:', '//sub', '.domai', 'n', '.examp', 'le.co', '.uk/', '~user', '/page']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('control layout', ['https://sub.domain.example.co.uk/~user/page', 16], ['https://sub', '.domain.example', '.co.uk/~user', '/page']), ('control layout', ['mailto:someone@example.com', 8], ['mailto:', 'someone@', 'example', '.com'])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
double slash inside path['http://a', '.b.org', '/x//y?q=1', '&r=2']['http://a.b', '.org/x//y', '?q=1&r=2']Failed
regression: candidate window['file', '://', '/', 'usr', '/loc', 'al', '/sha', 're', '/doc']['file', ':///', 'usr', '/loc', 'al', '/sha', 're', '/doc']Failed
regression: candidate window['http', 's:', '//', 'exam', 'ple', '.com', '/pat', 'h', '/to', '/pag', 'e', '.htm', 'l']['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e', '.htm', 'l']Failed
partial-repair probe['file:', '///', 'usr', '/loca', 'l', '/shar', 'e/doc']['file:', '///', 'usr', '/loca', 'l', '/shar', 'e/doc']Passed
break after scheme['https:', '//', 'example', '.com', '/path', '/to', '/page', '.html']['https://', 'example', '.com', '/path/to', '/page', '.html']Failed
control layout['https://x.io', '/search?term=', 'line%20break&', 'lang=en']['https://x.io', '/search?term=', 'line%20break&', 'lang=en']Passed
control layout['mailto:', 'someone@examp', 'le.com']['mailto:', 'someone@examp', 'le.com']Passed
control layout['file:///usr', '/local/share', '/doc']['file:///usr', '/local/share', '/doc']Passed

SHA-256 / b0b5b0f8c427eb959accf86397e7d800d7a2b7f21e1950b3665e3d7c9b55cc55

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    url, width = x
    n = len(url)
    ok = set()
    for p in range(1, n):
        a, b = url[p - 1], url[p]
        if a == ':':
            ok.add(p)
        elif a == '/' and url[p - 2:p] == '//':
            ok.add(p)
        elif b == '/' and a != '/' and url[p + 1:p + 2] != '/':
            ok.add(p)
        elif b in '.-_?#%~':
            ok.add(p)
        elif a in '=&' or b in '=&':
            ok.add(p)
    lines = []
    start = 0
    while n - start > width:
        cands = [p for p in ok if start + 1 < p <= start + width]
        cut = max(cands) if cands else start + width
        lines.append(url[start:cut])
        start = cut
    lines.append(url[start:])
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('regression: candidate window', ['file:///usr/local/share/doc', 4], ['file', ':///', 'usr', '/loc', 'al', '/sha', 're', '/doc']), ('regression: candidate window', ['https://example.com/path/to/page.html', 4], ['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e', '.htm', 'l']), ('partial-repair probe', ['file:///usr/local/share/doc', 5], ['file:', '///', 'usr', '/loca', 'l', '/shar', 'e/doc']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('control layout', ['https://x.io/search?term=line%20break&lang=en', 15], ['https://x.io', '/search?term=', 'line%20break&', 'lang=en']), ('control layout', ['mailto:someone@example.com', 13], ['mailto:', 'someone@examp', 'le.com']), ('control layout', ['file:///usr/local/share/doc', 14], ['file:///usr', '/local/share', '/doc'])], [('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 11], ['https://sub', '.domain', '.example.co', '.uk/~user', '/page']), ('regression: candidate window', ['https://x.io/search?term=line%20break&lang=en', 5], ['https', '://x', '.io', '/sear', 'ch', '?term', '=line', '%20br', 'eak&', 'lang=', 'en']), ('partial-repair probe', ['https://sub.domain.example.co.uk/~user/page', 6], ['https:', '//sub', '.domai', 'n', '.examp', 'le.co', '.uk/', '~user', '/page']), ('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('control layout', ['mailto:someone@example.com', 7], ['mailto:', 'someone', '@exampl', 'e.com']), ('control layout', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 5], ['ftp:', '//', 'files', '.site', '.net', '/pub', '/file', '-name', '_v2', '.tar', '.gz'])], [('regression: candidate window', ['https://x.io/search?term=line%20break&lang=en', 6], ['https:', '//x.io', '/searc', 'h?term', '=line', '%20bre', 'ak&', 'lang=', 'en']), ('regression: candidate window', ['https://w.org/a=b/c&d', 11], ['https://w', '.org/a=b/c&', 'd']), ('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('regression: candidate window', ['https://example.com/path/to/page.html', 4], ['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e', '.htm', 'l']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('control layout', ['https://t.co/AbCdEf', 7], ['https:', '//t.co', '/AbCdEf']), ('control layout', ['https://sub.domain.example.co.uk/~user/page', 9], ['https://', 'sub', '.domain', '.example', '.co.uk/', '~user', '/page'])], [('regression: candidate window', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 12], ['ftp://files', '.site.net', '/pub/file', '-name_v2.tar', '.gz']), ('regression: candidate window', ['https://www.docs.io/a/b/c#sec-3', 5], ['https', '://', 'www', '.docs', '.io/a', '/b/c', '#sec', '-3']), ('regression: candidate window', ['https://x.io/search?term=line%20break&lang=en', 4], ['http', 's://', 'x.io', '/sea', 'rch', '?ter', 'm=', 'line', '%20b', 'reak', '&', 'lang', '=en']), ('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('control layout', ['https://sub.domain.example.co.uk/~user/page', 16], ['https://sub', '.domain.example', '.co.uk/~user', '/page']), ('control layout', ['mailto:someone@example.com', 16], ['mailto:', 'someone@example', '.com'])], [('regression: candidate window', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 9], ['ftp://', 'files', '.site.net', '/pub/file', '-name_v2', '.tar.gz']), ('regression: candidate window', ['https://t.co/AbCdEf', 4], ['http', 's://', 't.co', '/AbC', 'dEf']), ('partial-repair probe', ['mailto:someone@example.com', 6], ['mailto', ':', 'someon', 'e@exam', 'ple', '.com']), ('partial-repair probe', ['https://sub.domain.example.co.uk/~user/page', 6], ['https:', '//sub', '.domai', 'n', '.examp', 'le.co', '.uk/', '~user', '/page']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('control layout', ['https://sub.domain.example.co.uk/~user/page', 16], ['https://sub', '.domain.example', '.co.uk/~user', '/page']), ('control layout', ['mailto:someone@example.com', 8], ['mailto:', 'someone@', 'example', '.com'])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
double slash inside path['http://a.b', '.org/x//y', '?q=1&r=2']['http://a.b', '.org/x//y', '?q=1&r=2']Passed
regression: candidate window['file', ':///', 'usr', '/loc', 'al', '/sha', 're', '/doc']['file', ':///', 'usr', '/loc', 'al', '/sha', 're', '/doc']Passed
regression: candidate window['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e.ht', 'ml']['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e', '.htm', 'l']Failed
partial-repair probe['file:', '///', 'usr', '/loca', 'l/sha', 're', '/doc']['file:', '///', 'usr', '/loca', 'l', '/shar', 'e/doc']Failed
break after scheme['https://', 'example', '.com', '/path/to', '/page', '.html']['https://', 'example', '.com', '/path/to', '/page', '.html']Passed
control layout['https://x.io', '/search?term=', 'line%20break&', 'lang=en']['https://x.io', '/search?term=', 'line%20break&', 'lang=en']Passed
control layout['mailto:', 'someone@examp', 'le.com']['mailto:', 'someone@examp', 'le.com']Passed
control layout['file:///usr', '/local/share', '/doc']['file:///usr', '/local/share', '/doc']Passed

SHA-256 / f9b3ea0a8b7417444c3fe53a309fa9d0c5c0f0d1bb7adc90b02a1b39718b1ebe

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    url, width = x
    n = len(url)
    ok = set()
    for p in range(1, n):
        a, b = url[p - 1], url[p]
        if a == ':':
            ok.add(p)
        elif a == '/' and url[p - 2:p] == '//':
            ok.add(p)
        elif b == '/' and a != '/' and url[p + 1:p + 2] != '/':
            ok.add(p)
        elif b in '.-_?#%~':
            ok.add(p)
        elif a in '=&' or b in '=&':
            ok.add(p)
    lines = []
    start = 0
    while n - start > width:
        cands = [p for p in ok if start < p <= start + width]
        cut = max(cands) if cands else start + width
        lines.append(url[start:cut])
        start = cut
    lines.append(url[start:])
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('regression: candidate window', ['file:///usr/local/share/doc', 4], ['file', ':///', 'usr', '/loc', 'al', '/sha', 're', '/doc']), ('regression: candidate window', ['https://example.com/path/to/page.html', 4], ['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e', '.htm', 'l']), ('partial-repair probe', ['file:///usr/local/share/doc', 5], ['file:', '///', 'usr', '/loca', 'l', '/shar', 'e/doc']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('control layout', ['https://x.io/search?term=line%20break&lang=en', 15], ['https://x.io', '/search?term=', 'line%20break&', 'lang=en']), ('control layout', ['mailto:someone@example.com', 13], ['mailto:', 'someone@examp', 'le.com']), ('control layout', ['file:///usr/local/share/doc', 14], ['file:///usr', '/local/share', '/doc'])], [('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 11], ['https://sub', '.domain', '.example.co', '.uk/~user', '/page']), ('regression: candidate window', ['https://x.io/search?term=line%20break&lang=en', 5], ['https', '://x', '.io', '/sear', 'ch', '?term', '=line', '%20br', 'eak&', 'lang=', 'en']), ('partial-repair probe', ['https://sub.domain.example.co.uk/~user/page', 6], ['https:', '//sub', '.domai', 'n', '.examp', 'le.co', '.uk/', '~user', '/page']), ('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('control layout', ['mailto:someone@example.com', 7], ['mailto:', 'someone', '@exampl', 'e.com']), ('control layout', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 5], ['ftp:', '//', 'files', '.site', '.net', '/pub', '/file', '-name', '_v2', '.tar', '.gz'])], [('regression: candidate window', ['https://x.io/search?term=line%20break&lang=en', 6], ['https:', '//x.io', '/searc', 'h?term', '=line', '%20bre', 'ak&', 'lang=', 'en']), ('regression: candidate window', ['https://w.org/a=b/c&d', 11], ['https://w', '.org/a=b/c&', 'd']), ('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('regression: candidate window', ['https://example.com/path/to/page.html', 4], ['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e', '.htm', 'l']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('control layout', ['https://t.co/AbCdEf', 7], ['https:', '//t.co', '/AbCdEf']), ('control layout', ['https://sub.domain.example.co.uk/~user/page', 9], ['https://', 'sub', '.domain', '.example', '.co.uk/', '~user', '/page'])], [('regression: candidate window', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 12], ['ftp://files', '.site.net', '/pub/file', '-name_v2.tar', '.gz']), ('regression: candidate window', ['https://www.docs.io/a/b/c#sec-3', 5], ['https', '://', 'www', '.docs', '.io/a', '/b/c', '#sec', '-3']), ('regression: candidate window', ['https://x.io/search?term=line%20break&lang=en', 4], ['http', 's://', 'x.io', '/sea', 'rch', '?ter', 'm=', 'line', '%20b', 'reak', '&', 'lang', '=en']), ('regression: candidate window', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('control layout', ['https://sub.domain.example.co.uk/~user/page', 16], ['https://sub', '.domain.example', '.co.uk/~user', '/page']), ('control layout', ['mailto:someone@example.com', 16], ['mailto:', 'someone@example', '.com'])], [('regression: candidate window', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 9], ['ftp://', 'files', '.site.net', '/pub/file', '-name_v2', '.tar.gz']), ('regression: candidate window', ['https://t.co/AbCdEf', 4], ['http', 's://', 't.co', '/AbC', 'dEf']), ('partial-repair probe', ['mailto:someone@example.com', 6], ['mailto', ':', 'someon', 'e@exam', 'ple', '.com']), ('partial-repair probe', ['https://sub.domain.example.co.uk/~user/page', 6], ['https:', '//sub', '.domai', 'n', '.examp', 'le.co', '.uk/', '~user', '/page']), ('double slash inside path', ['http://a.b.org/x//y?q=1&r=2', 10], ['http://a.b', '.org/x//y', '?q=1&r=2']), ('break after scheme', ['https://example.com/path/to/page.html', 8], ['https://', 'example', '.com', '/path/to', '/page', '.html']), ('control layout', ['https://sub.domain.example.co.uk/~user/page', 16], ['https://sub', '.domain.example', '.co.uk/~user', '/page']), ('control layout', ['mailto:someone@example.com', 8], ['mailto:', 'someone@', 'example', '.com'])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
double slash inside path['http://a.b', '.org/x//y', '?q=1&r=2']['http://a.b', '.org/x//y', '?q=1&r=2']Passed
regression: candidate window['file', ':///', 'usr', '/loc', 'al', '/sha', 're', '/doc']['file', ':///', 'usr', '/loc', 'al', '/sha', 're', '/doc']Passed
regression: candidate window['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e', '.htm', 'l']['http', 's://', 'exam', 'ple', '.com', '/pat', 'h/to', '/pag', 'e', '.htm', 'l']Passed
partial-repair probe['file:', '///', 'usr', '/loca', 'l', '/shar', 'e/doc']['file:', '///', 'usr', '/loca', 'l', '/shar', 'e/doc']Passed
break after scheme['https://', 'example', '.com', '/path/to', '/page', '.html']['https://', 'example', '.com', '/path/to', '/page', '.html']Passed
control layout['https://x.io', '/search?term=', 'line%20break&', 'lang=en']['https://x.io', '/search?term=', 'line%20break&', 'lang=en']Passed
control layout['mailto:', 'someone@examp', 'le.com']['mailto:', 'someone@examp', 'le.com']Passed
control layout['file:///usr', '/local/share', '/doc']['file:///usr', '/local/share', '/doc']Passed

SHA-256 / 8fa70934d9fd25644583887ac36538e2c4d71b2415869051184882ef49934f7f

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:49:52.888741+00:00.

Case digest / 5bb419200a1480dfc7bae12534e6d223a67fcb852ce2c85f2abb21fbeac11b90