Add align/recheck/compare, plugins, and refresh Agent docs.
selftest / selftest (push) Canceled after 0s

Wire deliver_report/listen_pack/retry hooks; gen --auto-retry and intro light check; make AGENTS_MIN the up-to-date agent entry with full command map.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
swl
2026-10-10 13:03:44 +08:00
co-authored by Cursor
parent b1afe68f3c
commit 6d79ab93a2
20 changed files with 780 additions and 91 deletions
+31 -9
View File
@@ -1,17 +1,39 @@
# plugins — 扩展目录(微内核外挂)
Agent / 开发者:**新能力优先写插件**,少改 `core/` / `rules/` / `cli/`。
| 路径 | 用途 |
|------|------|
| `plugins/hooks.py` | 钩子总线(内核只 `emit`,不 import 业务插件) |
| `plugins/builtin/` | 内置插件(随仓发布) |
| `plugins/<name>.py` | 单文件插件 |
| `plugins/<name>/plugin.py` | 包式插件入口 |
| `hooks.py` | 钩子总线(内核只 `emit`) |
| `builtin/` | 随仓内置(如 `intro_guard`) |
| `<name>/plugin.py` | 包式插件(推荐) |
| `<name>.py` | 单文件插件 |
## 钩子
- `before_build_tags`
- `after_assemble`(可返回 `{"tags","lyrics"}`)
- `before_qc_judge` / `after_qc_judge`(QC 子进程侧另见 qc_worker)
| 钩子 | 何时 | 典型用途 |
|------|------|----------|
| `before_build_tags` | assemble 前 | 改风格参数 |
| `after_assemble` | tags/歌词就绪 | 守卫、改写 |
| `after_gen` | gen/dry-run 写完 manifest | `deliver_report` |
| `after_qc` | qc 渲染结束 | `deliver_report` / `listen_pack` / `retry_on_intro_fail` |
内核层:`core/`(引擎/路径/workflow)、`rules/`(铁律)、`cli/`(命令)。
业务扩展优先写插件,少改内核。
## 当前插件
| 插件 | 作用 |
|------|------|
| `builtin/intro_guard` | tags 禁止点名衬词音节 |
| `deliver_report` | 写 `data/runs/.../report.md` |
| `listen_pack` | QC PASS 后截 `listen/intro.wav` + `chorus_approx.wav` |
| `retry_on_intro_fail` | 写 `retry_hint.json`;配合 `gen --auto-retry` |
## 最小插件示例
```python
# plugins/hello/plugin.py
from ..hooks import bus
@bus.on("after_gen")
def _hi(run_dir=None, **kw):
print("[hello]", run_dir)
```