普通镜牢转交 AALC,核对镜牢实际完成局数,合成与任务互斥

Browse Source
转交与互斥(原未提交改动,合入选队分支后提交):
- MCP 初始化说明和工具描述引导常规日常/领奖/普通镜牢走
  task_status -> run_task -> 轮询;jev_mirror_agent 默认转交 AALC,
  明确的速通配置、决策模型或未完成速通局仍走逐步模式。
- 新增 ~/lc_mcp/game.lock:run_task 子进程与模块合成脚本互斥,
  合成脚本另查 task_status,状态不明时不接管游戏。
- all 任务的 HDR 提示无 GUI 时直接确认并记录;预检按窗口位置
  决定是否计标题栏,set_windows=false 跳过;levelup card/weakest
  同步失败返回非零。急停提示改为 End 键。

镜牢结果(对接文档指出的缺口):
- 预检拒绝空队列和没有适用当前难度队伍的配置:AALC 会一局不打
  就以 0 退出。可用判定与 Mirror_task 的固定用途规则一致。
- 监听 mirror_signal 统计实际完成局数;少于应打局数记 [ERROR]
  并以退出码 4 结束,task_status 为 failed。
- mirror 指定 count 时临时关闭 infinite_dungeons(否则次数变成
  9999),原值写入恢复文件,结束或强杀后写回。

验证:Linux / Python 3.12 全套 507 项通过;git diff --check 通过。
用上游真实 Mirror_task 回放了无可用队伍和正常完成两种情况;
Windows 实机仍需回归。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yws
2026-11-14 03:27:03 +00:00
co-authored by Claude Opus 5.5
parent 1aa823ea2e
commit 5fdb9fd221
17 changed files with 904 additions and 46 deletions
+6
View File
@@ -10,6 +10,7 @@
关掉后严格 1:1。所以加速没关时不该给出"差不多"的位置。 关掉后严格 1:1。所以加速没关时不该给出"差不多"的位置。
""" """
import sys import sys
import contextlib
import os import os
import ast import ast
import inspect import inspect
@@ -326,6 +327,10 @@ class DriverWiringTest(unittest.TestCase):
with mock.patch.dict(sys.modules, modules), \ with mock.patch.dict(sys.modules, modules), \
mock.patch.dict(os.environ, LCP_DRIVER_INPUT='1', LCP_RESTORE_FILE=''), \ mock.patch.dict(os.environ, LCP_DRIVER_INPUT='1', LCP_RESTORE_FILE=''), \
mock.patch.object(aalc_task, 'bootstrap'), \ mock.patch.object(aalc_task, 'bootstrap'), \
mock.patch.object(aalc_task, 'exclusive_game'), \
mock.patch.object(aalc_task, 'headless_hdr_warning') as hdr_warning, \
mock.patch.object(aalc_task, 'mirror_progress',
lambda scheme: contextlib.nullcontext(ap.MirrorProgress())), \
mock.patch.object(aalc_task, 'install_exact_team_match'), \ mock.patch.object(aalc_task, 'install_exact_team_match'), \
mock.patch.object(aalc_task, 'install_robust_set_foreground'), \ mock.patch.object(aalc_task, 'install_robust_set_foreground'), \
mock.patch.object(aalc_task, 'WindowGuard'), \ mock.patch.object(aalc_task, 'WindowGuard'), \
@@ -338,6 +343,7 @@ class DriverWiringTest(unittest.TestCase):
mock.patch.object(ap.DriverClickProxy, '_screen_pos', return_value=(10, 20)): mock.patch.object(ap.DriverClickProxy, '_screen_pos', return_value=(10, 20)):
self.assertEqual(aalc_task.run(task, {}), 3 if problems else 0) self.assertEqual(aalc_task.run(task, {}), 3 if problems else 0)
install_hotkey.return_value.stop.assert_called_once() install_hotkey.return_value.stop.assert_called_once()
self.assertEqual(hdr_warning.call_count, int(task == 'all' and not problems))
if problems: if problems:
drv.click.assert_not_called() drv.click.assert_not_called()
else: else: