diff --git a/prod/clean_arch/runtime/pink_direct.py b/prod/clean_arch/runtime/pink_direct.py index 2b97e7a..43e17e0 100644 --- a/prod/clean_arch/runtime/pink_direct.py +++ b/prod/clean_arch/runtime/pink_direct.py @@ -458,6 +458,12 @@ class PinkDirectRuntime: current_price=float(slot_dict.get("entry_price", 0.0)), initial_size=float(slot_dict.get("initial_size", 0.0)), exit_leg_ratios=tuple(slot_dict.get("exit_leg_ratios", [1.0])), + # Carry the kernel's authoritative leg progression so the intent + # engine consumes the CORRECT exit-leg ratio. The legacy position + # is rebuilt every step; without this exit_leg_index resets to 0 + # and every leg uses ratio[0] — under-closing each leg and leaving + # a residual (kernel believes flat, exchange does not). + exit_leg_index=int(slot_dict.get("active_leg_index", 0) or 0), closed=False, ) diff --git a/prod/tests/test_pink_capital_harness.py b/prod/tests/test_pink_capital_harness.py index 44d9ad2..f9e9522 100644 --- a/prod/tests/test_pink_capital_harness.py +++ b/prod/tests/test_pink_capital_harness.py @@ -319,16 +319,7 @@ _TRADING_SCENARIOS = { } -@pytest.mark.parametrize("name", [ - "round_trip", - pytest.param("multi_leg", marks=pytest.mark.xfail( - reason="KNOWN capital/sizing finding: multi-leg partial reduce-only exits leave a " - "lot-step rounding residual on the venue (kernel believes flat, exchange has a " - "remainder). To be fixed in the capital/sizing-path rework.", - strict=False)), - "sequential", - "exit_then_reentry", -]) +@pytest.mark.parametrize("name", list(_TRADING_SCENARIOS)) def test_pink_capital(name): ratios, scenario = _TRADING_SCENARIOS[name]