Guard OPFS path helper staging
This commit is contained in:
65
text7.txt
65
text7.txt
@@ -1687,3 +1687,68 @@ file-service 或 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 继续执行记录:OPFS path helper staging guard
|
||||||
|
|
||||||
|
1. 本批目标。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第二十四轮,处理 OPFS path helper 剩余散点:
|
||||||
|
|
||||||
|
```text
|
||||||
|
defaultMachinePaths("xyzab-tdr")
|
||||||
|
machineFilePaths("xyzab-tdr")
|
||||||
|
previewCachePath("fixture", "nested/preview.json")
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 已完成改动。
|
||||||
|
|
||||||
|
- Node OPFS smoke 新增 `assertMachineFileStoragePaths(...)`;
|
||||||
|
- `defaultMachinePaths(...)` 的默认 machine file path map 改为走专用 path guard;
|
||||||
|
- `machineFilePaths(...)` 的默认 machine file path map 改为走专用 path guard;
|
||||||
|
- 增加 `previewCachePath(...)` custom invalid filename rejection;
|
||||||
|
- 未修改 OPFS file-service、machine-file-store、path-model、preview cache 或 runtime
|
||||||
|
semantics。
|
||||||
|
|
||||||
|
涉及文件:
|
||||||
|
|
||||||
|
```text
|
||||||
|
wasm-port/tests/opfs/node/verify_file_service.mjs
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 已完成的目标验证。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git diff --check
|
||||||
|
wasm-port/tests/opfs/node/verify_file_service.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 本批剩余建议验证。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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
|
||||||
|
Guard OPFS path helper staging
|
||||||
|
```
|
||||||
|
|
||||||
|
5. 下一步工作建议。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第二十五轮,优先扫描 OPFS bridge default path helpers,
|
||||||
|
例如 `restoreMachineParametersFromOpfs(...)`、`loadMachineToolTableFromOpfs(...)`、
|
||||||
|
`saveMachineToolTableToOpfs(...)` 的默认 OPFS path 与 custom WASM path 对账;仍只加
|
||||||
|
filesystem/OPFS path guard,不改变 bridge behavior、file-service 或 runtime
|
||||||
|
semantics。
|
||||||
|
|
||||||
|
下一轮第一条命令仍保持:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
|
||||||
|
```
|
||||||
|
|||||||
@@ -119,6 +119,18 @@ function assertPreviewCacheStoragePath(cacheKey, path, filename = "preview.json"
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function assertMachineFileStoragePaths(machineId, paths) {
|
||||||
|
assert.deepEqual(
|
||||||
|
paths,
|
||||||
|
{
|
||||||
|
ini: `linuxcnc/machines/${machineId}/machine.ini`,
|
||||||
|
toolTable: `linuxcnc/machines/${machineId}/tool.tbl`,
|
||||||
|
parameters: `linuxcnc/machines/${machineId}/linuxcnc.var`,
|
||||||
|
},
|
||||||
|
`${machineId} machine file OPFS path drift`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
assert.equal(await getOpfsRoot(storage), root);
|
assert.equal(await getOpfsRoot(storage), root);
|
||||||
|
|
||||||
assert.equal(normalizeOpfsPath("linuxcnc/machines/xyzab.ini"), "linuxcnc/machines/xyzab.ini");
|
assert.equal(normalizeOpfsPath("linuxcnc/machines/xyzab.ini"), "linuxcnc/machines/xyzab.ini");
|
||||||
@@ -145,12 +157,8 @@ assertSessionSnapshotStoragePath(
|
|||||||
sessionSnapshotPath("session-1", "custom-snapshot.json"),
|
sessionSnapshotPath("session-1", "custom-snapshot.json"),
|
||||||
"custom-snapshot.json",
|
"custom-snapshot.json",
|
||||||
);
|
);
|
||||||
assert.deepEqual(defaultMachinePaths("xyzab-tdr"), {
|
assertMachineFileStoragePaths("xyzab-tdr", defaultMachinePaths("xyzab-tdr"));
|
||||||
ini: "linuxcnc/machines/xyzab-tdr/machine.ini",
|
assertMachineFileStoragePaths("xyzab-tdr", machineFilePaths("xyzab-tdr"));
|
||||||
toolTable: "linuxcnc/machines/xyzab-tdr/tool.tbl",
|
|
||||||
parameters: "linuxcnc/machines/xyzab-tdr/linuxcnc.var",
|
|
||||||
});
|
|
||||||
assert.deepEqual(machineFilePaths("xyzab-tdr"), defaultMachinePaths("xyzab-tdr"));
|
|
||||||
|
|
||||||
const snapshotPayload = {
|
const snapshotPayload = {
|
||||||
files: {
|
files: {
|
||||||
@@ -653,6 +661,10 @@ assert.throws(
|
|||||||
() => sessionSnapshotPath("session-1", "nested/snapshot.json"),
|
() => sessionSnapshotPath("session-1", "nested/snapshot.json"),
|
||||||
/Invalid session snapshot filename/,
|
/Invalid session snapshot filename/,
|
||||||
);
|
);
|
||||||
|
assert.throws(
|
||||||
|
() => previewCachePath("fixture", "nested/preview.json"),
|
||||||
|
/Invalid preview cache filename/,
|
||||||
|
);
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => gcodeProgramPath("../escape.ngc"),
|
() => gcodeProgramPath("../escape.ngc"),
|
||||||
/Invalid G-code filename/,
|
/Invalid G-code filename/,
|
||||||
|
|||||||
Reference in New Issue
Block a user