diff --git a/docs/feedback/2026-10-02/validation/README.md b/docs/feedback/2026-10-02/validation/README.md new file mode 100644 index 0000000..de9a0d5 --- /dev/null +++ b/docs/feedback/2026-10-02/validation/README.md @@ -0,0 +1,33 @@ +# 2026-10-02 测试产物归档 + +这些文件是 **2026-10-02 那轮会话**产生并遗留在仓库根目录、一直未被提交的 +测试产物。2026-10-13 按用户要求归档到这个位置,让测试代码与结果 +跟对应的日期记录放在一起,仓库根目录不再散落未跟踪文件。 + +## 内容 + +| 文件 | 说明 | +|---|---| +| `TEST_REPORT.md` | 当轮测试报告 | +| `validation-output.txt` | 单测运行输出(`test_click_text_second_hit` / `test_get_state` / `test_missing_text_does_not_click` / `test_ocr_confidence_filter` / `test_ocr_error_does_not_click` / `test_protocol_discovery_and_all_input_tools` 等) | +| `validation-results.json` | 上式的结构化结果 | +| `live-service-results.json` | 对**常驻服务**(非 FakeEngine)的实测结果 | +| `sdk-client-results.json` | SDK 客户端实测结果 | +| `tests/live_services_v05.py` | 常驻服务实测脚本 | +| `tests/validation_v05.py` | 校验脚本(v0.5) | +| `validation-artifacts/ocr-synthetic.png` | OCR 合成测试图 | +| `validation-artifacts/run-original.vbs` | 复现用启动脚本 | + +## 两点说明 + +1. **这些不是本次无人值守部署(10-04 / 10-05)的产物。** 那两天的记录在 + `docs/feedback/2026-10-04/` 与 `docs/feedback/2026-10-05/`。 +2. `tests/*.py` 归档到这里是为了保留证据链,**它们不在 `tests/` 目录下 + 就不会被 `python -m unittest discover -s tests` 收集**。若希望它们 + 参与常规测试,需要移回 `tests/` 并确认通过。 + +## 相关提交 + +- `docs/feedback/2026-10-04/README.md` — 无人值守部署:6 个失败根因 + 自愈看门狗 +- `docs/feedback/2026-10-05/PITFALLS.md` — 自动化实战:14 个坑 +- `docs/feedback/2026-10-05/logs/` — 20 份任务日志 + 服务/看门狗日志 diff --git a/docs/feedback/2026-10-02/validation/TEST_REPORT.md b/docs/feedback/2026-10-02/validation/TEST_REPORT.md new file mode 100644 index 0000000..73c6e62 --- /dev/null +++ b/docs/feedback/2026-10-02/validation/TEST_REPORT.md @@ -0,0 +1,135 @@ +# lc-mcp 测试报告 + +测试日期:2026-10-02(Asia/Hong_Kong)。 + +仓库:https://git.lingll.icu/yws/lc-mcp + +测试提交:`8d24276511e2f007a758b180cba7167e58aca090`,main,服务版本 0.5.0。 + +## 结论 + +基础 MCP 连接和远端 OCR 可用,但当前版本不能判定为可以可靠操作真实游戏。Windows 默认截图启动脚本存在可复现的 VBScript 编译错误;参数缺失会导致意外点击;输入和工具错误可能被报告为成功。应优先修复这三类问题,再做实际游戏闭环测试。 + +当前仓库实现独立的屏幕 OCR 和桌面输入,没有找到 AALC 的 API 调用、配置、依赖或游戏状态集成。是否来自 AALC 的设计或早期代码,无法从本次仓库内容确定。 + +## 环境与范围 + +- Windows 本机;服务使用已安装的 Python 3.8.6。 +- 官方 MCP Python SDK 1.30.0 客户端运行于独立 Python 3.12.14 虚拟环境。 +- 远端 OCR 使用仓库默认地址,上传内容仅为生成的测试 PNG。 +- 输入测试使用 mock 或模拟底层调用失败,没有向真实桌面发送点击、按键或文字。 +- 没有检测到正在运行的 LimbusCompany/AALC 进程。实际游戏窗口、战斗、奖励结算和 AALC 联动均未验证。 +- Linux uinput 检查使用模拟依赖复现 Python 错误,并核对上游数据类型;没有 Linux 内核或 macOS 实机测试。 +- Windows VBScript 使用相同生成表达式、隔离文件路径,通过 `cscript.exe` 编译检查。没有覆盖或运行现有 LcMCP 计划任务。 +- 仅新增测试和报告文件,没有修改原有实现、提交或推送代码。 + +## 测试结果 + +| 检查 | 结果 | 证据 | +|---|---|---| +| 自带测试 | 3 组全部通过 | mock 动作、扫描码表、stdio 往返 | +| Python 编译检查 | 通过 | `python -m compileall -q .` | +| 独立测试 | 22 项:11 通过、9 断言失败、2 运行异常 | `validation-results.json`;失败项是边界行为复现,不代表 11 个独立缺陷 | +| 官方 SDK 连接 | 通过 | initialize、ping、tools/list;识别 9 个工具 | +| SDK 模拟输入 | 通过 | move、中文 type_text | +| 远端 OCR | 通过 | 正确识别“开始 测试”和“TEST 123”;置信度 0.944、0.960 | +| OCR 延迟 | 单次 19.515 秒 | 仅一次请求,不能视为稳定性能或游戏图像准确率 | +| Windows 截图启动脚本 | 失败 | VBScript 编译器错误:语句未结束;退出码 1 | +| SendInput 初始化 | 通过 | 只加载后端,没有发送输入 | +| Interception 初始化 | 环境不满足 | 本机未找到 interception.dll;没有安装驱动或重启 | + +正常语义流程的模拟测试覆盖:OCR 置信度过滤、文字子串和大小写匹配、中心坐标计算、第二候选点击、文字找不到时不点击、OCR 失败时不点击、截图失败透传、文字出现和消失等待。 + +## 主要发现 + +### 1. Windows 截图启动脚本无法编译(P1) + +位置:[platform/win.py:20](D:/codex/tmp/lc-mcp-test/platform/win.py:20)。 + +生成的脚本在 VBScript 字符串内部直接使用单个双引号包围 PowerShell 脚本路径,提前结束了字符串。VBScript 需要将字符串内部双引号写为两个双引号。 + +复现产物为 `validation-artifacts/run-original.vbs`。执行 `cscript.exe //nologo <该文件>` 返回 1,报“Microsoft VBScript 编译器错误:语句未结束”。 + +影响:使用默认生成脚本的新部署不能启动截图任务,进而阻断 screenshot、get_state 和依赖 OCR 的工具。已有自定义修正脚本的机器需单独验证;代码仅在文件不存在时生成脚本,更新 Python 代码也不会自动刷新旧脚本。 + +### 2. 必需参数没有运行时校验,可能意外点击(P1) + +位置:[lc_mcp.py:117](D:/codex/tmp/lc-mcp-test/lc_mcp.py:117)、[lc_mcp.py:131](D:/codex/tmp/lc-mcp-test/lc_mcp.py:131)。 + +- `click({})` 被默认值转换为点击 `(0,0)`,返回 `ok=true`。官方 SDK 客户端复现相同行为。 +- `click_text({})` 使用空字符串匹配所有 OCR 项,并点击第一个文字中心。 +- `index=99` 静默选择最后一个候选;`index=-1` 也选择最后一个候选。这是当前行为,接口没有说明索引越界规则。 + +影响:客户端遗漏参数或模型选择错误索引时,服务仍可能执行桌面输入。建议在任何截图和输入之前校验必需参数、非空文字、索引整数和范围。 + +### 3. MCP 工具错误标记位置错误,客户端读成成功(P1) + +位置:[lc_mcp.py:221](D:/codex/tmp/lc-mcp-test/lc_mcp.py:221)。 + +调用 `move({"x":"invalid","y":6})` 时,服务把 `isError=true` 放在 JSON-RPC 顶层,而不是 `result` 内部。官方 SDK 接收到文本里的 `ok=false`,但 `CallToolResult.isError` 实际为 false。 + +普通 `ok=false` 返回路径没有设置 `result.isError`;未知工具也返回普通文本结果。 + +工具执行错误应在 `result.isError` 中表达;未知工具和无效参数可用 JSON-RPC 错误。这与 [MCP 2024-11-05 Tools 规范](https://modelcontextprotocol.io/specification/2024-11-05/server/tools)不符。 + +### 4. SendInput 注入失败仍返回成功(P1) + +位置:[backends/sendinput_win.py:54](D:/codex/tmp/lc-mcp-test/backends/sendinput_win.py:54)、[backends/sendinput_win.py:87](D:/codex/tmp/lc-mcp-test/backends/sendinput_win.py:87)。 + +模拟 `SendInput` 返回 0 后,`keypress('p')` 仍返回 `ok=true`。点击和文字输入也不检查注入数量;移动不检查 SetCursorPos 结果。 + +影响:服务返回成功不代表目标应用收到输入。需要检查底层调用结果,并在游戏环境用后续状态验证动作效果。本次没有实机验证游戏对 SendInput 的接受程度。 + +### 5. 等待 timeout 不约束内部截图和网络请求(P2) + +位置:[lc_mcp.py:43](D:/codex/tmp/lc-mcp-test/lc_mcp.py:43)、[lc_mcp.py:140](D:/codex/tmp/lc-mcp-test/lc_mcp.py:140)。 + +用模拟时钟将一次 OCR 请求设为 30 秒,`wait_for_text(timeout=1)` 需要 31.2 秒才结束。请求固定使用 30 秒超时;截图也有自己的超时,外层没有传递剩余时间。 + +应使用单调时钟和剩余预算约束内部操作,避免短等待变成长阻塞。 + +### 6. 输入后端初始化失败同时禁用了截图(P2) + +位置:[lc_mcp.py:171](D:/codex/tmp/lc-mcp-test/lc_mcp.py:171)。 + +截图提供者与输入后端共用一个 try/except。设置一个不存在的输入后端后,`screenshot` 返回 `'NoneType' object has no attribute 'grab'`,尽管截图提供者此前已成功创建。 + +应分别初始化和报告截图、输入能力;仅观察屏幕的工具不应依赖输入后端可用。 + +### 7. Linux uinput 后端存在确定的 Python 错误(P1,限该后端) + +位置:[backends/uinput_linux.py:28](D:/codex/tmp/lc-mcp-test/backends/uinput_linux.py:28)、[backends/uinput_linux.py:72](D:/codex/tmp/lc-mcp-test/backends/uinput_linux.py:72)。 + +- `keypress('enter')` 引用未定义的 `KEY_ENTER`,抛 NameError。 +- `_ensure()` 对 uinput 的元组常量执行 `KEY_Z + 1` 和 range,抛 TypeError。 +- 其他输入路径引用未在模块作用域导入的 REL_X、BTN_LEFT 等常量;代码还缺少 time 导入。 + +前两项已通过隔离测试复现,后两项为源码检查。uinput 的事件描述符类型已核对 [python-uinput 上游实现](https://raw.githubusercontent.com/tuomasjjrasanen/python-uinput/master/src/__init__.py)。 + +### 8. Interception 实现与上游公开 API 不一致(待实机确认) + +位置:[backends/interception_win.py:91](D:/codex/tmp/lc-mcp-test/backends/interception_win.py:91)。 + +代码调用 interception_open_device/interception_close_device,但 [上游公开头文件](https://raw.githubusercontent.com/oblitum/Interception/master/library/interception.h)没有这两个接口。上游设备总数为 20,代码扫描到 64,且硬件 ID 被按 ASCII 文本解释。 + +这是源码与上游接口比对发现,本机缺少 DLL,未测试实际加载的 DLL 是否为提供这些接口的定制版本。部署前应明确支持的 DLL 版本并用真实设备验证。 + +### 9. 畸形 JSON 使服务退出(P2,健壮性) + +向 stdio 发送 `{ invalid json }` 后,服务直接关闭 stdout 并退出,没有返回 JSON-RPC parse error。这会断开客户端连接。有效请求的正常流程不受本测试影响。 + +## 复现文件 + +- [独立测试脚本](D:/codex/tmp/lc-mcp-test/tests/test_validation.py) +- [OCR 和 VBScript 检查脚本](D:/codex/tmp/lc-mcp-test/tests/test_live_services.py) +- [官方 SDK 客户端脚本](D:/codex/tmp/lc-mcp-sdk-client-test.py)(放在仓库外,避免仓库的 platform 包影响客户端标准库导入) +- [逐项测试结果](D:/codex/tmp/lc-mcp-test/validation-results.json) +- [OCR、VBScript 与后端初始化结果](D:/codex/tmp/lc-mcp-test/live-service-results.json) +- [官方 SDK 返回结果](D:/codex/tmp/lc-mcp-test/sdk-client-results.json) +- [生成的 OCR 测试图](D:/codex/tmp/lc-mcp-test/validation-artifacts/ocr-synthetic.png) + +执行服务端测试:`python tests/test_dev.py`、`python tests/test_validation.py`、`python tests/test_live_services.py`。后者需要 Pillow、Windows 字体和网络;当前本机已有所需图像依赖。独立验证脚本当前返回非零是预期结果,因为其断言要求服务拒绝错误输入并正确报告失败。 + +## 下一步 + +先修复 Windows 脚本生成、参数校验、MCP 错误返回和底层输入结果检查,再准备可观察的游戏窗口,逐步验证“截图 → OCR → 正确候选 → 单次输入 → 新截图确认”。真实游戏测试需要运行机器和窗口状态;本次结果不包含战斗自动化成功率或 AALC 集成验证。 diff --git a/docs/feedback/2026-10-02/validation/live-service-results.json b/docs/feedback/2026-10-02/validation/live-service-results.json new file mode 100644 index 0000000..35f1f88 --- /dev/null +++ b/docs/feedback/2026-10-02/validation/live-service-results.json @@ -0,0 +1,39 @@ +{ + "remote_ocr": { + "url": "http://35.212.193.150:8599/", + "seconds": 19.515, + "items": [ + { + "text": "开始 测试", + "x": 37, + "y": 39, + "w": 230, + "h": 59, + "score": 0.944 + }, + { + "text": "TEST 123", + "x": 40, + "y": 143, + "w": 226, + "h": 47, + "score": 0.96 + } + ], + "error": null, + "input": "D:\\codex\\tmp\\lc-mcp-test\\validation-artifacts\\ocr-synthetic.png" + }, + "windows_vbs": { + "returncode": 1, + "stdout": "", + "stderr": "D:\\codex\\tmp\\lc-mcp-test\\validation-artifacts\\run-original.vbs(1, 93) Microsoft VBScript 编译器错误: 语句未结束\r\n\r\n", + "script": "CreateObject(\"WScript.Shell\").Run \"powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"D:\\codex\\tmp\\lc-mcp-test\\validation-artifacts\\nonexistent-test-job.ps1\"\", 0, False\n" + }, + "sendinput_initialization": { + "ok": true + }, + "interception_initialization": { + "ok": false, + "error": "Could not find module 'interception.dll' (or one of its dependencies). Try using the full path with constructor syntax." + } +} \ No newline at end of file diff --git a/docs/feedback/2026-10-02/validation/sdk-client-results.json b/docs/feedback/2026-10-02/validation/sdk-client-results.json new file mode 100644 index 0000000..3453a05 --- /dev/null +++ b/docs/feedback/2026-10-02/validation/sdk-client-results.json @@ -0,0 +1,133 @@ +{ + "sdk_version": "1.30.0", + "initialize": { + "meta": null, + "protocolVersion": "2024-11-05", + "capabilities": { + "experimental": null, + "logging": null, + "prompts": null, + "resources": null, + "tools": { + "listChanged": false + }, + "completions": null, + "tasks": null + }, + "serverInfo": { + "name": "lc-mcp", + "title": null, + "version": "0.5.0", + "websiteUrl": null, + "icons": null + }, + "instructions": null + }, + "ping": "PASS", + "tools": [ + "get_state", + "click_text", + "wait_for_text", + "wait_for_text_gone", + "screenshot", + "click", + "move", + "keypress", + "type_text" + ], + "calls": [ + { + "name": "move", + "arguments": { + "x": 5, + "y": 6 + }, + "result": { + "meta": null, + "content": [ + { + "type": "text", + "text": "{\"ok\": true, \"backend\": \"mock\"}", + "annotations": null, + "meta": null + } + ], + "structuredContent": null, + "isError": false + } + }, + { + "name": "type_text", + "arguments": { + "text": "测试" + }, + "result": { + "meta": null, + "content": [ + { + "type": "text", + "text": "{\"ok\": true, \"typed\": \"测试\", \"backend\": \"mock\"}", + "annotations": null, + "meta": null + } + ], + "structuredContent": null, + "isError": false + } + }, + { + "name": "move", + "arguments": { + "x": "invalid", + "y": 6 + }, + "result": { + "meta": null, + "content": [ + { + "type": "text", + "text": "{\"ok\": false, \"error\": \"invalid literal for int() with base 10: 'invalid'\"}", + "annotations": null, + "meta": null + } + ], + "structuredContent": null, + "isError": false + } + }, + { + "name": "click", + "arguments": {}, + "result": { + "meta": null, + "content": [ + { + "type": "text", + "text": "{\"ok\": true, \"clicked\": [0, 0], \"backend\": \"mock\"}", + "annotations": null, + "meta": null + } + ], + "structuredContent": null, + "isError": false + } + }, + { + "name": "unknown", + "arguments": {}, + "result": { + "meta": null, + "content": [ + { + "type": "text", + "text": "{\"ok\": false, \"error\": \"unknown tool unknown\"}", + "annotations": null, + "meta": null + } + ], + "structuredContent": null, + "isError": false + } + } + ] +} \ No newline at end of file diff --git a/docs/feedback/2026-10-02/validation/tests/live_services_v05.py b/docs/feedback/2026-10-02/validation/tests/live_services_v05.py new file mode 100644 index 0000000..1907be5 --- /dev/null +++ b/docs/feedback/2026-10-02/validation/tests/live_services_v05.py @@ -0,0 +1,45 @@ +"""Use only generated images; never send screenshots or desktop input.""" +import json +from pathlib import Path +import subprocess +import sys +import time + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT)) +import lc_mcp as app +from PIL import Image, ImageDraw, ImageFont + +out = ROOT / 'validation-artifacts' +out.mkdir(exist_ok=True) +results = {} +image = Image.new('RGB', (900, 300), 'white') +draw = ImageDraw.Draw(image) +font = ImageFont.truetype('C:/Windows/Fonts/msyh.ttc', 52) +draw.text((40, 30), '开始 测试', font=font, fill='black') +draw.text((40, 130), 'TEST 123', font=font, fill='black') +path = out / 'ocr-synthetic.png' +image.save(str(path)) +start = time.monotonic() +items, error = app.ocr_image(str(path)) +results['remote_ocr'] = {'url': app.OCR_URL, 'seconds': round(time.monotonic() - start, 3), + 'items': items, 'error': error, 'input': str(path)} +print(json.dumps({'remote_ocr': results['remote_ocr']}, ensure_ascii=True), flush=True) + +# Exact script-generation expression from platform/win.py, with isolated paths. +job = str(out / 'nonexistent-test-job.ps1') +vbs = out / 'run-original.vbs' +vbs.write_text('CreateObject("WScript.Shell").Run "powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%s"", 0, False\n' % job, encoding='utf-8') +r = subprocess.run(['cscript.exe', '//nologo', str(vbs)], capture_output=True, timeout=10) +results['windows_vbs'] = {'returncode': r.returncode, + 'stdout': r.stdout.decode('mbcs', errors='replace'), 'stderr': r.stderr.decode('mbcs', errors='replace'), + 'script': vbs.read_text(encoding='utf-8')} +print(json.dumps({'windows_vbs': results['windows_vbs']}, ensure_ascii=True), flush=True) +for name in ('sendinput', 'interception'): + try: + backend = app.get_input_backend(name, 'win') + results[name + '_initialization'] = {'ok': True} + except Exception as e: + results[name + '_initialization'] = {'ok': False, 'error': str(e)} +(ROOT / 'live-service-results.json').write_text(json.dumps(results, ensure_ascii=False, indent=2), encoding='utf-8') +print(json.dumps(results, ensure_ascii=True), flush=True) diff --git a/docs/feedback/2026-10-02/validation/tests/validation_v05.py b/docs/feedback/2026-10-02/validation/tests/validation_v05.py new file mode 100644 index 0000000..e584a21 --- /dev/null +++ b/docs/feedback/2026-10-02/validation/tests/validation_v05.py @@ -0,0 +1,251 @@ +"""Independent validation; no real desktop inputs are sent. + +Run: python tests/test_validation.py +Failures assert the intended behavior and reproduce defects in the tested revision. +""" +import contextlib +import io +import json +import os +from pathlib import Path +import queue +import subprocess +import sys +import tempfile +import threading +import unittest +from unittest.mock import patch + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT)) +import lc_mcp as app +from backends.mock import MockBackend + +ITEMS = [ + {'text': '开始', 'x': 100, 'y': 200, 'w': 80, 'h': 40, 'score': .99}, + {'text': '开始战斗', 'x': 300, 'y': 400, 'w': 100, 'h': 50, 'score': .95}, +] + + +class Provider: + def grab(self): + return {'ok': True, 'path': 'synthetic.png'} + + +class Peer: + def __init__(self, extra_env=None): + env = dict(os.environ, INPUT_BACKEND='mock', PYTHONIOENCODING='utf-8') + env.update(extra_env or {}) + self.p = subprocess.Popen([sys.executable, str(ROOT / 'lc_mcp.py')], + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + text=True, encoding='utf-8', env=env) + self.q = queue.Queue() + def pump(): + for line in self.p.stdout: + self.q.put(line) + self.q.put(None) + threading.Thread(target=pump, daemon=True).start() + + def send(self, obj): + self.p.stdin.write(json.dumps(obj, ensure_ascii=True) + '\n') + self.p.stdin.flush() + line = self.q.get(timeout=5) + return json.loads(line) if line else None + + def close(self): + if self.p.poll() is None: + self.p.kill() + self.p.communicate(timeout=5) + + +class HealthyPaths(unittest.TestCase): + def setUp(self): + self.b = MockBackend() + self.s = app.MCPServer('win', Provider(), self.b) + + def test_text_coordinates(self): + self.assertEqual(app.calc_click('开始', ITEMS)[0], {'text': '开始', 'x': 140, 'y': 220}) + + def test_substring_case_insensitive(self): + items = [dict(ITEMS[0], text='Start Battle')] + self.assertEqual(len(app.calc_click('START', items)), 1) + + def test_get_state(self): + with patch.object(app, 'ocr_image', return_value=(ITEMS, None)): + self.assertEqual(self.s.call('get_state', {})['items'], ITEMS) + + def test_click_text_second_hit(self): + with patch.object(app, 'ocr_image', return_value=(ITEMS, None)): + self.s.call('click_text', {'text': '开始', 'index': 1}) + self.assertEqual(self.b.log[-1]['x'], 350) + self.assertEqual(self.b.log[-1]['y'], 425) + + def test_missing_text_does_not_click(self): + with patch.object(app, 'ocr_image', return_value=(ITEMS, None)): + self.assertFalse(self.s.call('click_text', {'text': '不存在'})['ok']) + self.assertEqual(self.b.log, []) + + def test_ocr_error_does_not_click(self): + with patch.object(app, 'ocr_image', return_value=(None, 'service unavailable')): + self.assertFalse(self.s.call('click_text', {'text': '开始'})['ok']) + self.assertEqual(self.b.log, []) + + def test_screenshot_error_propagates(self): + with patch.object(self.s.provider, 'grab', return_value={'ok': False, 'error': 'capture fail'}): + self.assertEqual(self.s.call('get_state', {})['error'], 'capture fail') + + def test_wait_present(self): + with patch.object(app, 'ocr_image', return_value=(ITEMS, None)): + self.assertTrue(self.s.call('wait_for_text', {'text': '开始', 'timeout': 1})['present']) + + def test_wait_absent(self): + with patch.object(app, 'ocr_image', return_value=([], None)): + result = self.s.call('wait_for_text_gone', {'text': '开始', 'timeout': 1}) + self.assertTrue(result['ok']) + self.assertFalse(result['present']) + + def test_ocr_confidence_filter(self): + payload = {'ok': True, 'items': ITEMS + [dict(ITEMS[0], score=.1)]} + response = contextlib.closing(io.BytesIO(json.dumps(payload).encode('utf-8'))) + with tempfile.TemporaryDirectory() as tmp, patch.object(app.urllib.request, 'urlopen', return_value=response): + path = Path(tmp) / 'image.png' + path.write_bytes(b'fixture') + items, error = app.ocr_image(str(path)) + self.assertIsNone(error) + self.assertEqual(len(items), 2) + + def test_protocol_discovery_and_all_input_tools(self): + p = Peer() + try: + response = p.send({'jsonrpc': '2.0', 'id': 1, 'method': 'initialize', 'params': {}}) + self.assertEqual(response['result']['serverInfo']['name'], 'lc-mcp') + response = p.send({'jsonrpc': '2.0', 'id': 2, 'method': 'tools/list'}) + self.assertEqual(len(response['result']['tools']), 9) + for name, args in [('click', {'x': 10, 'y': 20}), ('move', {'x': 5, 'y': 6}), + ('keypress', {'key': 'p'}), ('type_text', {'text': '开始'})]: + r = p.send({'jsonrpc': '2.0', 'id': 3, 'method': 'tools/call', 'params': {'name': name, 'arguments': args}}) + self.assertTrue(json.loads(r['result']['content'][0]['text'])['ok']) + finally: + p.close() + + +class RequiredBehavior(unittest.TestCase): + def setUp(self): + self.b = MockBackend() + self.s = app.MCPServer('win', Provider(), self.b) + + def test_missing_click_coordinates_rejected(self): + result = self.s.call('click', {}) + self.assertFalse(result['ok'], result) + self.assertEqual(self.b.log, []) + + def test_missing_click_text_rejected(self): + with patch.object(app, 'ocr_image', return_value=(ITEMS, None)): + result = self.s.call('click_text', {}) + self.assertFalse(result['ok'], result) + self.assertEqual(self.b.log, []) + + def test_out_of_range_index_rejected(self): + with patch.object(app, 'ocr_image', return_value=(ITEMS, None)): + result = self.s.call('click_text', {'text': '开始', 'index': 99}) + self.assertFalse(result['ok'], result) + + def test_negative_index_rejected(self): + with patch.object(app, 'ocr_image', return_value=(ITEMS, None)): + result = self.s.call('click_text', {'text': '开始', 'index': -1}) + self.assertFalse(result['ok'], result) + + def test_wait_timeout_honored(self): + clock = [0.0] + def slow_ocr(_): + clock[0] += 30 + return None, 'network timeout' + def sleep(seconds): + clock[0] += seconds + with patch.object(app.time, 'time', side_effect=lambda: clock[0]), \ + patch.object(app.time, 'sleep', side_effect=sleep), \ + patch.object(app, 'ocr_image', side_effect=slow_ocr): + self.s.call('wait_for_text', {'text': '开始', 'timeout': 1}) + self.assertLessEqual(clock[0], 1.1, 'one-second deadline took %.1f seconds' % clock[0]) + + def test_tool_exception_sets_result_iserror(self): + p = Peer() + try: + r = p.send({'jsonrpc': '2.0', 'id': 1, 'method': 'tools/call', + 'params': {'name': 'move', 'arguments': {'x': 'invalid', 'y': 1}}}) + self.assertTrue(r['result'].get('isError', False), r) + finally: + p.close() + + def test_unknown_tool_returns_protocol_error(self): + p = Peer() + try: + r = p.send({'jsonrpc': '2.0', 'id': 1, 'method': 'tools/call', + 'params': {'name': 'unknown', 'arguments': {}}}) + self.assertIn('error', r, r) + finally: + p.close() + + def test_invalid_json_keeps_server_alive(self): + p = Peer() + try: + p.p.stdin.write('{ invalid json }\n') + p.p.stdin.flush() + line = p.q.get(timeout=5) + self.assertIsNotNone(line, 'server closes stdout and exits without JSON-RPC parse error') + self.assertEqual(json.loads(line)['error']['code'], -32700) + finally: + p.close() + + def test_sendinput_failed_injection_is_reported(self): + from backends.sendinput_win import SendInputBackend + b = SendInputBackend.__new__(SendInputBackend) + with patch.object(b, '_send_input', return_value=0): + r = b.keypress('p') + self.assertFalse(r['ok'], r) + + def test_uinput_key_constants_in_scope(self): + from backends.uinput_linux import UinputBackend + b = UinputBackend.__new__(UinputBackend) + with patch.object(b, '_key'): + r = b.keypress('enter') + self.assertTrue(r['ok']) + + def test_uinput_device_events_are_valid(self): + import types + from backends.uinput_linux import UinputBackend + fake = types.SimpleNamespace(Device=lambda events: object()) + names = ['KEY_A', 'KEY_Z', 'KEY_ENTER', 'KEY_ESC', 'KEY_SPACE', 'KEY_TAB', 'KEY_F4', + 'KEY_LEFTCTRL', 'KEY_LEFTSHIFT', 'KEY_LEFTALT', 'KEY_BACKSPACE', + 'REL_X', 'REL_Y', 'BTN_LEFT', 'BTN_RIGHT'] + for i, name in enumerate(names): + setattr(fake, name, (1, i + 30)) + b = UinputBackend.__new__(UinputBackend) + b._ctx = None + with patch.dict(sys.modules, {'uinput': fake}): + self.assertIsNotNone(b._ensure()) + + +class Result(unittest.TextTestResult): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.records = [] + + def addSuccess(self, test): + super().addSuccess(test) + self.records.append({'test': test.id(), 'status': 'PASS'}) + + def addFailure(self, test, err): + super().addFailure(test, err) + self.records.append({'test': test.id(), 'status': 'FAIL', 'detail': self._exc_info_to_string(err, test)}) + + def addError(self, test, err): + super().addError(test, err) + self.records.append({'test': test.id(), 'status': 'ERROR', 'detail': self._exc_info_to_string(err, test)}) + + +if __name__ == '__main__': + suite = unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__]) + result = unittest.TextTestRunner(verbosity=2, resultclass=Result).run(suite) + (ROOT / 'validation-results.json').write_text(json.dumps(result.records, ensure_ascii=False, indent=2), encoding='utf-8') + sys.exit(0 if result.wasSuccessful() else 1) diff --git a/docs/feedback/2026-10-02/validation/validation-artifacts/ocr-synthetic.png b/docs/feedback/2026-10-02/validation/validation-artifacts/ocr-synthetic.png new file mode 100644 index 0000000..f7bbd21 Binary files /dev/null and b/docs/feedback/2026-10-02/validation/validation-artifacts/ocr-synthetic.png differ diff --git a/docs/feedback/2026-10-02/validation/validation-artifacts/run-original.vbs b/docs/feedback/2026-10-02/validation/validation-artifacts/run-original.vbs new file mode 100644 index 0000000..230fb83 --- /dev/null +++ b/docs/feedback/2026-10-02/validation/validation-artifacts/run-original.vbs @@ -0,0 +1 @@ +CreateObject("WScript.Shell").Run "powershell.exe -NoProfile -ExecutionPolicy Bypass -File "D:\codex\tmp\lc-mcp-test\validation-artifacts\nonexistent-test-job.ps1"", 0, False diff --git a/docs/feedback/2026-10-02/validation/validation-output.txt b/docs/feedback/2026-10-02/validation/validation-output.txt new file mode 100644 index 0000000..3ef04f1 --- /dev/null +++ b/docs/feedback/2026-10-02/validation/validation-output.txt @@ -0,0 +1,119 @@ +test_click_text_second_hit (__main__.HealthyPaths) ... ok +test_get_state (__main__.HealthyPaths) ... ok +test_missing_text_does_not_click (__main__.HealthyPaths) ... ok +test_ocr_confidence_filter (__main__.HealthyPaths) ... ok +test_ocr_error_does_not_click (__main__.HealthyPaths) ... ok +test_protocol_discovery_and_all_input_tools (__main__.HealthyPaths) ... ok +test_screenshot_error_propagates (__main__.HealthyPaths) ... ok +test_substring_case_insensitive (__main__.HealthyPaths) ... ok +test_text_coordinates (__main__.HealthyPaths) ... ok +test_wait_absent (__main__.HealthyPaths) ... ok +test_wait_present (__main__.HealthyPaths) ... ok +test_invalid_json_keeps_server_alive (__main__.RequiredBehavior) ... FAIL +test_missing_click_coordinates_rejected (__main__.RequiredBehavior) ... FAIL +test_missing_click_text_rejected (__main__.RequiredBehavior) ... FAIL +test_negative_index_rejected (__main__.RequiredBehavior) ... FAIL +test_out_of_range_index_rejected (__main__.RequiredBehavior) ... FAIL +test_sendinput_failed_injection_is_reported (__main__.RequiredBehavior) ... FAIL +test_tool_exception_sets_result_iserror (__main__.RequiredBehavior) ... FAIL +test_uinput_device_events_are_valid (__main__.RequiredBehavior) ... ERROR +test_uinput_key_constants_in_scope (__main__.RequiredBehavior) ... ERROR +test_unknown_tool_returns_protocol_error (__main__.RequiredBehavior) ... FAIL +test_wait_timeout_honored (__main__.RequiredBehavior) ... FAIL + +====================================================================== +ERROR: test_uinput_device_events_are_valid (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 226, in test_uinput_device_events_are_valid + self.assertIsNotNone(b._ensure()) + File "D:\codex\tmp\lc-mcp-test\backends\uinput_linux.py", line 28, in _ensure + *[key for key in range(KEY_A, KEY_Z + 1)], +TypeError: can only concatenate tuple (not "int") to tuple + +====================================================================== +ERROR: test_uinput_key_constants_in_scope (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 211, in test_uinput_key_constants_in_scope + r = b.keypress('enter') + File "D:\codex\tmp\lc-mcp-test\backends\uinput_linux.py", line 72, in keypress + mapping = {'enter': KEY_ENTER, 'esc': KEY_ESC, 'space': KEY_SPACE, +NameError: name 'KEY_ENTER' is not defined + +====================================================================== +FAIL: test_invalid_json_keeps_server_alive (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 195, in test_invalid_json_keeps_server_alive + self.assertIsNotNone(line, 'server closes stdout and exits without JSON-RPC parse error') +AssertionError: unexpectedly None : server closes stdout and exits without JSON-RPC parse error + +====================================================================== +FAIL: test_missing_click_coordinates_rejected (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 139, in test_missing_click_coordinates_rejected + self.assertFalse(result['ok'], result) +AssertionError: True is not false : {'ok': True, 'clicked': [0, 0], 'backend': 'mock'} + +====================================================================== +FAIL: test_missing_click_text_rejected (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 145, in test_missing_click_text_rejected + self.assertFalse(result['ok'], result) +AssertionError: True is not false : {'ok': True, 'clicked': [140, 220], 'backend': 'mock', 'on': '��ʼ'} + +====================================================================== +FAIL: test_negative_index_rejected (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 156, in test_negative_index_rejected + self.assertFalse(result['ok'], result) +AssertionError: True is not false : {'ok': True, 'clicked': [350, 425], 'backend': 'mock', 'on': '��ʼս��'} + +====================================================================== +FAIL: test_out_of_range_index_rejected (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 151, in test_out_of_range_index_rejected + self.assertFalse(result['ok'], result) +AssertionError: True is not false : {'ok': True, 'clicked': [350, 425], 'backend': 'mock', 'on': '��ʼս��'} + +====================================================================== +FAIL: test_sendinput_failed_injection_is_reported (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 205, in test_sendinput_failed_injection_is_reported + self.assertFalse(r['ok'], r) +AssertionError: True is not false : {'ok': True, 'key': 'p', 'backend': 'sendinput'} + +====================================================================== +FAIL: test_tool_exception_sets_result_iserror (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 176, in test_tool_exception_sets_result_iserror + self.assertTrue(r['result'].get('isError', False), r) +AssertionError: False is not true : {'jsonrpc': '2.0', 'id': 1, 'result': {'content': [{'type': 'text', 'text': '{"ok": false, "error": "invalid literal for int() with base 10: \'invalid\'"}'}]}, 'isError': True} + +====================================================================== +FAIL: test_unknown_tool_returns_protocol_error (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 185, in test_unknown_tool_returns_protocol_error + self.assertIn('error', r, r) +AssertionError: 'error' not found in {'jsonrpc': '2.0', 'id': 1, 'result': {'content': [{'type': 'text', 'text': '{"ok": false, "error": "unknown tool unknown"}'}]}} : {'jsonrpc': '2.0', 'id': 1, 'result': {'content': [{'type': 'text', 'text': '{"ok": false, "error": "unknown tool unknown"}'}]}} + +====================================================================== +FAIL: test_wait_timeout_honored (__main__.RequiredBehavior) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "tests\test_validation.py", line 169, in test_wait_timeout_honored + self.assertLessEqual(clock[0], 1.1, 'one-second deadline took %.1f seconds' % clock[0]) +AssertionError: 31.2 not less than or equal to 1.1 : one-second deadline took 31.2 seconds + +---------------------------------------------------------------------- +Ran 22 tests in 0.886s + +FAILED (failures=9, errors=2) diff --git a/docs/feedback/2026-10-02/validation/validation-results.json b/docs/feedback/2026-10-02/validation/validation-results.json new file mode 100644 index 0000000..a7fc66a --- /dev/null +++ b/docs/feedback/2026-10-02/validation/validation-results.json @@ -0,0 +1,101 @@ +[ + { + "test": "__main__.HealthyPaths.test_click_text_second_hit", + "status": "PASS" + }, + { + "test": "__main__.HealthyPaths.test_get_state", + "status": "PASS" + }, + { + "test": "__main__.HealthyPaths.test_missing_text_does_not_click", + "status": "PASS" + }, + { + "test": "__main__.HealthyPaths.test_ocr_confidence_filter", + "status": "PASS" + }, + { + "test": "__main__.HealthyPaths.test_ocr_error_does_not_click", + "status": "PASS" + }, + { + "test": "__main__.HealthyPaths.test_protocol_discovery_and_all_input_tools", + "status": "PASS" + }, + { + "test": "__main__.HealthyPaths.test_screenshot_error_propagates", + "status": "PASS" + }, + { + "test": "__main__.HealthyPaths.test_substring_case_insensitive", + "status": "PASS" + }, + { + "test": "__main__.HealthyPaths.test_text_coordinates", + "status": "PASS" + }, + { + "test": "__main__.HealthyPaths.test_wait_absent", + "status": "PASS" + }, + { + "test": "__main__.HealthyPaths.test_wait_present", + "status": "PASS" + }, + { + "test": "__main__.RequiredBehavior.test_invalid_json_keeps_server_alive", + "status": "FAIL", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 195, in test_invalid_json_keeps_server_alive\n self.assertIsNotNone(line, 'server closes stdout and exits without JSON-RPC parse error')\nAssertionError: unexpectedly None : server closes stdout and exits without JSON-RPC parse error\n" + }, + { + "test": "__main__.RequiredBehavior.test_missing_click_coordinates_rejected", + "status": "FAIL", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 139, in test_missing_click_coordinates_rejected\n self.assertFalse(result['ok'], result)\nAssertionError: True is not false : {'ok': True, 'clicked': [0, 0], 'backend': 'mock'}\n" + }, + { + "test": "__main__.RequiredBehavior.test_missing_click_text_rejected", + "status": "FAIL", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 145, in test_missing_click_text_rejected\n self.assertFalse(result['ok'], result)\nAssertionError: True is not false : {'ok': True, 'clicked': [140, 220], 'backend': 'mock', 'on': '开始'}\n" + }, + { + "test": "__main__.RequiredBehavior.test_negative_index_rejected", + "status": "FAIL", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 156, in test_negative_index_rejected\n self.assertFalse(result['ok'], result)\nAssertionError: True is not false : {'ok': True, 'clicked': [350, 425], 'backend': 'mock', 'on': '开始战斗'}\n" + }, + { + "test": "__main__.RequiredBehavior.test_out_of_range_index_rejected", + "status": "FAIL", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 151, in test_out_of_range_index_rejected\n self.assertFalse(result['ok'], result)\nAssertionError: True is not false : {'ok': True, 'clicked': [350, 425], 'backend': 'mock', 'on': '开始战斗'}\n" + }, + { + "test": "__main__.RequiredBehavior.test_sendinput_failed_injection_is_reported", + "status": "FAIL", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 205, in test_sendinput_failed_injection_is_reported\n self.assertFalse(r['ok'], r)\nAssertionError: True is not false : {'ok': True, 'key': 'p', 'backend': 'sendinput'}\n" + }, + { + "test": "__main__.RequiredBehavior.test_tool_exception_sets_result_iserror", + "status": "FAIL", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 176, in test_tool_exception_sets_result_iserror\n self.assertTrue(r['result'].get('isError', False), r)\nAssertionError: False is not true : {'jsonrpc': '2.0', 'id': 1, 'result': {'content': [{'type': 'text', 'text': '{\"ok\": false, \"error\": \"invalid literal for int() with base 10: \\'invalid\\'\"}'}]}, 'isError': True}\n" + }, + { + "test": "__main__.RequiredBehavior.test_uinput_device_events_are_valid", + "status": "ERROR", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 226, in test_uinput_device_events_are_valid\n self.assertIsNotNone(b._ensure())\n File \"D:\\codex\\tmp\\lc-mcp-test\\backends\\uinput_linux.py\", line 28, in _ensure\n *[key for key in range(KEY_A, KEY_Z + 1)],\nTypeError: can only concatenate tuple (not \"int\") to tuple\n" + }, + { + "test": "__main__.RequiredBehavior.test_uinput_key_constants_in_scope", + "status": "ERROR", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 211, in test_uinput_key_constants_in_scope\n r = b.keypress('enter')\n File \"D:\\codex\\tmp\\lc-mcp-test\\backends\\uinput_linux.py\", line 72, in keypress\n mapping = {'enter': KEY_ENTER, 'esc': KEY_ESC, 'space': KEY_SPACE,\nNameError: name 'KEY_ENTER' is not defined\n" + }, + { + "test": "__main__.RequiredBehavior.test_unknown_tool_returns_protocol_error", + "status": "FAIL", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 185, in test_unknown_tool_returns_protocol_error\n self.assertIn('error', r, r)\nAssertionError: 'error' not found in {'jsonrpc': '2.0', 'id': 1, 'result': {'content': [{'type': 'text', 'text': '{\"ok\": false, \"error\": \"unknown tool unknown\"}'}]}} : {'jsonrpc': '2.0', 'id': 1, 'result': {'content': [{'type': 'text', 'text': '{\"ok\": false, \"error\": \"unknown tool unknown\"}'}]}}\n" + }, + { + "test": "__main__.RequiredBehavior.test_wait_timeout_honored", + "status": "FAIL", + "detail": "Traceback (most recent call last):\n File \"tests\\test_validation.py\", line 169, in test_wait_timeout_honored\n self.assertLessEqual(clock[0], 1.1, 'one-second deadline took %.1f seconds' % clock[0])\nAssertionError: 31.2 not less than or equal to 1.1 : one-second deadline took 31.2 seconds\n" + } +] \ No newline at end of file diff --git a/docs/feedback/2026-10-03/PHYSICAL_INPUT_CHANGE.md b/docs/feedback/2026-10-03/PHYSICAL_INPUT_CHANGE.md new file mode 100644 index 0000000..f10ab07 --- /dev/null +++ b/docs/feedback/2026-10-03/PHYSICAL_INPUT_CHANGE.md @@ -0,0 +1,31 @@ +# Interception 输入改动 + +**2026-10-03 已撤销:Interception 驱动已卸载,系统过滤器恢复为 kbdclass/mouclass;驱动服务和系统驱动文件均已确认不存在。仓库已恢复上游输入实现。下文仅保留历史记录,不应再执行安装步骤。卸载需要重启才能完全生效。** + +2026-10-02,基础提交 `a4b27f9`,AALC 固定提交 `7452fad5a45a0fadb59a753fafbf40434d987c19`。 + +已拉取最新仓库和 AALC 子模块。本地新增 Interception 驱动后端,MCP 直接输入和 `run_task` 子进程共享适配逻辑;AALC 的 `auto.init_input()` 重初始化后也保持使用此后端。 + +修改文件: + +- `lc_mcp/physical_input.py`:上游 DLL 的 ctypes 接口、设备发现、发送结果检查、虚拟桌面坐标、游戏前台焦点确认、按键和按钮释放、AALC 输入绑定。 +- `lc_mcp/aalc_engine.py` 与 `lc_mcp/aalc_task.py`:在服务及任务进程中安装物理输入适配。 +- `scripts/install_interception.ps1`:固定上游 v1.0.1 包与 SHA256;支持 WhatIf;管理员安装驱动;不自动重启。 +- `tests/test_physical_input.py`:驱动 ABI、设备选择、发送失败、坐标、扩展键、释放、AALC 重初始化与 MCP 错误返回测试。 +- `README.md`:部署和输入行为说明。 + +所有鼠标点击、移动、拖拽、滚轮和按键均通过 Interception 的 `interception_send` 发送,每次发送一个 stroke,检查实际发送数量。驱动/DLL/键鼠不可用时失败,不回退到其他输入方式。中文等文字通过剪贴板加驱动 Ctrl+V 粘贴。 + +复用 AALC 的窗口客户区到桌面坐标转换;恢复并确认窗口焦点后再换算坐标。覆盖 AALC 输入初始化,同时保留输入锁、交互门、暂停与监控路径。没有修改 vendor/aalc 源码或 config.yaml。 + +验证:Python 3.12.14 完整 unittest discovery 共 32 项通过,编译检查与 git diff --check 通过。PowerShell 语法解析无错误,技能静态检查报告 safe=true。输入验证使用模拟驱动,没有发送真实游戏输入。 + +历史 v0.5 的两个本地测试脚本已保留为 `tests/validation_v05.py` 和 `tests/live_services_v05.py`,避免被新版 unittest 自动发现。旧报告和结果保留为历史记录。 + +本机安装状态:已从上游下载并校验 Interception v1.0.1,Windows 管理员安装器输出“Interception successfully installed. You must reboot for it to take effect.”。键盘和鼠标设备类 UpperFilters 已加入对应驱动。 + +安装日志:[lc-mcp-driver-install.log](D:/codex/tmp/lc-mcp-driver-install.log)。安装结果:[lc-mcp-driver-install-result.json](D:/codex/tmp/lc-mcp-driver-install-result.json)。 + +待环境步骤:重启 Windows 后驱动才会生效;实际游戏输入尚未验证。新仓库的 AALC 运行依赖需在其 Python >=3.12 环境准备好(README 的 uv sync 步骤);本次没有安装 AALC 的全部 GUI/OCR 依赖或启动常驻服务。正常服务会移动桌面光标并使用前台游戏窗口。 + +本地改动尚未提交或推送。 diff --git a/docs/feedback/2026-10-05/logs/elev_check.txt b/docs/feedback/2026-10-05/logs/elev_check.txt new file mode 100644 index 0000000..411d2ec Binary files /dev/null and b/docs/feedback/2026-10-05/logs/elev_check.txt differ diff --git a/docs/feedback/2026-10-05/logs/full/keep_display.log.gz b/docs/feedback/2026-10-05/logs/full/keep_display.log.gz new file mode 100644 index 0000000..4d0822b Binary files /dev/null and b/docs/feedback/2026-10-05/logs/full/keep_display.log.gz differ diff --git a/docs/feedback/2026-10-05/logs/full/lc_mcp.log.gz b/docs/feedback/2026-10-05/logs/full/lc_mcp.log.gz new file mode 100644 index 0000000..321cd9b Binary files /dev/null and b/docs/feedback/2026-10-05/logs/full/lc_mcp.log.gz differ diff --git a/docs/feedback/2026-10-05/logs/full/server.log.gz b/docs/feedback/2026-10-05/logs/full/server.log.gz new file mode 100644 index 0000000..4a462d7 Binary files /dev/null and b/docs/feedback/2026-10-05/logs/full/server.log.gz differ diff --git a/docs/feedback/2026-10-05/logs/keep_display-watchdog.txt b/docs/feedback/2026-10-05/logs/keep_display-watchdog.txt new file mode 100644 index 0000000..0ea47cb --- /dev/null +++ b/docs/feedback/2026-10-05/logs/keep_display-watchdog.txt @@ -0,0 +1,177 @@ +[2026-10-05 01:15:26] ForceDisc: skipping state check (real state was 'Disc') +[2026-10-05 01:15:26] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 01:15:58] tscon said: (no output file) | session 2 now: Active +[2026-10-05 01:15:58] render check: BitBlt=1 desktop=1920x1080 +[2026-10-05 08:35:05] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 08:35:37] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 08:35:37] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 08:35:37] WARN: session 2 still 'Disc' after tscon +[2026-10-05 08:40:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 08:40:36] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 08:40:36] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 08:40:36] WARN: session 2 still 'Disc' after tscon +[2026-10-05 08:45:05] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 08:45:37] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 08:45:37] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 08:45:37] WARN: session 2 still 'Disc' after tscon +[2026-10-05 10:39:25] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 10:39:57] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 10:39:57] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 10:39:57] WARN: session 2 still 'Disc' after tscon +[2026-10-05 10:40:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 10:40:37] tscon said: (no output file) | session 2 now: Active +[2026-10-05 10:40:37] render check: BitBlt=1 desktop=1920x1080 +[2026-10-05 20:35:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 20:35:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 20:35:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 20:35:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 20:40:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 20:40:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 20:40:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 20:40:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 20:45:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 20:45:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 20:45:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 20:45:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 20:50:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 20:50:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 20:50:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 20:50:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 20:55:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 20:55:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 20:55:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 20:55:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:00:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:00:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:00:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:00:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:05:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:05:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:05:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:05:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:10:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:10:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:10:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:10:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:15:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:15:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:15:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:15:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:20:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:20:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:20:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:20:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:25:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:25:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:25:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:25:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:30:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:30:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:30:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:30:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:35:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:35:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:35:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:35:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:40:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:40:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:40:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:40:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:45:03] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:45:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:45:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:45:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:50:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:50:34] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:50:34] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:50:34] WARN: session 2 still 'Disc' after tscon +[2026-10-05 21:55:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 21:55:34] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 21:55:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 21:55:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:00:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:00:34] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:00:34] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 22:00:34] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:05:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:05:34] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:05:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 22:05:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:10:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:10:34] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:10:34] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 22:10:34] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:15:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:15:34] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:15:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 22:15:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:20:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:20:34] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:20:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 22:20:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:25:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:25:34] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:25:35] render check: BitBlt=0 desktop=2560x1600 +[2026-10-05 22:25:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:30:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:30:21] tscon said: (no output file) | session 2 now: Active +[2026-10-05 22:30:22] render check: BitBlt=1 desktop=1872x921 +[2026-10-05 22:35:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:35:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:35:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 22:35:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:40:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:40:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:40:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 22:40:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:45:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:45:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:45:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 22:45:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:50:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:50:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:50:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 22:50:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 22:55:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 22:55:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 22:55:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 22:55:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 23:00:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 23:00:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 23:00:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 23:00:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 23:05:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 23:05:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 23:05:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 23:05:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 23:10:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 23:10:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 23:10:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 23:10:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 23:15:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 23:15:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 23:15:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 23:15:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 23:20:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 23:20:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 23:20:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 23:20:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 23:25:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 23:25:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 23:25:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 23:25:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 23:30:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 23:30:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 23:30:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 23:30:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 23:35:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 23:35:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 23:35:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 23:35:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 23:40:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 23:40:35] tscon said: (no output file) | session 2 now: Disc +[2026-10-05 23:40:35] render check: BitBlt=0 desktop=1600x900 +[2026-10-05 23:40:35] WARN: session 2 still 'Disc' after tscon +[2026-10-05 23:45:02] session 2 is Disc -> re-attaching to console via elevated tscon +[2026-10-05 23:45:30] tscon said: (no output file) | session 2 now: Active +[2026-10-05 23:45:30] render check: BitBlt=1 desktop=1872x921 diff --git a/docs/feedback/2026-10-05/logs/lunacy_baseline.txt b/docs/feedback/2026-10-05/logs/lunacy_baseline.txt new file mode 100644 index 0000000..e95e0a7 --- /dev/null +++ b/docs/feedback/2026-10-05/logs/lunacy_baseline.txt @@ -0,0 +1 @@ +3476 \ No newline at end of file diff --git a/docs/feedback/2026-10-05/logs/server-excerpt.txt b/docs/feedback/2026-10-05/logs/server-excerpt.txt new file mode 100644 index 0000000..b9aec56 --- /dev/null +++ b/docs/feedback/2026-10-05/logs/server-excerpt.txt @@ -0,0 +1,52 @@ +[DEBUG] 2026-10-04 20:36:15,784 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-04 22:25:28,514 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-04 22:36:09,828 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-04 22:39:20,384 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-04 23:10:05,506 [AALC] module\automation\automation.py:83: 使用后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-04 23:19:50,811 [AALC] module\automation\automation.py:83: 使用后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-04 23:30:39,791 [AALC] module\automation\automation.py:88: 使用前台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-04 23:47:18,039 [AALC] module\automation\automation.py:88: 使用前台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 01:12:23,477 [AALC] module\automation\automation.py:83: 使用后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 01:23:59,394 [AALC] module\automation\automation.py:83: 使用后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 09:16:59,056 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 09:39:19,197 [AALC] module\automation\automation.py:83: 使用后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 10:53:33,065 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 10:54:25,749 [AALC] module\automation\automation.py:83: 使用后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 11:23:14,474 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 13:49:21,322 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 14:44:59,051 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 14:59:08,556 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 17:27:51,254 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 17:40:47,222 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-05 17:49:33,449 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-06 11:36:06,293 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-06 11:38:08,017 [AALC] module\automation\automation.py:88: 使用前台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-06 11:46:49,310 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-11 11:47:52,478 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token) +[DEBUG] 2026-10-13 10:43:08,152 [AALC] module\automation\automation.py:93: 使用基于窗口移动的后台点击模块 +[lc_mcp] listening on 127.0.0.1:8765 (token: C:\Users\YWS-HHH\lc_mcp\token)