FAILURE MAP
← Case archive

FA-8956 / Filter interfaces / Open access

Filter-chip identity and removal: Equal values in different filter fields are collapsed · case 01

Equal values in different filter fields are collapsed.

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

ROOT CAUSE

The identity operation uses `if any(v == value for f,v in chips):` where the contract requires `if (field,value) in chips:`.

VERIFIED REPAIR

Implement the identity operation as `if (field,value) in chips:`.

Unsuccessful approach: Never deduplicating creates repeated chips for the same criterion.

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 any(v == value for f,v 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 fixtureActualExpectedOutcome
cross field[['color', 'red']][['color', 'red'], ['tag', 'red']]Failed
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 / 135ac78146cae5a69a0c1b6d5379fae038e0fbcc1fa4e69988c4abf13536c2f3

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 False: 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 fixtureActualExpectedOutcome
cross field[['color', 'red'], ['tag', 'red']][['color', 'red'], ['tag', 'red']]Passed
duplicate[['color', 'red'], ['color', 'red']][['color', 'red']]Failed
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 / 553afa9bd7fa9ff561cb30753e3da5687ee4bdf48e7c054aff6bd3915deda445

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

Case digest / ff71d8ef55099c83b1b2d0159896a082055c215ddf5928f49f52c212b97548e5