Files
MeltMind/tools/phase2_h1_decision.py
T

21 lines
1.3 KiB
Python

"""Claude1794888554 fixed tree rule, raw metric units, candidate minus A."""
import math
def branch_decision(field, location, tau):
intervals=(field,location,tau)
if any(v is None or v.get('low') is None or v.get('high') is None for v in intervals):
return dict(decision='PARK',reason='inconclusive: undefined paired interval')
if any(not math.isfinite(v[k]) for v in intervals for k in ('low','high')):
raise ValueError('Nonfinite interval')
if any(v['low']>v['high'] for v in intervals): raise ValueError('Reversed interval')
improve_location=location['high']<0; improve_tau=tau['low']>0
if field['high']<.001 and (improve_location or improve_tau):
decision='EXPAND';reason='field noninferiority and at least one ordering/location interval excludes zero'
elif field['low']>0 and not improve_location and not improve_tau:
decision='PRUNE';reason='field clearly worse without interval-supported ordering/location improvement'
else:decision='PARK';reason='inconclusive'
return dict(decision=decision,reason=reason,field_margin_raw=.001,field_margin_percentage_points=.10,
sign='H1 minus A',location_improves=improve_location,tau_improves=improve_tau,
scope='grouped100 paired components; topology and v4 descriptive only')