maafw-debug
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMaaFW 调试与验收
MaaFW Debugging and Acceptance
标注 TODO 的节为实践待补的经验样本(增量内容,不影响可用性);分诊状态见 skills/README.md。
定位:开发态、设备在线的实时调试与验收(验收环节的冷启动 / 重连 / 断线恢复由开发者主动制造离线与重连窗口,属验收手段而非离开开发态)。字段精确语义(字段名、参数、默认值、版本支持)与调试命令一律路由 MaaLLMWiki 版本锁定的协议原文(2.4-控制方式说明、3.1-任务流水线协议、3.3-ProjectInterfaceV2);运行工具的命令与结果字段路由所选运行工具自身文档(Agent 自主默认 maafw-live,见 references/tooling.md)——协议原文不含工具命令。两类来源不可达时标记"未验证"。事后日志与证据诊断(用户日志、Sentry、历史记录)归 MaaEvidenceKit 的 ,不是本 skill。
maa-evidenceSections marked with TODO are experience samples to be supplemented through practice (incremental content that does not affect usability); for triage status, see skills/README.md.
Scope: Real-time debugging and acceptance for MaaFW applications in development state with online devices (cold start / reconnection / disconnection recovery during acceptance are actively created by developers as acceptance methods, and do not mean leaving the development state). The precise semantics of fields (field names, parameters, default values, version support) and debugging commands are all routed to the version-locked protocol originals in MaaLLMWiki (2.4-Control Method Description, 3.1-Task Pipeline Protocol, 3.3-ProjectInterfaceV2); commands and result fields of runtime tools are routed to the documentation of the selected runtime tool itself (Agent defaults to maafw-live autonomously, see references/tooling.md) — the protocol originals do not include tool commands. If both sources are unreachable, mark as "unverified". Post-hoc log and evidence diagnosis (user logs, Sentry, historical records) belongs to in MaaEvidenceKit, not this skill.
maa-evidence硬护栏
Hard Guardrails
- 证据优先:每个诊断结论必须有实时观测证据——当前帧、识别命中/未命中与得分、日志、box 与落点比对;「可能是」必须转成可验证假设再测,不许凭猜下结论(与 maafw-pipeline 的探索优先同源)。
- 一次一个变量:阈值 / ROI / 模板 / 参数每次只改一个,改完立即复测并留记录;多处同时改后结果变化无法归因——调试态第一纪律。
- 走框架链路:诊断用截图与点击必须走框架截图链路(观测底座 / 框架截图 API / 运行工具),不用外部截图工具——分辨率与图像空间必须与识别输入一致(像素空间一致原则继承 maafw-pipeline 素材标准)。
- 只定位不修复:本 skill 产出「定位结论 + 证据」。边界:为验证假设可临时改并立即复测(硬护栏 2「一次一个变量」正是此用法),但交付物仍是结论 + 证据,修复落盘走交接(识别/流程 → maafw-pipeline,接线/选项 → maafw-interface,custom → maafw-custom;修改轨已含 ROI 微调这类小修)——不边定位边做结构性改动。
- 判定分级:区分调用成功(命令是否执行完)、任务成功(任务级结果 + 实际识别命中)、业务验收成功(功能行为符合预期)——三层互不顶替,调用层信号(外层 ok / 退出码)不能当任务或验收结论;具体判定字段与退出码语义随工具(maafw-live 见 tooling.md 判定要点)。一次跑通 ≠ 稳定——验收要重复、含冷启动与重连。
- 调试现场及时留存:调试过程中的关键帧及时升格进关键帧库(观测底座留存),现场过了就过了;脱机的事后分析转 。
maa-evidence
- Evidence First: Every diagnostic conclusion must be supported by real-time observation evidence — current frame, recognition hit/miss and score, logs, comparison between box and click position; "maybe" must be converted into a verifiable hypothesis before testing, and conclusions based on guessing are prohibited (aligned with the exploration-first principle of maafw-pipeline).
- One Variable at a Time: Only one of threshold / ROI / template / parameter is changed at a time, and retest immediately after the change with records kept; result changes from simultaneous multiple changes cannot be attributed — this is the top discipline in debugging mode.
- Use Framework Pipeline: Screenshots and clicks for diagnosis must go through the framework's screenshot pipeline (observation base / framework screenshot API / runtime tool), external screenshot tools are not allowed — resolution and image space must be consistent with recognition input (the pixel space consistency principle inherits from maafw-pipeline asset standards).
- Position Only, Do Not Fix: This skill produces "root cause conclusion + evidence". Boundary: temporary changes for hypothesis verification followed by immediate retest are allowed (Hard Guardrail 2 "One Variable at a Time" is exactly for this purpose), but the deliverable is still conclusion + evidence. Fix implementation goes through handover (recognition/flow → maafw-pipeline, integration/options → maafw-interface, custom → maafw-custom; minor adjustments like ROI fine-tuning are already included in the modification track) — no structural changes while positioning.
- Judgment Hierarchy: Distinguish between call success (whether the command finishes execution), task success (task-level result + actual recognition hit), and business acceptance success (functional behavior meets expectations) — the three layers cannot replace each other, and call-layer signals (outer ok / exit code) cannot be used as task or acceptance conclusions; specific judgment fields and exit code semantics depend on the tool (for maafw-live, see judgment points in tooling.md). A single successful run ≠ stability — acceptance requires repeated runs, including cold start and reconnection scenarios.
- Preserve Debugging Scenes Promptly: Key frames during debugging should be promptly promoted to the key frame library (preserved by the observation base), as the scene cannot be reproduced once passed; offline post-hoc analysis is transferred to .
maa-evidence
工作流
Workflow
0. 分诊(先分层再动手)
0. Triage (Stratify Before Taking Action)
按症状定位到五层之一再进对应层流程;跨层症状按最外层先排查:
| 症状 | 层 |
|---|---|
| 设备连不上 / 任务起不来 / 启动即失败 / 选项没生效 | 配置层 |
| 某节点不命中 / 命中错 | 识别层 |
| 识别命中但点击没落地 / 滑动没动 / 落点偏移 | 动作层 |
| 卡死 / 死循环 / 走到不该走的节点 / 提前终止 | 流程层 |
| 跑通了但功能行为不对 / 交付前检查 | 验收层 |
排障树(症状 → 检查项 → 常见根因)见 references/diagnosis-tree.md;各层检查的取证手段与工具见 references/tooling.md——硬要求不随工具变,工具可替换。
进层之前先定执行工具(tooling.md「工作模式」):Agent 自主默认 maafw-live,动手前 / / 自检;未安装或不可用时按「工具替换判定」选定替代、并在定位结论里明说缺哪项能力——工具选择先于任何层内动作。
versionenvprobeLocate the symptom to one of the five layers before entering the corresponding layer's process; for cross-layer symptoms, troubleshoot from the outermost layer first:
| Symptom | Layer |
|---|---|
| Device cannot connect / task cannot start / fails immediately at startup / options do not take effect | Configuration Layer |
| A node does not hit / hits the wrong target | Recognition Layer |
| Recognition hits but click does not land / swipe does not move / click position is offset | Action Layer |
| Stuck / infinite loop / goes to an unexpected node / terminates early | Flow Layer |
| Runs through but functional behavior is incorrect / pre-delivery check | Acceptance Layer |
The troubleshooting tree (symptom → check items → common root causes) can be found in references/diagnosis-tree.md; for evidence collection methods and tools for each layer's checks, see references/tooling.md — hard requirements do not change with tools, and tools are replaceable.
Before entering a layer, first determine the execution tool (see "Working Modes" in tooling.md): Agent defaults to maafw-live autonomously, and perform self-checks with / / before starting; if the tool is not installed or unavailable, select an alternative according to "Tool Replacement Judgment", and clearly state which capability is missing in the positioning conclusion — tool selection precedes any in-layer actions.
versionenvprobe1. 配置层(设备与启动链路)
1. Configuration Layer (Device and Startup Pipeline)
先静态后动态:有 dev-tools 的项目先 清结构错误,再谈运行时行为。「选项没生效」先查 option 适用性过滤(头号原因,经验值;机制见 maafw-interface),再查接线。设备连通、任务入口、子进程双日志等检查项、协议字段核对与常见根因见排障树配置层细节。
pnpm checkStatic first, then dynamic: For projects with dev-tools, first run to clear structural errors before discussing runtime behavior. For "options not taking effect", first check option applicability filtering (the top cause based on experience; mechanism see maafw-interface), then check integration. For check items such as device connectivity, task entry, and dual logs of child processes, protocol field verification, and common root causes, see the configuration layer details in the troubleshooting tree.
pnpm check2. 识别层(单节点验证)
2. Recognition Layer (Single-Node Verification)
单节点验证 + 截图 + hits/box 期望——命令查所选工具文档(默认 maafw-live: 识别单测、 真机执行动作半; 从 entry 起跑会继续走 next / on_error、不是单节点验证——隔离与副作用边界见 tooling.md 默认执行路径),节点字段语义查 3.1 协议。第一问永远是目标在不在帧里,再谈 ROI / 阈值 / 模板;一次一个变量(硬护栏 2)。判据、经验值与识别类型适配见排障树识别层细节。
reco--actrunSingle-node verification + screenshot + hits/box expectations — for commands, refer to the selected tool's documentation (default maafw-live: for recognition unit test, for half-action execution on real device; starts from entry and continues to next / on_error, which is not single-node verification — for isolation and side effect boundaries, see the default execution path in tooling.md). For node field semantics, refer to protocol 3.1. The first question is always whether the target is in the frame, before discussing ROI / threshold / template; one variable at a time (Hard Guardrail 2). For criteria, empirical values, and recognition type adaptation, see the recognition layer details in the troubleshooting tree.
reco--actrun3. 动作层(识别成功 ≠ 点击生效)
3. Action Layer (Recognition Success ≠ Effective Click)
第一问永远是「点到哪了」:识别 box vs 实际落点逐像素比对,再谈 target / offset。target 语义、inverse 陷阱、两坑治法与重试门控见排障树动作层细节。
The first question is always "where did it click": compare the recognition box with the actual click position pixel by pixel, before discussing target / offset. For target semantics, inverse traps, solutions to two common pitfalls, and retry gating, see the action layer details in the troubleshooting tree.
4. 流程层(卡死归因)
4. Flow Layer (Stuck Cause Attribution)
用执行模型归因(执行模型全文见 maafw-pipeline SKILL.md,这是归因的唯一地图)。最常见归因错误:想调某节点被识别的等待时长,改的是它上一节点的 / 。死循环三查、提前终止与改名失联面清单见排障树流程层细节。
timeouton_errorUse the execution model for attribution (the full execution model can be found in maafw-pipeline SKILL.md, which is the only map for attribution). The most common attribution error: when you want to adjust the waiting time for a node to be recognized, you modify the / of its previous node. For three checks for infinite loops, early termination, and renamed disconnection surface list, see the flow layer details in the troubleshooting tree.
timeouton_error5. 验收层(端到端)
5. Acceptance Layer (End-to-End)
完备性四问(尤其「不在目标场景时的行为已显式定义」)+ 判定分级(硬护栏 5)+ 重复跑(含冷启动 / 重连 / 断线恢复);验收分两档——Pipeline 业务流程验收(运行工具可承担,结论须记录前置条件与 Agent 状态)与目标 Client 集成验收(实际经 Client 的 pretask、装配、Agent 启动与任务入口,工具跑通不能替代——边界见 tooling.md)。override 生效验证与测试沉淀见排障树验收层细节。
Four completeness questions (especially "behavior when not in the target scenario is explicitly defined") + judgment hierarchy (Hard Guardrail 5) + repeated runs (including cold start / reconnection / disconnection recovery); acceptance is divided into two levels — Pipeline business process acceptance (can be undertaken by runtime tools, conclusions must record preconditions and Agent status) and target Client integration acceptance (actually goes through the Client's pretask, assembly, Agent startup, and task entry, tool run-through cannot replace it — boundary see tooling.md). For override effect verification and test precipitation, see the acceptance layer details in the troubleshooting tree.
6. 交接
6. Handover
定位结论必须包含:症状 → 层 → 根因假设 → 证据(帧/日志/得分/比对)→ 建议修复方向 → 交接目标 skill。修复转 maafw-pipeline / maafw-interface / maafw-custom;离线证据分析转 maa-evidence。
The positioning conclusion must include: symptom → layer → root cause hypothesis → evidence (frame/log/score/comparison) → suggested fix direction → target skill for handover. Fixes are transferred to maafw-pipeline / maafw-interface / maafw-custom; offline evidence analysis is transferred to maa-evidence.
深入阅读(按需)
Further Reading (On Demand)
- references/diagnosis-tree.md — 排障树:症状 → 检查项 → 常见根因(配置层细节、静默失联面清单、阈值与 ROI 经验值)
- references/tooling.md — 取证手段与工具矩阵:工作模式、maafw-live 默认执行路径与判定要点、替代工具能力对应、各层检查要点与工具替换判定
- references/diagnosis-tree.md — Troubleshooting Tree: symptom → check items → common root causes (configuration layer details, silent disconnection surface list, threshold and ROI empirical values)
- references/tooling.md — Evidence Collection Methods and Tool Matrix: working modes, maafw-live default execution path and judgment points, alternative tool capability mapping, check points for each layer and tool replacement judgment
TODO(实践待补——经验样本类增量,唯一清单)
TODO (To Be Supplemented Through Practice — Incremental Experience Samples, Sole Checklist)
- 排障树各分支的日志判读细则(日志片段 → 结论的判读样本)
- 识别慢(性能)排查分支;ColorMatch / And / Or / 自训模型节点的调试要点
- 各层最小复现标准流程与取证快照清单(含流程层「最小取证序列」模板)
- 验收记录模板(验证对象、范围、实际结果、证据、实现指纹——对齐 state-plan 的 tested 语义,待其 schema 冻结)
排障树 / 工具文档中的内联 TODO 仅为位置标记,以本节为唯一清单与完成判据。
- Log interpretation rules for each branch of the troubleshooting tree (log snippet → conclusion interpretation samples)
- Recognition slowdown (performance) troubleshooting branch; debugging points for ColorMatch / And / Or / self-trained model nodes
- Standard minimum reproduction process and evidence snapshot checklist for each layer (including the "minimum evidence sequence" template for the flow layer)
- Acceptance record template (verification object, scope, actual result, evidence, implementation fingerprint — aligned with the tested semantics of state-plan, pending its schema freeze)
Inline TODOs in the troubleshooting tree / tool documentation are only position markers, and this section is the sole checklist and completion criterion.