Peach: Local-first video metadata scraper and media manager.
chore(release): 核对发版上游并补充 Star 历史
longmeidaobbca94944475
diff --git a/.claude/skills/peach-worktree/SKILL.md b/.claude/skills/peach-worktree/SKILL.mdindex 2814d0fa3..324fbd0c4 100644--- a/.claude/skills/peach-worktree/SKILL.md+++ b/.claude/skills/peach-worktree/SKILL.md@@ -37,6 +37,7 @@ description: 在用户说并行、工作树、暂存、提交、ready、集成5. 协调者统一运行 `integrate`:锁内复查、合并固定提交。取得成功退出状态并核对主线提交后才重启;锁忙交给入口等待,禁止直接 merge;提示带持锁方的 pid、开始时间与范围,不反复数进程。同一批任务由协调者整理 `STATUS`,工作者按文件分工;共享文件安排顺序。版本号不在这里动,`integrate` 只报当前值:推进与打标签都走 `scripts/release_tag.py`,它是唯一入口。`--bump auto --apply` 推版本、定版变更日志并把那一节带在输出里给人确认,+ 落盘前自动检查上游、依赖与非 manual 参考来源;审阅 `build/release-review.json`,采用范围见 `docs/TESTING.md`。确认后 `--ship --apply` 一次做完提交、推送、等 Test 转绿、打标签(ADR-0012 修订)。人只判断措辞,不记流程;停在半路就再跑一次同一条命令。「该发一版了」由 `release_due.py` 的 Stop 钩子一家说,收尾那段不要跟着说第二遍:diff --git a/README.en.md b/README.en.mdindex 9286b2929..327f67e88 100644--- a/README.en.md+++ b/README.en.md@@ -17,7 +17,7 @@<p align="center"><a href="https://github.com/peach-mitao/peach/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/peach-mitao/peach/test.yml?branch=master&label=tests&logo=githubactions&logoColor=white" alt="tests"></a>- <a href="https://github.com/peach-mitao/peach/releases"><img src="https://img.shields.io/github/v/release/peach-mitao/peach?include_prereleases&label=release&logo=github&logoColor=white" alt="release"></a>+ <a href="https://github.com/peach-mitao/peach/releases"><img src="https://img.shields.io/github/v/release/peach-mitao/peach?include_prereleases&filter=v*&sort=semver&label=release" alt="release"></a><a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--or--later-blue?logo=gnu&logoColor=white" alt="license"></a><img src="https://img.shields.io/badge/python-3.14%2B-3776AB?logo=python&logoColor=white" alt="Python 3.14+"><img src="https://img.shields.io/badge/platform-Windows-0078D4?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0id2hpdGUiPjxwYXRoIGQ9Ik0xIDFoMTB2MTBIMXptMTIgMGgxMHYxMEgxM3pNMSAxM2gxMHYxMEgxem0xMiAwaDEwdjEwSDEzeiIvPjwvc3ZnPg%3D%3D" alt="Windows">@@ -187,6 +187,16 @@ Contributing: [Development guide](AGENTS.md) · [Architecture](docs/ARCHITECTUREThe full reuse and credits list is in the [reuse inventory](docs/REUSE.md).+## Star history++<a href="https://www.star-history.com/?repos=peach-mitao%2Fpeach&type=date">+ <picture>+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date&theme=dark">+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date">+ <img alt="Peach Star history" src="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date">+ </picture>+</a>+## License[AGPL-3.0-or-later](LICENSE) · Copyright (C) 2026 longmeidao. Third-party frontend files keep their own licenses. The [dependency manifest](package.json) records versions, and the [vendor script](scripts/vendor_web_dependencies.mjs) records file and license locations in `web/vendor/`.diff --git a/README.md b/README.mdindex e043b2cda..e5612e0e9 100644--- a/README.md+++ b/README.md@@ -17,7 +17,7 @@<p align="center"><a href="https://github.com/peach-mitao/peach/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/peach-mitao/peach/test.yml?branch=master&label=tests&logo=githubactions&logoColor=white" alt="tests"></a>- <a href="https://github.com/peach-mitao/peach/releases"><img src="https://img.shields.io/github/v/release/peach-mitao/peach?include_prereleases&label=release&logo=github&logoColor=white" alt="release"></a>+ <a href="https://github.com/peach-mitao/peach/releases"><img src="https://img.shields.io/github/v/release/peach-mitao/peach?include_prereleases&filter=v*&sort=semver&label=release" alt="release"></a><a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--or--later-blue?logo=gnu&logoColor=white" alt="license"></a><img src="https://img.shields.io/badge/python-3.14%2B-3776AB?logo=python&logoColor=white" alt="Python 3.14+"><img src="https://img.shields.io/badge/platform-Windows-0078D4?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0id2hpdGUiPjxwYXRoIGQ9Ik0xIDFoMTB2MTBIMXptMTIgMGgxMHYxMEgxM3pNMSAxM2gxMHYxMEgxem0xMiAwaDEwdjEwSDEzeiIvPjwvc3ZnPg%3D%3D" alt="Windows">@@ -186,6 +186,16 @@ Linux 无桌面镜像与 CloudDrive2 分别部署,媒体目录与运行数据各项目的复用位置与取舍见 [复用清单](docs/REUSE.md)。+## Star 历史++<a href="https://www.star-history.com/?repos=peach-mitao%2Fpeach&type=date">+ <picture>+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date&theme=dark">+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date">+ <img alt="Peach Star 历史" src="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date">+ </picture>+</a>+## 许可证[AGPL-3.0-or-later](LICENSE) · Copyright (C) 2026 longmeidao。第三方前端文件保留各自的许可证;[依赖清单](package.json) 登记版本,[生成脚本](scripts/vendor_web_dependencies.mjs) 登记 `web/vendor/` 中的文件与许可证位置。diff --git a/docs/PRODUCT_BACKLOG.md b/docs/PRODUCT_BACKLOG.mdindex a7eb8ecc9..a5c139729 100644--- a/docs/PRODUCT_BACKLOG.md+++ b/docs/PRODUCT_BACKLOG.md@@ -4,6 +4,8 @@## 待复核的元数据+- amane 0.21.0 桥升级待在独立工作树验证 MGStage 数字前缀搜索、站点字段与失败契约;Peach 独立 DMM 链路的目录与 CID 规则另测,采用范围见 [上游复核](reference-snapshots/upstream-review.md)。+- JAV 发现的历史目录候选、年代与时长偏好、质量参考、近期偏好衰减及可撤回的负向探索反馈待取得并验证,范围与有界采集方案见 [JAV 发现](JAV_DISCOVERY.md)。- 有码内容标签按 ADR-0100 优先 JavDB;真实馆藏回填待逐资产来源归属预览与同轮授权。歧义词 `口爆/吞精`、`車站性交`、`觸摸打字` 等保留原文复核;已核对的类别身份与译名见 [来源词复核](reference-snapshots/javdb-category-translations.md)。diff --git a/docs/TESTING.md b/docs/TESTING.mdindex c353ed8ef..3911dc7cf 100644--- a/docs/TESTING.md+++ b/docs/TESTING.md@@ -49,6 +49,12 @@ Dependabot 的 PR 一律在本地接管,不在网页上合:版本来自 `src/peach/__init__.py`,已纳入 uv 缓存键;源码版本更新后再次同步会刷新安装元数据。缓存规则采用 [uv 官方动态元数据机制](https://docs.astral.sh/uv/concepts/cache/#dynamic-metadata)。+### 每次发版检查++`release_tag.py --bump auto --apply` 在写版本前调用 `release_review.py`,检查两份 Python 锁、两份 npm 清单的可用更新、Dependabot 待处理 PR、sha 固定的运行依赖及其最新稳定发布,以及登记表中全部非 manual 参考来源。独立检查入口为 `scripts/release_review.py`;报告存于 `build/release-review.json`,含提交、时间、差异与逐项错误。Docker 与 GitHub Actions 的更新以 Dependabot PR 为线索,不据空 PR 列表断言全部最新。++网络失败记为「未取得」,其余检查继续;检查不全时版本文件保持原样。发现更新只报告,由智能体对照真实消费者、字段语义与许可证判断采用范围;升级依赖沿用隔离工作树与完整验证。原文证据按 `peach-reference-evidence` 审阅后接受,人工笔记不被网页覆盖。+## 验证频率测试直接使用项目入口,不设置机器级资源槽位、CPU、内存或进程数限额。每轮并发由 `-Jobs` / `--jobs` 选择,默认按本机核数取最多四路,显式正整数不设机器级上限。取消时只按已创建的 PID 清理本轮子进程树;全量测试与集成仍按代码一致性要求互斥。diff --git a/docs/reference-snapshots/upstream-review.md b/docs/reference-snapshots/upstream-review.mdindex 7a705d1fc..c3afe45f0 100644--- a/docs/reference-snapshots/upstream-review.md+++ b/docs/reference-snapshots/upstream-review.md@@ -16,6 +16,23 @@桥锁文件同时覆盖 PR #40、#42 的传递依赖要求:Mako 1.4.3、pydantic-ai-slim / pydantic-graph 2.55.0。没有新增直接依赖;传递更新包括 anthropic、openai、genai-prices,桥不调用它们的模型服务。+## amane 0.21.0 采用范围++2026-10-17 复核稳定版 [v0.21.0](https://github.com/sqzw-x/amane/releases/tag/v0.21.0),+提交 `a2d45880e83df7047d461452965919692701e8c9`;桥清单仍固定 0.20.0,未执行运行依赖升级。+从固定提交到该版本的源码差异覆盖 DMM 图片路径、CID、数字前缀与 MGStage 搜索;+版本检查与实际接入必须分开判断。++| 能力 | 上游修复与 Peach 消费者 | 判断 |+| --- | --- | --- |+| 高清图片 | amane 生成 legacy 高清候选;Peach `jav_cover_fetch` 同时测 modern、legacy 与原始图的真实像素面积,保留最大官方图 | 保留 Peach 选图策略;上游补充的 mono/movie 分类目录与剧照路径可单独补回归 |+| DMM CID | amane 区分通贩与配信 CID,剥离门店前缀;Peach 正式 DMM 来源独立使用 GraphQL 与 `makerContentId` 核对 | 升级桥不会替换 Peach DMM;不直接套用全局去数字规则 |+| MGStage 搜索 | amane 生成搜索变体,精确命中优先,只有一个候选时才允许单边数字前缀差异;Peach 正式来源通过桥调用 MGStage | 桥升级的有效收益,须在独立升级中验证字段与错误契约 |+| 聚合与产品功能 | Peach 经桥使用 4 个社区站、5 个官方来源入口,不调用 amane 聚合、任务中心或前端 | 沿用固定上游版本加 Peach 领域策略,无需维护完整 fork |++pnpm 管理 amane 的前端依赖,Justfile 编排 uv、前端、测试与打包;它们不是桥运行依赖。+Peach 继续使用现有 npm 清单与项目命令入口。pnpm 的多工作树安装收益需实测,just 暂无独立消费者。+## Dependabot PRPR #41、#43、#44、#45、#46、#47、#48 在隔离工作树按项目接管入口处理,保持一 PR 一提交。PR #43 的锁冲突保留主线 `pyahocorasick` 并采用 Pydantic 2.14.0,`uv lock --check` 通过。npm vendor、主界面与独立页面包按清单重建。diff --git a/scripts/release_review.py b/scripts/release_review.pynew file mode 100644index 000000000..6e23c282b--- /dev/null+++ b/scripts/release_review.py@@ -0,0 +1,119 @@+"""发版前只读检查上游、依赖与参考项目,证据写入 build。"""+from __future__ import annotations++import argparse+import datetime as dt+import json+from pathlib import Path+import shutil+import subprocess+import sys++if not __package__:+ sys.path.insert(0, str(Path(__file__).resolve().parents[1]))+ __package__ = "scripts"+from . import check_reference_updates as references++ROOT = Path(__file__).resolve().parents[1]+++def run(args: list[str], root: Path, *, allowed: tuple[int, ...] = (0,)) -> str:+ result = subprocess.run([shutil.which(args[0]) or args[0], *args[1:]], cwd=root,+ capture_output=True, text=True, encoding="utf-8",+ errors="replace", timeout=180)+ if result.returncode not in allowed:+ raise RuntimeError(f"{' '.join(args)}:{result.stderr.strip() or result.stdout.strip()}")+ return result.stdout.strip()+++def collect(root: Path, repo: str) -> dict:+ registry = references.load_registry(root / "docs/reference-sources.json")+ problems = references.validate_registry(root, registry)+ if problems:+ raise ValueError(";".join(problems))+ report = {"checked_at": dt.datetime.now(dt.timezone.utc).isoformat(),+ "commit": run(["git", "rev-parse", "HEAD"], root),+ "checks": [], "complete": True}++ def check(label, action):+ print(f"检查:{label}", flush=True)+ try:+ report["checks"].append({"id": label, "status": "已取得", "result": action()})+ except (OSError, RuntimeError, ValueError, subprocess.SubprocessError) as exc:+ report["complete"] = False+ report["checks"].append({"id": label, "status": "未取得", "error": str(exc)})++ for label, args, allowed in (+ ("python", ["uv", "tree", "--locked", "--all-groups", "--outdated"], (0,)),+ ("amane-python", ["uv", "tree", "--project", "tools/amane-bridge", "--locked",+ "--outdated"], (0,)),+ ("npm", ["npm", "outdated", "--json"], (0, 1)),+ ("frontend-npm", ["npm", "outdated", "--prefix", "frontend", "--json"], (0, 1)),+ ("dependabot", ["gh", "api", "--paginate", "--slurp",+ f"repos/{repo}/pulls?state=open&per_page=100"], (0,)),+ ):+ def inspect_dependency(args=args, allowed=allowed, label=label):+ output = run(args, root, allowed=allowed)+ if label == "dependabot":+ return [{"number": item["number"], "title": item["title"], "url": item["html_url"]}+ for page in json.loads(output) for item in page+ if item.get("user", {}).get("login") == "dependabot[bot]"]+ if label.endswith("npm"):+ payload = json.loads(output or "{}")+ if "error" in payload:+ raise ValueError(str(payload["error"]))+ return payload+ return output+ check(label, inspect_dependency)++ revisions = {}++ def resolve(source):+ git = source.get("git")+ if not git:+ return None+ key = (git["repository"], git["ref"])+ if key not in revisions:+ revisions[key] = references.resolve_git_revision(source)+ return revisions[key]++ for pin in references.selected_sources(registry, None, key="pins"):+ check(pin["id"], lambda pin=pin: references.inspect_pin(root, pin))+ web = pin["repository"].removesuffix(".git")+ if web.startswith("https://github.com/"):+ upstream = web.removeprefix("https://github.com/")+ check(pin["id"] + "-release", lambda upstream=upstream: json.loads(run(+ ["gh", "api", f"repos/{upstream}/releases/latest"], root)))+ for source in references.selected_sources(registry, None):+ def inspect(source=source):+ result = references.inspect_source(root, source, revision_resolver=resolve)+ return {key: value for key, value in result.items() if key != "live"}+ check(source["id"], inspect)+ return report+++def review(root: Path, repo: str) -> dict:+ report = collect(root, repo)+ path = root / "build/release-review.json"+ path.parent.mkdir(parents=True, exist_ok=True)+ path.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")+ if not report["complete"]:+ missing = [item["id"] for item in report["checks"] if item["status"] == "未取得"]+ raise ValueError(f"发版检查未取得:{'、'.join(missing)};证据见 {path}")+ return {"report": str(path), "checks": len(report["checks"]), "complete": True}+++def main() -> int:+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument("--repo", default="peach-mitao/peach")+ args = parser.parse_args()+ try:+ print(json.dumps(review(ROOT, args.repo), ensure_ascii=False))+ return 0+ except (OSError, ValueError, RuntimeError, subprocess.SubprocessError) as exc:+ print(str(exc), file=sys.stderr)+ return 2+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/scripts/release_tag.py b/scripts/release_tag.pyindex b00da4db5..8f62299d4 100644--- a/scripts/release_tag.py+++ b/scripts/release_tag.py@@ -133,6 +133,8 @@ def prepare(repo: str, part: str, *, apply: bool) -> dict:result = {**planned, "tag": tag, "repo": repo, "applied": apply}if not apply:return result+ from .release_review import review+ result["upstream_review"] = review(ROOT, repo)version_bump.write_version(ROOT, str(planned["bump"]))changelog.release(ROOT, version, repo=repo, spec=str(planned["range"]))# 那一节原样带在输出里:确认措辞的人不该再去翻文件才知道自己在确认什么。diff --git a/tests/test_reference_updates.py b/tests/test_reference_updates.pyindex a5828b4db..1dbc0f724 100644--- a/tests/test_reference_updates.py+++ b/tests/test_reference_updates.py@@ -2,6 +2,7 @@ import importlib.utilimport sysimport tempfileimport unittest+from unittest import mockfrom pathlib import Path@@ -17,6 +18,54 @@ def load_checker():return module+class ReleaseReviewTests(unittest.TestCase):+ def test_network_failure_keeps_later_checks_and_records_missing_evidence(self):+ from scripts import release_review as review+ registry = {"pins": [], "sources": [+ {"id": "first", "cadence": "weekly"},+ {"id": "second", "cadence": "quarterly"},+ {"id": "manual", "cadence": "manual"},+ ]}++ def run(args, root, **kwargs):+ if args[0] == "git":+ return "head"+ if args[0] == "gh":+ return '[[{"number": 3, "title": "更新", "html_url": "url", "user": {"login": "dependabot[bot]"}}]]'+ if args[0] == "npm":+ self.assertEqual(kwargs["allowed"], (0, 1))+ return "{}"+ return "locked tree"++ with mock.patch.object(review.references, "load_registry", return_value=registry), \+ mock.patch.object(review.references, "validate_registry", return_value=[]), \+ mock.patch.object(review, "run", side_effect=run), \+ mock.patch.object(review.references, "inspect_source", side_effect=[+ OSError("network unavailable"), {"changed": True, "live": b"evidence"}+ ]) as inspect:+ report = review.collect(ROOT, "owner/repo")+ self.assertFalse(report["complete"])+ self.assertEqual(inspect.call_count, 2)+ by_id = {item["id"]: item for item in report["checks"]}+ self.assertEqual(by_id["first"]["status"], "未取得")+ self.assertIn("network unavailable", by_id["first"]["error"])+ self.assertEqual(by_id["second"]["result"], {"changed": True})+ self.assertNotIn("manual", by_id)+ self.assertEqual(by_id["dependabot"]["result"][0]["number"], 3)++ def test_report_is_saved_before_incomplete_review_is_rejected(self):+ import json+ from scripts import release_review as review+ report = {"complete": False, "checks": [{"id": "example", "status": "未取得"}]}+ with tempfile.TemporaryDirectory() as temp:+ root = Path(temp).resolve()+ with mock.patch.object(review, "collect", return_value=report), \+ self.assertRaisesRegex(ValueError, "example"):+ review.review(root, "owner/repo")+ self.assertEqual(json.loads((root / "build/release-review.json").read_text(+ encoding="utf-8")), report)++class ReferenceUpdateTests(unittest.TestCase):@classmethoddef setUpClass(cls):diff --git a/tests/test_scripts.py b/tests/test_scripts.pyindex d39710b8f..87d9d2fde 100644--- a/tests/test_scripts.py+++ b/tests/test_scripts.py@@ -4502,12 +4502,14 @@ class ReleaseTagTests(unittest.TestCase):def test_applying_a_bump_writes_the_version_and_the_changelog_but_commits_nothing(self):"""措辞要人过一遍,所以脚本只落盘;提交与标签是后面两步。"""with self._shell() as command, mock.patch.object(self.release, "api", return_value=[]), \+ mock.patch("scripts.release_review.review", return_value={"complete": True}) as review, \mock.patch.object(self.release.version_bump, "plan_bump",return_value=self._planned_bump()), \mock.patch.object(self.release.version_bump, "write_version") as write, \mock.patch.object(self.release.changelog, "release") as promote:result = self.release.prepare("owner/repo", "auto", apply=True)write.assert_called_once_with(self.release.ROOT, "minor")+ review.assert_called_once_with(self.release.ROOT, "owner/repo")self.assertEqual(promote.call_args.args, (self.release.ROOT, "0.8.0"))self.assertEqual(promote.call_args.kwargs["spec"], "v0.7.14..HEAD")self.assertTrue(result["next"], "落盘之后必须告诉人下一步做什么")@@ -4515,6 +4517,18 @@ class ReleaseTagTests(unittest.TestCase):self.assertFalse([args for args in issuedif {"commit", "tag", "push"} & set(args)], issued)+ def test_incomplete_upstream_review_keeps_version_files_untouched(self):+ with self._shell(), mock.patch.object(self.release, "api", return_value=[]), \+ mock.patch.object(self.release.version_bump, "plan_bump",+ return_value=self._planned_bump()), \+ mock.patch("scripts.release_review.review", side_effect=ValueError("未取得")), \+ mock.patch.object(self.release.version_bump, "write_version") as write, \+ mock.patch.object(self.release.changelog, "release") as promote, \+ self.assertRaisesRegex(ValueError, "未取得"):+ self.release.prepare("owner/repo", "auto", apply=True)+ write.assert_not_called()+ promote.assert_not_called()+def test_a_bump_stops_when_the_target_tag_already_exists(self):with self._shell(), \mock.patch.object(self.release, "api", return_value=[{"ref": "refs/tags/v0.8.0"}]), \