From 75449556348a6318c6fb95101542acf408f17b3b Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 12 Jul 2026 12:15:44 +0200 Subject: [PATCH] =?UTF-8?q?uv(parity):=20exit-doctrine=20parity=20pass=20?= =?UTF-8?q?=E2=80=94=20SL/TP/MAX=5FHOLD=20verdict=20matrix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MAX_HOLD: PARITY (base 250 + 4 modulation branches + bar quantization; fallback 120 loud-only). SL: value PARITY -1.2% (catastrophic-floor override), UV strictly tighter. TP: NOT AT PARITY — UV 0.35% vs BLUE live 0.20%, no OB modulation (x1.40/x0.60/x0.75), no TP_FLOOR; UV trailing is a different mechanism. Tie order divergent (BLUE TP-first, UV SL-first). Price basis+cadence divergent (OBF-mid per-scan vs BingX-mark 1s). Remediation order proposed, no build without operator. --- .../UV_EXIT_DOCTRINE_PARITY_PASS_20260712.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 prod/docs/uv_cert/UV_EXIT_DOCTRINE_PARITY_PASS_20260712.md diff --git a/prod/docs/uv_cert/UV_EXIT_DOCTRINE_PARITY_PASS_20260712.md b/prod/docs/uv_cert/UV_EXIT_DOCTRINE_PARITY_PASS_20260712.md new file mode 100644 index 0000000..170e2cf --- /dev/null +++ b/prod/docs/uv_cert/UV_EXIT_DOCTRINE_PARITY_PASS_20260712.md @@ -0,0 +1,65 @@ +# Exit-Doctrine Parity Pass — SL / TP / MAX_HOLD, BLUE vs UV +**2026-07-12, Fable. Operator order: "painstakingly ascertain full code SL/TP/MAX_HOLD +parity, over quantized timing for MAX_HOLD, sub-femto for SL/TP."** + +Sources read line-by-line: +- BLUE live: `nautilus_dolphin/nautilus_dolphin/nautilus/alpha_exit_manager.py` + (the class `esf_alpha_orchestrator.py:193` actually instantiates), live config in + `prod/nautilus_event_trader.py` (ENGINE_KWARGS `:134`, gold spec `:651`, + overrides `:2022/:2287`, OBF mid injection `:932`). + NOTE: `alpha_engine/execution/exit_manager.py` is a DIFFERENT (time-based, + wall-clock) manager — NOT the live exit path; do not compare against it. +- UV flight-3: `violet/uv/brain_tpsl.py`, `violet/uv/tpsl_ticker.py`, + `violet/uv/max_hold_modulation.py` (codex's source-faithful port, on tree at 402201e). + +## Verdict matrix + +| # | Dimension | BLUE (live) | UV (flight-3) | Verdict | +|---|---|---|---|---| +| 1 | **TP threshold** | `fixed_tp_pct=0.0020` (0.20%; TP research 2026-05-11; trader:134+651) | `DOCTRINE_TP_PCT=0.0035` (brain_tpsl:26) | **DIVERGENT — UV TP is 75% wider (0.35% vs 0.20%)** | +| 2 | **TP OB-modulation** | cascade>0 → TP ×1.40 (aem:177); withdrawal+profit → ×0.60 (aem:187); per-asset withdrawal+profit → ×0.75 (aem:204) | none — TP is static | **MISSING in UV** | +| 3 | **TP_FLOOR ratchet** | ON by default (`DOLPHIN_TP_FLOOR`, trader:612): once max_favorable ≥ base TP, regression to ≤ base TP exits immediately, checked BEFORE everything (aem:232) | none | **MISSING in UV** | +| 4 | **Trailing (from best)** | none — TP_FLOOR is BLUE's only ratchet (discrete, at base TP) | armed by default: retrace 0.20% from best after +0.20% favorable (brain_tpsl:28-29, ticker:113-114) | **UV-ONLY mechanism — DIVERGENT** (similar intent to TP_FLOOR, different math: continuous-from-best vs discrete-at-base) | +| 5 | **SL value** | per-trade catastrophic-floor override **0.0120** armed at every setup (trader:2022, 2287). Manager default `stop_pct=1.0` (100%) is inert. | `DOCTRINE_SL_PCT=0.012` (brain_tpsl:27) | **PARITY (−1.2%)** | +| 6 | **SL withdrawal-stress branch** | regime_signal==1 → hard SL forced to **0.10** (10%) (aem:186) | none | Missing but **SUBSUMED** — UV's constant −1.2% always exits before −10%; UV is strictly tighter | +| 7 | **Check order / tie semantics** | TP_FLOOR → FIXED_TP → STOP_LOSS → MAX_HOLD (aem:232, 316, 321, 326) | SL → trailing → TP (brain_tpsl `_evaluate`, "loss-protection wins ties") | **DIVERGENT** — a tick satisfying both exits as TP on BLUE, SL on UV. Rare, but changes the label AND the fill context | +| 8 | **MAX_HOLD base** | 250 bars (trader:134) | ingress-supplied (engine mirror provides BLUE base); loud fallback 120 + counter (brain_tpsl:30, ticker:129/230) | **PARITY via ingress**; fallback constant 120 ≠ 250 (labeled+counted, fires only on ingress failure) | +| 9 | **MAX_HOLD modulation** | 4 branches: cascade ×0.5, withdrawal+OB-against ×0.4, calm+favorable ×1.5, per-asset min(×0.40) (aem:178, 190, 196, 201) | `blue_max_hold_yield` source-faithful ×0.5/×0.4/×1.5/min ×0.40 from base 250 (max_hold_modulation:78-95); mutation-tested (codex 64b5a742) | **PARITY (ported, certified)** | +| 10 | **MAX_HOLD quantization** | `bars_held = current_bar − entry_bar`, evaluated per scan (aem:144) | `on_bar()` per runner scan-bar, same bar arithmetic (ticker:170-191) | **PARITY (bar-quantized both sides)** | +| 11 | **PnL formula** | `d·(price−entry)/entry`, fee-exclusive (aem:146) | identical, side-aware (brain_tpsl:203-207) | **PARITY** | +| 12 | **Price source ("sub-femto" axis)** | scan price with **OBF WS mid-injection** (~0.5s fresh bid/ask mid, Binance-derived) for the open position's asset (trader:932); evaluated once per scan (~6-12s) | **BingX mark-price REST poll every 1s** (ticker:7, 65-76) | **DIVERGENT on BOTH axes**: different price basis (Binance-scan/OBF mid vs BingX mark) and different cadence (per-scan ≈6-12s vs 1s). UV catches interscan crossings BLUE structurally misses (BLUE's "interscan SL miss" bug class) — an intentional improvement, but it means same-tape different-exits | +| 13 | **Adjacent overlays** | VD-invalidation + TF-spread exits present but `vd_enabled=False`/`tf_enabled=False` (aem:44/50); OB DURESS exits live upstream; V7 engine + EFSM LONG overlay | none | Disabled gates = parity-neutral today (but a BLUE flag-flip silently diverges); V7 veto + LONG overlay = already-open known DIVs | + +## Bottom line + +**MAX_HOLD (quantized): PARITY** — base, all four modulation branches, and bar +quantization are certified equal (codex's port + this pass). Only the *fallback* +constant differs (120 vs 250) and it is loud and counted. + +**SL: value PARITY (−1.2%), semantics tighter on UV** (constant vs BLUE's +mostly-inert manager stop + catastrophic floor; withdrawal 10% branch subsumed). + +**TP: NOT AT PARITY — three stacked divergences**, and they are money: +1. threshold 0.35% vs BLUE's live 0.20% (UV holds for 75% more move per win → + fewer, larger wins; plausibly a contributor to flight-1's GROSS-negative), +2. no OB cascade/withdrawal modulation (×1.40/×0.60/×0.75), +3. no TP_FLOOR ratchet; UV's trailing is a different mechanism, not a port. + +**Tie order DIVERGENT** (BLUE TP-first, UV SL-first). + +**Timing/price ("sub-femto"): DIVERGENT by design** — UV evaluates ~6-12× +more often against a different price basis. This is the C11 axis: true parity +of *observation* needs the same feed (OBF mid) or an explicit equivalence +argument; today UV would exit on intra-bar spikes BLUE never sees. + +## Recommended remediation order (no build without operator word) +1. UV TP base → read from BLUE's live engine value (0.0020) via ingress like + MAX_HOLD does — never a hardcoded doctrine constant that can drift (this + drift already happened: doctrine said .0035 while BLUE ran .0020). +2. Port TP modulation + TP_FLOOR into the ticker via the same OBF ingress + codex built for MAX_HOLD (the ingress already carries cascade/regime/ + imbalance/withdrawal — the exact fields TP modulation needs). +3. Decide trailing: disable for parity, or keep as UV improvement post-parity. +4. Align check order (TP_FLOOR → TP → SL → MAX_HOLD) or document the tie rule. +5. Price-basis equivalence: OBF-mid feed for the ticker (C11) or a measured + BingX-mark-vs-OBF-mid divergence bound in the dossier.