mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
refactor(schemas): 统一 message/notification 命名边界,旧名收敛至兼容映射表
- notification 域:渠道能力(MessageChannel→NotificationChannel、ChannelCapability* 迁入 notification.py) - message 域:消息收发(Notification→Message、NotificationType→MessageType、CommingMessage→IncomingMessage、NotificationHistoryItem→MessageHistoryItem、NotificationClear*→MessageClear*) - Agent 工具契约:send_notification_message→send_message、notification_callback→message_callback - 源码不保留旧名物理别名,旧导入经 app/runtime/compat/manifest.py SYMBOL_ALIASES 惰性解析 - API 路径与持久化键冻结不变,前端零改动 - 新增兼容守护测试与 docs/rules/07 命名边界规范
This commit is contained in:
@@ -20,6 +20,7 @@ from app.runtime.compat.manifest import (
|
||||
SYMBOL_ALIASES,
|
||||
VIRTUAL_PACKAGES,
|
||||
ModuleAlias,
|
||||
_MESSAGE_NOTIFICATION_SYMBOL_ALIASES,
|
||||
)
|
||||
|
||||
|
||||
@@ -316,7 +317,7 @@ def test_plugin_scan_reports_moved_symbol_import(tmp_path: Path):
|
||||
|
||||
|
||||
def test_symbol_alias_manifest_covers_all_moved_public_symbols():
|
||||
"""符号级映射清单应覆盖媒体身份与整理工作项的旧入口。"""
|
||||
"""符号级映射清单应覆盖媒体身份、整理工作项与消息/通知命名统一的旧入口。"""
|
||||
assert set(SYMBOL_ALIASES["app.domain.media"]) == {
|
||||
"MEDIA_SOURCE_ALIASES",
|
||||
"MEDIA_SOURCE_PREFIXES",
|
||||
@@ -329,8 +330,15 @@ def test_symbol_alias_manifest_covers_all_moved_public_symbols():
|
||||
assert set(SYMBOL_ALIASES["app.schemas"]) == {
|
||||
"TransferTask",
|
||||
"TransferQueue",
|
||||
}
|
||||
} | set(_MESSAGE_NOTIFICATION_SYMBOL_ALIASES)
|
||||
assert set(SYMBOL_ALIASES["app.schemas.transfer"]) == {
|
||||
"TransferTask",
|
||||
"TransferQueue",
|
||||
}
|
||||
assert set(SYMBOL_ALIASES["app.schemas.types"]) == {
|
||||
"MessageChannel",
|
||||
"NotificationType",
|
||||
}
|
||||
assert set(SYMBOL_ALIASES["app.schemas.message"]) == set(
|
||||
_MESSAGE_NOTIFICATION_SYMBOL_ALIASES
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user