FA-8966 / Filter interfaces / Open access
Filter-chip identity and removal: Removing one chip removes equal values from other fields · case 01
Removing one chip removes equal values from other fields.
ROOT CAUSE
The remove operation uses `v != value` where the contract requires `(f,v) != (field,value)`.
VERIFIED REPAIR
Implement the remove operation as `(f,v) != (field,value)`.
Unsuccessful approach: Removing by field clears sibling values too.
Case contract
Chip identity includes field and value; exclusive replacement clears only that field; removal targets one identity; field clear and global clear have distinct scope.
Why this case matters
A deterministic model of filter-chip identity and removal; this isolates one interface invariant without requiring a browser.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(chips, event, field, value, exclusive):
chips = list(chips)
if event == 'add':
if (field,value) in chips: return chips
if exclusive: chips = [(f,v) for f,v in chips if f != field]
chips.append((field,value))
elif event == 'remove': chips = [(f,v) for f,v in chips if v != value]
elif event == 'clear-field': chips = [(f,v) for f,v in chips if f != field]
elif event == 'clear-all': chips = []
return chips
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cross field', solve([('color','red')], 'add', 'tag', 'red', False), [('color', 'red'), ('tag', 'red')])
check('duplicate', solve([('color','red')], 'add', 'color', 'red', False), [('color', 'red')])
check('exclusive', solve([('color','red'),('tag','new')], 'add', 'color', 'blue', True), [('tag', 'new'), ('color', 'blue')])
check('remove identity', solve([('color','red'),('color','blue'),('tag','red')], 'remove', 'color', 'red', False), [('color', 'blue'), ('tag', 'red')])
check('clear field', solve([('color','red'),('tag','new')], 'clear-field', 'color', None, False), [('tag', 'new')])
check('clear all', solve([('color','red'),('tag','new')], 'clear-all', 'color', None, False), [])
check('parameterized filter criterion', solve([],'add','field',str(N),False), [('field',str(N))])
for repetition in range(N):
check('repeat clear all', solve([('color','red'),('tag','new')], 'clear-all', 'color', None, False), [])
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 |
|---|---|---|---|
| cross field | [['color', 'red'], ['tag', 'red']] | [['color', 'red'], ['tag', 'red']] | Passed |
| duplicate | [['color', 'red']] | [['color', 'red']] | Passed |
| exclusive | [['tag', 'new'], ['color', 'blue']] | [['tag', 'new'], ['color', 'blue']] | Passed |
| remove identity | [['color', 'blue']] | [['color', 'blue'], ['tag', 'red']] | Failed |
| clear field | [['tag', 'new']] | [['tag', 'new']] | Passed |
| clear all | [] | [] | Passed |
| parameterized filter criterion | [['field', '1']] | [['field', '1']] | Passed |
| repeat clear all | [] | [] | Passed |
SHA-256 / 75e7e0eaa37c0e5a4effb4f7df8e5fd813a9d40be81f9b1217858a1bfbdb82da
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(chips, event, field, value, exclusive):
chips = list(chips)
if event == 'add':
if (field,value) in chips: return chips
if exclusive: chips = [(f,v) for f,v in chips if f != field]
chips.append((field,value))
elif event == 'remove': chips = [(f,v) for f,v in chips if f != field]
elif event == 'clear-field': chips = [(f,v) for f,v in chips if f != field]
elif event == 'clear-all': chips = []
return chips
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cross field', solve([('color','red')], 'add', 'tag', 'red', False), [('color', 'red'), ('tag', 'red')])
check('duplicate', solve([('color','red')], 'add', 'color', 'red', False), [('color', 'red')])
check('exclusive', solve([('color','red'),('tag','new')], 'add', 'color', 'blue', True), [('tag', 'new'), ('color', 'blue')])
check('remove identity', solve([('color','red'),('color','blue'),('tag','red')], 'remove', 'color', 'red', False), [('color', 'blue'), ('tag', 'red')])
check('clear field', solve([('color','red'),('tag','new')], 'clear-field', 'color', None, False), [('tag', 'new')])
check('clear all', solve([('color','red'),('tag','new')], 'clear-all', 'color', None, False), [])
check('parameterized filter criterion', solve([],'add','field',str(N),False), [('field',str(N))])
for repetition in range(N):
check('repeat clear all', solve([('color','red'),('tag','new')], 'clear-all', 'color', None, False), [])
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 |
|---|---|---|---|
| cross field | [['color', 'red'], ['tag', 'red']] | [['color', 'red'], ['tag', 'red']] | Passed |
| duplicate | [['color', 'red']] | [['color', 'red']] | Passed |
| exclusive | [['tag', 'new'], ['color', 'blue']] | [['tag', 'new'], ['color', 'blue']] | Passed |
| remove identity | [['tag', 'red']] | [['color', 'blue'], ['tag', 'red']] | Failed |
| clear field | [['tag', 'new']] | [['tag', 'new']] | Passed |
| clear all | [] | [] | Passed |
| parameterized filter criterion | [['field', '1']] | [['field', '1']] | Passed |
| repeat clear all | [] | [] | Passed |
SHA-256 / 40b12514463609adc58f238772bb56799ad957fb0bd9cf37b250d425c9a307a8
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(chips, event, field, value, exclusive):
chips = list(chips)
if event == 'add':
if (field,value) in chips: return chips
if exclusive: chips = [(f,v) for f,v in chips if f != field]
chips.append((field,value))
elif event == 'remove': chips = [(f,v) for f,v in chips if (f,v) != (field,value)]
elif event == 'clear-field': chips = [(f,v) for f,v in chips if f != field]
elif event == 'clear-all': chips = []
return chips
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cross field', solve([('color','red')], 'add', 'tag', 'red', False), [('color', 'red'), ('tag', 'red')])
check('duplicate', solve([('color','red')], 'add', 'color', 'red', False), [('color', 'red')])
check('exclusive', solve([('color','red'),('tag','new')], 'add', 'color', 'blue', True), [('tag', 'new'), ('color', 'blue')])
check('remove identity', solve([('color','red'),('color','blue'),('tag','red')], 'remove', 'color', 'red', False), [('color', 'blue'), ('tag', 'red')])
check('clear field', solve([('color','red'),('tag','new')], 'clear-field', 'color', None, False), [('tag', 'new')])
check('clear all', solve([('color','red'),('tag','new')], 'clear-all', 'color', None, False), [])
check('parameterized filter criterion', solve([],'add','field',str(N),False), [('field',str(N))])
for repetition in range(N):
check('repeat clear all', solve([('color','red'),('tag','new')], 'clear-all', 'color', None, False), [])
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 |
|---|---|---|---|
| cross field | [['color', 'red'], ['tag', 'red']] | [['color', 'red'], ['tag', 'red']] | Passed |
| duplicate | [['color', 'red']] | [['color', 'red']] | Passed |
| exclusive | [['tag', 'new'], ['color', 'blue']] | [['tag', 'new'], ['color', 'blue']] | Passed |
| remove identity | [['color', 'blue'], ['tag', 'red']] | [['color', 'blue'], ['tag', 'red']] | Passed |
| clear field | [['tag', 'new']] | [['tag', 'new']] | Passed |
| clear all | [] | [] | Passed |
| parameterized filter criterion | [['field', '1']] | [['field', '1']] | Passed |
| repeat clear all | [] | [] | Passed |
SHA-256 / 2a4c92dc010790ac8cc27e9f5a3402a8495b184d4ec94aba6e46bad057ac5446
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:25.978315+00:00.
Case digest / c93c3518e010bc64f3d4b7bb0dcd80b08e1621bd89454cfa272610664b38220f