Guard browser OPFS session staging
This commit is contained in:
63
text7.txt
63
text7.txt
@@ -1886,3 +1886,66 @@ LinuxCNC-owned interpreter、INI、tool、parameter 或 runtime semantics。
|
|||||||
```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 session staging guard
|
||||||
|
|
||||||
|
1. 本批目标。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第二十七轮,收敛 browser OPFS smoke 中普通 session
|
||||||
|
与 random toolchanger session 的重复 inline staging 断言:
|
||||||
|
|
||||||
|
```text
|
||||||
|
loadMachineSessionFromOpfs(...)
|
||||||
|
browser-interp
|
||||||
|
browser-random-toolchanger
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 已完成改动。
|
||||||
|
|
||||||
|
- browser smoke 新增 `assertOpfsSessionStaging(...)`;
|
||||||
|
- 普通 `browser-interp` session 的 INI、tool table、parameter path 断言改为走 session
|
||||||
|
helper;
|
||||||
|
- `browser-random-toolchanger` session 的 INI、tool table、parameter path 断言改为走
|
||||||
|
session helper;
|
||||||
|
- 保留既有 `assertOpfsIniStaging(...)`、`assertOpfsToolTableStaging(...)`、
|
||||||
|
`assertOpfsParameterStaging(...)` 单项 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 session staging
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 下一步工作建议。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第二十八轮,优先把 browser OPFS smoke 中 INI-derived
|
||||||
|
和 explicit override session 的 `assertOpfsIniStaging(...)`、`assertOpfsToolTableStaging(...)`、
|
||||||
|
`assertOpfsParameterStaging(...)` 三件套收敛到 session-aware helper,但保留 custom
|
||||||
|
filename 的显式 expected OPFS path;仍只加 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 assertOpfsSessionStaging(label, session, machineId, expectedWasmPaths) {
|
||||||
|
if (session.machineId !== machineId) {
|
||||||
|
throw new Error(`${label}: unexpected machine id ${session.machineId}`);
|
||||||
|
}
|
||||||
|
assertOpfsIniStaging(
|
||||||
|
`${label}_ini`,
|
||||||
|
session.ini,
|
||||||
|
`linuxcnc/machines/${machineId}/machine.ini`,
|
||||||
|
expectedWasmPaths.ini,
|
||||||
|
);
|
||||||
|
assertOpfsToolTableStaging(
|
||||||
|
`${label}_tool_table`,
|
||||||
|
session.toolTable,
|
||||||
|
`linuxcnc/machines/${machineId}/tool.tbl`,
|
||||||
|
expectedWasmPaths.toolTable,
|
||||||
|
);
|
||||||
|
assertOpfsParameterStaging(
|
||||||
|
`${label}_parameters`,
|
||||||
|
session.parameters,
|
||||||
|
`linuxcnc/machines/${machineId}/linuxcnc.var`,
|
||||||
|
expectedWasmPaths.parameters,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function assertSimConfigStagingPlan(machineRel, plan, expectedWasmDir) {
|
function assertSimConfigStagingPlan(machineRel, plan, expectedWasmDir) {
|
||||||
if (plan.wasmDir !== expectedWasmDir) {
|
if (plan.wasmDir !== expectedWasmDir) {
|
||||||
throw new Error(`${machineRel}: browser sim staging root drift`);
|
throw new Error(`${machineRel}: browser sim staging root drift`);
|
||||||
@@ -9052,23 +9076,15 @@
|
|||||||
toolTableWasmPath: "/work/browser-tool.tbl",
|
toolTableWasmPath: "/work/browser-tool.tbl",
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
assertOpfsIniStaging(
|
assertOpfsSessionStaging(
|
||||||
"opfs_load_ini_staging",
|
"opfs_load_session_staging",
|
||||||
loadedSession.ini,
|
loadedSession,
|
||||||
"linuxcnc/machines/browser-interp/machine.ini",
|
"browser-interp",
|
||||||
"/work/browser-machine.ini",
|
{
|
||||||
);
|
ini: "/work/browser-machine.ini",
|
||||||
assertOpfsToolTableStaging(
|
parameters: "/work/browser-linuxcnc.var",
|
||||||
"opfs_load_tool_table_staging",
|
toolTable: "/work/browser-tool.tbl",
|
||||||
loadedSession.toolTable,
|
},
|
||||||
"linuxcnc/machines/browser-interp/tool.tbl",
|
|
||||||
"/work/browser-tool.tbl",
|
|
||||||
);
|
|
||||||
assertOpfsParameterStaging(
|
|
||||||
"opfs_restore_parameters_staging",
|
|
||||||
loadedSession.parameters,
|
|
||||||
"linuxcnc/machines/browser-interp/linuxcnc.var",
|
|
||||||
"/work/browser-linuxcnc.var",
|
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
"opfs_restore_parameters",
|
"opfs_restore_parameters",
|
||||||
@@ -9224,23 +9240,15 @@
|
|||||||
toolTableWasmPath: "/work/browser-random-tool.tbl",
|
toolTableWasmPath: "/work/browser-random-tool.tbl",
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
assertOpfsIniStaging(
|
assertOpfsSessionStaging(
|
||||||
"opfs_load_random_ini_staging",
|
"opfs_load_random_session_staging",
|
||||||
loadedRandomSession.ini,
|
loadedRandomSession,
|
||||||
"linuxcnc/machines/browser-random-toolchanger/machine.ini",
|
"browser-random-toolchanger",
|
||||||
"/work/browser-random-machine.ini",
|
{
|
||||||
);
|
ini: "/work/browser-random-machine.ini",
|
||||||
assertOpfsToolTableStaging(
|
parameters: "/work/browser-random-linuxcnc.var",
|
||||||
"opfs_load_random_tool_table_staging",
|
toolTable: "/work/browser-random-tool.tbl",
|
||||||
loadedRandomSession.toolTable,
|
},
|
||||||
"linuxcnc/machines/browser-random-toolchanger/tool.tbl",
|
|
||||||
"/work/browser-random-tool.tbl",
|
|
||||||
);
|
|
||||||
assertOpfsParameterStaging(
|
|
||||||
"opfs_load_random_parameters_staging",
|
|
||||||
loadedRandomSession.parameters,
|
|
||||||
"linuxcnc/machines/browser-random-toolchanger/linuxcnc.var",
|
|
||||||
"/work/browser-random-linuxcnc.var",
|
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
"opfs_load_random_tool_table",
|
"opfs_load_random_tool_table",
|
||||||
|
|||||||
Reference in New Issue
Block a user