FAILURE MAP
← Case archive

FA-32916 / Menu interactions / Open access

Menu command accepts a mixed unsupported document batch · case 01

Menu command accepts a mixed unsupported document batch.

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

ROOT CAUSE

The command-availability model applies `any(t in p['supported'] for t in p['types'])` at its all-types operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `all(t in p['supported'] for t in p['types'])` at all-types.

Unsuccessful approach: The attempted repair `bool(set(p['types']) & set(p['supported']))` still violates the all-types oracle.

Case contract

Menu-specific command availability combines document cardinality, type support and command preconditions; explanations have a deterministic policy order.

Why this case matters

Cascading and context menus require coherent command and session state as content changes.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'cardinality':
        return p['min']<=p['count']<=p['max']
    if action == 'all-types':
        return any(t in p['supported'] for t in p['types'])
    if action == 'nonempty':
        return bool(p['targets']) and all(p['valid'])
    if action == 'busy':
        return not p['document_busy'] and not p['command_busy']
    if action == 'reason':
        return next((x['reason'] for x in p if not x['ok']),None)
    if action == 'expiry':
        return p['now']<p['expires']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cardinality contract', solve('cardinality', {'min':1,'max':N+1,'count':N+2}), False)
check('all-types contract', solve('all-types', {'types':['text','binary'+str(N)],'supported':['text']}), False)
check('nonempty contract', solve('nonempty', {'targets':[],'valid':[],'revision':N}), False)
check('busy contract', solve('busy', {'document_busy':False,'command_busy':True,'id':N}), False)
check('reason contract', solve('reason', [{'ok':False,'reason':'first'+str(N)},{'ok':False,'reason':'second'}]), 'first'+str(N))
check('expiry contract', solve('expiry', {'now':N,'expires':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('too few context objects',solve('cardinality',{'min':N+1,'max':N+3,'count':N}),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
cardinality contractFalseFalsePassed
all-types contractTrueFalseFailed
nonempty contractFalseFalsePassed
busy contractFalseFalsePassed
reason contractfirst1first1Passed
expiry contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed
too few context objectsFalseFalsePassed

SHA-256 / 6962df5bc1d210f71c5df91b3015b492a80aaa1bfe98789f30373560afb55bbc

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'cardinality':
        return p['min']<=p['count']<=p['max']
    if action == 'all-types':
        return bool(set(p['types']) & set(p['supported']))
    if action == 'nonempty':
        return bool(p['targets']) and all(p['valid'])
    if action == 'busy':
        return not p['document_busy'] and not p['command_busy']
    if action == 'reason':
        return next((x['reason'] for x in p if not x['ok']),None)
    if action == 'expiry':
        return p['now']<p['expires']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cardinality contract', solve('cardinality', {'min':1,'max':N+1,'count':N+2}), False)
check('all-types contract', solve('all-types', {'types':['text','binary'+str(N)],'supported':['text']}), False)
check('nonempty contract', solve('nonempty', {'targets':[],'valid':[],'revision':N}), False)
check('busy contract', solve('busy', {'document_busy':False,'command_busy':True,'id':N}), False)
check('reason contract', solve('reason', [{'ok':False,'reason':'first'+str(N)},{'ok':False,'reason':'second'}]), 'first'+str(N))
check('expiry contract', solve('expiry', {'now':N,'expires':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('too few context objects',solve('cardinality',{'min':N+1,'max':N+3,'count':N}),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
cardinality contractFalseFalsePassed
all-types contractTrueFalseFailed
nonempty contractFalseFalsePassed
busy contractFalseFalsePassed
reason contractfirst1first1Passed
expiry contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed
too few context objectsFalseFalsePassed

SHA-256 / fe5134cd5e3cf9071eeed7b08ed4c6499541774a3f9c69848fc821af8b05f1b1

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'cardinality':
        return p['min']<=p['count']<=p['max']
    if action == 'all-types':
        return all(t in p['supported'] for t in p['types'])
    if action == 'nonempty':
        return bool(p['targets']) and all(p['valid'])
    if action == 'busy':
        return not p['document_busy'] and not p['command_busy']
    if action == 'reason':
        return next((x['reason'] for x in p if not x['ok']),None)
    if action == 'expiry':
        return p['now']<p['expires']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cardinality contract', solve('cardinality', {'min':1,'max':N+1,'count':N+2}), False)
check('all-types contract', solve('all-types', {'types':['text','binary'+str(N)],'supported':['text']}), False)
check('nonempty contract', solve('nonempty', {'targets':[],'valid':[],'revision':N}), False)
check('busy contract', solve('busy', {'document_busy':False,'command_busy':True,'id':N}), False)
check('reason contract', solve('reason', [{'ok':False,'reason':'first'+str(N)},{'ok':False,'reason':'second'}]), 'first'+str(N))
check('expiry contract', solve('expiry', {'now':N,'expires':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('too few context objects',solve('cardinality',{'min':N+1,'max':N+3,'count':N}),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
cardinality contractFalseFalsePassed
all-types contractFalseFalsePassed
nonempty contractFalseFalsePassed
busy contractFalseFalsePassed
reason contractfirst1first1Passed
expiry contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed
too few context objectsFalseFalsePassed

SHA-256 / c1dfd83e17fe71d067333fd9560cf800b16d5829e531a8275a44f303ca293a83

Verification & scope

Offline supplied-valid-payload model; excludes DOM, keyboard, focus, selection, announcements and browser conformance. 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:42:17.066483+00:00.

Case digest / bdbdeccd29897f728b5b1a7ffdc993a6b79196c543fbf5f6ee10dd723915b0da