Stage 07.4.3.15 — Isolated debug runtime and debug auto screen

This commit is contained in:
2026-05-09 09:17:34 +03:00
parent df76490783
commit 71cf206e32
13 changed files with 1875 additions and 492 deletions

View File

@@ -266,6 +266,30 @@
- integration testing flow for execution alerts
- preparation for isolated debug runtime architecture
#### 07.4.3.15 — Isolated Debug Runtime & Debug Auto Screen ✅
- isolated DebugTradeState
- isolated DebugPositionState
- isolated DebugTradeService
- isolated DebugExecutionEngine
- isolated DebugTradeRunner
- separate `/debug_auto_screen`
- separate debug auto UI
- debug commands no longer mutate AutoTradeService
- debug execution no longer mutates ExecutionEngine._position
- debug runner no longer uses AutoTradeRunner
- `/debug_live` disabled as production-runtime injector
- legacy debug commands redirected to isolated debug runtime
- debug LONG / SHORT / FLIP / CLOSE sandbox flow
- debug Start / Stop / Reset controls
- debug PnL live refresh
- debug margin / reserved rendering
- debug bid / ask execution pricing
- fresh REST snapshot support for debug execution
- debug_auto router added
- ordinary 🤖 Автоторговля screen remains unchanged by debug commands
- preparation for production execution pricing layer
### 07.4.4
⏳ Grid Strategy

View File

@@ -253,6 +253,29 @@
- integration testing flow for execution alerts
- preparation for isolated debug runtime architecture
#### 07.4.3.15 — Isolated Debug Runtime & Debug Auto Screen ✅
- isolated DebugTradeState
- isolated DebugPositionState
- isolated DebugTradeService
- isolated DebugExecutionEngine
- isolated DebugTradeRunner
- separate `/debug_auto_screen`
- separate debug auto UI
- debug commands no longer mutate AutoTradeService
- debug execution no longer mutates ExecutionEngine._position
- debug runner no longer uses AutoTradeRunner
- `/debug_live` disabled as production-runtime injector
- legacy debug commands redirected to isolated debug runtime
- debug LONG / SHORT / FLIP / CLOSE sandbox flow
- debug Start / Stop / Reset controls
- debug PnL live refresh
- debug margin / reserved rendering
- debug bid / ask execution pricing
- fresh REST snapshot support for debug execution
- debug_auto router added
- ordinary 🤖 Автоторговля screen remains unchanged by debug commands
- preparation for production execution pricing layer
---
### 07.4.4

View File

@@ -0,0 +1,176 @@
# 07.4.3.15 — Isolated Debug Runtime & Debug Auto Screen
## Цель
Изолировать debug-режим от обычной автоторговли и добавить отдельный экран:
```text
/debug_auto_screen
```
Теперь debug-команды больше не должны изменять runtime обычной автоторговли.
---
## Что было раньше
Ранее команды:
```text
/debug_exec
/debug_live
/debug_auto
```
работали напрямую с обычными компонентами автоторговли:
```text
AutoTradeService
ExecutionEngine
AutoTradeRunner
Auto UI
```
Это было удобно для integration testing, но могло загрязнять реальное состояние автоторговли.
---
## Что реализовано
### 1. Отдельный debug state
Добавлен отдельный debug state:
```text
app/src/trading/debug/state.py
```
Основные структуры:
```text
DebugTradeState
DebugPositionState
```
---
### 2. Отдельный debug execution engine
Добавлен:
```text
app/src/trading/debug/execution.py
```
Важно:
```text
DebugExecutionEngine не трогает ExecutionEngine._position
```
---
### 3. Отдельный debug service
Добавлен:
```text
app/src/trading/debug/service.py
```
Важно:
```text
DebugTradeService не трогает AutoTradeService
```
---
### 4. Переделаны debug-команды
Файл:
```text
app/src/telegram/handlers/debug.py
```
Теперь команды работают через изолированный debug runtime.
---
### 5. Отключён старый /debug_live
Команда:
```text
/debug_live
```
больше не вмешивается в обычную автоторговлю.
---
### 6. Отдельный debug runner
Добавлен:
```text
app/src/trading/debug/runner.py
```
Он обновляет только debug screen:
```text
🧪 [DEBUG] Автоторговля
```
---
### 7. Отдельный debug auto screen
Добавлены файлы:
```text
app/src/telegram/handlers/debug_auto/main.py
app/src/telegram/handlers/debug_auto/ui.py
```
Открытие экрана:
```text
/debug_auto_screen
```
---
### 8. Fresh REST snapshot для debug execution
Для debug execution добавлен fresh REST snapshot:
```text
ExchangeService.get_fresh_market_snapshot()
```
---
## Архитектурный результат
Теперь debug runtime отделён от обычной автоторговли.
Было:
```text
debug commands → AutoTradeService / ExecutionEngine / AutoTradeRunner
```
Стало:
```text
debug commands → DebugTradeService / DebugExecutionEngine / DebugTradeRunner
```
---
## Следующий этап
07.4.3.16 — Production Execution Pricing Layer