Commit Graph

18 Commits

Author SHA1 Message Date
Mavis
4cc5d41e39 fix(orm): Article 模型加 body_zh_formatted/image_ai_url/4 个 *_status 字段(同步 0002 migration) 2026-06-08 16:08:39 +08:00
Mavis
a5548d6e64 fix(fetcher): fulltext 抓取用真实浏览器 UA,绕过 NHK 等 403 2026-06-08 15:55:30 +08:00
Mavis
6b5828c1c0 fix(translation): 规范化 BCP-47 lang_src(避免 en-gb/zh-cn 等被 TMT 拒) 2026-06-08 15:49:03 +08:00
Mavis
ba2298da0a chore: 集成 LLM 增强 — config/main/articles schema/workers + .env.example 加 Agnes 配置 2026-06-08 14:24:23 +08:00
Mavis
ffd667f0dc feat(llm): 新增 LLM 智能增强服务(Agnes client + 4 项 enrichment 任务 + admin API + migration) 2026-06-08 14:24:00 +08:00
Mavis
523c82f7a5 fix: NHK 源配置改 ja(seed 写错了); translate_article 加强 lang_src 兜底 2026-06-08 00:54:02 +08:00
Mavis
639562593e fix: 翻译失败/降级文本不再写 cache(避免 30 天污染)
之前 service.translate 写 cache 无条件,导致:
- 第一次翻译失败时,'[翻译失败: ...]' 占位符被写进 cache
- 30 天内相同文本的请求(新文章 title 与老文章 title 相同时)全部返回占位符
- 触发 200+ 文章 title_zh 字段被永久污染

修法:仅在 engine ∈ {tencent, nllb, cache} 且文本不含错误标记时,才写 cache。
2026-06-08 00:48:36 +08:00
Mavis
9862a92423 perf: 翻译独立后台循环(1 篇/秒)+ Semaphore 1
之前 fetch_one_source 入库后立即调翻译(可能并发触发腾讯 TMT 限速)
改为独立 translation_loop 后台循环:
- 完全不和 RSS 抓取并行
- 1 篇/秒节拍(Semaphore 1 + sleep 1.0)
- 没活时空闲 5 秒再轮询
- pending/failed 都重试
2026-06-08 00:27:09 +08:00
Mavis
e79cfaa5f7 fix: articles.py get_article 链式 await coroutine 报错(.first()) 2026-06-08 00:19:03 +08:00
Mavis
cc02d39d29 fix: 翻译主流程失败时 raise(不再返回占位符); add_usage TTL 用 replace(day=1) 防 0 TTL 2026-06-07 23:58:13 +08:00
Mavis
501713a3e8 fix: deps.py 修 await chain (3 处 .scalars()) 2026-06-07 23:38:04 +08:00
Mavis
3ebf280278 fix: pipeline INSERT 去掉不存在的 translate_to 字段 2026-06-07 23:32:13 +08:00
Mavis
30acd6af54 fix: create_user 默认 role=owner(而非 member) 2026-06-07 23:27:52 +08:00
Mavis
ce903ac58e fix: 修剩余的 (await ...)).scalar_one_or_none() 链式 + bookmark 2026-06-07 23:25:53 +08:00
Mavis
5109d6f824 fix: API 全部改用显式两步走 await session.execute + result.scalars()
之前 (await ...).scalars() 链式在 SQLAlchemy 2.0 async 下报
'coroutine' has no attribute 'scalars' 错误。改为先 await 拿 result
再 .scalars(),这是 SQLAlchemy 2.0 推荐的 async 写法。
2026-06-07 23:22:56 +08:00
Mavis
2e75985a3c fix: healthz 路径改成 /api/v1/healthz(归到 API 前缀下) 2026-06-07 23:15:33 +08:00
Mavis
6635b8fea8 fix: enum 写入 PG 用 value 而非 name
Source/SourceKind、UserRole、SubscriptionMatch 三个 enum 改用 values_callable
保证 PG 看到 'rss' / 'owner' / 'any' 等小写 value,而非 'RSS' 大写 name。
seed_sources 同步改为显式字符串。
2026-06-07 23:11:32 +08:00
Mavis
60b062daf2 feat: initial MVP - FastAPI backend + Vue3 frontend + docker-compose
- backend: FastAPI + SQLAlchemy 2.0(async) + asyncpg + Alembic
- 7 API routes: auth/me/articles/sources/bookmarks/subscriptions/admin
- models: User/Source/Article/Bookmark/Subscription/ApiToken
- services: RSS fetcher (feedparser) + Tencent TMT translator with quota + cache + local NLLB fallback
- workers: APScheduler + asyncio pipeline (fetch -> dedupe -> insert -> translate)
- seed scripts: create_user, seed_sources (5 RSS: Reuters/BBC/Al Jazeera/NHK/DW)
- frontend: Vue 3 + Vite + Naive UI + Pinia + vue-router
- pages: Login, Feed (24h), ArticleDetail, Sources, Bookmarks, AdminSources
- deploy: docker-compose (postgres/redis/api/worker/frontend/caddy)
- docs: README, DEPLOY, architecture, acceptance
2026-06-07 21:51:01 +08:00