Guard browser OPFS invalid INI path helper

This commit is contained in:
2026-06-14 01:08:19 +08:00
parent 7117bdc890
commit 1bf920bc27
2 changed files with 52 additions and 2 deletions

View File

@@ -466,3 +466,52 @@ host_wasm_opfs_browser_smokes=ok
`interp_smoke.html` 中 `verifyOpfsInvalidIniSessionRejects(...)` 内部的 path literal
是否还能用既有 `opfsMachineFilePath(...)` helper 收敛,前提是只改 test glue
不改变 reject 行为或 path model 实现。
十二、2026-06-14 继续执行记录browser OPFS invalid INI path helper guard
本轮按上一条下一步建议继续收敛 OPFS invalid INI session rejection helper 内部 path
literal范围仍只触及 `wasm-port/tests/browser/interp_smoke.html` 的 browser/OPFS
test glue。
完成内容:
- 在 `verifyOpfsInvalidIniSessionRejects(...)` 中复用既有
`opfsMachineFilePath(machineId, "machine.ini")` 生成 expected INI OPFS path
- 移除 invalid INI rejection helper 内部重复的
`linuxcnc/machines/${machineId}/machine.ini` literal
- WASM staging path、reject label、expected regex 与 invalid INI fixture 均未改变;
- 未改变 reject 行为、path model 实现、OPFS bridge behavior、file-service、
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` 中 OPFS custom session helpers 周边是否还有硬编码
`machine.ini`、`linuxcnc.var`、`tool.tbl` default path literal 可安全接入既有
path helper只改测试胶水不改变 path model 或 runtime bridge。

View File

@@ -4626,13 +4626,14 @@
iniSdk,
iniWasmPath: `/work/${machineId}.ini`,
};
const expectedIniOpfsPath = opfsMachineFilePath(machineId, "machine.ini");
assertOpfsIniStaging(
`${label}_ini_staging`,
{
opfsPath: `linuxcnc/machines/${machineId}/machine.ini`,
opfsPath: expectedIniOpfsPath,
wasmPath: sessionOptions.iniWasmPath,
},
`linuxcnc/machines/${machineId}/machine.ini`,
expectedIniOpfsPath,
`/work/${machineId}.ini`,
);
await verifyRejects(