{"abstract":"Reset accepts unsaved edits as the new baseline.","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":"Clearing the draft loses initial values.","family":"xi-form-dirty-reset","id":"FA-7986","implementations":{"attempt":{"sha256":"c1ab267fa9e993886f159d7a8f6f6b04323ec62972c821cac3b363f695c4b68f","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 = {}\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":"9681e986ea37fbfb992ecee66754a9fba319c112e554ba3e54f4487baad06f54","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': initial = dict(current)\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-reset","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 reset operation uses `initial = dict(current)` where the contract requires `current = dict(initial)`.","sha256":"5471eaca64d25430a91e3134406eda417211fcdcdd30541d7dd6d5e4b69b1111","title":"Form dirty-field bookkeeping: Reset accepts unsaved edits as the new baseline · 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":41.528,"exit_code":1,"observations":[{"actual":[{"a":1},{"a":2},["a"]],"check":"edit","expected":[{"a":1},{"a":2},["a"]],"passed":true},{"actual":[{"a":1},{},["a"]],"check":"reset","expected":[{"a":1},{"a":1},[]],"passed":false},{"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":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\"]], \"expected\": [{\"a\": 1}, {\"a\": 1}, []], \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":41.048,"exit_code":1,"observations":[{"actual":[{"a":1},{"a":2},["a"]],"check":"edit","expected":[{"a":1},{"a":2},["a"]],"passed":true},{"actual":[{"a":2},{"a":2},[]],"check":"reset","expected":[{"a":1},{"a":1},[]],"passed":false},{"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":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"edit\", \"actual\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"expected\": [{\"a\": 1}, {\"a\": 2}, [\"a\"]], \"passed\": true}, {\"check\": \"reset\", \"actual\": [{\"a\": 2}, {\"a\": 2}, []], \"expected\": [{\"a\": 1}, {\"a\": 1}, []], \"passed\": false}, {\"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\": 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."}}