{"abstract":"'1 234,50' from a locale-aware formatter fails to parse.","category":"Currency rounding and FX conversion","checks":6,"contract":"solve(text, locale, exp): parse a localized amount into integer minor units at exponent exp. Group/decimal separators: en ',' '.', de '.' ',', ch \"'\" '.', fr ' ' or U+202F and ','. An optional leading '-' marks a negative amount (including -0.xx). If grouping is used, the first group has 1-3 digits and every later group exactly 3. A decimal separator must be followed by digits. Fraction digits beyond exp are allowed only if they are zeros, otherwise 'ERR:precision'. Malformed text returns 'ERR:format'; an unknown locale 'ERR:locale'.","contract_signature":"text, locale, exp","evaluation_group":"w2-currency_rounding_and_fx_conversion-locale-amount-parsing","failed_approach":"Adding U+00A0 instead of U+202F still rejects the narrow no-break space.","family":"w2-currency_rounding_and_fx_conversion-locale-amount-parsing-narrow-space-group","id":"FA-62131","implementations":{"attempt":{"sha256":"109125873c780615f448bfd8ee18215d4f4697ea28e420681cddfc36665fa6ba","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, locale, exp):\n    seps = {'en': (',', '.'), 'de': ('.', ','), 'ch': (\"'\", '.'), 'fr': (' \\u00a0', ',')}\n    if locale not in seps: return 'ERR:locale'\n    groups, dec = seps[locale]\n    dig = lambda t: t != '' and all(c in '0123456789' for c in t)\n    s = text.strip()\n    neg = s.startswith('-')\n    if neg: s = s[1:]\n    whole, _, frac = s.partition(dec)\n    for g in groups[1:]: whole = whole.replace(g, groups[0])\n    parts = whole.split(groups[0])\n    if not all(dig(p) for p in parts) or (dec in s and not dig(frac)): return 'ERR:format'\n    if len(parts) > 1 and (len(parts[0]) > 3 or any(len(p) != 3 for p in parts[1:])): return 'ERR:format'\n    if frac[exp:].strip('0'): return 'ERR:precision'\n    frac = frac[:exp].ljust(exp, '0')\n    v = int(''.join(parts)) * 10 ** exp + (int(frac) if frac else 0)\n    return -v if neg else v\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression narrow-space-group 1', ('1\\u202f234,500', 'fr', 2), 123450),\n  ('regression narrow-space-group 2', ('-12\\u202f345,6', 'fr', 2), -1234560),\n  ('control: english grouping', ('1,234.56', 'en', 2), 123456),\n  ('control: german short fraction', ('1.234,5', 'de', 2), 123450),\n  ('control: negative below one', ('-0,50', 'de', 2), -50),\n  ('control: excess precision', ('12.345', 'en', 2), 'ERR:precision')],\n [('regression narrow-space-group 1', ('-12\\u202f345,05', 'fr', 2), -1234505),\n  ('regression narrow-space-group 2', ('-1\\u202f234\\u202f567,05', 'fr', 2), -123456705),\n  ('partial repair guard 1', ('1\\xa0234\\xa0567,0010', 'fr', 2), 'ERR:format'),\n  ('partial repair guard 2', ('1\\xa0234\\xa0567,5', 'fr', 3), 'ERR:format'),\n  ('control: narrow space with trailing zero', ('1\\u202f234,500', 'fr', 2), 123450),\n  ('control: excess precision', ('12.345', 'en', 2), 'ERR:precision'),\n  ('control: bad grouping', ('1,23,4.00', 'en', 2), 'ERR:format'),\n  ('control: dinar fraction', ('12.5', 'en', 3), 12500)],\n [('regression narrow-space-group 1', ('100\\u202f000,05', 'fr', 0), 'ERR:precision'),\n  ('regression narrow-space-group 2', ('1\\u202f000,0010', 'fr', 3), 1000001),\n  ('partial repair guard 1', ('-12\\u202f345,05', 'fr', 2), -1234505),\n  ('partial repair guard 2', ('-1\\u202f234\\u202f567,05', 'fr', 2), -123456705),\n  ('control: dinar fraction', ('12.5', 'en', 3), 12500), ('control: swiss integer', (\"1'000\", 'ch', 0), 1000),\n  ('control: french plain space', ('12 345,6', 'fr', 2), 1234560),\n  ('control: dangling separator', ('12.', 'en', 2), 'ERR:format')],\n [('regression narrow-space-group 1', ('1\\u202f234\\u202f567,500', 'fr', 2), 123456750),\n  ('regression narrow-space-group 2', ('-1\\u202f234\\u202f567,123', 'fr', 2), 'ERR:precision'),\n  ('partial repair guard 1', ('1\\xa0234\\xa0567,123', 'fr', 0), 'ERR:format'),\n  ('partial repair guard 2', ('100\\u202f000,05', 'fr', 0), 'ERR:precision'),\n  ('control: dangling separator', ('12.', 'en', 2), 'ERR:format'),\n  ('control: unknown locale', ('12', 'it', 2), 'ERR:locale'),\n  ('control: oversized first group', ('1234,567.00', 'en', 2), 'ERR:format'),\n  ('control: english grouping', ('1,234.56', 'en', 2), 123456)],\n [('regression narrow-space-group 1', ('-1\\u202f000,50', 'fr', 3), -1000500),\n  ('regression narrow-space-group 2', ('-1\\u202f234\\u202f567', 'fr', 3), -1234567000),\n  ('partial repair guard 1', ('100\\xa0000,50', 'fr', 2), 'ERR:format'),\n  ('partial repair guard 2', ('1\\u202f000,0010', 'fr', 3), 1000001),\n  ('control: english grouping', ('1,234.56', 'en', 2), 123456),\n  ('control: german short fraction', ('1.234,5', 'de', 2), 123450),\n  ('control: negative below one', ('-0,50', 'de', 2), -50),\n  ('control: narrow space with trailing zero', ('1\\u202f234,500', 'fr', 2), 123450)]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"77db3d7a28f8b559f9d7397b6b95e9b21e05b1189f1fc0a62cf117e0dea4bb0c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, locale, exp):\n    seps = {'en': (',', '.'), 'de': ('.', ','), 'ch': (\"'\", '.'), 'fr': (' ', ',')}\n    if locale not in seps: return 'ERR:locale'\n    groups, dec = seps[locale]\n    dig = lambda t: t != '' and all(c in '0123456789' for c in t)\n    s = text.strip()\n    neg = s.startswith('-')\n    if neg: s = s[1:]\n    whole, _, frac = s.partition(dec)\n    for g in groups[1:]: whole = whole.replace(g, groups[0])\n    parts = whole.split(groups[0])\n    if not all(dig(p) for p in parts) or (dec in s and not dig(frac)): return 'ERR:format'\n    if len(parts) > 1 and (len(parts[0]) > 3 or any(len(p) != 3 for p in parts[1:])): return 'ERR:format'\n    if frac[exp:].strip('0'): return 'ERR:precision'\n    frac = frac[:exp].ljust(exp, '0')\n    v = int(''.join(parts)) * 10 ** exp + (int(frac) if frac else 0)\n    return -v if neg else v\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression narrow-space-group 1', ('1\\u202f234,500', 'fr', 2), 123450),\n  ('regression narrow-space-group 2', ('-12\\u202f345,6', 'fr', 2), -1234560),\n  ('control: english grouping', ('1,234.56', 'en', 2), 123456),\n  ('control: german short fraction', ('1.234,5', 'de', 2), 123450),\n  ('control: negative below one', ('-0,50', 'de', 2), -50),\n  ('control: excess precision', ('12.345', 'en', 2), 'ERR:precision')],\n [('regression narrow-space-group 1', ('-12\\u202f345,05', 'fr', 2), -1234505),\n  ('regression narrow-space-group 2', ('-1\\u202f234\\u202f567,05', 'fr', 2), -123456705),\n  ('partial repair guard 1', ('1\\xa0234\\xa0567,0010', 'fr', 2), 'ERR:format'),\n  ('partial repair guard 2', ('1\\xa0234\\xa0567,5', 'fr', 3), 'ERR:format'),\n  ('control: narrow space with trailing zero', ('1\\u202f234,500', 'fr', 2), 123450),\n  ('control: excess precision', ('12.345', 'en', 2), 'ERR:precision'),\n  ('control: bad grouping', ('1,23,4.00', 'en', 2), 'ERR:format'),\n  ('control: dinar fraction', ('12.5', 'en', 3), 12500)],\n [('regression narrow-space-group 1', ('100\\u202f000,05', 'fr', 0), 'ERR:precision'),\n  ('regression narrow-space-group 2', ('1\\u202f000,0010', 'fr', 3), 1000001),\n  ('partial repair guard 1', ('-12\\u202f345,05', 'fr', 2), -1234505),\n  ('partial repair guard 2', ('-1\\u202f234\\u202f567,05', 'fr', 2), -123456705),\n  ('control: dinar fraction', ('12.5', 'en', 3), 12500), ('control: swiss integer', (\"1'000\", 'ch', 0), 1000),\n  ('control: french plain space', ('12 345,6', 'fr', 2), 1234560),\n  ('control: dangling separator', ('12.', 'en', 2), 'ERR:format')],\n [('regression narrow-space-group 1', ('1\\u202f234\\u202f567,500', 'fr', 2), 123456750),\n  ('regression narrow-space-group 2', ('-1\\u202f234\\u202f567,123', 'fr', 2), 'ERR:precision'),\n  ('partial repair guard 1', ('1\\xa0234\\xa0567,123', 'fr', 0), 'ERR:format'),\n  ('partial repair guard 2', ('100\\u202f000,05', 'fr', 0), 'ERR:precision'),\n  ('control: dangling separator', ('12.', 'en', 2), 'ERR:format'),\n  ('control: unknown locale', ('12', 'it', 2), 'ERR:locale'),\n  ('control: oversized first group', ('1234,567.00', 'en', 2), 'ERR:format'),\n  ('control: english grouping', ('1,234.56', 'en', 2), 123456)],\n [('regression narrow-space-group 1', ('-1\\u202f000,50', 'fr', 3), -1000500),\n  ('regression narrow-space-group 2', ('-1\\u202f234\\u202f567', 'fr', 3), -1234567000),\n  ('partial repair guard 1', ('100\\xa0000,50', 'fr', 2), 'ERR:format'),\n  ('partial repair guard 2', ('1\\u202f000,0010', 'fr', 3), 1000001),\n  ('control: english grouping', ('1,234.56', 'en', 2), 123456),\n  ('control: german short fraction', ('1.234,5', 'de', 2), 123450),\n  ('control: negative below one', ('-0,50', 'de', 2), -50),\n  ('control: narrow space with trailing zero', ('1\\u202f234,500', 'fr', 2), 123450)]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic, bounded teaching model with a stipulated toy contract; it makes no claim of conformance to any real regulation, standard, or institution's rules. 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-currency_rounding_and_fx_conversion-locale-amount-parsing-narrow-space-group","generated_at":"2026-09-29T14:47:01.743094+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Currency amounts must be rounded at the right stage and in the right unit, or ledgers, quotes and settlements drift by minor units.","root_cause":"Only an ASCII space is recognised as the French group separator.","sha256":"afaf4651cb6f4937db412b9e654fa921c4ecb6e0e8e70247d2f855694d232535","title":"French amounts grouped with a narrow no-break space are rejected · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":40.256,"exit_code":1,"observations":[{"actual":"ERR:format","check":"regression narrow-space-group 1","expected":123450,"passed":false},{"actual":"ERR:format","check":"regression narrow-space-group 2","expected":-1234560,"passed":false},{"actual":123456,"check":"control: english grouping","expected":123456,"passed":true},{"actual":123450,"check":"control: german short fraction","expected":123450,"passed":true},{"actual":-50,"check":"control: negative below one","expected":-50,"passed":true},{"actual":"ERR:precision","check":"control: excess precision","expected":"ERR:precision","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression narrow-space-group 1\", \"actual\": \"ERR:format\", \"expected\": 123450, \"passed\": false}, {\"check\": \"regression narrow-space-group 2\", \"actual\": \"ERR:format\", \"expected\": -1234560, \"passed\": false}, {\"check\": \"control: english grouping\", \"actual\": 123456, \"expected\": 123456, \"passed\": true}, {\"check\": \"control: german short fraction\", \"actual\": 123450, \"expected\": 123450, \"passed\": true}, {\"check\": \"control: negative below one\", \"actual\": -50, \"expected\": -50, \"passed\": true}, {\"check\": \"control: excess precision\", \"actual\": \"ERR:precision\", \"expected\": \"ERR:precision\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.845,"exit_code":1,"observations":[{"actual":"ERR:format","check":"regression narrow-space-group 1","expected":123450,"passed":false},{"actual":"ERR:format","check":"regression narrow-space-group 2","expected":-1234560,"passed":false},{"actual":123456,"check":"control: english grouping","expected":123456,"passed":true},{"actual":123450,"check":"control: german short fraction","expected":123450,"passed":true},{"actual":-50,"check":"control: negative below one","expected":-50,"passed":true},{"actual":"ERR:precision","check":"control: excess precision","expected":"ERR:precision","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression narrow-space-group 1\", \"actual\": \"ERR:format\", \"expected\": 123450, \"passed\": false}, {\"check\": \"regression narrow-space-group 2\", \"actual\": \"ERR:format\", \"expected\": -1234560, \"passed\": false}, {\"check\": \"control: english grouping\", \"actual\": 123456, \"expected\": 123456, \"passed\": true}, {\"check\": \"control: german short fraction\", \"actual\": 123450, \"expected\": 123450, \"passed\": true}, {\"check\": \"control: negative below one\", \"actual\": -50, \"expected\": -50, \"passed\": true}, {\"check\": \"control: excess precision\", \"actual\": \"ERR:precision\", \"expected\": \"ERR:precision\", \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}