FAILURE MAP
← Case archive

FA-8976 / Filter interfaces / Open access

Filter-chip identity and removal: Clear-all removes only the last criterion · case 01

Clear-all removes only the last criterion.

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

ROOT CAUSE

The clear all operation uses `elif event == 'clear-all': chips = chips[:-1]` where the contract requires `elif event == 'clear-all': chips = []`.

VERIFIED REPAIR

Implement the clear all operation as `elif event == 'clear-all': chips = []`.

Unsuccessful approach: Clearing the active field alone leaves other criteria active.

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 (f,v) != (field,value)]
    elif event == 'clear-field': chips = [(f,v) for f,v in chips if f != field]
    elif event == 'clear-all': chips = chips[:-1]
    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[['color', 'red']][]Failed
parameterized filter criterion[['field', '1']][['field', '1']]Passed
repeat clear all[['color', 'red']][]Failed

SHA-256 / baa5cf6dfd532f7d32263e0db6c30f6e78b1f095acfb3389f819b5a6b56d31dc

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,v) != (field,value)]
    elif event == 'clear-field': chips = [(f,v) for f,v in chips if f != field]
    elif event == 'clear-all': chips = [(f,v) for f,v in chips if f != field]
    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[['tag', 'new']][]Failed
parameterized filter criterion[['field', '1']][['field', '1']]Passed
repeat clear all[['tag', 'new']][]Failed

SHA-256 / 8fccb72a7b781384f8cc8b7f92e878864c66e666cad42985a6f37ecd22aaff0a

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

Case digest / c0c7cd1c90fc2e57ec893ce782329bfb310fc3c9cc799c53f6766e8004187220