07.4.3.19.4 — Journal Runtime Standardization & Export Layer

This commit is contained in:
2026-05-10 15:26:49 +03:00
parent 1692cb4d81
commit 8024cd9d9a
13 changed files with 343 additions and 325 deletions

View File

@@ -573,9 +573,9 @@ class AutoTradeService:
try:
JournalService().log_ui_info(
event_type="auto_signal_summary",
event_type="signal_summary",
message=(
f"🟡 HOLD {duration_text} завершён сигналом {next_signal}"
f"🟡 HOLD {duration_text} завершён сигналом {next_signal}."
),
screen="auto",
action="signal_summary",
@@ -614,12 +614,8 @@ class AutoTradeService:
try:
JournalService().log_ui_info(
event_type="auto_signal_ready",
message=(
f"Сигнал {normalized_signal} готов: "
f"{signal_intent}, confidence={confidence:.2f}, "
f"repeats={state.last_signal_repeat_count}"
),
event_type="signal_ready",
message=f"Сигнал {normalized_signal} готов к исполнению.",
screen="auto",
action="signal_ready",
payload={

View File

@@ -148,8 +148,8 @@ class ExecutionEngine:
}
JournalService().log_ui_info(
event_type="paper_position_opened",
message=f"Paper ENTRY открыта: {side} {state.symbol}",
event_type="position_opened",
message=f"Позиция {side} открыта: {state.symbol}.",
screen="auto",
action="paper_execution",
payload=payload,
@@ -266,8 +266,8 @@ class ExecutionEngine:
}
JournalService().log_ui_info(
event_type="paper_position_flipped",
message=f"Paper FLIP выполнен: {old_side}{new_side} {state.symbol}",
event_type="position_flipped",
message=f"Направление позиции изменено: {old_side}{new_side}.",
screen="auto",
action="paper_execution",
payload=payload,
@@ -337,13 +337,11 @@ class ExecutionEngine:
"price_updated_at": exit_execution.updated_at if exit_execution else None,
}
close_reason = forced_reason or "MANUAL"
JournalService().log_ui_info(
event_type="paper_position_closed",
message=(
f"Paper EXIT закрыта по риску {forced_reason}: {position.side} {state.symbol}"
if forced_reason is not None
else f"Paper EXIT закрыта: {position.side} {state.symbol}"
),
event_type="position_closed",
message=f"Позиция {position.side} закрыта: {close_reason}.",
screen="auto",
action="paper_execution",
payload=payload,
@@ -535,9 +533,9 @@ class ExecutionEngine:
"updated_at": position.updated_at,
}
JournalService().log_ui_info(
event_type="paper_flip_blocked",
message=f"Paper FLIP заблокирован: {reason}",
JournalService().log_ui_warning(
event_type="position_flip_blocked",
message=f"Смена направления позиции заблокирована: {reason}",
screen="auto",
action="paper_execution",
payload=payload,

View File

@@ -279,8 +279,8 @@ class JournalService:
deleted_count = self.repository.delete_older_than_days(days)
self.log_ui_warning(
event_type="journal_cleared_old",
message=f"Журнал очищен старше {days} дней.",
event_type="journal_cleared",
message=f"Журнал очищен: удалены записи старше {days} дней.",
screen="journal",
action="clear_old",
payload={