Files
cnc_wams/web-rtcp-5axis-sim-plan/docs/development-continuation.md

1185 lines
46 KiB
Markdown
Raw Permalink 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.
# 5 轴数控系统 Web 仿真编写过程接续文档
生成时间2026-06-20 CST
## 1. 当前结论
已确定:
- Web 前端界面可实现;
- 首选界面风格为 `gmoccapy_5_axis.png`
- 前端不使用 React/Vue 等框架,采用原生 HTML/CSS + TypeScript/JavaScript ES modules
- 3D 使用 Three.js
- LinuxCNC Python GUI 只做界面参考;
- LinuxCNC C/C++/WASM/source-derived boundary 才能作为 CNC 语义和五轴运动学依据。
当前准备文档已完成:
```text
README.md
docs/implementation-plan.md
docs/technical-roadmap.md
docs/program-implementation-guide.md
docs/development-continuation.md
docs/traceability-matrix.md
docs/linuxcnc-python-gui-reference.md
docs/linuxcnc-gui-reference-gallery.md
```
## 2. 下一轮直接开工任务
下一轮不再继续扩展方案,直接进入实现。
第一批任务:
```text
M1-web-shell-gmoccapy
```
状态:
```text
completed_with_build_gate
```
目标:
- 创建 `app/`
- 创建原生 HTML/CSS/TS 项目;
- 实现 gmoccapy 风格静态 shell
- 复制必要的参考图路径到 docs
- 加 browser smoke 验证页面区域存在。
已补齐 M1 工程化验收:
- `app/tsconfig.json` 已创建;
- `npm run build` 已可输出静态产物;
- build 产物目录 `app/dist/` 已加入 `.gitignore`
- browser smoke 已检查无 React/Vue/Angular/Svelte 依赖和 DOM 标记。
## 3. M1 任务拆分
### M1.1 初始化 app
创建:
```text
app/index.html
app/package.json
app/tsconfig.json
app/src/main.ts
app/src/styles/gmoccapy.css
```
要求:
- 不安装 React/Vue
- 可使用 Vite
- `npm run dev` 能启动;
- `npm run build` 能输出静态产物。
### M1.2 静态 shell
创建:
```text
app/src/ui/gmoccapy-shell.ts
```
渲染区域:
```text
titlebar
preview
dro
gcode
status-sidebar
info-tabs
override
spindle-coolant
bottom-controls
```
### M1.3 CSS layout
目标:
- 视觉接近 `gmoccapy_5_axis.png`
- 黑底 preview
- 绿色 DRO
- 灰色面板;
- 橙色 override
- 右侧竖向大按钮;
- 底部大按钮栏。
### M1.4 smoke
创建:
```text
tests/browser/gmoccapy_shell_smoke.html
tests/browser/verify_gmoccapy_shell_browser.sh
```
检查:
- 页面加载;
- 关键 `data-region` 存在;
- DRO 文本非空;
- G-code rows 存在;
- preview 容器非空;
- 无 React/Vue 依赖标记。
当前 gate
```text
gmoccapy_static_build=ok
gmoccapy_shell_smoke=ok
```
## 4. M2 任务
```text
M2-state-and-controls
```
状态:
```text
completed_with_rtcp_frame_and_control_wiring
```
目标:
- 实现 store
- 实现 Run/Stop/Pause/Step action
- G-code active line
- DRO state update
- Node smoke。
本轮追加 RTCP 最小可验证链路:
- 新增 `xyzac-trt` profile source reference
- 新增 `web-rtcp-5axis-motion-frame`
- store 输出 `axisPose``jointPose``tcpPose``toolAxisVector``rtcpFrame`
- 右侧 TCP/IDENTITY 按钮可切换 `rtcpState=on/off`
- DRO 和 info tabs 显示 TCP pose、tool axis vector、RTCP frame readiness
- browser smoke 验证 RTCP DOM 和状态同步;
- node smoke 验证 frame/store 行为。
本轮继续补齐 M2 控件接线:
- preview X/Y/Z/Fit/Clear 按钮接入 store
- Rapid Override / Feed Rate 加减按钮接入 store
- Spindle override 加减按钮接入 store
- Flood / Mist 冷却按钮接入 store
- Reload / Home / Full 底部按钮接入 store
- `operatorMessage` 记录最近一次仿真操作;
- Node smoke 和 browser smoke 覆盖上述控制链路。
边界说明:
```text
sourceMode=fixture-ui-only
semanticBoundary=fixture_frame_ui_plumbing_not_linuxcnc_kinematics_proof
linuxCncKinematicsReady=false
promotionAllowed=false
```
也就是说Web 仿真界面现在已经具备 RTCP 状态链路和显示链路,但尚未把 LinuxCNC/source-derived 五轴运动学 WASM 接入为最终语义源。
## 5. M3 任务
```text
M3-threejs-preview
```
状态:
```text
completed_with_canvas_smoke
```
目标:
- Three.js canvas
- 基础五轴机床;
- tool marker
- simple path
- canvas nonblank browser smoke。
M3 需要消费 M2 的 `rtcpFrame`
- Three.js tool marker 使用 `tcpPose`
- 刀轴显示使用 `toolAxisVector`
- RTCP on/off 需要在预览中产生可见姿态差异;
- canvas smoke 需要检查 frame 与预览数据同步。
已完成:
- 新增 `app/src/vendor/three/three.module.js``three.core.js`
- 新增 `app/src/visualization/five-axis-scene.js`
- gmoccapy preview 区域由真实 WebGL canvas 渲染;
- 预览显示基础五轴工作区、工作台、刀具/TCP marker、刀轴和刀路
- Three.js canvas 消费 `tcpPose``toolAxisVector``rtcpState``rtcpFrame`
- browser smoke 验证 canvas nonblank、scene objects、path points、RTCP on/off 同步和 STEP 后 TCP pose 更新。
当前 gate
```text
gmoccapy_static_build=ok
rtcp_store_smoke=ok
gmoccapy_shell_smoke=ok
```
## 6. M4 任务
```text
M4-profile-and-linuxcnc-boundary
```
状态:
```text
completed_with_profile_boundary_smoke
```
目标:
- `xyzac-trt` profile
- source reference map
- PyVCP/HAL panel schema
- LinuxCNC adapter 接入点;
- traceability update。
已完成:
- 扩展 `app/src/profiles/xyzac-trt.js`,记录 INI、PyVCP XML、postgui HAL、generated HAL、tool table、remap、switchkins type、HAL pins、offsets、sample programs
- 进一步按 LinuxCNC `xyzac-trt.ini`/`xyzac-trt_cmds.hal`/`*.tbl`/`428-430remap.ngc` 整理 machine name、DISPLAY/RS274NGC/TRAJ、axis/joint limits、HALCMD nets、HALUI MDI commands、tool table 条目;
- 新增 `app/src/profiles/source-reference-map.js`,建立 `xyzac-trt` source/config/reference map
- 新增 `app/src/panel-schema/xyzac-trt-pyvcp.js`,把 `xyzac-trt.xml``switchkins_postgui.hal` 的 SWITCHKINS 控件整理为 Web panel schema
- 新增 `app/src/runtime/linuxcnc-boundary-adapter.js`,作为后续 LinuxCNC interpreter/kinematics WASM 的接入点;
- store 输出 `linuxCncBoundaryAdapter``linuxCncBoundaryReadiness`
- info tabs 显示 adapter、panel schema、source map 和 boundary readiness
- 新增 `tests/node/verify_profile_boundary.mjs`,并接入 `npm run smoke:node`
- browser smoke 验证 LinuxCNC boundary adapter/schema/readiness DOM 状态。
边界说明:
```text
sourceMapBoundary=profile_source_map_only_not_runtime_proof
panelSchemaBoundary=pyvcp_hal_schema_reference_only
adapterBoundary=adapter_entrypoint_only_runtime_not_connected
linuxCncKinematicsReady=false
promotionAllowed=false
```
说明:
```text
M4 现在可视为在 profile/source-map/panel-schema/adapter 层面完全满足;
但这不等于 LinuxCNC interpreter/kinematics runtime 已接入。
```
## 7. M5 任务
```text
M5-operator-program-workflow
```
状态:
```text
completed_with_operator_program_smoke
```
目标:
- 上电、急停、自动、手动、JOG、MDI、复位等操作
- 加载 G-code 文件;
- 刀具预览;
- 执行程序并显示执行的当前行。
已完成:
- store 新增 `machine.powerOn``machine.estopActive``machine.mode`、JOG/MDI/reset 状态;
- 右侧按钮栏新增 POWER、E-STOP、RESET、AUTO、MANUAL、JOG、MDI
- 底部控制栏新增本地 G-code 文件输入、JOG X/Y、MDI run
- `LOAD_PROGRAM` 可从浏览器 FileReader 或 public dispatch 加载 operator G-code 文本;
- G-code 面板显示程序来源、当前执行行,并按当前行高亮;
- Three.js 预览区域新增刀具预览卡,显示 T 号、直径、长度和 holder
- RUN/STEP 会在上电且非急停状态下推进当前行,未上电时明确 blocked
- node/browser smoke 覆盖上电、加载程序、运行、高亮当前行、JOG、MDI、复位和急停。
边界说明:
```text
operatorWorkflowBoundary=browser_ui_runtime_fixture
gcodeLoadBoundary=file_text_staging_only
programExecutionBoundary=fixture_line_playback_not_linuxcnc_interpreter
linuxCncKinematicsReady=false
promotionAllowed=false
```
## 8. 每批完成后必须更新
每批完成后更新:
- 本文件的“当前状态”;
- `docs/traceability-matrix.md`
- 如果新增 UI 或 runtime 约束,更新 `docs/program-implementation-guide.md`
- 如果新增参考来源,更新 `docs/linuxcnc-python-gui-reference.md``docs/linuxcnc-gui-reference-gallery.md`
## 9. 当前状态
```text
status=M24_xyzbc_trt_kinematics_parity_complete
active_style=gmoccapy_5_axis
frontend_framework=none
ui_stack=html_css_typescript_es_modules
preview_stack=threejs
semantic_boundary=linuxcnc_owned
latest_batch=M24-xyzbc-trt-kinematics-parity
latest_gate=xyzac_trt_kinematics_runtime=ok,xyzbc_trt_kinematics_runtime=ok,xyzbc_b_axis_tcp_pose_preserved=1,tool_db_web_simulation_smoke=ok,staged_tool_tbl_loaded=1,tool_db_query_edit_save=1,tool_db_t_m6_g43_state=1,tool_db_memory_fallback_save=1,host_tool_db_process=0,tool_db_user_m_simulation_smoke=ok,tool_db_process_ready_web_simulation_only=1,external_user_m_process_ready_web_simulation_only=1,arbitrary_user_m_blocked=1,host_process_execution=0,host_native_boundary_ui=ok,hardware_drive_false_visible=1,host_realtime_false_visible=1,host_external_user_m_false_visible=1,host_tool_db_false_visible=1,threejs_program_preview_mode=program-preview-and-tool-execution,threejs_preview_source=linuxcnc-interpreter-wasm_or_linuxcnc-machine-file-remap-wasm,threejs_toolpath_preview_source=linuxcnc_interpreter_canonical_motion,threejs_tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback,threejs_path_fit_bounds=ok,threejs_current_segment_highlight=ok,threejs_rapid_feed_visual_distinction=ok,threejs_no_gcode_semantics_generation=ok,threejs_canvas_nonblank_desktop=ok,threejs_canvas_nonblank_mobile=ok,opfs_unavailable_detected=1,opfs_fallback_current_page_lifecycle_only=1,non_opfs_workflows_still_pass=1,public_http_smoke_no_uncaught_exception=1,real_linuxcnc_5axis_program_cases_smoke=ok,native_task_hal_source_artifact_audit=ok,task_hal_web_simulation_boundary_consistent=1,full_execution_boundary_smoke=ok,linuxcnc_kinematics_runtime_smoke=ok,linuxcnc_interpreter_runtime_smoke=ok,linuxcnc_ini_runtime_smoke=ok,full_linuxcnc_5axis_source_node_smoke=ok,machine_file_staging_smoke=ok,five_axis_session_smoke=ok,profile_boundary_smoke=ok,rtcp_store_smoke=ok,gmoccapy_shell_smoke=ok,gmoccapy_dist_smoke=ok
rtcp_ui_state=implemented_browser_worker_and_node_kinematics_wasm_frame_with_fixture_fallback
control_wiring=power_estop_reset_auto_manual_jog_mdi_run_stop_pause_step_overrides_coolant_spindle_preview_home_reload_full
gcode_loading=implemented_browser_file_text_staging_with_linuxcnc_interpreter_execution
linuxcnc_5axis_gcode_sources=implemented_and_guarded_to_linuxcnc_source_manifest_trt_demos_only
linuxcnc_source_program_case_coverage=implemented_boat_xyzac_boat_xyzbc_impeller_xyzac_switchkins_xyzbc_switchkins_guarded_cases
program_current_line=implemented_linuxcnc_canonical_motion_highlight_with_fixture_fallback
tool_preview=implemented_tool_card_and_threejs_marker
threejs_preview=implemented_program_preview_and_tool_execution_with_fit_bounds_current_segment_and_rapid_feed_arc_layers
profile_source_map=implemented_xyzac_trt_and_xyzbc_trt
profile_switching=implemented_xyzac_trt_and_xyzbc_trt_with_runtime_reload
pyvcp_hal_schema=implemented_xyzac_trt_switchkins
linuxcnc_boundary_adapter=kinematics_and_interpreter_runtime_connected_remap_planner_missing
full_execution_boundary=implemented_machine_file_remap_ready_with_planner_task_hal_blockers
host_native_boundary_visibility=implemented_ui_and_browser_smoke_guard_for_hardware_realtime_external_user_m_tool_db_false
linuxcnc_kinematics_wasm=browser_and_node_proof_ready_xyzac_trt_and_node_direct_xyzbc_trt_b_axis_tcp_pose
browser_kinematics_wasm=worker_connected_source_and_dist_xyzac_trt
linuxcnc_interpreter_wasm=browser_worker_and_node_direct_canonical_program_execution_ready_with_switchkins_mcode_preservation
browser_interpreter_wasm=worker_connected_source_and_dist
switchkins_rtcp_program_execution=implemented_m428_m429_program_events_drive_rtcp_and_kinematics_switch
full_program_execution=partial_interpreter_canonical_and_switchkins_event_ready_remap_planner_not_promoted
session_persistence=implemented_opfs_save_restore_for_5axis_session_with_memory_fallback_when_opfs_unavailable
machine_file_staging=implemented_linuxcnc_trt_ini_hal_tool_table_remap_demo_opfs_staging_with_memory_fallback_when_opfs_unavailable
machine_file_backed_run=implemented_linuxcnc_fiveaxis_remap_wasm_machine_file_execution
planner_task_hal_gap=closed_for_web_simulation_boundary_with_task_motion_hal_wasm_runtime
native_task_hal_sync_plan=docs_native_task_hal_sync_implementation_steps_ready
native_task_hal_phase0_8=source_manifest_native_probe_hal_runtime_motion_hal_sync_task_shim_sdk_machine_file_store_ui_full_boundary_smokes_ready_and_m18_readiness_artifact_audited
native_task_hal_readiness_artifact=web-rtcp-5axis-sim-plan/build/readiness/native-task-hal-readiness.json
tool_db_user_m_web_simulation=ready_for_staged_tool_tbl_and_whitelisted_user_m
next_batch=none_from_development_continuation
```
当前 native task/HAL 接续状态:
- Phase 0 source manifest gate 已输出 `task_hal_source_manifest_ready=1`
- Phase 1 TRT native probe 已按 opt-in 模式就绪,默认 `ready_disabled_by_default`,不提升;
- Phase 2 HAL runtime 已覆盖 pin/signal/param/net/thread scheduler 和 `loadusr` blocked evidence
- Phase 3 minimal motion/HAL C ABI 已覆盖 servo cycle、program-line、switchkins、jog/status HAL 同步;
- Phase 4 minimal task/HAL C ABI 已覆盖 `lctask_*` session/stage/open/command/cycle/status/eventsRUN/MDI/JOG/PAUSE/RESUME/ABORT 能从 task shim 驱动 motion/HAL runtime并已补 SDK wrapper
- Phase 5-8 已把 machine-file session、task/HAL runtime adapter、Worker/client 文件、store action mapping、gmoccapy diagnostics 和 full boundary gate 接上;
- `nativeTaskReady=true``nativeHalSyncReady=true` 当前只表示 Web simulation boundary 内的 task/motion/HAL WASM runtime proof`toolDbProcessReady=true``externalUserMProcessReady=true` 也只表示 Web simulation boundary 内的 staged `tool.tbl` 与白名单 user-M 仿真;仍保持 `hardwareDrive=false``hostRealtimeKernel=false``hostExternalUserMProcessReady=false``hostToolDbProcessReady=false``arbitraryUserMExecution=false`
补充实施文档:
```text
docs/native-task-hal-sync-implementation-steps.md
```
该文档给出完成 `nativeTaskReady``nativeHalSyncReady` 的分阶段实现步骤、程序编写顺序、LinuxCNC 源程序参考清单和验收 gate。当前已完成 Web simulation boundary不表示真实硬件、host realtime kernel 或外部进程 runtime 已完成。
## 10. M12 任务
```text
M12-switchkins-rtcp-program-execution
```
状态:
```text
completed_with_program_level_rtcp_switching
```
已完成:
- `linuxcnc-interpreter-runtime` 识别 LinuxCNC TRT 配置中的 `M428/M429/M430` switchkins remap M-code
- 因当前 interpreter WASM 未启用 Python/NGC remap runtime运行前会从送入 WASM 的程序文本中移除这些高位 M-code避免 `M-code greater than 199` 阻断普通 canonical motion
- 原始程序的 `M428/M429/M430` 被保留为 `switchkinsEvents`,并打上 `linuxcnc_switchkins_remap_mcode_preserved_web_runtime_applied` 边界;
- canonical motion event 继承最近的 switchkins 状态,`RUN/STEP/RUN_FRAME` 按程序自动切换 `identity` / `tcp-xyzac` / `tcp-xyzbc`
- node/browser kinematics runtime 增加 `switchKinematics()`,程序内 `M428/M429` 会同步切换 LinuxCNC kinematics WASM 的 `lckins_switch()`
- gmoccapy diagnostics 显示 program switchkins event count
- smoke 覆盖含 `M428/M429` 的五轴联动 RTCP 程序:加载后进入 TCP执行 A/C 联动段保持 RTCP on运行到 `M429` 后回到 identity。
边界说明:
```text
switchkinsProgramBoundary=linuxcnc_remap_mcode_preserved_and_web_runtime_applied
interpreterBoundary=linuxcnc_interpreter_wasm_canonical_events
kinematicsBoundary=linuxcnc_kinematics_wasm_c_abi
remapRuntimeReady=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false
```
## 16. 最新接续基线
生成时间2026-06-22 CST
本节是下一轮工作的优先入口。旧的 M1-M17 记录保留为历史,不再作为“下一步”的判断依据;后续直接按本节和 `docs/native-task-hal-sync-implementation-steps.md` 执行。
### 16.1 当前完成情况
```text
ui_shell=ready
gmoccapy_layout=ready
profile_xyzac_trt=ready
profile_xyzbc_trt=ready
linuxcnc_kinematics_wasm=ready_browser_worker_and_node
linuxcnc_interpreter_wasm=ready_browser_worker_and_node
linuxcnc_tp_queue_timing=ready_for_canonical_motion
machine_file_staging=ready_opfs_and_memory_storage
machine_file_backed_fiveaxis_remap_run=ready_for_staged_linuxcnc_trt_sources
task_motion_hal_wasm_simulation_boundary=ready_for_web_simulation
threejs_program_preview=ready
threejs_tool_execution_display=ready
linuxcnc_source_program_case_coverage=ready_node_and_browser_guarded
nativeTaskReady=web_simulation_boundary_only
nativeHalSyncReady=web_simulation_boundary_only
opfs_degradation=ready_memory_fallback_current_page_lifecycle_only
toolDbProcessReady=true for web_simulation_only
externalUserMProcessReady=true for web_simulation_only
hardwareDrive=false
hostRealtimeKernel=false
hostExternalUserMProcessReady=false
hostToolDbProcessReady=false
arbitraryUserMExecution=false
```
已通过的当前 gate
```text
npm --prefix web-rtcp-5axis-sim-plan/app run smoke:node
bash web-rtcp-5axis-sim-plan/tests/browser/verify_gmoccapy_shell_browser.sh
bash web-rtcp-5axis-sim-plan/tests/browser/verify_gmoccapy_dist_browser.sh
```
### 16.2 Three.js 当前状态
Three.js 显示区现在不再承担 CNC 语义,只消费 LinuxCNC runtime 输出:
- 完整程序预览路径来自 `state.programExecution.motion`,即 LinuxCNC interpreter/WASM canonical motion events
- 已执行路径优先来自 `state.programExecutionTiming.samples`,即 LinuxCNC TP queue runtime timing samples
- 当前刀具/TCP 标记来自 `state.programRuntimeFeedback.axisPose` 或 task/HAL runtime feedback
- 刀轴方向线来自 `state.toolAxisVector`
- `Clear` 同步清空完整路径和已执行路径;
- 鼠标/触控旋转、平移、缩放和 `X/Y/Z/Fit` 预设视角已保留。
可观测 dataset
```text
canvas.dataset.threeSceneMode=program-preview-and-tool-execution
canvas.dataset.threeProgramPreviewSource=linuxcnc-interpreter-wasm / linuxcnc-machine-file-remap-wasm / fixture-line-playback
canvas.dataset.threeToolpathPreviewSource=linuxcnc_interpreter_canonical_motion
canvas.dataset.threeToolExecutionTraceSource=linuxcnc_tp_samples_or_task_motion_hal_feedback
canvas.dataset.threePathFitBounds=ok
canvas.dataset.threeCurrentSegmentHighlight=ok
canvas.dataset.threeRapidFeedVisualDistinction=ok
canvas.dataset.threeNoGcodeSemanticsGeneration=ok
canvas.dataset.threePathPoints=完整程序预览点数
canvas.dataset.threeExecutedPathPoints=已执行路径点数
canvas.dataset.threeRapidPathPoints=rapid 路径点数
canvas.dataset.threeFeedPathPoints=feed 路径点数
canvas.dataset.threeArcPathPoints=arc 路径点数
canvas.dataset.threeCurrentSegmentPoints=当前 segment 高亮点数
canvas.dataset.threeToolExecutionMarker=true/false
canvas.dataset.threeCameraControls=orbit-pan-zoom
```
边界要求:
```text
Three.js 不解析 G-code
Three.js 不重写 LinuxCNC 运动语义
Three.js 只显示 interpreter canonical motion、TP samples、task/HAL feedback
```
刀具路径预览和刀具执行轨迹对标要求:
```text
toolpath_preview_source=linuxcnc_source_program_interpreter_canonical_motion
tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback
tool_marker_source=linuxcnc_task_hal_or_runtime_feedback_tcp_pose
source_program_guard=linuxcnc_vendored_5axis_gcode_source_file
threejs_generated_toolpath_semantics=forbidden
```
- 完整刀具路径预览必须来自当前选中的 LinuxCNC 源程序 `.ngc` 经 interpreter/WASM 输出的 canonical motion不得由 Three.js 或 Web 侧按 G-code 文本自行推导;
- 已执行刀具轨迹必须优先来自 LinuxCNC TP queue timing samples 或 task/motion/HAL feedback不能用 UI 播放进度伪造为 LinuxCNC 执行轨迹;
- 刀具/TCP marker、刀轴和当前 segment 高亮必须能追溯到同一个 LinuxCNC runtime snapshot 或 canonical/timing event
- `boat-xyzac.ngc``boat-xyzbc.ngc``impeller-7bl-xyzac.ngc``xyzac_switchkins*.ngc``xyzbc_switchkins.ngc` 等案例需要逐个验证预览路径点数、执行轨迹点数、当前 G-code 行、RTCP/switchkins 状态和 source guard
- 如果 runtime fallback 到 fixture-line-playbackUI 可以显示降级预览,但不得把它标记为 LinuxCNC 源程序刀具路径对标通过。
### 16.3 后续工作总原则
后续工作按 `docs/native-task-hal-sync-implementation-steps.md` 执行,保持以下原则:
1. 不用 Web 侧自定义状态机替代 LinuxCNC task/HAL/motion 语义。
2. 不把 browser simulation boundary 扩大描述为真实硬件 runtime。
3. `nativeTaskReady=true``nativeHalSyncReady=true` 只允许在 Web simulation boundary 内成立,除非另有 host-native 对照和 WASM 比对 artifact。
4. `hardwareDrive=false``hostRealtimeKernel=false``hostExternalUserMProcessReady=false``hostToolDbProcessReady=false``arbitraryUserMExecution=false` 必须继续明确展示;`externalUserMProcessReady=true``toolDbProcessReady=true` 只能附带 `web_simulation_only`
5. 不修改用户个人备忘文件;本项目接续只写 `docs/development-continuation.md` 和必要工程文档。
### 16.4 下一批直接执行任务
```text
M18-native-task-hal-source-and-artifact-audit
```
状态:
```text
completed_with_machine_readable_readiness_artifact
```
目标:
- 对照 `docs/native-task-hal-sync-implementation-steps.md` 阶段 0-8审计当前源码、构建产物、测试和 UI 证据是否一致;
- 修正 `docs/development-continuation.md` 中旧段落遗留的 false/partial 状态,避免同一文件同时宣称 task/HAL ready 和 blocked
- 产出机器可读 readiness artifact明确 Web simulation promoted 与 hardware/native blocked 的区别。
建议检查文件:
```text
web-rtcp-5axis-sim-plan/app/src/runtime/linuxcnc-task-hal-runtime.js
web-rtcp-5axis-sim-plan/app/src/runtime/linuxcnc-task-hal-worker.js
web-rtcp-5axis-sim-plan/app/src/runtime/linuxcnc-task-hal-worker-client.js
web-rtcp-5axis-sim-plan/app/src/runtime/full-execution-boundary.js
web-rtcp-5axis-sim-plan/app/src/state/store.js
web-rtcp-5axis-sim-plan/app/src/ui/gmoccapy-shell.js
web-rtcp-5axis-sim-plan/tests/node/verify_linuxcnc_task_hal_runtime.mjs
web-rtcp-5axis-sim-plan/tests/browser/gmoccapy_shell_smoke.html
wasm-port/tests/wasm/node/verify_task_hal_wasm.sh
wasm-port/tests/wasm/node/verify_motion_hal_sync.sh
wasm-port/tests/wasm/node/verify_hal_runtime.sh
wasm-port/tests/native/probe_trt_task_hal_runtime.sh
```
验收:
```text
task_hal_web_simulation_boundary_consistent=1
native_task_hal_host_probe_status=passed_or_ready_disabled_by_default_or_skipped_missing_host_runtime
hardware_drive=0
host_realtime_kernel=0
external_user_m_process_ready=1
tool_db_process_ready=1
host_external_user_m_process_ready=0
host_tool_db_process_ready=0
promotion_scope=web_simulation_only
```
已完成:
- 新增 `app/src/runtime/native-task-hal-audit.js`,汇总 source manifest、native opt-in probe、full execution boundary 和 task/HAL readiness
- 新增 `tests/node/verify_native_task_hal_audit.mjs`,默认运行 `wasm-port/tests/native/verify_task_hal_phase0.sh` 刷新 source/probe 证据;
- 生成机器可读 artifact `build/readiness/native-task-hal-readiness.json`
- `npm run smoke:node` 已接入该 gate
- 明确区分 `webSimulation.promoted=true``toolUserWebSimulation.externalUserMProcessReady=true``toolUserWebSimulation.toolDbProcessReady=true``nativeHostAndHardware.hardwareDrive=false``hostRealtimeKernel=false``externalUserMProcessReady=false``toolDbProcessReady=false`
当前 M18 gate
```text
native_task_hal_source_artifact_audit=ok
task_hal_web_simulation_boundary_consistent=1
native_task_hal_host_probe_status=ready_disabled_by_default
hardware_drive=0
host_realtime_kernel=0
external_user_m_process_ready=1
tool_db_process_ready=1
host_external_user_m_process_ready=0
host_tool_db_process_ready=0
promotion_scope=web_simulation_only
```
### 16.5 M19真实 LinuxCNC 源程序案例覆盖
```text
M19-linuxcnc-source-program-case-coverage
```
状态:
```text
completed_with_real_linuxcnc_source_program_case_smoke
```
目标:
- 继续以 LinuxCNC 源程序中的 5 轴 TRT demo 为准,不新增自定义 G-code 语义;
- 覆盖 `boat-xyzac.ngc``boat-xyzbc.ngc``impeller-7bl-xyzac.ngc``xyzac_switchkins*.ngc``xyzbc_switchkins.ngc`
- 每个案例都验证interpreter canonical motion、TP timing samples、Three.js 完整刀具路径预览、Three.js 已执行刀具轨迹、G-code 当前行、RTCP/switchkins 状态;
- 刀具路径预览和刀具执行轨迹必须对标 LinuxCNC 源程序 runtime 输出,不能由 Three.js/Web 自行解析或生成运动语义。
验收:
```text
linuxcnc_source_program_case_count>=5
all_cases_program_preview_points>0
all_cases_executed_path_points>0_after_run_or_step
all_cases_toolpath_preview_source=linuxcnc_interpreter_canonical_motion
all_cases_tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback
all_switchkins_cases_rtcp_state_changes_verified=1
all_cases_source_guard=linuxcnc_vendored_5axis_gcode_source_file
fixture_toolpath_fallback_not_promoted=1
```
建议新增或扩展:
```text
web-rtcp-5axis-sim-plan/tests/node/verify_real_linuxcnc_5axis_program_cases.mjs
web-rtcp-5axis-sim-plan/tests/browser/gmoccapy_shell_smoke.html
```
已完成:
- 新增 `tests/node/verify_real_linuxcnc_5axis_program_cases.mjs` 并接入 `npm run smoke:node`
- 覆盖 staged LinuxCNC TRT demo source guard`boat-xyzac.ngc``boat-xyzbc.ngc``impeller-7bl-xyzac.ngc``xyzac_switchkins.ngc``xyzac_switchkins_test_1.ngc``xyzac_switchkins_test_2.ngc``xyzac_switchkins_test_3.ngc``xyzbc_switchkins.ngc`
- 直接 canonical/TP 覆盖 `boat-xyzac.ngc``boat-xyzbc.ngc``impeller-7bl-xyzac.ngc``xyzac_switchkins_test_*.ngc`
-`xyzac_switchkins.ngc``xyzbc_switchkins.ngc` 这类 `o<sub> call` 入口,验证 LinuxCNC machine-file staging/remap run 和 source guard不把 direct interpreter 无子程序上下文时的 0 motion 标记为失败或通过;
- `linuxcnc-interpreter-runtime` 预处理单独一行的 LinuxCNC `%` 程序定界符为注释,保留行号,不新增 G-code 运动语义;
- TP WASM timing artifact 容量和大程序 sample stride 已支持 `impeller-7bl-xyzac.ngc` 的 4492 条 canonical motion 与 TP segment 对齐;
- browser smoke 在现有 `impeller-7bl-xyzac.ngc` 源程序流程中验证 canonical motion、TP samples、Three.js 完整路径/已执行轨迹和初始 RTCP switchkins 状态。
当前 M19 gate
```text
linuxcnc_source_program_case_count=8
all_cases_program_preview_points=ok
all_cases_executed_path_points=ok_after_run_or_step
all_cases_toolpath_preview_source=linuxcnc_interpreter_canonical_motion
all_cases_tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback
all_switchkins_cases_rtcp_state_changes_verified=1
all_cases_source_guard=linuxcnc_vendored_5axis_gcode_source_file
fixture_toolpath_fallback_not_promoted=1
real_linuxcnc_5axis_program_cases_smoke=ok
```
边界说明:
```text
sourceProgramBoundary=linuxcnc_vendored_5axis_gcode_source_file
toolpathPreviewBoundary=linuxcnc_interpreter_canonical_motion
toolExecutionTraceBoundary=linuxcnc_tp_samples_or_task_motion_hal_feedback
threejsGeneratedToolpathSemantics=forbidden
fixtureToolpathFallbackPromoted=false
hardwareDrive=false
```
### 16.6 M20Three.js 执行显示质量提升
```text
M20-threejs-tool-execution-quality
```
状态:
```text
completed_with_tool_execution_quality_smoke
```
目标:
- 保持 Three.js 不解析 G-code只消费 runtime 输出;
- 增加执行进度色带或当前 segment 高亮;
- 明确 rapid/feed/arc/switchkins segment 的可视区别;
- 增加路径 fit bounds避免真实 LinuxCNC 大程序被固定 clamp 后压扁;
- 增加 desktop/mobile 截图或 canvas pixel smoke验证刀具路径预览、已执行刀具轨迹和刀具 marker 不重叠、不空白;
- 任何可视化质量提升都必须保持路径点、segment 类型、当前刀具位置来源于 LinuxCNC interpreter/TP/task-HAL 输出。
验收:
```text
threejs_program_preview_mode=program-preview-and-tool-execution
threejs_preview_source=linuxcnc-interpreter-wasm_or_linuxcnc-machine-file-remap-wasm
threejs_toolpath_preview_source=linuxcnc_interpreter_canonical_motion
threejs_tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback
threejs_path_fit_bounds=ok
threejs_current_segment_highlight=ok
threejs_rapid_feed_visual_distinction=ok
threejs_no_gcode_semantics_generation=ok
threejs_canvas_nonblank_desktop=ok
threejs_canvas_nonblank_mobile=ok
```
已完成:
- Three.js 增加 rapid/feed/arc 分层路径、已执行路径和当前 segment 高亮;
- `Fit` 改为按当前程序预览、执行轨迹、当前 segment、TCP marker 和刀轴点集计算 bounds避免真实大程序在固定范围内压扁
- dataset 明确输出 toolpath preview source、tool execution trace source、fit bounds、当前 segment、rapid/feed 区分和 no G-code semantics generation
- fallback canvas 同步输出相同的可观测 gate并绘制当前 segment
- browser smoke 在真实 LinuxCNC `impeller-7bl-xyzac.ngc` 源程序路径中验证 desktop/mobile canvas nonblank、路径来源、rapid/feed 区分和当前 segment。
当前 M20 gate
```text
threejs_program_preview_mode=program-preview-and-tool-execution
threejs_preview_source=linuxcnc-interpreter-wasm_or_linuxcnc-machine-file-remap-wasm
threejs_toolpath_preview_source=linuxcnc_interpreter_canonical_motion
threejs_tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback
threejs_path_fit_bounds=ok
threejs_current_segment_highlight=ok
threejs_rapid_feed_visual_distinction=ok
threejs_no_gcode_semantics_generation=ok
threejs_canvas_nonblank_desktop=ok
threejs_canvas_nonblank_mobile=ok
```
### 16.7 M21公网部署与 OPFS 降级
```text
M21-public-http-opfs-degradation
```
状态:
```text
completed_with_public_http_fallback_smoke
```
背景:
公网 `http://82.156.24.101:8092` 这类 HTTP/IP 环境不是安全上下文OPFS 可能不可用。此前测试中 Save Session 已出现 `OPFS is not available in this browser`
目标:
- 检测非安全上下文和 OPFS 不可用状态;
- 让 Save Session、Restore Session、Stage Machine Files、Full Boundary Audit 给出明确 UI 状态;
- 不让 OPFS 缺失阻断不依赖 OPFS 的预览、运行、Three.js 显示、DRO、G-code 加载;
- 可选增加 memory fallback仅用于当前页面生命周期不宣称持久化。
验收:
```text
opfs_unavailable_detected=1
opfs_dependent_actions_blocked_with_clear_message=1
non_opfs_workflows_still_pass=1
public_http_smoke_no_uncaught_exception=1
```
已完成:
- `five-axis-session``linuxcnc-machine-file-staging` 增加 storage capability 检测,识别非安全上下文、缺失 `navigator.storage.getDirectory()` 和测试强制 OPFS unavailable
- OPFS 不可用时 Save Session、Restore Session、Stage Machine Files 使用 memory fallback只在当前页面生命周期内有效不声明持久化
- UI diagnostics 显示 `opfs unavailable`、fallback mode 和原因,避免静默失败;
- machine-file staging 在 memory fallback 下仍可支持不依赖持久 OPFS 的预览、运行、Three.js、DRO、G-code 加载和 full boundary audit
- browser smoke 强制 OPFS unavailable验证 source 页面没有 uncaught error非 OPFS 工作流仍通过。
当前 M21 gate
```text
opfs_unavailable_detected=1
opfs_fallback_current_page_lifecycle_only=1
opfs_dependent_actions_report_clear_fallback_message=1
non_opfs_workflows_still_pass=1
public_http_smoke_no_uncaught_exception=1
```
### 16.8 M22Host/native 边界可见性
```text
M22-host-native-boundary-visibility
```
状态:
```text
completed_with_host_native_boundary_ui_smoke
```
目标:
- 在 Web simulation boundary 已 promoted 时,继续明确展示非浏览器仿真范围;
- UI diagnostics 必须显示 `hardwareDrive=false``hostRealtimeKernel=false``externalUserMProcessReady=true for web_simulation_only``toolDbProcessReady=true for web_simulation_only``hostExternalUserMProcessReady=false``hostToolDbProcessReady=false``arbitraryUserMExecution=false`
- browser smoke 同时验证 state 字段和 DOM 文本,避免把 Web simulation promoted 误读为真实硬件、host realtime、外部 user-M 或 tool DB runtime ready。
已完成:
- gmoccapy info tabs 新增 `Host/native` 诊断行;
- `Host/native` 显示 hardware drive、host realtime、Web tool/user 仿真 only、host external user-M、host tool DB、arbitrary user-M 状态;
- browser smoke 在 task/HAL full simulation boundary promoted 后验证 Web tool/user ready 与 host/native false 的 state 和 DOM 可见性。
当前 M22 gate
```text
host_native_boundary_ui=ok
hardware_drive_false_visible=1
host_realtime_false_visible=1
external_user_m_web_simulation_only_visible=1
tool_db_web_simulation_only_visible=1
host_external_user_m_false_visible=1
host_tool_db_false_visible=1
arbitrary_user_m_false_visible=1
```
### 16.9 M23受控 tool DB / user-M Web 仿真
```text
M23-controlled-tool-db-user-m-web-simulation
```
状态:
```text
completed_with_linuxcnc_tooldb_index_spindle_semantics
```
目标:
- 对标 LinuxCNC `taskclass.cc``tooldata/*`、TRT remap subroutines 和受控 user-M 用法;
- 读取 staged `tool.tbl`,在 Web storage 中支持 OPFS/memory fallback 保存;
- 支持刀具号、刀长、刀径、刀袋的查询/编辑/保存;
- 接入 `Tn/M6/G43/M61` 仿真状态;
- 只允许白名单 `M128/M129/M428/M429/M430`,不执行任意系统脚本;
- UI 显示 `toolDbProcessReady=true for web_simulation_only``externalUserMProcessReady=true for web_simulation_only`
已完成:
- 新增 `app/src/runtime/tool-db-simulation.js`
- 新增 `app/src/runtime/controlled-user-m-simulation.js`
- `tool-db-simulation.js` 按 LinuxCNC `CANON_TOOL_TABLE` 字段建模,保留非随机刀库的真实 `pocketno`,同时用内部 `idx=1..n` 表示 tool table 行,`idx=0` 固定为 spindle pocket
- `Tn/M6/G43/M61``tooldata_find_index_for_tool()``Task::load_tool()``Task::read_tool_inputs()``convert_tool_length_offset()` 语义更新 `tool_prep_*``toolInSpindle``toolFromPocket``activeToolOffset`#5400/#5401-#5413 参数;
- store 和浏览器入口暴露 `queryToolDb()``editToolDb()``saveToolDb()`,支持 staged `tool.tbl` 查询、编辑和 OPFS/memory fallback 保存;
- store 在 machine-file staging 后自动解析 profile 的 staged `tool.tbl`
- store 在加载 LinuxCNC source program 时扫描 tool commands 和受控 user-M 事件;
- full boundary 把 tool DB/user-M 纳入 Web promotion gate同时保留 host/native false
- gmoccapy info tabs 新增 `Tool/User process` 诊断;
- 新增 `tests/node/verify_tool_db_web_simulation.mjs``tests/node/verify_tool_db_user_m_simulation.mjs` 并接入 `smoke:node`
当前 M23 gate
```text
tool_db_web_simulation_smoke=ok
staged_tool_tbl_loaded=1
tool_db_query_edit_save=1
tool_db_t_m6_g43_state=1
tool_db_memory_fallback_save=1
host_tool_db_process=0
tool_db_user_m_simulation_smoke=ok
tool_db_process_ready_web_simulation_only=1
external_user_m_process_ready_web_simulation_only=1
arbitrary_user_m_blocked=1
host_process_execution=0
```
边界:
```text
toolDbProcessReady=true for web_simulation_only
externalUserMProcessReady=true for web_simulation_only
hostToolDbProcessReady=false
hostExternalUserMProcessReady=false
arbitraryUserMExecution=false
```
### 16.10 M24XYZBC TRT kinematics parity proof
```text
M24-xyzbc-trt-kinematics-parity
```
状态:
```text
completed_with_b_axis_tcp_pose_preserved
```
目标:
- 对标 LinuxCNC `xyzac-trt-kins.c``xyzbc-trt-kins.c``trtfuncs.c``switchkins.c`
- Node direct runtime 同时证明 `linuxcnc_xyzac_trt_kinematics.wasm``linuxcnc_xyzbc_trt_kinematics.wasm`
- 使用 `switchkinsType=1` 验证 TCP 模式正解/逆解闭环;
- `rtcpFrame.tcpPose` 同时保留 `a/b/c`,避免 XYZBC 的 B 轴姿态在 UI 诊断链路中丢失;
- Three.js `data-three-tcp-pose` 输出 B 轴,方便浏览器 smoke 和人工检查。
已完成:
- `app/src/runtime/rtcp-frame.js` 的 fixture frame 和 LinuxCNC kinematics frame 均输出 `tcpPose.b`
- `app/src/visualization/five-axis-scene.js` 的 rounded TCP pose dataset 输出 `b`
- `tests/node/verify_linuxcnc_kinematics_runtime.mjs` 扩展为 XYZAC/XYZBC 双模块 runtime proof校验 wasm 文件、switchkins type、forward/inverse rc、关节闭环、A/B/C TCP 姿态与刀轴方向;
- `tests/node/verify_rtcp_store.mjs` 增加 XYZBC store 状态对 `tcpPose.b` 的保持校验。
当前 M24 gate
```text
xyzac_trt_kinematics_runtime=ok
xyzbc_trt_kinematics_runtime=ok
linuxcnc_kinematics_runtime_smoke=ok
xyzbc_b_axis_tcp_pose_preserved=1
rtcp_store_smoke=ok
```
边界:
```text
semanticBoundary=linuxcnc_kinematics_wasm_c_abi
scope=node_direct_web_runtime_proof
hardwareDrive=false
hostRealtimeKernel=false
```
### 16.11 每轮必须执行的回归
常规回归:
```text
npm --prefix web-rtcp-5axis-sim-plan/app run smoke:node
bash web-rtcp-5axis-sim-plan/tests/browser/verify_gmoccapy_shell_browser.sh
bash web-rtcp-5axis-sim-plan/tests/browser/verify_gmoccapy_dist_browser.sh
```
涉及 WASM core 时追加:
```text
bash wasm-port/tests/wasm/node/verify_hal_runtime.sh
bash wasm-port/tests/wasm/node/verify_motion_hal_sync.sh
bash wasm-port/tests/wasm/node/verify_task_hal_wasm.sh
bash wasm-port/tests/wasm/node/verify_task_hal_sdk.sh
bash wasm-port/tests/native/probe_trt_task_hal_runtime.sh
```
涉及部署时追加:
```text
npm --prefix web-rtcp-5axis-sim-plan/app run build
bash web-rtcp-5axis-sim-plan/tests/browser/verify_gmoccapy_dist_browser.sh
```
### 16.10 禁止事项
```text
禁止修改用户个人备忘文件,除非用户明确要求
禁止把 fixture fallback 描述为 LinuxCNC semantic proof
禁止把 Web simulation task/HAL runtime 描述为真实硬件控制
禁止绕过 LinuxCNC interpreter/TP/task/HAL 输出去手写 G-code 运动语义
禁止默认启动 host-native LinuxCNC runtime 或抢占已有 linuxcncsvr/rtapi_app
```
## 14. M16 任务
```text
M16-linuxcnc-tp-queue-timing-runtime
```
状态:
```text
completed_with_tp_wasm_and_web_node_smoke
```
已完成:
- `wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_tp_wasm.c` 新增
`lctp_run_canonical_motion_timing()`
- TP WASM C ABI 将 LinuxCNC interpreter canonical motion events 入队到 vendored
LinuxCNC `src/emc/tp` runtime并通过 `tpRunCycle()` 生成 segment timing
- canonical 零长度 motion 保留为 0 秒 timing segment不作为 TP enqueue failure
- 新增 `wasm-port/runtime/sdk/src/linuxcnc-tp.js`
- `linuxcnc-interpreter-runtime``runProgram()` / `runMachineFileProgram()` 后调用
TP SDK`programExecution.plannerTiming` 使用
`linuxcnc_tp_queue_runtime_timing_from_canonical_motion` 边界;
- store 优先使用 TP planner timingJS `execution-timing.js` 保留为 fallback/MDI
lightweight path
- full execution boundary 可在 TP timing 成功时报告 `plannerRuntimeReady=true`
- browser source/dist smoke 验证 interpreter Worker readiness 包含 TP planner runtime
并验证含 `ARC_FEED` 的真实 G-code 程序通过 TP arc timing segment。
边界说明:
```text
timingBoundary=linuxcnc_tp_queue_runtime_timing_from_canonical_motion
plannerRuntimeReady=true for interpreter canonical motion with TP WASM timing
nativeTaskReady=false
nativeHalSyncReady=false
fullLinuxCncProgramExecutionReady=false
hardwareDrive=false
```
验证:
```text
source /home/cnc/emsdk/emsdk_env.sh >/dev/null && bash wasm-port/tools/build_tp_wasm.sh && bash wasm-port/tests/wasm/node/verify_tp_wasm.sh
node web-rtcp-5axis-sim-plan/tests/node/verify_linuxcnc_interpreter_runtime.mjs
npm --prefix web-rtcp-5axis-sim-plan/app run smoke:node
npm --prefix web-rtcp-5axis-sim-plan/app run smoke
```
## 11. M13 任务
```text
M13-interpreter-worker-runtime
```
状态:
```text
completed_with_browser_worker_smoke
```
已完成:
- 新增 `linuxcnc-interpreter-worker.js``linuxcnc-interpreter-worker-client.js`
- 浏览器默认优先通过 Web Worker 加载 LinuxCNC interpreter WASM
- store 的 `RUN_INTERPRETER_PROGRAM` 支持 async runtime避免 worker 结果阻塞 UI 线程;
- 增加 `interpreterExecutionPending` 和 sequence guard防止旧解释器结果覆盖新加载程序
- gmoccapy diagnostics 显示 interpreter execution context
- browser smoke 验证 kinematics 和 interpreter 都在 Worker并验证 source/dist 两条路径。
边界说明:
```text
browserInterpreterExecutionContext=worker
nodeInterpreterExecutionContext=direct
interpreterBoundary=linuxcnc_interpreter_wasm_canonical_events
remapRuntimeReady=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false
```
## 14. M16 任务
```text
M16-planner-task-hal-boundary-audit
```
状态:
```text
completed_with_full_execution_boundary_smoke
```
已完成:
- 新增 `full-execution-boundary.js`,统一汇总 kinematics、interpreter canonical、machine-file staging、five-axis remap run、switchkins HAL evidence
- store 新增 `fullExecutionBoundary` 派生状态和 `RUN_FULL_BOUNDARY_AUDIT_REQUEST`
- gmoccapy diagnostics 显示 full boundary、planner/task/HAL blockers 和证据摘要;
- 底部新增 `Audit` 按钮,可触发 machine-file staging + machine-file backed five-axis remap run
- interpreter runtime 对 machine-file backed run 的 `remapRuntimeReady` 改为基于 `fiveaxis_ini_open=1``fiveaxis_remaps_ready=1``fiveaxis_file_reached_exit=1`
- Node/browser smoke 验证 partial remap boundary ready同时继续禁止 full LinuxCNC program execution promoted。
边界说明:
```text
fullExecutionBoundary=linuxcnc_machine_file_remap_ready_planner_task_hal_blocked
remapRuntimeReady=true for staged fiveAxisRemap C ABI run
halSwitchkinsEvidenceReady=true for fiveaxis_hal_switchkins evidence
nativeTaskReady=false
nativeHalSyncReady=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false
promotionAllowed=false
```
## 15. M17 任务
```text
M17-linuxcnc-5axis-gcode-source-ingest
```
状态:
```text
completed_with_real_linuxcnc_5axis_source_program_smoke
```
已完成:
- machine-file staging 从 LinuxCNC source manifest 中追加 TRT `demos/*.ngc`,包括 `boat-xyzac.ngc``boat-xyzbc.ngc``impeller-7bl-xyzac.ngc``xyzac_switchkins*.ngc``xyzbc_switchkins.ngc`
- `selectMachineFileProgram()` 强制 5 轴 G-code 必须来自当前 profile 对应的 LinuxCNC 源程序目录axis/vismach 使用 `configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/*.ngc`gmoccapy TRT 使用 `configs/sim/gmoccapy/non_trivial_kinematics/table-rotary-tilting/examples/*.ngc`
- 新增 `listLinuxCncGcodeSources()``selectMachineFileProgram()`
- store 新增 `LOAD_LINUXCNC_GCODE_SOURCE`,可把 staged LinuxCNC 真实 5 轴 `.ngc` 源文件加载到 G-code 面板;
- gmoccapy G-code 面板新增 LinuxCNC 5-axis source 下拉框和 staging 按钮;
- machine-file backed remap run 使用当前选中的 LinuxCNC `.ngc` 源程序路径;
- Node/browser smoke 验证选择 `impeller-7bl-xyzac.ngc`UI 加载真实源程序machine-file run 的 `wasmProgramPath` 指向该源文件。
边界说明:
```text
gcodeSourceBoundary=linuxcnc_vendored_5axis_gcode_source_file
sourceMode=linuxcnc-vendored-5axis-gcode
machineFileBackedRunProgram=selected_staged_linuxcnc_ngc_source
sourceDirectoryGuard=profile_specific_linuxcnc_demos_or_gmoccapy_examples_only
remapRuntimeReady=true for staged fiveAxisRemap C ABI run
plannerRuntimeReady=false
nativeTaskReady=false
nativeHalSyncReady=false
fullLinuxCncProgramExecutionReady=false
```
## 12. M14 任务
```text
M14-opfs-machine-file-staging
```
状态:
```text
completed_with_node_and_browser_opfs_smoke
```
已完成:
- 新增 `linuxcnc-machine-file-staging.js`
- 复用 `wasm-port/runtime/sdk/src/sim-config-staging.js``planSimConfigStaging()`,为 `xyzac-trt` / `xyzbc-trt` 生成 LinuxCNC sim-config staging plan
- 将 INI、tool table、HAL、PyVCP XML、`remap_subs/*.ngc`、demo G-code 等 vendored LinuxCNC 文本文件保存到 OPFS 风格路径;
- store 增加 `machineFileStaging` 状态和 `stageMachineFiles()` API
- gmoccapy diagnostics 显示 machine-file staging 状态;
- build 产物复制 `wasm-port/tools/source-manifest.txt`,保证 dist 页面也能生成 staging plan
- node smoke 使用 memory OPFS 验证文件保存browser smoke 使用真实 OPFS 验证 source/dist staging。
边界说明:
```text
machineFileStagingBoundary=linuxcnc_sim_config_file_staging_plan_plus_opfs_text_persistence
stagedFiles=ini,hal,pyvcp,tool_table,remap_ngc,demo_gcode
nativeHalTaskSync=false
remapRuntimeReady=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false
```
## 13. M15 任务
```text
M15-machine-file-backed-fiveaxis-remap-run
```
状态:
```text
completed_with_node_and_browser_fiveaxis_remap_run
```
已完成:
- `linuxcnc-interpreter-runtime` 新增 `runMachineFileProgram()`
- interpreter Worker 支持 `runMachineFileProgram` 转发;
- store 新增 `RUN_MACHINE_FILE_PROGRAM` action 和 `machineFileExecution` 状态;
- 使用 M14 的 machine-file staging plan/files把 TRT INI、tool table、remap NGC、demo G-code 写入 Emscripten FS
- 调用 LinuxCNC interpreter SDK `runSimConfigProgram({ executionMode: "fiveAxisRemap" })`
- Node/browser smoke 验证 `fiveaxis_ini_open=1``fiveaxis_remaps_ready=1``fiveaxis_file_reached_exit=1`
- gmoccapy diagnostics 显示 machine-file backed run 状态。
边界说明:
```text
machineFileBackedRunBoundary=linuxcnc_fiveaxis_remap_wasm_machine_file_execution
sourceMode=linuxcnc-machine-file-remap-wasm
remapRuntimeReady=vendored_linuxcnc_fiveaxis_remap_c_abi_for_staged_files
nativeTaskHalSync=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false
```