参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke:锁定OPFS参数保存顺序

结论:按 LinuxCNC rs274ngc_pre.cc save_parameters() 的 .new、.bak、unlink/link/rename 顺序补强 OPFS/app/browser smoke 守卫,并验证临时参数文件不会残留在 OPFS。
This commit is contained in:
cnc
2026-06-04 19:42:49 +08:00
parent a12c0166b5
commit b89d6311ff
7 changed files with 46 additions and 0 deletions

View File

@@ -15,6 +15,8 @@ must not expand the temporary smoke parser.
- `src/emc/rs274ngc/rs274ngc_pre.cc` saves parameter files through
`Interp::save_parameters()`, including `filename + ".new"` and
`filename + ".bak"` behavior.
- `src/emc/rs274ngc/rs274ngc_pre.cc` orders parameter saves as backup unlink,
backup link, then temporary-file rename.
- `src/emc/rs274ngc/rs274ngc_pre.cc` reads program blocks through `read_text()`
after the browser bridge mirrors the OPFS program into the WASM filesystem.

View File

@@ -14,6 +14,9 @@ persistence. It is a policy and bridge map only; it must not add independent fil
- `src/emc/rs274ngc/rs274ngc_pre.cc` implements
`Interp::save_parameters()` for `filename + ".new"`, backup, and replacement
writes.
- `src/emc/rs274ngc/rs274ngc_pre.cc` unlinks `filename + ".bak"`, links the
previous parameter file to that backup path, then renames `filename + ".new"`
over the configured parameter file.
## OPFS Coverage

View File

@@ -11,6 +11,9 @@ OPFS-only is the required boundary.
- `src/emc/rs274ngc/rs274ngc_pre.cc` provides `Interp::ini_load()`,
`Interp::restore_parameters()`, `Interp::save_parameters()`, and `read_text()`
behavior exercised by Node/browser bridge tests.
- `src/emc/rs274ngc/rs274ngc_pre.cc` saves parameters by writing
`filename + ".new"`, unlinking `filename + ".bak"`, linking the previous file
to `filename + ".bak"`, and renaming the temporary file over the main file.
- `src/emc/rs274ngc/interp_convert.cc` provides `convert_m()` coverage for
M66 waits and M68 analog output side effects used by generated remap cases.
- `src/emc/nml_intf/canon.hh` declares the `WAIT()` and