结论:按 LinuxCNC rs274ngc_pre.cc save_parameters() 的 .new、.bak、unlink/link/rename 顺序补强 OPFS/app/browser smoke 守卫,并验证临时参数文件不会残留在 OPFS。
2.2 KiB
2.2 KiB
LinuxCNC browser app source map
This map records the source basis and boundaries for the browser application entry point. It is an app/bridge guard only; it must not add CNC behavior and must not expand the temporary smoke parser.
LinuxCNC Source Basis
src/emc/rs274ngc/interp_internal.hhdefinesRS274NGC_PARAMETER_FILE_NAME_DEFAULTasrs274ngc.var.src/emc/rs274ngc/interp_internal.hhdefinesRS274NGC_PARAMETER_FILE_BACKUP_SUFFIXas.bak.src/emc/rs274ngc/rs274ngc_pre.ccrestores parameter files throughInterp::restore_parameters().src/emc/rs274ngc/rs274ngc_pre.ccsaves parameter files throughInterp::save_parameters(), includingfilename + ".new"andfilename + ".bak"behavior.src/emc/rs274ngc/rs274ngc_pre.ccorders parameter saves as backup unlink, backup link, then temporary-file rename.src/emc/rs274ngc/rs274ngc_pre.ccreads program blocks throughread_text()after the browser bridge mirrors the OPFS program into the WASM filesystem.
App Coverage
| Entry | Boundary |
|---|---|
web/index.html |
Loads the browser app module and exposes only the LinuxCNC backend selector. |
web/src/app.js |
Creates a required OPFS-backed simulator workspace and parses browser programs with a LinuxCNC parameter file. |
web/test-browser-wasm-smoke-app-sections.js |
Verifies app-level OPFS program save, parameter save, parameter backup, and reload behavior. |
Boundaries
- The app must use the existing
createWasmSimulator()OPFS API; it must not add browser filesystem persistence outside OPFS. - The app must persist the current program at
programs/current.ngc. - The app must persist LinuxCNC parameter state at
parameters/rs274ngc.var. - The app must require OPFS for browser program parsing and call
parseFileWithParameterFile(programPath, parameterPath, "linuxcnc", ...). - The visible backend selector must stay limited to the LinuxCNC RS274 backend.
Checks
Run:
./check-linuxcnc-browser-app-source-map.sh
./test-native.sh
./test-linuxcnc-source-link.sh
check-linuxcnc-browser-app-source-map.sh keeps this document, LinuxCNC source
anchors, app OPFS paths, app parse routing, and app smoke coverage synchronized.