文档: 重写 README 的"无人值守"章节 + 防止文档漂移的测试

Browse Source
一、README 的"无人值守"章节已经过时: 写着"每 5 分钟的会话看门狗 + 每天 05:30
   一轮", 而实际早改成了 1 分钟 + 每 N 小时一轮, 还多了一套独立的挂机攒模块任务。
   重写成两套自动化分开说(打关卡的刷取循环 / 只攒模块不发车), 并链上 docs/WATCH.md
   —— 否则那份手册写了也没人找得到。

   引用的脚本和参数都逐项核对过存在: install_unattended.ps1(-EveryHours)、
   install_convert_task.ps1(-EveryHours/-Uninstall)、convert_modules.py、
   modules_status.py、docs/WATCH.md。

二、新增 tests/test_doc_refs.py: 机械检查文档里形如 scripts/xxx、docs/xxx.md 的
   引用是否真实存在, 并确认 README 指向 WATCH.md、手册里提到四个计划任务名。

   这条测试也验证过能失败: 把 README 里的 convert_modules.py 改成不存在的名字,
   它准确报出 "README.md -> scripts/convert_modules_RENAMED.py"。

   第一版把 ~/lc_mcp/modules/convert.log 这类**运行期产物**也算进去了(在用户主目录
   下, 本来就不该在仓库里), 造成误报 —— 已收紧到只认 scripts/ 与 docs/。

文档漂移是最难发现的一类问题: README 说"跑 install_xxx.ps1"而脚本早改名了,
读到的人直接卡住, 而代码测试全绿。

全套 289/289 通过。
This commit is contained in:
Codex Agent
2026-10-16 11:39:32 +08:00
parent 0616535260
commit 6fd8b8d386
2 changed files with 76 additions and 2 deletions
+22 -2
View File
@@ -113,16 +113,36 @@ codex mcp add limbus --env PYTHONUTF8=1 -- D:\lc-mcp\vendor\aalc\.venv\Scripts\p
## 无人值守 ## 无人值守
有两套独立的自动化,按需要各自启用:
### 1. 刷取循环(打关卡)
`scripts/auto_cycle.py` 每次跑一轮,流程是:刷材料(daily)→ 镜牢(`--mirror N`)→ 把队内人格升级、同步到 `--target`。 `scripts/auto_cycle.py` 每次跑一轮,流程是:刷材料(daily)→ 镜牢(`--mirror N`)→ 把队内人格升级、同步到 `--target`。
AALC 卡死时,脚本会停掉任务并重跑一次。每轮在 `~/lc_mcp/cycles/` 写一份 `cycle_*.log` 和一份 `cycle_*.json` 报告。 AALC 卡死时,脚本会停掉任务并重跑一次。每轮在 `~/lc_mcp/cycles/` 写一份 `cycle_*.log` 和一份 `cycle_*.json` 报告。
```powershell ```powershell
# 先手动跑一轮确认 # 先手动跑一轮确认
vendor\aalc\.venv\Scripts\python.exe scripts\auto_cycle.py --mirror 1 vendor\aalc\.venv\Scripts\python.exe scripts\auto_cycle.py --mirror 1
# 再注册计划任务: 每 5 分钟的会话看门狗 + 每天 05:30 一轮 # 再注册计划任务: 每 1 分钟的会话看门狗 + 每 N 小时一轮
powershell -ExecutionPolicy Bypass -File scripts\install_unattended.ps1 -At 05:30 -Mirror 1 powershell -ExecutionPolicy Bypass -File scripts\install_unattended.ps1 -EveryHours 2.5 -Mirror 1
``` ```
### 2. 只需挂机攒模块(不打任何关卡)
`scripts/convert_modules.py` 到点自己启动游戏 → 把体力合成为模块 → 关掉游戏。
每 4 小时一轮,用 `scripts/install_convert_task.ps1` 注册。
```powershell
vendor\aalc\.venv\Scripts\python.exe scripts\convert_modules.py # 手动跑一次
powershell -ExecutionPolicy Bypass -File scripts\install_convert_task.ps1 -EveryHours 4
```
看历史:`python scripts/modules_status.py`
**⚠️ 挂机值守前先读 [`docs/WATCH.md`](docs/WATCH.md)** —— 那里记着环境事实、
界面坐标、狂气的三道防线、六种已知失败模式及处置,以及几条踩过的坑
(比如 OCR 会把 `LUNACY` 读成 `UNACY`,曾让整条狂气防线静默失效)。
`scripts/levelup.py` 和 `auto_cycle.py` 里的坐标都按 1600×900 客户区书写,运行时会按实际客户区大小缩放。 `scripts/levelup.py` 和 `auto_cycle.py` 里的坐标都按 1600×900 客户区书写,运行时会按实际客户区大小缩放。
## 环境变量 ## 环境变量