Guard tool-table direct staging
This commit is contained in:
70
text7.txt
70
text7.txt
@@ -1084,3 +1084,73 @@ filesystem path guard,不改变 tool table 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 继续执行记录:tool-table direct staging guard
|
||||||
|
|
||||||
|
1. 本批目标。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第十五轮,处理 Node/browser 成对覆盖的 direct
|
||||||
|
tool table fixture path:
|
||||||
|
|
||||||
|
```text
|
||||||
|
tool.tbl
|
||||||
|
random-tool.tbl
|
||||||
|
browser-direct-tool.tbl
|
||||||
|
browser-direct-random-tool.tbl
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 已完成改动。
|
||||||
|
|
||||||
|
- Node 侧新增 `generatedToolTablePath(...)` 与
|
||||||
|
`writeGeneratedToolTableFixture(...)`;
|
||||||
|
- Node 侧 direct `tool.tbl` 与 `random-tool.tbl` 初始写入改为走显式 path parity
|
||||||
|
guard;
|
||||||
|
- browser 侧同步新增 direct tool-table fixture path guard helper;
|
||||||
|
- browser 侧 `browser-direct-tool.tbl` 与 `browser-direct-random-tool.tbl` 初始写入改为
|
||||||
|
走显式 path parity guard;
|
||||||
|
- 未修改 tool table fixture 内容、load/save expected output、random tool changer
|
||||||
|
配置或 tool table runtime semantics。
|
||||||
|
|
||||||
|
涉及文件:
|
||||||
|
|
||||||
|
```text
|
||||||
|
wasm-port/tests/wasm/node/verify_interp_wasm.mjs
|
||||||
|
wasm-port/tests/browser/interp_smoke.html
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 已完成的目标验证。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git diff --check
|
||||||
|
node --check wasm-port/tests/wasm/node/verify_interp_wasm.mjs
|
||||||
|
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh
|
||||||
|
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_interp_browser.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_sim_configs_inventory_wasm.sh
|
||||||
|
wasm-port/tests/host/verify_host_smokes.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
如果通过,提交建议:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Guard tool-table direct staging
|
||||||
|
```
|
||||||
|
|
||||||
|
5. 下一步工作建议。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第十六轮,优先处理 browser OPFS/session tool-table
|
||||||
|
path guard,例如 `/work/browser-tool.tbl`、`/work/browser-random-tool.tbl`、
|
||||||
|
`/work/browser-custom-tool.tbl`、`/work/browser-explicit-tool.tbl`;仍只加
|
||||||
|
filesystem/OPFS path guard,不改变 tool table、INI 或 session runtime semantics。
|
||||||
|
|
||||||
|
下一轮第一条命令仍保持:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
|
||||||
|
```
|
||||||
|
|||||||
@@ -4459,6 +4459,19 @@
|
|||||||
return checkedPath;
|
return checkedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generatedToolTablePath(wasmPath, expectedWasmPath) {
|
||||||
|
if (wasmPath !== expectedWasmPath) {
|
||||||
|
throw new Error(`browser_tool_table_fixture_${expectedWasmPath}: path drift`);
|
||||||
|
}
|
||||||
|
return wasmPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeGeneratedToolTableFixture(interp, wasmPath, expectedWasmPath, text) {
|
||||||
|
const checkedPath = generatedToolTablePath(wasmPath, expectedWasmPath);
|
||||||
|
interp.writeTextFile(checkedPath, text);
|
||||||
|
return checkedPath;
|
||||||
|
}
|
||||||
|
|
||||||
async function loadSimMachineFiles(machineRel, iniFile, programFile = null) {
|
async function loadSimMachineFiles(machineRel, iniFile, programFile = null) {
|
||||||
const iniText = await fetchText(
|
const iniText = await fetchText(
|
||||||
`../../vendor/linuxcnc/configs/sim/${machineRel}/${iniFile}`,
|
`../../vendor/linuxcnc/configs/sim/${machineRel}/${iniFile}`,
|
||||||
@@ -8832,9 +8845,10 @@
|
|||||||
].join("\n"),
|
].join("\n"),
|
||||||
);
|
);
|
||||||
|
|
||||||
const browserToolTablePath = "/work/browser-direct-tool.tbl";
|
const browserToolTablePath = writeGeneratedToolTableFixture(
|
||||||
interp.writeTextFile(
|
interp,
|
||||||
browserToolTablePath,
|
"/work/browser-direct-tool.tbl",
|
||||||
|
"/work/browser-direct-tool.tbl",
|
||||||
[
|
[
|
||||||
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser direct finish tool",
|
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser direct finish tool",
|
||||||
"T5 P9 X1 Y2 Z3 ;browser direct rough tool",
|
"T5 P9 X1 Y2 Z3 ;browser direct rough tool",
|
||||||
@@ -8888,9 +8902,10 @@
|
|||||||
].join("\n"),
|
].join("\n"),
|
||||||
);
|
);
|
||||||
|
|
||||||
const browserRandomToolTablePath = "/work/browser-direct-random-tool.tbl";
|
const browserRandomToolTablePath = writeGeneratedToolTableFixture(
|
||||||
interp.writeTextFile(
|
interp,
|
||||||
browserRandomToolTablePath,
|
"/work/browser-direct-random-tool.tbl",
|
||||||
|
"/work/browser-direct-random-tool.tbl",
|
||||||
[
|
[
|
||||||
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser direct random finish tool",
|
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser direct random finish tool",
|
||||||
"T5 P9 X1 Y2 Z3 ;browser direct random rough tool",
|
"T5 P9 X1 Y2 Z3 ;browser direct random rough tool",
|
||||||
|
|||||||
@@ -219,6 +219,17 @@ function writeGeneratedParameterFixture(wasmPath, expectedWasmPath, text, target
|
|||||||
return checkedPath;
|
return checkedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generatedToolTablePath(wasmPath, expectedWasmPath) {
|
||||||
|
assert.equal(wasmPath, expectedWasmPath, `tool table fixture ${expectedWasmPath} staging path drift`);
|
||||||
|
return wasmPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeGeneratedToolTableFixture(wasmPath, expectedWasmPath, text, targetInterp = interp) {
|
||||||
|
const checkedPath = generatedToolTablePath(wasmPath, expectedWasmPath);
|
||||||
|
targetInterp.writeTextFile(checkedPath, text);
|
||||||
|
return checkedPath;
|
||||||
|
}
|
||||||
|
|
||||||
function stageInterpIniContext(name, programFile = "test.ngc") {
|
function stageInterpIniContext(name, programFile = "test.ngc") {
|
||||||
const sourceRootRel = `tests/interp/${name}`;
|
const sourceRootRel = `tests/interp/${name}`;
|
||||||
const iniText = readFileSync(
|
const iniText = readFileSync(
|
||||||
@@ -3795,9 +3806,9 @@ assert.equal(savedParameterFile.includes("5399\t66.600000"), true);
|
|||||||
assert.equal(savedParameterFile.includes("_named_param"), false);
|
assert.equal(savedParameterFile.includes("_named_param"), false);
|
||||||
assert.equal(backupParameterFile.includes("5161 10.5"), true);
|
assert.equal(backupParameterFile.includes("5161 10.5"), true);
|
||||||
|
|
||||||
const toolTablePath = "/work/tool.tbl";
|
const toolTablePath = writeGeneratedToolTableFixture(
|
||||||
interp.writeTextFile(
|
"/work/tool.tbl",
|
||||||
toolTablePath,
|
"/work/tool.tbl",
|
||||||
[
|
[
|
||||||
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;finish tool",
|
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;finish tool",
|
||||||
"T5 P9 X1 Y2 Z3 ;rough tool",
|
"T5 P9 X1 Y2 Z3 ;rough tool",
|
||||||
@@ -3848,9 +3859,9 @@ assert.equal(savedToolTable.includes("T5"), true);
|
|||||||
assert.equal(savedToolTable.includes("P9"), true);
|
assert.equal(savedToolTable.includes("P9"), true);
|
||||||
assert.equal(savedToolTable.includes(";rough tool"), true);
|
assert.equal(savedToolTable.includes(";rough tool"), true);
|
||||||
|
|
||||||
const randomToolTablePath = "/work/random-tool.tbl";
|
const randomToolTablePath = writeGeneratedToolTableFixture(
|
||||||
interp.writeTextFile(
|
"/work/random-tool.tbl",
|
||||||
randomToolTablePath,
|
"/work/random-tool.tbl",
|
||||||
[
|
[
|
||||||
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;random finish tool",
|
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;random finish tool",
|
||||||
"T5 P9 X1 Y2 Z3 ;random rough tool",
|
"T5 P9 X1 Y2 Z3 ;random rough tool",
|
||||||
|
|||||||
Reference in New Issue
Block a user