From 7117bdc8907fad34b58405e56b4c975b597a3244 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sun, 14 Jun 2026 01:03:55 +0800 Subject: [PATCH] Guard browser OPFS invalid INI lines helper --- text8.txt | 46 +++++++++++++++++++++++ wasm-port/tests/browser/interp_smoke.html | 33 +++++++++------- 2 files changed, 65 insertions(+), 14 deletions(-) diff --git a/text8.txt b/text8.txt index 13d77e9..56b4b3c 100644 --- a/text8.txt +++ b/text8.txt @@ -420,3 +420,49 @@ host_wasm_opfs_browser_smokes=ok OPFS invalid INI session rejection helper 周边,确认是否还有重复的 invalid filename fixture 构造或 path guard 可收敛;只处理 browser test glue,不改变错误语义或 runtime bridge。 + +十一、2026-06-14 继续执行记录:browser OPFS invalid INI lines helper guard + +本轮按上一条下一步建议扫描 OPFS invalid INI session rejection helper 周边,范围仍只触及 +`wasm-port/tests/browser/interp_smoke.html` 的 browser/OPFS test glue。 + +完成内容: + +- 新增 `opfsInvalidIniLines(...)`,统一 invalid INI fixture 的基础结构构造; +- 收敛 invalid `PARAMETER_FILE` 与 invalid `TOOL_TABLE` 两个 rejection fixture; +- invalid assignment 与 expected regex 仍在调用点外显; +- 未改变错误匹配语义、OPFS bridge behavior、file-service、path-model、SDK planner、 + interpreter、INI、tool、parameter 或 LinuxCNC-owned runtime semantics。 + +验证已通过: + +```bash +git diff --check +wasm-port/tools/verify_vendor_sync.sh +wasm-port/tools/verify_no_standalone_cnc_semantics.sh +SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh +SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_sim_configs_inventory_wasm.sh +SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_interp_browser.sh +wasm-port/tests/host/verify_host_smokes.sh +``` + +关键输出: + +```text +vendor sync up to date +standalone CNC semantics guard complete +interp_wasm_node_smoke=ok +sim_configs_wasm_node_inventory_executed=28 +sim_configs_wasm_node_inventory_passed=28 +sim_configs_wasm_node_inventory_skipped=131 +sim_configs_wasm_node_inventory_unexpected_fail=0 +browser_interp_smoke=ok +host_wasm_opfs_browser_smokes=ok +``` + +下一步建议: + +继续保持 browser/OPFS boundary guard 小批量推进。优先扫描 +`interp_smoke.html` 中 `verifyOpfsInvalidIniSessionRejects(...)` 内部的 path literal +是否还能用既有 `opfsMachineFilePath(...)` helper 收敛,前提是只改 test glue, +不改变 reject 行为或 path model 实现。 diff --git a/wasm-port/tests/browser/interp_smoke.html b/wasm-port/tests/browser/interp_smoke.html index fd20c9e..96bd5fd 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -4642,6 +4642,17 @@ ); } + function opfsInvalidIniLines(machineId, section, assignment) { + return [ + "[EMC]", + `MACHINE = ${machineId}`, + "", + `[${section}]`, + assignment, + "", + ]; + } + function assertSimConfigStagingPlan(machineRel, plan, expectedWasmDir) { if (plan.wasmDir !== expectedWasmDir) { throw new Error(`${machineRel}: browser sim staging root drift`); @@ -9775,14 +9786,11 @@ interp, ini, "browser-invalid-param-file-session", - [ - "[EMC]", - "MACHINE = browser-invalid-param-file-session", - "", - "[RS274NGC]", + opfsInvalidIniLines( + "browser-invalid-param-file-session", + "RS274NGC", "PARAMETER_FILE = ../escape.var", - "", - ], + ), /Invalid parameter filename/, ); @@ -9791,14 +9799,11 @@ interp, ini, "browser-invalid-tool-file-session", - [ - "[EMC]", - "MACHINE = browser-invalid-tool-file-session", - "", - "[EMCIO]", + opfsInvalidIniLines( + "browser-invalid-tool-file-session", + "EMCIO", "TOOL_TABLE = nested/tool.tbl", - "", - ], + ), /Invalid tool table filename/, );