FA-32921 / Menu interactions / Open access
Vacuous target validation enables an empty context command · case 01
Vacuous target validation enables an empty context command.
ROOT CAUSE
The command-availability model applies `all(p['valid'])` at its nonempty operation instead of the stipulated transformation.
VERIFIED REPAIR
Apply `bool(p['targets']) and all(p['valid'])` at nonempty.
Unsuccessful approach: The attempted repair `not any(not x for x in p['valid'])` still violates the nonempty 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 all(t in p['supported'] for t in p['types'])
if action == 'nonempty':
return 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| cardinality contract | False | False | Passed |
| all-types contract | False | False | Passed |
| nonempty contract | True | False | Failed |
| busy contract | False | False | Passed |
| reason contract | first1 | first1 | Passed |
| expiry contract | False | False | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
| too few context objects | False | False | Passed |
SHA-256 / c33167bb094b85d0d2a8253d67ca09e2ccc5f737d9686c74f2752a164c3b30bf
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 all(t in p['supported'] for t in p['types'])
if action == 'nonempty':
return not any(not x for x in 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| cardinality contract | False | False | Passed |
| all-types contract | False | False | Passed |
| nonempty contract | True | False | Failed |
| busy contract | False | False | Passed |
| reason contract | first1 | first1 | Passed |
| expiry contract | False | False | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
| too few context objects | False | False | Passed |
SHA-256 / 693740dd2fd77a78ab3d359341bfd5c1876253b3b9fe3c6ce2d49450c2d0ed84
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| cardinality contract | False | False | Passed |
| all-types contract | False | False | Passed |
| nonempty contract | False | False | Passed |
| busy contract | False | False | Passed |
| reason contract | first1 | first1 | Passed |
| expiry contract | False | False | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
| too few context objects | False | False | Passed |
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.113066+00:00.
Case digest / 8fd652fe4ec11b204a680121c69a69b0f4e9cc4d6abc9be1382db09227536f79