FAILURE MAP
← Case archive

FA-3811 / Parsing / Open access

A nested comment ends at its first inner terminator · case 01

A nested comment ends at its first inner terminator.

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

ROOT CAUSE

The implementation applies an operation whose text or grammar semantics violate this contract: Remove nested /* */ comments from otherwise literal text; unclosed comments return None.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Remove nested /* */ comments from otherwise literal text; unclosed comments return None.

Unsuccessful approach: The attempted repair handles the primary example but still violates a separate boundary of the same contract.

Case contract

Remove nested /* */ comments from otherwise literal text; unclosed comments return None.

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 re.sub(r'/\*.*?\*/','',x,flags=re.S)
    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/*c*/d*/e'), 'ae')
check('boundary 2', solve('a/*x*/b/*y*/c'), 'abc')
check('boundary 3', solve('a/*'), None)
check('boundary 4', solve('plain'), 'plain')
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 1ad*/eaeFailed
boundary 2abcabcPassed
boundary 3a/*NoneFailed
boundary 4plainplainPassed

SHA-256 / 00c6596bfe8e9ed0a3ce581a02621a53c88cee906c0c92a1709a50560b6d99a1

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 re.sub(r'/\*.*\*/','',x,flags=re.S)
    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/*c*/d*/e'), 'ae')
check('boundary 2', solve('a/*x*/b/*y*/c'), 'abc')
check('boundary 3', solve('a/*'), None)
check('boundary 4', solve('plain'), 'plain')
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 1aeaePassed
boundary 2acabcFailed
boundary 3a/*NoneFailed
boundary 4plainplainPassed

SHA-256 / b48f9a34e96bef915d3131b24b79a05c80c2ca4b29078b5f037df57d21f52b98

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:
        out=[]
        i=depth=0
        while i<len(x):
            if x[i:i+2]=='/*': depth+=1; i+=2
            elif depth and x[i:i+2]=='*/': depth-=1; i+=2
            else:
                if not depth: out.append(x[i])
                i+=1
        return None if depth else ''.join(out)
    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/*c*/d*/e'), 'ae')
check('boundary 2', solve('a/*x*/b/*y*/c'), 'abc')
check('boundary 3', solve('a/*'), None)
check('boundary 4', solve('plain'), 'plain')
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 1aeaePassed
boundary 2abcabcPassed
boundary 3NoneNonePassed
boundary 4plainplainPassed

SHA-256 / fa526a5666b4ab37c2cd894e33c5d104cf1214328dbf7186514776a5229c1afd

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

Case digest / 8349f57e5d92843a92c627e7c307ae9a39d797e39e8b81694d461c5aba78b064