Guard browser storage behind OPFS

This commit is contained in:
cnc
2026-06-02 07:11:41 +08:00
parent 0db23b4a5d
commit dab7b9e2ef
4 changed files with 17 additions and 0 deletions

View File

@@ -16,6 +16,10 @@ Hard rules:
LinuxCNC source before implementation.
- Browser-side wasm filesystem behavior must use OPFS-backed storage. Do not
add browser filesystem paths that bypass OPFS.
- Browser app and wasm bridge code must not persist CNC programs, LinuxCNC
parameter files, or mirrored workspace files through non-OPFS browser storage
APIs such as Local Storage, IndexedDB, File Picker writes, WebKit filesystem
APIs, or FileReader-backed import paths.
Allowed project code:
@@ -61,6 +65,8 @@ Efficiency rules:
permission to expand the pass into another workstream.
- Do not add a smoke-only behavior path when the LinuxCNC-backed route already
exists; add coverage to the source-backed route instead.
- Keep browser filesystem guardrails negative as well as positive: require the
OPFS bridge and reject browser app/wasm storage APIs that could bypass it.
- Smoke tests are verification guardrails. They must not be expanded with new
functional CNC behavior unless that behavior is directly routed to, copied
from, or checked against the relevant LinuxCNC source in the same narrow