FA-3781 / Parsing / Open access
Column tracking does not reset after a newline · case 01
Column tracking does not reset after a newline.
ROOT CAUSE
The implementation applies an operation whose text or grammar semantics violate this contract: Given text and a valid codepoint offset, return one-based line and zero-based column; newline itself belongs to preceding line.
VERIFIED REPAIR
Implement the complete stated contract, including the boundary fixtures: Given text and a valid codepoint offset, return one-based line and zero-based column; newline itself belongs to preceding line.
Unsuccessful approach: The attempted repair handles the primary example but still violates a separate boundary of the same contract.
Case contract
Given text and a valid codepoint offset, return one-based line and zero-based column; newline itself belongs to preceding line.
Why this case matters
A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap
N = 1
observations = []
def solve(x):
try:
return [1,x[1]]
except Exception as exc:
return {"error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve(['a\nbc', 3]), [2, 1])
check('boundary 2', solve(['a\nb', 1]), [1, 1])
check('boundary 3', solve(['\n', 1]), [2, 0])
check('boundary 4', solve(['', 0]), [1, 0])
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 |
|---|---|---|---|
| boundary 1 | [1, 3] | [2, 1] | Failed |
| boundary 2 | [1, 1] | [1, 1] | Passed |
| boundary 3 | [1, 1] | [2, 0] | Failed |
| boundary 4 | [1, 0] | [1, 0] | Passed |
SHA-256 / d89033c48f182b1239bda986eba9022e5e4b21661439c1d7b73849d523e01b22
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap
N = 1
observations = []
def solve(x):
try:
return [x[0][:x[1]].count('\n')+1,x[1]]
except Exception as exc:
return {"error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve(['a\nbc', 3]), [2, 1])
check('boundary 2', solve(['a\nb', 1]), [1, 1])
check('boundary 3', solve(['\n', 1]), [2, 0])
check('boundary 4', solve(['', 0]), [1, 0])
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 |
|---|---|---|---|
| boundary 1 | [2, 3] | [2, 1] | Failed |
| boundary 2 | [1, 1] | [1, 1] | Passed |
| boundary 3 | [2, 1] | [2, 0] | Failed |
| boundary 4 | [1, 0] | [1, 0] | Passed |
SHA-256 / b4e9835d9daf4f219706ec25fa5761fc547fc078f6d725030ef5c2dd1ca5b014
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap
N = 1
observations = []
def solve(x):
try:
return [x[0][:x[1]].count('\n')+1,x[1]-(x[0].rfind('\n',0,x[1])+1)]
except Exception as exc:
return {"error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve(['a\nbc', 3]), [2, 1])
check('boundary 2', solve(['a\nb', 1]), [1, 1])
check('boundary 3', solve(['\n', 1]), [2, 0])
check('boundary 4', solve(['', 0]), [1, 0])
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 |
|---|---|---|---|
| boundary 1 | [2, 1] | [2, 1] | Passed |
| boundary 2 | [1, 1] | [1, 1] | Passed |
| boundary 3 | [2, 0] | [2, 0] | Passed |
| boundary 4 | [1, 0] | [1, 0] | Passed |
SHA-256 / 78d3142a668ff71596d20f1ea493ea9e6e3c5ba7e80c876e61ecdc440e86005d
Verification & scope
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:37:30.807561+00:00.
Case digest / 496e9d775773fb2d0a0eb81c128b2250d6b735532f0b405a01a74a0087e30665