Guard browser OPFS custom session staging
This commit is contained in:
62
text7.txt
62
text7.txt
@@ -1949,3 +1949,65 @@ 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
|
||||
```
|
||||
|
||||
三十三、2026-06-13 继续执行记录:browser OPFS custom session staging guard
|
||||
|
||||
1. 本批目标。
|
||||
|
||||
继续 staged path guard inventory 第二十八轮,收敛 browser OPFS smoke 中 custom session
|
||||
路径三件套:
|
||||
|
||||
```text
|
||||
browser-ini-file-session
|
||||
browser-ini-override-session
|
||||
```
|
||||
|
||||
2. 已完成改动。
|
||||
|
||||
- 扩展 browser smoke 的 `assertOpfsSessionStaging(...)`,支持默认 OPFS path 加 custom
|
||||
`opfs` override;
|
||||
- 普通/default session 调用改为显式 `wasm` path map;
|
||||
- INI-derived `browser-ini-file-session` 的 INI、custom parameter、custom tool table
|
||||
staging 断言改为走 session helper;
|
||||
- explicit override `browser-ini-override-session` 的 INI、explicit parameter、explicit
|
||||
tool table staging 断言改为走 session helper;
|
||||
- 保留 custom filename 的显式 expected OPFS path;
|
||||
- 未修改 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 staging
|
||||
```
|
||||
|
||||
4. 下一步工作建议。
|
||||
|
||||
继续 staged path guard inventory 第二十九轮,优先扫描 browser OPFS smoke 中 invalid
|
||||
INI parameter/tool-table rejection 的 staging guard,收敛为 invalid-session helper;
|
||||
仍只加 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
|
||||
```
|
||||
|
||||
@@ -4511,27 +4511,33 @@
|
||||
generatedToolTablePath(toolTable.wasmPath, expectedWasmPath);
|
||||
}
|
||||
|
||||
function assertOpfsSessionStaging(label, session, machineId, expectedWasmPaths) {
|
||||
function assertOpfsSessionStaging(label, session, machineId, expectedPaths) {
|
||||
if (session.machineId !== machineId) {
|
||||
throw new Error(`${label}: unexpected machine id ${session.machineId}`);
|
||||
}
|
||||
const expectedOpfsPaths = {
|
||||
ini: `linuxcnc/machines/${machineId}/machine.ini`,
|
||||
parameters: `linuxcnc/machines/${machineId}/linuxcnc.var`,
|
||||
toolTable: `linuxcnc/machines/${machineId}/tool.tbl`,
|
||||
...(expectedPaths.opfs ?? {}),
|
||||
};
|
||||
assertOpfsIniStaging(
|
||||
`${label}_ini`,
|
||||
session.ini,
|
||||
`linuxcnc/machines/${machineId}/machine.ini`,
|
||||
expectedWasmPaths.ini,
|
||||
expectedOpfsPaths.ini,
|
||||
expectedPaths.wasm.ini,
|
||||
);
|
||||
assertOpfsToolTableStaging(
|
||||
`${label}_tool_table`,
|
||||
session.toolTable,
|
||||
`linuxcnc/machines/${machineId}/tool.tbl`,
|
||||
expectedWasmPaths.toolTable,
|
||||
expectedOpfsPaths.toolTable,
|
||||
expectedPaths.wasm.toolTable,
|
||||
);
|
||||
assertOpfsParameterStaging(
|
||||
`${label}_parameters`,
|
||||
session.parameters,
|
||||
`linuxcnc/machines/${machineId}/linuxcnc.var`,
|
||||
expectedWasmPaths.parameters,
|
||||
expectedOpfsPaths.parameters,
|
||||
expectedPaths.wasm.parameters,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9081,10 +9087,12 @@
|
||||
loadedSession,
|
||||
"browser-interp",
|
||||
{
|
||||
wasm: {
|
||||
ini: "/work/browser-machine.ini",
|
||||
parameters: "/work/browser-linuxcnc.var",
|
||||
toolTable: "/work/browser-tool.tbl",
|
||||
},
|
||||
},
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_restore_parameters",
|
||||
@@ -9245,10 +9253,12 @@
|
||||
loadedRandomSession,
|
||||
"browser-random-toolchanger",
|
||||
{
|
||||
wasm: {
|
||||
ini: "/work/browser-random-machine.ini",
|
||||
parameters: "/work/browser-random-linuxcnc.var",
|
||||
toolTable: "/work/browser-random-tool.tbl",
|
||||
},
|
||||
},
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_load_random_tool_table",
|
||||
@@ -9348,23 +9358,21 @@
|
||||
toolTableWasmPath: "/work/browser-custom-tool.tbl",
|
||||
},
|
||||
);
|
||||
assertOpfsIniStaging(
|
||||
"opfs_load_ini_named_ini_staging",
|
||||
loadedIniFileSession.ini,
|
||||
"linuxcnc/machines/browser-ini-file-session/machine.ini",
|
||||
"/work/browser-ini-file-session.ini",
|
||||
);
|
||||
assertOpfsToolTableStaging(
|
||||
"opfs_load_ini_named_tool_table_staging",
|
||||
loadedIniFileSession.toolTable,
|
||||
"linuxcnc/machines/browser-ini-file-session/browser-custom-tool.tbl",
|
||||
"/work/browser-custom-tool.tbl",
|
||||
);
|
||||
assertOpfsParameterStaging(
|
||||
"opfs_load_ini_named_parameters_staging",
|
||||
loadedIniFileSession.parameters,
|
||||
"linuxcnc/machines/browser-ini-file-session/browser-custom.var",
|
||||
"/work/browser-custom.var",
|
||||
assertOpfsSessionStaging(
|
||||
"opfs_load_ini_named_session_staging",
|
||||
loadedIniFileSession,
|
||||
"browser-ini-file-session",
|
||||
{
|
||||
opfs: {
|
||||
parameters: "linuxcnc/machines/browser-ini-file-session/browser-custom.var",
|
||||
toolTable: "linuxcnc/machines/browser-ini-file-session/browser-custom-tool.tbl",
|
||||
},
|
||||
wasm: {
|
||||
ini: "/work/browser-ini-file-session.ini",
|
||||
parameters: "/work/browser-custom.var",
|
||||
toolTable: "/work/browser-custom-tool.tbl",
|
||||
},
|
||||
},
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_load_ini_named_parameter_file",
|
||||
@@ -9522,23 +9530,21 @@
|
||||
toolTableWasmPath: "/work/browser-explicit-tool.tbl",
|
||||
},
|
||||
);
|
||||
assertOpfsIniStaging(
|
||||
"opfs_load_explicit_ini_staging",
|
||||
loadedIniOverrideSession.ini,
|
||||
"linuxcnc/machines/browser-ini-override-session/machine.ini",
|
||||
"/work/browser-ini-override-session.ini",
|
||||
);
|
||||
assertOpfsToolTableStaging(
|
||||
"opfs_load_explicit_tool_table_staging",
|
||||
loadedIniOverrideSession.toolTable,
|
||||
"linuxcnc/machines/browser-ini-override-session/browser-explicit-tool.tbl",
|
||||
"/work/browser-explicit-tool.tbl",
|
||||
);
|
||||
assertOpfsParameterStaging(
|
||||
"opfs_load_explicit_parameters_staging",
|
||||
loadedIniOverrideSession.parameters,
|
||||
"linuxcnc/machines/browser-ini-override-session/browser-explicit.var",
|
||||
"/work/browser-explicit.var",
|
||||
assertOpfsSessionStaging(
|
||||
"opfs_load_explicit_session_staging",
|
||||
loadedIniOverrideSession,
|
||||
"browser-ini-override-session",
|
||||
{
|
||||
opfs: {
|
||||
parameters: "linuxcnc/machines/browser-ini-override-session/browser-explicit.var",
|
||||
toolTable: "linuxcnc/machines/browser-ini-override-session/browser-explicit-tool.tbl",
|
||||
},
|
||||
wasm: {
|
||||
ini: "/work/browser-ini-override-session.ini",
|
||||
parameters: "/work/browser-explicit.var",
|
||||
toolTable: "/work/browser-explicit-tool.tbl",
|
||||
},
|
||||
},
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_load_explicit_parameter_file",
|
||||
|
||||
Reference in New Issue
Block a user