{"abstract":"Saving restores stale initial values.","category":"Form lifecycle","checks":8,"contract":"Edits change draft only; reset restores baseline; commit accepts draft; unmount removal clears both; dirty comparison includes additions and removals.","evaluation_group":"xi-form-dirty","failed_approach":"Removing the baseline makes every saved value dirty.","family":"xi-form-dirty-commit","id":"FA-7991","implementations":{"attempt":{"sha256":"a6859daa89dc094f1d3cb03f7b1585a93dd7b4e15e76719ae1da41d768bcc492","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(initial, current, event, name, value):\n    initial, current = initial.copy(), current.copy()\n    if event == 'input': current[name] = value\n    elif event == 'reset': current = dict(initial)\n    elif event == 'commit': initial = {}\n    elif event == 'remove': current.pop(name, None); initial.pop(name, None)\n    dirty = sorted(k for k in set(initial) | set(current) if initial.get(k, object()) != current.get(k, object()))\n    return (initial, current, dirty)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('edit', solve({'a':1}, {'a':1}, 'input', 'a', 2), ({'a': 1}, {'a': 2}, ['a']))\ncheck('reset', solve({'a':1}, {'a':2}, 'reset', None, None), ({'a': 1}, {'a': 1}, []))\ncheck('commit', solve({'a':1}, {'a':2}, 'commit', None, None), ({'a': 2}, {'a': 2}, []))\ncheck('remove', solve({'a':1,'b':2}, {'a':3,'b':2}, 'remove', 'a', None), ({'b': 2}, {'b': 2}, []))\ncheck('new', solve({}, {'new':0}, 'read', None, None), ({}, {'new': 0}, ['new']))\ncheck('removed', solve({'a':1}, {}, 'read', None, None), ({'a': 1}, {}, ['a']))\ncheck('parameterized dirty value', solve({'a':N}, {'a':N}, 'input', 'a', N+1), ({'a':N}, {'a':N+1}, ['a']))\nfor repetition in range(N):\n    check('repeat removed', solve({'a':1}, {}, 'read', None, None), ({'a': 1}, {}, ['a']))\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":"de9a9eb67f362c34fb63409cf0449444d6448e0bf17c100fae753db1144a629d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(initial, current, event, name, value):\n    initial, current = initial.copy(), current.copy()\n    if event == 'input': current[name] = value\n    elif event == 'reset': current = dict(initial)\n    elif event == 'commit': current = dict(initial)\n    elif event == 'remove': current.pop(name, None); initial.pop(name, None)\n    dirty = sorted(k for k in set(initial) | set(current) if initial.get(k, object()) != current.get(k, object()))\n    return (initial, current, dirty)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('edit', solve({'a':1}, {'a':1}, 'input', 'a', 2), ({'a': 1}, {'a': 2}, ['a']))\ncheck('reset', solve({'a':1}, {'a':2}, 'reset', None, None), ({'a': 1}, {'a': 1}, []))\ncheck('commit', solve({'a':1}, {'a':2}, 'commit', None, None), ({'a': 2}, {'a': 2}, []))\ncheck('remove', solve({'a':1,'b':2}, {'a':3,'b':2}, 'remove', 'a', None), ({'b': 2}, {'b': 2}, []))\ncheck('new', solve({}, {'new':0}, 'read', None, None), ({}, {'new': 0}, ['new']))\ncheck('removed', solve({'a':1}, {}, 'read', None, None), ({'a': 1}, {}, ['a']))\ncheck('parameterized dirty value', solve({'a':N}, {'a':N}, 'input', 'a', N+1), ({'a':N}, {'a':N+1}, ['a']))\nfor repetition in range(N):\n    check('repeat removed', solve({'a':1}, {}, 'read', None, None), ({'a': 1}, {}, ['a']))\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"},"fixed":{"sha256":"b63e8e7931c4bdb9300dcd6b9f00fae2852e95c78e3e5bd58ac37e930f722a94","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(initial, current, event, name, value):\n    initial, current = initial.copy(), current.copy()\n    if event == 'input': current[name] = value\n    elif event == 'reset': current = dict(initial)\n    elif event == 'commit': initial = dict(current)\n    elif event == 'remove': current.pop(name, None); initial.pop(name, None)\n    dirty = sorted(k for k in set(initial) | set(current) if initial.get(k, object()) != current.get(k, object()))\n    return (initial, current, dirty)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('edit', solve({'a':1}, {'a':1}, 'input', 'a', 2), ({'a': 1}, {'a': 2}, ['a']))\ncheck('reset', solve({'a':1}, {'a':2}, 'reset', None, None), ({'a': 1}, {'a': 1}, []))\ncheck('commit', solve({'a':1}, {'a':2}, 'commit', None, None), ({'a': 2}, {'a': 2}, []))\ncheck('remove', solve({'a':1,'b':2}, {'a':3,'b':2}, 'remove', 'a', None), ({'b': 2}, {'b': 2}, []))\ncheck('new', solve({}, {'new':0}, 'read', None, None), ({}, {'new': 0}, ['new']))\ncheck('removed', solve({'a':1}, {}, 'read', None, None), ({'a': 1}, {}, ['a']))\ncheck('parameterized dirty value', solve({'a':N}, {'a':N}, 'input', 'a', N+1), ({'a':N}, {'a':N+1}, ['a']))\nfor repetition in range(N):\n    check('repeat removed', solve({'a':1}, {}, 'read', None, None), ({'a': 1}, {}, ['a']))\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":" 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":"xi-form-dirty-commit","generated_at":"2026-09-29T14:38:17.177989+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic model of form dirty-field bookkeeping; this isolates one interface invariant without requiring a browser.","repair":"Implement the commit operation as `initial = dict(current)`.","root_cause":"The commit operation uses `current = dict(initial)` where the contract requires `initial = dict(current)`.","sha256":"82890237e49632ef417ca1ebb478597c6c8c04212bd409366fba1ecdcba72b6a","title":"Form dirty-field bookkeeping: Saving restores stale initial values · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.666,"exit_code":1,"observations":[{"actual":[{"a":1},{"a":2},["a"]],"check":"edit","expected":[{"a":1},{"a":2},["a"]],"passed":true},{"actual":[{"a":1},{"a":1},[]],"check":"reset","expected":[{"a":1},{"a":1},[]],"passed":true},{"actual":[{},{"a":2},["a"]],"check":"commit","expected":[{"a":2},{"a":2},[]],"passed":false},{"actual":[{"b":2},{"b":2},[]],"check":"remove","expected":[{"b":2},{"b":2},[]],"passed":true},{"actual":[{},{"new":0},["new"]],"check":"new","expected":[{},{"new":0},["new"]],"passed":true},{"actual":[{"a":1},{},["a"]],"check":"removed","expected":[{"a":1},{},["a"]],"passed":true},{"actual":[{"a":1},{"a":2},["a"]],"check":"parameterized dirty value","expected":[{"a":1},{"a":2},["a"]],"passed":true},{"actual":[{"a":1},{},["a"]],"check":"repeat removed","expected":[{"a":1},{},["a"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"edit\", \"actual\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": true}, {\"check\": \"reset\", \"actual\": [{\"a\": 1}, {\"a\": 1}, []], \"expected\": [{\"a\": 1}, {\"a\": 1}, []], \"passed\": true}, {\"check\": \"commit\", \"actual\": [{}, {\"a\": 2}, [\"a\"]], \"expected\": [{\"a\": 2}, {\"a\": 2}, []], \"passed\": false}, {\"check\": \"remove\", \"actual\": [{\"b\": 2}, {\"b\": 2}, []], \"expected\": [{\"b\": 2}, {\"b\": 2}, []], \"passed\": true}, {\"check\": \"new\", \"actual\": [{}, {\"new\": 0}, [\"new\"]], \"expected\": [{}, {\"new\": 0}, [\"new\"]], \"passed\": true}, {\"check\": \"removed\", \"actual\": [{\"a\": 1}, {}, [\"a\"]], \"expected\": [{\"a\": 1}, {}, [\"a\"]], \"passed\": true}, {\"check\": \"parameterized dirty value\", \"actual\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": true}, {\"check\": \"repeat removed\", \"actual\": [{\"a\": 1}, {}, [\"a\"]], \"expected\": [{\"a\": 1}, {}, [\"a\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.794,"exit_code":1,"observations":[{"actual":[{"a":1},{"a":2},["a"]],"check":"edit","expected":[{"a":1},{"a":2},["a"]],"passed":true},{"actual":[{"a":1},{"a":1},[]],"check":"reset","expected":[{"a":1},{"a":1},[]],"passed":true},{"actual":[{"a":1},{"a":1},[]],"check":"commit","expected":[{"a":2},{"a":2},[]],"passed":false},{"actual":[{"b":2},{"b":2},[]],"check":"remove","expected":[{"b":2},{"b":2},[]],"passed":true},{"actual":[{},{"new":0},["new"]],"check":"new","expected":[{},{"new":0},["new"]],"passed":true},{"actual":[{"a":1},{},["a"]],"check":"removed","expected":[{"a":1},{},["a"]],"passed":true},{"actual":[{"a":1},{"a":2},["a"]],"check":"parameterized dirty value","expected":[{"a":1},{"a":2},["a"]],"passed":true},{"actual":[{"a":1},{},["a"]],"check":"repeat removed","expected":[{"a":1},{},["a"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"edit\", \"actual\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": true}, {\"check\": \"reset\", \"actual\": [{\"a\": 1}, {\"a\": 1}, []], \"expected\": [{\"a\": 1}, {\"a\": 1}, []], \"passed\": true}, {\"check\": \"commit\", \"actual\": [{\"a\": 1}, {\"a\": 1}, []], \"expected\": [{\"a\": 2}, {\"a\": 2}, []], \"passed\": false}, {\"check\": \"remove\", \"actual\": [{\"b\": 2}, {\"b\": 2}, []], \"expected\": [{\"b\": 2}, {\"b\": 2}, []], \"passed\": true}, {\"check\": \"new\", \"actual\": [{}, {\"new\": 0}, [\"new\"]], \"expected\": [{}, {\"new\": 0}, [\"new\"]], \"passed\": true}, {\"check\": \"removed\", \"actual\": [{\"a\": 1}, {}, [\"a\"]], \"expected\": [{\"a\": 1}, {}, [\"a\"]], \"passed\": true}, {\"check\": \"parameterized dirty value\", \"actual\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": true}, {\"check\": \"repeat removed\", \"actual\": [{\"a\": 1}, {}, [\"a\"]], \"expected\": [{\"a\": 1}, {}, [\"a\"]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.303,"exit_code":0,"observations":[{"actual":[{"a":1},{"a":2},["a"]],"check":"edit","expected":[{"a":1},{"a":2},["a"]],"passed":true},{"actual":[{"a":1},{"a":1},[]],"check":"reset","expected":[{"a":1},{"a":1},[]],"passed":true},{"actual":[{"a":2},{"a":2},[]],"check":"commit","expected":[{"a":2},{"a":2},[]],"passed":true},{"actual":[{"b":2},{"b":2},[]],"check":"remove","expected":[{"b":2},{"b":2},[]],"passed":true},{"actual":[{},{"new":0},["new"]],"check":"new","expected":[{},{"new":0},["new"]],"passed":true},{"actual":[{"a":1},{},["a"]],"check":"removed","expected":[{"a":1},{},["a"]],"passed":true},{"actual":[{"a":1},{"a":2},["a"]],"check":"parameterized dirty value","expected":[{"a":1},{"a":2},["a"]],"passed":true},{"actual":[{"a":1},{},["a"]],"check":"repeat removed","expected":[{"a":1},{},["a"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"edit\", \"actual\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": true}, {\"check\": \"reset\", \"actual\": [{\"a\": 1}, {\"a\": 1}, []], \"expected\": [{\"a\": 1}, {\"a\": 1}, []], \"passed\": true}, {\"check\": \"commit\", \"actual\": [{\"a\": 2}, {\"a\": 2}, []], \"expected\": [{\"a\": 2}, {\"a\": 2}, []], \"passed\": true}, {\"check\": \"remove\", \"actual\": [{\"b\": 2}, {\"b\": 2}, []], \"expected\": [{\"b\": 2}, {\"b\": 2}, []], \"passed\": true}, {\"check\": \"new\", \"actual\": [{}, {\"new\": 0}, [\"new\"]], \"expected\": [{}, {\"new\": 0}, [\"new\"]], \"passed\": true}, {\"check\": \"removed\", \"actual\": [{\"a\": 1}, {}, [\"a\"]], \"expected\": [{\"a\": 1}, {}, [\"a\"]], \"passed\": true}, {\"check\": \"parameterized dirty value\", \"actual\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": true}, {\"check\": \"repeat removed\", \"actual\": [{\"a\": 1}, {}, [\"a\"]], \"expected\": [{\"a\": 1}, {}, [\"a\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}