FA-80311 / Typography line breaking / Open access
URL line breaking: double slash integrity · case 01
URLs are broken between the two slashes of "//".
ROOT CAUSE
Any position before a slash is a break opportunity.
THE FAILURE
Any position before a slash is a break opportunity.
Unsuccessful approach: Checking the previous character but not the next still splits "x//y" before the pair.
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 == '/':
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: double slash integrity', ['https://x.io/search?term=line%20break&lang=en', 7], ['https:', '//x.io', '/search', '?term=', 'line', '%20brea', 'k&lang=', 'en']), ('regression: double slash integrity', ['https://example.com/path/to/page.html', 7], ['https:', '//', 'example', '.com', '/path', '/to', '/page', '.html']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('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://w.org/a=b/c&d', 5], ['https', '://w', '.org', '/a=b', '/c&d']), ('control layout', ['file:///usr/local/share/doc', 14], ['file:///usr', '/local/share', '/doc'])], [('regression: double slash integrity', ['https://www.docs.io/a/b/c#sec-3', 7], ['https:', '//www', '.docs', '.io/a/b', '/c#sec', '-3']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 6], ['http:', '//a.b', '.org', '/x//y', '?q=1&r', '=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 8], ['http://a', '.b.org', '/x//y?q=', '1&r=2']), ('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://www.docs.io/a/b/c#sec-3', 4], ['http', 's://', 'www', '.doc', 's.io', '/a/b', '/c', '#sec', '-3']), ('control layout', ['https://t.co/AbCdEf', 5], ['https', '://t', '.co', '/AbCd', 'Ef'])], [('regression: double slash integrity', ['https://example.com/path/to/page.html', 7], ['https:', '//', 'example', '.com', '/path', '/to', '/page', '.html']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 8], ['http://a', '.b.org', '/x//y?q=', '1&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 8], ['http://a', '.b.org', '/x//y?q=', '1&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 6], ['http:', '//a.b', '.org', '/x//y', '?q=1&r', '=2']), ('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', ['file:///usr/local/share/doc', 7], ['file://', '/usr', '/local', '/share', '/doc']), ('control layout', ['https://www.docs.io/a/b/c#sec-3', 14], ['https://www', '.docs.io/a/b/c', '#sec-3'])], [('regression: double slash integrity', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 5], ['ftp:', '//', 'files', '.site', '.net', '/pub', '/file', '-name', '_v2', '.tar', '.gz']), ('regression: double slash integrity', ['https://t.co/AbCdEf', 7], ['https:', '//t.co', '/AbCdEf']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 8], ['http://a', '.b.org', '/x//y?q=', '1&r=2']), ('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://w.org/a=b/c&d', 16], ['https://w.org/a=', 'b/c&d']), ('control layout', ['https://example.com/path/to/page.html', 11], ['https://', 'example.com', '/path/to', '/page.html'])], [('regression: double slash integrity', ['https://example.com/path/to/page.html', 7], ['https:', '//', 'example', '.com', '/path', '/to', '/page', '.html']), ('regression: double slash integrity', ['file:///usr/local/share/doc', 6], ['file:', '///usr', '/local', '/share', '/doc']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 8], ['http://a', '.b.org', '/x//y?q=', '1&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 16], ['http://a.b.org', '/x//y?q=1&r=2']), ('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', 15], ['mailto:', 'someone@example', '.com']), ('control layout', ['file:///usr/local/share/doc', 12], ['file:///usr', '/local/share', '/doc'])]]
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: double slash integrity | ['https:/', '/x.io', '/search', '?term=', 'line', '%20brea', 'k&lang=', 'en'] | ['https:', '//x.io', '/search', '?term=', 'line', '%20brea', 'k&lang=', 'en'] | Failed |
| regression: double slash integrity | ['https:/', '/', 'example', '.com', '/path', '/to', '/page', '.html'] | ['https:', '//', 'example', '.com', '/path', '/to', '/page', '.html'] | Failed |
| regression: double slash integrity | ['http://a', '.b.org/x/', '/y?q=1&r=', '2'] | ['http://a', '.b.org', '/x//y?q=1', '&r=2'] | Failed |
| regression: double slash integrity | ['http://a', '.b.org/x/', '/y?q=1&r=', '2'] | ['http://a', '.b.org', '/x//y?q=1', '&r=2'] | 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 | ['https', '://w', '.org', '/a=b', '/c&d'] | ['https', '://w', '.org', '/a=b', '/c&d'] | Passed |
| control layout | ['file:///usr', '/local/share', '/doc'] | ['file:///usr', '/local/share', '/doc'] | Passed |
SHA-256 / 59087e45d671414ed15c566d5f4ff831d379e52975f3a1e38557368618390af5
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 != '/':
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: double slash integrity', ['https://x.io/search?term=line%20break&lang=en', 7], ['https:', '//x.io', '/search', '?term=', 'line', '%20brea', 'k&lang=', 'en']), ('regression: double slash integrity', ['https://example.com/path/to/page.html', 7], ['https:', '//', 'example', '.com', '/path', '/to', '/page', '.html']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('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://w.org/a=b/c&d', 5], ['https', '://w', '.org', '/a=b', '/c&d']), ('control layout', ['file:///usr/local/share/doc', 14], ['file:///usr', '/local/share', '/doc'])], [('regression: double slash integrity', ['https://www.docs.io/a/b/c#sec-3', 7], ['https:', '//www', '.docs', '.io/a/b', '/c#sec', '-3']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 6], ['http:', '//a.b', '.org', '/x//y', '?q=1&r', '=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 8], ['http://a', '.b.org', '/x//y?q=', '1&r=2']), ('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://www.docs.io/a/b/c#sec-3', 4], ['http', 's://', 'www', '.doc', 's.io', '/a/b', '/c', '#sec', '-3']), ('control layout', ['https://t.co/AbCdEf', 5], ['https', '://t', '.co', '/AbCd', 'Ef'])], [('regression: double slash integrity', ['https://example.com/path/to/page.html', 7], ['https:', '//', 'example', '.com', '/path', '/to', '/page', '.html']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 8], ['http://a', '.b.org', '/x//y?q=', '1&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 8], ['http://a', '.b.org', '/x//y?q=', '1&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 6], ['http:', '//a.b', '.org', '/x//y', '?q=1&r', '=2']), ('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', ['file:///usr/local/share/doc', 7], ['file://', '/usr', '/local', '/share', '/doc']), ('control layout', ['https://www.docs.io/a/b/c#sec-3', 14], ['https://www', '.docs.io/a/b/c', '#sec-3'])], [('regression: double slash integrity', ['ftp://files.site.net/pub/file-name_v2.tar.gz', 5], ['ftp:', '//', 'files', '.site', '.net', '/pub', '/file', '-name', '_v2', '.tar', '.gz']), ('regression: double slash integrity', ['https://t.co/AbCdEf', 7], ['https:', '//t.co', '/AbCdEf']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 9], ['http://a', '.b.org', '/x//y?q=1', '&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 8], ['http://a', '.b.org', '/x//y?q=', '1&r=2']), ('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://w.org/a=b/c&d', 16], ['https://w.org/a=', 'b/c&d']), ('control layout', ['https://example.com/path/to/page.html', 11], ['https://', 'example.com', '/path/to', '/page.html'])], [('regression: double slash integrity', ['https://example.com/path/to/page.html', 7], ['https:', '//', 'example', '.com', '/path', '/to', '/page', '.html']), ('regression: double slash integrity', ['file:///usr/local/share/doc', 6], ['file:', '///usr', '/local', '/share', '/doc']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 8], ['http://a', '.b.org', '/x//y?q=', '1&r=2']), ('regression: double slash integrity', ['http://a.b.org/x//y?q=1&r=2', 16], ['http://a.b.org', '/x//y?q=1&r=2']), ('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', 15], ['mailto:', 'someone@example', '.com']), ('control layout', ['file:///usr/local/share/doc', 12], ['file:///usr', '/local/share', '/doc'])]]
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: double slash integrity | ['https:', '//x.io', '/search', '?term=', 'line', '%20brea', 'k&lang=', 'en'] | ['https:', '//x.io', '/search', '?term=', 'line', '%20brea', 'k&lang=', 'en'] | Passed |
| regression: double slash integrity | ['https:', '//', 'example', '.com', '/path', '/to', '/page', '.html'] | ['https:', '//', 'example', '.com', '/path', '/to', '/page', '.html'] | Passed |
| regression: double slash integrity | ['http://a', '.b.org/x', '//y?q=1&r', '=2'] | ['http://a', '.b.org', '/x//y?q=1', '&r=2'] | Failed |
| regression: double slash integrity | ['http://a', '.b.org/x', '//y?q=1&r', '=2'] | ['http://a', '.b.org', '/x//y?q=1', '&r=2'] | 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 | ['https', '://w', '.org', '/a=b', '/c&d'] | ['https', '://w', '.org', '/a=b', '/c&d'] | Passed |
| control layout | ['file:///usr', '/local/share', '/doc'] | ['file:///usr', '/local/share', '/doc'] | Passed |
SHA-256 / 860be1427159b0c7d7f209c1d248a152a75f7ae76b23e26ae0c4420e43c269c4
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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.806865+00:00.
Case digest / 0eb7f56b1977e16a195094bc9682f77920629de23dffc8f9ab8472be8c6f35d5