Skip to content

Commit aee8121

Browse files
authored
Clarify plugin impact notification copy
Clarify plugin-impact wording so review-only states are understood as current-run behavior.
1 parent 293d187 commit aee8121

2 files changed

Lines changed: 23 additions & 17 deletions

File tree

src/quant_platform_kit/common/notification_localization.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
"strategy_plugin_line": "🧩 插件:{plugin} | 启用:{enabled} | 状态:{route} | 提醒:{action}",
3333
"strategy_plugin_enabled_true": "是",
3434
"strategy_plugin_enabled_false": "否",
35-
"strategy_plugin_consumption_auto": "🧩 插件消费:已按策略规则参与本轮仓位计算",
36-
"strategy_plugin_consumption_auto_defend": "🧩 插件消费:已按策略规则参与本轮仓位计算;风险仓位按防守规则处理",
37-
"strategy_plugin_consumption_auto_delever": "🧩 插件消费:已按策略规则参与本轮仓位计算;杠杆仓位按降档规则缩放",
38-
"strategy_plugin_consumption_loaded_not_applied": "🧩 插件消费:已加载但未改写仓位;当前策略未启用该状态的自动消费",
39-
"strategy_plugin_consumption_review_only": "🧩 插件消费:仅通知复核,未参与自动仓位计算",
40-
"strategy_plugin_consumption_unavailable": "🧩 插件消费:未消费插件信号",
35+
"strategy_plugin_consumption_auto": "🧩 插件本次影响:已按策略规则参与本轮仓位计算",
36+
"strategy_plugin_consumption_auto_defend": "🧩 插件本次影响:已触发防守规则并参与本轮仓位计算",
37+
"strategy_plugin_consumption_auto_delever": "🧩 插件本次影响:已触发降杠杆规则并参与本轮仓位计算",
38+
"strategy_plugin_consumption_loaded_not_applied": "🧩 插件本次影响:已加载;该状态未启用自动仓位改写",
39+
"strategy_plugin_consumption_review_only": "🧩 插件本次影响:仅通知复核;当前状态未触发自动仓位改写",
40+
"strategy_plugin_consumption_unavailable": "🧩 插件本次影响:未加载可用插件信号",
4141
"strategy_plugin_error_line": "⚠️ 插件信号未加载:{reason};本轮使用策略内置规则",
4242
"strategy_plugin_error_reason_JSONDecodeError": "插件配置格式错误",
4343
"strategy_plugin_error_reason_FileNotFoundError": "插件信号文件不存在",
@@ -130,12 +130,12 @@
130130
"strategy_plugin_line": "🧩 Plugin: {plugin} | enabled: {enabled} | status: {route} | notice: {action}",
131131
"strategy_plugin_enabled_true": "yes",
132132
"strategy_plugin_enabled_false": "no",
133-
"strategy_plugin_consumption_auto": "🧩 Plugin consumption: included in this cycle's position calculation under strategy rules",
134-
"strategy_plugin_consumption_auto_defend": "🧩 Plugin consumption: included in this cycle's position calculation; risk exposure follows defensive rules",
135-
"strategy_plugin_consumption_auto_delever": "🧩 Plugin consumption: included in this cycle's position calculation; leveraged exposure follows de-risking rules",
136-
"strategy_plugin_consumption_loaded_not_applied": "🧩 Plugin consumption: loaded but did not rewrite positions; this strategy does not enable automatic consumption for this state",
137-
"strategy_plugin_consumption_review_only": "🧩 Plugin consumption: review-only notice, not used for automatic position calculation",
138-
"strategy_plugin_consumption_unavailable": "🧩 Plugin consumption: no plugin signal consumed",
133+
"strategy_plugin_consumption_auto": "🧩 Plugin impact this run: included in this cycle's position calculation under strategy rules",
134+
"strategy_plugin_consumption_auto_defend": "🧩 Plugin impact this run: triggered defensive rules and joined this cycle's position calculation",
135+
"strategy_plugin_consumption_auto_delever": "🧩 Plugin impact this run: triggered de-levering rules and joined this cycle's position calculation",
136+
"strategy_plugin_consumption_loaded_not_applied": "🧩 Plugin impact this run: loaded; this state did not enable automatic position rewrites",
137+
"strategy_plugin_consumption_review_only": "🧩 Plugin impact this run: review-only notice; current state did not trigger automatic position rewrites",
138+
"strategy_plugin_consumption_unavailable": "🧩 Plugin impact this run: no usable plugin signal loaded",
139139
"strategy_plugin_error_line": "⚠️ Plugin signal failed to load: {reason}; this run falls back to built-in strategy rules",
140140
"strategy_plugin_error_reason_JSONDecodeError": "invalid plugin mount JSON",
141141
"strategy_plugin_error_reason_FileNotFoundError": "plugin signal file not found",

src/quant_platform_kit/common/strategy_plugins.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -980,20 +980,26 @@ def _strategy_plugin_consumption_notification_line(
980980
key = "strategy_plugin_consumption_auto_delever"
981981
else:
982982
key = "strategy_plugin_consumption_auto"
983-
return _translate(translator, key, fallback="Plugin consumption: included in this cycle's position calculation")
983+
return _translate(
984+
translator,
985+
key,
986+
fallback="Plugin impact this run: included in this cycle's position calculation",
987+
)
984988
if _strategy_plugin_is_notification_only(signal):
985989
return _translate(
986990
translator,
987991
"strategy_plugin_consumption_review_only",
988-
fallback="Plugin consumption: review-only notice, not used for automatic position calculation",
992+
fallback=(
993+
"Plugin impact this run: review-only notice; current state did not trigger automatic "
994+
"position rewrites"
995+
),
989996
)
990997
if action in STRATEGY_PLUGIN_AUTOMATED_POSITION_ACTIONS:
991998
return _translate(
992999
translator,
9931000
"strategy_plugin_consumption_loaded_not_applied",
9941001
fallback=(
995-
"Plugin consumption: loaded but did not rewrite positions; this strategy does not enable "
996-
"automatic consumption for this state"
1002+
"Plugin impact this run: loaded; this state did not enable automatic position rewrites"
9971003
),
9981004
)
9991005
return None
@@ -1098,7 +1104,7 @@ def build_strategy_plugin_error_notification_lines(
10981104
_translate(
10991105
translator,
11001106
"strategy_plugin_consumption_unavailable",
1101-
fallback="Plugin consumption: no plugin signal consumed",
1107+
fallback="Plugin impact this run: no usable plugin signal loaded",
11021108
),
11031109
)
11041110

0 commit comments

Comments
 (0)