P2-8 镜牢局内决策写入审计日志

Browse Source
- 新增 lc_mcp/decisions.py:每个决策追加一行 JSON(time/stage/choice/reason + 细节),
  写失败只丢该行;summarize 按 stage/reason 计数
- TaskRunner 用 LCP_DECISIONS 把 task_*.decisions.jsonl 路径交给子进程,
  task_status 返回 decisions.counts,清理旧日志时一并删除
- 选队/键盘寻路/饰品/事件补丁记录各自决策;商店购买与卡包选择用只观察的补丁记录
  (购买按钮点中前的商品;卡包取自上游日志里的选择结果与权重)
- 抽出 _override 统一临时替换 auto 方法并在结束时还原

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yws
2026-11-14 07:11:30 +00:00
co-authored by Claude Opus 5.5
parent 4376d9cfb2
commit 51525722cd
12 changed files with 575 additions and 40 deletions
+2 -1
View File
@@ -87,7 +87,8 @@ TOOLS = [
'inputSchema': _obj({'task': {'type': 'string', 'enum': sorted(TASKS)}, 'inputSchema': _obj({'task': {'type': 'string', 'enum': sorted(TASKS)},
'exp': _NUM, 'thread': _NUM, 'times': _NUM, 'count': _NUM}, ['task'])}, 'exp': _NUM, 'thread': _NUM, 'times': _NUM, 'count': _NUM}, ['task'])},
{'name': 'task_status', 'description': '启动 run_task 前检查占用,启动后轮询此工具监控,避免逐帧截图和重复启动。' {'name': 'task_status', 'description': '启动 run_task 前检查占用,启动后轮询此工具监控,避免逐帧截图和重复启动。'
'返回 idle/running/succeeded/failed/stopped、日志及异常。' '返回 idle/running/succeeded/failed/stopped、日志及异常;'
'decisions.counts 按阶段统计选队/寻路/卡包/饰品/事件/商店的决策理由。'
'succeeded 也要看 errors 和 pending_restore;running 出现 stall 应 stop_task 并确认停止后排障;' 'succeeded 也要看 errors 和 pending_restore;running 出现 stall 应 stop_task 并确认停止后排障;'
'stopped/退出码130 表示用户停止,不自动重跑。', 'stopped/退出码130 表示用户停止,不自动重跑。',
'inputSchema': _obj({'lines': {'type': 'number', 'default': 30}})}, 'inputSchema': _obj({'lines': {'type': 'number', 'default': 30}})},