参考所有分组,完成尽量多的内容:同步 OPFS 与 smoke 映射
结论:未扩展 smoke 功能行为,仅收紧 OPFS workspace、directory、policy 浏览器烟测和 source-map 守卫。 LinuxCNC 来源依据:src/emc/rs274ngc/rs274ngc_pre.cc 的 restore_parameters/save_parameters/read_text 参数文件与文件读取语义,以及 interp_internal.hh 的 rs274ngc.var/.bak 常量边界。 检查通过:./check-linuxcnc-opfs-source-map.sh;./check-linuxcnc-wasm-smoke-source-map.sh;./check-linuxcnc-workstreams-source-map.sh;./test-native.sh;./test-linuxcnc-source-link.sh。
This commit is contained in:
@@ -26,7 +26,10 @@ persistence. It is a policy and bridge map only; it must not add independent fil
|
||||
| `web/src/app.js` | Persists browser programs at `programs/current.ngc` and LinuxCNC parameters at `parameters/rs274ngc.var`. |
|
||||
| `web/test-browser-wasm-smoke-opfs-basic-sections.js` | Verifies OPFS program file reads through LinuxCNC `read_text()` and rejects unsafe paths. |
|
||||
| `web/test-browser-wasm-smoke-opfs-parameter-sections.js` | Verifies OPFS parameter restore, save, `.new`, `.bak`, failure, and stale-state semantics. |
|
||||
| `web/test-browser-wasm-smoke-opfs-workspace-sections.js` | Aggregates OPFS basic, parameter, mirror, and directory checks under browser OPFS availability. |
|
||||
| `web/test-browser-wasm-smoke-opfs-mirror-sections.js` | Verifies OPFS/WASM mirror persistence used by source-backed file parsing and parameter movement. |
|
||||
| `web/test-browser-wasm-smoke-opfs-directory-sections.js` | Verifies OPFS directory persistence and WASM mirror refresh without polluting mirrors during metadata queries. |
|
||||
| `web/test-browser-wasm-smoke-opfs-policy-sections.js` | Verifies OPFS workspace and mount policy, including the browser rule that OPFS cannot be disabled. |
|
||||
| `web/test-browser-wasm-smoke-app-sections.js` | Verifies app-level OPFS program, parameter, backup, and reload behavior. |
|
||||
|
||||
## Browser Bridge Boundary
|
||||
@@ -34,6 +37,9 @@ persistence. It is a policy and bridge map only; it must not add independent fil
|
||||
- `web/src/wasm-core.js` must keep LinuxCNC parameter persistence routed
|
||||
through an OPFS workspace.
|
||||
- Browser contexts with OPFS support must not disable OPFS.
|
||||
- OPFS workspace paths must remain relative paths inside the CNC workspace, and
|
||||
OPFS mount points must remain absolute paths inside the Emscripten
|
||||
filesystem.
|
||||
- Browser app and wasm bridge code must not use Local Storage, IndexedDB,
|
||||
File Picker, Directory Picker, WebKit filesystem, or FileReader persistence
|
||||
paths for CNC programs, LinuxCNC parameter files, or mirrored workspace files.
|
||||
|
||||
@@ -34,7 +34,12 @@ OPFS-only is the required boundary.
|
||||
| `test-web-wasm-node-smoke.cjs` | Exercises the C ABI, `web/src/wasm-core.js`, generated switchkins config cases, and source-backed kinematics events. |
|
||||
| `test-web-wasm-browser-smoke.sh` | Runs browser checks after verifying copied WASM artifacts and smoke module structure. |
|
||||
| `web/test-browser-wasm-smoke-linuxcnc-sections.js` | Exercises LinuxCNC browser parsing and generated switchkins cases without INI_FILE_NAME remap-load aliases. |
|
||||
| `web/test-browser-wasm-smoke-opfs-workspace-sections.js` | Aggregates OPFS basic, parameter, mirror, and directory sections under browser OPFS availability. |
|
||||
| `web/test-browser-wasm-smoke-opfs-basic-sections.js` | Exercises OPFS-backed program file reads through LinuxCNC `read_text()` and rejects unsafe paths. |
|
||||
| `web/test-browser-wasm-smoke-opfs-parameter-sections.js` | Exercises LinuxCNC parameter restore/save/backup semantics through OPFS. |
|
||||
| `web/test-browser-wasm-smoke-opfs-mirror-sections.js` | Exercises OPFS/WASM mirror persistence used by source-backed program parsing and parameter movement. |
|
||||
| `web/test-browser-wasm-smoke-opfs-directory-sections.js` | Exercises OPFS directory persistence and WASM mirror refresh without filesystem persistence outside OPFS. |
|
||||
| `web/test-browser-wasm-smoke-opfs-policy-sections.js` | Exercises browser OPFS workspace and mount policy, including the rule that OPFS cannot be disabled. |
|
||||
| `web/test-browser-wasm-smoke-app-sections.js` | Verifies the browser app uses OPFS program and parameter persistence. |
|
||||
|
||||
## Boundaries
|
||||
@@ -46,8 +51,8 @@ OPFS-only is the required boundary.
|
||||
- Generated switchkins config smoke cases must continue to come from
|
||||
`web/public/linuxcnc_switchkins_remap_config_cases.json`.
|
||||
- The browser smoke shell guard also pins required section names for LinuxCNC
|
||||
browser parsing, OPFS parameter restore/save failure handling, and browser
|
||||
app OPFS reload coverage.
|
||||
browser parsing, OPFS workspace/policy/directory handling, OPFS parameter
|
||||
restore/save failure handling, and browser app OPFS reload coverage.
|
||||
- Smoke wrappers must keep positive minimum coverage thresholds so accidental
|
||||
section loss is visible.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user