结论:新增 OPFS source-map 文档和同步守卫,绑定 interp_internal.hh 默认参数文件、rs274ngc_pre.cc restore/save 语义与浏览器 OPFS 边界;未扩展 smoke 功能。
1.5 KiB
1.5 KiB
LinuxCNC OPFS source map
This map records the source basis for browser-side LinuxCNC parameter-file persistence. It is a policy and bridge map only; it must not add independent filesystem behavior or 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.ccimplementsInterp::restore_parameters()for parameter-file reads.src/emc/rs274ngc/rs274ngc_pre.ccimplementsInterp::save_parameters()forfilename + ".new", backup, and replacement writes.
Browser Bridge Boundary
web/src/wasm-core.jsmust keep LinuxCNC parameter persistence routed through an OPFS workspace.- Browser contexts with OPFS support must not disable OPFS.
- 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.
web/src/app.jsmust parse browser programs throughparseFileWithParameterFile()so the program file and LinuxCNC parameter state both live under OPFS.
Checks
Run:
./check-linuxcnc-opfs-source-map.sh
./test-native.sh
./test-linuxcnc-source-link.sh
check-linuxcnc-opfs-source-map.sh keeps this document, the LinuxCNC source
anchors, and the browser bridge guardrails synchronized.