From 4de2c84a627237e7bdaa0b51ac3c28d80d62bad0 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 8 Jun 2026 09:31:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=20OPFS=20=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=B7=AF=E5=BE=84=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:Node OPFS smoke 现在验证 INI 缺失参数文件和刀具表文件名时,会话桥接回落到 host path model 默认路径,保持文件边界策略不进入 CNC 语义。 --- wasm-port/docs/compatibility-validation.md | 4 +++- wasm-port/tests/opfs/node/verify_file_service.mjs | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index 056ce41..73deca8 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -110,6 +110,7 @@ parameter semantics, and that INI-derived machine file names are still rejected by the OPFS path model when they contain traversal or nested path segments. The same Node smoke also validates that explicit session file-name options take precedence over INI-derived parameter and tool-table file names, +and that missing INI file-name values fall back to the host path model defaults, keeping host override policy outside CNC semantics. The browser INI/OPFS smoke script serves `wasm-port/` over localhost and runs @@ -273,7 +274,8 @@ derived from vendored LinuxCNC INI boolean parsing, INI-derived `[RS274NGC]PARAMETER_FILE` and `[EMCIO]TOOL_TABLE` file names mapped to OPFS machine files, OPFS path-model rejection of invalid INI-derived file names, explicit host session file-name overrides taking precedence over INI-derived -names, session snapshot custom filename handling plus envelope/path rejection +names, default host path fallback when INI file-name values are absent, +session snapshot custom filename handling plus envelope/path rejection for unsupported format/version, wrong session id, and invalid snapshot filenames, and a browser interpreter smoke that uses the same session bridge with real LinuxCNC INI WASM parsing before saving OPFS-backed parameter and diff --git a/wasm-port/tests/opfs/node/verify_file_service.mjs b/wasm-port/tests/opfs/node/verify_file_service.mjs index 9fec4ea..a8fd49a 100644 --- a/wasm-port/tests/opfs/node/verify_file_service.mjs +++ b/wasm-port/tests/opfs/node/verify_file_service.mjs @@ -441,6 +441,14 @@ assert.equal( loadedIniDerivedRandomSession.toolTable.result, "tooldata_load=0\nload_tool_path=/work/ini-derived-session-tool.tbl\nrandom_toolchanger=1\n", ); +assert.equal( + loadedIniDerivedRandomSession.parameters.opfsPath, + "linuxcnc/machines/xyzab-tdr/linuxcnc.var", +); +assert.equal( + loadedIniDerivedRandomSession.toolTable.opfsPath, + "linuxcnc/machines/xyzab-tdr/tool.tbl", +); await saveMachineTextFiles("ini-file-session", { ini: [