Guard browser OPFS custom session wasm input paths

This commit is contained in:
2026-06-13 23:49:02 +08:00
parent 327f86804c
commit 33ae88bc21
2 changed files with 70 additions and 10 deletions

View File

@@ -2353,3 +2353,59 @@ guard不改变 LinuxCNC-owned interpreter、INI、tool、parameter 或 runtim
```bash ```bash
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
``` ```
四十、2026-06-13 继续执行记录browser OPFS custom session wasm path input guard
1. 本批目标。
继续 staged path guard inventory 第三十五轮,收敛 browser OPFS smoke 中 custom
session 的 `parameterWasmPath`、`toolTableWasmPath` runtime input 与 helper 生成 path
的重复规则。
2. 已完成改动。
- browser smoke 新增 `opfsCustomSessionWasmPath(...)`
- `opfsCustomSessionPaths(...)` 改为复用该 helper 生成 custom parameter/tool-table
WASM path
- INI-derived custom session 和 explicit override session 的 runtime input
`parameterWasmPath` / `toolTableWasmPath` 改为走同一 helper
- save parameter/tool-table staging 断言的 expected WASM path 同步改为走同一 helper
- 未修改 OPFS bridge behavior、file-service、path-model、SDK planner、interpreter 或
LinuxCNC-owned runtime semantics。
涉及文件:
```text
wasm-port/tests/browser/interp_smoke.html
```
3. 已完成验证。
```bash
git diff --check
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_interp_browser.sh
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
wasm-port/tests/host/verify_host_smokes.sh
```
提交建议:
```text
Guard browser OPFS custom session wasm input paths
```
4. 下一步工作建议。
继续 staged path guard inventory 第三十六轮,优先扫描 browser OPFS smoke 中 custom
session 的 repeated filename literals判断是否值得用局部 constants 收敛;仍只加
browser/OPFS boundary guard不改变 LinuxCNC-owned interpreter、INI、tool、parameter
或 runtime semantics。
下一轮第一条命令仍保持:
```bash
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
```

View File

@@ -4545,6 +4545,10 @@
return opfsPath; return opfsPath;
} }
function opfsCustomSessionWasmPath(filename) {
return `/work/${filename}`;
}
function opfsCustomSessionPaths(machineId, parameterFilename, toolTableFilename, iniWasmPath) { function opfsCustomSessionPaths(machineId, parameterFilename, toolTableFilename, iniWasmPath) {
return { return {
opfs: { opfs: {
@@ -4553,8 +4557,8 @@
}, },
wasm: { wasm: {
ini: iniWasmPath, ini: iniWasmPath,
parameters: `/work/${parameterFilename}`, parameters: opfsCustomSessionWasmPath(parameterFilename),
toolTable: `/work/${toolTableFilename}`, toolTable: opfsCustomSessionWasmPath(toolTableFilename),
}, },
}; };
} }
@@ -9432,8 +9436,8 @@
{ {
iniSdk: ini, iniSdk: ini,
iniWasmPath: "/work/browser-ini-file-session.ini", iniWasmPath: "/work/browser-ini-file-session.ini",
parameterWasmPath: "/work/browser-custom.var", parameterWasmPath: opfsCustomSessionWasmPath("browser-custom.var"),
toolTableWasmPath: "/work/browser-custom-tool.tbl", toolTableWasmPath: opfsCustomSessionWasmPath("browser-custom-tool.tbl"),
}, },
); );
assertOpfsSessionStaging( assertOpfsSessionStaging(
@@ -9478,7 +9482,7 @@
savedIniNamedParameters, savedIniNamedParameters,
"browser-ini-file-session", "browser-ini-file-session",
"browser-custom.var", "browser-custom.var",
"/work/browser-custom.var", opfsCustomSessionWasmPath("browser-custom.var"),
); );
verifyExpectedOutput( verifyExpectedOutput(
"opfs_save_ini_named_parameter_file", "opfs_save_ini_named_parameter_file",
@@ -9536,7 +9540,7 @@
savedIniNamedToolTable, savedIniNamedToolTable,
"browser-ini-file-session", "browser-ini-file-session",
"browser-custom-tool.tbl", "browser-custom-tool.tbl",
"/work/browser-custom-tool.tbl", opfsCustomSessionWasmPath("browser-custom-tool.tbl"),
); );
verifyExpectedOutput( verifyExpectedOutput(
"opfs_save_ini_named_tool_table", "opfs_save_ini_named_tool_table",
@@ -9601,9 +9605,9 @@
iniSdk: ini, iniSdk: ini,
iniWasmPath: "/work/browser-ini-override-session.ini", iniWasmPath: "/work/browser-ini-override-session.ini",
parameterFilename: "browser-explicit.var", parameterFilename: "browser-explicit.var",
parameterWasmPath: "/work/browser-explicit.var", parameterWasmPath: opfsCustomSessionWasmPath("browser-explicit.var"),
toolTableFilename: "browser-explicit-tool.tbl", toolTableFilename: "browser-explicit-tool.tbl",
toolTableWasmPath: "/work/browser-explicit-tool.tbl", toolTableWasmPath: opfsCustomSessionWasmPath("browser-explicit-tool.tbl"),
}, },
); );
assertOpfsSessionStaging( assertOpfsSessionStaging(
@@ -9660,7 +9664,7 @@
savedExplicitParameters, savedExplicitParameters,
"browser-ini-override-session", "browser-ini-override-session",
"browser-explicit.var", "browser-explicit.var",
"/work/browser-explicit.var", opfsCustomSessionWasmPath("browser-explicit.var"),
); );
verifyExpectedOutput( verifyExpectedOutput(
"opfs_save_explicit_parameter_file", "opfs_save_explicit_parameter_file",
@@ -9706,7 +9710,7 @@
savedExplicitToolTable, savedExplicitToolTable,
"browser-ini-override-session", "browser-ini-override-session",
"browser-explicit-tool.tbl", "browser-explicit-tool.tbl",
"/work/browser-explicit-tool.tbl", opfsCustomSessionWasmPath("browser-explicit-tool.tbl"),
); );
verifyExpectedOutput( verifyExpectedOutput(
"opfs_save_explicit_tool_table", "opfs_save_explicit_tool_table",