FAILURE MAP
← Case archive

FA-9706 / Configuration / Open access

Command option assignment: Assignment preserves an obsolete default · case 01

Assignment preserves an obsolete default.

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

ROOT CAUSE

The implementation substitutes if op == 'set': result.setdefault(key, value) for if op == 'set': result[key] = value, so assignment preserves an obsolete default.

THE FAILURE

The implementation substitutes if op == 'set': result.setdefault(key, value) for if op == 'set': result[key] = value, so assignment preserves an obsolete default.

Unsuccessful approach: The attempted repair substitutes if op == 'set': result[key] = value or result.get(key). Fixture 2 still yields {'a': 1} instead of {'a': 0}.

Case contract

Starting from defaults, process assignment, append, unset, enable, and disable operations in sequence. Append creates a new list or extends an existing list. Unknown operations are ignored.

Why this case matters

An offline model of command option assignment, 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(defaults, operations):
    result = dict(defaults)
    for op, key, value in operations:
        if op == 'set': result.setdefault(key, value)
        elif op == 'append': result[key] = list(result.get(key, [])) + [value]
        elif op == 'unset': result.pop(key, None)
        elif op == 'enable': result[key] = True
        elif op == 'disable': result[key] = False
    return result
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': 1}, [('set', 'a', 0)]), {'a': 0})
check('fixture 3', solve({'a': [1]}, [('append', 'a', 2), ('append', 'a', 2)]), {'a': [1, 2, 2]})
check('fixture 4', solve({'a': 1}, [('unset', 'a', None)]), {})
check('fixture 5', solve({}, [('unset', 'a', None)]), {})
check('fixture 6', solve({}, [('enable', 'a', None)]), {'a': True})
check('fixture 7', solve({'a': True}, [('disable', 'a', None)]), {'a': False})
check('fixture 8', solve({'a': 1}, [('unknown', 'a', 2)]), {'a': 1})
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
fixture 1{}{}Passed
fixture 2{'a': 1}{'a': 0}Failed
fixture 3{'a': [1, 2, 2]}{'a': [1, 2, 2]}Passed
fixture 4{}{}Passed
fixture 5{}{}Passed
fixture 6{'a': True}{'a': True}Passed
fixture 7{'a': False}{'a': False}Passed
fixture 8{'a': 1}{'a': 1}Passed

SHA-256 / 5d8f3435318d1cdf3e70c369ffc27bf5bea6ba993e816a6df1624f9040bd70f0

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(defaults, operations):
    result = dict(defaults)
    for op, key, value in operations:
        if op == 'set': result[key] = value or result.get(key)
        elif op == 'append': result[key] = list(result.get(key, [])) + [value]
        elif op == 'unset': result.pop(key, None)
        elif op == 'enable': result[key] = True
        elif op == 'disable': result[key] = False
    return result
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': 1}, [('set', 'a', 0)]), {'a': 0})
check('fixture 3', solve({'a': [1]}, [('append', 'a', 2), ('append', 'a', 2)]), {'a': [1, 2, 2]})
check('fixture 4', solve({'a': 1}, [('unset', 'a', None)]), {})
check('fixture 5', solve({}, [('unset', 'a', None)]), {})
check('fixture 6', solve({}, [('enable', 'a', None)]), {'a': True})
check('fixture 7', solve({'a': True}, [('disable', 'a', None)]), {'a': False})
check('fixture 8', solve({'a': 1}, [('unknown', 'a', 2)]), {'a': 1})
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
fixture 1{}{}Passed
fixture 2{'a': 1}{'a': 0}Failed
fixture 3{'a': [1, 2, 2]}{'a': [1, 2, 2]}Passed
fixture 4{}{}Passed
fixture 5{}{}Passed
fixture 6{'a': True}{'a': True}Passed
fixture 7{'a': False}{'a': False}Passed
fixture 8{'a': 1}{'a': 1}Passed

SHA-256 / eb7b07882402b15127005b5761541c479cb57f8be93d24304aa2670b52cd9c66

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 14096e000a2d5190348cea043f8872299a90942e2c33eedf2611469f12dc0d38