Guard browser OPFS save operation staging
This commit is contained in:
57
text7.txt
57
text7.txt
@@ -2070,3 +2070,60 @@ browser/OPFS boundary guard,不改变 LinuxCNC-owned interpreter、INI、tool
|
|||||||
```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 save operation staging guard
|
||||||
|
|
||||||
|
1. 本批目标。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第三十轮,收敛 browser OPFS smoke 中 save
|
||||||
|
parameter/tool-table 后的重复 explicit staging 断言。
|
||||||
|
|
||||||
|
2. 已完成改动。
|
||||||
|
|
||||||
|
- browser smoke 新增 `opfsMachineFilePath(...)`;
|
||||||
|
- 新增 `assertOpfsSavedParameterStaging(...)`,统一校验 saved parameter OPFS path、
|
||||||
|
WASM path 和 `.bak` backup path;
|
||||||
|
- 新增 `assertOpfsSavedToolTableStaging(...)`,统一校验 saved tool-table OPFS/WASM
|
||||||
|
path;
|
||||||
|
- 普通 `browser-interp`、random toolchanger、INI-derived custom session、explicit
|
||||||
|
override session 的 save parameter/tool-table staging 断言改为走 save-operation
|
||||||
|
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 save operation staging
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 下一步工作建议。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第三十一轮,优先扫描 browser OPFS smoke 中
|
||||||
|
`loadTextFile(...)` 对 saved parameter/tool-table backup 或 saved file text 的 inline
|
||||||
|
path 使用,挑选仍可收敛为 readback 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,6 +4511,30 @@
|
|||||||
generatedToolTablePath(toolTable.wasmPath, expectedWasmPath);
|
generatedToolTablePath(toolTable.wasmPath, expectedWasmPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function opfsMachineFilePath(machineId, filename) {
|
||||||
|
return `linuxcnc/machines/${machineId}/${filename}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function assertOpfsSavedParameterStaging(label, parameters, machineId, filename, expectedWasmPath) {
|
||||||
|
const expectedOpfsPath = opfsMachineFilePath(machineId, filename);
|
||||||
|
assertOpfsParameterStaging(
|
||||||
|
label,
|
||||||
|
parameters,
|
||||||
|
expectedOpfsPath,
|
||||||
|
expectedWasmPath,
|
||||||
|
`${expectedOpfsPath}.bak`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function assertOpfsSavedToolTableStaging(label, toolTable, machineId, filename, expectedWasmPath) {
|
||||||
|
assertOpfsToolTableStaging(
|
||||||
|
label,
|
||||||
|
toolTable,
|
||||||
|
opfsMachineFilePath(machineId, filename),
|
||||||
|
expectedWasmPath,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function assertOpfsSessionStaging(label, session, machineId, expectedPaths) {
|
function assertOpfsSessionStaging(label, session, machineId, expectedPaths) {
|
||||||
if (session.machineId !== machineId) {
|
if (session.machineId !== machineId) {
|
||||||
throw new Error(`${label}: unexpected machine id ${session.machineId}`);
|
throw new Error(`${label}: unexpected machine id ${session.machineId}`);
|
||||||
@@ -9159,12 +9183,12 @@
|
|||||||
},
|
},
|
||||||
{ wasmPath: "/work/browser-linuxcnc.var" },
|
{ wasmPath: "/work/browser-linuxcnc.var" },
|
||||||
);
|
);
|
||||||
assertOpfsParameterStaging(
|
assertOpfsSavedParameterStaging(
|
||||||
"opfs_save_parameters_staging",
|
"opfs_save_parameters_staging",
|
||||||
savedParameters,
|
savedParameters,
|
||||||
"linuxcnc/machines/browser-interp/linuxcnc.var",
|
"browser-interp",
|
||||||
|
"linuxcnc.var",
|
||||||
"/work/browser-linuxcnc.var",
|
"/work/browser-linuxcnc.var",
|
||||||
"linuxcnc/machines/browser-interp/linuxcnc.var.bak",
|
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
"opfs_save_parameters",
|
"opfs_save_parameters",
|
||||||
@@ -9205,10 +9229,11 @@
|
|||||||
"browser-interp",
|
"browser-interp",
|
||||||
{ wasmPath: "/work/browser-tool.tbl" },
|
{ wasmPath: "/work/browser-tool.tbl" },
|
||||||
);
|
);
|
||||||
assertOpfsToolTableStaging(
|
assertOpfsSavedToolTableStaging(
|
||||||
"opfs_save_tool_table_staging",
|
"opfs_save_tool_table_staging",
|
||||||
savedToolTable,
|
savedToolTable,
|
||||||
"linuxcnc/machines/browser-interp/tool.tbl",
|
"browser-interp",
|
||||||
|
"tool.tbl",
|
||||||
"/work/browser-tool.tbl",
|
"/work/browser-tool.tbl",
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
@@ -9310,10 +9335,11 @@
|
|||||||
"browser-random-toolchanger",
|
"browser-random-toolchanger",
|
||||||
{ wasmPath: "/work/browser-random-tool.tbl" },
|
{ wasmPath: "/work/browser-random-tool.tbl" },
|
||||||
);
|
);
|
||||||
assertOpfsToolTableStaging(
|
assertOpfsSavedToolTableStaging(
|
||||||
"opfs_save_random_tool_table_staging",
|
"opfs_save_random_tool_table_staging",
|
||||||
savedRandomToolTable,
|
savedRandomToolTable,
|
||||||
"linuxcnc/machines/browser-random-toolchanger/tool.tbl",
|
"browser-random-toolchanger",
|
||||||
|
"tool.tbl",
|
||||||
"/work/browser-random-tool.tbl",
|
"/work/browser-random-tool.tbl",
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
@@ -9426,12 +9452,12 @@
|
|||||||
wasmPath: loadedIniFileSession.parameters.wasmPath,
|
wasmPath: loadedIniFileSession.parameters.wasmPath,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
assertOpfsParameterStaging(
|
assertOpfsSavedParameterStaging(
|
||||||
"opfs_save_ini_named_parameters_staging",
|
"opfs_save_ini_named_parameters_staging",
|
||||||
savedIniNamedParameters,
|
savedIniNamedParameters,
|
||||||
"linuxcnc/machines/browser-ini-file-session/browser-custom.var",
|
"browser-ini-file-session",
|
||||||
|
"browser-custom.var",
|
||||||
"/work/browser-custom.var",
|
"/work/browser-custom.var",
|
||||||
"linuxcnc/machines/browser-ini-file-session/browser-custom.var.bak",
|
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
"opfs_save_ini_named_parameter_file",
|
"opfs_save_ini_named_parameter_file",
|
||||||
@@ -9484,10 +9510,11 @@
|
|||||||
wasmPath: loadedIniFileSession.toolTable.wasmPath,
|
wasmPath: loadedIniFileSession.toolTable.wasmPath,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
assertOpfsToolTableStaging(
|
assertOpfsSavedToolTableStaging(
|
||||||
"opfs_save_ini_named_tool_table_staging",
|
"opfs_save_ini_named_tool_table_staging",
|
||||||
savedIniNamedToolTable,
|
savedIniNamedToolTable,
|
||||||
"linuxcnc/machines/browser-ini-file-session/browser-custom-tool.tbl",
|
"browser-ini-file-session",
|
||||||
|
"browser-custom-tool.tbl",
|
||||||
"/work/browser-custom-tool.tbl",
|
"/work/browser-custom-tool.tbl",
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
@@ -9610,12 +9637,12 @@
|
|||||||
wasmPath: loadedIniOverrideSession.parameters.wasmPath,
|
wasmPath: loadedIniOverrideSession.parameters.wasmPath,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
assertOpfsParameterStaging(
|
assertOpfsSavedParameterStaging(
|
||||||
"opfs_save_explicit_parameters_staging",
|
"opfs_save_explicit_parameters_staging",
|
||||||
savedExplicitParameters,
|
savedExplicitParameters,
|
||||||
"linuxcnc/machines/browser-ini-override-session/browser-explicit.var",
|
"browser-ini-override-session",
|
||||||
|
"browser-explicit.var",
|
||||||
"/work/browser-explicit.var",
|
"/work/browser-explicit.var",
|
||||||
"linuxcnc/machines/browser-ini-override-session/browser-explicit.var.bak",
|
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
"opfs_save_explicit_parameter_file",
|
"opfs_save_explicit_parameter_file",
|
||||||
@@ -9656,10 +9683,11 @@
|
|||||||
wasmPath: loadedIniOverrideSession.toolTable.wasmPath,
|
wasmPath: loadedIniOverrideSession.toolTable.wasmPath,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
assertOpfsToolTableStaging(
|
assertOpfsSavedToolTableStaging(
|
||||||
"opfs_save_explicit_tool_table_staging",
|
"opfs_save_explicit_tool_table_staging",
|
||||||
savedExplicitToolTable,
|
savedExplicitToolTable,
|
||||||
"linuxcnc/machines/browser-ini-override-session/browser-explicit-tool.tbl",
|
"browser-ini-override-session",
|
||||||
|
"browser-explicit-tool.tbl",
|
||||||
"/work/browser-explicit-tool.tbl",
|
"/work/browser-explicit-tool.tbl",
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
|
|||||||
Reference in New Issue
Block a user