Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions application/rebalance_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def send_and_capture(text: str) -> bool | None:


def _should_publish_cycle_notification(result: Mapping[str, Any]) -> bool:
from notifications.digest_snapshot.digest_routing import daily_digest_enabled
from quant_platform_kit.notifications.digest_routing import daily_digest_enabled
if daily_digest_enabled() and (result.get("ok") is False or any(result.get(key) for key in (
"error", "errors", "strategy_run_persistence_error", "strategy_plugin_error",
"strategy_plugin_alert_error", "pending_reconciliation", "orders_pending_count",
Expand All @@ -313,7 +313,7 @@ def _should_publish_cycle_notification(result: Mapping[str, Any]) -> bool:
repeat_funding = result.get("notification_suppressed_reason") == "repeat_funding_blocked"
if suppressed and not repeat_funding:
return False
from notifications.digest_snapshot.digest_routing import defer_routine_cycle_to_digest
from quant_platform_kit.notifications.digest_routing import defer_routine_cycle_to_digest
notification_evidence = dict(result)
if not notification_evidence.get("execution_status") and result.get("ok") is True:
notification_evidence["execution_status"] = "completed"
Expand Down Expand Up @@ -419,7 +419,7 @@ def publish_strategy_plugin_alerts(
log_message: Callable[..., Any] = print,
env_reader: Callable[[str, str | None], str | None] = os.getenv,
):
from notifications.digest_snapshot.digest_routing import immediate_plugin_signals
from quant_platform_kit.notifications.digest_routing import immediate_plugin_signals
return dispatch_strategy_plugin_alerts(
immediate_plugin_signals(signals),
notification_settings=settings,
Expand Down
2 changes: 1 addition & 1 deletion docs/display-names.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

QRS `platform-config.json` owns public strategy/platform labels. `display-names.config.json` owns display-only account aliases, lanes, legacy labels and aliases. `python/scripts/build_display_names.py` combines them into one fixed mapping; it never changes trading catalog metadata or runtime configuration hashes.

Run `python3 python/scripts/build_display_names.py --repos-root /path/to/source/checkouts` from QRS, then `--check` with the same arguments. Review and commit each repository separately. Consumer `display_names.py/json` files are generated snapshots, not independently maintained maps. They avoid upgrading pinned trading dependencies just for labels. No runtime fetch is performed. Refresh the snapshots together when labels change.
Run `python3 python/scripts/build_display_names.py --repos-root /path/to/source/checkouts` from QRS, then `--check` with the same arguments. Review and commit each repository separately. Display name resolution is provided by `quant_platform_kit.common.display_names`, installed with QPK pin `5181f2d6`; this repository keeps no local `display_names.py/json` copy. No runtime fetch is performed; label updates reach consumers through the QPK pin.

Python: optional `QSL_DISPLAY_NAMES_JSON` JSON object. Console: optional `VITE_QSL_DISPLAY_NAMES_JSON` at build time. Example (synthetic): `{"strategies":{"custom_profile":{"zh":"ETF-轮动-202610","en":"ETF-Rotation-202610"}},"accounts":{"binance":{"crypto_combo":"live"}}}`. Invalid JSON falls back to defaults; unknown labels retain the supplied fallback. Set private aliases only in the existing protected configuration, never in public source or PR bodies.

Expand Down
4 changes: 2 additions & 2 deletions docs/naming-trading-diff.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

基线:`c3f4a2122aa535594703279f9a4a1b4222d57586`。作者自审与 AST 检查,不声称独立人工审查。

只改通知显示名解析、固定显示配置副本、测试和说明。账户 key、策略 profile、RuntimeTarget、fingerprint、release/continuity binding、Secret 名称、存储 key、通知去重键均不改。交易依赖及锁文件未改;SOXL 0.679 / 总仓位 0.97 / 现金 0.03 未改。不部署交易服务。
只改通知显示名解析、固定显示配置副本、测试和说明。当前显示名解析由 QPK 提供(`quant_platform_kit.common.display_names`,随 QPK pin `5181f2d6` 安装),仓库内 `notifications/display_names.py/json` 副本已删除;下表保留基线时的文件记录。账户 key、策略 profile、RuntimeTarget、fingerprint、release/continuity binding、Secret 名称、存储 key、通知去重键均不改。交易依赖及锁文件未改;SOXL 0.679 / 总仓位 0.97 / 现金 0.03 未改。不部署交易服务。

现有源码中的券商、订单、风险、状态和报告持久化调用表达式及其参数比较结果:

Expand All @@ -11,4 +11,4 @@
| `notifications/display_names.py` | 0 | 是 |
| `notifications/telegram.py` | 0 | 是 |

新增解析器只读同目录的生成 JSON 及可选显示环境配置,不联网、不调用券商、不写持久状态。显示值不得作为机器标识再输入交易调用。固定副本来自 QRS 的生成器,避免只为改名升级交易依赖。PR 保持 draft;即使 CI 通过,也未批准实际运行版本采用。
新增解析器只读同目录的生成 JSON 及可选显示环境配置,不联网、不调用券商、不写持久状态。显示值不得作为机器标识再输入交易调用。该 PR 的固定副本来自 QRS 的生成器,避免只为改名升级交易依赖。PR 保持 draft;即使 CI 通过,也未批准实际运行版本采用。
11 changes: 6 additions & 5 deletions docs/unified-daily-notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ immediate confirmed order notices. Failed, pending, uncertain, risk, persistence
and authentication outcomes retain immediate alerts. Healthy idle cycles and
routine plugin observations do not produce individual pushes.

QPK source reference: `4cc5e55251269923771f90cd661bb62a5cfdf0cd` (notification modules only).
QPK source reference: `5181f2d6a44b935f7b82c46bc9e77439297e18d5` (notification modules; same as the QPK pin).

The notification-only QPK source snapshot in `notifications/digest_snapshot/` avoids an
unrelated trading dependency upgrade. Keep these three modules byte-identical
to the reviewed QPK notification modules. Existing QPK/strategy pins, order
execution, funding, risk, account enablement and durable report writes are unchanged.
The notification modules are imported directly from the QPK dependency pinned in
`pyproject.toml` and `uv.lock`; no vendored QPK notification snapshot is kept in
this repository. The pinned QPK revision is the single reviewed source for these
modules. Existing QPK/strategy pins, order execution, funding, risk, account
enablement and durable report writes are unchanged.

Before enabling routing, validate the exact active target's private archived
report, candidate store and QRS receiver. Existing cloud monitor wiring uses
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ def _strategy_result_summary(result: dict[str, Any], *, dry_run: bool) -> dict[s
summary["orders_skipped"] = skipped_orders
if execution_notes:
summary["execution_notes"] = execution_notes
from notifications.digest_snapshot.digest_routing import daily_digest_enabled
from quant_platform_kit.notifications.digest_routing import daily_digest_enabled
from notifications.unified import enabled
if enabled() or daily_digest_enabled():
from notifications.digest_snapshot.digest_candidates import cycle_evidence
from quant_platform_kit.notifications.digest_candidates import cycle_evidence
evidence = dict(result)
if not evidence.get("execution_status") and result.get("ok") is True:
evidence["execution_status"] = "completed"
Expand Down
1 change: 0 additions & 1 deletion notifications/digest_snapshot/__init__.py

This file was deleted.

127 changes: 0 additions & 127 deletions notifications/digest_snapshot/digest_archive.py

This file was deleted.

Loading
Loading