FA-9621 / Configuration / Open access
Configuration schema diagnostics: Enumerated settings accept arbitrary values · case 01
Enumerated settings accept arbitrary values.
ROOT CAUSE
The implementation substitutes False for choices is not None and value not in choices, so enumerated settings accept arbitrary values.
VERIFIED REPAIR
Validate values against the declared allowed set.
Unsuccessful approach: The attempted repair substitutes choices is not None and value in choices. Fixture 6 still yields [] instead of [('a', 'choice')].
Case contract
Return errors in key order for missing required keys, unknown keys, exact type mismatch, disallowed values, and invalid bounds. Booleans must not satisfy integer type.
Why this case matters
An offline model of configuration schema diagnostics, suitable for testing build and release tooling without external services.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(data, schema):
errors = []
for key in sorted(set(data) | set(schema)):
if key not in schema: errors.append((key, 'unknown')); continue
required, kind, choices, minimum = schema[key]
if key not in data:
if required: errors.append((key, 'missing'))
continue
value = data[key]
if type(value).__name__ != kind: errors.append((key, 'type')); continue
if False: errors.append((key, 'choice'))
if minimum is not None and value < minimum: errors.append((key, 'minimum'))
return errors
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({}, {}), [])
check('fixture 2', solve({}, {'a': (True, 'int', None, None)}), [('a', 'missing')])
check('fixture 3', solve({}, {'a': (False, 'int', None, None)}), [])
check('fixture 4', solve({'x': 1}, {}), [('x', 'unknown')])
check('fixture 5', solve({'a': True}, {'a': (True, 'int', None, None)}), [('a', 'type')])
check('fixture 6', solve({'a': 2}, {'a': (True, 'int', [1, 3], None)}), [('a', 'choice')])
check('fixture 7', solve({'a': 1}, {'a': (True, 'int', None, 2)}), [('a', 'minimum')])
check('fixture 8', solve({'a': 2}, {'a': (True, 'int', None, 2)}), [])
check('fixture 9', solve({'a': 'x'}, {'a': (True, 'str', ['x'], None)}), [])
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 |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | [['a', 'missing']] | [['a', 'missing']] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [['x', 'unknown']] | [['x', 'unknown']] | Passed |
| fixture 5 | [['a', 'type']] | [['a', 'type']] | Passed |
| fixture 6 | [] | [['a', 'choice']] | Failed |
| fixture 7 | [['a', 'minimum']] | [['a', 'minimum']] | Passed |
| fixture 8 | [] | [] | Passed |
| fixture 9 | [] | [] | Passed |
SHA-256 / fb1d42329e242b2395ec8917e58f13b90bffd321a3937ec857d4c2415901ac7e
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(data, schema):
errors = []
for key in sorted(set(data) | set(schema)):
if key not in schema: errors.append((key, 'unknown')); continue
required, kind, choices, minimum = schema[key]
if key not in data:
if required: errors.append((key, 'missing'))
continue
value = data[key]
if type(value).__name__ != kind: errors.append((key, 'type')); continue
if choices is not None and value in choices: errors.append((key, 'choice'))
if minimum is not None and value < minimum: errors.append((key, 'minimum'))
return errors
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({}, {}), [])
check('fixture 2', solve({}, {'a': (True, 'int', None, None)}), [('a', 'missing')])
check('fixture 3', solve({}, {'a': (False, 'int', None, None)}), [])
check('fixture 4', solve({'x': 1}, {}), [('x', 'unknown')])
check('fixture 5', solve({'a': True}, {'a': (True, 'int', None, None)}), [('a', 'type')])
check('fixture 6', solve({'a': 2}, {'a': (True, 'int', [1, 3], None)}), [('a', 'choice')])
check('fixture 7', solve({'a': 1}, {'a': (True, 'int', None, 2)}), [('a', 'minimum')])
check('fixture 8', solve({'a': 2}, {'a': (True, 'int', None, 2)}), [])
check('fixture 9', solve({'a': 'x'}, {'a': (True, 'str', ['x'], None)}), [])
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 |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | [['a', 'missing']] | [['a', 'missing']] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [['x', 'unknown']] | [['x', 'unknown']] | Passed |
| fixture 5 | [['a', 'type']] | [['a', 'type']] | Passed |
| fixture 6 | [] | [['a', 'choice']] | Failed |
| fixture 7 | [['a', 'minimum']] | [['a', 'minimum']] | Passed |
| fixture 8 | [] | [] | Passed |
| fixture 9 | [['a', 'choice']] | [] | Failed |
SHA-256 / 281e4d206b7dfe91f29203aafc5d45365f26374c33cea18d231e9d60ecbc1c94
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(data, schema):
errors = []
for key in sorted(set(data) | set(schema)):
if key not in schema: errors.append((key, 'unknown')); continue
required, kind, choices, minimum = schema[key]
if key not in data:
if required: errors.append((key, 'missing'))
continue
value = data[key]
if type(value).__name__ != kind: errors.append((key, 'type')); continue
if choices is not None and value not in choices: errors.append((key, 'choice'))
if minimum is not None and value < minimum: errors.append((key, 'minimum'))
return errors
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({}, {}), [])
check('fixture 2', solve({}, {'a': (True, 'int', None, None)}), [('a', 'missing')])
check('fixture 3', solve({}, {'a': (False, 'int', None, None)}), [])
check('fixture 4', solve({'x': 1}, {}), [('x', 'unknown')])
check('fixture 5', solve({'a': True}, {'a': (True, 'int', None, None)}), [('a', 'type')])
check('fixture 6', solve({'a': 2}, {'a': (True, 'int', [1, 3], None)}), [('a', 'choice')])
check('fixture 7', solve({'a': 1}, {'a': (True, 'int', None, 2)}), [('a', 'minimum')])
check('fixture 8', solve({'a': 2}, {'a': (True, 'int', None, 2)}), [])
check('fixture 9', solve({'a': 'x'}, {'a': (True, 'str', ['x'], None)}), [])
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 |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | [['a', 'missing']] | [['a', 'missing']] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [['x', 'unknown']] | [['x', 'unknown']] | Passed |
| fixture 5 | [['a', 'type']] | [['a', 'type']] | Passed |
| fixture 6 | [['a', 'choice']] | [['a', 'choice']] | Passed |
| fixture 7 | [['a', 'minimum']] | [['a', 'minimum']] | Passed |
| fixture 8 | [] | [] | Passed |
| fixture 9 | [] | [] | Passed |
SHA-256 / 166c9af4fb28fcc3a677649a25e82b977cb9bc0bddede2fedacf963ad200a441
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:38:31.615193+00:00.
Case digest / a213b465b9548045a10d0461238fb76407a71c63bca2631db046bf31536c2dea