2158 Commits

Author SHA1 Message Date
Estrella Pan
285bf151ba Merge branch 'refactor/4.0-p3-ingest' into refactor/4.0-p5-events-api 2026-10-08 09:20:28 +02:00
Estrella Pan
582a3894ee Merge branch 'refactor/4.0-p2-extension-points' into refactor/4.0-p3-ingest
# Conflicts:
#	backend/src/module/plugin/host.py
2026-10-08 09:19:13 +02:00
Estrella Pan
58ed9a36b6 fix(4.0-P2): 校验插件定时任务间隔与搜索站点/LLM 适配器返回值
- 定时任务的 interval/initial_delay 在受保护的 run() 中读取并校验,插件出错计入熔断,不再打断调度循环
- provider_impls 增加契约校验,搜索站点与 LLM 适配器返回值不合契约时跳过
2026-10-08 09:19:03 +02:00
Estrella Pan
f1b8dc61f7 fix(4.0-P5): 修复评审发现的插件 MCP 资源与通知模板隔离问题
- MCP read_resource 把 AnyUrl 转成字符串再交给 handle_resource,插件资源按 AnyUrl 规范化后的 URI 索引(含空格/非 ASCII 的 id 也能读取)
- 插件 McpTool/McpResource 字段不合法时在 _resolve 内跳过并计入熔断,不再拖垮 tools/list 与 resources/list
- 插件资源处理函数沿用工具默认超时(DEFAULT_TOOL_TIMEOUT),超时计入熔断
- render_event 以 expect=RenderedMessage 调用 transform,错误返回值计入出错插件的熔断,不再传给后续钩子
2026-10-08 09:11:51 +02:00
Estrella Pan
a4df845934 Merge branch 'refactor/4.0-p3-ingest' into refactor/4.0-p5-events-api 2026-10-08 09:08:39 +02:00
Estrella Pan
8f9ddd6eec fix(4.0-P3): 修复评审发现的插件过滤与返回值校验问题
- 手动收集整季与 eps_complete 补全(collect_season)同样经过 torrent.filter 钩子
- torrent.filter 收到的解析结果先经 title.parsed 钩子修正,与建规则时一致
- HookRunner 新增 check 校验:返回值校验在记成功之前,无效结果计入熔断
- torrent.adding 校验 save_path/category/tags 类型,无效时沿用原请求
- http.request 校验请求头为 str → str 映射,无效时沿用默认请求头
- metadata_provider 校验标题非空、季度为整数等字段,无效时不改写规则
2026-10-08 09:07:08 +02:00
Estrella Pan
58f3b40599 Merge branch 'refactor/4.0-p2-extension-points' into refactor/4.0-p3-ingest
# Conflicts:
#	backend/src/module/plugin/host.py
#	webui/src/hooks/usePluginProviders.ts
2026-10-08 09:00:59 +02:00
Estrella Pan
0c5563f8c8 fix(4.0-P2): 修复评审发现的插件隔离与掩码问题
- 插件清单拒绝保留 id "core",避免插件与宿主内置 Provider 共享归属
- 新增 host.provider_impls():搜索站点与 LLM 扩展适配器逐个调用工厂,出错的跳过并记录
- 插件代码未加载(无 schema)时,掩码/还原把全部配置项按秘密处理
- 定时任务桥接:ScheduledTask 字段读取纳入异常保护并计入熔断;enabled 每轮读取,异常计入熔断
- 通知渠道先按原样匹配 type,再按小写兼容,支持含大写的插件渠道 id
- WebUI:插件启停/保存后刷新插件 Provider 候选列表
2026-10-08 08:55:34 +02:00
Claude
0b6de31593 Merge refactor/4.0-p3-ingest into refactor/4.0-p5-events-api
- 合并 P3 与 P5 共同追加的扩展点列表(ab_sdk/points.py、plugin/host.py POINTS)
- host.py 中两边各自实现的 set_runner / get_runner 去重,保留 P5 的
  get_bus / set_bus / publish;AppContext 统一设置 bus 与 runner
- CHANGELOG、设计文档第 0 节、插件开发文档按 P3 → P5 顺序合并
- 修复 MCP /sse 端点在 SSE 结束后重复发送响应头导致的 AssertionError

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 06:44:43 +00:00
Claude
93f6d794c5 feat(4.0-P5): 系统事件上总线、通知中心 SSE 改为事件推送、插件路由 / MCP / 通知模板
- 系统事件类移入 ab_sdk.events(SystemEvent 基类,新增 i18n()),
  NotificationManager.send_event 写入通知中心后发布到插件事件总线
- module.plugin.host 新增 get_bus/set_bus、get_runner/set_runner、publish,
  由 AppContext 构造时设置
- SSE notification 帧改为订阅 inbox.changed 即时推送,线格式不变
- 新扩展点 api_router(/api/v1/plugins/<id>/ 分发路由,强制鉴权)、
  mcp_tool / mcp_resource(<plugin-id>__<id> 命名)、message_template
- ExtensionPoint.scoped:Provider id 只需在插件内唯一
- ab_sdk 0.3.0;插件开发文档、设计文档、CHANGELOG 更新

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 06:34:43 +00:00
Claude
9b7ef00c2e feat(4.0-P3): ingest 流水线扩展点与内置种子过滤插件
- 钩子:torrent.filter(排除过滤之后,fail-open)、title.parsed(准入判定前)、
  torrent.adding(save_path / category / tags,ab:<id> 标签强制保留)、
  http.request(GET 请求头)
- Provider:metadata_provider,mikan / tmdb 以 core 登记,按 RSSItem.parser 选择,
  行为与 3.x 一致;插件元数据源走超时与熔断
- SDK 0.3.0:新增 ab_sdk.ingest(冻结快照 TorrentInfo / BangumiInfo / AddRequest /
  HttpRequest / Metadata)
- host.get_runner()/hook_runner():AppContext 构建时设置 runner,无钩子时零开销
- 内置插件 ingest-filters:全局包含过滤,默认启用、留空不生效
- WebUI:添加订阅的解析器下拉框并入插件元数据源
- 文档:插件开发指南新增各扩展点;设计文档 P3 调整

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 06:31:23 +00:00
Claude
332fb451c4 feat(4.0-P2): 下载器/通知/LLM/搜索/定时任务扩展点与插件管理界面
- ab_sdk 0.2:新增 points、downloader(自 module/downloader/base.py 迁入)、
  llm(自 providers/base.py 迁入)、notify、search、tasks 契约与
  secret_field();原路径保留重新导出
- module/plugin/host:进程级扩展注册表,内置 qB/aria2/mock 与各通知渠道以
  core 身份登记;DownloadClient、NotificationManager、LLM 注册表、搜索站点
  均改为按 id 从注册表解析
- 插件定时任务随插件加载/重载/停用同步进调度器,失败计入熔断
- 插件变更后重建通知渠道、清理 LLM 解析器缓存;下载器客户端缓存键包含
  Provider 登记项,插件重载后自动换新
- /api/v1/plugins:总览(schema + 掩码配置)、启停、配置(按模型校验)、
  allow_unsigned、Provider 列表;/config 读写同样掩码/还原插件秘密字段
- WebUI:设置页「插件」卡片与 JSON Schema 表单;下载器与通知下拉框并入插件
  Provider;插件保存后刷新 config store 的 plugins 段,避免全局保存覆盖
- 修复:/search/provider 读取导入时的站点快照,新站点需重启才出现
- 文档:开发者指南 → 插件开发

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 05:59:07 +00:00
Claude
94da8fa741 feat(4.0-P1): 插件运行时与 SDK 骨架
- ab_sdk:Plugin[ConfigT] 基类、@hook / @provider / @subscribe、只读的
  PluginContext 协议、事件基类,以及插件单测辅助 ab_sdk.testing;SDK 不依赖
  module.*(有边界测试)
- module/plugin:plugin.toml 清单校验(含 sdk 版本范围),内置 / 本地目录 /
  pip entry point 三种来源的发现与加载(ab_plugin_<id> 包名、支持相对导入、
  vendor 纯 Python 依赖、拒绝原生扩展)
- 扩展点注册表;HookRunner 负责 filter / transform 钩子的优先级与 hook_order
  排序、超时、fail-open / fail-closed,以及按插件熔断
- EventBus:每个订阅者独立的有序队列,失败与超时隔离,计入熔断
- PluginManager:失败时回滚注册;配置变更只重载受影响的插件;失败插件在其
  配置变化后才重试;熔断后自动禁用并发布 PluginDisabled
- 插件私有 KV 存储(plugin_kv 表,迁移 v25)、plugins 配置段、
  GET /api/v1/plugins
- 插件随进程 lifespan 启停,reload_settings 时重新应用插件配置

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 04:37:57 +00:00
Claude
8ccacb6060 refactor(4.0-P0): 清理死代码与 3.x 兼容层
- 4.0 只支持从 3.3.x 升级:version_check 改为完整 semver 比较,数据低于 3.3
  或残留 2.x data.json 时抛 UnsupportedUpgradeError 中止启动;删除 3.0→3.2
  跨版本迁移、data.json 迁移和 Database.migrate()
- 删除 3.2 兼容的 GET 控制端点与 GET /auth/refresh_token
- 删除旧 JWT 与内存会话实现,密码哈希移到 security/password.py
- 删除 experimental_openai 配置节、通知单 provider 旧字段、3.1 配置字段改名迁移
  与 DEFAULT_SETTINGS;normal 重命名方式迁移为 none
- 删除约 70 处无调用方的函数、方法、模型及未使用的 qB API 封装
- CI 新增 vulture 死代码检查(配置见 pyproject.toml 与 vulture_whitelist.py)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 04:19:53 +00:00
Claude
b742148054 docs: 修正章节编号
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 03:48:06 +00:00
Claude
fd75652ab2 docs: 记录 4.0 插件化核心决策,补充多下载器与前端插件设计
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 03:47:57 +00:00
Claude
c2f1784497 docs: 4.0 插件化重构与死代码清理设计草案
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 03:41:50 +00:00
Estrella Pan
ccb3f8d257 Merge pull request #1118 from EstrellaXD/fix/3.3.5-issues
Release 3.3.6
3.3.6
2026-09-19 18:07:59 +02:00
Estrella Pan
aaa464193b chore(release): prepare 3.3.6
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KU9GqKzULrNb7MN5T9TYix
2026-09-19 17:58:18 +02:00
Estrella Pan
37fa6b4ea5 fix: RSS matching, proxy pool, parser, healthcheck and log issues (#1103 #1104 #1105 #1106 #1108 #1114 #1117)
- match_bangumi_in_list: also accept a torrent whose rebuilt title equals
  the stored title_raw (#1103, #1114)
- download_bangumi / collect_season: drop items whose season or type
  conflicts with the bangumi (#1105)
- request_url: swap in a fresh shared client on PoolTimeout without
  closing the old one (#1104)
- classic parser: Unicode Roman numeral season, strip fullwidth dash
  wrapper (#1108)
- Docker HEALTHCHECK: healthcheck.py reads the configured WebUI port and
  probes IPv4 then IPv6 loopback (#1106)
- scheduler: non-positive interval falls back to 1s; deploy docs cap
  container logs at 10 MB x 3 (#1117)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KU9GqKzULrNb7MN5T9TYix
2026-09-19 17:58:17 +02:00
Estrella Pan
fd798519fe chore: add GitHub Sponsors funding 2026-08-04 21:11:05 +02:00
Estrella Pan
2befeb4933 Merge pull request #1102 from EstrellaXD/3.3-dev
Release 3.3.5 (mypy fix)
3.3.5
2026-07-26 15:53:23 +02:00
Estrella Pan
5cc2fabc64 fix(types): correct type-ignore codes and narrow Optional in tests
CI mypy (not run locally before) flagged the is_not() ignores as
union-attr and the un-narrowed RSSItem | None in the re-enable test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WTfJZ3EzCpY8SLhzXT6Sf
2026-07-26 15:53:14 +02:00
Estrella Pan
3d7b4d8417 Merge pull request #1101 from EstrellaXD/3.3-dev
Release 3.3.5
2026-07-26 15:49:29 +02:00
Estrella Pan
f54df55754 chore(release): prepare 3.3.5
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WTfJZ3EzCpY8SLhzXT6Sf
2026-07-26 15:49:06 +02:00
Estrella Pan
d33a43f201 Merge fix/config-mask-empty (#1100): stop masking empty secrets, scrub corrupted sentinels 2026-07-26 15:46:16 +02:00
Estrella Pan
8b8a15f322 Merge fix/reset-all-fk (#1099): clear FK references before bangumi reset-all 2026-07-26 15:46:16 +02:00
Estrella Pan
0916bf688a Merge fix/issue-1092-episodeless-special (#1098): admit unmarked episode-less releases 2026-07-26 15:45:48 +02:00
Estrella Pan
900328928e Merge fix/issue-1094-telegram-poster (#1097): Telegram poster via source URL with fallbacks 2026-07-26 15:45:48 +02:00
Estrella Pan
708b937108 Merge fix/issue-1095-rss-reenable (#1096): re-enable disabled RSS on re-subscribe 2026-07-26 15:45:48 +02:00
Estrella Pan
2f1a18f37e fix(config): stop masking empty secrets and scrub corrupted mask sentinels
Empty sensitive fields were masked to '********' in GET /config, so the
UI showed a phantom password where none was set. Worse, 3.2.3/3.2.4
masked without restoring on save, so users who saved config on those
versions had the literal sentinel written into stored proxy/downloader
credentials, breaking authentication until manually cleared.

- _sanitize_dict now masks only non-empty values.
- Settings._migrate_old_config scrubs literal '********' sentinels from
  sensitive fields on load (original values are unrecoverable), logging
  a warning so users know to re-enter real secrets.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WTfJZ3EzCpY8SLhzXT6Sf
2026-07-26 15:39:11 +02:00
Estrella Pan
f1ca52cbe8 fix(database): clear FK references before bangumi reset-all
BangumiDatabase.delete_all() issued a bare DELETE FROM bangumi while
torrent.bangumi_id and aria2_gid.bangumi_id rows still referenced it;
with PRAGMA foreign_keys=ON the whole reset rolled back with
IntegrityError, and the surviving torrent dedup rows made re-added
bangumi skip episodes as already downloaded. Delete bangumi-linked
torrent records (same semantics as delete_rule) and detach aria2_gid
mappings before the table wipe.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WTfJZ3EzCpY8SLhzXT6Sf
2026-07-26 15:36:02 +02:00
Estrella Pan
dee536cdc9 fix(parser): admit unmarked episode-less releases on classic engine (#1092)
Subtitle groups sometimes release TV specials without an episode number
or any special/movie marker (e.g. LoliHouse's ONE PIECE HEROINES). The
Preview engine's admission policy already accepts such evidence-backed
single releases as eps_collect bangumi, but the classic engine's legacy
Episode projection rejected them outright, so default installs silently
skipped the torrent.

Align classic admission with the Preview persistence policy for exactly
this shape (no episode, unknown media type, admissible under
persistence_target). The frozen legacy Episode contract and its golden
corpus stay untouched; numbered legacy rejections (e.g. fractional
episodes) keep their behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WTfJZ3EzCpY8SLhzXT6Sf
2026-07-26 11:39:24 +02:00
Estrella Pan
cadaf1fe59 fix(notification): send Telegram posters by source URL with text fallback (#1094)
Download-complete notifications were silently dropped when sendPhoto
failed: post_form returned None on any error and the provider crashed
on resp.status_code, with no text fallback. HTTP rejections were also
logged as "Cannot connect", hiding the real cause.

- save_image now records the poster's source URL in a .url sidecar;
  Telegram prefers sendPhoto with that URL (server-side fetch), falls
  back to local multipart upload, then to a plain text message.
- load_image returns None instead of raising when the cached file is
  missing.
- post_url/post_form log HTTP status and response body separately from
  connection errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WTfJZ3EzCpY8SLhzXT6Sf
2026-07-26 11:13:15 +02:00
Estrella Pan
e3b6e03067 fix(rss): re-enable disabled RSS on re-subscribe (#1095)
Deleting a bangumi disables its orphan standalone RSS feed (#1053), but
re-subscribing the same feed hit the duplicate-URL early return in
RSSDatabase.add() and never reset enabled, so the rebuilt bangumi
silently stopped updating. Re-enable the existing row and report it as
a successful add.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WTfJZ3EzCpY8SLhzXT6Sf
2026-07-26 11:08:19 +02:00
Estrella Pan
520873f035 test(e2e): align standalone movie contract (#1080) 2026-07-15 15:33:36 +02:00
Estrella Pan
bd6d35dbe5 Merge 3.3-dev for 3.3.4 3.3.4 2026-07-13 20:37:28 +02:00
Estrella Pan
f354a63959 chore(release): prepare 3.3.4 2026-07-13 20:36:26 +02:00
Estrella Pan
a99b78931c Merge fix/issue-1078-revision-replace into 3.3-dev 3.3.4-beta.2 2026-07-13 01:37:10 +02:00
Estrella Pan
37d794db0d chore(release): prepare 3.3.4-beta.2 2026-07-13 01:36:29 +02:00
Estrella Pan
9d5b1c3998 fix(renamer): safely replace higher revisions (#1078) 2026-07-13 01:36:17 +02:00
Estrella Pan
00b78dfa64 docs(renamer): design revision replacement for #1078 2026-07-13 00:31:34 +02:00
Estrella Pan
01534b802c test(e2e): assert the standalone movie contract 2026-07-12 21:18:54 +02:00
Estrella Pan
32dcbc53df fix(webui): type template event handlers 2026-07-12 21:07:33 +02:00
Estrella Pan
4cb2b369ab fix(parser): preserve CJK movie words in titles 2026-07-12 21:07:33 +02:00
Estrella Pan
e8bcece42f feat(parser): add selectable preview engine 2026-07-12 21:07:33 +02:00
Estrella Pan
060b602aaf docs(parser): design classic and preview engine switch 2026-07-12 21:07:33 +02:00
Estrella Pan
e744b3601a fix(parser): handle ranges and mixed collections safely 2026-07-12 21:07:33 +02:00
Estrella Pan
8ceec47174 perf(parser): add reproducible tokenizer benchmark 2026-07-12 21:07:33 +02:00
Estrella Pan
56ce4dbe21 docs(parser): record resolved tokenizer architecture 2026-07-12 21:07:33 +02:00