FAILURE MAP
← Case archive

FA-3576 / Lexical grammars / Open access

An XML-style comment contains an illegal internal double hyphen · case 01

An XML-style comment contains an illegal internal double hyphen.

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

ROOT CAUSE

The recognizer uses '<!--[\\s\\S]*-->', which admits or omits a token shape forbidden by the stated grammar.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Accept <!--body--> where body has no internal double hyphen and does not end in hyphen.

Unsuccessful approach: The candidate grammar '<!--(?:(?!--)[\\s\\S])+-->' still disagrees with the explicit boundary fixtures.

Case contract

Accept <!--body--> where body has no internal double hyphen and does not end in hyphen.

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('<!--[\\s\\S]*-->',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('<!--a--b-->'), False)
check('boundary 2', solve('<!--a--->'), False)
check('boundary 3', solve('<!--a-b-->'), True)
check('boundary 4', solve('<!---->'), 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 2TrueFalseFailed
boundary 3TrueTruePassed
boundary 4TrueTruePassed

SHA-256 / 9158652e6ec354bf30990c930f0790a86b98cacf835ee869d0c700daec78a4ab

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('<!--(?:(?!--)[\\s\\S])+-->',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('<!--a--b-->'), False)
check('boundary 2', solve('<!--a--->'), False)
check('boundary 3', solve('<!--a-b-->'), True)
check('boundary 4', solve('<!---->'), 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 2FalseFalsePassed
boundary 3TrueTruePassed
boundary 4FalseTrueFailed

SHA-256 / 97d577b48492d1c5ca6215ae1fa6befa967cc3e057accc15a28744a7706f32e4

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('<!--(?:[^-]|-(?!-))*-->',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('<!--a--b-->'), False)
check('boundary 2', solve('<!--a--->'), False)
check('boundary 3', solve('<!--a-b-->'), True)
check('boundary 4', solve('<!---->'), 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 2FalseFalsePassed
boundary 3TrueTruePassed
boundary 4TrueTruePassed

SHA-256 / 16269108adc1b868abbf1ecf6b6dd831698d1a05fda88e14190946c7e9929a73

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

Case digest / 18164776e15d8a7c709cf7e681943b9f76ab1cabba9f6e9f9e26280d44a0dd11