FAILURE MAP
← Case archive

FA-32931 / Menu interactions / Open access

Menu availability explanation reports a lower-priority denial · case 01

Menu availability explanation reports a lower-priority denial.

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

ROOT CAUSE

The command-availability model applies `next((x['reason'] for x in reversed(p) if not x['ok']),None)` at its reason operation instead of the stipulated transformation.

THE FAILURE

The command-availability model applies `next((x['reason'] for x in reversed(p) if not x['ok']),None)` at its reason operation instead of the stipulated transformation.

Unsuccessful approach: The attempted repair `None` still violates the reason 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 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 reversed(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 contractsecondfirst1Failed
expiry contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed
too few context objectsFalseFalsePassed

SHA-256 / bbe9513ae97049594c05e74d95bfab08bf025f19a66a773b0e7d65e7b1be532b

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 bool(p['targets']) and all(p['valid'])
    if action == 'busy':
        return not p['document_busy'] and not p['command_busy']
    if action == 'reason':
        return 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 contractNonefirst1Failed
expiry contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed
too few context objectsFalseFalsePassed

SHA-256 / 248349e8de4de3bf9474b0320c8f7ac4e685b1f87f5dfce4fbc57387565e7b66

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 8b6b0a8363c0a283e75155a04055d3d7511ca8e91a1db498e37f7345a1c6027c