Files
cnc_wams/web-rtcp-5axis-sim-plan/working_run/06-run-implementation-traceability-matrix-and-next-steps.md

150 lines
5.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 06 RUN 实施完成情况矩阵与接续工作
生成时间2026-06-22
## 1. 本轮执行范围
`05-run-program-implementation-detailed-steps.md` 核对并补强当前实现,本轮完成:
```text
1. 建立 05 阶段完成情况矩阵。
2. 补强 INI definition contract validation。
3. 修正普通 RUN 的 EMC_TASK_PLAN_RUN 起始行为 line=0。
4. 补充 INI runtime 测试断言。
5. 执行 node smoke 验证。
6. 记录剩余接续工作。
```
## 2. 本轮代码改动
### 2.1 INI contract validation 补强
更新:
```text
app/src/runtime/linuxcnc-ini-runtime.js
tests/node/verify_linuxcnc_ini_runtime.mjs
```
补强内容:
```text
1. parseLinuxCncIni() 现在保留 sourceText。
2. 解析并输出 emcmot.module / emcmot.servoPeriodNs。
3. 解析并输出 task.module / task.cycleTimeSeconds。
4. emcio.toolTable 保持结构化输出。
5. applyIniConfigToProfile() 将 emcmot/task/emcio 写入 profile。
6. validateIniConfig() 增加 05 要求的关键 gate
- required sections: [EMC], [DISPLAY], [RS274NGC], [KINS], [HAL], [HALUI], [TRAJ], [EMCMOT], [TASK], [EMCIO]
- COORDINATES 必须是 XYZAC 或 XYZBC
- JOINTS 必须是 5
- JOINT_0..JOINT_4 必须存在
- KINEMATICS 必须包含 sparm=identityfirst
- M428/M429/M430 remap 必须完整
- HAL_PIN_VARS=1 必须存在
- HALCMD 必须连接 motion.analog-out-03 与 motion.switchkins-type
- SERVO_PERIOD / CYCLE_TIME / TOOL_TABLE 必须存在
```
### 2.2 RUN 起始行修正
更新:
```text
app/src/state/store.js
```
修正:
```text
普通 RUN 发送 EMC_TASK_PLAN_RUN line=0。
不再用 activeLine - programStartLine 推导普通 RUN 起始行。
run-from-line 后续应作为独立功能处理。
```
## 3. 完成情况矩阵
| 05 阶段 | 状态 | 证据 | 备注 |
| --- | --- | --- | --- |
| 阶段 0建立当前状态基线 | 完成 | `smoke:node` 完整通过 | 当前基线可复现 |
| 阶段 1INI definition contract | 完成 | `verify_linuxcnc_ini_runtime.mjs` | 本轮补强 section/字段 validation |
| 阶段 2绑定 kinematics runtime | 完成 | `verify_linuxcnc_kinematics_runtime.mjs`, `verify_run_preconditions.mjs` | RUN gate 检查 module/frame source |
| 阶段 3machine-file staging | 完成 | `verify_machine_file_staging.mjs` | selected G-code 与 wasmProgramPath 同步 |
| 阶段 4初始化 task/HAL session | 完成 | `verify_linuxcnc_task_hal_runtime.mjs` | openProgram/session/status 链路通过 |
| 阶段 5RUN preconditions gate | 完成 | `verify_run_preconditions.mjs` | 仍可继续扩展更细 ON/AUTO/homed 阻断文案 |
| 阶段 6RUN command sequence | 完成 | `verify_run_feedback_loop.mjs` | 本轮修正普通 RUN line=0 |
| 阶段 7taskHalStatusLoop | 完成 | `verify_run_feedback_loop.mjs` | tick/history/STOP 断言通过 |
| 阶段 8统一 TASK_HAL_STATUS_APPLIED | 完成 | `verify_run_feedback_loop.mjs`, `verify_rtcp_store.mjs` | feedback history 保留 task/HAL/motion source |
| 阶段 9STOP/ABORT/PAUSE/RESUME/STEP | 部分完成 | `verify_linuxcnc_task_hal_runtime.mjs` | PAUSE/RESUME 有测试STOP 有 feedback-loop 测试STEP/ABORT 仍需专门断言 |
| 阶段 10UI 显示与交互 | 部分完成 | 现有 browser smoke 未在本轮执行 | 仍需 07 浏览器证据 case |
| 阶段 11full execution boundary | 完成 | `verify_full_execution_boundary.mjs`, native audit | web simulation boundary 通过 |
| 阶段 12Node smoke 集成 | 完成 | `npm --prefix web-rtcp-5axis-sim-plan/app run smoke:node` | 完整通过 |
| 阶段 13浏览器证据采集 | 未完成 | 无新 JSON/截图 | 下一步工作 |
## 4. 本轮验证结果
通过:
```bash
node web-rtcp-5axis-sim-plan/tests/node/verify_linuxcnc_ini_runtime.mjs
npm --prefix web-rtcp-5axis-sim-plan/app run build
npm --prefix web-rtcp-5axis-sim-plan/app run smoke:node
```
关键输出:
```text
linuxcnc_ini_runtime_smoke=ok
gmoccapy_static_build=ok
run_feedback_status_loop_smoke=ok
linuxcnc_task_hal_runtime_smoke=ok
full_execution_boundary_smoke=ok
machine_file_staging_smoke=ok
rtcp_store_smoke=ok
profile_boundary_smoke=ok
```
`smoke:node` 已完整通过。
## 5. 剩余接续工作
下一步建议优先做浏览器证据采集:
```text
1. 扩展 qa/web-rtcp-5axis-site-test/capture-toolpath-preview-cases.mjs。
2. 新增 07-run-preconditions-and-feedback case。
3. 浏览器执行 POWER/HOME/AUTO/RUN。
4. 采集 t=0.2s / 0.5s / 1.0s / 2.0s / 5.0s state。
5. 断言 taskHalStatusLoop.tickCount 和 programRuntimeFeedbackHistory 增长。
6. 断言 feedback sourceMode 不含 fixture-line-playback。
7. 输出 JSON 与截图:
qa/web-rtcp-5axis-site-test/output/run-preconditions-feedback.json
qa/web-rtcp-5axis-site-test/screenshots/run-preconditions-feedback/*.png
```
随后补强控制类测试:
```text
1. ABORT 后 loop active=falserunState/stopped status 正确。
2. STEP 在 task/HAL loaded 时 sourceMode 仍是 linuxcnc-task-motion-hal-wasm。
3. RUN gate 对 machine ON / AUTO / homed / opened-file 增加更细粒度失败断言。
4. taskHalStatusLoop 的 taskPeriodNs/servoPeriodNs 从 INI CYCLE_TIME/SERVO_PERIOD 派生,而不是只使用默认值。
5. xyzbc-trt 增加对称 RUN status loop 测试。
```
## 6. 当前结论
当前 RUN 主链路已经满足 05 的 node 侧核心完成标准:
```text
INI contract ready
-> profile/INI/kinematics 一致
-> machine files staged
-> selected G-code opened by task/HAL session
-> RUN sends LinuxCNC task commands
-> taskHalStatusLoop continuously runCycles/readStatus
-> UI/store consumes TASK_HAL_STATUS_APPLIED snapshots
```
尚未完成的是浏览器端 JSON/截图证据,以及 ABORT/STEP/xyzbc 对称测试的补强。