{"abstract":"Typing rewrites the baseline instead of the draft.","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.","contract_signature":"initial, current, event, name, value","evaluation_group":"xi-form-dirty","failed_approach":"Setdefault ignores edits to existing fields.","family":"xi-form-dirty-input","id":"FA-7981","implementations":{"attempt":{"sha256":"7505b7a289e0601cd816f5f11d60e2b9133d39a5bb430d73c9a9e929e9a8883a","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.setdefault(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"},"broken":{"sha256":"22aeab6fb9b954d433157b4c8894f0ee6245a30a6fdb5e26251eef89605822e3","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': initial[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-input","generated_at":"2026-09-29T14:38:17.309084+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.","root_cause":"The input operation uses `initial[name] = value` where the contract requires `current[name] = value`.","sha256":"bb114aa9d88e0a238d7c89c115475fbbc149fdcb5a24d7bab3dbc78d8ea02154","title":"Form dirty-field bookkeeping: Typing rewrites the baseline instead of the draft · 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":38.865,"exit_code":1,"observations":[{"actual":[{"a":1},{"a":1},[]],"check":"edit","expected":[{"a":1},{"a":2},["a"]],"passed":false},{"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":1},[]],"check":"parameterized dirty value","expected":[{"a":1},{"a":2},["a"]],"passed":false},{"actual":[{"a":1},{},["a"]],"check":"repeat removed","expected":[{"a":1},{},["a"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"edit\", \"actual\": [{\"a\": 1}, {\"a\": 1}, []], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": false}, {\"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\": 1}, []], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": false}, {\"check\": \"repeat removed\", \"actual\": [{\"a\": 1}, {}, [\"a\"]], \"expected\": [{\"a\": 1}, {}, [\"a\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.542,"exit_code":1,"observations":[{"actual":[{"a":2},{"a":1},["a"]],"check":"edit","expected":[{"a":1},{"a":2},["a"]],"passed":false},{"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":2},{"a":1},["a"]],"check":"parameterized dirty value","expected":[{"a":1},{"a":2},["a"]],"passed":false},{"actual":[{"a":1},{},["a"]],"check":"repeat removed","expected":[{"a":1},{},["a"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"edit\", \"actual\": [{\"a\": 2}, {\"a\": 1}, [\"a\"]], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": false}, {\"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\": 2}, {\"a\": 1}, [\"a\"]], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": false}, {\"check\": \"repeat removed\", \"actual\": [{\"a\": 1}, {}, [\"a\"]], \"expected\": [{\"a\": 1}, {}, [\"a\"]], \"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."}}