FA-9611 / Configuration / Open access
Configuration schema diagnostics: Required keys may be omitted · case 01
Required keys may be omitted.
ROOT CAUSE
The implementation substitutes if False: for if required:, so required keys may be omitted.
VERIFIED REPAIR
Report absent required keys only.
Unsuccessful approach: The attempted repair substitutes if not required:. Fixture 2 still yields [] instead of [('a', 'missing')].
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 False: 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']] | Failed |
| 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 / 0baa41b6388c3beb6ae7eda2a31c1ad2b0be7e4e9ea06871dccebca6046c9a63
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 not 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']] | Failed |
| fixture 3 | [['a', 'missing']] | [] | Failed |
| 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 / cdb20d2cf7d97995e5326ae8dadaa4448f1cfe8c1e493a15ff55b07c20b3c5ab
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.535445+00:00.
Case digest / 4289b0241c0cb8e507e50719c2aaf45c0e06e80e529d9ee62f535a3bf54e058a