FAILURE MAP
← Case archive

FA-3451 / Lexical grammars / Open access

A code fence closes with a shorter delimiter · case 01

A code fence closes with a shorter delimiter.

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

ROOT CAUSE

The recognizer uses '`{3,}\\n[^\\n]*\\n`{3,}', which admits or omits a token shape forbidden by the stated grammar.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Accept a backtick run of at least three, one text line, and an identical closing run on its own line.

Unsuccessful approach: The candidate grammar '(`{3})\\n[^\\n]*\\n\\1' still disagrees with the explicit boundary fixtures.

Case contract

Accept a backtick run of at least three, one text line, and an identical closing run on its own 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 bool(re.fullmatch('`{3,}\\n[^\\n]*\\n`{3,}',x))
    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('````\nx\n```'), False)
check('boundary 2', solve('````\nx\n````'), True)
check('boundary 3', solve('```\n\n```'), True)
check('boundary 4', solve('```\nx\n```'), True)
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
boundary 1TrueFalseFailed
boundary 2TrueTruePassed
boundary 3TrueTruePassed
boundary 4TrueTruePassed

SHA-256 / 95fe73aceb8820b80217efd29999326d5acf7bd42c2edf4e989c3184c7c77b31

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 bool(re.fullmatch('(`{3})\\n[^\\n]*\\n\\1',x))
    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('````\nx\n```'), False)
check('boundary 2', solve('````\nx\n````'), True)
check('boundary 3', solve('```\n\n```'), True)
check('boundary 4', solve('```\nx\n```'), True)
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
boundary 1FalseFalsePassed
boundary 2FalseTrueFailed
boundary 3TrueTruePassed
boundary 4TrueTruePassed

SHA-256 / 66d38289e784dc2c2c8786eb32e0876c80108a08307d48d33aaf505625c31c9a

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 bool(re.fullmatch('(`{3,})\\n[^\\n]*\\n\\1',x))
    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('````\nx\n```'), False)
check('boundary 2', solve('````\nx\n````'), True)
check('boundary 3', solve('```\n\n```'), True)
check('boundary 4', solve('```\nx\n```'), True)
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
boundary 1FalseFalsePassed
boundary 2TrueTruePassed
boundary 3TrueTruePassed
boundary 4TrueTruePassed

SHA-256 / 3abf82c48823b8eb34000d6bb40b7582047ae785aebf62d85751933a2cfec8d8

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:26.046138+00:00.

Case digest / 4819e761de487768b1857879eeb9b6b4a376bf7d9cbfa55b6a47a753f7b8e30f