FA-80336 / Typography line breaking / Open access
URL line breaking: hard break fallback · case 01
Unbreakable URL runs overflow the line.
ROOT CAUSE
Without a candidate the rest of the URL is emitted as one line.
VERIFIED REPAIR
Hard-break at the width when no opportunity exists.
Unsuccessful approach: Hard-breaking one character early wastes a column.
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 n
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 = [[('regression: hard break fallback', ['mailto:someone@example.com', 8], ['mailto:', 'someone@', 'example', '.com']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 5], ['https', '://', 'sub', '.doma', 'in', '.exam', 'ple', '.co', '.uk/', '~user', '/page']), ('regression: hard break fallback', ['mailto:someone@example.com', 11], ['mailto:', 'someone@exa', 'mple.com']), ('regression: hard break fallback', ['https://x.io/search?term=line%20break&lang=en', 6], ['https:', '//x.io', '/searc', 'h?term', '=line', '%20bre', 'ak&', 'lang=', 'en']), ('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', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('control layout', ['https://example.com/path/to/page.html', 13], ['https://', 'example.com', '/path/to/page', '.html'])], [('regression: hard break fallback', ['https://example.com/path/to/page.html', 6], ['https:', '//', 'exampl', 'e.com', '/path', '/to', '/page', '.html']), ('regression: hard break fallback', ['mailto:someone@example.com', 4], ['mail', 'to:', 'some', 'one@', 'exam', 'ple', '.com']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 5], ['https', '://', 'sub', '.doma', 'in', '.exam', 'ple', '.co', '.uk/', '~user', '/page']), ('regression: hard break fallback', ['mailto:someone@example.com', 12], ['mailto:', 'someone@exam', 'ple.com']), ('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://t.co/AbCdEf', 14], ['https://t.co', '/AbCdEf']), ('control layout', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 10], ['ftp://', 'files.site', '.net/pub', '/file-name', '_v2.tar.gz'])], [('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 7], ['https:', '//sub', '.domain', '.exampl', 'e.co.uk', '/~user', '/page']), ('regression: hard break fallback', ['https://x.io/search?term=line%20break&lang=en', 4], ['http', 's://', 'x.io', '/sea', 'rch', '?ter', 'm=', 'line', '%20b', 'reak', '&', 'lang', '=en']), ('regression: hard break fallback', ['mailto:someone@example.com', 9], ['mailto:', 'someone@e', 'xample', '.com']), ('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://w.org/a=b/c&d', 11], ['https://w', '.org/a=b/c&', 'd']), ('control layout', ['file:///usr/local/share/doc', 12], ['file:///usr', '/local/share', '/doc'])], [('regression: hard break fallback', ['http://a.b.org/x//y?q=1&r=2', 4], ['http', '://a', '.b', '.org', '/x//', 'y?q=', '1&r=', '2']), ('regression: hard break fallback', ['https://www.docs.io/a/b/c#sec-3', 5], ['https', '://', 'www', '.docs', '.io/a', '/b/c', '#sec', '-3']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 6], ['https:', '//t.co', '/AbCdE', 'f']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 5], ['https', '://t', '.co', '/AbCd', 'Ef']), ('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://example.com/path/to/page.html', 16], ['https://example', '.com/path/to', '/page.html']), ('control layout', ['https://t.co/AbCdEf', 11], ['https://t', '.co/AbCdEf'])], [('regression: hard break fallback', ['http://a.b.org/x//y?q=1&r=2', 4], ['http', '://a', '.b', '.org', '/x//', 'y?q=', '1&r=', '2']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 6], ['https:', '//sub', '.domai', 'n', '.examp', 'le.co', '.uk/', '~user', '/page']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 5], ['https', '://t', '.co', '/AbCd', 'Ef']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 6], ['https:', '//t.co', '/AbCdE', 'f']), ('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://example.com/path/to/page.html', 11], ['https://', 'example.com', '/path/to', '/page.html']), ('control layout', ['http://a.b.org/x//y?q=1&r=2', 7], ['http://', 'a.b.org', '/x//y?q', '=1&r=2'])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: hard break fallback | ['mailto:', 'someone@example.com', ''] | ['mailto:', 'someone@', 'example', '.com'] | Failed |
| regression: hard break fallback | ['https://sub.domain.example.co.uk/~user/page', ''] | ['https', '://', 'sub', '.doma', 'in', '.exam', 'ple', '.co', '.uk/', '~user', '/page'] | Failed |
| regression: hard break fallback | ['mailto:', 'someone@example.com', ''] | ['mailto:', 'someone@exa', 'mple.com'] | Failed |
| regression: hard break fallback | ['https:', '//x.io', '/search?term=line%20break&lang=en', ''] | ['https:', '//x.io', '/searc', 'h?term', '=line', '%20bre', 'ak&', 'lang=', 'en'] | Failed |
| 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 |
| break after scheme | ['https://', 'example', '.com', '/path/to', '/page', '.html'] | ['https://', 'example', '.com', '/path/to', '/page', '.html'] | Passed |
| control layout | ['http://a', '.b.org', '/x//y?q=1', '&r=2'] | ['http://a', '.b.org', '/x//y?q=1', '&r=2'] | Passed |
| control layout | ['https://', 'example.com', '/path/to/page', '.html'] | ['https://', 'example.com', '/path/to/page', '.html'] | Passed |
SHA-256 / 685a35e3518ed1cfc4a92d0ca18c3ef8b3405233fedb2e14607e523822357ee2
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 < p <= start + width]
cut = max(cands) if cands else start + width - 1
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 = [[('regression: hard break fallback', ['mailto:someone@example.com', 8], ['mailto:', 'someone@', 'example', '.com']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 5], ['https', '://', 'sub', '.doma', 'in', '.exam', 'ple', '.co', '.uk/', '~user', '/page']), ('regression: hard break fallback', ['mailto:someone@example.com', 11], ['mailto:', 'someone@exa', 'mple.com']), ('regression: hard break fallback', ['https://x.io/search?term=line%20break&lang=en', 6], ['https:', '//x.io', '/searc', 'h?term', '=line', '%20bre', 'ak&', 'lang=', 'en']), ('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', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('control layout', ['https://example.com/path/to/page.html', 13], ['https://', 'example.com', '/path/to/page', '.html'])], [('regression: hard break fallback', ['https://example.com/path/to/page.html', 6], ['https:', '//', 'exampl', 'e.com', '/path', '/to', '/page', '.html']), ('regression: hard break fallback', ['mailto:someone@example.com', 4], ['mail', 'to:', 'some', 'one@', 'exam', 'ple', '.com']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 5], ['https', '://', 'sub', '.doma', 'in', '.exam', 'ple', '.co', '.uk/', '~user', '/page']), ('regression: hard break fallback', ['mailto:someone@example.com', 12], ['mailto:', 'someone@exam', 'ple.com']), ('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://t.co/AbCdEf', 14], ['https://t.co', '/AbCdEf']), ('control layout', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 10], ['ftp://', 'files.site', '.net/pub', '/file-name', '_v2.tar.gz'])], [('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 7], ['https:', '//sub', '.domain', '.exampl', 'e.co.uk', '/~user', '/page']), ('regression: hard break fallback', ['https://x.io/search?term=line%20break&lang=en', 4], ['http', 's://', 'x.io', '/sea', 'rch', '?ter', 'm=', 'line', '%20b', 'reak', '&', 'lang', '=en']), ('regression: hard break fallback', ['mailto:someone@example.com', 9], ['mailto:', 'someone@e', 'xample', '.com']), ('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://w.org/a=b/c&d', 11], ['https://w', '.org/a=b/c&', 'd']), ('control layout', ['file:///usr/local/share/doc', 12], ['file:///usr', '/local/share', '/doc'])], [('regression: hard break fallback', ['http://a.b.org/x//y?q=1&r=2', 4], ['http', '://a', '.b', '.org', '/x//', 'y?q=', '1&r=', '2']), ('regression: hard break fallback', ['https://www.docs.io/a/b/c#sec-3', 5], ['https', '://', 'www', '.docs', '.io/a', '/b/c', '#sec', '-3']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 6], ['https:', '//t.co', '/AbCdE', 'f']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 5], ['https', '://t', '.co', '/AbCd', 'Ef']), ('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://example.com/path/to/page.html', 16], ['https://example', '.com/path/to', '/page.html']), ('control layout', ['https://t.co/AbCdEf', 11], ['https://t', '.co/AbCdEf'])], [('regression: hard break fallback', ['http://a.b.org/x//y?q=1&r=2', 4], ['http', '://a', '.b', '.org', '/x//', 'y?q=', '1&r=', '2']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 6], ['https:', '//sub', '.domai', 'n', '.examp', 'le.co', '.uk/', '~user', '/page']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 5], ['https', '://t', '.co', '/AbCd', 'Ef']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 6], ['https:', '//t.co', '/AbCdE', 'f']), ('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://example.com/path/to/page.html', 11], ['https://', 'example.com', '/path/to', '/page.html']), ('control layout', ['http://a.b.org/x//y?q=1&r=2', 7], ['http://', 'a.b.org', '/x//y?q', '=1&r=2'])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: hard break fallback | ['mailto:', 'someone', '@example', '.com'] | ['mailto:', 'someone@', 'example', '.com'] | Failed |
| regression: hard break fallback | ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~user', '/page'] | ['https', '://', 'sub', '.doma', 'in', '.exam', 'ple', '.co', '.uk/', '~user', '/page'] | Failed |
| regression: hard break fallback | ['mailto:', 'someone@ex', 'ample.com'] | ['mailto:', 'someone@exa', 'mple.com'] | Failed |
| regression: hard break fallback | ['https:', '//x.io', '/sear', 'ch', '?term=', 'line', '%20br', 'eak&', 'lang=', 'en'] | ['https:', '//x.io', '/searc', 'h?term', '=line', '%20bre', 'ak&', 'lang=', 'en'] | Failed |
| 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 |
| break after scheme | ['https://', 'example', '.com', '/path/to', '/page', '.html'] | ['https://', 'example', '.com', '/path/to', '/page', '.html'] | Passed |
| control layout | ['http://a', '.b.org', '/x//y?q=1', '&r=2'] | ['http://a', '.b.org', '/x//y?q=1', '&r=2'] | Passed |
| control layout | ['https://', 'example.com', '/path/to/page', '.html'] | ['https://', 'example.com', '/path/to/page', '.html'] | Passed |
SHA-256 / 349e2a5744da20b2d0692da9aa0d7fea925caffa57c95d725dfa8d4fb520d14f
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 = [[('regression: hard break fallback', ['mailto:someone@example.com', 8], ['mailto:', 'someone@', 'example', '.com']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 5], ['https', '://', 'sub', '.doma', 'in', '.exam', 'ple', '.co', '.uk/', '~user', '/page']), ('regression: hard break fallback', ['mailto:someone@example.com', 11], ['mailto:', 'someone@exa', 'mple.com']), ('regression: hard break fallback', ['https://x.io/search?term=line%20break&lang=en', 6], ['https:', '//x.io', '/searc', 'h?term', '=line', '%20bre', 'ak&', 'lang=', 'en']), ('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', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('control layout', ['https://example.com/path/to/page.html', 13], ['https://', 'example.com', '/path/to/page', '.html'])], [('regression: hard break fallback', ['https://example.com/path/to/page.html', 6], ['https:', '//', 'exampl', 'e.com', '/path', '/to', '/page', '.html']), ('regression: hard break fallback', ['mailto:someone@example.com', 4], ['mail', 'to:', 'some', 'one@', 'exam', 'ple', '.com']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 5], ['https', '://', 'sub', '.doma', 'in', '.exam', 'ple', '.co', '.uk/', '~user', '/page']), ('regression: hard break fallback', ['mailto:someone@example.com', 12], ['mailto:', 'someone@exam', 'ple.com']), ('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://t.co/AbCdEf', 14], ['https://t.co', '/AbCdEf']), ('control layout', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 10], ['ftp://', 'files.site', '.net/pub', '/file-name', '_v2.tar.gz'])], [('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 4], ['http', 's://', 'sub', '.dom', 'ain', '.exa', 'mple', '.co', '.uk/', '~use', 'r', '/pag', 'e']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 7], ['https:', '//sub', '.domain', '.exampl', 'e.co.uk', '/~user', '/page']), ('regression: hard break fallback', ['https://x.io/search?term=line%20break&lang=en', 4], ['http', 's://', 'x.io', '/sea', 'rch', '?ter', 'm=', 'line', '%20b', 'reak', '&', 'lang', '=en']), ('regression: hard break fallback', ['mailto:someone@example.com', 9], ['mailto:', 'someone@e', 'xample', '.com']), ('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://w.org/a=b/c&d', 11], ['https://w', '.org/a=b/c&', 'd']), ('control layout', ['file:///usr/local/share/doc', 12], ['file:///usr', '/local/share', '/doc'])], [('regression: hard break fallback', ['http://a.b.org/x//y?q=1&r=2', 4], ['http', '://a', '.b', '.org', '/x//', 'y?q=', '1&r=', '2']), ('regression: hard break fallback', ['https://www.docs.io/a/b/c#sec-3', 5], ['https', '://', 'www', '.docs', '.io/a', '/b/c', '#sec', '-3']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 6], ['https:', '//t.co', '/AbCdE', 'f']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 5], ['https', '://t', '.co', '/AbCd', 'Ef']), ('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://example.com/path/to/page.html', 16], ['https://example', '.com/path/to', '/page.html']), ('control layout', ['https://t.co/AbCdEf', 11], ['https://t', '.co/AbCdEf'])], [('regression: hard break fallback', ['http://a.b.org/x//y?q=1&r=2', 4], ['http', '://a', '.b', '.org', '/x//', 'y?q=', '1&r=', '2']), ('regression: hard break fallback', ['https://sub.domain.example.co.uk/~user/page', 6], ['https:', '//sub', '.domai', 'n', '.examp', 'le.co', '.uk/', '~user', '/page']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 5], ['https', '://t', '.co', '/AbCd', 'Ef']), ('regression: hard break fallback', ['https://t.co/AbCdEf', 6], ['https:', '//t.co', '/AbCdE', 'f']), ('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://example.com/path/to/page.html', 11], ['https://', 'example.com', '/path/to', '/page.html']), ('control layout', ['http://a.b.org/x//y?q=1&r=2', 7], ['http://', 'a.b.org', '/x//y?q', '=1&r=2'])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: hard break fallback | ['mailto:', 'someone@', 'example', '.com'] | ['mailto:', 'someone@', 'example', '.com'] | Passed |
| regression: hard break fallback | ['https', '://', 'sub', '.doma', 'in', '.exam', 'ple', '.co', '.uk/', '~user', '/page'] | ['https', '://', 'sub', '.doma', 'in', '.exam', 'ple', '.co', '.uk/', '~user', '/page'] | Passed |
| regression: hard break fallback | ['mailto:', 'someone@exa', 'mple.com'] | ['mailto:', 'someone@exa', 'mple.com'] | Passed |
| regression: hard break fallback | ['https:', '//x.io', '/searc', 'h?term', '=line', '%20bre', 'ak&', 'lang=', 'en'] | ['https:', '//x.io', '/searc', 'h?term', '=line', '%20bre', 'ak&', 'lang=', 'en'] | Passed |
| 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 |
| break after scheme | ['https://', 'example', '.com', '/path/to', '/page', '.html'] | ['https://', 'example', '.com', '/path/to', '/page', '.html'] | Passed |
| control layout | ['http://a', '.b.org', '/x//y?q=1', '&r=2'] | ['http://a', '.b.org', '/x//y?q=1', '&r=2'] | Passed |
| control layout | ['https://', 'example.com', '/path/to/page', '.html'] | ['https://', 'example.com', '/path/to/page', '.html'] | Passed |
SHA-256 / cb5507fcfdc9b3acf762ecae3396f6236a9107f5c23b72fe250b050afe322f4f
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.888818+00:00.
Case digest / b07ef955379fcdb772f0695cceba1090f9924ba6a318b1ee6036968635eba172