用户问"日志都上传了吗", 一查发现确有遗漏: - server.log (427KB, 写至 10-13) 与 keep_display.log (看门狗, 12.5KB), lc_mcp.log 此前只上传了 runs/ 下的 20 份任务日志, 这三个漏了。 - 10-02/10-03 那轮会话遗留在仓库根目录的测试产物从未提交, 一直显示为未跟踪。 本次补上: - logs/full/ 增加 server.log.gz / keep_display.log.gz / lc_mcp.log.gz - logs/keep_display-watchdog.txt 为看门狗日志全文(177 行), 完整记录了 "RDP 一断开就提权 tscon 切回物理 console" 的每次触发, 即被要求关闭的那支脚本的行为证据。 - logs/server-excerpt.txt 为服务日志摘录(52 行)。 - 10-02 的测试产物归档到 docs/feedback/2026-10-02/validation/ 并附 README 说明, PHYSICAL_INPUT_CHANGE.md 归到 2026-10-03/。 注: tests/*.py 归档后不在 tests/ 目录, 不会被 unittest discover 收集; 此为保留证据链的有意选择, 已在 README 中注明。
46 lines
2.1 KiB
Python
46 lines
2.1 KiB
Python
"""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)
|